Mercurial > hg > GlobalNeighbors
diff globalneighbors/templates/index.html @ 7:254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 25 Jun 2017 09:13:48 -0700 |
parents | 316e1d54ffd4 |
children | 21ed15391e8a |
line wrap: on
line diff
--- a/globalneighbors/templates/index.html Sat Jun 24 15:47:59 2017 -0700 +++ b/globalneighbors/templates/index.html Sun Jun 25 09:13:48 2017 -0700 @@ -2,9 +2,27 @@ <html> <head> <title>Global Neighbors</title> + <script src="https://code.jquery.com/jquery-1.12.4.js"></script> + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> + <script> + $( function() { + $( "#cities" ).autocomplete({ + source: "/cities", + autoFocus: true, + minLength: 3, + delay: 3000 + }); + }); + </script> </head> <body> <h1>Global Neighbors</h1> <h2>Serving {{ n_cities }} cities</h2> + + <div class="ui-widget"> + <label for="cities">Enter a city: </label> + <input id="cities"/> + </div> + </body> </html>