don't do server pushes for unneccesary resources on ajax topics

save bytes in init.js
This commit is contained in:
Azareal 2020-03-13 19:02:28 +10:00
parent bfea6b740f
commit 4d8858b846
2 changed files with 11 additions and 24 deletions

View File

@ -37,9 +37,7 @@ function addInitHook(name,h) {
}
// Temporary hack for templates
function len(it) {
return it.length;
}
function len(it) {return it.length;}
function asyncGetScript(src) {
return new Promise((resolve,reject) => {
@ -109,8 +107,7 @@ function notifyOnScriptW(name,complete,success) {
complete();
if(success!==undefined) success();
}).catch(e => {
console.log("Unable to get script name '"+name+"'");
console.log("e",e);
console.log("Unable to get script name '"+name+"'",e);
console.trace();
complete(e);
});
@ -133,8 +130,7 @@ function loadScript(name,callback,fail) {
asyncGetScript(iurl)
.then(callback)
.catch(e => {
console.log("Unable to get script '"+iurl+"'");
console.log("e",e);
console.log("Unable to get script '"+iurl+"'",e);
console.trace();
});
}
@ -144,17 +140,7 @@ function loadScript(name,callback,fail) {
});
}
/*function loadTmpl(name,callback) {
let url = "/s/"+name
let worker = new Worker(url);
}*/
function DoNothingButPassBack(it) {
return it;
}
function RelativeTime(date) {
return date;
}
function RelativeTime(date) {return date;}
function initPhrases(loggedIn, panel=false) {
console.log("in initPhrases")

View File

@ -128,6 +128,7 @@ func renderTemplate3(tmplName, hookName string, w http.ResponseWriter, r *http.R
if h.CurrentUser.Loggedin {
h.AddScriptAsync("member.js")
}
h.CurrentUser.LastAgent = 0
}
if h.CurrentUser.Loggedin {