diff options
Diffstat (limited to 'data/bzpage.js')
-rw-r--r-- | data/bzpage.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/data/bzpage.js b/data/bzpage.js index 47f14c0..b980e96 100644 --- a/data/bzpage.js +++ b/data/bzpage.js @@ -16,6 +16,7 @@ var EmptyLogsColor = new Color(0, 255, 0); var FullLogsColor = new Color(0, 40, 103); // global variables +var config = {}; var constantData = {}; // This should be probably eliminated ASAP or // or done by other means. TODO var submitHandlerInstalled = false; // for setUpLogging @@ -53,15 +54,12 @@ onMessage = function onMessage(msg) { case "ReloadThePage": document.location.reload(true); break; - case "RetClipboard": - if (msg.data.cmd == "queryLocal") { - queryInNewTab(msg.data.data, getComponent(), getProduct()); - } else if (msg.data.cmd == "queryUpstream") { - // - } + case "queryLocal": + queryInNewTab(msg.data.data, getComponent(), getProduct()); break; case "CreateButtons": constantData = msg.data.constData; + config = msg.data.config; generateButtons(msg.data.instPkgs, msg.data.kNodes); break; case "Error": @@ -491,6 +489,15 @@ function parseMailto(aElement) { } /** + * Get the current title of the bug + * + * @return string + */ +function getSummary() { + return document.getElementById("short_desc_nonedit_display").textContent; +} + +/** * Get the current email of the reporter of the bug. * * @return string @@ -730,6 +737,8 @@ function getDefaultBugzillaMaintainer (component) { * @return array with string name of the attachment, integer its id number, * string of MIME type, integer of size in kilobytes, and the whole * element itself + * + * TODO error handling is missing ... it's bleee */ function parseAttachmentLine(inElem) { var MIMEtype = ""; @@ -737,19 +746,18 @@ function parseAttachmentLine(inElem) { // Skip over obsolete attachments if (inElem.getElementsByClassName("bz_obsolete").length > 0) { - return ( []); + return ([]); } // getting name of the attachment - // TODO probably could use url.URL object var attName = inElem.getElementsByTagName("b")[0].textContent.trim(); + // TODO probably could use url.URL object var aHrefsArr = inElem.getElementsByTagName("a"); var aHref = Array.filter(aHrefsArr, function(x) { return x.textContent.trim() === "Details"; })[0]; - var id = parseInt(aHref.getAttribute("href").replace( - /^.*attachment.cgi\?id=/, ""), 10); + var id = getParamsFromURL(aHref.getAttribute("href")).id; // getting MIME type and size var stringArray = inElem.getElementsByClassName("bz_attach_extra_info")[0].textContent. @@ -995,7 +1003,7 @@ function startup() { } // TODO Probably could be ignored ... used only once on line 973 of rhbzpage.js - // if (parseAbrtBacktraces && this.RE.Abrt.test(this.title)) { + // if (parseAbrtBacktraces && this.RE.Abrt.test(getSummary())) { // title = document.getElementById("short_desc_nonedit_display").textContent; // So, now we know we are logged in, so we can get to @@ -1009,6 +1017,10 @@ function startup() { location: window.location.href, login: getLogin() })); + + if (RHBZinit) { + RHBZinit(); + } } startup(); |