Last active
August 29, 2015 14:13
-
-
Save codingawayy/7e1ea413646d4f5a438a to your computer and use it in GitHub Desktop.
TFS website: add support for links to backlog/buglist
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
<style> | |
.link {padding:2px 3px; border-radius:3px; display:inline-block; margin:0 5px; border:1px solid} | |
.link.story {background:#A7EEFF; border-color:#8EC7D8} | |
.link.issue {background:#4CFF85; border-color:#6DC295} | |
</style> | |
<script> | |
(function() { | |
$(document).ajaxComplete(initTags); | |
function initTags() { | |
var backlogLinkRegex = new RegExp(/(#([1-9][0-9]*))/gim); | |
var bugLinkRegex = new RegExp(/(!([1-9][0-9]*))/gim); | |
$(".result-details,.vc-page-title").each(function() { | |
var el = $(this); | |
var taggedDescription = el.html() | |
.replace(backlogLinkRegex, "<a class='link story' href='/backlog/items/$2'>$2</a>") | |
.replace(bugLinkRegex, "<a class='link issue' href='/buglist/items/$2'>$2</a>"); | |
el.html(taggedDescription); | |
}); | |
} | |
}()); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment