aboutsummaryrefslogtreecommitdiffstats
path: root/docs/html/overview-summary-rhbzpage.js.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/overview-summary-rhbzpage.js.html')
-rw-r--r--docs/html/overview-summary-rhbzpage.js.html1092
1 files changed, 1092 insertions, 0 deletions
diff --git a/docs/html/overview-summary-rhbzpage.js.html b/docs/html/overview-summary-rhbzpage.js.html
new file mode 100644
index 0000000..56dcb4c
--- /dev/null
+++ b/docs/html/overview-summary-rhbzpage.js.html
@@ -0,0 +1,1092 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
+<html>
+<head>
+<title>
+ Overview
+</title>
+<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
+<script>
+function asd() {
+
+ parent.document.title="rhbzpage.js Overview";
+
+}
+</script>
+</head>
+<body bgcolor="white" onload="asd();">
+
+<!-- ========== START OF NAVBAR ========== -->
+<a name="navbar_top"><!-- --></a>
+<table border="0" width="100%" cellpadding="1" cellspacing="0">
+<tr>
+<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
+<a name="navbar_top_firstrow"><!-- --></a>
+<table border="0" cellpadding="0" cellspacing="3">
+ <tr align="center" valign="top">
+
+
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
+ <td bgcolor="#FFFFFF" class="NavBarCell1Rev"> &nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
+
+
+ <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
+ </tr>
+</table>
+</td>
+<td bgcolor="#EEEEFF" align="right" valign="top">
+<em>
+<b></b></em>
+</td>
+</tr>
+
+<tr>
+<td bgcolor="white" class="NavBarCell2"><font size="-2">
+&nbsp;PREV&nbsp;
+&nbsp;NEXT</font></td>
+<td bgcolor="white" class="NavBarCell2"><font size="-2">
+ <a href="index.html" target="_top"><b>FRAMES</b></a> &nbsp;
+&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
+&nbsp;&nbsp;
+<script>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+</script>
+<noscript>
+<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
+</noscript>
+</font></td>
+</tr>
+</table>
+<!-- =========== END OF NAVBAR =========== -->
+
+<hr>
+<center>
+
+ <h2>rhbzpage.js</h2>
+
+</center>
+
+
+
+
+<h4>Summary</h4>
+<p>
+
+ No overview generated for 'rhbzpage.js'<BR/><BR/>
+
+</p>
+
+<hr>
+
+
+ <table border="1" cellpadding="3" cellspacing="0" width="100%">
+ <tr bgcolor="#CCCCFF" class="TableHeadingColor">
+ <td colspan=2><font size="+2">
+
+ <b>Class Summary</b>
+
+ </font></td>
+ </tr>
+
+ <tr bgcolor="white" class="TableRowColor">
+ <td width="15%"><b><a href="RHBugzillaPage.html">RHBugzillaPage</a></b></td>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ <hr/>
+
+
+<!-- ========== METHOD SUMMARY =========== -->
+
+<!-- ========== END METHOD SUMMARY =========== -->
+
+
+ <pre class="sourceview"><span class="comment">/*jslint onevar: false, browser: true, evil: true, laxbreak: true, undef: true, nomen: true, eqeqeq: true, bitwise: true, maxerr: 1000, immed: false, white: false, plusplus: false, regexp: false, undef: false */</span>
+<span class="comment">// Released under the MIT/X11 license</span>
+<span class="comment">// http://www.opensource.org/licenses/mit-license.php</span>
+<span class="literal">"use strict"</span>;
+var util = require(<span class="literal">"util"</span>);
+var xrpc = require(<span class="literal">"xmlrpc"</span>);
+var apiUtils = require(<span class="literal">"api-utils"</span>);
+var xhr = require(<span class="literal">"xhr"</span>);
+var clip = require(<span class="literal">"clipboard"</span>);
+var Color = require(<span class="literal">"color"</span>).Color;
+var BZPage = require(<span class="literal">"bzpage"</span>).BZPage;
+var url = require(<span class="literal">"url"</span>);
+var timer = require(<span class="literal">"timer"</span>);
+var selection = require(<span class="literal">"selection"</span>);
+var tabs = require(<span class="literal">"tabs"</span>);
+<span class="comment">// var NumberOfFrames = 7;</span>
+<span class="comment">// var bugURL = "https://bugzilla.redhat.com/show_bug.cgi?id=";</span>
+
+<span class="comment">// ====================================================================================</span>
+<span class="comment">// RHBugzillaPage object</span>
+
+var RHBugzillaPage = <span class="reserved">function</span> RHBugzillaPage(win, config) {
+ <span class="comment">// inheritance ... call superobject's constructor</span>
+ BZPage.call(<span class="reserved">this</span>, win, config);
+
+ <span class="comment">// For identification of graphics card</span>
+ var manuChipStrs = [ [ <span class="literal">"ATI Radeon"</span>, <span class="literal">"ATI"</span>, <span class="literal">"1002"</span> ],
+ [ <span class="literal">"ATI Mobility Radeon"</span>, <span class="literal">"ATI"</span>, <span class="literal">"1002"</span> ],
+ [ <span class="literal">"Intel Corporation"</span>, <span class="literal">"INTEL"</span>, <span class="literal">"8086"</span> ], [ <span class="literal">"NVIDIA"</span>, <span class="literal">"NV"</span>, <span class="literal">"10de"</span> ] ];
+
+ <span class="comment">// http://en.wikipedia.org/wiki/HSL_color_space</span>
+ <span class="comment">// when only the value of S is changed</span>
+ <span class="comment">// stupido!!! the string is value in hex for each color</span>
+ <span class="reserved">this</span>.RHColor = new Color(158, 41, 43); <span class="comment">// RGB 158, 41, 43; HSL 359, 1, 39</span>
+ <span class="reserved">this</span>.FedoraColor = new Color(0, 40, 103); <span class="comment">// RGB 0, 40, 103; HSL 359, 1, 39</span>
+ <span class="reserved">this</span>.RawhideColor = new Color(0, 119, 0); <span class="comment">// or "green", or RGB 0, 119, 0, or</span>
+ <span class="comment">// HSL</span>
+ <span class="comment">// 120, 0, 23</span>
+ <span class="reserved">this</span>.RHITColor = new Color(102, 0, 102); <span class="comment">// RGB 102, 0, 102; HSL 300, 0, 20</span>
+
+ <span class="reserved">this</span>.RE = {
+ Comment: new RegExp(<span class="literal">"^\\s*#"</span>), <span class="comment">// unsused</span>
+ BlankLine: new RegExp(<span class="literal">"^\\s*$"</span>), <span class="comment">// unused</span>
+ <span class="comment">// new line</span>
+ <span class="comment">// [ 65.631] (--) intel(0): Chipset: "845G"</span>
+ Chipset: new RegExp(<span class="literal">"^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) "</span>+
+ <span class="literal">"([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$"</span>),
+ ATIgetID: new RegExp(<span class="literal">"^.*\\(ChipID = 0x([0-9a-fA-F]+)\\).*$"</span>),
+ Abrt: new RegExp(<span class="literal">"^\\s*\\[abrt\\]"</span>),
+ signalHandler: new RegExp(<span class="literal">"^\\s*#[0-9]*\\s*&lt;signal handler called&gt;"</span>),
+ frameNo: new RegExp(<span class="literal">"^\\s*#([0-9]*)\\s"</span>)
+ };
+
+ <span class="reserved">this</span>.XMLRPCurl = <span class="literal">"https://bugzilla.redhat.com/xmlrpc.cgi"</span>;
+ <span class="comment">// END OF CONSTANTS</span>
+
+ var that = <span class="reserved">this</span>;
+ <span class="reserved">this</span>.reqCounter = 0;
+ <span class="reserved">this</span>.signaturesCounter = 0;
+ <span class="reserved">this</span>.chipMagicInterestingLine = <span class="literal">""</span>;
+
+ <span class="reserved">this</span>.login = <span class="reserved">this</span>.getLogin();
+ <span class="reserved">this</span>.password = <span class="reserved">this</span>.getPassword();
+
+ var ITbutton = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"cf_issuetracker"</span>);
+ <span class="reserved">this</span>.its = ITbutton ? ITbutton.value.trim() : <span class="literal">""</span>;
+
+ <span class="comment">// set default assignee on change of the component</span>
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"component"</span>).addEventListener(<span class="literal">"change"</span>,
+ <span class="reserved">function</span>() {
+ that.component = that.getOptionValue(<span class="literal">"component"</span>);
+ that.changeAssignee(<span class="literal">"default"</span>);
+ }, false);
+
+ <span class="comment">// getBadAttachments</span>
+ <span class="reserved">this</span>.XorgLogAttList = [];
+ <span class="reserved">this</span>.XorgLogAttListIndex = 0;
+ <span class="reserved">this</span>.attachments = <span class="reserved">this</span>.getAttachments();
+ <span class="reserved">this</span>.markBadAttachments();
+ <span class="reserved">this</span>.setDefaultAssignee();
+
+ <span class="comment">// Dig out backtrace</span>
+ <span class="reserved">this</span>.btSnippet = <span class="literal">""</span>;
+
+ var parseAbrtBacktraces = config.gJSONData.configData.parseAbrtBacktraces;
+ <span class="reserved">if</span> (parseAbrtBacktraces &amp;&amp; <span class="reserved">this</span>.RE.Abrt.test(<span class="reserved">this</span>.title)) {
+ <span class="reserved">this</span>.pasteBacktraceInComments();
+ }
+
+ <span class="comment">// Take care of signature for Fedora bugzappers</span>
+ <span class="reserved">if</span> (config.gJSONData.configData.signature.length &gt; 0) {
+ var signatureFedoraString = config.gJSONData.configData.signature;
+ <span class="reserved">this</span>.doc.forms.namedItem(<span class="literal">"changeform"</span>).addEventListener(<span class="literal">"submit"</span>,
+ <span class="reserved">function</span>() {
+ <span class="reserved">if</span> (<span class="reserved">this</span>.signaturesCounter &lt; 1) {
+ that.addStuffToTextBox(<span class="literal">"comment"</span>, signatureFedoraString);
+ <span class="reserved">this</span>.signaturesCounter += 1;
+ }
+ }, false);
+ }
+
+ <span class="reserved">this</span>.setBranding();
+ <span class="reserved">this</span>.checkComments();
+
+ <span class="comment">// TODO Get compiz bugs as well</span>
+ <span class="reserved">if</span> ((config.gJSONData.configData.PCIIDsURL
+ &amp;&amp; (config.PCI_ID_Array.length &gt; 0))
+ &amp;&amp; <span class="reserved">this</span>.maintCCAddr === <span class="literal">"xgl-maint@redhat.com"</span>) {
+ <span class="comment">// Add find chip magic button</span>
+ var whiteboard_string = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"status_whiteboard"</span>).value;
+ <span class="reserved">if</span> (!/card_/.test(whiteboard_string)) {
+ <span class="reserved">this</span>.fillInChipMagic();
+ }
+ }
+}; <span class="comment">// END OF RHBugzillaPage CONSTRUCTOR</span>
+
+RHBugzillaPage.<span class="reserved">prototype</span>.toString = <span class="reserved">function</span> toString () {
+ <span class="reserved">return</span> (<span class="literal">"[Object RHBugzillaPage]"</span>);
+};
+
+RHBugzillaPage.<span class="reserved">prototype</span> = util.heir(BZPage);
+RHBugzillaPage.<span class="reserved">prototype</span>.constructor = RHBugzillaPage;
+
+<span class="comment">/**
+ * Find default assignee based on the current component
+ *
+ * <span class="attrib">@return</span> String what would be a default assignee if
+ * we haven't set it up.
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.getDefaultAssignee = <span class="reserved">function</span>() {
+ <span class="reserved">return</span> util.filterByRegexp(<span class="reserved">this</span>.constantData.defaultAssignee,
+ <span class="reserved">this</span>.component).toLowerCase();
+};
+
+<span class="comment">/**
+ * Set default assignee
+ *
+ * <span class="attrib">@return</span> none
+ * sets this.defaultAssignee property according to defaultAssignee list
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.setDefaultAssignee = <span class="reserved">function</span>() {
+ <span class="reserved">this</span>.defaultAssignee = <span class="reserved">this</span>.getDefaultAssignee();
+ var defAss = <span class="reserved">this</span>.defaultAssignee;
+
+ <span class="comment">// Add setting default assignee</span>
+ <span class="reserved">if</span> ((defAss.length &gt; 0) &amp;&amp; (defAss !== <span class="reserved">this</span>.getOwner())) {
+ <span class="reserved">this</span>.constantData.defaultAssigneeTrigger = true;
+ <span class="reserved">this</span>.createNewButton(<span class="literal">"bz_assignee_edit_container"</span>,true,<span class="literal">"rh-common"</span>,<span class="literal">"setDefaultAssignee"</span>);
+ }
+};
+
+<span class="comment">/**
+ * Auxiliary function to computer more complicated resolution
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.closeSomeRelease = <span class="reserved">function</span>() {
+ <span class="comment">// for RAWHIDE close as RAWHIDE,</span>
+ <span class="comment">// if active selection -&gt; CURRENTRELEASE</span>
+ <span class="comment">// and put the release version to</span>
+ <span class="comment">// "Fixed in Version" textbox</span>
+ <span class="comment">// otherwise -&gt; NEXTRELEASE</span>
+ var verNo = <span class="reserved">this</span>.getVersion();
+ <span class="reserved">this</span>.selectOption(<span class="literal">"bug_status"</span>, <span class="literal">"CLOSED"</span>);
+ var text = <span class="literal">""</span>;
+ var resolution = <span class="literal">""</span>;
+
+ <span class="reserved">if</span> (selection.text) {
+ text = selection.text.trim();
+ }
+ <span class="reserved">if</span> (text.length &gt; 0) {
+ resolution = <span class="literal">"CURRENTRELEASE"</span>;
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"cf_fixed_in"</span>).value = text;
+ } <span class="reserved">else</span> <span class="reserved">if</span> (verNo === 999) {
+ resolution = <span class="literal">"RAWHIDE"</span>;
+ } <span class="reserved">else</span> {
+ resolution = <span class="literal">"NEXTRELEASE"</span>;
+ }
+ <span class="reserved">this</span>.centralCommandDispatch(<span class="literal">"resolution"</span>, resolution);
+};
+
+<span class="comment">/**
+ * Additional commands specific for this subclass, overriding superclass one.
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.centralCommandDispatch = <span class="reserved">function</span>(cmdLabel, cmdParams) {
+ console.log(<span class="literal">"cmdLabel = "</span> + cmdLabel + <span class="literal">", cmdParams = "</span> + cmdParams);
+ switch (cmdLabel) {
+ <span class="comment">// Set up our own commands</span>
+ case <span class="literal">"closeUpstream"</span>:
+ <span class="reserved">this</span>.addClosingUpstream();
+ break;
+ case <span class="literal">"computeResolution"</span>:
+ <span class="reserved">this</span>.closeSomeRelease();
+ break;
+ case <span class="literal">"queryStringOurBugzilla"</span>:
+ <span class="reserved">this</span>.queryForSelection();
+ break;
+ case <span class="literal">"queryUpstreamBugzilla"</span>:
+ <span class="reserved">this</span>.queryUpstream();
+ break;
+ case <span class="literal">"sendBugUpstream"</span>:
+ <span class="reserved">this</span>.sendBugUpstream();
+ break;
+ case <span class="literal">"markTriaged"</span>:
+ <span class="reserved">this</span>.markBugTriaged();
+ break;
+ case <span class="literal">"chipMagic"</span>:
+ var splitArr = cmdParams.split(<span class="literal">"\t"</span>);
+ <span class="reserved">this</span>.fillInWhiteBoard(splitArr[0], splitArr[1]);
+ break;
+ <span class="comment">// If we don't have it here, call superclass method</span>
+ default:
+ BZPage.<span class="reserved">prototype</span>.centralCommandDispatch.call(<span class="reserved">this</span>, cmdLabel, cmdParams);
+ break;
+ }
+};
+
+
+<span class="comment">/* Bugzilla functions. */</span>
+
+RHBugzillaPage.<span class="reserved">prototype</span>.ProfessionalProducts = [
+ <span class="literal">"Red Hat Enterprise Linux"</span>,
+ <span class="literal">"Red Hat Enterprise MRG"</span>
+];
+
+<span class="comment">/**
+ *
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.pasteBacktraceInComments = <span class="reserved">function</span>() {
+ <span class="comment">// FIXME This paragraph looks suspicous ... what is it?</span>
+ <span class="comment">// Does it belong to this function?</span>
+ var notedLabel = <span class="reserved">this</span>.doc.querySelector(<span class="literal">"label[for='newcc']"</span>);
+ <span class="reserved">while</span> (notedLabel.firstChild) {
+ var node = notedLabel.removeChild(notedLabel.firstChild);
+ notedLabel.parentNode.insertBefore(node, notedLabel);
+ }
+ notedLabel.parentNode.removeChild(notedLabel);
+
+ var abrtQueryURL = <span class="literal">"https://bugzilla.redhat.com/buglist.cgi?"</span>
+ + <span class="literal">"cmdtype=dorem&amp;remaction=run&amp;namedcmd=all%20NEW%20abrt%20crashes&amp;sharer_id=74116"</span>;
+
+ var mainTitle = <span class="reserved">this</span>.doc
+ .getElementsByClassName(<span class="literal">"bz_alias_short_desc_container"</span>)[0];
+ var abrtButton = <span class="reserved">this</span>.doc.createElement(<span class="literal">"a"</span>);
+ abrtButton.setAttribute(<span class="literal">"accesskey"</span>, <span class="literal">"a"</span>);
+ abrtButton.setAttribute(<span class="literal">"href"</span>, abrtQueryURL);
+ abrtButton.textContent = <span class="literal">"Abrt bugs"</span>;
+ mainTitle.appendChild(abrtButton);
+
+ <span class="reserved">if</span> (<span class="reserved">this</span>.idContainsWord(<span class="literal">"cf_devel_whiteboard"</span>, <span class="literal">'btparsed'</span>)) {
+ <span class="reserved">this</span>.addStuffToTextBox(<span class="literal">'status_whiteboard'</span>, <span class="literal">'btparsed'</span>);
+ }
+
+ <span class="reserved">if</span> (!(<span class="reserved">this</span>.isTriaged() || <span class="reserved">this</span>.idContainsWord(<span class="literal">"status_whiteboard"</span>,
+ <span class="literal">'btparsed'</span>))) {
+ var btAttachments = <span class="reserved">this</span>.attachments
+ .filter(<span class="reserved">function</span>(att, idx, arr) {
+ <span class="reserved">return</span> (/backtrace/.test(att[0]));
+ });
+ <span class="comment">// TODO we need to go through all backtrace attachments, but</span>
+ <span class="comment">// just the first one will do for now, we would need to do async</span>
+ <span class="comment">// parsing</span>
+ btAttachments.forEach(<span class="reserved">function</span>(x) {
+ attURL = <span class="literal">"https://bugzilla.redhat.com/attachment.cgi?id="</span>
+ + x[1];
+ <span class="reserved">if</span> (!<span class="reserved">this</span>.btSnippet) {
+ var btRaw = util.loadText(attURL, <span class="reserved">function</span>(ret) {
+ <span class="reserved">this</span>.btSnippet = <span class="reserved">this</span>.parseBacktrace(ret);
+ <span class="reserved">if</span> (<span class="reserved">this</span>.btSnippet) {
+ <span class="reserved">this</span>.addStuffToTextBox(<span class="literal">"comment"</span>, <span class="reserved">this</span>.btSnippet);
+ <span class="reserved">this</span>.addStuffToTextBox(<span class="literal">"status_whiteboard"</span>,
+ <span class="literal">"btparsed"</span>);
+ }
+ }, <span class="reserved">this</span>);
+ }
+ }, <span class="reserved">this</span>);
+ }
+};
+
+<span class="comment">/**
+ *
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.markBadAttachments = <span class="reserved">function</span>() {
+ var badMIMEArray = [ <span class="literal">"application/octet-stream"</span>, <span class="literal">"text/x-log"</span>, <span class="literal">"undefined"</span> ];
+
+ var badAttachments = <span class="reserved">this</span>.attachments.filter(<span class="reserved">function</span>(att, idx, arr) {
+ <span class="reserved">return</span> (util.isInList(att[2], badMIMEArray));
+ });
+
+ <span class="reserved">if</span> (badAttachments.length &gt; 0) {
+ var titleElement = <span class="reserved">this</span>.doc
+ .getElementsByClassName(<span class="literal">"bz_alias_short_desc_container"</span>)[0];
+ titleElement.style.backgroundColor = <span class="literal">"olive"</span>;
+ titleElement.appendChild(<span class="reserved">this</span>.createFixAllButton(badAttachments));
+ badAttachments.forEach(<span class="reserved">function</span>(x, i, a) {
+ <span class="reserved">this</span>.addTextLink(x);
+ }, <span class="reserved">this</span>);
+ }
+};
+
+<span class="comment">/**
+ * Is this bug a RHEL bug?
+ *
+ * <span class="attrib">@return</span> Boolean true if it is a RHEL bug
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.isEnterprise = <span class="reserved">function</span>() {
+ var prod = <span class="reserved">this</span>.product;
+ var result = <span class="reserved">this</span>.ProfessionalProducts.some(<span class="reserved">function</span>(elem,idx,arr) {
+ <span class="reserved">return</span> new RegExp(elem).test(prod);
+ });
+ <span class="reserved">return</span> result;
+};
+
+<span class="comment">/**
+ * Find out whether the bug is needed an attention of bugZappers
+ *
+ * <span class="attrib">@return</span> Boolean whether the bug has been triaged or not
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.isTriaged = <span class="reserved">function</span>() {
+ <span class="comment">// First excceptions</span>
+ <span class="reserved">if</span> (<span class="reserved">this</span>.version &gt; 7 &amp;&amp; <span class="reserved">this</span>.version &lt; 12) {
+ <span class="reserved">return</span> <span class="reserved">this</span>.doc.getElementById(<span class="literal">"bug_status"</span>).value.toUpperCase() !== <span class="literal">"NEW"</span>;
+ } <span class="reserved">else</span> { <span class="comment">// and then the rule</span>
+ <span class="reserved">return</span> <span class="reserved">this</span>.hasKeyword(<span class="literal">"Triaged"</span>);
+ }
+};
+
+<span class="comment">/**
+ * Set branding colours to easily distinguish between Fedora and RHEL bugs
+ *
+ * <span class="attrib">@param</span> brand String with product of the current bug
+ * <span class="attrib">@param</span> version String with the version of the bug
+ * <span class="attrib">@param</span> its String with the IsueTracker numbers
+ * <span class="attrib">@return</span> none
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.setBranding = <span class="reserved">function</span>() {
+ var brandColor = {};
+ var TriagedColor = {};
+
+ <span class="reserved">if</span> (<span class="reserved">this</span>.isEnterprise()) {
+ <span class="reserved">if</span> (<span class="reserved">this</span>.its &amp;&amp; (<span class="reserved">this</span>.its.length &gt; 0)) {
+ brandColor = <span class="reserved">this</span>.RHITColor;
+ } <span class="reserved">else</span> {
+ brandColor = <span class="reserved">this</span>.RHColor;
+ }
+ } <span class="reserved">else</span> <span class="reserved">if</span> (new RegExp(<span class="literal">"Fedora"</span>).test(<span class="reserved">this</span>.product)) {
+ <span class="reserved">if</span> (<span class="reserved">this</span>.version === 999) {
+ brandColor = <span class="reserved">this</span>.RawhideColor;
+ } <span class="reserved">else</span> {
+ brandColor = <span class="reserved">this</span>.FedoraColor;
+ }
+ }
+
+ <span class="comment">// Comment each of the following lines to get only partial branding</span>
+ <span class="reserved">this</span>.doc.getElementsByTagName(<span class="literal">"body"</span>)[0].style.background = brandColor
+ .toString()
+ + <span class="literal">" none"</span>;
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"titles"</span>).style.background = brandColor.toString()
+ + <span class="literal">" none"</span>;
+
+ <span class="comment">// Remove "Bug" from the title of the bug page, so we have more space with</span>
+ <span class="comment">// plenty of tabs</span>
+ var titleElem = <span class="reserved">this</span>.doc.getElementsByTagName(<span class="literal">"title"</span>)[0];
+
+ titleElem.textContent = titleElem.textContent.slice(4);
+ var bodyTitleParent = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"summary_alias_container"</span>).parentNode;
+ var bodyTitleElem = bodyTitleParent.getElementsByTagName(<span class="literal">"b"</span>)[0];
+ bodyTitleElem.textContent = bodyTitleElem.textContent.slice(4);
+
+ <span class="comment">// Make background-color of the body of bug salmon pink</span>
+ <span class="comment">// for security bugs.</span>
+ <span class="reserved">if</span> (<span class="reserved">this</span>.hasKeyword(<span class="literal">"Security"</span>)) {
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"bugzilla-body"</span>).style.background = <span class="reserved">this</span>.SalmonPink
+ .toString() + <span class="literal">' none'</span>;
+ }
+
+ <span class="comment">// Make it visible whether the bug has been triaged</span>
+ <span class="reserved">if</span> (<span class="reserved">this</span>.isTriaged()) {
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"bz_field_status"</span>).style.background = brandColor
+ .lightColor().toString()
+ + <span class="literal">" none"</span>;
+ }
+
+ <span class="comment">// we should make visible whether maintCCAddr is in CCList</span>
+ <span class="reserved">if</span> (util.isInList(<span class="reserved">this</span>.maintCCAddr, <span class="reserved">this</span>.CCList)) {
+ var ccEditBoxElem = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"cc_edit_area_showhide"</span>);
+ <span class="comment">// ccEditBoxElem.textContent = "*"+ccEditBoxElem.textContent;</span>
+ ccEditBoxElem.style.color = <span class="literal">"navy"</span>;
+ ccEditBoxElem.style.fontWeight = <span class="literal">"bolder"</span>;
+ ccEditBoxElem.style.textDecoration = <span class="literal">"underline"</span>;
+ }
+
+ <span class="comment">// mark suspicious components</span>
+ var compElems;
+ <span class="reserved">if</span> (<span class="reserved">this</span>.suspiciousComponents
+ &amp;&amp; util.isInList(<span class="reserved">this</span>.component, <span class="reserved">this</span>.suspiciousComponents)
+ &amp;&amp; (compElems = <span class="reserved">this</span>.doc
+ .getElementById(<span class="literal">"bz_component_edit_container"</span>))) {
+ compElems.style.background = <span class="literal">"red none"</span>;
+ }
+};
+
+<span class="comment">/**
+ * Given line to be parsed, find out which chipset it is and fill in the
+ * whiteboard
+ *
+ * <span class="attrib">@param</span> iLine String with the whole unparsed "interesting line"
+ * <span class="attrib">@param</span> driverStr String with the driver name
+ * <span class="attrib">@return</span> None
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.fillInWhiteBoard = <span class="reserved">function</span>(iLine, driverStr) {
+ var that = <span class="reserved">this</span>;
+
+ <span class="reserved">function</span> groupIDs(manStr, cardStrID) {
+ var outStr = util.filterByRegexp(chipIDsGroupings, manStr + <span class="literal">","</span> + cardStrID);
+ <span class="reserved">if</span> (outStr.length === 0) {
+ outStr = <span class="literal">"UNGROUPED_"</span> + manStr + <span class="literal">"/"</span> + cardStrID;
+ }
+ <span class="reserved">return</span> outStr;
+ }
+
+ <span class="comment">/**
+ * Given PCI IDs for manufacturer and card ID return chipset string
+ *
+ * <span class="attrib">@param</span> manufacturerNo String with manufacturer PCI ID
+ * <span class="attrib">@param</span> cardNo String with card PCI ID
+ * <span class="attrib">@return</span> Array with chip string and optinoal variants
+ */</span>
+ <span class="reserved">function</span> checkChipStringFromID(manufacturerNo, cardNo) {
+ var soughtID = (manufacturerNo + <span class="literal">","</span> + cardNo).toUpperCase();
+ var outList = config.PCI_ID_Array[soughtID];
+ <span class="reserved">if</span> (outList) {
+ <span class="reserved">return</span> outList;
+ } <span class="reserved">else</span> {
+ <span class="reserved">return</span> <span class="literal">""</span>;
+ }
+ }
+
+ var outStr = <span class="literal">""</span>;
+ var cardIDStr = <span class="literal">""</span>;
+ var cardIDArr = [];
+
+ chipSwitchboard: <span class="reserved">if</span> (driverStr === <span class="literal">"RADEON"</span>) {
+ var cardID = iLine.replace(<span class="reserved">this</span>.RE.ATIgetID, <span class="literal">"$1"</span>);
+ cardIDArr = checkChipStringFromID(<span class="literal">"1002"</span>, cardID);
+ <span class="reserved">if</span> (cardIDArr.length &gt; 0) {
+ cardIDStr = cardIDArr[0];
+ <span class="reserved">if</span> (cardIDArr[1]) {
+ optionStr = cardIDArr[1];
+ outStr = groupIDs(driverStr, cardIDStr) + <span class="literal">"/"</span> + optionStr;
+ } <span class="reserved">else</span> {
+ outStr = groupIDs(driverStr, cardIDStr);
+ optionStr = <span class="literal">""</span>;
+ }
+ } <span class="reserved">else</span> {
+ outStr = <span class="literal">"**** FULLSTRING: "</span> + iLine;
+ }
+ } <span class="reserved">else</span> {
+ <span class="comment">// Intel Corporation, NVIDIA</span>
+ cardIDArr = manuChipStrs.filter(<span class="reserved">function</span>(el, ind, arr) {
+ <span class="reserved">return</span> new RegExp(el[0], <span class="literal">"i"</span>).test(iLine);
+ });
+ <span class="reserved">if</span> (cardIDArr &amp;&amp; (cardIDArr.length &gt; 0)) {
+ cardIDArr = cardIDArr[0];
+ } <span class="reserved">else</span> {
+ outStr = iLine;
+ break chipSwitchboard;
+ }
+ <span class="comment">// cardIDArr [0] = RE, [1] = ("RADEON","INTEL","NOUVEAU"), [2] = manu</span>
+ <span class="comment">// PCIID</span>
+ iLine = iLine.replace(new RegExp(cardIDArr[0], <span class="literal">"i"</span>)).trim();
+ <span class="comment">// nVidia developers opted-out from grouping</span>
+ <span class="reserved">if</span> (driverStr === <span class="literal">"INTEL"</span>) {
+ outStr = groupIDs(cardIDArr[1], iLine);
+ } <span class="reserved">else</span> {
+ outStr = iLine;
+ }
+ }
+ <span class="reserved">this</span>.addStuffToTextBox(<span class="literal">"status_whiteboard"</span>, (<span class="literal">"card_"</span> + outStr).trim());
+ <span class="reserved">this</span>.doc.getElementById(<span class="literal">"chipmagic"</span>).style.display = <span class="literal">"none"</span>;
+};
+
+<span class="comment">/**
+ * 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.
+ *
+ * <span class="attrib">@return</span> None
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.fillInChipMagic = <span class="reserved">function</span> () {
+ var that = <span class="reserved">this</span>;
+ var XorgLogURL = <span class="literal">""</span>;
+ var XorgLogAttID = <span class="literal">""</span>;
+ var XorgLogFound = false;
+ var attURL = <span class="literal">""</span>, interestingLine = <span class="literal">""</span>;
+ var interestingArray = [];
+
+
+ <span class="comment">// Find out Xorg.0.log attachment URL</span>
+ <span class="reserved">this</span>.XorgLogAttList = <span class="reserved">this</span>.attachments.filter(<span class="reserved">function</span> (value, index, array) {
+ <span class="comment">// Xorg.0.log must be text, otherwise we cannot parse it</span>
+ <span class="reserved">return</span> (/[xX].*log/.test(value[0]) &amp;&amp; /text/.test(value[2]));
+ });
+ <span class="reserved">if</span> (<span class="reserved">this</span>.XorgLogAttList.length === 0) {
+ <span class="reserved">return</span>;
+ }
+
+ XorgLogAttID = <span class="reserved">this</span>.XorgLogAttList[<span class="reserved">this</span>.XorgLogAttListIndex][1];
+ attURL = <span class="literal">"https://bugzilla.redhat.com/attachment.cgi?id="</span>+XorgLogAttID;
+ that = <span class="reserved">this</span>;
+
+ <span class="comment">// parse Xorg.0.log</span>
+ util.loadText(attURL, <span class="reserved">function</span>(ret){
+ var interestingLineArr = ret.split(<span class="literal">"\n"</span>).
+ filter(<span class="reserved">function</span> (v,i,a) {
+ <span class="reserved">return</span> that.RE.Chipset.test(v);
+ });
+ <span class="reserved">if</span> (interestingLineArr.length &gt;0) {
+ <span class="comment">// TODO we are parsing only the first found line; is it alright?</span>
+ interestingArray = that.RE.Chipset.exec(interestingLineArr[0]);
+ interestingLine = interestingArray[2].
+ replace(/[\s<span class="literal">"]+/g,"</span> <span class="literal">").trim();
+ // Persuade createNewButton to have mercy and to actually add
+ // non-default button
+ that.constantData.chipMagicTrigger = true;
+ that.chipMagicInterestingLine = interestingLine+"</span>\t<span class="literal">"+interestingArray[1]
+ .toUpperCase();
+ that.createNewButton("</span>status_whiteboard<span class="literal">", true, "</span>rh-xorg<span class="literal">", "</span>chipMagic<span class="literal">");
+ }
+ });
+ this.XorgLogAttListIndex++;
+};
+
+RHBugzillaPage.prototype.getSelectionOrClipboard = function getSelectionOrClipboard () {
+ var text = selection.text;
+ if (!text) {
+ text = clip.get();
+ }
+ return text;
+};
+
+/**
+ * Opens a new tab with a query for the given text in the selected component
+ *
+ * @param text to be searched for
+ * @param component String with the component name (maybe latter regexp?)
+ * @param product (optional) string with the product name, if undefined,
+ * search in all products
+ * @return None
+ *
+ */
+RHBugzillaPage.prototype.queryInNewTab = function(text, component, product) {
+ var urlStr = "</span>https:<span class="comment">//bugzilla.redhat.com/buglist.cgi?query_format=advanced";</span>
+ <span class="reserved">if</span> (product) {
+ urlStr += <span class="literal">"&amp;product="</span> + product.trim();
+ }
+ <span class="reserved">if</span> (component) {
+ urlStr += <span class="literal">"&amp;field0-0-0=component&amp;type0-0-0=substring&amp;value0-0-0="</span>
+ + component.trim();
+ }
+ <span class="comment">// using more complicated query tables here, because they can be more easily</span>
+ <span class="comment">// edited</span>
+ <span class="comment">// for further investigative searches</span>
+ <span class="reserved">if</span> (text) {
+ text = encodeURIComponent(text.trim());
+ var searchText = <span class="literal">"&amp;field1-0-0=longdesc&amp;type1-0-0=substring&amp;value1-0-0="</span>
+ + text
+ + <span class="literal">"&amp;field1-0-1=attach_data.thedata&amp;type1-0-1=substring&amp;value1-0-1="</span>
+ + text
+ + <span class="literal">"&amp;field1-0-2=status_whiteboard&amp;type1-0-2=substring&amp;value1-0-2="</span>
+ + text;
+ urlStr += searchText;
+ tabs.open({url: urlStr});
+ }
+};
+
+<span class="comment">/**
+ * Get the text to search for and prepare other things for the real executive
+ * function this.queryInNewTab, and run it.
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.queryForSelection = <span class="reserved">function</span>() {
+ var text = <span class="reserved">this</span>.getSelectionOrClipboard();
+ <span class="reserved">if</span> (text) {
+ <span class="reserved">this</span>.queryInNewTab(text, <span class="reserved">this</span>.component);
+ }
+};
+
+<span class="comment">/**
+ * Search simple query in the upstream bugzilla appropriate for the component.
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.queryUpstream = <span class="reserved">function</span>() {
+ console.log(<span class="literal">"Querying upstream!"</span>);
+ var text = <span class="reserved">this</span>.getSelectionOrClipboard();
+ <span class="reserved">if</span> (text) {
+ text = encodeURIComponent(text.trim());
+ var queryUpstreamBugsURLArray = <span class="reserved">this</span>.constantData.queryUpstreamBug;
+ var urlBase = util.filterByRegexp(queryUpstreamBugsURLArray, <span class="reserved">this</span>.component);
+ tabs.open({
+ url: urlBase + text,
+ inBackground: true,
+ onOpen: <span class="reserved">function</span> (t) {
+ t.activate();
+ }
+ });
+ }
+};
+
+<span class="comment">/**
+ *
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.sendBugUpstream = <span class="reserved">function</span>() {
+ var that = <span class="reserved">this</span>;
+ var urlStr = util.filterByRegexp(<span class="reserved">this</span>.constantData.newUpstreamBug, <span class="reserved">this</span>
+ .getOptionValue(<span class="literal">"component"</span>));
+
+ var ret = tabs.open({
+ url: urlStr,
+ inBackground: true,
+ onOpen: <span class="reserved">function</span> (tab) {
+ var otherDoc = tab.contentDocument;
+ var otherElems = otherDoc.forms.namedItem(<span class="literal">"Create"</span>).elements;
+ otherElems.namedItem(<span class="literal">"short_desc"</span>).value = that.doc
+ .getElementById(<span class="literal">"short_desc_nonedit_display"</span>).textContent
+ .trim();
+ otherElems.namedItem(<span class="literal">"comment"</span>).value = that.collectComments();
+ ret.focus();
+ }
+ });
+};
+
+<span class="comment">/**
+ * Parse the row with the attachment
+ *
+ * <span class="attrib">@param</span> DOM element to be parsed
+ * <span class="attrib">@return</span> 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
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.parseAttachmentLine = <span class="reserved">function</span>(inElem) {
+ var MIMEtype = <span class="literal">""</span>;
+ var size = 0;
+
+ <span class="comment">// Skip over obsolete attachments</span>
+ <span class="reserved">if</span> (inElem.getElementsByClassName(<span class="literal">"bz_obsolete"</span>).length &gt; 0) {
+ <span class="reserved">return</span> ( []);
+ }
+
+ <span class="comment">// getting name of the attachment</span>
+ <span class="comment">// FIXME probably could use url.URL object</span>
+ var attName = inElem.getElementsByTagName(<span class="literal">"b"</span>)[0].textContent.trim();
+
+ var aHrefsArr = inElem.getElementsByTagName(<span class="literal">"a"</span>);
+ var aHref = Array.filter(aHrefsArr, <span class="reserved">function</span>(x) {
+ <span class="reserved">return</span> x.textContent.trim() === <span class="literal">"Details"</span>;
+ })[0];
+ var id = parseInt(aHref.getAttribute(<span class="literal">"href"</span>).replace(
+ /^.*attachment.cgi\?id=/, <span class="literal">""</span>), 10);
+
+ <span class="comment">// getting MIME type and size</span>
+ var stringArray = inElem.getElementsByClassName(<span class="literal">"bz_attach_extra_info"</span>)[0].textContent
+ .replace(/[\n ()]+/g, <span class="literal">" "</span>).trim().split(<span class="literal">", "</span>);
+ size = parseInt(stringArray[0], 10);
+ MIMEtype = stringArray[1].split(<span class="literal">" "</span>)[0];
+
+ <span class="reserved">return</span> [ attName, id, MIMEtype, size, inElem ];
+};
+
+<span class="comment">/**
+ * Add accesskey to the particular element
+ *
+ * <span class="attrib">@param</span> rootElement Element to which the new text object will be attached
+ * <span class="attrib">@param</span> beforeText Text before the accesskey character
+ * <span class="attrib">@param</span> accKey what will be the accesskey itself
+ * <span class="attrib">@param</span> afterText text after the accesskey character
+ * <span class="attrib">@return</span> modified element with the fixed accesskey
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.fixElement = <span class="reserved">function</span>(elem, beforeText, accKey, afterText) {
+ elem.setAttribute(<span class="literal">"accesskey"</span>, accKey.toLowerCase());
+ elem.innerHTML = beforeText + <span class="literal">"&lt;b&gt;&lt;u&gt;"</span> + accKey + <span class="literal">"&lt;/u&gt;&lt;/b&gt;"</span> + afterText;
+ <span class="reserved">return</span> elem;
+};
+
+<span class="comment">/**
+ * Return string with the ID for the external_id SELECT for external bugzilla
+ *
+ * <span class="attrib">@param</span> URLhostname String hostname of the external bugzilla
+ * <span class="attrib">@return</span> String with the string for the external_id SELECT
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.getBugzillaName = <span class="reserved">function</span>(URLhostname) {
+ var bugzillaID = <span class="literal">""</span>;
+ <span class="reserved">if</span> (<span class="reserved">this</span>.constantData.bugzillalabelNames[URLhostname]) {
+ bugzillaID = <span class="reserved">this</span>.constantData.bugzillalabelNames[URLhostname];
+ } <span class="reserved">else</span> {
+ bugzillaID = <span class="literal">""</span>;
+ }
+ <span class="reserved">return</span> bugzillaID;
+};
+
+<span class="comment">/**
+ * Callback function for the XMLRPC request
+ *
+ * <span class="attrib">@param</span> ret Object with xmlhttprequest response with attributes:
+ * + status -- int return code
+ * + statusText
+ * + responseHeaders
+ * + responseText
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.fixingMIMECallBack = <span class="reserved">function</span>() {
+ var that = <span class="reserved">this</span>;
+ console.log(<span class="literal">"fixingMIMECallBack / that.doc = "</span> + that.doc);
+ console.log(<span class="literal">"fixingMIMECallBack / that.win = "</span> + that.win);
+ <span class="reserved">if</span> (--<span class="reserved">this</span>.reqCounter &lt;= 0) {
+ timer.setTimeout(<span class="reserved">function</span> () {
+ that.win.location.reload(true);
+ }, 1000);
+ }
+};
+
+<span class="comment">/**
+ * The worker function -- call XMLRPC to fix MIME type of the particular
+ * attachment
+ *
+ * <span class="attrib">@param</span> id Integer with the attachment id to be fixed
+ * <span class="attrib">@param</span> type String with the new MIME type, optional defaults to "text/plain"
+ * <span class="attrib">@param</span> 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" =&gt; "&lt;Attachment ID&gt;", # Attachment ID to perform
+ * MIME type change on. "mime_type" =&gt; "&lt;New MIME Type Value&gt;", # Legal MIME
+ * type value that you want to change the attachment to. "nomail" =&gt; 0, #
+ * OPTIONAL Flag that is either 1 or 0 if you want email to be sent or not for
+ * this change };
+ *
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.fixAttachById = <span class="reserved">function</span>(id, type, email) {
+ <span class="reserved">if</span> (type === undefined) {
+ type = <span class="literal">"text/plain"</span>;
+ }
+ <span class="reserved">if</span> (email === undefined) {
+ email = false;
+ }
+
+ var msg = new xrpc.XMLRPCMessage(<span class="literal">"bugzilla.updateAttachMimeType"</span>);
+ msg.addParameter( {
+ <span class="literal">'attach_id'</span> : id,
+ <span class="literal">'mime_type'</span> : type,
+ <span class="literal">'nomail'</span> : !email
+ });
+ msg.addParameter(<span class="reserved">this</span>.login);
+ msg.addParameter(<span class="reserved">this</span>.password);
+
+ <span class="comment">// https://bugzilla.redhat.com/\</span>
+ <span class="comment">// docs/en/html/api/extensions/compat_xmlrpc/code/webservice.html</span>
+ <span class="comment">// test on https://bugzilla.redhat.com/show_bug.cgi?id=485145</span>
+ util.httpPOST(<span class="reserved">this</span>.XMLRPCurl, msg.xml(), <span class="reserved">this</span>.fixingMIMECallBack,
+ <span class="reserved">this</span>, <span class="literal">"text/xml"</span>, <span class="literal">"text/xml"</span>);
+ <span class="reserved">this</span>.reqCounter++;
+};
+
+<span class="comment">/**
+ * Create a button for fixing all bad attachments.
+ *
+ * <span class="attrib">@param</span> list Array of all bad attachmentss
+ * <span class="attrib">@return</span> button fixing all bad Attachments
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.createFixAllButton = <span class="reserved">function</span>(list) {
+ <span class="reserved">if</span> (!xrpc.XMLRPCMessage) {
+ <span class="reserved">return</span>;
+ }
+ var that = <span class="reserved">this</span>;
+ var elem = <span class="reserved">this</span>.doc.createElement(<span class="literal">"a"</span>);
+ elem.setAttribute(<span class="literal">"href"</span>, <span class="literal">""</span>);
+ elem.setAttribute(<span class="literal">"accesskey"</span>, <span class="literal">"f"</span>);
+ elem.innerHTML = <span class="literal">"&lt;b&gt;F&lt;/b&gt;ix all"</span>;
+ elem.addEventListener(<span class="literal">"click"</span>, <span class="reserved">function</span>() {
+ Array.forEach(list, <span class="reserved">function</span>(x) {
+ <span class="reserved">this</span>.fixAttachById(x[1]);
+ }, that);
+ }, false);
+ <span class="reserved">return</span> elem;
+};
+
+<span class="comment">/**
+ * Add a link to the bad attachment for fixing it.
+ *
+ * <span class="attrib">@param</span>
+ * &lt;TR&gt; DOM jQuery element with a bad attachment
+ * <span class="attrib">@return</span> none
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.addTextLink = <span class="reserved">function</span>(row) {
+ var that = <span class="reserved">this</span>;
+ var elemS = row[4].getElementsByTagName(<span class="literal">"td"</span>);
+ var elem = elemS[elemS.length - 1];
+ elem.innerHTML += <span class="literal">"&lt;br/&gt;&lt;a href=''&gt;Text&lt;/a&gt;"</span>;
+ elem.addEventListener(<span class="literal">"click"</span>, <span class="reserved">function</span>(x) {
+ that.fixAttachById(row[1], <span class="literal">"text/plain"</span>);
+ }, false);
+};
+
+<span class="comment">/**
+ * Add information about the upstream bug upstream, and closing it.
+ *
+ * <span class="attrib">@param</span> evt Event which called this handler
+ * <span class="attrib">@return</span> none
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.addClosingUpstream = <span class="reserved">function</span>() {
+ var refs = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"external_bugs_table"</span>)
+ .getElementsByTagName(<span class="literal">"tr"</span>);
+ <span class="comment">// that's a bad id, if there is a one. :)</span>
+ var inputBox = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"inputbox"</span>);
+ var externalBugID = 0;
+ var wholeURL = <span class="literal">""</span>;
+
+ <span class="comment">// FIXME Hopefully unfinished and even less tested</span>
+ <span class="comment">// Fix missing ID on the external_id SELECT</span>
+ <span class="reserved">this</span>.doc.getElementsByName(<span class="literal">"external_id"</span>)[0].setAttribute(<span class="literal">"id"</span>,
+ <span class="literal">"external_id"</span>);
+
+ <span class="reserved">if</span> (inputBox.value.match(/^http.*/)) {
+ wholeURL = inputBox.value;
+ var helpURL = new url.URL(wholeURL);
+ var paramsArr = helpURL.path.replace(/^\?/, <span class="literal">''</span>).split(<span class="literal">'&amp;'</span>);
+ <span class="comment">// get convert URL parameters to an Object</span>
+ var params = {}, s = [];
+ paramsArr.forEach(<span class="reserved">function</span>(par, idx, arr) {
+ s = par.split(<span class="literal">'='</span>);
+ params[s[0]] = s[1];
+ });
+ <span class="reserved">if</span> (params.id) {
+ externalBugID = parseInt(params.id, 10);
+ inputBox.value = externalBugID;
+ }
+ <span class="comment">// get host and bugzillaName</span>
+ var bugzillaName = <span class="reserved">this</span>.getBugzillaName(helpURL.hostname);
+ <span class="reserved">this</span>.selectOption(<span class="literal">"external_id"</span>, bugzillaName);
+ } <span class="reserved">else</span> <span class="reserved">if</span> (!isNaN(inputBox.value)) {
+ externalBugID = parseInt(inputBox.value, 10);
+ var bugzillaHostname = <span class="reserved">this</span>.doc.getElementById(<span class="literal">"external_id"</span>).value;
+ wholeURL = bugzillaHostname+<span class="literal">"show_bug.cgi?id="</span>+externalBugID;
+ } <span class="reserved">else</span> {
+ <span class="comment">// no inputBox.value -- maybe there is an external bug from</span>
+ <span class="comment">// the previous commit?</span>
+ }
+
+ <span class="comment">// FIXME THis is not good, we don't have a feedback for other commands,</span>
+ <span class="comment">// not to be run, if this fails.</span>
+
+ <span class="comment">// It is not good to close bug as UPSTREAM, if there is no reference</span>
+ <span class="comment">// to the upstream bug.</span>
+ <span class="reserved">if</span> ((externalBugID &gt; 0) || (refs.length &gt; 2)) {
+ var msgStr = <span class="reserved">this</span>.commentStrings.sentUpstreamString;
+ msgStr = msgStr.replace(<span class="literal">"§§§"</span>, wholeURL);
+ <span class="reserved">this</span>.centralCommandDispatch(<span class="literal">"comment"</span>,msgStr);
+ <span class="reserved">this</span>.centralCommandDispatch(<span class="literal">"status"</span>, <span class="literal">"CLOSED"</span>);
+ <span class="reserved">this</span>.centralCommandDispatch(<span class="literal">"resolution"</span>, <span class="literal">"UPSTREAM"</span>);
+ } <span class="reserved">else</span> {
+ console.log(<span class="literal">"No external bug specified among the External References!"</span>);
+ }
+};
+
+RHBugzillaPage.<span class="reserved">prototype</span>.markBugTriaged = <span class="reserved">function</span>() {
+ <span class="comment">// Now we lie completely, we just set keyword Triaged,</span>
+ <span class="comment">// this is not just plain ASSIGNED, but</span>
+ <span class="comment">// modified according to</span>
+ <span class="comment">// https://fedoraproject.org/wiki/BugZappers/Meetings/Minutes-2009-Oct-27</span>
+ <span class="comment">// and</span>
+ <span class="comment">// http://meetbot.fedoraproject.org/fedora-meeting/2009-11-24\</span>
+ <span class="comment">// /fedora-meeting.2009-11-24-15.11.log.html</span>
+ <span class="comment">// and</span>
+ <span class="comment">// http://meetbot.fedoraproject.org/fedora-meeting/2009-11-24\</span>
+ <span class="comment">// /fedora-meeting.2009-11-24-15.11.log.html</span>
+ <span class="comment">// for F13 and later, ASSIGNED is "add Triaged keyword" (as well)</span>
+ <span class="comment">// for &lt;F13 it is "add both" (ASSIGNED status and Triaged keyword)</span>
+ var ver = <span class="reserved">this</span>.getVersion();
+ console.log(<span class="literal">"Marking bug as Triaged!"</span>);
+ <span class="reserved">if</span> ((!<span class="reserved">this</span>.isEnterprise()) &amp;&amp; (ver &lt;= 12)) {
+ <span class="reserved">this</span>.selectOption(<span class="literal">"bug_status"</span>, <span class="literal">"ASSIGNED"</span>);
+ }
+ <span class="reserved">this</span>.addStuffToTextBox(<span class="literal">"keywords"</span>,<span class="literal">"Triaged"</span>);
+};
+
+<span class="comment">/**
+ *
+ */</span>
+RHBugzillaPage.<span class="reserved">prototype</span>.parseBacktrace = <span class="reserved">function</span>(ret) {
+ var splitArray = ret.split(<span class="literal">"\n"</span>);
+ var i = 0, ii = splitArray.length;
+ var outStr = <span class="literal">""</span>, curLine = <span class="literal">""</span>, numStr = <span class="literal">""</span>;
+ var lineCounter = 0, endLineNo = 0;
+
+ <span class="reserved">while</span> (i &lt; ii) {
+ <span class="reserved">if</span> (<span class="reserved">this</span>.RE.signalHandler.test(splitArray[i])) {
+ break;
+ }
+ i++;
+ }
+
+ <span class="reserved">if</span> (i &lt; ii) {
+ lineCounter = parseInt(<span class="reserved">this</span>.RE.frameNo.exec(splitArray[i])[1], 10);
+ endLineNo = lineCounter + NumberOfFrames;
+ curLine = splitArray[i];
+ <span class="reserved">while</span> ((lineCounter &lt; endLineNo) &amp;&amp; (curLine.trim().length &gt; 0)
+ &amp;&amp; (i &lt; ii)) {
+ outStr += curLine + <span class="literal">'\n'</span>;
+ numStr = <span class="reserved">this</span>.RE.frameNo.exec(curLine);
+ <span class="reserved">if</span> (numStr) {
+ lineCounter = parseInt(numStr[1], 10);
+ }
+ i++;
+ curLine = splitArray[i];
+ }
+ }
+ <span class="reserved">return</span> outStr;
+};
+
+<span class="comment">// exports.RHBugzillaPage = apiUtils.publicConstructor(RHBugzillaPage);</span>
+exports.RHBugzillaPage = RHBugzillaPage;
+</pre>
+ <hr>
+
+
+
+<!-- ========== START OF NAVBAR ========== -->
+<a name="navbar_top"><!-- --></a>
+<table border="0" width="100%" cellpadding="1" cellspacing="0">
+<tr>
+<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
+<a name="navbar_top_firstrow"><!-- --></a>
+<table border="0" cellpadding="0" cellspacing="3">
+ <tr align="center" valign="top">
+
+
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
+ <td bgcolor="#FFFFFF" class="NavBarCell1Rev"> &nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
+
+
+ <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
+ <td bgcolor="#EEEEFF" class="NavBarCell1"> <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
+ </tr>
+</table>
+</td>
+<td bgcolor="#EEEEFF" align="right" valign="top"><em>
+<b></b></em>
+</td>
+</tr>
+
+<tr>
+<td bgcolor="white" class="NavBarCell2"><font size="-2">
+&nbsp;PREV&nbsp;
+&nbsp;NEXT</font></td>
+<td bgcolor="white" class="NavBarCell2"><font size="-2">
+ <a href="index.html" target="_top"><b>FRAMES</b></a> &nbsp;
+&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
+&nbsp;&nbsp;
+<script>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+</script>
+<noscript>
+<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
+</noscript>
+</font></td>
+</tr>
+</table>
+<!-- =========== END OF NAVBAR =========== -->
+
+<hr>
+<font size="-1">
+
+</font>
+<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Wed Jun 23 09:33:14 2010</div>
+</body>
+</html>