Skip to content

Instantly share code, notes, and snippets.

@alexdresko
Last active August 29, 2015 14:07
Show Gist options
  • Save alexdresko/1ebd8ff2b1db2fe66c85 to your computer and use it in GitHub Desktop.
Save alexdresko/1ebd8ff2b1db2fe66c85 to your computer and use it in GitHub Desktop.
Additional TFS online keyboard shortcuts ala TamperMonkey/GreaseMonkey
// ==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