diff options
| author | Jieiku | 2023-10-22 11:22:09 -0700 |
|---|---|---|
| committer | Jieiku | 2023-10-22 11:22:09 -0700 |
| commit | 8bca9db5ecb24813e83f5e5bdd2bf87c16ba06e4 (patch) | |
| tree | dfba781d758482ed128e0c165ef97e1ec9df1533 /static/js/search_tinysearch.min.js | |
| parent | b1f480de33a4893b76cd17b43478dd90432cdc4d (diff) | |
| download | abridge-8bca9db5ecb24813e83f5e5bdd2bf87c16ba06e4.tar.gz abridge-8bca9db5ecb24813e83f5e5bdd2bf87c16ba06e4.tar.bz2 abridge-8bca9db5ecb24813e83f5e5bdd2bf87c16ba06e4.zip | |
Search Results Page Translation Fix
Diffstat (limited to 'static/js/search_tinysearch.min.js')
| -rw-r--r-- | static/js/search_tinysearch.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/static/js/search_tinysearch.min.js b/static/js/search_tinysearch.min.js index dfcb383..a75829d 100644 --- a/static/js/search_tinysearch.min.js +++ b/static/js/search_tinysearch.min.js @@ -1 +1 @@ -function closeSearchNow(){document.querySelector("main").innerHTML=window.main}function goSearchNow(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),a='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> Results For: '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=a,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}async function lazyLoad(){var e=document.querySelector("meta[name='base']").getAttribute("content");await init((e="/"==e.slice(-1)?e.slice(0,-1):e)+"/tinysearch_engine_bg.wasm")}function closeAllLists(e){for(var t=document.getElementById("suggestions");t.firstChild;)t.removeChild(t.firstChild)}function markTerm(e,t){return e.replace(RegExp("(^|)("+t+")(|$)","ig"),"$1<mark><b>$2</b></mark>$3")}function autocomplete(e){e.addEventListener("input",function(e){var t=this.value;if(closeAllLists(),!t)return!1;for(var n=document.getElementById("suggestions"),o=search(t,99),a=0;a<o.length;a++){var c,r,i,s,u=o[a];(s=document.createElement("DIV")).innerHTML="<a href><span></span><span></span></a>",c=s.querySelector("a"),r=s.querySelector("span:first-child"),i=s.querySelector("span:nth-child(2)"),c.href=u[1]+"?q="+encodeURIComponent(t),r.innerHTML=markTerm(u[0],t),i.innerHTML=markTerm(u[2],t),n.appendChild(s)}})}function suggestionFocus(t){191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),searchinput.focus(),suggestions.classList.remove("d-none")),27===t.keyCode&&(searchinput.blur(),suggestions.classList.add("d-none"),closeAllLists());var n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){var o=[...n],a=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<a?a-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+a<o.length?1+a:a].focus())}}function getUint8Memory0(){return cachegetUint8Memory0=null!==cachegetUint8Memory0&&cachegetUint8Memory0.buffer===wasm.memory.buffer?cachegetUint8Memory0:new Uint8Array(wasm.memory.buffer)}function getStringFromWasm0(e,t){return cachedTextDecoder.decode(getUint8Memory0().subarray(e,e+t))}function addHeapObject(e){heap_next===heap.length&&heap.push(heap.length+1);var t=heap_next;return heap_next=heap[t],heap[t]=e,t}function passStringToWasm0(e,t,n){if(void 0===n){const n=cachedTextEncoder.encode(e),o=t(n.length);return getUint8Memory0().subarray(o,o+n.length).set(n),WASM_VECTOR_LEN=n.length,o}let o=e.length,a=t(o);var c=getUint8Memory0();let r=0;for(;r<o;r++){const t=e.charCodeAt(r);if(127<t)break;c[a+r]=t}if(r!==o){0!==r&&(e=e.slice(r)),a=n(a,o,o=r+3*e.length);const t=getUint8Memory0().subarray(a+r,a+o);r+=encodeString(e,t).written}return WASM_VECTOR_LEN=r,a}function getObject(e){return heap[e]}function dropObject(e){e<36||(heap[e]=heap_next,heap_next=e)}function takeObject(e){var t=getObject(e);return dropObject(e),t}function search(e,t){var e=passStringToWasm0(e,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),n=WASM_VECTOR_LEN;return takeObject(wasm.search(e,n,t))}async function load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t}var n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}return(n=await WebAssembly.instantiate(e,t))instanceof WebAssembly.Instance?{instance:n,module:e}:n}async function init(e){var t=document.querySelector("meta[name='base']").getAttribute("content"),t=("/"==t.slice(-1)&&(t=t.slice(0,-1)),void 0===e&&(e=new URL(t+"/tinysearch_engine_bg.wasm")),{wbg:{}}),{instance:e,module:t}=(t.wbg.__wbindgen_json_parse=function(e,t){return addHeapObject(JSON.parse(getStringFromWasm0(e,t)))},await load(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),t));return wasm=e.exports,init.__wbindgen_wasm_module=t,wasm}var loaded=!1,searchinput=(window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()}),document.getElementById("searchinput").onfocus=function(){loaded||(lazyLoad(),loaded=!0,document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})),document.getElementById("searchinput").onfocus=""}},document.getElementById("searchinput"));document.addEventListener("keydown",suggestionFocus);let wasm,cachedTextDecoder=(autocomplete(document.getElementById("searchinput")),new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})),cachegetUint8Memory0=(cachedTextDecoder.decode(),null);const heap=Array(32).fill(void 0);heap.push(void 0,null,!0,!1);let heap_next=heap.length,WASM_VECTOR_LEN=0,cachedTextEncoder=new TextEncoder("utf-8");const encodeString="function"==typeof cachedTextEncoder.encodeInto?function(e,t){return cachedTextEncoder.encodeInto(e,t)}:function(e,t){var n=cachedTextEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}};
\ No newline at end of file +function closeSearchNow(){document.querySelector("main").innerHTML=window.main}function goSearchNow(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),o=(n.id="results",document.createElement("div")),a='<form name="closeSearch"><h2><button type="submit" title="Close Search"><i class="svgs x"></i></button> <i class="svgs search"></i> '.concat(document.getElementById("searchinput").value,"</h2></form>");return o.innerHTML=a,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){closeSearchNow()}),!1}async function lazyLoad(){var e=document.querySelector("meta[name='base']").getAttribute("content");await init((e="/"==e.slice(-1)?e.slice(0,-1):e)+"/tinysearch_engine_bg.wasm")}function closeAllLists(e){for(var t=document.getElementById("suggestions");t.firstChild;)t.removeChild(t.firstChild)}function markTerm(e,t){return e.replace(RegExp("(^|)("+t+")(|$)","ig"),"$1<mark><b>$2</b></mark>$3")}function autocomplete(e){e.addEventListener("input",function(e){var t=this.value;if(closeAllLists(),!t)return!1;for(var n=document.getElementById("suggestions"),o=search(t,99),a=0;a<o.length;a++){var c,r,i,s,u=o[a];(s=document.createElement("DIV")).innerHTML="<a href><span></span><span></span></a>",c=s.querySelector("a"),r=s.querySelector("span:first-child"),i=s.querySelector("span:nth-child(2)"),c.href=u[1]+"?q="+encodeURIComponent(t),r.innerHTML=markTerm(u[0],t),i.innerHTML=markTerm(u[2],t),n.appendChild(s)}})}function suggestionFocus(t){191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),searchinput.focus(),suggestions.classList.remove("d-none")),27===t.keyCode&&(searchinput.blur(),suggestions.classList.add("d-none"),closeAllLists());var n=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==n.length){var o=[...n],a=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0<a?a-1:0].focus()):40===t.keyCode&&(t.preventDefault(),n[e=1+a<o.length?1+a:a].focus())}}function getUint8Memory0(){return cachegetUint8Memory0=null!==cachegetUint8Memory0&&cachegetUint8Memory0.buffer===wasm.memory.buffer?cachegetUint8Memory0:new Uint8Array(wasm.memory.buffer)}function getStringFromWasm0(e,t){return cachedTextDecoder.decode(getUint8Memory0().subarray(e,e+t))}function addHeapObject(e){heap_next===heap.length&&heap.push(heap.length+1);var t=heap_next;return heap_next=heap[t],heap[t]=e,t}function passStringToWasm0(e,t,n){if(void 0===n){const n=cachedTextEncoder.encode(e),o=t(n.length);return getUint8Memory0().subarray(o,o+n.length).set(n),WASM_VECTOR_LEN=n.length,o}let o=e.length,a=t(o);var c=getUint8Memory0();let r=0;for(;r<o;r++){const t=e.charCodeAt(r);if(127<t)break;c[a+r]=t}if(r!==o){0!==r&&(e=e.slice(r)),a=n(a,o,o=r+3*e.length);const t=getUint8Memory0().subarray(a+r,a+o);r+=encodeString(e,t).written}return WASM_VECTOR_LEN=r,a}function getObject(e){return heap[e]}function dropObject(e){e<36||(heap[e]=heap_next,heap_next=e)}function takeObject(e){var t=getObject(e);return dropObject(e),t}function search(e,t){var e=passStringToWasm0(e,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),n=WASM_VECTOR_LEN;return takeObject(wasm.search(e,n,t))}async function load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t}var n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}return(n=await WebAssembly.instantiate(e,t))instanceof WebAssembly.Instance?{instance:n,module:e}:n}async function init(e){var t=document.querySelector("meta[name='base']").getAttribute("content"),t=("/"==t.slice(-1)&&(t=t.slice(0,-1)),void 0===e&&(e=new URL(t+"/tinysearch_engine_bg.wasm")),{wbg:{}}),{instance:e,module:t}=(t.wbg.__wbindgen_json_parse=function(e,t){return addHeapObject(JSON.parse(getStringFromWasm0(e,t)))},await load(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),t));return wasm=e.exports,init.__wbindgen_wasm_module=t,wasm}var loaded=!1,searchinput=(window.onload=function(){document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()}),document.getElementById("searchinput").onfocus=function(){loaded||(lazyLoad(),loaded=!0,document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()})),document.getElementById("searchinput").onfocus=""}},document.getElementById("searchinput"));document.addEventListener("keydown",suggestionFocus);let wasm,cachedTextDecoder=(autocomplete(document.getElementById("searchinput")),new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})),cachegetUint8Memory0=(cachedTextDecoder.decode(),null);const heap=Array(32).fill(void 0);heap.push(void 0,null,!0,!1);let heap_next=heap.length,WASM_VECTOR_LEN=0,cachedTextEncoder=new TextEncoder("utf-8");const encodeString="function"==typeof cachedTextEncoder.encodeInto?function(e,t){return cachedTextEncoder.encodeInto(e,t)}:function(e,t){var n=cachedTextEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}};
\ No newline at end of file |
