Updated the way dynamic content is added

This commit is contained in:
Kasper Rynning-Tønnesen
2017-01-13 12:38:32 +01:00
parent 1c65b6d035
commit b4c2d75f00
3 changed files with 17 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1139,16 +1139,18 @@ function onepage_load(){
document.title = "Zöff"; document.title = "Zöff";
} }
var response = $("<div>" + e + "</div>");
$(".drag-target").remove(); $(".drag-target").remove();
$("#sidenav-overlay").remove(); $("#sidenav-overlay").remove();
$("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)[63]).html()); $("header").html($(response.find("header")).html());
$($(e)[65]).insertAfter("header"); $($(response.find(".section.mega"))).insertAfter("header");
$($(e)[67]).insertAfter(".mega"); $($(response.find(".section.mobile-search"))).insertAfter(".mega");
if(Helper.mobilecheck()) $("main").html($($(e)[71]).html()); if(Helper.mobilecheck()) $("main").html($(response.find("main")).html());
else $("main").append($($($(e)[71]).html())[0]); else $("main").append($(response.find("#main_section_frontpage")).wrap("<div>").parent().html());
$(".page-footer").removeClass("padding-bottom-extra"); $(".page-footer").removeClass("padding-bottom-extra");
$(".page-footer").removeClass("padding-bottom-novideo"); $(".page-footer").removeClass("padding-bottom-novideo");
$("#favicon").attr("href", "public/images/favicon.png"); $("#favicon").attr("href", "public/images/favicon.png");

View File

@@ -264,17 +264,19 @@ var Nochan = {
window.chan = new_channel; window.chan = new_channel;
} }
var response = $("<div>" + e + "</div>");
$(".mega").remove(); $(".mega").remove();
$(".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)[63]).html()); //$("header").html($($(e)[63]).html());
$("header").html($(response.find("header")).html());
if($("#alreadychannel").length === 0 || Helper.mobilecheck() || Player.player === undefined){ if($("#alreadychannel").length === 0 || Helper.mobilecheck() || Player.player === undefined){
$("main").html($($(e)[67]).html()); $("main").html($(response.find("main")).html());
} else { } else {
var main = $($($($($(e)[67]).html())[0]).html()); $("#main-row").append($(response.find("#playlist").wrap("<div>").parent().html()));
$("#main-row").append($(main[2]).wrap("<div>").parent().html()); $("#video-container").append($(response.find("#main_components").wrap("<div>").parent().html()));
$("#video-container").append($($($(main[0]).html())[4]).wrap("<div>").parent().html());
$("#main-row").append("<div id='playbar'></div>"); $("#main-row").append("<div id='playbar'></div>");
$("#player").removeClass("player_bottom"); $("#player").removeClass("player_bottom");
$("#main-row").removeClass("frontpage_modified_heights"); $("#main-row").removeClass("frontpage_modified_heights");