Last active
March 5, 2020 21:44
-
-
Save jwasden/d89edfcdc76973d1daf1cfe16109855f to your computer and use it in GitHub Desktop.
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
// https://github.com/sudodoki/copy-to-clipboard | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'https://wzrd.in/standalone/copy-to-clipboard@latest'; | |
document.head.appendChild(script); | |
// https://github.com/ibnujakaria/snackbar-js/ | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'https://cdn.jsdelivr.net/npm/snackbar-js@1.0.10/dist/snackbar.js'; | |
document.head.appendChild(script); | |
var getStories = function(colName = "Ready for Release", releaseName = "Branch/Release", releaseImageUrl = "http://deseretdigital.com/img/homeddm.jpg"){ | |
let stories = [`![${releaseName} Image](${releaseImageUrl} "${releaseName} Release") | |
Stories: | |
`]; | |
[...document.querySelectorAll("a")] | |
.filter(a => a.textContent.includes(colName)) | |
.forEach(a => (console.log(Array.prototype.slice.call(a.parentElement.parentElement.querySelectorAll(".column-bucket > .bucket-content a")).filter( story => story.classList.contains("selected")).forEach(story => stories.push(`- [${story.href.split('/').pop().split('-').join(" ")}](${story.href})`))))) | |
let result = stories.join("\n"); | |
copy(result, { | |
debug: true, | |
message: 'Press #{key} to copy', | |
}); | |
Snackbar | |
.create() | |
.setText('Stories markdown copied to clipboard.') | |
.setStyle('center') | |
.show(); | |
console.log("getStories Completed: Stories markdown is now copied to clipboard."); | |
} | |
// run getStories(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment