Created
December 18, 2009 06:26
-
-
Save masaakif/259327 to your computer and use it in GitHub Desktop.
Add arrows on JIRA number
This file contains hidden or 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
| // ==UserScript== | |
| // @name Add arrows on JIRA number | |
| // @namespace http://gist.github.com/259327 | |
| // @include http://sydlinux3:8080/browse/* | |
| // ==/UserScript== | |
| // Version 20091218 | |
| addArrows(); | |
| function addArrows() { | |
| var itemLink = document.evaluate("//table[@id='issuedetails']/tbody/tr/td[2]//a", | |
| document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
| if (itemLink) { | |
| parentB = itemLink.parentNode | |
| itemID = itemLink.innerHTML; | |
| [itemType, itemNo] = itemID.split("-"); | |
| prevItemNo = itemNo - 1; | |
| nextItemNo = itemNo - 0 + 1; | |
| prevItemID = itemType + "-" + prevItemNo; | |
| nextItemID = itemType + "-" + nextItemNo; | |
| var pf = document.createElement("a"); | |
| pf.setAttribute("href", prevItemID); | |
| pf.innerHTML = "  <<  "; | |
| parentB.insertBefore(pf,itemLink); | |
| var nf = document.createElement("a"); | |
| nf.setAttribute("href", nextItemID); | |
| nf.innerHTML = "  >>  "; | |
| parentB.appendChild(nf); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment