From: 2weiEmu Date: Wed, 29 Jan 2025 21:39:06 +0000 (+0100) Subject: made it so it's easier to keep track of scripts X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=4aeeb888c0621e1ab3bc6f5db92233287885bcda;p=creative-path-pep.git made it so it's easier to keep track of scripts --- diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go index 6fc0177..406eecb 100644 --- a/pkg/handlers/handlers.go +++ b/pkg/handlers/handlers.go @@ -1,17 +1,36 @@ package handlers import ( + "fmt" "net/http" "text/template" ) +var scriptNames = []string{ + "index.js", +} + +const scriptFormat = `` + +func formatAllScripts(args string) string { + totalFormat := "" + for _, name := range scriptNames { + totalFormat += fmt.Sprintf(scriptFormat, name, args) + } + fmt.Println("totalFormat:", totalFormat) + return totalFormat +} + type IndexPageStruct struct { + Scripts string } var indexTemplate, err = template.ParseFiles("static/templates/index.html") func HandleIndex(w http.ResponseWriter, r *http.Request) { - err := indexTemplate.Execute(w, IndexPageStruct{}) + err := indexTemplate.Execute(w, IndexPageStruct{ + formatAllScripts(""), + }) if err != nil { w.Write([]byte("error oopsie woopsie")) @@ -23,7 +42,9 @@ func HandleIndexDebug(w http.ResponseWriter, r *http.Request) { if err != nil { w.Write([]byte("error oopsie woopsie")) } - err = indexTemplate.Execute(w, IndexPageStruct{}) + err = indexTemplate.Execute(w, IndexPageStruct{ + formatAllScripts(""), + }) if err != nil { w.Write([]byte("error oopsie woopsie")) diff --git a/static/css/index.css b/static/css/index.css index 5b4eef9..f1f0a36 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -54,5 +54,13 @@ h1 { border-right: 3px solid black; } +#save-collapse-button { + background: none; + outline: none; + border: none; + color: var(--primary); + font-size: large; +} + .inner-sidebar { } diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..7905a73 --- /dev/null +++ b/static/js/index.js @@ -0,0 +1 @@ +console.log("Loaded index.js") diff --git a/static/templates/index.html b/static/templates/index.html index 6c06d57..050cf9c 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -5,15 +5,15 @@ - FacCalc + Phi Factory