aboutsummaryrefslogtreecommitdiffstats
path: root/template.go
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2016-09-23 00:02:59 +1000
committerJames Mills <prologic@shortcircuit.net.au>2016-09-23 00:02:59 +1000
commit0105bbb0d56f4ca845df1b73cd2a0b8e94a968ae (patch)
treee5b81a0844d4b6f85467d4e3747ca095cffb3f6f /template.go
parentAdded templating support (diff)
downloadgopherproxy-0105bbb0d56f4ca845df1b73cd2a0b8e94a968ae.tar.gz
gopherproxy-0105bbb0d56f4ca845df1b73cd2a0b8e94a968ae.tar.bz2
gopherproxy-0105bbb0d56f4ca845df1b73cd2a0b8e94a968ae.zip
Add query support
Diffstat (limited to 'template.go')
-rw-r--r--template.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/template.go b/template.go
index 7c13451..c0a79a4 100644
--- a/template.go
+++ b/template.go
@@ -8,7 +8,19 @@ var tpltext = `<!doctype html>
8</head> 8</head>
9<body> 9<body>
10<pre> 10<pre>
11{{range .Lines}} {{if .Link}}({{.Type}}) <a href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} 11{{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}}
12{{end}}</pre> 12{{end}}</pre>
13<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script>
14<script type="text/javascript">
15$(document).ready(function () {
16 $(".QRY").click(function (e) {
17 e.preventDefault();
18 var query = prompt("Please enter required input: ", "");
19 if (query != null) {
20 window.location = e.target.href + "%09" + query;
21 }
22 });
23});
24</script>
13</body> 25</body>
14</html>` 26</html>`