diff options
-rw-r--r-- | bugzillaBugTriage.js | 61 |
1 files changed, 20 insertions, 41 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index ce6bb51..210d41c 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -4,13 +4,14 @@ jetpack.future.import("pageMods"); jetpack.future.import("storage.simple"); jetpack.future.import("selection"); +jetpack.future.import("clipboard"); var RHColor = "#9E292B"; var FedoraColor = "#002867"; var RawhideColor = "#007700"; // or "green" var RHITColor = "#660066"; var SalmonPink = "#FFE0B0"; -var ReporterColorHex = "#FFFFA6"; +var ReporterColor = "#FFFFA6"; var XMLRPCurl = "https://bugzilla.redhat.com/xmlrpc.cgi"; var myConfig = jetpack.storage.simple; var badMIMEArray = ["application/octet-stream","text/x-log"]; @@ -193,7 +194,7 @@ bzPage.prototype.hasKeyword = function (str) { /* Bugzilla functions.*/ /** - * Set background color of all comments made by reporter in ReporterColorHex color + * Set background color of all comments made by reporter in ReporterColor color * */ bzPage.prototype.checkComments = function () { @@ -201,7 +202,7 @@ bzPage.prototype.checkComments = function () { $("#comments .bz_comment", this.doc).each(function (i) { var email = $(".vcard a", this).text(); if (new RegExp(reporter).test(email)) { - $(this).css("background-color", ReporterColorHex); + $(this).css("background-color", ReporterColor); } }); }; @@ -469,23 +470,21 @@ bzPage.prototype.queryInNewTab = function(text,component,product) { url += "&long_desc_type=substring&long_desc="+ text.replace(" ","%20"); } console.log("queryInNewTab: url = " + url); - jetpack.tabs.contentWindow.open(url); + jetpack.tabs.open(url); } /** + * Get the text to search for and prepare other things for the real executive + * function this.queryInNewTab, and run it. */ bzPage.prototype.queryForSelection = function() { -// var text = $.trim(jetpack.tabs.current.contentWindow.getSelection().toString); -// var text = $.trim(jetpack.selection.text); - var text=""; -// if (text.length < 1) { -// console.log("current clipbpard flavors = " + -// jetpack.clipboard.getCurrentFlavors()); -// text = jetpack.clipboard.get(); -// }; -// if (text.length > 0) { -// queryInNewTab(text, this.component); -// } + var text = $.trim(jetpack.selection.text); + if (text.length < 1) { + text = jetpack.clipboard.get(); + }; + if (text.length > 0) { + this.queryInNewTab(text, this.component); + } } /** @@ -685,32 +684,11 @@ bzPage.prototype.addClosingUpstream = function() { } } -/** - * Currently we don't use this function - * @param evt event send from DOM (not used) - * @return none - */ -bzPage.prototype.swapXGLMainToCCListHandler = function(evt) { - /** Remove mcepl@redhat.com from CC list and put there - * xgl-maint@redhat.com - */ - - myAddrIndex = CCList.indexOf(login); - if (!isInList(this.maintCCAddr, CCList)) { - $("#newcc",this.doc).text(this.maintCCAddr); - } - if (isInList(login, CCList)) { - var selBox = $("#cc").get(); - selBox[myAddrIndex].selected = true; - $("#removecc").attr("checked","checked"); - } - evt.stopPropagation(); - evt.preventDefault(); -} - -/** Insert row of buttons before the marked element +/** Insert a row of buttons before the marked element + * * @param anchor element before which the row of buttons will be inserted * @param array array of data for buttons to be generated + * @return none */ bzPage.prototype.generateToolBar = function(anchor,array) { for (var i=0; i<array.length; i++) { @@ -840,7 +818,7 @@ bzPage.prototype.addKeyword = function (str) { /** * Main executable functioning actually building all buttons on the page -- * separated into function, so that - * it could be called from onload method of the GM_XMLHTTPRequest. + * it could be called from onload method of the XMLHTTPRequest. * * @param jsonList Array created from JSON * @return none @@ -865,7 +843,8 @@ bzPage.prototype.buildButtons = function (above,below) { newPosition.css("border","solid blue"); this.addNewButton(newPosition,"newqueryintab","Query for string", "","QUERYSEL","",false); - } + } + console.log("chipIDsGroupings = " + chipIDsGroupings.length); if ((chipIDsGroupings.length >0) && this.maintCCAddr == "xgl-maint@redhat.com") { // Add find chip magic button if (!$("#status_whiteboard:contains('card_')", this.doc)) { |