A categorical programming language
Revision | f20fdf3a14c00f7bae868d219dbe97ef7bf23417 (tree) |
---|---|
Time | 2022-10-01 14:00:23 |
Author | Corbin <cds@corb...> |
Commiter | Corbin |
Autocomplete possible dippers.
@@ -21,6 +21,8 @@ tuples = {tuple(l): i for i, l in enumerate(heap) if isinstance(l, list)} | ||
21 | 21 | @app.route("/") |
22 | 22 | def home(): |
23 | 23 | dipperCount = len(symbols) |
24 | + dippers = "\n".join("<option value=\"%s\" />" % dipper | |
25 | + for dipper in symbols) | |
24 | 26 | heapCount = len(heap) |
25 | 27 | return f""" |
26 | 28 | <!DOCTYPE html5> |
@@ -32,18 +34,19 @@ def home(): | ||
32 | 34 | <p>There are {dipperCount} dippers available.</p> |
33 | 35 | <p>The heap has {heapCount} rows.</p> |
34 | 36 | <form id="dipper-form"> |
35 | - <input type="textbox" id="dipper" /> | |
37 | + <input list="dippers" id="dipper" /> | |
36 | 38 | <button id="go" type="submit">Go!</button> |
37 | 39 | </form> |
38 | - <div id="log"> | |
39 | - <p>Log starts here</p> | |
40 | - </div> | |
40 | + <div id="log"></div> | |
41 | 41 | <script |
42 | 42 | src="{ url_for("static", filename="bilby.min.js") }" |
43 | 43 | type="text/javascript"></script> |
44 | 44 | <script |
45 | 45 | src="{ url_for("static", filename="honey.js") }" |
46 | 46 | type="text/javascript"></script> |
47 | + <datalist id="dippers"> | |
48 | + {dippers} | |
49 | + </datalist> | |
47 | 50 | </body> |
48 | 51 | """ |
49 | 52 |