mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 21:41:00 +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,9 +20,12 @@ var Hostcontroller = {
|
||||
if(!began)
|
||||
{
|
||||
began = true;
|
||||
socket.on(id, function(arr)
|
||||
{
|
||||
setup_host_listener(id);
|
||||
}
|
||||
},
|
||||
|
||||
host_on_action: function(arr)
|
||||
{
|
||||
if(enabled){
|
||||
if(arr[0] == "volume"){
|
||||
$("#volume").slider("value", arr[1]);
|
||||
@@ -30,7 +33,6 @@ var Hostcontroller = {
|
||||
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;
|
||||
|
||||
@@ -52,8 +54,6 @@ var Hostcontroller = {
|
||||
else if(arr[0] == "skip")
|
||||
List.skip();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
change_enabled:function(val){
|
||||
|
||||
@@ -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;
|
||||
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