Sha256: 3260d1f223671c88fe43379910ff65379313caf309441f57b7fbfbb0ef737672
Contents?: true
Size: 782 Bytes
Versions: 29
Compression:
Stored size: 782 Bytes
Contents
(function() { window.show_search_bar = function() { $('#searchbar').show(); return $('#searchbar > input').focus(); }; $(document).ready(function() { return $('#searchbar > input').change(function() { var anchor, text; text = $('#searchbar > input')[0].value; $('#searchbar').hide(); $('#searchbar > input')[0].value = ""; console.log("Searching " + text); if (window.find(text, 0, 0, 1)) { console.log("Found " + text); anchor = window.getSelection().anchorNode; if (anchor.nodeType !== 1) { anchor = anchor.parentNode; } anchor.focus(); return anchor.scrollIntoView(); } else { return alert("Cannot find " + text); } }); }); }).call(this);
Version data entries
29 entries across 29 versions & 1 rubygems