Trying to get frontpage to work

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-09 19:19:07 +01:00
parent 1971783bbd
commit d5751e1f0e
5 changed files with 18 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -441,9 +441,17 @@ function onepage_load(){
$($(e)[39]).insertAfter(".mega"); $($(e)[39]).insertAfter(".mega");
$("main").html($($(e)[43]).html()); $("main").html($($(e)[43]).html());
if($("#alreadychannel").length == 0) $("head").append("<div id='alreadychannel'></div") console.log($($(e)[63]).html());
if($("#alreadyfp").length == 1) window.initfp();
else $("#scripts").append($($(e)[63]).html()); if($("#alreadyfp").length == 1){
window.initfp();
}else {
$("#scripts").append($($(e)[63]).html());
}
if($("#alreadychannel").length == 0){
$("head").append("<div id='alreadychannel'></div")
}
$("#channel-load").css("display", "none"); $("#channel-load").css("display", "none");
}, 1000); }, 1000);

View File

@@ -231,8 +231,6 @@ var Nochan = {
//console.log($(e)); //console.log($(e));
delete Nochan
socket.disconnect(); socket.disconnect();
if(!popstate) window.history.pushState("to the channel!", "Title", "/" + chan + "/"); if(!popstate) window.history.pushState("to the channel!", "Title", "/" + chan + "/");
@@ -283,15 +281,18 @@ function initfp(){
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";
socket = io.connect(''+add+':8880', connection_options); socket = io.connect(''+add+':8880', connection_options);
socket.emit('frontpage_lists');
socket.on('playlists', function(msg){ socket.on('playlists', function(msg){
$("#channels").empty(); $("#channels").empty();
Nochan.populate_channels(msg.channels); Nochan.populate_channels(msg.channels);
Nochan.set_viewers(msg.viewers); Nochan.set_viewers(msg.viewers);
}); });
socket.emit('frontpage_lists');
$("#channel-load").css("display", "none"); $("#channel-load").css("display", "none");
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000) //Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)
if(window.location.hash == "#donation") if(window.location.hash == "#donation")