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