diff options
Diffstat (limited to 'js/dict.js')
-rw-r--r-- | js/dict.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/dict.js b/js/dict.js new file mode 100644 index 0000000..7b36d78 --- /dev/null +++ b/js/dict.js @@ -0,0 +1,12 @@ +$(window).on("mouseup touchend", function() { + if (!navigator.onLine) return; + + var sel = getSelection().toString().trim(); + + if (sel.match(/^\w+$/)) { + parent.dict_lookup(sel, function() { + getSelection().removeAllRanges(); + }); + } +}); + |