Last active
March 19, 2019 05:25
-
-
Save wifeofvillon/de40c6034b4f9ef98cb58541fc35a434 to your computer and use it in GitHub Desktop.
JavaScript to get `${column title}: ${column card count}` strings on Trello board
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
{ | |
let panes = document.querySelectorAll("div.list-wrapper"); | |
let alertTextArray = new Array(); | |
// console.log(panes); | |
for (pane of panes) { | |
if (!pane.classList.contains("is-idle")){ | |
let title = pane.getElementsByClassName("list-header-name-assist")[0].innerText; | |
// console.log(title); | |
let cards = pane.getElementsByClassName("list-card-details"); | |
// console.log(`${title}: ${cards.length}`) | |
let checkedCount = 0; | |
for (card of cards) { | |
if (card.getElementsByClassName("card-label").length > 0) { | |
checkedCount++; | |
} | |
} | |
alertTextArray.push(`${title}: ${cards.length} (${checkedCount} cards are checked)`); | |
} | |
} | |
prompt("copy and paste", alertTextArray.join(`\n`)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment