From b60caaf7bcb2da227a756f86720842943aa4140d Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Tue, 24 Dec 2024 14:18:49 +0000 Subject: [PATCH] more html stuff Signed-off-by: Doug Davis --- registry/httpStuff.go | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/registry/httpStuff.go b/registry/httpStuff.go index 027082b3..b75a1a5e 100644 --- a/registry/httpStuff.go +++ b/registry/httpStuff.go @@ -308,11 +308,20 @@ func (pw *PageWriter) Done() { buf := pw.Buffer.Bytes() list := "" - list += fmt.Sprintf("
  • Default
  • \n") - for _, name := range GetRegistryNames() { - list += fmt.Sprintf("
  • %s
  • \n", - name, name) + regs := GetRegistryNames() + sort.Strings(regs) + regs = append([]string{"Default"}, regs...) + + for _, name := range regs { + checked := "" + if name == "Default" && !strings.Contains(pw.Info.BaseURL, "/reg-") { + checked = " selected" + } else if strings.Contains(pw.Info.BaseURL, "/reg-"+name) { + checked = " selected" + } + list += fmt.Sprintf("\n %s", checked, name) } + list += "\n" filters := "" prefix := MustPropPathFromPath(pw.Info.Abstract).UI() @@ -518,6 +527,9 @@ func (pw *PageWriter) Done() { font-family: courier ; width: 100%% } + select { + font-weight: bold ; + } .inlines { font-size: 13px ; font-family: courier ; @@ -551,17 +563,17 @@ func (pw *PageWriter) Done() { }
    - Registries: + Registry: + +

    - `+list+` -
    Filters: Inlines:`+inlines+`
    - `+ + `+ structureButton+`
    @@ -576,6 +588,15 @@ func (pw *PageWriter) Done() { var structureswitch = `+structureswitch+`; +function changeRegistry(name) { + var loc = "" + + if (name == "Default") loc = "/?ui" + else loc = "/reg-" + name + "?ui" + + window.location = loc +} + function apply() { var loc = "`+pw.Info.BaseURL+`/`+strings.Join(pw.Info.Parts, "/")+`"