From 95c95d246771a60740c60af801fb265fbb93a5c8 Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Thu, 1 Jul 2021 14:45:29 +0500 Subject: [PATCH] Rename Omnipresent to Common --- assets/config.ini | 3 --- assets/devconfig.ini | 2 -- cfg/config.go | 18 +++++++++--------- views/stuff.qtpl | 6 +++--- views/stuff.qtpl.go | 14 +++++++------- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/assets/config.ini b/assets/config.ini index b6d3c5e..f60e60c 100644 --- a/assets/config.ini +++ b/assets/config.ini @@ -9,12 +9,9 @@ HeaderLinksHypha = header-links [Network] HTTPPort = 8080 URL = https://wiki -GeminiCertificatePath = /home/wiki/gemcerts [Authorization] UseFixedAuth = true -FixedAuthCredentialsPath = /home/wiki/mycocredentials.json UseRegistration = true -RegistrationCredentialsPath = /home/wiki/mycoregistration.json LimitRegistration = 10 diff --git a/assets/devconfig.ini b/assets/devconfig.ini index 4a26789..08435a1 100644 --- a/assets/devconfig.ini +++ b/assets/devconfig.ini @@ -12,8 +12,6 @@ URL = http://localhost:1737 [Authorization] UseFixedAuth = true -FixedAuthCredentialsPath = mycocredentials.json UseRegistration = true -RegistrationCredentialsPath = mycoregistration.json LimitRegistration = 3 diff --git a/cfg/config.go b/cfg/config.go index 602312f..9011955 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -30,9 +30,9 @@ var ( UseRegistration bool LimitRegistration int - OmnipresentScripts []string - ViewScripts []string - EditScripts []string + CommonScripts []string + ViewScripts []string + EditScripts []string ) // WikiDir is a full path to the wiki storage directory, which also must be a @@ -68,8 +68,8 @@ type Network struct { // CustomScripts is a section with paths to JavaScript files that are loaded on // specified pages. type CustomScripts struct { - // OmnipresentScripts: everywhere... - OmnipresentScripts []string `delim:"," comment:"These scripts are loaded from anywhere."` + // CommonScripts: everywhere... + CommonScripts []string `delim:"," comment:"These scripts are loaded from anywhere."` // ViewScripts: /hypha, /rev ViewScripts []string `delim:"," comment:"These scripts are only loaded on view pages."` // Edit: /edit @@ -106,9 +106,9 @@ func ReadConfigFile(path string) error { LimitRegistration: 0, }, CustomScripts: CustomScripts{ - OmnipresentScripts: []string{}, - ViewScripts: []string{}, - EditScripts: []string{}, + CommonScripts: []string{}, + ViewScripts: []string{}, + EditScripts: []string{}, }, } @@ -167,7 +167,7 @@ func ReadConfigFile(path string) error { UseFixedAuth = cfg.UseFixedAuth UseRegistration = cfg.UseRegistration LimitRegistration = int(cfg.LimitRegistration) - OmnipresentScripts = cfg.OmnipresentScripts + CommonScripts = cfg.CommonScripts ViewScripts = cfg.ViewScripts EditScripts = cfg.EditScripts diff --git a/views/stuff.qtpl b/views/stuff.qtpl index bdb37d1..0d7e74d 100644 --- a/views/stuff.qtpl +++ b/views/stuff.qtpl @@ -39,7 +39,7 @@
- {%= omnipresentScripts() %} + {%= CommonScripts() %} {% endfunc %} @@ -130,8 +130,8 @@ for u := range user.YieldUsers() { {% endfunc %} -{% func omnipresentScripts() %} -{% for _, scriptPath := range cfg.OmnipresentScripts %} +{% func CommonScripts() %} +{% for _, scriptPath := range cfg.CommonScripts %} {% endfor %} {% endfunc %} diff --git a/views/stuff.qtpl.go b/views/stuff.qtpl.go index 003cf02..bb060fe 100644 --- a/views/stuff.qtpl.go +++ b/views/stuff.qtpl.go @@ -106,7 +106,7 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User, `) //line views/stuff.qtpl:42 - streamomnipresentScripts(qw422016) + StreamCommonScripts(qw422016) //line views/stuff.qtpl:42 qw422016.N().S(` @@ -461,12 +461,12 @@ func AboutHTML() string { } //line views/stuff.qtpl:133 -func streamomnipresentScripts(qw422016 *qt422016.Writer) { +func StreamCommonScripts(qw422016 *qt422016.Writer) { //line views/stuff.qtpl:133 qw422016.N().S(` `) //line views/stuff.qtpl:134 - for _, scriptPath := range cfg.OmnipresentScripts { + for _, scriptPath := range cfg.CommonScripts { //line views/stuff.qtpl:134 qw422016.N().S(`