Skip to content

Instantly share code, notes, and snippets.

@mescoda
Last active November 10, 2016 07:56
Show Gist options
  • Save mescoda/66e3c65b751c8f7d0226 to your computer and use it in GitHub Desktop.
Save mescoda/66e3c65b751c8f7d0226 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name toggl-helper
// @namespace toggl-helper
// @version 0.3.1
// @author mescoda on http://mescoda.com/
// @include https://toggl.com/app/timer
// @grant unsafeWindow
// ==/UserScript==
document.body.addEventListener('keyup', function (e) {
if (e.target.nodeName.toLowerCase() !== 'input') {
switch (e.keyCode) {
// i 73
case 73:
unsafeWindow.jQuery('.TimeEntryDescription__timeEntryDescription').click();
unsafeWindow.jQuery('.TimeEntryDescription__timeEntryDescription').focus();
break;
// s 83
case 83:
unsafeWindow.toggl.model.TimeEntries.stopTracking();
break;
// n 78
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment