Embedded is now also ajour

This commit is contained in:
Kasper Rynning-Tønnesen
2017-05-16 17:26:22 +02:00
parent 7e83116a61
commit 0ffe14cbdf
8 changed files with 16 additions and 10 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -72,7 +72,7 @@ var Admin = {
msg="Skipping is disabled the first 10 seconds."; msg="Skipping is disabled the first 10 seconds.";
break; break;
case "correctpass": case "correctpass":
adminpass = Crypt.get_pass(chan.toLowerCase()) == undefined ? Crypt.crypt_pass(Crypt.tmp_pass) : Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())); adminpass = Crypt.get_pass(chan.toLowerCase()) == undefined ? Crypt.tmp_pass : Crypt.get_pass(chan.toLowerCase());
msg="Correct password. You now have access to the sacred realm of The Admin."; msg="Correct password. You now have access to the sacred realm of The Admin.";
$("#thumbnail_form").css("display", "inline-block"); $("#thumbnail_form").css("display", "inline-block");
$("#description_form").css("display", "inline-block"); $("#description_form").css("display", "inline-block");
@@ -310,7 +310,7 @@ var Admin = {
frontpage: frontpage, frontpage: frontpage,
allvideos: allvideos, allvideos: allvideos,
removeplay: removeplay, removeplay: removeplay,
adminpass: adminpass, adminpass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass),
skipping: skipping, skipping: skipping,
shuffling: shuffling, shuffling: shuffling,
userpass: Crypt.crypt_pass(pass_send), userpass: Crypt.crypt_pass(pass_send),
@@ -328,7 +328,7 @@ var Admin = {
shuffle: function() shuffle: function()
{ {
if(!offline){ if(!offline){
socket.emit('shuffle', {adminpass: adminpass !== undefined ? adminpass : "", channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit('shuffle', {adminpass: adminpass !== undefined ? Crypt.crypt_pass(adminpass) : "", channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
} else { } else {
for(var x = 0; x < full_playlist.length; x++){ for(var x = 0; x < full_playlist.length; x++){
var num = Math.floor(Math.random()*1000000); var num = Math.floor(Math.random()*1000000);
+6
View File
@@ -32,6 +32,12 @@ var connection_options = {
'force new connection': true 'force new connection': true
}; };
var Crypt = {
crypt_pass: function(pass) {
return pass;
}
};
$(document).ready(function(){ $(document).ready(function(){
if(hash.length == 3 && hash[2] == "autoplay"){ if(hash.length == 3 && hash[2] == "autoplay"){
+2 -2
View File
@@ -443,7 +443,7 @@ var List = {
vote: function(id, vote){ vote: function(id, vote){
if(!offline || (vote == "del" && (hasadmin && (!w_p && adminpass != "")))){ if(!offline || (vote == "del" && (hasadmin && (!w_p && adminpass != "")))){
socket.emit('vote', {channel: chan, id: id, type: vote, adminpass: adminpass, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit('vote', {channel: chan, id: id, type: vote, adminpass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
} else { } else {
if(vote == "pos"){ if(vote == "pos"){
List.voted_song(id, (new Date()).getTime()/1000); List.voted_song(id, (new Date()).getTime()/1000);
@@ -456,7 +456,7 @@ var List = {
skip: function(){ skip: function(){
if(!offline){ if(!offline){
socket.emit('skip', {pass: adminpass, id:video_id, channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit('skip', {pass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), id:video_id, channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
} else { } else {
Player.playNext(); Player.playNext();
} }
+1 -1
View File
@@ -502,7 +502,7 @@ function chromecastListener(evt, data){
if(offline){ if(offline){
Player.playNext(); Player.playNext();
} else { } else {
socket.emit("skip", {error: json_parsed.data_code, id: json_parsed.videoId, pass: adminpass, channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit("skip", {error: json_parsed.data_code, id: json_parsed.videoId, pass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
} }
break; break;
} }
+1 -1
View File
@@ -319,7 +319,7 @@ var Player = {
if(!user_auth_started) { if(!user_auth_started) {
if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150) { if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150) {
curr_playing = Player.player.getVideoUrl().replace("https://www.youtube.com/watch?v=", ""); curr_playing = Player.player.getVideoUrl().replace("https://www.youtube.com/watch?v=", "");
socket.emit("skip", {error: newState.data, id: video_id, pass: adminpass, channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit("skip", {error: newState.data, id: video_id, pass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
} else if(video_id !== undefined) { } else if(video_id !== undefined) {
Player.loadVideoById(video_id); Player.loadVideoById(video_id);
+1 -1
View File
@@ -386,7 +386,7 @@ var Search = {
List.vote(id, "pos"); List.vote(id, "pos");
} }
} else { } else {
socket.emit("add", {id: id, title: decodeURIComponent(title), adminpass: adminpass, list: chan.toLowerCase(), duration: duration, playlist: playlist, num: num, total: full_num, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))}); socket.emit("add", {id: id, title: decodeURIComponent(title), adminpass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), list: chan.toLowerCase(), duration: duration, playlist: playlist, num: num, total: full_num, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
}//[id, decodeURIComponent(title), adminpass, duration, playlist]); }//[id, decodeURIComponent(title), adminpass, duration, playlist]);
}, },