aboutsummaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/lib/addAttachmentRow.js48
-rw-r--r--data/lib/bugzillaDOMFunctions.js12
-rw-r--r--data/lib/bzpage.js48
-rw-r--r--data/lib/color.js22
-rw-r--r--data/lib/makeBacktraceAttachment.js58
-rw-r--r--data/lib/otherButtons.js13
-rw-r--r--data/lib/queries.js10
-rw-r--r--data/lib/util.js66
-rw-r--r--data/rhlib/fixingAttMIME.js22
-rw-r--r--data/rhlib/rhbzpage.js142
-rw-r--r--data/rhlib/xorgBugCategories.js4
-rw-r--r--data/tweaks/addNewLinks.js54
-rw-r--r--data/tweaks/bug-page-mod.js167
-rw-r--r--data/tweaks/viewSource.js19
14 files changed, 305 insertions, 380 deletions
diff --git a/data/lib/addAttachmentRow.js b/data/lib/addAttachmentRow.js
index 3bee73a..16eb02c 100644
--- a/data/lib/addAttachmentRow.js
+++ b/data/lib/addAttachmentRow.js
@@ -1,8 +1,8 @@
-// Released under the MIT/X11 license
-// http://www.opensource.org/licenses/mit-license.php
+//Released under the MIT/X11 license
+//http://www.opensource.org/licenses/mit-license.php
"use strict";
-// FIXME resp is JSON, not XML anymore
+//FIXME resp is JSON, not XML anymore
function addAttachmentCallback(resp) {
var newAttachID = parseInt(
resp.params.param.value.array.data.value.int, 10);
@@ -11,28 +11,28 @@ function addAttachmentCallback(resp) {
}
/**
- *
+ *
* This has to stay in RHBugzillaPage because upstream doesn't have
* addAttachment XML-RPC call yet.
*
Params: $params = {
- id => '<bug_id>', # ID of the bug report
- comment => "<Attachment Comment>", # OPTIONAL Text string containing comment to add.
- description => "<Attachment Description>", # REQUIRED Text Description of the attachment.
- isprivate => <Private Attachment ON/OFF 1/0>, # OPTIONAL Whether the Attachment
- will be private # Default: false
- filename => "<Attachment Filename>", REQUIRED The name of the file to attach to the bug report.
- obsoletes => [List of attach_id's to obsolete], OPTIONAL List if attachment ids that are
- obsoleted by this new attachment.
- ispatch => <Patch Attachment True/False 1/0>, OPTIONAL Whether the attachment is a Patch
- or not, if not provided the it will be considered NON Patch attachment.
- contenttype => "<Attachment Content Type>", OPTIONAL If the attachment is patch
- REQUIRED If the attachment is not a patch
- If the attachment is patch then contenttype will always be text/plain
- data => "<Encoded String of the Attachment Data>", REQUIRED It is a base64
- encoded string of the actual attachment data.
- nomail => 0, OPTIONAL Flag that is either 1 or 0 if you want email
- to be send ot not for this change }
+ id => '<bug_id>', # ID of the bug report
+ comment => "<Attachment Comment>", # OPTIONAL Text string containing comment to add.
+ description => "<Attachment Description>", # REQUIRED Text Description of the attachment.
+ isprivate => <Private Attachment ON/OFF 1/0>, # OPTIONAL Whether the Attachment
+ will be private # Default: false
+ filename => "<Attachment Filename>", REQUIRED The name of the file to attach to the bug report.
+ obsoletes => [List of attach_id's to obsolete], OPTIONAL List if attachment ids that are
+ obsoleted by this new attachment.
+ ispatch => <Patch Attachment True/False 1/0>, OPTIONAL Whether the attachment is a Patch
+ or not, if not provided the it will be considered NON Patch attachment.
+ contenttype => "<Attachment Content Type>", OPTIONAL If the attachment is patch
+ REQUIRED If the attachment is not a patch
+ If the attachment is patch then contenttype will always be text/plain
+ data => "<Encoded String of the Attachment Data>", REQUIRED It is a base64
+ encoded string of the actual attachment data.
+ nomail => 0, OPTIONAL Flag that is either 1 or 0 if you want email
+ to be send ot not for this change }
*/
function addAttachment(data, callback, param) {
var params = [];
@@ -44,7 +44,7 @@ function addAttachment(data, callback, param) {
}
var params = {
- id: getBugNo(),
+ id : getBugNo(),
description : titleParsedAttachment,
filename : "parsed-backtrace.txt",
contenttype : "text/plain",
@@ -53,8 +53,8 @@ function addAttachment(data, callback, param) {
};
self.postMessage(new Message("MakeJSONRPCCall", {
- url : constantData.XMLRPCData[window.location.hostname].url.
- replace("xmlrpc.cgi","jsonrpc.cgi"),
+ url : constantData.XMLRPCData[window.location.hostname].url
+ .replace("xmlrpc.cgi", "jsonrpc.cgi"),
method : "bugzilla.addAttachment",
params : params,
callRPC : "AddAttachmentCallback"
diff --git a/data/lib/bugzillaDOMFunctions.js b/data/lib/bugzillaDOMFunctions.js
index 6823bc1..8f74288 100644
--- a/data/lib/bugzillaDOMFunctions.js
+++ b/data/lib/bugzillaDOMFunctions.js
@@ -165,8 +165,8 @@ function createNewButton (location, after, cmdObj) {
var newId = cmdObj.name.toLowerCase().replace(/[^a-z0-9]+/,"","g") + "_btn";
} catch (e) {
console.error("createNewButton : e = " + e +
- "\ncreateNewButton : cmdObj.toSource() = " +
- cmdObj.toSource());
+ "\ncreateNewButton : cmdObj.toSource() = " +
+ cmdObj.toSource());
}
// protection against double-firings
@@ -259,7 +259,7 @@ function getProduct() {
function commentsWalker (fce) {
var comments = document.getElementById("comments").
- getElementsByClassName("bz_comment");
+ getElementsByClassName("bz_comment");
Array.forEach(comments, function(item) {
fce(item);
});
@@ -298,7 +298,7 @@ function parseAttachmentLine(inElem) {
// getting MIME type and size
var stringArray = inElem.getElementsByClassName("bz_attach_extra_info")[0].textContent.
- replace(/[\n ()]+/g, " ").trim().split(", ");
+ replace(/[\n ()]+/g, " ").trim().split(", ");
size = parseInt(stringArray[0], 10);
MIMEtype = stringArray[1].split(" ")[0];
@@ -316,7 +316,7 @@ function parseAttachmentLine(inElem) {
function getAttachments () {
var outAtts = [];
var atts = document.getElementById("attachment_table").
- getElementsByTagName("tr");
+ getElementsByTagName("tr");
for ( var i = 1, ii = atts.length - 1; i < ii; i++) {
outAtts.push(parseAttachmentLine(atts[i]));
}
@@ -436,7 +436,7 @@ function isEnterprise() {
* @return Boolean whether the bug has been triaged or not
*/
function isTriaged() {
- return hasKeyword("Triaged");
+ return hasKeyword("Triaged");
}
/**
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js
index 10c71fb..aa496cf 100644
--- a/data/lib/bzpage.js
+++ b/data/lib/bzpage.js
@@ -9,14 +9,14 @@ var NumberOfFrames = 7;
// constants
var SalmonPink = new Color(255, 224, 176); // RGB 255, 224, 176; HSL 36, 2,
- // 85
+// 85
var ReporterColor = new Color(255, 255, 166); // RGB 255, 255, 166; HSL 60, 2,
- // 83
+// 83
// global variables
var config = {};
var constantData = {}; // This should be probably eliminated ASAP or
- // or done by other means. TODO
+// or done by other means. TODO
var equivalentComponents = null;
/**
* central handler processing messages from the main script.
@@ -34,7 +34,7 @@ self.on('message', function onMessage(msg) {
constantData = msg.data.constData;
config = msg.data.config;
equivalentComponents = ("equivalentComponents" in constantData) ?
- constantData.equivalentComponents : null;
+ constantData.equivalentComponents : null;
generateButtons(msg.data.instPkgs, msg.data.kNodes);
completeInit();
break;
@@ -131,7 +131,7 @@ function centralCommandDispatch (cmdLabel, cmdParams) {
clickMouse("bz_url_edit_action");
document.getElementById("bug_file_loc").value = cmdParams;
break;
- // TODO dependson/blocked doesn't work. Find out why.
+ // TODO dependson/blocked doesn't work. Find out why.
case "addDependsOn":
clickMouse("dependson_edit_action");
addStuffToTextBox("dependson", cmdParams);
@@ -165,7 +165,7 @@ function centralCommandDispatch (cmdLabel, cmdParams) {
case "queryStringOurBugzilla":
queryForSelection();
break;
- // TODO flags, see also
+ // TODO flags, see also
case "commit":
if (cmdParams) {
// Directly commit the form
@@ -179,7 +179,7 @@ function centralCommandDispatch (cmdLabel, cmdParams) {
else {
console.error("Unknown command:\n" + cmdLabel + "\nparameters:\n" + cmdParams);
}
- break;
+ break;
}
}
@@ -200,7 +200,7 @@ function changeAssignee (newAssignee) {
// Optional value null
if (newAssignee === null) {
document.getElementById("set_default_assignee").removeAttribute(
- "checked");
+ "checked");
return ;
}
@@ -273,8 +273,8 @@ function generateButtons (pkgs, kNodes) {
// =========================================================
if (kNodes && window.location.hostname in kNodes) {
- var killConf = kNodes[window.location.hostname];
- killNodes(document, killConf[0], killConf[1]);
+ var killConf = kNodes[window.location.hostname];
+ killNodes(document, killConf[0], killConf[1]);
}
// create anchor for the top toolbar
@@ -300,14 +300,14 @@ function generateButtons (pkgs, kNodes) {
break;
default: // [+-]ID
var firstChr = cmdObj.position.charAt(0);
- var newId = cmdObj.position.substr(1);
- createNewButton(newId, firstChr === "+", cmdObj);
- break;
+ var newId = cmdObj.position.substr(1);
+ createNewButton(newId, firstChr === "+", cmdObj);
+ break;
}
}
else {
console.error("generateButtons : rejected cmdObj = " +
- cmdObj.toSource());
+ cmdObj.toSource());
}
}
}
@@ -320,12 +320,12 @@ function setConfigurationButton () {
+ "Triage configuration</a>";
additionalButtons.appendChild(configurationButtonUI);
document.getElementById("configurationButton").addEventListener(
- "click",
- function(evt) {
- self.postMessage(new Message("ChangeJSONURL", null));
- evt.stopPropagation();
- evt.preventDefault();
- }, false);
+ "click",
+ function(evt) {
+ self.postMessage(new Message("ChangeJSONURL", null));
+ evt.stopPropagation();
+ evt.preventDefault();
+ }, false);
}
/**
@@ -346,15 +346,15 @@ function getOptionTableCell(tableId, label) {
if (ourLine.length > 0) {
return ourLine[0].getElementsByTagName("td")[1].
- getElementsByTagName("a")[0];
+ getElementsByTagName("a")[0];
}
return null;
}
/**
- * Complete startup, mainly run alternate inits for non-standard BZ
- * with proper arguments
+ * Complete startup, mainly run alternate inits for non-standard BZ with proper
+ * arguments
*
*/
function completeInit() {
@@ -394,7 +394,7 @@ function startup() {
if (brElementPlacer) {
brElementPlacer.setAttribute("id","brElementPlacer_location");
brElementPlacer.parentNode.insertBefore(document.createElement("br"),
- brElementPlacer);
+ brElementPlacer);
}
}
diff --git a/data/lib/color.js b/data/lib/color.js
index 4d0c41f..0031c5c 100644
--- a/data/lib/color.js
+++ b/data/lib/color.js
@@ -1,11 +1,11 @@
-// Released under the MIT/X11 license
-// http://www.opensource.org/licenses/mit-license.php
+//Released under the MIT/X11 license
+//http://www.opensource.org/licenses/mit-license.php
"use strict";
-// ============================================================================
-// Color management methods
-// originally from
-// http://www.mjijackson.com/2008/02\
-// /rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
+//============================================================================
+//Color management methods
+//originally from
+//http://www.mjijackson.com/2008/02\
+///rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
function Color(r, g, b) {
this.Luminosity = 0.85;
this.Desaturated = 0.4;
@@ -51,7 +51,7 @@ Color.prototype.toString = function() {
* Converts an RGB color value to HSL. Conversion formula adapted from
* http://en.wikipedia.org/wiki/HSL_color_space. Assumes r, g, and b are
* contained in the set [0, 255] and returns h, s, and l in the set [0, 1].4343
- *
+ *
* @param Number
* r The red color value
* @param Number
@@ -96,7 +96,7 @@ Color.prototype.hsl = function() {
* Converts an HSL color value to RGB. Conversion formula adapted from
* http://en.wikipedia.org/wiki/HSL_color_space. Assumes h, s, and l are
* contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
- *
+ *
* @param Number
* h The hue
* @param Number
@@ -147,7 +147,7 @@ Color.prototype.hslToRgb = function(h, s, l) {
* Converts an RGB color value to HSV. Conversion formula adapted from
* http://en.wikipedia.org/wiki/HSV_color_space. Assumes r, g, and b are
* contained in the set [0, 255] and returns h, s, and v in the set [0, 1].
- *
+ *
* @param Number
* r The red color value
* @param Number
@@ -193,7 +193,7 @@ Color.prototype.hsv = function() {
* Converts an HSV color value to RGB. Conversion formula adapted from
* http://en.wikipedia.org/wiki/HSV_color_space. Assumes h, s, and v are
* contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
- *
+ *
* @param Number
* h The hue
* @param Number
diff --git a/data/lib/makeBacktraceAttachment.js b/data/lib/makeBacktraceAttachment.js
index 6011c06..9fc72bc 100644
--- a/data/lib/makeBacktraceAttachment.js
+++ b/data/lib/makeBacktraceAttachment.js
@@ -1,9 +1,9 @@
-// Released under the MIT/X11 license
-// http://www.opensource.org/licenses/mit-license.php
+//Released under the MIT/X11 license
+//http://www.opensource.org/licenses/mit-license.php
var titleParsedAttachment = "Part of the thread where crash happened";
/**
- *
+ *
*/
function pasteBacktraceInComments(atts) {
/*
@@ -20,11 +20,11 @@ function pasteBacktraceInComments(atts) {
return null;
var abrtQueryURL = "https://bugzilla.redhat.com/buglist.cgi?"
- + "cmdtype=dorem&remaction=run&namedcmd=all%20NEW%20abrt%20crashes&"
- + "sharer_id=74116";
+ + "cmdtype=dorem&remaction=run&namedcmd=all%20NEW%20abrt%20crashes&"
+ + "sharer_id=74116";
var mainTitle = document
- .getElementsByClassName("bz_alias_short_desc_container")[0];
+ .getElementsByClassName("bz_alias_short_desc_container")[0];
createDeadLink("callAbrtQuery_link", "Abrt bugs", mainTitle,
abrtQueryURL, [], false, null, "a");
@@ -42,25 +42,25 @@ function pasteBacktraceInComments(atts) {
// just the first one will do for now, we would need to do async
//
btAttachments
- .forEach(
- function(x) {
- var attURL = "https://bugzilla.redhat.com/attachment.cgi?id="
- + x[1];
- if ((!btSnippet) && // ???? FIXME
+ .forEach(
+ function(x) {
+ var attURL = "https://bugzilla.redhat.com/attachment.cgi?id="
+ + x[1];
+ if ((!btSnippet) && // ???? FIXME
(!idContainsWord("status_whiteboard", 'btparsed'))) {
- Request({
- url : attURL,
- onComplete : function(response) {
- if (response.status == 200) {
- btSnippet = parseBacktrace(response.text);
- if (btSnippet) {
- addCheckShowLink(x, btSnippet);
- }
- }
+ Request({
+ url : attURL,
+ onComplete : function(response) {
+ if (response.status == 200) {
+ btSnippet = parseBacktrace(response.text);
+ if (btSnippet) {
+ addCheckShowLink(x, btSnippet);
}
- }).get();
+ }
}
- }, this);
+ }).get();
+ }
+ }, this);
}
// Add "show BT" links
if (parsedAttachments.length > 0) {
@@ -72,7 +72,7 @@ function pasteBacktraceInComments(atts) {
/**
* Open new window with the content of the attachment.
- *
+ *
* @param id
* Number of the attachment id
* @return none
@@ -84,7 +84,7 @@ function showAttachment(id) {
/**
* add a link opening a window with the parsed backtrace
- *
+ *
* @param att
* Attachment object
*/
@@ -100,7 +100,7 @@ function addShowParsedBTLink(att) {
function addNewAttachmentRow(origAtt, newAttId, newAttSize) {
var that = this;
var oldAddBTLink = document
- .getElementById("attachBacktraceActivator");
+ .getElementById("attachBacktraceActivator");
oldAddBTLink.parentNode.removeChild(oldAddBTLink);
var newTRElem = origAtt[4].cloneNode(true);
@@ -116,9 +116,9 @@ function addNewAttachmentRow(origAtt, newAttId, newAttSize) {
aElements[0].getElementsByTagName("b")[0].textContent = titleParsedAttachment;
var sizeSpan = newTRElem
- .getElementsByClassName("bz_attach_extra_info")[0];
+ .getElementsByClassName("bz_attach_extra_info")[0];
sizeSpan.textContent = "(" + (newAttSize / 1024).toFixed(2)
- + " KB, text/plain)";
+ + " KB, text/plain)";
// aElements[1].textContent = new Date().toString(); TODO we should add
// eventually, but not pressing
@@ -135,7 +135,7 @@ function addNewAttachmentRow(origAtt, newAttId, newAttSize) {
vcardAElem.setAttribute("href", "mailto:" + this.login);
vcardAElem.className = "email";
vcardAElem.innerHTML = "<span class='fn'>" + this.login
- + "</span>";
+ + "</span>";
}
var elem = newTRElem.querySelector("td:last-of-type");
@@ -148,7 +148,7 @@ function addNewAttachmentRow(origAtt, newAttId, newAttSize) {
/**
* Add a link to create a new attachment with a parsed backtrace
- *
+ *
* @param oldAtt
* Object with an attachment row
* @param snippet
diff --git a/data/lib/otherButtons.js b/data/lib/otherButtons.js
index 507a3b3..060ce16 100644
--- a/data/lib/otherButtons.js
+++ b/data/lib/otherButtons.js
@@ -4,7 +4,7 @@
/**
* Set background color of all comments made by reporter in ReporterColor color
- *
+ *
*/
function checkComments() {
var reporter = getReporter();
@@ -28,7 +28,7 @@ function collectComments() {
/**
* Find default assignee based on the current component
- *
+ *
* @return String what would be a default assignee if we haven't set it up.
*/
function getDefaultAssignee() {
@@ -38,7 +38,7 @@ function getDefaultAssignee() {
/**
* Set default assignee
- *
+ *
* @return none sets this.defaultAssignee property according to defaultAssignee
* list
*/
@@ -63,7 +63,8 @@ function markBugTriaged() {
if (hasXorgBugsCategory && !hasXorgBugsCategory()) {
alert("This won't do! First set the category!");
}
- else if (isEnterprise && !isEnterprise() && (getSeverity() == 'unspecified')) {
+ else if (isEnterprise && !isEnterprise()
+ && (getSeverity() == 'unspecified')) {
alert("This won't do! Specify some severity!");
}
else {
@@ -73,7 +74,7 @@ function markBugTriaged() {
var FillMagicDoneRE = new RegExp("^\\s*\\[[0-9a-zA-Z_]*\\]");
-function addingEmbelishments(list) {
+function addingEmbelishments(logList) {
var maintCCAddr = "";
if (constantData.CCmaintainer) {
@@ -127,7 +128,7 @@ function addingEmbelishments(list) {
/**
* Set branding colours to easily distinguish between Fedora and RHEL bugs
- *
+ *
* @param brand
* String with product of the current bug
* @param version
diff --git a/data/lib/queries.js b/data/lib/queries.js
index 52c6ce6..066991e 100644
--- a/data/lib/queries.js
+++ b/data/lib/queries.js
@@ -13,7 +13,7 @@ function getSelection() {
/**
* Opens a new tab with a query for the given text in the selected component
- *
+ *
* @param text
* to be searched for
* @param component
@@ -22,7 +22,7 @@ function getSelection() {
* (optional) string with the product name, if undefined, search in all
* products
* @return None
- *
+ *
*/
function queryInNewTab(text, component, product, equivComps) {
var urlStr = "https://" + window.location.hostname
@@ -55,7 +55,7 @@ function queryInNewTab(text, component, product, equivComps) {
+ text;
urlStr += searchText;
self.postMessage(new Message("OpenURLinTab", urlStr)); // utils.js is
- // always avaiulable
+ // always avaiulable
}
}
@@ -80,7 +80,7 @@ function queryForSelection() {
}
/**
- *
+ *
*/
function queryUpstreamCallback(text, queryUpBug) {
var searchData = filterByRegexp(queryUpBug, getComponent());
@@ -99,7 +99,7 @@ function queryUpstreamCallback(text, queryUpBug) {
/**
* Search simple query in the upstream bugzilla appropriate for the component
- *
+ *
* @return none
*/
function queryUpstream(qUpBug) {
diff --git a/data/lib/util.js b/data/lib/util.js
index 1c3e607..92b9436 100644
--- a/data/lib/util.js
+++ b/data/lib/util.js
@@ -1,5 +1,5 @@
-/*global console: false */
-/*jslint onevar: false */
+/* global console: false */
+/* jslint onevar: false */
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
"use strict";
@@ -7,14 +7,14 @@
/**
* parse URL to get its parts.
- *
+ *
* @param url
* @return object with all parsed parts of URL as properties
- *
+ *
* Originally from
* http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ Copyright
* February 19th, 2009, James Padolsey, <license undeclared>
- *
+ *
* This function creates a new anchor element and uses location properties
* (inherent) to get the desired URL data. Some String operations are used (to
* normalize results across browsers).
@@ -30,8 +30,8 @@ function parseURL(url) {
query: a.search,
params: (function(){
var ret = {},
- seg = a.search.replace(/^\?/,'').split('&'),
- len = seg.length, i = 0, s;
+ seg = a.search.replace(/^\?/,'').split('&'),
+ len = seg.length, i = 0, s;
for (;i<len;i++) {
if (!seg[i]) { continue; }
s = seg[i].split('=');
@@ -50,7 +50,7 @@ function parseURL(url) {
/**
* parse XML object out of string working around various bugs in Gecko
* implementation see https://developer.mozilla.org/en/E4X for more information
- *
+ *
* @param inStr
* String with unparsed XML string
* @return XML object
@@ -60,7 +60,7 @@ function parseXMLfromString (inStuff) {
// this.response
// and get just .text property out of it. TODO
var respStr = inStuff.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug
- // 336551
+ // 336551
return new XML(respStr);
}
@@ -74,7 +74,7 @@ function getBugNo() {
/**
* Get a bug no from URL ... fails with aliases
- *
+ *
* @param url
* String with URL to be analyzed
* @return String with the bug ID
@@ -88,7 +88,7 @@ function getBugNoFromURL(url) {
/**
* Send mouse click to the specified element
- *
+ *
* @param String
* ID of the element to send mouseclick to
* @return None
@@ -103,7 +103,7 @@ function clickMouse (targetID) {
/**
* Create a A element leadink nowhere, but with listener running a callback on
* the click
- *
+ *
* @param id
* String with a id to be added to the element
* @param text
@@ -173,10 +173,10 @@ function createDeadLink (id, text, parent, callback, params, before, covered, ac
* From <a> element diggs out just plain email address Note that
* bugzilla.gnome.org doesn't have mailto: url but
* https://bugzilla.gnome.org/page.cgi?id=describeuser.html&login=mcepl%40redhat.com
- *
+ *
* @param aElement Element with href attribute or something else @return String
* with the address or null
- *
+ *
*/
function parseMailto(aElement) {
var emailStr = "", hrefStr = "";
@@ -196,7 +196,7 @@ function parseMailto(aElement) {
/**
* format date to be in ISO format (just day part)
- *
+ *
* @param date
* @return string with the formatted date
*/
@@ -206,13 +206,13 @@ function getISODate(dateStr) {
}
var date = new Date(dateStr);
return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' +
- pad(date.getDate());
+ pad(date.getDate());
}
/**
* Check whether an item is member of the list. Idea is just to make long if
* commands slightly more readable.
- *
+ *
* @param mbr
* string to be searched in the list
* @param list
@@ -228,23 +228,23 @@ function isInList(mbr, list) {
/**
* Make sure value returned is Array
- *
+ *
* @param Array/String
* @return Array
- *
+ *
* If something else than Array or String is passed to the function the result
* will be untouched actual argument of the call.
*/
function valToArray(val) {
var isArr = val &&
- val.constructor &&
- val.constructor.name === "Array";
+ val.constructor &&
+ val.constructor.name === "Array";
return isArr ? val : [val];
}
/**
* Merges two comma separated string as a list and returns new string
- *
+ *
* @param str
* String with old values
* @param value
@@ -268,7 +268,7 @@ function addCSVValue(str, value) {
/**
* Treats comma separated string as a list and removes one item from it
- *
+ *
* @param str
* String treated as a list
* @param value
@@ -288,7 +288,7 @@ function removeCSVValue(str, value) {
/**
* select element of the array where regexp in the first element matches second
* parameter of this function
- *
+ *
* @param list
* Array with regexps and return values
* @param chosingMark
@@ -312,7 +312,7 @@ function filterByRegexp(list, chosingMark) {
/**
* remove elements from the page based on their IDs
- *
+ *
* @param doc
* Document object
* @param target
@@ -339,19 +339,19 @@ function killNodes(doc, target, remove) {
/**
* Remove duplicate elements from array
- *
+ *
* @param arr
* Array which needs to be cleaned up
* @return cleaned up array
*/
function removeDuplicates (arr) {
for (var i = 0; i < arr.length; i++) {
- for (var j = i + 1; j < arr.length; j++) {
- if (arr[i] == arr[j]) {
- arr.splice (j, 1);
+ for (var j = i + 1; j < arr.length; j++) {
+ if (arr[i] == arr[j]) {
+ arr.splice (j, 1);
+ }
}
}
- }
return arr;
}
@@ -361,12 +361,12 @@ function removeDuplicates (arr) {
* Message("GetPassword", { login: login, hostname: location.hostname }));
*/
function Message(cmd, data) {
- this.cmd = cmd;
- this.data = data;
+ this.cmd = cmd;
+ this.data = data;
}
function log(msg) {
- self.postMessage(new Message("LogMessage", msg));
+ self.postMessage(new Message("LogMessage", msg));
}
var NotLoggedinException = function NotLoggedinException (message) {
diff --git a/data/rhlib/fixingAttMIME.js b/data/rhlib/fixingAttMIME.js
index ada6974..9834cfa 100644
--- a/data/rhlib/fixingAttMIME.js
+++ b/data/rhlib/fixingAttMIME.js
@@ -1,11 +1,11 @@
-// Released under the MIT/X11 license
-// http://www.opensource.org/licenses/mit-license.php
+//Released under the MIT/X11 license
+//http://www.opensource.org/licenses/mit-license.php
var reqCounter = 0; // TODO should be probably a dict indexed by called method
/**
* Callback function for the XMLRPC request
- *
+ *
* @param ret
* Object with xmlhttprequest response with attributes: + status -- int
* return code + statusText + responseHeaders + responseText
@@ -22,7 +22,7 @@ function XMLRPCcallback() {
/**
* The worker function -- call XMLRPC to fix MIME type of the particular
* attachment
- *
+ *
* @param id
* Integer with the attachment id to be fixed
* @param type
@@ -30,19 +30,19 @@ function XMLRPCcallback() {
* @param email
* Boolean whether email should be sent to appropriate person; option,
* defaults to false
- *
+ *
* updateAttachMimeType($data_ref, $username, $password)
- *
+ *
* Update the attachment mime type of an attachment. The first argument is a
* data hash containing information on the new MIME type and the attachment id
* that you want to act on.
- *
+ *
* $data_ref = { "attach_id" => "<Attachment ID>", # Attachment ID to perform
* MIME type change on. "mime_type" => "<New MIME Type Value>", # Legal MIME
* type value that you want to change the attachment to. "nomail" => 0, #
* OPTIONAL Flag that is either 1 or 0 if you want email to be sent or not for
* this change };
- *
+ *
*/
function fixAttachById(id, XMLRPCURL, type, email) {
if (type === undefined) {
@@ -62,9 +62,9 @@ function fixAttachById(id, XMLRPCURL, type, email) {
};
self.postMessage(new Message("MakeJSONRPCall", {
- url : XMLRPCURL.replace("xmlrpc.cgi","jsonrpc.cgi"),
+ url : XMLRPCURL.replace("xmlrpc.cgi", "jsonrpc.cgi"),
method : "bugzilla.updateAttachMimeType",
- login: getLogin(),
+ login : getLogin(),
params : params,
callRPC : "FixAttachmentMIMECallback"
}));
@@ -73,7 +73,7 @@ function fixAttachById(id, XMLRPCURL, type, email) {
/**
* Add a link to the bad attachment for fixing it.
- *
+ *
* @param
* <TR> DOM jQuery element with a bad attachment
* @return none
diff --git a/data/rhlib/rhbzpage.js b/data/rhlib/rhbzpage.js
index bab9947..48a5758 100644
--- a/data/rhlib/rhbzpage.js
+++ b/data/rhlib/rhbzpage.js
@@ -3,8 +3,8 @@
// For identification of graphics card
var manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ],
- [ "ATI Mobility Radeon", "ATI", "1002" ],
- [ "Intel Corporation", "INTEL", "8086" ], [ "NVIDIA", "NV", "10de" ] ];
+ [ "ATI Mobility Radeon", "ATI", "1002" ],
+ [ "Intel Corporation", "INTEL", "8086" ], [ "NVIDIA", "NV", "10de" ] ];
// http://en.wikipedia.org/wiki/HSL_color_space
// when only the value of S is changed
@@ -12,44 +12,44 @@ var manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ],
var RHColor = new Color(158, 41, 43); // RGB 158, 41, 43; HSL 359, 1, 39
var FedoraColor = new Color(0, 40, 103); // RGB 0, 40, 103; HSL 359, 1, 39
var RawhideColor = new Color(0, 119, 0); // or "green", or RGB 0, 119, 0, or
- // HSL
+// HSL
// 120, 0, 23
var RHITColor = new Color(102, 0, 102); // RGB 102, 0, 102; HSL 300, 0, 20
// [ 126.386] (--) NOUVEAU(0): Chipset: "NVIDIA NVaf"
var logAnalyzeLogic = {
- "AnalyzeInterestingLine": {
- /*
- * [ 126.378] (--) PCI:*(0:4:0:0) 10de:08a0:106b:00c2 rev 162, Mem @
- * 0xd2000000/16777216, \ 0xc0000000/268435456, 0xd0000000/33554432, I/O @
- * 0x00001000/128, BIOS @ 0x????????/131072
- */
- re: [
- "^(\\[[ .0-9]+\\])?\\s*\\(--\\) PCI:\\*\\([0-9:]+\\)\\s*" +
- "([0-9a-f:]+).*$",
- "^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) "+
- "([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$",
- ],
- func: chipsetMagic
- },
- /*
- * [ 126.385] (WW) Falling back to old probe method for vesa [ 126.385] (WW)
- * Falling back to old probe method for fbdev [ 126.386] (--) NOUVEAU(0):
- * Chipset: "NVIDIA NVaf" Backtrace: [ 33.158] Kernel command line: ro
- * root=LABEL=root rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8
- * SYSFONT=latarcyrheb-sun16 KEYTABLE=us drm.debug=0x04
- *
- */
- "AnalyzeXorgLogBacktrace": {
- re: "^\\s*(\\[[0-9 .]*\\])?\\s*(\\((EE|WW)\\)|.* [cC]hipset:.*)|\\s*(Backtrace|Kernel command line)",
- func: analyzeXorg
- }
+ "AnalyzeInterestingLine": {
+ /*
+ * [ 126.378] (--) PCI:*(0:4:0:0) 10de:08a0:106b:00c2 rev 162, Mem @
+ * 0xd2000000/16777216, \ 0xc0000000/268435456, 0xd0000000/33554432, I/O @
+ * 0x00001000/128, BIOS @ 0x????????/131072
+ */
+ re: [
+ "^(\\[[ .0-9]+\\])?\\s*\\(--\\) PCI:\\*\\([0-9:]+\\)\\s*" +
+ "([0-9a-f:]+).*$",
+ "^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) "+
+ "([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$",
+ ],
+ func: chipsetMagic
+ },
+ /*
+ * [ 126.385] (WW) Falling back to old probe method for vesa [ 126.385] (WW)
+ * Falling back to old probe method for fbdev [ 126.386] (--) NOUVEAU(0):
+ * Chipset: "NVIDIA NVaf" Backtrace: [ 33.158] Kernel command line: ro
+ * root=LABEL=root rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8
+ * SYSFONT=latarcyrheb-sun16 KEYTABLE=us drm.debug=0x04
+ *
+ */
+ "AnalyzeXorgLogBacktrace": {
+ re: "^\\s*(\\[[0-9 .]*\\])?\\s*(\\((EE|WW)\\)|.* [cC]hipset:.*)|\\s*(Backtrace|Kernel command line)",
+ func: analyzeXorg
+ }
};
var ProfessionalProducts = [
- "Red Hat Enterprise Linux",
- "Red Hat Enterprise MRG"
-];
+ "Red Hat Enterprise Linux",
+ "Red Hat Enterprise MRG"
+ ];
// END OF CONSTANTS
@@ -77,7 +77,7 @@ function RHOnMessageHandler(msg) {
break;
default:
console.error("Error: unknown RPC call " + msg.toSource());
- break;
+ break;
}
}
@@ -133,10 +133,10 @@ function RHcentralCommandDispatch(cmdLabel, cmdParams) {
case "chipMagic":
fillInWhiteBoard(cmdParams);
break;
- // If we don't have it here, call superclass method
+ // If we don't have it here, call superclass method
default:
console.error("Unknown command:\n" + cmdLabel + "\nparameters:\n" + cmdParams);
- break;
+ break;
}
}
@@ -144,7 +144,7 @@ function RHcentralCommandDispatch(cmdLabel, cmdParams) {
/**
* Make it sailent that the some attachments with bad MIME type are present
- *
+ *
* @param atts
* Array of attachments subarrays
* @return none
@@ -162,7 +162,7 @@ function markBadAttachments(atts) {
if (badAttachments.length > 0) {
var titleElement = document.
- getElementsByClassName("bz_alias_short_desc_container")[0];
+ getElementsByClassName("bz_alias_short_desc_container")[0];
titleElement.style.backgroundColor = "olive";
createDeadLink("fixAllButton", "Fix all", titleElement, function() {
@@ -178,7 +178,7 @@ function markBadAttachments(atts) {
/**
* Open a tab in the upstream bugzilla to create a new bug
- *
+ *
* @return none
*/
function sendBugUpstream() {
@@ -190,14 +190,14 @@ function sendBugUpstream() {
self.postMessage(new Message("OpenBugUpstream", {
url: urlStr,
subject: document.getElementById("short_desc_nonedit_display").
- textContent.trim(),
+ textContent.trim(),
comment: collectComments()
}));
}
/**
* Add a link opening selected lines of Xorg.0.log
- *
+ *
* @return none
*/
function addCheckXorgLogLink(attList) {
@@ -214,14 +214,14 @@ function addCheckXorgLogLink(attList) {
/**
* Given line to be parsed, find out which chipset it is and fill in the
* whiteboard
- *
+ *
* @param PCIidArrObj
* object with two fields id Array manufacturer-ID and product-ID (PCI
* IDs) chipsetLine whole line containing PCI ID.
* @param driverStr
* String with the driver name
* @return None
- *
+ *
*/
function fillInWhiteBoard(cardName) {
console.myDebug("fillInWhiteBoard: cardName = " + cardName);
@@ -235,7 +235,7 @@ function fillInWhiteBoard(cardName) {
* Get attached Xorg.0.log, parse it and find the value of chip. Does not fill
* the whiteboard itself, just adds button to do so,paramList so that slow
* XMLHttpRequest is done in advance.
- *
+ *
* @param log
* array of XorgLogAttList
* @return None
@@ -246,7 +246,7 @@ function fillInChipMagic(XlogID) {
/**
* Creates a button to change summary by adding a graphic chip label
- *
+ *
* @param Array
* with matching results of re.exec()
*/
@@ -263,12 +263,12 @@ function chipsetMagic (interestingLineArr) {
// add to the button
if (interestingLineArr.length > 1) {
var PCIid = (interestingPCIID[0] + "," + interestingPCIID[1]).
- toUpperCase();
+ toUpperCase();
// Nvidia driver provides good code in the Chipset line
if (interestingPCIID[0].toLowerCase() == "10de") {
cardStr = interestingLineArr[1][2].
- replace(/\s*nvidia\s*/ig,"").
- replace('"','','g');
+ replace(/\s*nvidia\s*/ig,"").
+ replace('"','','g');
} else {
try {
cardStr = constantData.chipNames[PCIid][0];
@@ -307,17 +307,17 @@ function analyzeXorg(results) {
innerString += lRE.input + "<br>\n";
});
innerString += "----------<br>\n" +
- results.length + " interesting lines found.";
+ results.length + " interesting lines found.";
}
else {
innerString += "No matching lines found!";
}
self.postMessage(new Message("OpenStringInPanel",
- '<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">' +
- "<html><head><title>Xorg.0.log analysis</title></head><body><pre>\n" +
- innerString.trim() +
- "\n</pre></body></html>"));
+ '<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">' +
+ "<html><head><title>Xorg.0.log analysis</title></head><body><pre>\n" +
+ innerString.trim() +
+ "\n</pre></body></html>"));
}
function analyzeXorgLog(attachID, backMsg) {
@@ -345,29 +345,29 @@ function findInterestingLine(wholeLog, backMsg) {
var results = [];
wholeLog.split("\n").
- forEach(function(line) {
- REarr.forEach(function (re, reIdx) {
- if (re.test(line)) {
- console.myDebug("Found match on line:\n" + line);
- console.myDebug("Result: " + re.exec(line).toSource());
- results.push(re.exec(line));
- }
- });
+ forEach(function(line) {
+ REarr.forEach(function (re, reIdx) {
+ if (re.test(line)) {
+ console.myDebug("Found match on line:\n" + line);
+ console.myDebug("Result: " + re.exec(line).toSource());
+ results.push(re.exec(line));
+ }
});
+ });
console.myDebug("results = " + results.toSource());
logAnalyzeLogic[backMsg].func(results);
}
/**
* Add information about the upstream bug upstream, and closing it.
- *
+ *
* @param evt
* Event which called this handler
* @return none
*/
function addClosingUpstream() {
var refs = document.getElementById("external_bugs_table")
- .getElementsByTagName("tr");
+ .getElementsByTagName("tr");
// that's a bad id, if there is a one. :)
var inputBox = document.getElementById("inputbox");
@@ -375,8 +375,8 @@ function addClosingUpstream() {
var wholeURL = "";
// Fix missing ID on the external_id SELECT
- document.getElementsByName("external_id")[0].setAttribute("id",
- "external_id");
+ document.getElementsByName("external_id")[0].setAttribute("id",
+ "external_id");
if (inputBox.value.match(/^http.*/)) {
externalBugID = getBugNoFromURL(inputBox.value);
@@ -412,7 +412,7 @@ function addClosingUpstream() {
}
/**
- *
+ *
*/
function parseBacktrace (ret) {
var signalHandler = new RegExp("^\\s*#[0-9]*\\s*<signal handler called>");
@@ -463,8 +463,8 @@ function RHBZinit(attachments) {
markBadAttachments(attachments);
var parsedAttachments = attachments.filter(function (att) {
- return (new RegExp(titleParsedAttachment).test(att[0]));
- });
+ return (new RegExp(titleParsedAttachment).test(att[0]));
+ });
if (constantData.defaultAssignee) {
setDefaultAssignee();
@@ -472,7 +472,7 @@ function RHBZinit(attachments) {
if (constantData.xorgBugsCategories) {
var XBZlist = filterByRegexp(constantData.
- xorgBugsCategories, getComponent());
+ xorgBugsCategories, getComponent());
if (XBZlist) {
makeBugCategoriesList(XBZlist);
}
@@ -504,7 +504,7 @@ function RHBZinit(attachments) {
// Uncheck "set default assignee" when the assignee is changed by other means
document.getElementById("assigned_to").addEventListener("change",
- function() {
- changeAssignee(null);
- }, false);
+ function() {
+ changeAssignee(null);
+ }, false);
}
diff --git a/data/rhlib/xorgBugCategories.js b/data/rhlib/xorgBugCategories.js
index 3357ed7..31f2d37 100644
--- a/data/rhlib/xorgBugCategories.js
+++ b/data/rhlib/xorgBugCategories.js
@@ -4,12 +4,12 @@
/**
* Returns true if the bug is in a good shape
- *
+ *
* @return Boolean if the bug is either not in the category where we care about
* it (i.e., we don't have set up categories for this component) or if
* it is in the concerned categories, then it has a category recorded in
* the whiteboard input box.
- *
+ *
*/
function hasXorgBugsCategory() {
var catRE = /\s*\[cat:.*?\]\s*/; // RE for testing whether
diff --git a/data/tweaks/addNewLinks.js b/data/tweaks/addNewLinks.js
index 05d5ffb..5434b57 100644
--- a/data/tweaks/addNewLinks.js
+++ b/data/tweaks/addNewLinks.js
@@ -1,47 +1,47 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+/*******************************************************************************
+ * ***** BEGIN LICENSE BLOCK Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
+ * 1.1 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
*
* The Original Code is Bugzilla Tweaks.
*
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
+ * The Initial Developer of the Original Code is Mozilla Foundation. Portions
+ * created by the Initial Developer are Copyright (C) 2010 the Initial
+ * Developer. All Rights Reserved.
*
- * Contributor(s):
- * Johnathan Nightingale <johnath@mozilla.com>
- * Ehsan Akhgari <ehsan@mozilla.com>
+ * Contributor(s): Johnathan Nightingale <johnath@mozilla.com> Ehsan Akhgari
+ * <ehsan@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
+ * either the GNU General Public License Version 2 or later (the "GPL"), or the
+ * GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which
+ * case the provisions of the GPL or the LGPL are applicable instead of those
+ * above. If you wish to allow use of your version of this file only under the
+ * terms of either the GPL or the LGPL, and not to allow others to use your
+ * version of this file under the terms of the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and other
+ * provisions required by the GPL or the LGPL. If you do not delete the
+ * provisions above, a recipient may use your version of this file under the
+ * terms of any one of the MPL, the GPL or the LGPL.
*
- * ***** END LICENSE BLOCK ***** */
+ * ***** END LICENSE BLOCK *****
+ */
function addNewLinks() {
var product = document
.querySelector("#field_container_product option[selected]");
- var component = document.querySelector("#component option[selected]");
+ var component = document
+ .querySelector("#component option[selected]");
if (product) {
- var label = document.getElementById('field_container_product');
+ var label = document
+ .getElementById('field_container_product');
var url = 'enter_bug.cgi?product='
+ encodeURIComponent(product.value);
if (label) {
diff --git a/data/tweaks/bug-page-mod.js b/data/tweaks/bug-page-mod.js
index 3d5ee9b..0e3d431 100644
--- a/data/tweaks/bug-page-mod.js
+++ b/data/tweaks/bug-page-mod.js
@@ -53,7 +53,9 @@ function TweakOnMessageHandler(msg, nextHandler) {
/**
* generate XML-RPC call to collect complete history of the bug
- * @param XMLRPCURL URL of the XML-RPC gateway on the particular bugzilla
+ *
+ * @param XMLRPCURL
+ * URL of the XML-RPC gateway on the particular bugzilla
* @returns nothing
*
* As part of the message is name of the signal "returnedHistory"
@@ -172,116 +174,36 @@ function tweakBugzilla(atts, cData) {
// ===================================================
function processHistory(history) {
// FIXME Remove remaining code to special function ... callback
-// preprocessDuplicateMarkers(document, iframe.contentDocument);
-
-/*
-This is an example of the history we get:
-{
- "version": "1.1",
- "result": {
- "bugs": [
- {
- "history": [
- {
- "when": "2011-04-04T00:19:04Z",
- "who": "cebbert@redhat.com",
- "changes": [
- {
- "removed": "",
- "added": "xgl-maint@redhat.com",
- "field_name": "cc",
- "field": "CC"
- },
- {
- "removed": "kernel",
- "added": "xorg-x11-drv-ati",
- "field_name": "component",
- "field": "Component"
- },
- {
- "removed": "kernel-maint@redhat.com",
- "added": "xgl-maint@redhat.com",
- "field_name": "assigned_to",
- "field": "AssignedTo"
- }
- ]
- },
- {
- "when": "2011-04-12T22:48:22Z",
- "who": "mcepl@redhat.com",
- "changes": [
- {
- "attachment_id": 488889,
- "removed": "application/octet-stream",
- "added": "text/plain",
- "field_name": "attachments.mimetype",
- "field": "Attachment mime type"
- }
- ]
- },
- {
- "when": "2011-04-13T17:07:04Z",
- "who": "mcepl@redhat.com",
- "changes": [
- {
- "removed": "",
- "added": "needinfo?(suckfish@ihug.co.nz)",
- "field_name": "flagtypes.name",
- "field": "Flags"
- }
- ]
- },
- {
- "when": "2011-04-21T12:17:33Z",
- "who": "mcepl@redhat.com",
- "changes": [
- {
- "removed": "xgl-maint@redhat.com",
- "added": "jglisse@redhat.com",
- "field_name": "assigned_to",
- "field": "AssignedTo"
- }
- ]
- },
- {
- "when": "2011-04-28T22:53:58Z",
- "who": "mcepl@redhat.com",
- "changes": [
- {
- "attachment_id": 488889,
- "removed": "text/plain",
- "added": "application/octet-stream",
- "field_name": "attachments.mimetype",
- "field": "Attachment mime type"
- }
- ]
- },
- {
- "when": "2011-04-28T22:59:18Z",
- "who": "mcepl@redhat.com",
- "changes": [
- {
- "attachment_id": 488889,
- "removed": "application/octet-stream",
- "added": "text/plain",
- "field_name": "attachments.mimetype",
- "field": "Attachment mime type"
- }
- ]
- }
- ],
- "id": 692250,
- "alias": [
-
- ]
- }
- ],
- "faults": [
-
- ]
- }
-}
- */
+// preprocessDuplicateMarkers(document, iframe.contentDocument);
+
+ /*
+ * This is an example of the history we get: { "version": "1.1", "result": {
+ * "bugs": [ { "history": [ { "when": "2011-04-04T00:19:04Z", "who":
+ * "cebbert@redhat.com", "changes": [ { "removed": "", "added":
+ * "xgl-maint@redhat.com", "field_name": "cc", "field": "CC" }, { "removed":
+ * "kernel", "added": "xorg-x11-drv-ati", "field_name": "component", "field":
+ * "Component" }, { "removed": "kernel-maint@redhat.com", "added":
+ * "xgl-maint@redhat.com", "field_name": "assigned_to", "field": "AssignedTo" } ] }, {
+ * "when": "2011-04-12T22:48:22Z", "who": "mcepl@redhat.com", "changes": [ {
+ * "attachment_id": 488889, "removed": "application/octet-stream", "added":
+ * "text/plain", "field_name": "attachments.mimetype", "field": "Attachment
+ * mime type" } ] }, { "when": "2011-04-13T17:07:04Z", "who":
+ * "mcepl@redhat.com", "changes": [ { "removed": "", "added":
+ * "needinfo?(suckfish@ihug.co.nz)", "field_name": "flagtypes.name", "field":
+ * "Flags" } ] }, { "when": "2011-04-21T12:17:33Z", "who": "mcepl@redhat.com",
+ * "changes": [ { "removed": "xgl-maint@redhat.com", "added":
+ * "jglisse@redhat.com", "field_name": "assigned_to", "field": "AssignedTo" } ] }, {
+ * "when": "2011-04-28T22:53:58Z", "who": "mcepl@redhat.com", "changes": [ {
+ * "attachment_id": 488889, "removed": "text/plain", "added":
+ * "application/octet-stream", "field_name": "attachments.mimetype", "field":
+ * "Attachment mime type" } ] }, { "when": "2011-04-28T22:59:18Z", "who":
+ * "mcepl@redhat.com", "changes": [ { "attachment_id": 488889, "removed":
+ * "application/octet-stream", "added": "text/plain", "field_name":
+ * "attachments.mimetype", "field": "Attachment mime type" } ] } ], "id":
+ * 692250, "alias": [
+ * ] } ], "faults": [
+ * ] } }
+ */
// UserNameCache
var userNameCache = {};
@@ -299,12 +221,13 @@ This is an example of the history we get:
}
if (history) {
-// console.log("processHistory: history = " + history.toSource());
+// console.log("processHistory: history = " + history.toSource());
return ;
}
-// var historyItems = iframe.contentDocument.querySelectorAll('#bugzilla-body tr');
-// var cmtTimes = document.querySelectorAll('.bz_comment_time');
+// var historyItems = iframe.contentDocument.querySelectorAll('#bugzilla-body
+// tr');
+// var cmtTimes = document.querySelectorAll('.bz_comment_time');
// Sometimes the history will stack several changes together,
// and we'll want to append the data from the Nth item to the
@@ -312,19 +235,19 @@ This is an example of the history we get:
var i=0, j=0, flagsFound;
if (history) {
Array.forEach(history, function (item) {
- processHistoryItem(cmtTimes, item);
+ processHistoryItem(cmtTimes, item);
});
}
-
+
handleEmptyCollapsedBoxes(document);
-// // Set the latest flag links if necessary
-// for (var flagName in flagOccurrences) {
-// flags[flagName].innerHTML = '<a href="#' + flagOccurrences[flagName] + '">'
-// + flags[flagName].innerHTML + '</a>';
-// }
+// // Set the latest flag links if necessary
+// for (var flagName in flagOccurrences) {
+// flags[flagName].innerHTML = '<a href="#' + flagOccurrences[flagName] + '">'
+// + flags[flagName].innerHTML + '</a>';
+// }
-// AttachmentFlagHandler.setupLinks(document);
+// AttachmentFlagHandler.setupLinks(document);
// END OF load event handler
}
diff --git a/data/tweaks/viewSource.js b/data/tweaks/viewSource.js
index d2a9fd1..81e6735 100644
--- a/data/tweaks/viewSource.js
+++ b/data/tweaks/viewSource.js
@@ -38,9 +38,9 @@
var reAttachmentType = /,\s+([^ )]*)[;)]/;
function viewAttachmentSource(attachments) {
- attachments.forEach(function (att) {
+ attachments.forEach(function(att) {
if (att.length < 1) {
- return ;
+ return;
}
var typeName = att[2];
var elem = att[4];
@@ -56,14 +56,16 @@ function viewAttachmentSource(attachments) {
//
// https://bugzilla.mozilla.org/show_bug.cgi?id=369814#c5 has more
// possible mime types for zips?
- createDeadLink("viewSourceJAR_" + id, "JAR Contents", elem,
- "jar:" + attachHref + "!/", [], "pipe", null, null);
+ createDeadLink("viewSourceJAR_" + id, "JAR Contents",
+ elem, "jar:" + attachHref + "!/", [], "pipe", null,
+ null);
}
else if (typeName == "application/zip"
|| typeName == "application/x-zip-compressed"
|| typeName == "application/x-xpinstall") {
- createDeadLink("viewSourceZIP_" + id, "Static ZIP Contents", elem,
- "jar:" + attachHref + "!/", [], "pipe", null, null);
+ createDeadLink("viewSourceZIP_" + id,
+ "Static ZIP Contents", elem, "jar:" + attachHref
+ + "!/", [], "pipe", null, null);
}
else if (typeName != "text/plain" && typeName != "patch" &&
// Other types that Gecko displays like text/plain
@@ -77,8 +79,7 @@ function viewAttachmentSource(attachments) {
typeName != "image/gif" && typeName != "image/png"
&& typeName != "image/jpeg") {
createDeadLink("viewSourcePlain_" + id, "Source", elem,
- "view-source:" + attachHref, [], "pipe", null, null);
- }
+ "view-source:" + attachHref, [], "pipe", null, null);
}
- )
+ })
}