diff --git a/app.py b/app.py index 0d036b1..9243c97 100644 --- a/app.py +++ b/app.py @@ -111,6 +111,7 @@ cached: dict = { "css_response": open("styles/human_readable.css", "r").read(), "css_collapsible": open("styles/collapsible.css", "r").read(), "js_collapsible": open("js/collapsible.js", "r").read(), + "js_shortcode": open("js/shortcode.js", "r").read(), } # Fill the chapter list with unique chapters for seeking back and forward by index. @@ -125,6 +126,13 @@ for book in range(1, 67): "SELECT c FROM fts_kjv where b = ? ORDER BY id DESC LIMIT 1;", (book,) ).fetchone()[0] +@app.get("/js/shortcode.js") +def serve_shortcode_js(): + return cached.get("js_shortcode") + +@app.get("/js/collapsible.js") +def serve_collapsible_js(): + return cached.get("js_collapsible") def generate_short_id(): remain = random.randrange(614_656, 17_210_367) # resolves to length of 5 @@ -467,7 +475,7 @@ def parse_query(query_override: str = None): ) result += "