Atlassian JIRA - Auto-expand older comments

Automatically expands the older comments accordion in JIRA so you see all comments by default. Workaround to jira.comment.collapsing.minimum.hidden. Aids in searching page.

当前为 2018-05-08 提交的版本,查看 最新版本

  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. Workaround to jira.comment.collapsing.minimum.hidden. Aids in searching page.
  4. // @include https://jira.*
  5. // @include http://jira.*
  6. // @match https://jira.*
  7. // @match http://jira.*
  8. // @exclude *?jql=*
  9. // @exclude *&jql=*
  10. // @version 0.4
  11. // @namespace https://greasyfork.org/users/77886
  12. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  13. // @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
  14. // ==/UserScript==
  15.  
  16. function clickWhenItAppears (jNode) {
  17. var clickEvent = document.createEvent ('MouseEvents');
  18. clickEvent.initEvent ('click', true, true);
  19. jNode[0].dispatchEvent (clickEvent);
  20. }
  21.  
  22. bWaitOnce = true;
  23. // <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>
  24. waitForKeyElements (
  25. "a[class='collapsed-comments']",
  26. clickWhenItAppears
  27. );