diff --git a/src/content/clickup.js b/src/content/clickup.js index 92d720c0c..f53cb76d3 100644 --- a/src/content/clickup.js +++ b/src/content/clickup.js @@ -1,18 +1,30 @@ +/** + * @name ClickUp + * @urlAlias clickup.com + * @urlRegex *://*.clickup.com/* + */ 'use strict'; +function getDescription() { + const description = document.querySelector('title').textContent.split('|')[0]; + const taskID = document.querySelector('div[role="dialog"]').getAttribute('data-task-id'); + + return `${description} - #${taskID}`; +} + togglbutton.render('#timeTrackingItem:not(.toggl)', { observe: true }, function ( elem ) { - const description = document.querySelector('title').textContent.split('|')[0]; - const taskID = document.querySelector('div[role="dialog"]').getAttribute('data-task-id'); - - const project = elem.querySelector('.space-name').textContent; + function getProject() { + const project = elem.querySelector('.space-name').textContent; + return project + } const link = togglbutton.createTimerLink({ className: 'clickup', - description: `${description} - #${taskID}`, - projectName: project, + description: getDescription, + projectName: getProject, buttonType: 'minimal' }); diff --git a/src/origins.js b/src/origins.js index 091f70b99..97e03af5d 100644 --- a/src/origins.js +++ b/src/origins.js @@ -83,7 +83,8 @@ export default { }, 'clickup.com': { url: '*://*.clickup.com/*', - name: 'ClickUp' + name: 'ClickUp', + file: 'clickup.js' }, 'cloudes.me': { url: '*://*.cloudes.me/*',