gopherproxy/template.go

30 lines
817 B
Go
Raw Normal View History

package gopherproxy
2016-09-22 02:51:46 +00:00
var tpltext = `<!doctype html>
2017-09-16 06:10:17 +00:00
<html:>
2016-09-22 02:51:46 +00:00
<head>
<meta charset="utf-8">
2017-09-16 06:10:17 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1" />
2016-09-22 02:51:46 +00:00
<title>{{.Title}}</title>
</head>
<body>
2017-09-16 06:10:17 +00:00
<section>
2016-09-22 02:51:46 +00:00
<pre>
2016-09-22 14:02:59 +00:00
{{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}}
2016-09-22 02:51:46 +00:00
{{end}}</pre>
2017-09-16 06:10:17 +00:00
</section>
2016-09-22 14:02:59 +00:00
<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".QRY").click(function (e) {
2017-09-16 06:10:17 +00:00
e.preventDefault();
var query = prompt("Please enter required input: ", "");
if (query != null) {
window.location = e.target.href + "?" + query;
}
2016-09-22 14:02:59 +00:00
});
});
</script>
2016-09-22 02:51:46 +00:00
</body>
</html>`