Greasy Fork is available in English.

Toggl-Button Gitlab

Toggle button for Gitlab

Fra 06.07.2015. Se den seneste versjonen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  1. // ==UserScript==
  2. // @name Toggl-Button Gitlab
  3. // @namespace https://github.com/jurgenhaas/toggl-button-greasemonkey
  4. // @version 1.0
  5. // @include http*://gitlab.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.3/TogglLibrary.css
  15. // @description Toggle button for Gitlab
  16. // ==/UserScript==
  17.  
  18. new TogglButtonGM('.issue-details', function (elem) {
  19. var description, projectIds = [],
  20. numElem = elem.querySelector('.page-title', elem),
  21. titleElem = elem.querySelector('.issue-box .title, .issue-title', elem),
  22. projectElem = document.querySelector('.title');
  23.  
  24. description = titleElem.textContent.trim();
  25. if (numElem !== null) {
  26. description = numElem.childNodes[2].nodeValue.trim() + " " + description;
  27. }
  28.  
  29. if (projectElem !== null) {
  30. projectIds.push(projectElem.textContent.trim());
  31. }
  32.  
  33. return {
  34. className: 'gitlab',
  35. description: description,
  36. projectIds: projectIds
  37. };
  38. });