all repos — honk @ 1d311893e2c8967cfe27bcebb6b4eefd10425ce6

my fork of honk

allow setting local.js
Ted Unangst tedu@tedunangst.com
Wed, 02 Mar 2022 14:44:40 -0500
commit

1d311893e2c8967cfe27bcebb6b4eefd10425ce6

parent

d207a9a462b15864cbf37c1ff39d981dec3fbd09

3 files changed, 12 insertions(+), 2 deletions(-)

jump to
M views/honk.htmlviews/honk.html

@@ -54,7 +54,7 @@ <p>

<details class="noise" {{ .Open }} > <summary>{{ .HTPrecis }}<p></summary> <p>{{ .HTPrecis }} -<p>{{ .HTML }} +<p class="content">{{ .HTML }} {{ with .Time }} <p>Time: {{ .StartTime.Local.Format "03:04PM EDT Mon Jan 02"}} {{ if .Duration }}<br>Duration: {{ .Duration }}{{ end }}
M views/honkpage.htmlviews/honkpage.html

@@ -29,6 +29,9 @@ module.addguesscontrols(elem, word, wordlist, xid)

}) } </script> +{{ if .LocalJSParam }} +<script src="/local.js{{ .LocalJSParam }}"></script> +{{ end }} </div> {{ if and .HonkCSRF (not .IsPreview) }} <div class="info" id="refreshbox">
M web.goweb.go

@@ -78,6 +78,7 @@ templinfo := make(map[string]interface{})

templinfo["StyleParam"] = getassetparam(viewDir + "/views/style.css") templinfo["LocalStyleParam"] = getassetparam(dataDir + "/views/local.css") templinfo["JSParam"] = getassetparam(viewDir + "/views/honkpage.js") + templinfo["LocalJSParam"] = getassetparam(dataDir + "/views/local.js") templinfo["ServerName"] = serverName templinfo["IconName"] = iconName templinfo["UserSep"] = userSep

@@ -2470,7 +2471,12 @@ viewDir+"/views/onts.html",

viewDir+"/views/honkpage.js", ) if !develMode { - assets := []string{viewDir + "/views/style.css", dataDir + "/views/local.css", viewDir + "/views/honkpage.js"} + assets := []string{ + viewDir + "/views/style.css", + dataDir + "/views/local.css", + viewDir + "/views/honkpage.js", + dataDir + "/views/local.js", + } for _, s := range assets { savedassetparams[s] = getassetparam(s) }

@@ -2521,6 +2527,7 @@ getters.HandleFunc("/style.css", serveviewasset)

getters.HandleFunc("/honkpage.js", serveviewasset) getters.HandleFunc("/wonk.js", serveviewasset) getters.HandleFunc("/local.css", servedataasset) + getters.HandleFunc("/local.js", servedataasset) getters.HandleFunc("/icon.png", servedataasset) getters.HandleFunc("/favicon.ico", servedataasset)