5 <base href=
"https://fastly.jsdelivr.net/gh/fengdh/mdict-js/">
7 <meta name=
"viewport" content=
"width=device-width, initial-scale=1">
8 <link rel=
"stylesheet" type=
"text/css" href=
"selectize.default.css" media=
"screen">
19 #btnLookup:not([disabled]) {
28 #word + .selectize-control {
29 display: inline-block;
34 <script type=
"text/javascript" src=
"conf.js"></script>
35 <script src=
"require.js" data-main=
"mdict"></script>
38 Choose a dictionary file (*.mdx + optional *.mdd):
<input id=
"dictfile" type=
"file" multiple
>
40 <input id=
"word" type=
"text" value=
"">
41 <input id=
"btnLookup" type=
"button" value=
"look up" disabled=
"false">
43 <div id=
"dict-title"></div>
47 //?file=.../xx.xx,.../xx.xxx#word=
48 var dictinput
= document
.getElementById('dictfile');
49 var wordinput
= document
.getElementById('word');
50 var btnLookup
= document
.getElementById('btnLookup');
52 window
.onhashchange = function() {
53 let v
= location
.hash
.substring(6);
56 //wordinput.dispatchEvent(new Event('change', {'bubbles': true}));
62 let v
= decodeURIComponent(location
.hash
.substring(6));
67 let filenames
= location
.search
.substring(6);
68 window
.onload = function(){
69 if(filenames
.length
>0){
70 let clickurl
= "i:5fdictinput.click():"+filenames
;
71 location
.href
=clickurl
;
72 //setTimeout(()=>{dictinput.dispatchEvent(new Event('change', {'bubbles': true}));},100);
74 var callbackTimer
= setInterval(function() {
75 let files
= dictinput
.files
;
77 if(!btnLookup
.disabled
){
78 clearInterval(callbackTimer
);
82 location
.href
=clickurl
;
83 dictinput
.dispatchEvent(new Event('change', {'bubbles': true}));