EngliSEA.js
by webproger on 2022-10-03
ᐥ<script src='/EngliSEA.js'></script>ᐥ
var listionary = {
     q:null
    ,i:null
    ,image : function() {
        var b;
        listionary.i = document.createElement("img");
        listionary.i.setAttribute("src",'http://qindex.info/s/1768b76a74ef55c1acd8b78a3b6ae389.png');
        listionary.i.style.visibility = 'hidden';
        listionary.i.style.position = 'fixed';
        listionary.i.style.height  = '64px';
        listionary.i.style.right = '0px';
        listionary.i.style.top   = '50%';
        listionary.i.style.zIndex = '1000';
        listionary.i.setAttribute("onclick","listionary.open();");
        listionary.i.style.cursor = 'pointer';
        b = document.getElementsByTagName("body")[0];
        b.appendChild(listionary.i);
    }
    ,open : function() {
        window.open("http://qindex.info/listionary.php?q="+listionary.q);
    }
}
window.onload = listionary.image;
document.onselectionchange = function() {
    let s = document.getSelection().toString();
    let r = new RegExp("[-a-zA-Z'. ]{2,}");
    if(s.match(r)) {
        listionary.q = s;
        listionary.i.style.visibility = 'visible';
    } else {
        listionary.i.style.visibility = 'hidden';
    }
};