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

View File

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

View File

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