From 950f38d1e6f86a212c6bea5b8f8c49c6bea0eecb Mon Sep 17 00:00:00 2001 From: Nuno Nogueira Date: Tue, 14 Nov 2023 14:41:59 +0000 Subject: [PATCH] fix(any.do): Fix Any.do integration Related #2255 --- src/content/anydo.js | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) 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); } );