-
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.
feat: Add support for shortuct (previously clubhouse) (#2006)
- Loading branch information
1 parent
6742ec1
commit 208fe9c
Showing
3 changed files
with
58 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,31 @@ | ||
'use strict'; | ||
|
||
togglbutton.render('.story-state:not(.toggl)', { observe: true }, function ( | ||
elem | ||
) { | ||
const wrap = createTag('div'); | ||
const element = elem; | ||
elem = elem.parentNode.parentNode.parentNode; | ||
|
||
const getDescription = function () { | ||
const storyId = $('.story-id > input', elem).value; | ||
const title = $('h2.story-name', elem).textContent; | ||
|
||
return `#${storyId} - ${title}`; | ||
}; | ||
|
||
const getProject = function () { | ||
return $('.story-project .value', elem).textContent; | ||
}; | ||
|
||
const link = togglbutton.createTimerLink({ | ||
className: 'toggl-shortcut', | ||
description: getDescription, | ||
projectName: getProject | ||
}); | ||
|
||
wrap.className = 'attribute editable-attribute toggl-button-shortcut-wrapper'; | ||
wrap.appendChild(link); | ||
|
||
element.parentNode.insertBefore(wrap, element.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