mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed a lot of indentations
This commit is contained in:
2
server/public/assets/dist/callback.min.js
vendored
2
server/public/assets/dist/callback.min.js
vendored
@@ -1 +1 @@
|
|||||||
!function(){function e(e){var t,a=e.substring(1).split("&"),n={};for(var i in a)t=a[i].split("="),2==t.length&&(n[t[0]]=t[1]);return n}window.addEventListener("load",function(){var t,a,n,i=e(window.location.hash),o=window.location.protocol+"//"+window.location.hostname+"/o_callback";if(i.spotify)t="b934ecdd173648f5bcd38738af529d58",a="token",n="playlist-read-private playlist-read-collaborative user-read-private playlist-modify-public",state=i.nonce,window.location.href="https://accounts.spotify.com/authorize?client_id="+t+"&scope="+n+"&show_dialog=false&response_type="+a+"&redirect_uri="+o+"&state="+state;else if(i.youtube)t="944988770273-butsmlr1aotlsskk8lmgvh0etqqekigf.apps.googleusercontent.com",a="token",n="https://www.googleapis.com/auth/youtube",state=i.nonce,window.location.href="https://accounts.google.com/o/oauth2/v2/auth?client_id="+t+"&response_type="+a+"&state="+state+"&redirect_uri="+o+"&scope="+n;else{var s=e(window.location.hash);window.opener.callback(s)}})}();
|
!function(){function e(e){var t,a=e.substring(1).split("&"),n={};for(var s in a)t=a[s].split("="),2==t.length&&(n[t[0]]=t[1]);return n}window.addEventListener("load",function(){var t,a,n,s=e(window.location.hash),i=window.location.protocol+"//"+window.location.hostname+"/o_callback";if(s.spotify)t="b934ecdd173648f5bcd38738af529d58",a="token",n="playlist-read-private playlist-read-collaborative user-read-private playlist-modify-public",state=s.nonce,window.location.href="https://accounts.spotify.com/authorize?client_id="+t+"&scope="+n+"&show_dialog=false&response_type="+a+"&redirect_uri="+i+"&state="+state;else if(s.youtube)t="944988770273-butsmlr1aotlsskk8lmgvh0etqqekigf.apps.googleusercontent.com",a="token",n="https://www.googleapis.com/auth/youtube",state=s.nonce,window.location.href="https://accounts.google.com/o/oauth2/v2/auth?client_id="+t+"&response_type="+a+"&state="+state+"&redirect_uri="+i+"&scope="+n;else{var o=e(window.location.hash);window.opener.callback(o)}})}();
|
||||||
@@ -124,14 +124,10 @@ var Admin = {
|
|||||||
if($(".password_protected").prop("checked")) {
|
if($(".password_protected").prop("checked")) {
|
||||||
$(".change_user_pass").removeClass("hide");
|
$(".change_user_pass").removeClass("hide");
|
||||||
}
|
}
|
||||||
//if(!Helper.mobilecheck()){
|
|
||||||
if(!Helper.contains($(".playlist-tabs").attr("class").split(" "), "hide")) {
|
if(!Helper.contains($(".playlist-tabs").attr("class").split(" "), "hide")) {
|
||||||
$(".playlist-tabs-loggedIn").removeClass("hide");
|
$(".playlist-tabs-loggedIn").removeClass("hide");
|
||||||
$(".playlist-tabs").addClass("hide");
|
$(".playlist-tabs").addClass("hide");
|
||||||
}
|
}
|
||||||
//$("#top-button").toggleClass("top-button-with-tabs");
|
|
||||||
//$("#wrapper").toggleClass("tabs_height");
|
|
||||||
//}
|
|
||||||
|
|
||||||
if($("#admin-lock").html() != "lock_open"){
|
if($("#admin-lock").html() != "lock_open"){
|
||||||
$("#admin-lock").addClass("clickable");
|
$("#admin-lock").addClass("clickable");
|
||||||
@@ -230,16 +226,13 @@ var Admin = {
|
|||||||
{
|
{
|
||||||
$('ul.playlist-tabs').tabs('select_tab', 'wrapper');
|
$('ul.playlist-tabs').tabs('select_tab', 'wrapper');
|
||||||
$('ul.playlist-tabs-loggedIn').tabs('select_tab', 'wrapper');
|
$('ul.playlist-tabs-loggedIn').tabs('select_tab', 'wrapper');
|
||||||
//$("#wrapper").removeClass("tabs_height");
|
|
||||||
} else {
|
} else {
|
||||||
$('ul.playlist-tabs').tabs('select_tab', $(".playlist-tabs-loggedIn li a.active").attr("href").substring(1));
|
$('ul.playlist-tabs').tabs('select_tab', $(".playlist-tabs-loggedIn li a.active").attr("href").substring(1));
|
||||||
}
|
}
|
||||||
$("#admin-lock").removeClass("clickable");
|
$("#admin-lock").removeClass("clickable");
|
||||||
$("#password").attr("placeholder", "Enter admin password");
|
$("#password").attr("placeholder", "Enter admin password");
|
||||||
//$("#top-button").removeClass("top-button-with-tabs");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//function used in html onlick
|
|
||||||
save: function(userpass){
|
save: function(userpass){
|
||||||
Admin.submitAdmin(document.getElementById("adminForm").elements, userpass);
|
Admin.submitAdmin(document.getElementById("adminForm").elements, userpass);
|
||||||
},
|
},
|
||||||
@@ -294,10 +287,6 @@ var Admin = {
|
|||||||
$("#description_area").html(conf_array.description);
|
$("#description_area").html(conf_array.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(conf_array.desc !== undefined)
|
|
||||||
{
|
|
||||||
document.getElementById("description").innerHTML = conf_array.desc;
|
|
||||||
}*/
|
|
||||||
},
|
},
|
||||||
|
|
||||||
submitAdmin: function(form, userpass_changed)
|
submitAdmin: function(form, userpass_changed)
|
||||||
|
|||||||
@@ -64,12 +64,13 @@ var Chat = {
|
|||||||
}
|
}
|
||||||
} else if(data.value.startsWith("/removename")){
|
} else if(data.value.startsWith("/removename")){
|
||||||
Chat.removename();
|
Chat.removename();
|
||||||
}
|
} else if($(".chat-tab-li a.active").attr("href") == "#all_chat"){
|
||||||
else if($(".chat-tab-li a.active").attr("href") == "#all_chat")
|
|
||||||
socket.emit("all,chat", data.value);
|
socket.emit("all,chat", data.value);
|
||||||
else
|
} else {
|
||||||
socket.emit("chat", {channel: chan.toLowerCase(), data: data.value, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
socket.emit("chat", {channel: chan.toLowerCase(), data: data.value, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
|
}
|
||||||
data.value = "";
|
data.value = "";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,6 @@ var frontpage = true;
|
|||||||
var socket;
|
var socket;
|
||||||
var rotation_timeout;
|
var rotation_timeout;
|
||||||
|
|
||||||
/*
|
|
||||||
function getCookie(cname) {
|
|
||||||
var name = cname + "=";
|
|
||||||
var ca = document.cookie.split(';');
|
|
||||||
for(var i=0; i<ca.length; i++) {
|
|
||||||
var c = ca[i];
|
|
||||||
while (c.charAt(0)==' ') c = c.substring(1);
|
|
||||||
if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
var Frontpage = {
|
var Frontpage = {
|
||||||
|
|
||||||
blob_list: [],
|
blob_list: [],
|
||||||
@@ -29,8 +16,7 @@ var Frontpage = {
|
|||||||
|
|
||||||
all_channels: [],
|
all_channels: [],
|
||||||
|
|
||||||
frontpage_function: function(msg)
|
frontpage_function: function(msg) {
|
||||||
{
|
|
||||||
frontpage = true;
|
frontpage = true;
|
||||||
|
|
||||||
Helper.log("-----------");
|
Helper.log("-----------");
|
||||||
@@ -63,9 +49,7 @@ var Frontpage = {
|
|||||||
}, {
|
}, {
|
||||||
name: 'count',
|
name: 'count',
|
||||||
reverse: true
|
reverse: true
|
||||||
}
|
}));
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
lists = lists.sort(Helper.predicate({
|
lists = lists.sort(Helper.predicate({
|
||||||
name: 'viewers',
|
name: 'viewers',
|
||||||
@@ -73,9 +57,7 @@ var Frontpage = {
|
|||||||
}, {
|
}, {
|
||||||
name: 'count',
|
name: 'count',
|
||||||
reverse: true
|
reverse: true
|
||||||
}
|
}));
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pinned !== undefined){
|
if(pinned !== undefined){
|
||||||
@@ -410,10 +392,6 @@ function initfp(){
|
|||||||
//Materialize.toast('<p id="aprilfools">We suck at pranks..<a class="waves-effect waves-light btn light-green" style="pointer-events:none;">Agreed</a></p>', 100000);
|
//Materialize.toast('<p id="aprilfools">We suck at pranks..<a class="waves-effect waves-light btn light-green" style="pointer-events:none;">Agreed</a></p>', 100000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(window.location.hostname != "zoff.me"){
|
|
||||||
console.log("not zoff.me, redirecting"); //redirect
|
|
||||||
window.location.href = "https://zoff.me";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
window.onpopstate = function(e){
|
window.onpopstate = function(e){
|
||||||
var url_split = window.location.href.split("/");
|
var url_split = window.location.href.split("/");
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ var Hostcontroller = {
|
|||||||
host_listener: function(id) {
|
host_listener: function(id) {
|
||||||
|
|
||||||
if(Hostcontroller.old_id === null) Hostcontroller.old_id = id;
|
if(Hostcontroller.old_id === null) Hostcontroller.old_id = id;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
socket.removeAllListeners(id);
|
socket.removeAllListeners(id);
|
||||||
began = false;
|
began = false;
|
||||||
Hostcontroller.old_id = id;
|
Hostcontroller.old_id = id;
|
||||||
@@ -17,8 +16,7 @@ var Hostcontroller = {
|
|||||||
$("#code-text").text(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);
|
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
|
||||||
$("#code-link").attr("href", codeURL);
|
$("#code-link").attr("href", codeURL);
|
||||||
if(!began)
|
if(!began) {
|
||||||
{
|
|
||||||
began = true;
|
began = true;
|
||||||
setup_host_listener(id);
|
setup_host_listener(id);
|
||||||
}
|
}
|
||||||
@@ -27,12 +25,12 @@ var Hostcontroller = {
|
|||||||
host_on_action: function(arr)
|
host_on_action: function(arr)
|
||||||
{
|
{
|
||||||
if(enabled){
|
if(enabled){
|
||||||
if(arr.type == "volume"){
|
if(arr.type == "volume") {
|
||||||
$("#volume").slider("value", arr.value);
|
$("#volume").slider("value", arr.value);
|
||||||
Player.player.setVolume(arr.value);
|
Player.player.setVolume(arr.value);
|
||||||
localStorage.setItem("volume", arr.value);
|
localStorage.setItem("volume", arr.value);
|
||||||
Playercontrols.choose_button(arr.value, false);
|
Playercontrols.choose_button(arr.value, false);
|
||||||
}else if(arr.type == "channel"){
|
} else if(arr.type == "channel") {
|
||||||
socket.emit("change_channel");
|
socket.emit("change_channel");
|
||||||
Admin.beginning = true;
|
Admin.beginning = true;
|
||||||
|
|
||||||
@@ -44,16 +42,12 @@ var Hostcontroller = {
|
|||||||
if(private_channel) add = Crypt.getCookie("_uI") + "_";
|
if(private_channel) add = Crypt.getCookie("_uI") + "_";
|
||||||
socket.emit("list", {channel: add + chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
socket.emit("list", {channel: add + chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
|
|
||||||
/*if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Crypt.get_pass(chan.toLowerCase()) != ""){
|
|
||||||
socket.emit("password", {password: Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())), channel: chan.toLowerCase()});
|
|
||||||
}*/
|
|
||||||
|
|
||||||
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
||||||
}else if(arr.type == "pause")
|
} else if(arr.type == "pause") {
|
||||||
Player.pauseVideo();
|
Player.pauseVideo();
|
||||||
else if(arr.type == "play")
|
} else if(arr.type == "play") {
|
||||||
Player.playVideo();
|
Player.playVideo();
|
||||||
else if(arr.type == "skip")
|
} else if(arr.type == "skip") {
|
||||||
List.skip();
|
List.skip();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -62,4 +56,4 @@ var Hostcontroller = {
|
|||||||
enabled = val;
|
enabled = val;
|
||||||
document.getElementsByName("remote_switch")[0].checked = enabled;
|
document.getElementsByName("remote_switch")[0].checked = enabled;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,12 +137,7 @@ var List = {
|
|||||||
$(".first_page").css("display", "none");
|
$(".first_page").css("display", "none");
|
||||||
$(".next_page_hide").css("display","none");
|
$(".next_page_hide").css("display","none");
|
||||||
$(".last_page_hide").css("display","none");
|
$(".last_page_hide").css("display","none");
|
||||||
/*if($(".next_page").hasClass("hide")){
|
|
||||||
$(".next_page").removeClass("hide");
|
|
||||||
}
|
|
||||||
if($(".last_page").hasClass("hide")){
|
|
||||||
$(".last_page").removeClass("hide");
|
|
||||||
}*/
|
|
||||||
} else if(!$("#pageButtons").length){
|
} else if(!$("#pageButtons").length){
|
||||||
$('<div id="pageButtons"><span class="first_page_hide btn-flat"><i class="material-icons">first_page</i></span><a class="first_page waves-effect waves-light btn-flat"><i class="material-icons">first_page</i></a><span class="prev_page_hide btn-flat"><i class="material-icons">navigate_before</i> prev</span><a class="prev_page waves-effect waves-light btn-flat"><i class="material-icons">navigate_before</i> prev</a> <span id="pageNumber">1</span> <a class="next_page waves-effect waves-light btn-flat">next <i class="material-icons">navigate_next</i></a><span class="next_page_hide btn-flat">next <i class="material-icons">navigate_next</i></span><a class="last_page waves-effect waves-light btn-flat"><i class="material-icons">last_page</i></a><span class="last_page_hide btn-flat"><i class="material-icons">last_page</i></span></div>').insertAfter("#wrapper");
|
$('<div id="pageButtons"><span class="first_page_hide btn-flat"><i class="material-icons">first_page</i></span><a class="first_page waves-effect waves-light btn-flat"><i class="material-icons">first_page</i></a><span class="prev_page_hide btn-flat"><i class="material-icons">navigate_before</i> prev</span><a class="prev_page waves-effect waves-light btn-flat"><i class="material-icons">navigate_before</i> prev</a> <span id="pageNumber">1</span> <a class="next_page waves-effect waves-light btn-flat">next <i class="material-icons">navigate_next</i></a><span class="next_page_hide btn-flat">next <i class="material-icons">navigate_next</i></span><a class="last_page waves-effect waves-light btn-flat"><i class="material-icons">last_page</i></a><span class="last_page_hide btn-flat"><i class="material-icons">last_page</i></span></div>').insertAfter("#wrapper");
|
||||||
$(".prev_page").css("display", "none");
|
$(".prev_page").css("display", "none");
|
||||||
@@ -155,16 +150,8 @@ var List = {
|
|||||||
|
|
||||||
List.dynamicContentPage(-10);
|
List.dynamicContentPage(-10);
|
||||||
|
|
||||||
/*if(lazy_load){
|
|
||||||
if(Helper.mobilecheck()) $(".list-image").lazyload({});
|
|
||||||
else{
|
|
||||||
$(".list-image").lazyload({container: $("#wrapper")}).removeClass("lazy");
|
|
||||||
|
|
||||||
document.getElementById('wrapper').scrollTop += 1;
|
} else{
|
||||||
document.getElementById('wrapper').scrollTop += -1;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}else{
|
|
||||||
List.empty = true;
|
List.empty = true;
|
||||||
$("#wrapper").html("<span id='empty-channel-message'>The playlist is empty.</span>");
|
$("#wrapper").html("<span id='empty-channel-message'>The playlist is empty.</span>");
|
||||||
if(!$("#pageButtons").length){
|
if(!$("#pageButtons").length){
|
||||||
@@ -370,17 +357,7 @@ var List = {
|
|||||||
{
|
{
|
||||||
if(!removed) $("#"+deleted).remove();
|
if(!removed) $("#"+deleted).remove();
|
||||||
full_playlist.splice(List.getIndexOfSong(deleted), 1);
|
full_playlist.splice(List.getIndexOfSong(deleted), 1);
|
||||||
/*if(index < List.page && $("#wrapper").children().length - (List.page + 1) >= 0){
|
|
||||||
$($("#wrapper").children()[List.page - 1]).css("display", "block");
|
|
||||||
} else if($("#wrapper").children().length > List.page + (List.can_fit-1)){
|
|
||||||
$($("#wrapper").children()[List.page + (List.can_fit - 1)]).css("display", "block");
|
|
||||||
}
|
|
||||||
if(List.page >= $("#wrapper").children().length){
|
|
||||||
List.dynamicContentPage(-1);
|
|
||||||
} else if(List.page + List.can_fit >= $("#wrapper").children().length){
|
|
||||||
$(".next_page_hide").css("display", "flex");
|
|
||||||
$(".next_page").css("display", "none");
|
|
||||||
}*/
|
|
||||||
if(chromecastAvailable){
|
if(chromecastAvailable){
|
||||||
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
|
||||||
}
|
}
|
||||||
@@ -452,13 +429,9 @@ var List = {
|
|||||||
Helper.log(full_playlist[0]);
|
Helper.log(full_playlist[0]);
|
||||||
Helper.log("---------------------------");
|
Helper.log("---------------------------");
|
||||||
full_playlist.push(full_playlist.shift());
|
full_playlist.push(full_playlist.shift());
|
||||||
//if(!List.empty)
|
|
||||||
if(!remove){
|
if(!remove){
|
||||||
List.insertAtIndex(full_playlist[length-1], false, true);
|
List.insertAtIndex(full_playlist[length-1], false, true);
|
||||||
}
|
}
|
||||||
/*if($("#wrapper").children().length >= List.page + List.can_fit){
|
|
||||||
$($("#wrapper").children()[List.page + List.can_fit - 1]).css("display", "block");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}catch(e){}
|
}catch(e){}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ try{
|
|||||||
}/*
|
}/*
|
||||||
navigator.serviceWorker.getRegistration('/').then(function(registration) {
|
navigator.serviceWorker.getRegistration('/').then(function(registration) {
|
||||||
registration.unregister();
|
registration.unregister();
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
@@ -133,7 +133,8 @@ $().ready(function(){
|
|||||||
setup_no_connection_listener();
|
setup_no_connection_listener();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
git_info = $.ajax({ type: "GET",
|
git_info = $.ajax({
|
||||||
|
type: "GET",
|
||||||
url: "https://api.github.com/users/zoff-music/received_events",
|
url: "https://api.github.com/users/zoff-music/received_events",
|
||||||
async: false
|
async: false
|
||||||
}).responseText;
|
}).responseText;
|
||||||
@@ -173,12 +174,12 @@ function init(){
|
|||||||
$('ul.playlist-tabs-loggedIn').tabs();
|
$('ul.playlist-tabs-loggedIn').tabs();
|
||||||
$('ul.chatTabs').tabs();
|
$('ul.chatTabs').tabs();
|
||||||
$("#settings").sideNav({
|
$("#settings").sideNav({
|
||||||
menuWidth: 310, // Default is 240
|
menuWidth: 310,
|
||||||
edge: side, // Choose the horizontal origin
|
edge: side,
|
||||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
closeOnClick: false
|
||||||
});
|
});
|
||||||
$('.collapsible').collapsible({
|
$('.collapsible').collapsible({
|
||||||
accordion : true // A setting that changes the collapsible behavior to expandable instead of the default accordion style
|
accordion : true
|
||||||
});
|
});
|
||||||
$("#help").modal();
|
$("#help").modal();
|
||||||
$("#contact").modal();
|
$("#contact").modal();
|
||||||
@@ -260,11 +261,7 @@ function init(){
|
|||||||
tooltip: "Viewers"
|
tooltip: "Viewers"
|
||||||
});
|
});
|
||||||
|
|
||||||
//if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
|
||||||
/*if(!Helper.mobilecheck() && !window.MSStream){
|
|
||||||
document.getElementById("search").blur();
|
|
||||||
$("#channel-load").css("display", "none");
|
|
||||||
} else {*/
|
|
||||||
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
window.onYouTubeIframeAPIReady = Player.onYouTubeIframeAPIReady;
|
||||||
if(Player.player === "" || Player.player === undefined || Helper.mobilecheck()) Player.loadPlayer();
|
if(Player.player === "" || Player.player === undefined || Helper.mobilecheck()) Player.loadPlayer();
|
||||||
//}
|
//}
|
||||||
@@ -298,7 +295,7 @@ function init(){
|
|||||||
tooltip: "Stop casting"
|
tooltip: "Stop casting"
|
||||||
});
|
});
|
||||||
|
|
||||||
$( "#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
$("#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
||||||
$("#search").focus();
|
$("#search").focus();
|
||||||
$("#embed-button").css("display", "inline-block");
|
$("#embed-button").css("display", "inline-block");
|
||||||
$("#embed-area").val(embed_code(embed_autoplay, embed_width, embed_height, color));
|
$("#embed-area").val(embed_code(embed_autoplay, embed_width, embed_height, color));
|
||||||
@@ -330,20 +327,17 @@ function init(){
|
|||||||
|
|
||||||
if(!Helper.mobilecheck() && navigator.userAgent.match(/iPad/i) == null){
|
if(!Helper.mobilecheck() && navigator.userAgent.match(/iPad/i) == null){
|
||||||
setTimeout(function(){set_title_width();}, 100);
|
setTimeout(function(){set_title_width();}, 100);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeCastApi = function() {
|
initializeCastApi = function() {
|
||||||
cast.framework.CastContext.getInstance().setOptions({
|
cast.framework.CastContext.getInstance().setOptions({
|
||||||
receiverApplicationId: "E6856E24",
|
receiverApplicationId: "E6856E24",
|
||||||
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED});
|
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED
|
||||||
|
});
|
||||||
var context = cast.framework.CastContext.getInstance();
|
var context = cast.framework.CastContext.getInstance();
|
||||||
chromecastReady = true
|
chromecastReady = true
|
||||||
//$(".castButton-unactive").css("display", "block");
|
context.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED, function(event) {
|
||||||
context.addEventListener(
|
|
||||||
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
|
|
||||||
function(event) {
|
|
||||||
Helper.log("session state");
|
Helper.log("session state");
|
||||||
Helper.log(event.sessionState);
|
Helper.log(event.sessionState);
|
||||||
switch (event.sessionState) {
|
switch (event.sessionState) {
|
||||||
@@ -386,7 +380,6 @@ initializeCastApi = function() {
|
|||||||
case cast.framework.SessionState.SESSION_ENDED:
|
case cast.framework.SessionState.SESSION_ENDED:
|
||||||
chromecastAvailable = false;
|
chromecastAvailable = false;
|
||||||
hide_native(0);
|
hide_native(0);
|
||||||
// Update locally as necessary
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -431,14 +424,12 @@ function hide_native(way){
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$("#volume").slider("value", 100);
|
$("#volume").slider("value", 100);
|
||||||
//$("#player_overlay").width($("#player").width() + 1);
|
|
||||||
}
|
}
|
||||||
$("#player_overlay").css("background", "url(https://i.ytimg.com/vi/" + video_id + "/maxresdefault.jpg)");
|
$("#player_overlay").css("background", "url(https://i.ytimg.com/vi/" + video_id + "/maxresdefault.jpg)");
|
||||||
$("#player_overlay").css("background-position", "center");
|
$("#player_overlay").css("background-position", "center");
|
||||||
$("#player_overlay").css("background-size", "100%");
|
$("#player_overlay").css("background-size", "100%");
|
||||||
$("#player_overlay").css("background-color", "black");
|
$("#player_overlay").css("background-color", "black");
|
||||||
$("#player_overlay").css("background-repeat", "no-repeat");
|
$("#player_overlay").css("background-repeat", "no-repeat");
|
||||||
//$("#player_overlay").css("height", "calc(100% - 32px)");
|
|
||||||
$("#playing_on").css("display", "flex");
|
$("#playing_on").css("display", "flex");
|
||||||
$("#chromecast_text").html("Playing on<br>" + castSession.La.friendlyName);
|
$("#chromecast_text").html("Playing on<br>" + castSession.La.friendlyName);
|
||||||
Player.player.setVolume(100);
|
Player.player.setVolume(100);
|
||||||
@@ -625,18 +616,10 @@ function change_offline(enabled, already_offline){
|
|||||||
if(enabled){
|
if(enabled){
|
||||||
if(list_html){
|
if(list_html){
|
||||||
list_html = $("<div>" + list_html + "</div>");
|
list_html = $("<div>" + list_html + "</div>");
|
||||||
//list_html.find(".card-content").css("display", "flex");
|
|
||||||
//list_html.find(".card-content").css("height", "100%");
|
|
||||||
//list_html.find(".list-title").css("align-self", "center");
|
|
||||||
//list_html.find(".vote-span").addClass("hide");
|
|
||||||
list_html.find(".list-remove").removeClass("hide");
|
list_html.find(".list-remove").removeClass("hide");
|
||||||
list_html = list_html.html();
|
list_html = list_html.html();
|
||||||
}
|
}
|
||||||
//$(".card-content").css("display", "flex");
|
|
||||||
//$(".card-content").css("height", "100%");
|
|
||||||
//$(".list-title").css("align-self", "center");
|
|
||||||
$(".list-remove").removeClass("hide");
|
$(".list-remove").removeClass("hide");
|
||||||
//$(".vote-span").addClass("hide");
|
|
||||||
$("#viewers").addClass("hide");
|
$("#viewers").addClass("hide");
|
||||||
$("#offline-mode").removeClass("waves-cyan");
|
$("#offline-mode").removeClass("waves-cyan");
|
||||||
$("#offline-mode").addClass("cyan");
|
$("#offline-mode").addClass("cyan");
|
||||||
@@ -691,19 +674,11 @@ function change_offline(enabled, already_offline){
|
|||||||
} else {
|
} else {
|
||||||
if(list_html){
|
if(list_html){
|
||||||
list_html = $("<div>" + list_html + "</div>");
|
list_html = $("<div>" + list_html + "</div>");
|
||||||
//list_html.find(".card-content").css("display", "block");
|
|
||||||
//list_html.find(".card-content").css("height", "initial");
|
|
||||||
//list_html.find(".list-title").css("align-self", "center");
|
|
||||||
//list_html.find(".vote-span").removeClass("hide");
|
|
||||||
if(hasadmin && w_p){
|
if(hasadmin && w_p){
|
||||||
list_html.find(".list-remove").addClass("hide");
|
list_html.find(".list-remove").addClass("hide");
|
||||||
}
|
}
|
||||||
list_html = list_html.html();
|
list_html = list_html.html();
|
||||||
}
|
}
|
||||||
//$(".card-content").css("display", "block");
|
|
||||||
//$(".card-content").css("height", "initial");
|
|
||||||
//$(".list-title").css("align-self", "center");
|
|
||||||
//$(".vote-span").removeClass("hide");
|
|
||||||
$("#viewers").removeClass("hide");
|
$("#viewers").removeClass("hide");
|
||||||
if(hasadmin && w_p){
|
if(hasadmin && w_p){
|
||||||
$(".list-remove").addClass("hide");
|
$(".list-remove").addClass("hide");
|
||||||
@@ -756,7 +731,6 @@ window.enable_debug = enable_debug;
|
|||||||
window.disable_debug = disable_debug;
|
window.disable_debug = disable_debug;
|
||||||
|
|
||||||
function seekToMove(e){
|
function seekToMove(e){
|
||||||
//if(!Helper.mobilecheck()) {
|
|
||||||
var pos_x = e.clientX - Math.ceil($("#seekToDuration").width() / 2) - 8;
|
var pos_x = e.clientX - Math.ceil($("#seekToDuration").width() / 2) - 8;
|
||||||
if(pos_x < 0) pos_x = 0;
|
if(pos_x < 0) pos_x = 0;
|
||||||
else if(pos_x + $("#seekToDuration").width() > $("#controls").width()) {
|
else if(pos_x + $("#seekToDuration").width() > $("#controls").width()) {
|
||||||
@@ -764,7 +738,6 @@ function seekToMove(e){
|
|||||||
}
|
}
|
||||||
$("#seekToDuration").css("left", pos_x);
|
$("#seekToDuration").css("left", pos_x);
|
||||||
try{
|
try{
|
||||||
//var total = Player.player.getDuration() / $("#controls").width();
|
|
||||||
var total = full_playlist[full_playlist.length - 1].duration / $("#controls").width();
|
var total = full_playlist[full_playlist.length - 1].duration / $("#controls").width();
|
||||||
total = total * e.clientX;
|
total = total * e.clientX;
|
||||||
var _time = Helper.secondsToOther(total);
|
var _time = Helper.secondsToOther(total);
|
||||||
@@ -777,7 +750,6 @@ function seekToMove(e){
|
|||||||
$("#bar").width(((100 / Player.player.getDuration()) * total) + "%");
|
$("#bar").width(((100 / Player.player.getDuration()) * total) + "%");
|
||||||
}
|
}
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function seekToClick(e){
|
function seekToClick(e){
|
||||||
@@ -821,7 +793,6 @@ $(document).keyup(function(event) {
|
|||||||
|
|
||||||
if($("#search-btn i").html() == "close")
|
if($("#search-btn i").html() == "close")
|
||||||
{
|
{
|
||||||
//$("#search-btn i").html("mdi-navigation-close");
|
|
||||||
$("#search-btn i").html("search");
|
$("#search-btn i").html("search");
|
||||||
}
|
}
|
||||||
if($(".search-container").length != 0 && !Helper.contains($(".search-container").attr("class").split(" "), "hide")){
|
if($(".search-container").length != 0 && !Helper.contains($(".search-container").attr("class").split(" "), "hide")){
|
||||||
@@ -838,7 +809,6 @@ $(document).keyup(function(event) {
|
|||||||
|
|
||||||
if($("#search-btn i").html() == "close")
|
if($("#search-btn i").html() == "close")
|
||||||
{
|
{
|
||||||
//$("#search-btn i").html("mdi-navigation-close");
|
|
||||||
$("#search-btn i").html("search");
|
$("#search-btn i").html("search");
|
||||||
}
|
}
|
||||||
if($(".search-container").length != 0 && !Helper.contains($(".search-container").attr("class").split(" "), "hide")){
|
if($(".search-container").length != 0 && !Helper.contains($(".search-container").attr("class").split(" "), "hide")){
|
||||||
@@ -920,8 +890,6 @@ $(document).on("click", ".castButton-unactive", function(e){
|
|||||||
$(document).on("click", ".castButton-active", function(e){
|
$(document).on("click", ".castButton-active", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||||
// End the session and pass 'true' to indicate
|
|
||||||
// that receiver application should be stopped.
|
|
||||||
castSession.endSession(true);
|
castSession.endSession(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -986,7 +954,6 @@ $(document).on("click", ".modal-close", function(e){
|
|||||||
$(document).on("change", ".password_protected", function(e) {
|
$(document).on("change", ".password_protected", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(this.checked) {
|
if(this.checked) {
|
||||||
//alert("kwek");
|
|
||||||
$("#user_password").modal('open');
|
$("#user_password").modal('open');
|
||||||
$("#user-pass-input").focus();
|
$("#user-pass-input").focus();
|
||||||
} else {
|
} else {
|
||||||
@@ -999,8 +966,6 @@ $(document).on("change", ".password_protected", function(e) {
|
|||||||
$(document).on("submit", "#user-password-channel-form", function(e) {
|
$(document).on("submit", "#user-password-channel-form", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(user_auth_started) {
|
if(user_auth_started) {
|
||||||
//user_auth_started = false;
|
|
||||||
//$("#user_password").modal('close');
|
|
||||||
temp_user_pass = CryptoJS.SHA256($("#user-pass-input").val()).toString();
|
temp_user_pass = CryptoJS.SHA256($("#user-pass-input").val()).toString();
|
||||||
$("#user-pass-input").val("");
|
$("#user-pass-input").val("");
|
||||||
socket.emit("list", {channel: chan.toLowerCase(), pass: Crypt.crypt_pass(temp_user_pass)});
|
socket.emit("list", {channel: chan.toLowerCase(), pass: Crypt.crypt_pass(temp_user_pass)});
|
||||||
@@ -1023,8 +988,6 @@ $(document).on("click", ".change_user_pass_btn", function(e) {
|
|||||||
$(document).on("click", ".submit-user-password", function(e) {
|
$(document).on("click", ".submit-user-password", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(user_auth_started) {
|
if(user_auth_started) {
|
||||||
//user_auth_started = false;
|
|
||||||
//$("#user_password").modal('close');
|
|
||||||
temp_user_pass = CryptoJS.SHA256($("#user-pass-input").val()).toString();
|
temp_user_pass = CryptoJS.SHA256($("#user-pass-input").val()).toString();
|
||||||
$("#user-pass-input").val("");
|
$("#user-pass-input").val("");
|
||||||
socket.emit("list", {channel: chan.toLowerCase(), pass: Crypt.crypt_pass(temp_user_pass)});
|
socket.emit("list", {channel: chan.toLowerCase(), pass: Crypt.crypt_pass(temp_user_pass)});
|
||||||
@@ -1132,20 +1095,6 @@ $(document).on("submit", ".channel-finder", function(e){
|
|||||||
Frontpage.to_channel($(".room-namer").val());
|
Frontpage.to_channel($(".room-namer").val());
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
$(document).off("keyup", "keyup.autocomplete", function(e){
|
|
||||||
if(e.keyCode == 13){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).off("keydown", "keydown.autocomplete", function(e){
|
|
||||||
if(e.keyCode == 13){
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
|
|
||||||
$(document).on("submit", ".channel-finder-mobile", function(e){
|
$(document).on("submit", ".channel-finder-mobile", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -1161,7 +1110,6 @@ $(document).on("change", 'input[class=remote_switch_class]', function()
|
|||||||
|
|
||||||
$(document).on("change", 'input[class=offline_switch_class]', function()
|
$(document).on("change", 'input[class=offline_switch_class]', function()
|
||||||
{
|
{
|
||||||
//Hostcontroller.change_enabled(document.getElementsByName("remote_switch")[0].checked);
|
|
||||||
offline = document.getElementsByName("offline_switch")[0].checked;
|
offline = document.getElementsByName("offline_switch")[0].checked;
|
||||||
change_offline(offline, !offline);
|
change_offline(offline, !offline);
|
||||||
});
|
});
|
||||||
@@ -1248,7 +1196,6 @@ $(document).on("submit", "#listImport", function(e){
|
|||||||
$(document).on("submit", "#listImportSpotify", function(e){
|
$(document).on("submit", "#listImportSpotify", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(spotify_authenticated && $("#import_spotify").val() !== ""){
|
if(spotify_authenticated && $("#import_spotify").val() !== ""){
|
||||||
//Helper.log("Import this playlist: " + document.getElementById("import_spotify").value);
|
|
||||||
var url = $("#import_spotify").val().split("https://open.spotify.com/user/");
|
var url = $("#import_spotify").val().split("https://open.spotify.com/user/");
|
||||||
if(url.length == 2) {
|
if(url.length == 2) {
|
||||||
url = url[1].split("/");
|
url = url[1].split("/");
|
||||||
@@ -1302,8 +1249,6 @@ $(document).on("submit", "#remoteform", function(e) {
|
|||||||
$(document).on("click", ".chat-link", function(){
|
$(document).on("click", ".chat-link", function(){
|
||||||
$("#text-chat-input").focus();
|
$("#text-chat-input").focus();
|
||||||
$("#chat-btn i").css("opacity", 1);
|
$("#chat-btn i").css("opacity", 1);
|
||||||
//clearInterval(blink_interval);
|
|
||||||
//blink_interval_exists = false;
|
|
||||||
Chat.channel_received = 0;
|
Chat.channel_received = 0;
|
||||||
Chat.all_received = 0;
|
Chat.all_received = 0;
|
||||||
if(!$(".chat-link span.badge.new.white").hasClass("hide")){
|
if(!$(".chat-link span.badge.new.white").hasClass("hide")){
|
||||||
@@ -1328,21 +1273,13 @@ function searchTimeout(event) {
|
|||||||
timeout_search = setTimeout(function(){
|
timeout_search = setTimeout(function(){
|
||||||
Search.search(search_input);
|
Search.search(search_input);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
/*i = 0;
|
|
||||||
timer=100;*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(/iPad|iPhone|iPod/.test(navigator.userAgent)){
|
$(document).on('keyup', ".search_input", function(event) {
|
||||||
$(document).on('touchend', '.search_input', function(event) {
|
|
||||||
searchTimeout(event);
|
searchTimeout(event);
|
||||||
});
|
});
|
||||||
} else {*/
|
|
||||||
$(document).on('keyup', ".search_input", function(event) {
|
|
||||||
searchTimeout(event);
|
|
||||||
});
|
|
||||||
//}
|
|
||||||
|
|
||||||
$(document).on("click", ".chat-tab", function(){
|
$(document).on("click", ".chat-tab", function(){
|
||||||
$("#text-chat-input").focus();
|
$("#text-chat-input").focus();
|
||||||
@@ -1575,34 +1512,6 @@ $(document).on("click", "#player_bottom_overlay", function(){
|
|||||||
Frontpage.to_channel(chan.toLowerCase(), false);
|
Frontpage.to_channel(chan.toLowerCase(), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*$(document).on("mousemove", "#playlist", function(e)
|
|
||||||
{
|
|
||||||
var y = e.pageY - this.offsetTop;
|
|
||||||
if(((y <= 80 && y >= 48)) && $("#wrapper").scrollTop() > 0){
|
|
||||||
$("#top-button").removeClass("hide");
|
|
||||||
Helper.addClass("#bottom-button", "hide");
|
|
||||||
}else if(y >= $("#playlist").height() - 59 && y <= $("#playlist").height() - 32 && $("#wrapper").scrollTop() < $("#wrapper")[0].scrollHeight - $("#wrapper").height() - 1){
|
|
||||||
$("#bottom-button").removeClass("hide");
|
|
||||||
Helper.addClass("#top-button", "hide");
|
|
||||||
}else{
|
|
||||||
Helper.addClass("#bottom-button", "hide");
|
|
||||||
Helper.addClass("#top-button", "hide");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on("mouseleave", "#playlist", function(){
|
|
||||||
Helper.addClass("#bottom-button", "hide");
|
|
||||||
Helper.addClass("#top-button", "hide");
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on("click", "#top-button", function(){
|
|
||||||
List.scrollTop();
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on("click", "#bottom-button", function(){
|
|
||||||
List.scrollBottom();
|
|
||||||
});*/
|
|
||||||
|
|
||||||
|
|
||||||
$(document).keydown(function(event) {
|
$(document).keydown(function(event) {
|
||||||
if(window.location.pathname != "/"){
|
if(window.location.pathname != "/"){
|
||||||
@@ -1640,9 +1549,6 @@ $(document).on("submit", "#find_form", function(e){
|
|||||||
if(found_array.length == 0){
|
if(found_array.length == 0){
|
||||||
var that = this;
|
var that = this;
|
||||||
found_array_index = 0;
|
found_array_index = 0;
|
||||||
/*var result = $.grep(full_playlist, function(v,i) {
|
|
||||||
return v.title.toLowerCase().indexOf(that.find_value.value.toLowerCase()) >= 0;
|
|
||||||
});*/
|
|
||||||
found_array = $.map(full_playlist, function(obj, index) {
|
found_array = $.map(full_playlist, function(obj, index) {
|
||||||
if(obj.title.toLowerCase().indexOf(that.find_value.value.toLowerCase()) >= 0) {
|
if(obj.title.toLowerCase().indexOf(that.find_value.value.toLowerCase()) >= 0) {
|
||||||
return index;
|
return index;
|
||||||
@@ -1664,13 +1570,11 @@ $(document).on("submit", "#find_form", function(e){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function share_link_modifier_channel(){
|
function share_link_modifier_channel(){
|
||||||
$("#facebook-code-link").attr("href", "https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/" + chan.toLowerCase());
|
$("#facebook-code-link").attr("href", "https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/" + chan.toLowerCase());
|
||||||
$("#facebook-code-link").attr("onclick", "window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/" + chan.toLowerCase() + "', 'Share Playlist','width=600,height=300'); return false;");
|
$("#facebook-code-link").attr("onclick", "window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/" + chan.toLowerCase() + "', 'Share Playlist','width=600,height=300'); return false;");
|
||||||
$("#twitter-code-link").attr("href", "https://twitter.com/intent/tweet?url=https://zoff.me/" + chan.toLowerCase() + "&text=Check%20out%20this%20playlist%20" + chan.toLowerCase() + "%20on%20Zoff!&via=zoffmusic");
|
$("#twitter-code-link").attr("href", "https://twitter.com/intent/tweet?url=https://zoff.me/" + chan.toLowerCase() + "&text=Check%20out%20this%20playlist%20" + chan.toLowerCase() + "%20on%20Zoff!&via=zoffmusic");
|
||||||
$("#twitter-code-link").attr("onclick", "window.open('https://twitter.com/intent/tweet?url=https://zoff.me/" + chan.toLowerCase() + "/&text=Check%20out%20this%20playlist%20" + chan.toLowerCase() + "%20on%20Zoff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;");
|
$("#twitter-code-link").attr("onclick", "window.open('https://twitter.com/intent/tweet?url=https://zoff.me/" + chan.toLowerCase() + "/&text=Check%20out%20this%20playlist%20" + chan.toLowerCase() + "%20on%20Zoff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;");
|
||||||
//$("#qr-code-link").attr("href", "//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.me/" + chan.toLowerCase() + "&choe=UTF-8&chld=L%7C1");
|
|
||||||
$("#qr-code-image-link").attr("src", "//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.me/" + chan.toLowerCase() + "&choe=UTF-8&chld=L%7C1");
|
$("#qr-code-image-link").attr("src", "//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.me/" + chan.toLowerCase() + "&choe=UTF-8&chld=L%7C1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1762,9 +1666,7 @@ function onepage_load(){
|
|||||||
} else {
|
} else {
|
||||||
try{
|
try{
|
||||||
Player.player.destroy();
|
Player.player.destroy();
|
||||||
} catch(error){
|
} catch(error){}
|
||||||
//No player to destroy
|
|
||||||
}
|
|
||||||
Player.player = "";
|
Player.player = "";
|
||||||
document.title = "Zoff";
|
document.title = "Zoff";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,14 +137,13 @@ var Player = {
|
|||||||
case 0:
|
case 0:
|
||||||
playing = false;
|
playing = false;
|
||||||
paused = false;
|
paused = false;
|
||||||
if(!offline){
|
if(!offline) {
|
||||||
socket.emit("end", {id: video_id, channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
socket.emit("end", {id: video_id, channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
} else {
|
} else {
|
||||||
Player.playNext();
|
Player.playNext();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
|
||||||
playing = true;
|
playing = true;
|
||||||
if(beginning && Helper.mobilecheck() && !chromecastAvailable){
|
if(beginning && Helper.mobilecheck() && !chromecastAvailable){
|
||||||
Player.pauseVideo();
|
Player.pauseVideo();
|
||||||
@@ -165,24 +164,17 @@ var Player = {
|
|||||||
if(document.getElementById("pause").className.split(" ").length == 2)
|
if(document.getElementById("pause").className.split(" ").length == 2)
|
||||||
$("#pause").toggleClass("hide");
|
$("#pause").toggleClass("hide");
|
||||||
}
|
}
|
||||||
if(paused && !offline)
|
if(paused && !offline) {
|
||||||
{
|
|
||||||
socket.emit('pos', {channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
socket.emit('pos', {channel: chan.toLowerCase(), pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
paused = false;
|
paused = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
/*if(Helper.mobilecheck() || embed)
|
|
||||||
{*/
|
|
||||||
if(!chromecastAvailable){
|
if(!chromecastAvailable){
|
||||||
paused = true;
|
paused = true;
|
||||||
if(window.location.pathname != "/") Playercontrols.play_pause_show();
|
if(window.location.pathname != "/") Playercontrols.play_pause_show();
|
||||||
mobile_beginning = true;
|
mobile_beginning = true;
|
||||||
}
|
}
|
||||||
/*}
|
|
||||||
else
|
|
||||||
Player.player.playVideo();*/
|
|
||||||
//
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
break;
|
break;
|
||||||
@@ -305,30 +297,12 @@ var Player = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
errorHandler: function(newState)
|
errorHandler: function(newState) {
|
||||||
{
|
|
||||||
if(!user_auth_started) {
|
if(!user_auth_started) {
|
||||||
if(newState.data == 5 || newState.data == 100 ||
|
if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150) {
|
||||||
newState.data == 101 || newState.data == 150)
|
|
||||||
{
|
|
||||||
/*if(Player.count == 2){
|
|
||||||
Player.count = 0;*/
|
|
||||||
/*Helper.log("Before: " + Player.before_load);
|
|
||||||
Helper.log("Now: " + video_id);
|
|
||||||
Helper.log("After: " + Player.after_load);
|
|
||||||
Helper.log(Player.before_load == Player.player.getVideoUrl);*/
|
|
||||||
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, channel: chan.toLowerCase, userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
//Helper.log(video_id, Player.player.getVideoUrl(), Player.player.getPlayerState());
|
|
||||||
|
|
||||||
/*}else{
|
|
||||||
setTimeout(function(){
|
|
||||||
Player.loadVideoById(video_id);
|
|
||||||
Player.count ++;
|
|
||||||
}, Math.floor((Math.random() * 100) + 1));
|
|
||||||
}*/
|
|
||||||
}else if(video_id !== undefined) {
|
}else if(video_id !== undefined) {
|
||||||
Player.loadVideoById(video_id);
|
Player.loadVideoById(video_id);
|
||||||
}
|
}
|
||||||
@@ -339,8 +313,7 @@ var Player = {
|
|||||||
try{
|
try{
|
||||||
beginning = true;
|
beginning = true;
|
||||||
player_ready = true;
|
player_ready = true;
|
||||||
if(!window.MSStream)
|
if(!window.MSStream) {
|
||||||
{
|
|
||||||
if(Helper.mobilecheck()){
|
if(Helper.mobilecheck()){
|
||||||
$("#playpause").css("visibility", "hidden");
|
$("#playpause").css("visibility", "hidden");
|
||||||
$("#playpause").css("pointer-events", "none");
|
$("#playpause").css("pointer-events", "none");
|
||||||
@@ -477,9 +450,6 @@ var Player = {
|
|||||||
|
|
||||||
durationSetter: function()
|
durationSetter: function()
|
||||||
{
|
{
|
||||||
/*try{
|
|
||||||
//duration = Player.player.getDuration();
|
|
||||||
}catch(e){};*/
|
|
||||||
try{
|
try{
|
||||||
if(!user_auth_avoid && duration !== undefined){
|
if(!user_auth_avoid && duration !== undefined){
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ var Playercontrols = {
|
|||||||
|
|
||||||
initYoutubeControls: function()
|
initYoutubeControls: function()
|
||||||
{
|
{
|
||||||
//if(Helper.mobilecheck() && !/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
|
||||||
if(Helper.mobilecheck() && !window.MSStream){
|
if(Helper.mobilecheck() && !window.MSStream){
|
||||||
$("#controls").appendTo("#playbar");
|
$("#controls").appendTo("#playbar");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ $(document).ready(function (){
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
git_info = $.ajax({ type: "GET",
|
git_info = $.ajax({
|
||||||
|
type: "GET",
|
||||||
url: "https://api.github.com/users/zoff-music/received_events",
|
url: "https://api.github.com/users/zoff-music/received_events",
|
||||||
async: false
|
async: false
|
||||||
}).responseText;
|
}).responseText;
|
||||||
@@ -64,12 +65,6 @@ $(document).on("click", "#skipbutton", function()
|
|||||||
$(document).on("submit", "#remoteform", function(e)
|
$(document).on("submit", "#remoteform", function(e)
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
/*
|
|
||||||
if(start)
|
|
||||||
window.location.href = '/remote/'+document.getElementById("remoteform").chan.value;
|
|
||||||
else
|
|
||||||
Remotecontroller.control();
|
|
||||||
*/
|
|
||||||
Remotecontroller.control();
|
Remotecontroller.control();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -101,10 +96,6 @@ var Remotecontroller = {
|
|||||||
value: 100,
|
value: 100,
|
||||||
range: "min",
|
range: "min",
|
||||||
animate: true,
|
animate: true,
|
||||||
/*slide: function(event, ui) {
|
|
||||||
Helper.log(ui.value);
|
|
||||||
//localStorage.setItem("volume", ui.value);
|
|
||||||
},*/
|
|
||||||
stop:function(event, ui) {
|
stop:function(event, ui) {
|
||||||
socket.emit("id", {id: id, type: "volume", value: ui.value});
|
socket.emit("id", {id: id, type: "volume", value: ui.value});
|
||||||
}
|
}
|
||||||
@@ -116,5 +107,4 @@ var Remotecontroller = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ var Search = {
|
|||||||
$(".search_input").focus();
|
$(".search_input").focus();
|
||||||
}
|
}
|
||||||
$("#song-title").toggleClass("hide");
|
$("#song-title").toggleClass("hide");
|
||||||
//$("#results").toggleClass("hide");
|
|
||||||
$("#results").empty();
|
$("#results").empty();
|
||||||
if($("#search-btn i").html() == "close"){
|
if($("#search-btn i").html() == "close"){
|
||||||
$("#search-btn i").html("search");
|
$("#search-btn i").html("search");
|
||||||
} else {
|
} else {
|
||||||
$("#search-btn i").html("close");
|
$("#search-btn i").html("close");
|
||||||
}
|
}
|
||||||
//$("#search-btn i").html("search");
|
|
||||||
$("#search").focus();
|
$("#search").focus();
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -31,7 +29,6 @@ var Search = {
|
|||||||
if(search_input !== ""){
|
if(search_input !== ""){
|
||||||
searching = true;
|
searching = true;
|
||||||
var keyword= encodeURIComponent(search_input);
|
var keyword= encodeURIComponent(search_input);
|
||||||
//response= x
|
|
||||||
var yt_url = "https://www.googleapis.com/youtube/v3/search?key="+api_key+"&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";
|
var yt_url = "https://www.googleapis.com/youtube/v3/search?key="+api_key+"&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";
|
||||||
yt_url+="&q="+keyword;
|
yt_url+="&q="+keyword;
|
||||||
if(music)yt_url+="&videoCategoryId=10";
|
if(music)yt_url+="&videoCategoryId=10";
|
||||||
@@ -49,17 +46,14 @@ var Search = {
|
|||||||
url: yt_url,
|
url: yt_url,
|
||||||
dataType:"jsonp",
|
dataType:"jsonp",
|
||||||
success: function(response){
|
success: function(response){
|
||||||
if(response.items.length === 0)
|
if(response.items.length === 0) {
|
||||||
{
|
|
||||||
|
|
||||||
$("<div style='display:none;' id='mock-div'>"+empty_results_html+"</div>").appendTo($("#results")).show("blind", 83.33);
|
$("<div style='display:none;' id='mock-div'>"+empty_results_html+"</div>").appendTo($("#results")).show("blind", 83.33);
|
||||||
if(Helper.contains($(".search_loader_spinner").attr("class").split(" "), "active"))
|
if(Helper.contains($(".search_loader_spinner").attr("class").split(" "), "active"))
|
||||||
$(".search_loader_spinner").removeClass("active");
|
$(".search_loader_spinner").removeClass("active");
|
||||||
|
|
||||||
}else if(response.items){
|
} else if(response.items){
|
||||||
//get list of IDs and make new request for video info
|
$.each(response.items, function(i,data) {
|
||||||
$.each(response.items, function(i,data)
|
|
||||||
{
|
|
||||||
vid_url += data.id.videoId+",";
|
vid_url += data.id.videoId+",";
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,8 +116,7 @@ var Search = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
}else{
|
|
||||||
$(".main").removeClass("blurT");
|
$(".main").removeClass("blurT");
|
||||||
$("#controls").removeClass("blurT");
|
$("#controls").removeClass("blurT");
|
||||||
$(".main").removeClass("clickthrough");
|
$(".main").removeClass("clickthrough");
|
||||||
@@ -191,21 +184,8 @@ var Search = {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if(
|
if((!not_matched)){
|
||||||
(!not_matched //&&
|
|
||||||
//(duration + 1 > length && duration - 1 < length)
|
|
||||||
)
|
|
||||||
){
|
|
||||||
matched = true;
|
matched = true;
|
||||||
/*Helper.log("------------------------------");
|
|
||||||
Helper.log("MATCH FOR:");
|
|
||||||
Helper.log("YouTube title: " + data.snippet.title);
|
|
||||||
Helper.log("YouTube Channel: " + data.snippet.channelTitle);
|
|
||||||
Helper.log("YouTube duration: " + duration);
|
|
||||||
Helper.log("Spotify title: " + title + " " + artist.join(" "));
|
|
||||||
Helper.log("Spotify length: " + length);
|
|
||||||
Helper.log("------------------------------");*/
|
|
||||||
//Search.submit(data.id,data.snippet.title, duration, true, current, totalNumber);
|
|
||||||
Search.readySubmit(true, { id: data.id, title: data.snippet.title, duration: duration, totalLength: totalNumber - 1});
|
Search.readySubmit(true, { id: data.id, title: data.snippet.title, duration: duration, totalLength: totalNumber - 1});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -417,5 +397,4 @@ var Search = {
|
|||||||
seconds= parseInt(matches[16])||0;
|
seconds= parseInt(matches[16])||0;
|
||||||
return hours*60*60+minutes*60+seconds;
|
return hours*60*60+minutes*60+seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,11 +25,6 @@ var Suggestions = {
|
|||||||
var duration = Helper.secondsToOther(params.duration);
|
var duration = Helper.secondsToOther(params.duration);
|
||||||
var video_id = params.id;
|
var video_id = params.id;
|
||||||
var video_title = params.title;
|
var video_title = params.title;
|
||||||
/*var minutes = Math.floor(secs / 60);
|
|
||||||
var seconds = secs - minutes * 60;
|
|
||||||
|
|
||||||
duration = Helper.pad(minutes) + ":" + Helper.pad(seconds);*/
|
|
||||||
|
|
||||||
var song = List.generateSong({id: video_id, title: video_title, length: params.duration, duration: duration}, false, false, false, true);
|
var song = List.generateSong({id: video_id, title: video_title, length: params.duration, duration: duration}, false, false, false, true);
|
||||||
$("#user-suggest-html").append(song);
|
$("#user-suggest-html").append(song);
|
||||||
},
|
},
|
||||||
@@ -65,7 +60,6 @@ var Suggestions = {
|
|||||||
var video_id = song.id;
|
var video_id = song.id;
|
||||||
var video_title = song.snippet.title;
|
var video_title = song.snippet.title;
|
||||||
|
|
||||||
//duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s");
|
|
||||||
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: length, duration: duration}, false, false, false));
|
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: length, duration: duration}, false, false, false));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -83,5 +77,4 @@ var Suggestions = {
|
|||||||
$("#user_suggests").removeClass("hide");
|
$("#user_suggests").removeClass("hide");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user