Created
September 23, 2018 23:12
-
-
Save anstosa/331149d5fd70f2c49cf00340677a5176 to your computer and use it in GitHub Desktop.
JS to uncheck all items in a TickTick list. Copy and paste into bookmark URL field
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
javascript: (() => { | |
function uncheckAll() { | |
const completedCheckboxes = document.querySelectorAll('.completed .t-check'); | |
console.log(completedCheckboxes); | |
completedCheckboxes.forEach((checkbox) => checkbox.click()); | |
} | |
const showMoreButton = document.querySelector('.show-more'); | |
if (showMoreButton.style.display === 'none') { | |
uncheckAll(); | |
} | |
else { | |
showMoreButton.click(); | |
let completedTasks = document.querySelectorAll('.completed .task'); | |
const waitForLoad = setInterval(() => { | |
const completedTasks = document.querySelectorAll('.completed .task'); | |
if (5 < completedTasks.length) { | |
clearInterval(waitForLoad); | |
uncheckAll(); | |
} | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment