Created
May 23, 2013 00:48
Revisions
-
Evan Borgstrom created this gist
May 23, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ // // This is a userscript for activecollab that allows for you to press the 's' // key on any page and have it focus the search input box allowing for quick // searching. // // author: Evan Borgstrom (@borgstrom) // license: MIT // window.onkeydown = function(event) { // only work when the body is focused if (document.activeElement != document.body) { return; } // look for the "s" key if (event.keyCode == 83) { // focus the search input element and prevent the event // propagation so 's' doesn't end up in the input document.getElementsByName("q")[0].focus(); return false; } }