-
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.
- Loading branch information
1 parent
291f01c
commit 8079808
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 SampleScript | ||
* @urlAlias script_a_shortcode | ||
* @urlRegex app.sample.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