Jira Workflow transitioner shortcuts

Shortcut keys of > and < to trigger first two options in workflow transition.

当前为 2017-09-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Jira Workflow transitioner shortcuts
  3. // @namespace randomecho.com
  4. // @description Shortcut keys of > and < to trigger first two options in workflow transition.
  5. // @include https://*.atlassian.net/browse/*
  6. // @include */browse/*
  7. // @grant none
  8. // @copyright 2017 Soon Van
  9. // @author Soon Van - randomecho.com
  10. // @license http://opensource.org/licenses/BSD-3-Clause
  11. // @version 1.0
  12. // ==/UserScript==
  13.  
  14. function transitionIssue(e) {
  15. var workflowTransitions = document.getElementsByClassName('issueaction-workflow-transition');
  16.  
  17. if (!workflowTransitions[0])
  18. return;
  19.  
  20. if (e.key === '>' || (e.shiftKey && e.keyCode === 190)) {
  21. workflowTransitions[0].click();
  22. } else if (e.key === '<' || (e.shiftKey && e.keyCode === 188) && workflowTransitions[1]) {
  23. workflowTransitions[1].click();
  24. }
  25. }
  26.  
  27. document.addEventListener('keydown', transitionIssue, false);