From 83fd7fd92e5b21a177bc16cc7318792cf63a343b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 13 May 2011 12:20:05 +0200 Subject: Really Eclipseize formatting. --- data/rhlib/fixingAttMIME.js | 22 +++---- data/rhlib/rhbzpage.js | 142 ++++++++++++++++++++-------------------- data/rhlib/xorgBugCategories.js | 4 +- 3 files changed, 84 insertions(+), 84 deletions(-) (limited to 'data/rhlib') 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 to perform * MIME type change on. "mime_type" => "", # 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 * 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 + "
\n"; }); innerString += "----------
\n" + - results.length + " interesting lines found."; + results.length + " interesting lines found."; } else { innerString += "No matching lines found!"; } self.postMessage(new Message("OpenStringInPanel", - '' + - "Xorg.0.log analysis
\n" +
-    innerString.trim() +
-    "\n
")); + '' + + "Xorg.0.log analysis
\n" +
+      innerString.trim() +
+  "\n
")); } 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*"); @@ -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 -- cgit