From f71136c1a505794ecc79fe639d4c9b80258d7f08 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Sat, 28 Nov 2020 11:07:13 -0800 Subject: [PATCH] Set address bar width to screen width --- CHANGELOG | 3 +++ pkg/gmitohtml/assets.go | 27 +++++++++++++++++++++------ pkg/gmitohtml/convert.go | 8 -------- pkg/gmitohtml/daemon.go | 7 ++----- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c29fc4d..4539971 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +1.0.3: +- Set address bar width to screen width + 1.0.2: - Support bookmarks diff --git a/pkg/gmitohtml/assets.go b/pkg/gmitohtml/assets.go index 33d55fe..ddd6b60 100644 --- a/pkg/gmitohtml/assets.go +++ b/pkg/gmitohtml/assets.go @@ -10,15 +10,15 @@ const pageHeader = ` +
- -
` - -const navigationMenuText = ` -
+ + + -` +
+
` const inputPrompt = `
@@ -32,6 +32,7 @@ const inputPrompt = ` ` const pageFooter = ` +
` @@ -61,9 +62,23 @@ html { */ body { + margin: 0; + width: 100%; +} + +#content { margin: 0.67em; } +#navigationaddress { + box-sizing: border-box; + width: 100% +} + +#navigationbar { + padding: 4px 21px 7px 21px; +} + /** * Render the main element consistently in IE. */ diff --git a/pkg/gmitohtml/convert.go b/pkg/gmitohtml/convert.go index 1a76675..ba24b23 100644 --- a/pkg/gmitohtml/convert.go +++ b/pkg/gmitohtml/convert.go @@ -61,13 +61,6 @@ func rewriteURL(u string, loc *url.URL) string { return u } -func navigationMenu() []byte { - if daemonAddress == "" { - return nil - } - return []byte(navigationMenuText) -} - // Convert converts text/gemini to text/html. func Convert(page []byte, u string) []byte { var result []byte @@ -156,7 +149,6 @@ func Convert(page []byte, u string) []byte { } data := []byte(pageHeader) - data = append(data, navigationMenu()...) data = append(data, result...) data = append(data, []byte(pageFooter)...) return fillTemplateVariables(data, u, false) diff --git a/pkg/gmitohtml/daemon.go b/pkg/gmitohtml/daemon.go index 0bc548d..6656640 100644 --- a/pkg/gmitohtml/daemon.go +++ b/pkg/gmitohtml/daemon.go @@ -39,8 +39,6 @@ func bookmarksList() []byte { fakeURL, _ := url.Parse("/") // Always succeeds var b bytes.Buffer - b.Write([]byte(`
`)) - b.Write([]byte(`
Bookmarks
`)) b.Write([]byte(`