Last active
August 29, 2015 14:10
-
-
Save he7d3r/0373ff0b160d8a7da7b5 to your computer and use it in GitHub Desktop.
Update Bugzilla links in the current page to point to the corresponding Phabricator tasks
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
// Copyright © 2014 He7d3r | |
// License: http://he7d3r.mit-license.org/ | |
var i, link, href, match, | |
links = document.getElementsByTagName( 'a' ); | |
for( i = 0; i < links.length; i++ ){ | |
link = links[i]; | |
href = link.href || ''; | |
match = href.match( /^(?:(?:https?:)?\/\/(?:old-)?bugzilla\.wikimedia\.org\/)?show_bug\.cgi\?id=(\d+)$/ ); | |
if( match ) { | |
link.href = 'https://phabricator.wikimedia.org/T' + ( parseInt( match[1], 10 ) + 2000 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment