diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/lib/bzpage.js | 20 | ||||
-rw-r--r-- | data/lib/jumpNextBug.js | 15 | ||||
-rw-r--r-- | data/lib/logging-front.js | 4 | ||||
-rw-r--r-- | data/lib/util.js | 3 |
4 files changed, 32 insertions, 10 deletions
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js index bd8e6ce..c256228 100644 --- a/data/lib/bzpage.js +++ b/data/lib/bzpage.js @@ -75,6 +75,7 @@ function centralCommandDispatch (cmdLabel, cmdParams) { console.log("centralCommandDispatch : cmdLabel = " + cmdLabel); switch (cmdLabel) { case "name": + case "position": break; case "resolution": case "product": @@ -248,22 +249,25 @@ function changeAssignee (newAssignee) { function addToCommentsDropdown (cmdObj) { var select = document.getElementById("comment_action"); if (!select) { + config.commandsList = []; document.getElementById("comments").innerHTML += "<div id='make_bugzilla_comment_action'>" + " <label for='comment_action'>Add Comment: </label>" + " <select id='comment_action'>" + " <option value=''>-- Select Comment from List --</option>" + + " </select>" + "</div>"; select = document.getElementById("comment_action"); select.addEventListener("change", function (evt) { var value = select.options[select.selectedIndex].value; - log("value = " + value); - executeCommand(value); + executeCommand(config.commandsList[value]); }, false); } var opt = document.createElement("option"); - opt.value = cmdObj; + var objIdx = config.commandsList.length + 1; + opt.value = objIdx; + config.commandsList[objIdx] = cmdObj; opt.textContent = cmdObj.name; select.appendChild(opt); } @@ -332,7 +336,7 @@ function generateButtons (pkgs, kNodes) { // ========================================================= if (kNodes && window.location.hostname in kNodes) { - var killConf = killNodes[window.location.hostname]; + var killConf = kNodes[window.location.hostname]; killNodes(document, killConf[0], killConf[1]); } @@ -718,7 +722,7 @@ function getSelection () { * @param product (optional) string with the product name, if undefined, * search in all products * @return None - * + * */ function queryInNewTab(text, component, product) { var urlStr = "https://" + window.location.hostname + "/buglist.cgi?query_format=advanced"; @@ -743,11 +747,11 @@ function queryInNewTab(text, component, product) { // for further investigative searches if (text) { text = encodeURIComponent(text.trim()); - var searchText = "&field1-0-0=longdesc&type1-0-0=substring&value1-0-0=" + var searchText = "&field0-0-0=longdesc&type0-0-0=substring&value0-0-0=" + text - + "&field1-0-1=attach_data.thedata&type1-0-1=substring&value1-0-1=" + + "&field0-0-1=attach_data.thedata&type0-0-1=substring&value0-0-1=" + text - + "&field1-0-2=status_whiteboard&type1-0-2=substring&value1-0-2=" + + "&field0-0-2=status_whiteboard&type0-0-2=substring&value0-0-2=" + text; urlStr += searchText; postMessage(new Message("OpenURLinTab", urlStr)); diff --git a/data/lib/jumpNextBug.js b/data/lib/jumpNextBug.js new file mode 100644 index 0000000..f07bed0 --- /dev/null +++ b/data/lib/jumpNextBug.js @@ -0,0 +1,15 @@ +// Released under the MIT/X11 license +// http://www.opensource.org/licenses/mit-license.php +"use strict"; +var nextElement = {}; +var nextRE = new RegExp("Next"); + +var aNavigElements = document.querySelectorAll("#bugzilla-body .navigation a"); +var filteredElements = Array.filter(aNavigElements, function(elem) { + return nextRE.test(elem.textContent); +}); +if (filteredElements.length > 0) { + nextElement = filteredElements[0]; + nextElement.setAttribute("accesskey", "n"); + nextElement.innerHTML = "<u>N</u>ext"; +} diff --git a/data/lib/logging-front.js b/data/lib/logging-front.js index b3a175d..f6b3546 100644 --- a/data/lib/logging-front.js +++ b/data/lib/logging-front.js @@ -82,4 +82,6 @@ function setUpLogging () { */ } -setUpLogging(); +if (window.location.hostname == "bugzilla.redhat.com") { + setUpLogging(); +} diff --git a/data/lib/util.js b/data/lib/util.js index 0ecc318..1b5c37d 100644 --- a/data/lib/util.js +++ b/data/lib/util.js @@ -115,7 +115,8 @@ function createDeadLink (id, text, parent, callback, params, before, covered, ac } else { newAElem.setAttribute("href", ""); newAElem.addEventListener("click", function(evt) { - callback.apply(null, params); + // callback.apply(null, params); + callback(params); evt.stopPropagation(); evt.preventDefault(); }, false); |