Advertisement
Guest User

Additional Podio Keyboard Shortcuts

a guest
Mar 26th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       Additional Podio Keyboard Shortcuts
  3. // @namespace  http://www.schreibkraft.biz/
  4. // @version    0.3
  5. // @description Adds: ⌥N for new entry, ⌥S to trigger save button
  6. // @match      https://podio.com/*
  7. // @copyright  2014+, Bernhard Uellenberg
  8. // ==/UserScript==
  9. //
  10. function doc_keyUp(e) {
  11.     // alert(e.keyCode);
  12.     // U can use e.metaKey or e.ctrlKey, depending which key should be pressed the same time
  13.     if (e.altKey) {
  14.         switch (e.keyCode) {
  15.             case 78:
  16.                 // N
  17.                 if(document.location.href.match(/\/apps\/.+s/)) {
  18.                     document.location.href = document.location.href + '/items/new';
  19.                 }
  20.                 break;
  21.                
  22.             case 83:
  23.                 // S
  24.                 $('.save').trigger('click');
  25.                 break;
  26.  
  27.             default:
  28.                 break;
  29.         }
  30.     }
  31. }
  32. document.addEventListener('keyup', doc_keyUp, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement