Skip to content

Commit

Permalink
fix(any.do): Fix Any.do integration
Browse files Browse the repository at this point in the history
Related #2255
  • Loading branch information
nunofmn committed Nov 14, 2023
1 parent c0c2422 commit 950f38d
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/content/anydo.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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);
}
);

0 comments on commit 950f38d

Please sign in to comment.