-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Pascal Martineau <[email protected]>
- Loading branch information
1 parent
7fce794
commit 0913a9c
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @name Freedcamp | ||
* @urlAlias freedcamp.com | ||
* @urlRegex *://*.freedcamp.com/* | ||
*/ | ||
'use strict'; | ||
|
||
function tagsSelector() { | ||
const tagsElem = document.querySelectorAll('.AgTagItem--fk-AgTagItem'); | ||
const tags = [...tagsElem].map(tagEl => tagEl.textContent.trim()) | ||
return tags | ||
} | ||
|
||
togglbutton.render( | ||
'.AgListViewTask--fk-AgListViewTask-Body:not(.toggl)', | ||
{ observe: true }, | ||
function (elem) { | ||
const projectElem = $('.AgSidebarCurrentProject--fk-AgSidebarContext-ProjText') | ||
|
||
const descriptionElem = $('.AgListViewTask--fk-AgListViewTask-Title', elem); | ||
const link = togglbutton.createTimerLink({ | ||
buttonType: 'minimal', | ||
className: 'freedcamp', | ||
projectName: projectElem?.textContent, | ||
description: descriptionElem?.textContent, | ||
}); | ||
elem.appendChild(link); | ||
} | ||
); | ||
|
||
|
||
togglbutton.render( | ||
'.ItemViewSubheader--fk-ItemBasicFields-Title:not(.toggl)', | ||
{ observe: true }, | ||
function (elem) { | ||
const projectElem = $('.AgSidebarCurrentProject--fk-AgSidebarContext-ProjText') | ||
const descriptionElem = $('.ItemViewSubheader--fk-ItemBasicFields-Title'); | ||
const link = togglbutton.createTimerLink({ | ||
buttonType: 'minimal', | ||
className: 'freedcamp', | ||
projectName: projectElem?.textContent, | ||
description: descriptionElem?.textContent, | ||
tags: tagsSelector | ||
}); | ||
elem.parentNode.insertBefore(link, elem.nextSibling); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters