diff --git a/src/content/anydo.js b/src/content/anydo.js index 7e53cca42..04c1a4603 100644 --- a/src/content/anydo.js +++ b/src/content/anydo.js @@ -1,13 +1,12 @@ 'use strict'; /* global togglbutton, $ */ -// Any.do Q3 2021: task card togglbutton.render( - '.TaskEditPaneDetails:not(.toggl)', + '.TaskEditPane header:not(.toggl)', { observe: true }, elem => { - const descriptionSelector = () => elem.querySelector('.TaskEditPaneDetails__taskTitle textarea').value; - const projectSelector = () => elem.querySelector('.TaskCategoryPickerButton__text').textContent; + const descriptionSelector = () => document.querySelector('.TaskEditPaneDetails__taskTitle textarea').value; + const projectSelector = () => document.querySelector('.TaskEditPane .TaskEditPaneDetails__fullRow:nth-of-type(2) span:nth-of-type(2)').textContent; const link = togglbutton.createTimerLink({ buttonType: 'minimal', @@ -16,25 +15,6 @@ togglbutton.render( projectName: projectSelector }); - elem.querySelector('.TaskEditPaneDetails__taskLabels').after(link); - } -); - -// Any.do Q3 2021: tasks lists -togglbutton.render( - '.TaskList__taskContainer:not(.toggl)', - { observe: true }, - elem => { - const descriptionSelector = () => elem.querySelector('.TaskItem__title').textContent; - const projectSelector = () => elem.querySelector('.TaskItemIndicators').textContent || document.querySelector('.TasksToolBar__title').textContent; - - const link = togglbutton.createTimerLink({ - buttonType: 'minimal', - className: 'anydo--2021__taskItem', - description: descriptionSelector, - projectName: projectSelector - }); - - elem.querySelector('.TaskItem__mainContent').after(link); + elem.querySelector('& > div > div').appendChild(link); } );