Toggl-Button GitHub

Toggle button for github.com

当前为 2014-06-20 提交的版本,查看 最新版本

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

QingJ © 2025

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