This commit is contained in:
Kasper Rynning-Tønnesen
2016-01-25 11:36:36 +01:00
parent 0968aeccc7
commit 26dea79c7a
5 changed files with 77 additions and 63 deletions

View File

@@ -39,28 +39,30 @@ var list;
var seekTo;
var song_title;
var previous_video_id;
var socket;
var connection_options = {
'sync disconnect on unload':true,
'secure': true,
'force new connection': true
};
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost";
var socket = io.connect(''+add+':8880', connection_options);
socket.on("get_list", function(){
setTimeout(function(){socket.emit('list', chan.toLowerCase())},1000);
});
$().ready(init);
socket.on("suggested", function(params){
var single = true;
if(params.id == undefined)
single = false;
setTimeout(function(){Suggestions.catchUserSuggests(params, single)}, 1000);
});
$(document).ready(function()
{
function init(){
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost";
socket = io.connect(''+add+':8880', connection_options);
socket.on("get_list", function(){
setTimeout(function(){socket.emit('list', chan.toLowerCase())},1000);
});
socket.on("suggested", function(params){
var single = true;
if(params.id == undefined)
single = false;
setTimeout(function(){Suggestions.catchUserSuggests(params, single)}, 1000);
});
setTimeout(function(){
//window.vote = List.vote;
//window.submit = Search.submit;
@@ -181,7 +183,9 @@ $(document).ready(function()
}
}, 1);
}, 1000);
});
}
window.init = init;
$(document).keyup(function(e) {
if(event.keyCode == 27){
@@ -387,7 +391,7 @@ function onepage_load(){
document.getElementById("fullscreen").removeEventListener("click", Playercontrols.fullscreen);
setTimeout(function(){
delete Admin
/*delete Admin
delete Chat
delete Crypt
delete Hostcontroller
@@ -438,21 +442,21 @@ function onepage_load(){
delete previous_video_id;
delete connection_options;
delete socket;
delete window.onYouTubeIframeAPIReady;
delete window.onYouTubeIframeAPIReady;*/
$(".drag-target").remove();
$(".sidenav-overlay").remove();
$("main").attr("class", "center-align container");
$("body").attr("id", "");
$("body").attr("style", "");
$("header").html($($(e)[0]).html());
$($(e)[2]).insertAfter("header");
$($(e)[4]).insertAfter(".mega");
$("main").html($($(e)[6]).html());
$("#scripts").append($($(e)[8]).html());
}, 1000);
document.title = "Zöff";
$(".drag-target").remove();
$(".sidenav-overlay").remove();
$("main").attr("class", "center-align container");
$("body").attr("id", "");
$("body").attr("style", "");
$("header").html($($(e)[0]).html());
$($(e)[2]).insertAfter("header");
$($(e)[4]).insertAfter(".mega");
$("main").html($($(e)[6]).html());
$("#scripts").html($($(e)[8]).html());
}
});