diff options
author | James Tomasino <github@jamestomasino.com> | 2018-03-24 02:48:16 -0400 |
---|---|---|
committer | James Mills <prologic@shortcircuit.net.au> | 2018-03-23 23:48:16 -0700 |
commit | 5518da1cb642e7228f045d52a819afb244760b77 (patch) | |
tree | 760113186feccbfd43d37e88245f30743f87777d | |
parent | Updated README with instructions for using prebuilt image (diff) | |
download | gopherproxy-5518da1cb642e7228f045d52a819afb244760b77.tar.gz gopherproxy-5518da1cb642e7228f045d52a819afb244760b77.tar.bz2 gopherproxy-5518da1cb642e7228f045d52a819afb244760b77.zip |
remove jquery & replace with vanilla-js; cleaned stray html: char (#8)
-rw-r--r-- | template.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/template.go b/template.go index 6d47d06..40b9c31 100644 --- a/template.go +++ b/template.go | |||
@@ -1,7 +1,7 @@ | |||
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 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
@@ -13,17 +13,17 @@ var tpltext = `<!doctype html> | |||
13 | {{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} | 13 | {{range .Lines}} {{if .Link}}({{.Type}}) <a class="{{ .Type }}" href="{{.Link}}">{{.Text}}</a>{{else}} {{.Text}}{{end}} |
14 | {{end}}</pre> | 14 | {{end}}</pre> |
15 | </section> | 15 | </section> |
16 | <script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script> | ||
17 | <script type="text/javascript"> | 16 | <script type="text/javascript"> |
18 | $(document).ready(function () { | 17 | var qry=document.getElementsByClassName('QRY') |
19 | $(".QRY").click(function (e) { | 18 | var i=qry.length |
20 | e.preventDefault(); | 19 | while (i--) { |
21 | var query = prompt("Please enter required input: ", ""); | 20 | qry[i].addEventListener('click', function(e) { |
22 | if (query != null) { | 21 | e.preventDefault(); |
23 | window.location = e.target.href + "?" + query; | 22 | var resp=prompt("Please enter required input: ", "") |
24 | } | 23 | if (resp !== "") window.location = e.target.href + "?" + resp |
25 | }); | 24 | return false; |
26 | }); | 25 | }) |
26 | } | ||
27 | </script> | 27 | </script> |
28 | </body> | 28 | </body> |
29 | </html>` | 29 | </html>` |