diff options
author | James Mills <prologic@shortcircuit.net.au> | 2017-09-15 23:10:17 -0700 |
---|---|---|
committer | James Mills <prologic@shortcircuit.net.au> | 2017-09-15 23:10:17 -0700 |
commit | 1fbccfa2470990c29ac3edb93ad7e0d91d26622f (patch) | |
tree | ddee8c7214bc99a324e9ec1af1320563d3923c21 | |
parent | Set sensible defaults (diff) | |
download | gopherproxy-1fbccfa2470990c29ac3edb93ad7e0d91d26622f.tar.gz gopherproxy-1fbccfa2470990c29ac3edb93ad7e0d91d26622f.tar.bz2 gopherproxy-1fbccfa2470990c29ac3edb93ad7e0d91d26622f.zip |
Spruce up the style a bit
-rw-r--r-- | template.go | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/template.go b/template.go index 6fb1162..3b0fe2f 100644 --- a/template.go +++ b/template.go | |||
@@ -1,29 +1,45 @@ | |||
1 | package gopherproxy | 1 | package gopherproxy |
2 | 2 | ||
3 | var tpltext = `<!doctype html> | 3 | var tpltext = `<!doctype html> |
4 | <html> | 4 | <html:> |
5 | <head> | 5 | <head> |
6 | <meta charset="utf-8"> | 6 | <meta charset="utf-8"> |
7 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
7 | <title>{{.Title}}</title> | 8 | <title>{{.Title}}</title> |
8 | <style> | 9 | <style> |
9 | * { | 10 | body { |
10 | font-family: Monospace; | 11 | background: #FFFFFF; |
11 | } | 12 | } |
13 | |||
14 | section { | ||
15 | margin: auto; | ||
16 | width: 50%; | ||
17 | font-family:Courier; | ||
18 | color: #CCCCCC; | ||
19 | background: #000000; | ||
20 | border: 3px double #CCCCCC; | ||
21 | color: #FFFFFF; | ||
22 | border-radius: 1em; | ||
23 | padding: 1em; | ||
24 | overflow-x: auto; | ||
25 | } | ||
12 | </style> | 26 | </style> |
13 | </head> | 27 | </head> |
14 | <body> | 28 | <body> |
29 | <section> | ||
15 | <pre> | 30 | <pre> |
16 | {{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} | 31 | {{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} |
17 | {{end}}</pre> | 32 | {{end}}</pre> |
33 | </section> | ||
18 | <script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script> | 34 | <script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script> |
19 | <script type="text/javascript"> | 35 | <script type="text/javascript"> |
20 | $(document).ready(function () { | 36 | $(document).ready(function () { |
21 | $(".QRY").click(function (e) { | 37 | $(".QRY").click(function (e) { |
22 | e.preventDefault(); | 38 | e.preventDefault(); |
23 | var query = prompt("Please enter required input: ", ""); | 39 | var query = prompt("Please enter required input: ", ""); |
24 | if (query != null) { | 40 | if (query != null) { |
25 | window.location = e.target.href + "?" + query; | 41 | window.location = e.target.href + "?" + query; |
26 | } | 42 | } |
27 | }); | 43 | }); |
28 | }); | 44 | }); |
29 | </script> | 45 | </script> |