From ff9f26ebbcc9777a37d160dcf28af08996986b33 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Wed, 3 Aug 2022 16:57:07 +0800 Subject: [PATCH] rebuilding site Wed Aug 3 04:57:06 PM CST 2022 --- zh/searchurl/txt/mdict.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/zh/searchurl/txt/mdict.html b/zh/searchurl/txt/mdict.html index 3cac1cc1..30a9dce5 100644 --- a/zh/searchurl/txt/mdict.html +++ b/zh/searchurl/txt/mdict.html @@ -78,6 +78,8 @@ 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){ @@ -86,13 +88,16 @@ btnLookup.click(); } }; - + + //dictinput.onClick = {(e)=>{e.target.value="";}}; let filenames = location.search.substring(6); if(filenames.length>0){ dictinput.setAttribute('accept',filenames); - location.href="i:5fdictinput.click();setTimeout(()=>{btnLookup.click();dictinput.removeAttribute('accept');},70)"; + 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(); +