diff options
-rw-r--r-- | data/js/bug-page-mod.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/data/js/bug-page-mod.js b/data/js/bug-page-mod.js index 740ba1f..1fb70e8 100644 --- a/data/js/bug-page-mod.js +++ b/data/js/bug-page-mod.js @@ -85,6 +85,8 @@ function tweakBugzilla(d) { if (commentBox) commentBox.rows=20; + addNewLinks(d); + attachmentDiffLinkify(d); viewAttachmentSource(d); @@ -1137,6 +1139,31 @@ function htmlEncode(str) { .replace('"', '"', 'g'); } +function addNewLinks(d) { + var product = d.querySelector("#field_container_product option[selected]"); + var component = d.querySelector("#component option[selected]"); + + if (product) { + var label = d.getElementById('field_container_product'); + var span = d.createElement('span'); + var url = 'enter_bug.cgi?product=' + product.value; + span.innerHTML = "(<a href='" + url + "'>new</a>)"; + if (label && span) { + label.appendChild(span); + } + } + + if (product && component) { + var select = d.querySelector("select#component"); + var span = d.createElement('span'); + var url = 'enter_bug.cgi?product=' + product.value + '&component=' + component.value; + span.innerHTML = "(<a href='" + url + "'>new</a>)"; + if (select && span) { + select.parentNode.appendChild(span); + } + } +} + function tbplbotSpamCollapser(d) { var collapseExpandBox = d.querySelector(".bz_collapse_expand_comments"); if (!collapseExpandBox) { |