Created
June 18, 2018 22:03
-
-
Save kevincolten/4dffb4060521f4936e2142e102eae8d4 to your computer and use it in GitHub Desktop.
Pivotal-GH Bookmarklet
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
// Convert to a bookmarklet at https://mrcoles.com/bookmarklet/ | |
[...document.querySelectorAll('[data-id] a:not([aria-label])')] | |
.filter(el => el.href.includes('/c4eo/align-rails/pull/')) | |
.forEach(el => { | |
const tickets = el.innerText.split(']').join(' ').split('[').join(' ').split(',').join(' ').split(' ').filter(str => str[0] === '#'); | |
const ticketEls = tickets.map(ticket => ` | |
<a class="d-inline-block IssueLabel v-align-text-top labelstyle-de752c linked-labelstyle-de752c" style="background-color: #de752c; color: #ffffff; margin-right: 4px" title="${ticket}" href="https://www.pivotaltracker.com/n/projects/1519937/stories/${ticket.slice(1)}" target="_blank">${ticket}</a> | |
`); | |
el.parentNode.insertAdjacentHTML('beforeend', `<span class="labels lh-default">${ticketEls.join('')}</span>`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment