diff --git a/src/content/teamwork.js b/src/content/teamwork.js index e56407391..489f63c2f 100644 --- a/src/content/teamwork.js +++ b/src/content/teamwork.js @@ -1,3 +1,9 @@ +/** + * @name Teamwork + * @urlAlias teamwork.com + * @urlRegex *://*.teamwork.com/* + */ + 'use strict'; // Tasks listing page in project @@ -174,3 +180,29 @@ togglbutton.render( root.appendChild(link); } ); + +// Teamwork Desk - new design (March 2022) +togglbutton.render( + '.ticket-view-page--container:not(.toggl)', + { observe: true }, + function (elem) { + // ticket view + const container = $('.title-container', elem); + const id = $('.ticket-id', elem).textContent; + const description = $('.title__subject', elem).textContent; + + const descFunc = function () { + return id.trim() + ' ' + description.trim(); + }; + + const link = togglbutton.createTimerLink({ + className: 'teamwork', + buttonType: 'minimal', + description: descFunc + }); + + link.style.margin = '3px 0 0 7px'; + + container.appendChild(link); + } +); \ No newline at end of file diff --git a/src/origins.js b/src/origins.js index 20eb8bd23..10206a1b1 100644 --- a/src/origins.js +++ b/src/origins.js @@ -588,7 +588,8 @@ export default { }, 'teamwork.com': { url: '*://*.teamwork.com/*', - name: 'Teamwork' + name: 'Teamwork', + file: 'teamwork.js' }, 'teamworkpm.net': { url: '*://*.teamworkpm.net/*',