mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed faster loading between views
This commit is contained in:
@@ -273,11 +273,8 @@
|
|||||||
|
|
||||||
<?php include("php/footer.php"); ?>
|
<?php include("php/footer.php"); ?>
|
||||||
<div id="scripts">
|
<div id="scripts">
|
||||||
<script type="text/javascript" src="/static/dist/lib/jquery.lazyload.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/color-thief.js"></script>
|
|
||||||
<script type="text/javascript" src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
|
|
||||||
<script type="text/javascript" src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/main.min.js"></script>
|
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript" src="/static/dist/main.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -135,10 +135,4 @@
|
|||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/materialize.min.js"></script>
|
|
||||||
<script type="text/javascript" src="//cdn.socket.io/socket.io-1.4.5.js"></script>
|
|
||||||
@@ -30,4 +30,13 @@
|
|||||||
ga('create', '***REMOVED***', 'auto');
|
ga('create', '***REMOVED***', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/dist/lib/materialize.min.js"></script>
|
||||||
|
<script type="text/javascript" src="//cdn.socket.io/socket.io-1.4.5.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/dist/lib/jquery.lazyload.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/dist/lib/color-thief.js"></script>
|
||||||
|
<script type="text/javascript" src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
|
||||||
|
<script type="text/javascript" src="//crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
|
||||||
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.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
@@ -5,7 +5,7 @@ var showToggle = true;
|
|||||||
var list_html = $("#list-song-html").html();
|
var list_html = $("#list-song-html").html();
|
||||||
var blink_interval_exists = false;
|
var blink_interval_exists = false;
|
||||||
var unseen = false;
|
var unseen = false;
|
||||||
var timer = 0;
|
//var timer = 0;
|
||||||
var api_key = "***REMOVED***";
|
var api_key = "***REMOVED***";
|
||||||
var result_html = $("#temp-results-container");
|
var result_html = $("#temp-results-container");
|
||||||
var empty_results_html = $("#empty-results-container").html();
|
var empty_results_html = $("#empty-results-container").html();
|
||||||
@@ -28,6 +28,7 @@ var lazy_load = true;
|
|||||||
var embed = false;
|
var embed = false;
|
||||||
var autoplay = true;
|
var autoplay = true;
|
||||||
|
|
||||||
|
var timeout_search;
|
||||||
var id;
|
var id;
|
||||||
var full_playlist;
|
var full_playlist;
|
||||||
var conf;
|
var conf;
|
||||||
@@ -48,7 +49,9 @@ var connection_options = {
|
|||||||
'force new connection': true
|
'force new connection': true
|
||||||
};
|
};
|
||||||
|
|
||||||
$().ready(function(){init();});
|
$().ready(function(){
|
||||||
|
if(!window.fromFront) init();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
@@ -63,139 +66,153 @@ function init(){
|
|||||||
chan = $("#chan").html();
|
chan = $("#chan").html();
|
||||||
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
|
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
|
||||||
else add = "localhost";
|
else add = "localhost";
|
||||||
|
|
||||||
|
|
||||||
|
//setTimeout(function(){
|
||||||
|
if(Youtube != undefined) Youtube.stopInterval= false;
|
||||||
|
//window.vote = List.vote;
|
||||||
|
//window.submit = Search.submit;
|
||||||
|
//window.submitAndClose = Search.submitAndClose;
|
||||||
|
|
||||||
|
if(!localStorage["list_update"] || localStorage["list_update"] != "13.06.15")
|
||||||
|
{
|
||||||
|
localStorage.setItem("list_update", "13.06.15");
|
||||||
|
window.location.reload(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('ul.tabs').tabs();
|
||||||
|
$("#settings").sideNav({
|
||||||
|
menuWidth: 300, // Default is 240
|
||||||
|
edge: 'right', // Choose the horizontal origin
|
||||||
|
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||||
|
});
|
||||||
|
$('.collapsible').collapsible({
|
||||||
|
accordion : true // A setting that changes the collapsible behavior to expandable instead of the default accordion style
|
||||||
|
});
|
||||||
|
|
||||||
|
//awdwad
|
||||||
|
$(".video-container").resizable({
|
||||||
|
start: function(event, ui) {
|
||||||
|
$('iframe').css('pointer-events','none');
|
||||||
|
},
|
||||||
|
stop: function(event, ui) {
|
||||||
|
$('iframe').css('pointer-events','auto');
|
||||||
|
Crypt.set_width($(this).width());
|
||||||
|
},
|
||||||
|
handles: "e",
|
||||||
|
minWidth: 350
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(localStorage[chan.toLowerCase()])
|
||||||
|
{
|
||||||
|
if(localStorage[chan.toLowerCase()].length != 64)
|
||||||
|
localStorage.removeItem(chan.toLowerCase());
|
||||||
|
else
|
||||||
|
socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase()]);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
socket = io.connect(''+add+':8880', connection_options);
|
socket = io.connect(''+add+':8880', connection_options);
|
||||||
|
Youtube.setup_youtube_listener(chan);
|
||||||
|
Admin.admin_listener();
|
||||||
|
List.channel_listener();
|
||||||
|
|
||||||
socket.on("get_list", function(){
|
socket.on("get_list", function(){
|
||||||
setTimeout(function(){socket.emit('list', chan.toLowerCase())},1000);
|
//setTimeout(function(){
|
||||||
|
socket.emit('list', chan.toLowerCase())
|
||||||
|
//},1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("suggested", function(params){
|
socket.on("suggested", function(params){
|
||||||
var single = true;
|
var single = true;
|
||||||
if(params.id == undefined)
|
if(params.id == undefined)
|
||||||
single = false;
|
single = false;
|
||||||
setTimeout(function(){Suggestions.catchUserSuggests(params, single)}, 1000);
|
//setTimeout(function(){
|
||||||
|
Suggestions.catchUserSuggests(params, single);
|
||||||
|
//}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function(){
|
if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
||||||
Youtube.stopInterval= false;
|
document.getElementById("search").blur();
|
||||||
//window.vote = List.vote;
|
Youtube.readyLooks();
|
||||||
//window.submit = Search.submit;
|
}else{
|
||||||
//window.submitAndClose = Search.submitAndClose;
|
Chat.setup_chat_listener(chan);
|
||||||
|
Chat.allchat_listener();
|
||||||
|
if(!window.mobilecheck()) Hostcontroller.host_listener();
|
||||||
|
window.onYouTubeIframeAPIReady = Youtube.onYouTubeIframeAPIReady;
|
||||||
|
Youtube.loadPlayer();
|
||||||
|
|
||||||
if(!localStorage["list_update"] || localStorage["list_update"] != "13.06.15")
|
$("#chat-btn").sideNav({
|
||||||
{
|
menuWidth: 272, // Default is 240
|
||||||
localStorage.setItem("list_update", "13.06.15");
|
edge: 'left', // Choose the horizontal origin
|
||||||
window.location.reload(true);
|
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||||
}
|
});
|
||||||
Youtube.setup_youtube_listener(chan);
|
|
||||||
Admin.admin_listener();
|
|
||||||
List.channel_listener();
|
|
||||||
|
|
||||||
$('ul.tabs').tabs();
|
$(".drag-target")[1].remove();
|
||||||
$("#settings").sideNav({
|
|
||||||
menuWidth: 300, // Default is 240
|
|
||||||
edge: 'right', // Choose the horizontal origin
|
|
||||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
|
||||||
});
|
|
||||||
$('.collapsible').collapsible({
|
|
||||||
accordion : true // A setting that changes the collapsible behavior to expandable instead of the default accordion style
|
|
||||||
});
|
|
||||||
|
|
||||||
//awdwad
|
if(!Helper.msieversion()) Notification.requestPermission();
|
||||||
$(".video-container").resizable({
|
if(navigator.userAgent.toLowerCase().indexOf("firefox") > -1) //quickdickfix for firefoxs weird percent handling
|
||||||
start: function(event, ui) {
|
$(".main").height(window.innerHeight-64);
|
||||||
$('iframe').css('pointer-events','none');
|
|
||||||
},
|
|
||||||
stop: function(event, ui) {
|
|
||||||
$('iframe').css('pointer-events','auto');
|
|
||||||
Crypt.set_width($(this).width());
|
|
||||||
},
|
|
||||||
handles: "e",
|
|
||||||
minWidth: 350
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(localStorage[chan.toLowerCase()])
|
|
||||||
{
|
|
||||||
if(localStorage[chan.toLowerCase()].length != 64)
|
|
||||||
localStorage.removeItem(chan.toLowerCase());
|
|
||||||
else
|
|
||||||
socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase()]);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
git_info = $.ajax({ type: "GET",
|
||||||
document.getElementById("search").blur();
|
url: "https://api.github.com/repos/zoff-music/zoff/commits",
|
||||||
Youtube.readyLooks();
|
async: false
|
||||||
}else{
|
}).responseText;
|
||||||
Chat.setup_chat_listener(chan);
|
|
||||||
Chat.allchat_listener();
|
|
||||||
if(!window.mobilecheck()) Hostcontroller.host_listener();
|
|
||||||
window.onYouTubeIframeAPIReady = Youtube.onYouTubeIframeAPIReady;
|
|
||||||
Youtube.loadPlayer();
|
|
||||||
|
|
||||||
$("#chat-btn").sideNav({
|
git_info = $.parseJSON(git_info);
|
||||||
menuWidth: 272, // Default is 240
|
$("#latest-commit").html("Latest Commit: <br>"
|
||||||
edge: 'left', // Choose the horizontal origin
|
+ git_info[0].commit.author.date.substring(0,10)
|
||||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
+ ": " + git_info[0].committer.login
|
||||||
|
+ "<br><a href='"+git_info[0].html_url+"'>"
|
||||||
|
+ git_info[0].sha.substring(0,10) + "</a>: "
|
||||||
|
+ git_info[0].commit.message+"<br");
|
||||||
|
|
||||||
|
Helper.sample();
|
||||||
|
}
|
||||||
|
|
||||||
|
$( "#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
||||||
|
$("#search").focus();
|
||||||
|
|
||||||
|
$('#base').bind("keyup keypress", function(e) {
|
||||||
|
var code = e.keyCode || e.which;
|
||||||
|
if (code == 13) {
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".drag-target")[1].remove();
|
$(".search_input").focus();
|
||||||
|
$(".search_input").keyup(function(event) {
|
||||||
|
|
||||||
if(!Helper.msieversion()) Notification.requestPermission();
|
search_input = $(this).val();
|
||||||
if(navigator.userAgent.toLowerCase().indexOf("firefox") > -1) //quickdickfix for firefoxs weird percent handling
|
|
||||||
$(".main").height(window.innerHeight-64);
|
|
||||||
|
|
||||||
git_info = $.ajax({ type: "GET",
|
if (event.keyCode != 40 && event.keyCode != 38 && event.keyCode != 13 && event.keyCode != 39 && event.keyCode != 37 &&
|
||||||
url: "https://api.github.com/repos/zoff-music/zoff/commits",
|
event.keyCode != 17 && event.keyCode != 16 && event.keyCode != 225 && event.keyCode != 18) {
|
||||||
async: false
|
clearTimeout(timeout_search);
|
||||||
}).responseText;
|
if(search_input.length < 3){$("#results").html("");}
|
||||||
|
if(event.keyCode == 13){
|
||||||
|
Search.search(search_input);
|
||||||
|
}else{
|
||||||
|
|
||||||
git_info = $.parseJSON(git_info);
|
timeout_search = setTimeout(function(){
|
||||||
$("#latest-commit").html("Latest Commit: <br>"
|
Search.search(search_input);
|
||||||
+ git_info[0].commit.author.date.substring(0,10)
|
}, 1000);
|
||||||
+ ": " + git_info[0].committer.login
|
/*i = 0;
|
||||||
+ "<br><a href='"+git_info[0].html_url+"'>"
|
timer=100;*/
|
||||||
+ git_info[0].sha.substring(0,10) + "</a>: "
|
}
|
||||||
+ git_info[0].commit.message+"<br");
|
|
||||||
|
|
||||||
Helper.sample();
|
|
||||||
}
|
|
||||||
|
|
||||||
$( "#results" ).hover( function() { $("div.result").removeClass("hoverResults"); i = 0; }, function(){ });
|
|
||||||
$("#search").focus();
|
|
||||||
|
|
||||||
$('#base').bind("keyup keypress", function(e) {
|
|
||||||
var code = e.keyCode || e.which;
|
|
||||||
if (code == 13) {
|
|
||||||
e.preventDefault();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".search_input").focus();
|
|
||||||
$(".search_input").keyup(function(event) {
|
|
||||||
search_input = $(this).val();
|
|
||||||
|
|
||||||
if (event.keyCode != 40 && event.keyCode != 38 && event.keyCode != 13 && event.keyCode != 39 && event.keyCode != 37) {
|
|
||||||
if(search_input.length < 3){$("#results").html("");}
|
|
||||||
if(event.keyCode == 13){
|
|
||||||
Search.search(search_input);
|
|
||||||
}else{
|
|
||||||
i = 0;
|
|
||||||
timer=100;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(function(){
|
/*setInterval(function(){
|
||||||
timer--;
|
timer--;
|
||||||
if(timer===0){
|
if(timer===0){
|
||||||
Search.search($(".search_input").val());
|
Search.search($(".search_input").val());
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);*/
|
||||||
}, 1000);
|
//}, 1000);
|
||||||
|
|
||||||
$("#embed-button").css("display", "inline-block");
|
$("#embed-button").css("display", "inline-block");
|
||||||
$("#embed-area").val('<embed src="https://zoff.no/embed.html#' + chan.toLowerCase() + '&autplay" width="600px" height="300px">');
|
$("#embed-area").val('<embed src="https://zoff.no/embed.html#' + chan.toLowerCase() + '&autplay" width="600px" height="300px">');
|
||||||
@@ -465,6 +482,7 @@ function onepage_load(){
|
|||||||
url: "php/nochan.php",
|
url: "php/nochan.php",
|
||||||
success: function(e){
|
success: function(e){
|
||||||
|
|
||||||
|
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
|
|
||||||
document.getElementById("volume-button").removeEventListener("click", Playercontrols.mute_video);
|
document.getElementById("volume-button").removeEventListener("click", Playercontrols.mute_video);
|
||||||
@@ -485,17 +503,27 @@ function onepage_load(){
|
|||||||
$("main").attr("class", "center-align container");
|
$("main").attr("class", "center-align container");
|
||||||
$("body").attr("id", "");
|
$("body").attr("id", "");
|
||||||
$("body").attr("style", "");
|
$("body").attr("style", "");
|
||||||
$("header").html($($(e)[37]).html());
|
$("header").html($($(e)[53]).html());
|
||||||
$($(e)[39]).insertAfter("header");
|
$($(e)[55]).insertAfter("header");
|
||||||
$($(e)[41]).insertAfter(".mega");
|
$($(e)[57]).insertAfter(".mega");
|
||||||
$("main").html($($(e)[45]).html());
|
$("main").html($($(e)[61]).html());
|
||||||
|
|
||||||
if($("#alreadyfp").length == 1){
|
if($("#alreadyfp").length == 1){
|
||||||
window.initfp();
|
window.initfp();
|
||||||
}else {
|
}else {
|
||||||
if(window.location.hostname == "zoff.no") number = 47;
|
if(window.location.hostname == "zoff.no") number = 47;
|
||||||
else number = 65;
|
else number = 65;
|
||||||
$("#scripts").append($($(e)[number]).html());
|
window.fromChannel = true;
|
||||||
|
//$("#scripts").append($($(e)[number]).html());
|
||||||
|
var scriptScript = document.createElement('script');
|
||||||
|
scriptScript.type = "text/javascript";
|
||||||
|
scriptScript.src = "/static/dist/frontpage.min.js";
|
||||||
|
//scriptScript.async = true;
|
||||||
|
//$.holdReady( true );
|
||||||
|
scriptScript.onreadystatechange = scriptScript.onload = function() {
|
||||||
|
window.initfp();
|
||||||
|
}
|
||||||
|
document.getElementById("scripts").appendChild(scriptScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($("#alreadychannel").length == 0){
|
if($("#alreadychannel").length == 0){
|
||||||
|
|||||||
@@ -239,13 +239,25 @@ var Nochan = {
|
|||||||
$(".mobile-search").remove();
|
$(".mobile-search").remove();
|
||||||
$("main").attr("class", "container center-align main");
|
$("main").attr("class", "container center-align main");
|
||||||
$("body").attr("id", "channelpage");
|
$("body").attr("id", "channelpage");
|
||||||
$("header").html($($(e)[37]).html());
|
$("header").html($($(e)[53]).html());
|
||||||
$("main").html($($(e)[41]).html());
|
$("main").html($($(e)[57]).html());
|
||||||
$("#search").attr("placeholder", "Find song on youtube");
|
$("#search").attr("placeholder", "Find song on youtube");
|
||||||
if($("#alreadychannel").length == 1){
|
if($("#alreadychannel").length == 1){
|
||||||
window.init();
|
window.init();
|
||||||
}else{
|
}else{
|
||||||
$("#scripts").append($($(e)[55]).html());
|
window.fromFront = true;
|
||||||
|
//console.log($($(e)[55]).html());
|
||||||
|
//$("#scripts").append($($(e)[55]).html());
|
||||||
|
var scriptScript = document.createElement('script');
|
||||||
|
scriptScript.type = "text/javascript";
|
||||||
|
scriptScript.src = "/static/dist/main.min.js";
|
||||||
|
//scriptScript.async = true;
|
||||||
|
//$.holdReady( true );
|
||||||
|
scriptScript.onreadystatechange = scriptScript.onload = function() {
|
||||||
|
window.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("scripts").appendChild(scriptScript);
|
||||||
}
|
}
|
||||||
if($("#alreadyfp").length == 0) $("head").append("<div id='alreadyfp'></div>");
|
if($("#alreadyfp").length == 0) $("head").append("<div id='alreadyfp'></div>");
|
||||||
}
|
}
|
||||||
@@ -258,7 +270,9 @@ String.prototype.capitalizeFirstLetter = function() {
|
|||||||
return this.charAt(0).toUpperCase() + this.slice(1);
|
return this.charAt(0).toUpperCase() + this.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$().ready(initfp);
|
$().ready(function(){
|
||||||
|
if(!window.fromChannel) initfp();
|
||||||
|
});
|
||||||
|
|
||||||
function share_link_modifier(){
|
function share_link_modifier(){
|
||||||
$("#facebook-code-link").attr("href", "https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/");
|
$("#facebook-code-link").attr("href", "https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/");
|
||||||
|
|||||||
Reference in New Issue
Block a user