From 0728ce81f7586ce6787afd1f7bd20fe365931ee1 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Sat, 10 Sep 2022 19:25:14 +0800 Subject: [PATCH] rebuilding Sat Sep 10 07:25:14 PM CST 2022 --- zh/searchurl/txt/mdict.html | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/zh/searchurl/txt/mdict.html b/zh/searchurl/txt/mdict.html index 45780662..30f2b8f2 100644 --- a/zh/searchurl/txt/mdict.html +++ b/zh/searchurl/txt/mdict.html @@ -78,27 +78,26 @@ let dictinput = document.getElementById('dictfile'); let wordinput = document.getElementById('word'); let btnLookup = document.getElementById('btnLookup'); - let v = location.hash.substring(6); - wordinput.value = v; - window.onhashchange = function() { - let v = location.hash.substring(6); - if(v.length>0){ - wordinput.value = v; - //wordinput.dispatchEvent(new Event('change', {'bubbles': true})); - btnLookup.click(); - } - }; - //dictinput.onClick = {(e)=>{e.target.value="";}}; window.onload = function() { + let v = location.hash.substring(6); + wordinput.value = v; + let filenames = location.search.substring(6); if(filenames.length>0){ dictinput.setAttribute('accept',filenames); location.href="i:5fdictinput.click()"; - //setTimeout(()=>{location.href="i:5fdictinput.click();"},100); - //setTimeout(()=>{location.href="i:5fdictinput.click();"},300); setTimeout(()=>{dictinput.dispatchEvent(new Event('change'));dictinput.removeAttribute('accept')},500); } + window.onhashchange = function() { + let v = location.hash.substring(6); + if(v.length>0){ + wordinput.value = v; + //wordinput.dispatchEvent(new Event('change', {'bubbles': true})); + btnLookup.click(); + } + }; + }