diff --git a/public/init.js b/public/init.js index 9fb24f36..641ef6e8 100644 --- a/public/init.js +++ b/public/init.js @@ -218,20 +218,24 @@ function fetchPhrases(plist) { runInitHook("pre_iife"); let loggedIn = document.head.querySelector("[property='x-loggedin']").content == "true"; - let toLoad = 2; - // TODO: Shunt this into loggedIn if there aren't any search and filter widgets? - let q = (f) => { - toLoad--; - if(toLoad===0) initPhrases(loggedIn); - if(f) throw("template function not found"); - }; - if(loggedIn) { - toLoad += 2; - notifyOnScriptW("template_topic_c_edit_post", () => q(!Template_topic_c_edit_post)); - notifyOnScriptW("template_topic_c_attach_item", () => q(!Template_topic_c_attach_item)); + if(!window.location.pathname.startsWith("/panel/")) { + let toLoad = 2; + // TODO: Shunt this into loggedIn if there aren't any search and filter widgets? + let q = (f) => { + toLoad--; + if(toLoad===0) initPhrases(loggedIn); + if(f) throw("template function not found"); + }; + if(loggedIn) { + toLoad += 2; + notifyOnScriptW("template_topic_c_edit_post", () => q(!Template_topic_c_edit_post)); + notifyOnScriptW("template_topic_c_attach_item", () => q(!Template_topic_c_attach_item)); + } + notifyOnScriptW("template_topics_topic", () => q(!Template_topics_topic)); + notifyOnScriptW("template_paginator", () => q(!Template_paginator)); + } else { + initPhrases(false); } - notifyOnScriptW("template_topics_topic", () => q(!Template_topics_topic)); - notifyOnScriptW("template_paginator", () => q(!Template_paginator)); if(loggedIn) { fetch("/api/me/") diff --git a/templates/header.html b/templates/header.html index 57c8c31f..529c650d 100644 --- a/templates/header.html +++ b/templates/header.html @@ -7,7 +7,7 @@ {{range .Header.PreScriptsAsync}} {{end}} - + {{range .Header.ScriptsAsync}} {{end}}