Last active
December 28, 2023 00:10
-
-
Save niallsmart/d7138b87b306a1f3bb8a to your computer and use it in GitHub Desktop.
Copy Trello checklist to clipboard
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
copy($(".checklist-item:not(.checklist-item-checked)").map(function() { | |
var e = $(this), | |
item = e.find(".checklist-item-details-text").text() | |
if (e.hasClass("checklist-item-state-complete")) { | |
item = item + " (DONE)" | |
} | |
return item | |
}).get().join("\n")) |
Thanks for this script, very useful.
For me, it didn't fully work for checklists that contain google, youtube or any other link that Trello detects and converts to a text in an overly smart manner. I haven't found a way to turn off this feature and it's a huge pain because if I copy the checklist, the textual version of the original links will be copied and not the original links.
An updated version of the script with parsing such smart links:
copy($(".checklist-item:not(.checklist-item-checked)").map(function() {
var e = $(this),
item = e.find(".checklist-item-details-text").text()
var smartlinks = e.find(".atlaskit-smart-link")
if (smartlinks.length) {
//sanity check
if (smartlinks.length != 1) {
console.error("length of smartlinks should be 1, but it is: " + smartlinks.length)
} else {
item = item + " " + smartlinks.attr("href")
}
}
if (e.hasClass("checklist-item-state-complete")) {
item = item + " (DONE)"
}
return item
}).get().join("\n"))
🙏
This just came in handy! Thank you very much :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!