Toggl-Button GitHub

Toggle button for github.com

2014-08-21 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

  1. // ==UserScript==
  2. // @name Toggl-Button GitHub
  3. // @namespace https://github.com/jurgenhaas/toggl-button-greasemonkey
  4. // @version 1.2
  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://greatest.deepsurf.us/scripts/2670-toggllibrary/code/TogglLibrary.js
  14. // @resource togglStyle https://raw.githubusercontent.com/jurgenhaas/toggl-button-greasemonkey/v1.1/TogglLibrary.css
  15. // @description Toggle button for github.com
  16. // ==/UserScript==
  17.  
  18. new TogglButtonGM('#partial-discussion-header', function (elem) {
  19. var description, projectIds = [],
  20. numElem = elem.querySelector('.gh-header-number', elem),
  21. titleElem = elem.querySelector('.js-issue-title', elem),
  22. authorElem = document.querySelector('.url.fn'),
  23. projectElem = document.querySelector('.js-current-repository');
  24.  
  25. description = titleElem.textContent.trim();
  26. if (numElem !== null) {
  27. description = numElem.textContent.trim() + " " + description;
  28. }
  29.  
  30. if (authorElem !== null) {
  31. projectIds.push(authorElem.textContent.trim());
  32. }
  33. if (projectElem !== null) {
  34. projectIds.push(projectElem.textContent.trim());
  35. }
  36.  
  37. return {
  38. className: 'github',
  39. description: description,
  40. projectIds: projectIds
  41. };
  42. });