Toggl-Button Jira

Toggle button for Jira

  1. // ==UserScript==
  2. // @name Toggl-Button Jira
  3. // @namespace https://gitlab.paragon-es.de/toggl-button
  4. // @version 0.9
  5. // @include http*://*.atlassian.com/browse/*
  6. // @include http*://*.atlassian.net/browse/*
  7. // @grant GM_xmlhttpRequest
  8. // @grant GM_addStyle
  9. // @grant GM_getResourceText
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @grant GM_info
  13. // @grant GM_registerMenuCommand
  14. // @require https://gf.qytechs.cn/scripts/2670-toggllibrary/code/TogglLibrary.js
  15. // @resource togglStyle https://gitlab.paragon-es.de/toggl-button/core/raw/master/TogglLibrary.css
  16. // @description Toggle button for Jira
  17. // ==/UserScript==
  18.  
  19. new TogglButtonGM('.issue-header-content', function (elem) {
  20. var description, projectIds = [],
  21. id = elem.querySelector('#key-val'),
  22. titleElem = elem.querySelector('#summary-val'),
  23. projectElem = elem.querySelector('#project-name-val'),
  24. tagsElem = document.querySelector('.labels-wrap-value span'),
  25. tags = [];
  26.  
  27. description = titleElem.textContent.trim();
  28. if (id !== null) {
  29. description = id.textContent.trim() + " " + description;
  30. }
  31.  
  32. if (projectElem !== null) {
  33. projectIds.push(projectElem.textContent.trim());
  34. }
  35.  
  36. if (tagsElem !== null) {
  37. for (var i = 0, element; elements = tagsElem[i]; i++) {
  38. var text = element.textContent.trim();
  39. if (text != 'None') {
  40. tags.push(text);
  41. }
  42. }
  43. }
  44.  
  45. return {
  46. className: 'jira',
  47. description: description,
  48. projectIds: projectIds,
  49. tags: tags
  50. };
  51. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址