diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 21:22:00 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 21:22:00 +1200 |
commit | ccd6eeed4b8eafcfd2530057fb645915fe335caf (patch) | |
tree | f950def13a56a87c9b8c7eb5dc8ea0ab5d49f33d | |
parent | 1431b36c4a226dc9b57a3334364a0c40162c388f (diff) | |
download | mitmproxy-ccd6eeed4b8eafcfd2530057fb645915fe335caf.tar.gz mitmproxy-ccd6eeed4b8eafcfd2530057fb645915fe335caf.tar.bz2 mitmproxy-ccd6eeed4b8eafcfd2530057fb645915fe335caf.zip |
Make "Go" button on preview form work.
-rw-r--r-- | libpathod/app.py | 2 | ||||
-rw-r--r-- | libpathod/templates/index.html | 11 | ||||
-rw-r--r-- | libpathod/templates/preview.html | 6 | ||||
-rw-r--r-- | libpathod/templates/previewform.html | 12 | ||||
-rw-r--r-- | todo | 1 |
5 files changed, 15 insertions, 17 deletions
diff --git a/libpathod/app.py b/libpathod/app.py index 0274853b..fbb99dc4 100644 --- a/libpathod/app.py +++ b/libpathod/app.py @@ -11,7 +11,7 @@ class Index(_Page): name = "index" section = "main" def get(self): - self.render(self.name, section=self.section) + self.render(self.name, section=self.section, spec="") class Preview(_Page): diff --git a/libpathod/templates/index.html b/libpathod/templates/index.html index f5808c4d..396137d6 100644 --- a/libpathod/templates/index.html +++ b/libpathod/templates/index.html @@ -1,13 +1,4 @@ {% extends frame.html %} {% block body %} - <form class="well form-search" method="GET" action="/preview"> - <input style="width: 30em;" name="spec" class="input-medium search-query"> - <input type="submit" class="btn" value="preview"> - <a href="#" class="btn">go</a> - </form> - <script> - $(function(){ - console.log("pigs"); - }); - </script> + {% include previewform.html %} {% end %} diff --git a/libpathod/templates/preview.html b/libpathod/templates/preview.html index 6599362f..63960ebe 100644 --- a/libpathod/templates/preview.html +++ b/libpathod/templates/preview.html @@ -20,9 +20,5 @@ <pre>{{ output }}</pre> {% end %} - <form class="well form-search" method="GET" action="/preview"> - <input style="width: 30em;" name="spec" class="input-medium search-query" value="{{spec}}"> - <input type="submit" class="btn" value="preview"> - <a href="#" class="btn">go</a> - </form> +{% include previewform.html %} {% end %} diff --git a/libpathod/templates/previewform.html b/libpathod/templates/previewform.html new file mode 100644 index 00000000..42502ba7 --- /dev/null +++ b/libpathod/templates/previewform.html @@ -0,0 +1,12 @@ +<form class="well form-search" method="GET" action="/preview"> + <input id="spec" style="width: 30em;" name="spec" class="input-medium search-query" value="{{spec}}"> + <input type="submit" class="btn" value="preview"> + <a href="#" id="submitspec" class="btn">go</a> +</form> +<script> + $(function(){ + $("#submitspec").click(function(){ + document.location = "/p/" + $("#spec").val() + }); + }); +</script> @@ -1,6 +1,5 @@ 0.1: - - Web status and explain - setup.py - API - Logs, log reset, log retrieval |