diff options
| author | Jieiku | 2023-05-22 22:37:44 -0700 |
|---|---|---|
| committer | Jieiku | 2023-05-22 22:37:44 -0700 |
| commit | 6dcec618d0ff0a2270f787f62267a0622275c69d (patch) | |
| tree | f0dd674fe43331db55ddae38808749de0323f030 /static/stork_config.js | |
| parent | 71d977d49afbf93e0c736815e36d59664991fa18 (diff) | |
| download | abridge-6dcec618d0ff0a2270f787f62267a0622275c69d.tar.gz abridge-6dcec618d0ff0a2270f787f62267a0622275c69d.tar.bz2 abridge-6dcec618d0ff0a2270f787f62267a0622275c69d.zip | |
Load Tinysearch/Stork On Demand
Diffstat (limited to 'static/stork_config.js')
| -rw-r--r-- | static/stork_config.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/static/stork_config.js b/static/stork_config.js index 5480a18..3c589c2 100644 --- a/static/stork_config.js +++ b/static/stork_config.js @@ -11,4 +11,15 @@ function loadStork() { }); // download WASM stork.register("stork",baseUrl + "/stork.st"); } -loadStork();
\ No newline at end of file +var loaded = false; +window.onload = function() { + document.body.contains(document.goSearch) && (document.goSearch.onsubmit = function() { return goSearchNow() }) + document.getElementById('searchinput').onfocus = function() { + if (!loaded) { + loadStork(); + loaded = true; + document.body.contains(document.goSearch) && (document.goSearch.onsubmit = function() { return goSearchNow() }) + } + document.getElementById('searchinput').onfocus = ''; + } +}; |
