aboutsummaryrefslogtreecommitdiffstats
path: root/template.go
blob: 40b9c316875a3062cd6368c1e7d11b7d6e812916 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package gopherproxy

var tpltext = `<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{.Title}}</title>
</head>
<body>
<section>
<pre>
{{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}}      {{.Text}}{{end}}
{{end}}</pre>
</section>
<script type="text/javascript">
var qry=document.getElementsByClassName('QRY')
var i=qry.length
while (i--) {
  qry[i].addEventListener('click', function(e) {
    e.preventDefault();
    var resp=prompt("Please enter required input: ", "")
    if (resp !== "") window.location = e.target.href + "?" + resp
    return false;
  })
}
</script>
</body>
</html>`