Toggl-Button GitHub

Toggle button for GitHub

当前为 2015-11-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Toggl-Button GitHub
  3. // @namespace https://gitlab.paragon-es.de/toggl-button
  4. // @version 1.4
  5. // @include http*://github.com/*/*/issues/*
  6. // @include http*://github.com/*/*/poll/*
  7. // @include http*://github.com/*/*/issues/new
  8. // @grant GM_xmlhttpRequest
  9. // @grant GM_addStyle
  10. // @grant GM_getResourceText
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM_info
  14. // @grant GM_registerMenuCommand
  15. // @require https://gf.qytechs.cn/scripts/2670-toggllibrary/code/TogglLibrary.js
  16. // @resource togglStyle https://gitlab.paragon-es.de/toggl-button/core/raw/latest/TogglLibrary.css
  17. // @description Toggle button for GitHub
  18. // ==/UserScript==
  19.  
  20. new TogglButtonGM('#partial-discussion-header', function (elem) {
  21. var description, projectIds = [],
  22. numElem = elem.querySelector('.gh-header-number', elem),
  23. titleElem = elem.querySelector('.js-issue-title', elem),
  24. authorElem = document.querySelector('.url.fn'),
  25. projectElem = document.querySelector('.js-current-repository');
  26.  
  27. description = titleElem.textContent.trim();
  28. if (numElem !== null) {
  29. description = numElem.textContent.trim() + " " + description;
  30. }
  31.  
  32. if (authorElem !== null) {
  33. projectIds.push(authorElem.textContent.trim());
  34. }
  35. if (projectElem !== null) {
  36. projectIds.push(projectElem.textContent.trim());
  37. }
  38.  
  39. return {
  40. className: 'github',
  41. description: description,
  42. projectIds: projectIds
  43. };
  44. });

QingJ © 2025

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