mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
fixed bug settings were 'enabled' when not logged in after changing channels remotely
This commit is contained in:
2
static/dist/main-min.js
vendored
2
static/dist/main-min.js
vendored
File diff suppressed because one or more lines are too long
@@ -17,6 +17,7 @@ var Admin = {
|
|||||||
localStorage.removeItem(chan.toLowerCase());
|
localStorage.removeItem(chan.toLowerCase());
|
||||||
}
|
}
|
||||||
Admin.display_logged_out();
|
Admin.display_logged_out();
|
||||||
|
w_p = true;
|
||||||
break;
|
break;
|
||||||
case "shuffled":
|
case "shuffled":
|
||||||
msg=Helper.rnd(["♫ You stir me right round, baby. ♫","♫ Stir, stir, stir my boat ♫","I vigorously stirred your playlist!", "I hope you like your list stirred, not shaken.", "I shuffled your playlist with the cosmic background radiation as a seed. Enjoy.", "100% randomized, for your listening pleasure!", "I hope you enjoy your fresh playlist!"])
|
msg=Helper.rnd(["♫ You stir me right round, baby. ♫","♫ Stir, stir, stir my boat ♫","I vigorously stirred your playlist!", "I hope you like your list stirred, not shaken.", "I shuffled your playlist with the cosmic background radiation as a seed. Enjoy.", "100% randomized, for your listening pleasure!", "I hope you enjoy your fresh playlist!"])
|
||||||
@@ -76,7 +77,7 @@ var Admin = {
|
|||||||
|
|
||||||
socket.on("conf", function(msg)
|
socket.on("conf", function(msg)
|
||||||
{
|
{
|
||||||
List.set_conf(msg[0]);
|
Admin.set_conf(msg[0]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -120,6 +121,27 @@ var Admin = {
|
|||||||
Admin.submitAdmin(document.getElementById("adminForm").elements);
|
Admin.submitAdmin(document.getElementById("adminForm").elements);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_conf: function(conf_array)
|
||||||
|
{
|
||||||
|
if(conf_array['adminpass'] == "" || !w_p) hasadmin = false;
|
||||||
|
else hasadmin = true;
|
||||||
|
music = conf_array["allvideos"];
|
||||||
|
longsongs = conf_array["longsongs"];
|
||||||
|
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
||||||
|
for (var i = 0; i < names.length; i++) {
|
||||||
|
document.getElementsByName(names[i])[0].checked = (conf_array[names[i]] === true);
|
||||||
|
$("input[name="+names[i]+"]").attr("disabled", hasadmin);
|
||||||
|
}
|
||||||
|
if(hasadmin && !localStorage[chan.toLowerCase()])
|
||||||
|
{
|
||||||
|
$("#password").attr("placeholder", "Enter channel password");
|
||||||
|
Admin.display_logged_out();
|
||||||
|
}else if(!hasadmin && !localStorage[chan.toLowerCase()])
|
||||||
|
$("#password").attr("placeholder", "Enter channel password");
|
||||||
|
else
|
||||||
|
$("#password").attr("placeholder", "Change channel password");
|
||||||
|
},
|
||||||
|
|
||||||
submitAdmin: function(form)
|
submitAdmin: function(form)
|
||||||
{
|
{
|
||||||
voting = form.vote.checked;
|
voting = form.vote.checked;
|
||||||
|
|||||||
@@ -35,8 +35,18 @@ var Hostcontroller = {
|
|||||||
chan = arr[1].toLowerCase();
|
chan = arr[1].toLowerCase();
|
||||||
$("#chan").html(chan.substring(0,1).toUpperCase()+chan.substring(1).toLowerCase());
|
$("#chan").html(chan.substring(0,1).toUpperCase()+chan.substring(1).toLowerCase());
|
||||||
|
|
||||||
|
w_p = true;
|
||||||
socket.emit("list", chan.toLowerCase());
|
socket.emit("list", chan.toLowerCase());
|
||||||
|
|
||||||
|
if(localStorage[chan.toLowerCase()])
|
||||||
|
{
|
||||||
|
//localStorage.removeItem(chan.toLowerCase());
|
||||||
|
if(localStorage[chan.toLowerCase()].length != 64)
|
||||||
|
localStorage.removeItem(chan.toLowerCase());
|
||||||
|
else
|
||||||
|
socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase()]);
|
||||||
|
}
|
||||||
|
|
||||||
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
||||||
}else if(arr[0] == "pause")
|
}else if(arr[0] == "pause")
|
||||||
ytplayer.pauseVideo()
|
ytplayer.pauseVideo()
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ var List = {
|
|||||||
name: 'votes',
|
name: 'votes',
|
||||||
reverse: true
|
reverse: true
|
||||||
}, 'added'));
|
}, 'added'));
|
||||||
List.set_conf(conf);
|
Admin.set_conf(conf);
|
||||||
List.populate_list(full_playlist);
|
List.populate_list(full_playlist);
|
||||||
}else if(msg[0] == "added")
|
}else if(msg[0] == "added")
|
||||||
{
|
{
|
||||||
@@ -85,20 +85,6 @@ var List = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
set_conf: function(conf_array)
|
|
||||||
{
|
|
||||||
if(conf_array['adminpass'] == "" || w_p === false) hasadmin = false;
|
|
||||||
else hasadmin = true;
|
|
||||||
music = conf_array["allvideos"];
|
|
||||||
longsongs = conf_array["longsongs"];
|
|
||||||
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
|
||||||
document.getElementsByName(names[i])[0].checked = (conf_array[names[i]] === true);
|
|
||||||
if(hasadmin)
|
|
||||||
$("input[name="+names[i]+"]").attr("disabled", true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
populate_list: function(msg)
|
populate_list: function(msg)
|
||||||
{
|
{
|
||||||
$("#wrapper").empty();
|
$("#wrapper").empty();
|
||||||
|
|||||||
Reference in New Issue
Block a user