Toggl-Button Gitlab

Toggl (see http://toggl.com) is an online time tracking platform and this user script integrates it so that you can easily start and stop time entries and quickly recognize which task is currently active. More details can be found at https://github.com/jurgenhaas/toggl-button-greasemonkey

目前为 2015-07-06 提交的版本。查看 最新版本

// ==UserScript==
// @name        Toggl-Button Gitlab
// @namespace   https://github.com/jurgenhaas/toggl-button-greasemonkey
// @version     1.2
// @include     http*://gitlab.com/*
// @grant       GM_xmlhttpRequest
// @grant       GM_addStyle
// @grant       GM_getResourceText
// @grant       GM_getValue
// @grant       GM_setValue
// @grant       GM_info
// @grant       GM_registerMenuCommand
// @require     https://gf.qytechs.cn/scripts/2670-toggllibrary/code/TogglLibrary.js
// @resource    togglStyle https://raw.githubusercontent.com/jurgenhaas/toggl-button-greasemonkey/v1.1/TogglLibrary.css
// @description Toggl (see http://toggl.com) is an online time tracking platform and this user script integrates it so that you can easily start and stop time entries and quickly recognize which task is currently active. More details can be found at https://github.com/jurgenhaas/toggl-button-greasemonkey
// ==/UserScript==

new TogglButtonGM('.issue-details', function (elem) {
  var description, projectIds = [],
    numElem = elem.querySelector('.page-title', elem),
    titleElem = elem.querySelector('.issue-box .title, .issue-title', elem),
    projectElem = document.querySelector('.title');

  description = titleElem.textContent.trim();
  if (numElem !== null) {
    description = numElem.childNodes[2].nodeValue.trim() + " " + description;
  }

  if (projectElem !== null) {
    projectIds.push(projectElem.textContent.trim());
  }

  return {
    className: 'gitlab',
    description: description,
    projectIds: projectIds
  };
});

QingJ © 2025

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