Atlassian JIRA - Auto-expand older comments

Automatically expands the older comments accordion in JIRA so you see all comments by default. Aids in searching page.

当前为 2017-04-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Atlassian JIRA - Auto-expand older comments
  3. // @description Automatically expands the older comments accordion in JIRA so you see all comments by default. Aids in searching page.
  4. // @include https://jira.*
  5. // @include http://jira.*
  6. // @match https://jira.*
  7. // @match http://jira.*
  8. // @version 0.2
  9. // @namespace https://greasyfork.org/users/77886
  10. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  11. // @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
  12. // ==/UserScript==
  13.  
  14. function clickWhenItAppears (jNode) {
  15. var clickEvent = document.createEvent ('MouseEvents');
  16. clickEvent.initEvent ('click', true, true);
  17. jNode[0].dispatchEvent (clickEvent);
  18. }
  19.  
  20. bWaitOnce = true;
  21. // <a class="collapsed-comments" href="(redacted)"><span class="collapsed-comments-line"></span><span class="collapsed-comments-line"></span><span class="show-more-comments" data-collapsed-count="12">12 older comments</span></a>
  22. waitForKeyElements (
  23. "a[class='collapsed-comments']",
  24. clickWhenItAppears
  25. );