diff --git a/src/content/wrike.js b/src/content/wrike.js index a7bd2174f..5f1d1bb2f 100644 --- a/src/content/wrike.js +++ b/src/content/wrike.js @@ -4,43 +4,42 @@ * @urlRegex *://*.wrike.com/* */ -'use strict'; - +'use strict' togglbutton.render( 'work-item-title:not(.toggl)', { observe: true }, function (elem) { const container = document.querySelector('action-panel') - const viewContainer = document.querySelector('entity-view') + const viewContainer = document.querySelector('work-item-location') const getTitleElement = function () { - const wsTaskTitle = elem.querySelectorAll('task-title'); + const wsTaskTitle = elem.querySelectorAll('task-title') if (wsTaskTitle.length === 1 && wsTaskTitle[0].textContent !== '') { - return wsTaskTitle[0]; + return wsTaskTitle[0] } - return $('title'); - }; + return $('title') + } const descriptionText = function () { - const titleElem = getTitleElement(); - const titleElemText = titleElem ? titleElem.textContent : 'not found'; - - return `${titleElemText.trim().replace(' - Wrike', '')}`.trim(); - }; + const titleElem = getTitleElement() + const titleElemText = titleElem ? titleElem.textContent : 'not found' + + return `${titleElemText.trim().replace(' - Wrike', '')}`.trim() + } const projectText = function () { - const projectElem = viewContainer.querySelector('wrike-tag'); + const projectElem = viewContainer.querySelector('wrike-tag') // We process the project element text content. - return projectElem ? projectElem.textContent : ''; - }; + return projectElem ? projectElem.textContent : '' + } const link = togglbutton.createTimerLink({ className: 'wrike', description: descriptionText, - projectName: projectText - }); + projectName: projectText, + }) - container.prepend(link); - } -); + container.prepend(link) + }, +)