diff options
Diffstat (limited to 'static/search_facade_tinysearch.js')
| -rw-r--r-- | static/search_facade_tinysearch.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/static/search_facade_tinysearch.js b/static/search_facade_tinysearch.js index 84eef82..c928818 100644 --- a/static/search_facade_tinysearch.js +++ b/static/search_facade_tinysearch.js @@ -1,17 +1,16 @@ -var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); -if (baseUrl.slice(-1) == "/") { - baseUrl = baseUrl.slice(0, -1); -} -var sha256='6207e0e054d79360bf9ba96c57c29cd0fc74dad470108d2967ab5f4a8059be6e'; -var sha384='v7zeE9S7EtbyaWph0D+9ntMWbjg4318Of0zydaSQWel5E7MtOYLQH4JcTHtm9w3C'; -function loadSearchNow() { - var loadSearch = document.createElement('script'); - loadSearch.src = baseUrl + '/search_bundle_tinysearch.min.js?h=' + sha256; - loadSearch.setAttribute('integrity', 'sha384-' + sha384); - loadSearch.setAttribute('type', 'module'); - document.head.appendChild(loadSearch); - document.getElementById('searchinput').onclick = ''; -} window.onload = function() { - document.getElementById('searchinput').onclick = function() { return loadSearchNow() } + document.getElementById('searchinput').onclick = function() { + var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); + if (baseUrl.slice(-1) == "/") { + baseUrl = baseUrl.slice(0, -1); + } + var sha256='1532d7e7d8292eec3ae8364d3d76029049533141d0674e4a02b1a17986e5f8ef'; + var sha384='POHXtCCwUbHtLT1Hn4+cEysiGJyU7RbnIQKfucRPc9gAquQsFc6j4Zca1HoWo+GS'; + var loadSearch = document.createElement('script'); + loadSearch.src = baseUrl + '/search_bundle_tinysearch.min.js?h=' + sha256; + loadSearch.setAttribute('integrity', 'sha384-' + sha384); + loadSearch.setAttribute('type', 'module'); + document.head.appendChild(loadSearch); + document.getElementById('searchinput').onclick = ''; + } }; |
