forked from clockify/browser-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasana.js
34 lines (32 loc) · 1.37 KB
/
asana.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// New task pane list detail modal
setTimeout(() => {
clockifyButton.render('.SingleTaskPaneSpreadsheet:not(.clockify)', {observe: true}, (elem) => {
var link,
container = $('.SingleTaskPaneToolbarAnimation-row', elem),
description = $('.SingleTaskTitleInput-taskName textarea', elem) ?
$('.SingleTaskTitleInput-taskName textarea', elem).textContent : "",
project = $('.TaskProjects .TokenizerPillBase-name').textContent;
link = clockifyButton.createButton({
description: description,
projectName: project,
taskName: description
});
link.style.marginLeft = "10px";
container.appendChild(link);
});
},500);
// subtasks
setTimeout(() => {
clockifyButton.render('.ItemRowTwoColumnStructure-left:not(.clockify)', {observe: true}, (elem) => {
maintask = $('.SingleTaskTitleInput-taskName textarea') ? $('.SingleTaskTitleInput-taskName textarea').textContent : "",
project = $('.TaskProjects .TokenizerPillBase-name').textContent;
let description = $('.simpleTextarea.AutogrowTextarea-input', elem).textContent.trim();
link = clockifyButton.createButton({
description: description,
projectName: project,
taskName: maintask,
small: true
});
elem.parentNode.appendChild(link);
});
},100);