Fixed issues with client

This commit is contained in:
Kasper Rynning-Tønnesen
2018-04-06 16:51:04 +02:00
parent 1d9b3a42b1
commit 435fb23fd3
7 changed files with 40 additions and 26 deletions

View File

@@ -1786,12 +1786,16 @@ margin-right: 52%;
.nav-btn .nav-btn
{ {
transition: background-color .2s; transition: background-color .2s;
min-width: 64px; min-width: 50px;
float:right; float:right;
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.settings-hamburger {
min-width: 50px;
}
.nav-btn:hover{background-color:rgba(0,0,0,0.6);} .nav-btn:hover{background-color:rgba(0,0,0,0.6);}
.hover-text{display:none;} .hover-text{display:none;}
.nav-btn:hover > .hover-text { .nav-btn:hover > .hover-text {
@@ -3171,7 +3175,7 @@ nav ul li:hover, nav ul li.active {
.control-list{ .control-list{
position: absolute !important; position: absolute !important;
width: 120px; /*width: 120px;*/
} }
.client-control-list { .client-control-list {
@@ -3223,7 +3227,7 @@ nav ul li:hover, nav ul li.active {
.chan { .chan {
text-shadow: 0px 0px 0px rgba(0, 0, 0, 0.42); text-shadow: 0px 0px 0px rgba(0, 0, 0, 0.42);
width: calc(100vw - 170px) !important; width: calc(100vw - 170px) !important;
max-width: 100%; max-width: calc(100% - 87.5px - 130px);
font-size: 2rem; font-size: 2rem;
padding-right:0px; padding-right:0px;
overflow: hidden; overflow: hidden;
@@ -3233,6 +3237,10 @@ nav ul li:hover, nav ul li.active {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.chan-client {
max-width: calc(100% - 87.5px - 170px);
}
.control-list li a{ min-width: 0px; width: 37px; padding: 0 0 0 0px;} .control-list li a{ min-width: 0px; width: 37px; padding: 0 0 0 0px;}
nav .zbrand{ nav .zbrand{

View File

@@ -5,7 +5,7 @@ var Channel = {
$("#wrapper").removeClass("tabs_height"); $("#wrapper").removeClass("tabs_height");
$("#wrapper").addClass("client-wrapper"); $("#wrapper").addClass("client-wrapper");
//$(".embed-button-footer").addClass("hide"); //$(".embed-button-footer").addClass("hide");
$(".skip_next_client").removeClass("hide"); //$(".skip_next_client").removeClass("hide");
if(!Helper.mobilecheck()) { if(!Helper.mobilecheck()) {
$(".skip_next_client").tooltip({ $(".skip_next_client").tooltip({
delay: 5, delay: 5,
@@ -13,6 +13,7 @@ var Channel = {
html: "Skip" html: "Skip"
}); });
} }
$("#chan").addClass("chan-client");
$("#results").addClass("client-results-height"); $("#results").addClass("client-results-height");
$(".pagination-results").addClass("client-pagination-height"); $(".pagination-results").addClass("client-pagination-height");
$(".control-list").addClass("client-control-list"); $(".control-list").addClass("client-control-list");
@@ -177,11 +178,13 @@ var Channel = {
} }
if(!Helper.mobilecheck()) { if(!Helper.mobilecheck()) {
$("#chan").tooltip({ if(!client) {
delay: 5, $("#chan").tooltip({
position: "bottom", delay: 5,
html: "Show join URL", position: "bottom",
}); html: "Show join URL",
});
}
$("#viewers").tooltip({ $("#viewers").tooltip({
delay: 5, delay: 5,
@@ -510,7 +513,6 @@ var Channel = {
$("#embed-button").css("display", "none"); $("#embed-button").css("display", "none");
if(!Helper.mobilecheck()) { if(!Helper.mobilecheck()) {
$("#chan").tooltip("destroy");
$('.castButton').tooltip("destroy"); $('.castButton').tooltip("destroy");
$("#viewers").tooltip("destroy"); $("#viewers").tooltip("destroy");
//$('.castButton-unactive').tooltip("destroy"); //$('.castButton-unactive').tooltip("destroy");
@@ -528,11 +530,14 @@ var Channel = {
} }
$("#seekToDuration").remove(); $("#seekToDuration").remove();
$(".sidenav").sidenav("destroy"); $(".sidenav").sidenav("destroy");
if(M.TapTarget.getInstance($(".tap-target"))) { if(!client) {
$('.tap-target').tapTarget('close'); $("#chan").tooltip("destroy");
} if(M.TapTarget.getInstance($(".tap-target"))) {
if(M.TapTarget.getInstance($(".tap-target-join"))) { $('.tap-target').tapTarget('close');
$('.tap-target-join').tapTarget('close'); }
if(M.TapTarget.getInstance($(".tap-target-join"))) {
$('.tap-target-join').tapTarget('close');
}
} }
clearTimeout(tap_target_timeout); clearTimeout(tap_target_timeout);
before_toast(); before_toast();

View File

@@ -425,6 +425,7 @@ function get_list_listener(){
} }
function setup_suggested_listener(){ function setup_suggested_listener(){
if(client) return;
socket.on("suggested", function(params){ socket.on("suggested", function(params){
var single = true; var single = true;
if(params.id === undefined) if(params.id === undefined)

View File

@@ -148,7 +148,7 @@ window.zoff = {
disable_debug: disable_debug disable_debug: disable_debug
} }
if(!Helper.mobilecheck() && window.location.host != "localhost") { if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.location.host != "client.localhost")) {
window.onerror = function(e, source, lineno, colno, error) { window.onerror = function(e, source, lineno, colno, error) {
if(e == "Script error.") return true; if(e == "Script error.") return true;
Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source}); Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source});

View File

@@ -5,10 +5,9 @@
</div> </div>
<main class="container center-align main"> <main class="container center-align main">
<div id="main-row" class="row"> <div id="main-row" class="row">
{{#if client}} {{#unless client}}
{{else}}
{{> channel/players}} {{> channel/players}}
{{/if}} {{/unless}}
{{> channel/tabs}} {{> channel/tabs}}
</div> </div>
</main> </main>

View File

@@ -37,11 +37,13 @@
<i class="material-icons">search</i> <i class="material-icons">search</i>
</div> </div>
</li> </li>
<li class="skip_next_client hide"> {{#if client}}
<div class="nav-btn skip"> <li class="skip_next_client">
<i class="material-icons">skip_next</i> <div class="nav-btn skip">
</div> <i class="material-icons">skip_next</i>
</li> </div>
</li>
{{/if}}
<li class="shuffle-btn-container"> <li class="shuffle-btn-container">
<div class="nav-btn" id="shuffle"> <div class="nav-btn" id="shuffle">
<i class="material-icons">shuffle</i> <i class="material-icons">shuffle</i>

View File

@@ -188,10 +188,9 @@ function channel(req, res, next) {
embed: false, embed: false,
client:false, client:false,
} }
if(subdomain == "client") { if(subdomain[0] == "client") {
data.client = true; data.client = true;
} }
if(req.params.channel_name == "404") { if(req.params.channel_name == "404") {
res.status(404); res.status(404);
} }