From 19a64b3dfb86045dcb99593f5da8d66eb6556de9 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Fri, 18 Feb 2011 14:13:48 -0800 Subject: Add new bug links next to product, component to create bug in same area --- data/js/bug-page-mod.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 = "(new)"; + 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 = "(new)"; + if (select && span) { + select.parentNode.appendChild(span); + } + } +} + function tbplbotSpamCollapser(d) { var collapseExpandBox = d.querySelector(".bz_collapse_expand_comments"); if (!collapseExpandBox) { -- cgit