Last active
August 29, 2015 14:07
-
-
Save alexdresko/1ebd8ff2b1db2fe66c85 to your computer and use it in GitHub Desktop.
Additional TFS online keyboard shortcuts ala TamperMonkey/GreaseMonkey
This file contains 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 characters
// ==UserScript== | |
// @name TFS online shortcuts | |
// @author Alex Dresko | |
// @namespace http://www.alexdresko.com | |
// @version 0.5 | |
// @description Some additional shortcuts for TFS online | |
// @match https://*.visualstudio.com/* | |
// @copyright 2014+, Alex Dresko | |
// @require 'http://code.jquery.com/jquery-1.11.1.min.js' | |
// @updateURL 'https://gist.githubusercontent.com/alexdresko/1ebd8ff2b1db2fe66c85/raw/tfsonlinekeyboardshortcuts.user.js' | |
// @downloadURL 'https://gist.githubusercontent.com/alexdresko/1ebd8ff2b1db2fe66c85/raw/tfsonlinekeyboardshortcuts.user.js' | |
// ==/UserScript== | |
$(function() { | |
function doc_keyUp(e) { | |
var steps = $($("a[rawtitle|='Steps to Reproduce']")[0]); | |
if (!steps) { steps = $($("a[rawtitle|='Description']")[0]); } | |
if (e.altKey && e.keyCode == 83) { | |
// call your function to do the thing | |
var asdf = document.getElementById("searchbox"); | |
$(asdf).focus(); | |
} | |
if (e.altKey && e.keyCode == 75) { | |
$($(steps).closest('div').find('table')[0]).find('iframe').contents().find('body').focus(); | |
} | |
} | |
document.addEventListener('keyup', doc_keyUp, true, true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment