mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
rebuilding site Sun Jul 31 04:18:31 PM CST 2022
This commit is contained in:
parent
4087db750e
commit
1d24854e0b
15 changed files with 289 additions and 96 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue