mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed errors with turning of remote capabilities and listeners on adminsettings
This commit is contained in:
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -20,39 +20,39 @@ var Hostcontroller = {
|
||||
if(!began)
|
||||
{
|
||||
began = true;
|
||||
socket.on(id, function(arr)
|
||||
{
|
||||
setup_host_listener(id);
|
||||
}
|
||||
},
|
||||
|
||||
if(enabled){
|
||||
if(arr[0] == "volume"){
|
||||
$("#volume").slider("value", arr[1]);
|
||||
Player.ytplayer.setVolume(arr[1]);
|
||||
localStorage.setItem("volume", arr[1]);
|
||||
Playercontrols.choose_button(arr[1], false);
|
||||
}else if(arr[0] == "channel"){
|
||||
console.log("changing channel");
|
||||
socket.emit("change_channel");
|
||||
Admin.beginning = true;
|
||||
host_on_action: function(arr)
|
||||
{
|
||||
if(enabled){
|
||||
if(arr[0] == "volume"){
|
||||
$("#volume").slider("value", arr[1]);
|
||||
Player.ytplayer.setVolume(arr[1]);
|
||||
localStorage.setItem("volume", arr[1]);
|
||||
Playercontrols.choose_button(arr[1], false);
|
||||
}else if(arr[0] == "channel"){
|
||||
socket.emit("change_channel");
|
||||
Admin.beginning = true;
|
||||
|
||||
chan = arr[1].toLowerCase();
|
||||
$("#chan").html(Helper.upperFirst(chan));
|
||||
chan = arr[1].toLowerCase();
|
||||
$("#chan").html(Helper.upperFirst(chan));
|
||||
|
||||
w_p = true;
|
||||
socket.emit("list", chan.toLowerCase());
|
||||
w_p = true;
|
||||
socket.emit("list", chan.toLowerCase());
|
||||
|
||||
/*if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Crypt.get_pass(chan.toLowerCase()) != ""){
|
||||
socket.emit("password", [Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())), chan.toLowerCase()]);
|
||||
}*/
|
||||
/*if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Crypt.get_pass(chan.toLowerCase()) != ""){
|
||||
socket.emit("password", [Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())), chan.toLowerCase()]);
|
||||
}*/
|
||||
|
||||
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
||||
}else if(arr[0] == "pause")
|
||||
Player.ytplayer.pauseVideo()
|
||||
else if(arr[0] == "play")
|
||||
Player.ytplayer.playVideo();
|
||||
else if(arr[0] == "skip")
|
||||
List.skip();
|
||||
}
|
||||
});
|
||||
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
||||
}else if(arr[0] == "pause")
|
||||
Player.ytplayer.pauseVideo()
|
||||
else if(arr[0] == "play")
|
||||
Player.ytplayer.playVideo();
|
||||
else if(arr[0] == "skip")
|
||||
List.skip();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ function init(){
|
||||
Playercontrols.initSlider();
|
||||
Player.ytplayer.setVolume(Crypt.get_volume());
|
||||
$(".video-container").removeClass("no-opacity");
|
||||
|
||||
|
||||
var codeURL = "https://remote."+window.location.hostname+"/"+id;
|
||||
$("#code-text").text(id)
|
||||
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
|
||||
@@ -167,7 +167,7 @@ function init(){
|
||||
setup_admin_listener();
|
||||
setup_list_listener();
|
||||
setup_chat_listener();
|
||||
if(!Helper.mobilecheck() && $("#alreadychannel").length == 0) setup_host_listener();
|
||||
if(!Helper.mobilecheck() && $("#alreadychannel").length == 0) setup_host_initialization();
|
||||
|
||||
if(!Helper.msieversion()) Notification.requestPermission();
|
||||
|
||||
@@ -230,10 +230,14 @@ function setup_playlist_listener(){
|
||||
socket.on('playlists', Nochan.frontpage_function);
|
||||
}
|
||||
|
||||
function setup_host_listener(){
|
||||
function setup_host_initialization(){
|
||||
socket.on("id", Hostcontroller.host_listener);
|
||||
}
|
||||
|
||||
function setup_host_listener(id){
|
||||
socket.on(id, Hostcontroller.host_on_action);
|
||||
}
|
||||
|
||||
$(document).keyup(function(e) {
|
||||
if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
@@ -308,13 +312,13 @@ $(document).on("submit", "#base", function(e){
|
||||
});
|
||||
|
||||
|
||||
$('input[class=remote_switch_class]').change(function()
|
||||
$(document).on("change", 'input[class=remote_switch_class]', function()
|
||||
{
|
||||
enabled = document.getElementsByName("remote_switch")[0].checked;
|
||||
Crypt.set_remote(enabled);
|
||||
Hostcontroller.change_enabled(document.getElementsByName("remote_switch")[0].checked);
|
||||
Crypt.set_remote(enabled);
|
||||
});
|
||||
|
||||
$('input[class=conf]').change(function()
|
||||
$(document).on("change", 'input[class=conf]', function()
|
||||
{
|
||||
Admin.save();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user