Last active
August 29, 2015 14:22
-
-
Save dveeden/2b194f0fe14046dd0048 to your computer and use it in GitHub Desktop.
Greasemonkey script to add links to MySQL bugs on dev.mysql.com
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
// ==UserScript== | |
// @name MySQL_BugLink | |
// @include https://dev.mysql.com/* | |
// @include http://dev.mysql.com/* | |
// @description Add buglinks to mysql pages | |
// ==/UserScript== | |
items = document.getElementsByClassName('listitem') | |
var searchRe = new RegExp('Bug #([0-9]{5})([^0-9])','g'); | |
var searchrepl = "<a href=\"https://bugs.mysql.com/$1\">Bug #$1</a>$2"; | |
var ora_searchRe = new RegExp('Bug #([0-9]{8})([^0-9])','g'); | |
var ora_searchrepl = "<a href=\"https://support.oracle.com/epmos/faces/BugDisplay?id=$1\">Bug #$1</a>$2"; | |
for (var i=0;i<items.length;i++) { | |
var item = items[i]; | |
item.innerHTML = item.innerHTML.replace(searchRe, searchrepl); | |
item.innerHTML = item.innerHTML.replace(ora_searchRe, ora_searchrepl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment