rebuilding site Sun Jul 31 04:18:31 PM CST 2022

This commit is contained in:
James Feng Cao 2022-07-31 16:18:31 +08:00
parent 4087db750e
commit 1d24854e0b
15 changed files with 289 additions and 96 deletions

View file

@ -75,20 +75,24 @@
</section>
<script>
//?file=./xxx/xx.xx,./xx/xx.xxx#word=
let filenames = location.search.substring(6);
let word = location.hash.substring(6);
let dictinput = document.getElementById('dictfile');
let wordinput = document.getElementById('word');
let btnLookup = document.getElementById('btnLookup');
wordinput.value = word;
{
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();
}
};
let filenames = location.search.substring(6);
if(filenames.length>0){
dictinput.setAttribute('accept',filenames);
location.href="i:5fsetTimeout(()=>{dictinput.click()},20);setTimeout(()=>{btnLookup.click();dictinput.removeAttribute('accept');},70)";
}
window.addEventListener('hashchange', function() {
wordinput.value = location.hash.substring(6);
btnLookup.click();
});
window.onhashchange();
</script>
</body>
</html>