NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name ZadrotoSeach // @namespace ZadrotoSeach // @version 1.2.4 // @description Zadroto seach // @author JD99 // @match http://*/* // @match https://*/* // @grant none // ==/UserScript== var textsech = ""; picWA = "background-image: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAuRXhpZgAASUkqAAgAAAACAAABBAABAAAAGQAAAAEBBAABAAAAGQAAAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAZABkDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDwz4E/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P2VCFKrWrr2H1eU4ycMTeNKnChF/Ynhn9i39mPwhpfxe0TQfhZZW+j/Hgf8AF1NLvPEfjLWNP8TH7Xq9+HgtNZ8R6hB4blW91zUbtJfCsehypcPaSo6vpmmGz808Of8ABND9inwo3hh9G+Dk0Ung3xHdeLPDTXHxJ+LN6ul65eTaRNc3ENvdeOpbWS1n/sHSoZdKngl0mW1tpLWSxeC9v47r7uor9fdCg3FuhQbhFxg3QoNwi5upKMG6DcIyqN1JRi4xlNucoym3J/p/+sPEPJi6X+sPEHsswnGrmFL+38+9lj6sMFLLYVMfT/tz2ePqQy6c8ujUx1PGzjl05ZeprASlgX8lfC/9h39mz4O/EKz+KXgTwj4qsvGumxajBpV9rPxd+MPivSNJh1XT7nStQGl+EPFXjzWfB1jPd6ddTWlzf2+gJqNzGIXubyaa2tpIvrWiipw2FwuDpRw+DwuGweHhfkoYTDYfCUIX35KGFw+GoQv15KMb9bnh0qNGhCNKhRo0KUfhpUKNGhSjsvdpUKVClHRL4aUdle5//9k=);" $( document ).ready(function() { img_css = 'float:left;background-size: contain;width:25px!important;height:25px!important; cursor: pointer;margin: 1px;border-radius: 3px;box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.59);'; div_css = 'display:none;position:absolute;z-index:100000;'; $('html').append('<div id="zadrotoseach" style="'+div_css+'">' + '<div style="'+picS+img_css+'" class="s1 zadrotoseach" ></div>'+ '<div style="'+picWA+img_css+'" class="s2 zadrotoseach"></div>'+ '<div style="'+picR+img_css+'" class="s3 zadrotoseach"></div>'+ '</div>'); }); $(document).mousedown(function(e){ if ($(e.target).hasClass('zadrotoseach')){ if ($(e.target).hasClass('s1')) { urlM1 = 'https://shikimori.org/animes/search/'; textsech1 = urlEncode2 (textsech); } if ($(e.target).hasClass('s2')) { urlM1 = 'http://www.world-art.ru/search.php?global_sector=all&public_search='; textsech1 = urlEncode (textsech); } if ($(e.target).hasClass('s3')) { urlM1 = 'http://rutracker.net/forum/tracker.php?&f=1105,1386,1387,1388,1389,1390,1391,1478,1642,2491,281,282,404,599,893&nm=' textsech1 = urlEncode2 (textsech); } $('#zadrotoseach').fadeOut(0) $('#zadrotoseach').offset({top:0, left:0}); clearSelection() setTimeout(function() { window.open(urlM1+textsech1, '_blank'); }, 30); } else { $('#zadrotoseach').fadeOut(30) $('#zadrotoseach').offset({top:0, left:0}); } }); $(document).mouseup(function(e){ setTimeout(function() { range = getRangeObject(); if (range) { textsech = String(range); if ( textsech.length == 0 ) {return false;} var x = e.pageX; var y = e.pageY; $('#zadrotoseach').offset({top:y+10, left:x+5}); $('#zadrotoseach').fadeIn(30) } }, 30); }); function urlEncode(str) { if (!str || typeof(str) == "undefined") return; var utf8Array = {}; var i = j = j2 = 0; for (i = 0; i <= 255; i++) { j = parseInt(i/16); var j2 = parseInt(i%16); utf8Array[String.fromCharCode(i)] = ('%' + j.toString(16) + j2.toString(16)).toUpperCase(); } var rusAdditional = { '_' : '%5F', 'А' : '%C0', 'Б' : '%C1', 'В' : '%C2', 'Г' : '%C3', 'Д' : '%C4', 'Е' : '%C5', 'Ж' : '%C6', 'З' : '%C7', 'И' : '%C8', 'Й' : '%C9', 'К' : '%CA', 'Л' : '%CB', 'М' : '%CC', 'Н' : '%CD', 'О' : '%CE', 'П' : '%CF', 'Р' : '%D0', 'С' : '%D1', 'Т' : '%D2', 'У' : '%D3', 'Ф' : '%D4', 'Х' : '%D5', 'Ц' : '%D6', 'Ч' : '%D7', 'Ш' : '%D8', 'Щ' : '%D9', 'Ъ' : '%DA', 'Ы' : '%DB', 'Ь' : '%DC', 'Э' : '%DD', 'Ю' : '%DE', 'Я' : '%DF', 'а' : '%E0', 'б' : '%E1', 'в' : '%E2', 'г' : '%E3', 'д' : '%E4', 'е' : '%E5', 'ж' : '%E6', 'з' : '%E7', 'и' : '%E8', 'й' : '%E9', 'к' : '%EA', 'л' : '%EB', 'м' : '%EC', 'н' : '%ED', 'о' : '%EE', 'п' : '%EF', 'р' : '%F0', 'с' : '%F1', 'т' : '%F2', 'у' : '%F3', 'ф' : '%F4', 'х' : '%F5', 'ц' : '%F6', 'ч' : '%F7', 'ш' : '%F8', 'щ' : '%F9', 'ъ' : '%FA', 'ы' : '%FB', 'ь' : '%FC', 'э' : '%FD', 'ю' : '%FE', 'я' : '%FF', 'ё' : '%B8', 'Ё' : '%A8' } for (i in rusAdditional) utf8Array[i] = rusAdditional[i]; var res = ""; for(i = 0; i < str.length; i++) { var simbol = str.substr(i,1); res += typeof utf8Array[simbol] != "undefined" ? utf8Array[simbol] : simbol; } res = res.replace(/\s{2,}/g, ' '); res = res.replace(/\s/g, "+"); return res; } function urlEncode2(str) { str = str.replace(/\s{2,}/g, ' '); str = str.replace(/\./g, " "); str = str.replace(/\s+/g,' ') str = str.replace(/[\s{2,}]+/g, ' '); str = str.replace(/\s/g, "+"); return str; } function fixIERangeObject(range, win) { win = win || window; if (!range) return null; if (!range.startContainer && win.document.selection) { var _findTextNode = function(parentElement, text) { var container = null, offset = -1; for (var node = parentElement.firstChild; node; node = node.nextSibling) { if (node.nodeType == 3) { var find = node.nodeValue; var pos = text.indexOf(find); if (pos == 0 && text != find) { text = text.substring(find.length); } else { container = node; offset = text.length - 1; break; } } } return { node: container, offset: offset }; } var rangeCopy1 = range.duplicate(), rangeCopy2 = range.duplicate(); var rangeObj1 = range.duplicate(), rangeObj2 = range.duplicate(); rangeCopy1.collapse(true); rangeCopy1.moveEnd('character', 1); rangeCopy2.collapse(false); rangeCopy2.moveStart('character', -1); var parentElement1 = rangeCopy1.parentElement(), parentElement2 = rangeCopy2.parentElement(); if (parentElement1 instanceof HTMLInputElement || parentElement2 instanceof HTMLInputElement) { return null; } rangeObj1.moveToElementText(parentElement1); rangeObj1.setEndPoint('EndToEnd', rangeCopy1); rangeObj2.moveToElementText(parentElement2); rangeObj2.setEndPoint('EndToEnd', rangeCopy2); var text1 = rangeObj1.text; var text2 = rangeObj2.text; var nodeInfo1 = _findTextNode(parentElement1, text1); var nodeInfo2 = _findTextNode(parentElement2, text2); range.startContainer = nodeInfo1.node; range.startOffset = nodeInfo1.offset; range.endContainer = nodeInfo2.node; range.endOffset = nodeInfo2.offset + 1; } return range; } function getRangeObject(win) { win = win || window; if (win.getSelection) { try { return win.getSelection().getRangeAt(0); } catch (e) { /*If no text is selected an exception might be thrown*/ } } else if (win.document.selection) { var range = win.document.selection.createRange(); return fixIERangeObject(range, win); } return null; } function clearSelection() { if (window.getSelection) { window.getSelection().removeAllRanges(); } else { document.selection.empty(); } }