
var currentA = null;
var jiraRe = new RegExp("("
        /* GateIn */
        + "GTNPORTAL|GTNCOMMON|GTNWCM"
        /* Hawkular */
        + "|HAWKULAR|HWKALERTS|HWKBTM|HWKINVENT|HWKMETRICS"
        /* WildFly */
        + "|WFLY|WFCORE|UNDERTOW"
        /* Misc */
        + "|JDF|MODE|JBIDE|JBQA|JBDS|TOOLSDOC|AS7|JBPAPP6|JBPAPP|FORGE|FORGEPLUGINS|ARQ|SHRINKRES|SHRINKWRAP|SHRINKDESC|ARQGRA|RF|RFPL|RFSBOX"
        + ")-[0-9]+", "g");
var bugzillaRe = new RegExp("(BZ|Bug)[ #\\-]?[0-9]+", "gi");

function traverseDom(node, func) {
    var endA = false;
    if (node.nodeType == 1 && node.nodeName.toLowerCase() == "a") {
        currentA = node;
        endA = true;
    }
    func(node);
    node = node.firstChild;
    while (node) {
        traverseDom(node, func);
        node = node.nextSibling;
    }
    if (endA) {
        currentA = null;
    }
}

function linkJira(node) {
    if (node.nodeType == 3 && node.nodeValue.trim().length > 0) {
            var matches = node.nodeValue.match(jiraRe);
            if (matches) {
                for (var i = 0; i < matches.length; i++) {
                    var newA = document.createElement("a");
                    newA.href = "https://issues.jboss.org/browse/"+ matches[i];
                    newA.className = "JBossJiraContentScriptBlock";
                    newA.target = "_blank";
                    newA.innerHTML = matches[i];
                    var insertBefore = currentA ? currentA : node;
                    insertBefore.parentNode.insertBefore(newA, insertBefore);
                }
            }
            matches = node.nodeValue.match(bugzillaRe);
            if (matches) {
                for (var i = 0; i < matches.length; i++) {
                    var bugId = matches[i].match(new RegExp("[0-9]+$"));
                    var newA = document.createElement("a");
                    newA.href = "https://bugzilla.redhat.com/show_bug.cgi?id="+ bugId;
                    newA.className = "JBossJiraContentScriptBlock";
                    newA.target = "_blank";
                    newA.innerHTML = "BZ#"+ bugId;
                    var insertBefore = currentA ? currentA : node;
                    insertBefore.parentNode.insertBefore(newA, insertBefore);
                }
            }
    }
}

var nodeHandlers = function (node) {
    linkJira(node);
};

traverseDom(document.body, nodeHandlers);


@@ -201,30 +201,123 @@
  /* 
-WildFly */%0A        + %22
+JBoss Tools */%0A        + %22%7CJBIDE%7CJBDS%7CTOOLSDOC%22%0A        /* JBoss AS, WildFly and EAP */%0A        + %22AS7%7CJBAS%7CJBPAPP6
 %7CWFL
@@ -370,53 +370,23 @@
 + %22%7C
-JDF%7CMODE%7CJBIDE%7CJBQA%7CJBDS%7CTOOLSDOC%7CAS7%7CJBPAPP6
+ARQ%7CARQGRA%7CJBQA
 %7CJBP
@@ -408,19 +408,34 @@
 PLUGINS%7C
-ARQ
+JDF%7CHIBERNATE%7CMODE
 %7CSHRINKR
@@ -459,23 +459,16 @@
 INKDESC%7C
-ARQGRA%7C
 RF%7CRFPL%7C

Reorder patterns