Skip to content

Instantly share code, notes, and snippets.

@xagronaut
Created November 30, 2018 14:20
Show Gist options
  • Save xagronaut/f3379cb8ed23ff14e0d37cf19e0a13a1 to your computer and use it in GitHub Desktop.
Save xagronaut/f3379cb8ed23ff14e0d37cf19e0a13a1 to your computer and use it in GitHub Desktop.
Bookmarklets for use in TFS Web application (tested in Google Chrome)
<!DOCTYPE html>
<html>
<head>
<title>TFS bookmarklets - Jeffrey Miller</title>
<style type='text/css'>
body {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 12;
}
blockquote {
border-radius: 5px;
padding: 15px;
border: 1px solid #999999;
box-shadow: 2px 2px #CCCCCC;
}
.instructions {
border-radius: 5px;
background-color: #FFFFA5;
padding: 15px;
border: 1px solid #999999;
box-shadow: 2px 2px #CCCCCC;
}
div.section, div.entry {
border: 1px solid #999999;
/*border-radius: 5px;*/
margin: 3px;
margin-top: 10px;
padding: 15px;
}
div.section {
background-color: C1C1C1;
}
div.entry {
background-color: #FFFFFF;
}
div.entry blockquote {
background-color: lightgreen;
margin-top: 15px;
}
a[href*="javascript"] {
display: inline-block;
background-color: blue;
color: #ffffff;
padding: 5px;
font-weight: bold;
border-radius: 5px;
border: 3px solid teal;
}
</style>
</head>
<body>
<h1>TFS Bookmarklets</h1>
<div class="section">
<p class="instructions"><strong>Drag these links to your browser toolbar</strong>, and click them when logged into TFS to extract key details useful for reporting.</p>
<div class="entry">
<a href="javascript:(function()%7Bprompt('Copy details to clipboard'%2C function() %7B var scrapeTitleDiv %3D document.querySelector('.main-container .hub-title')%2C scrapeTitle %3D (titleDiv.innerText %7C%7C '').trim().replace(%2F%3A%2F%2C '%3A ')%2C scrapeHyperlink %3D window.location.protocol %2B '%2F%2F' %2B window.location.host %2B ((scrapeTitleDiv.querySelector('a').getAttribute('href')) %7C%7C '').trim()%3B return %5BscrapeTitle%2C scrapeHyperlink%5D.join('%5Cn')%3B %7D())%7D)()">Grab TFS details</a>
<blockquote>
<p>On the TFS work item edit page, click this to extract basic title and link.</p>
<p>You will be given a prompt from the current window. Just copy the contents and paste elsewhere as needed.</p>
</blockquote>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment