aboutsummaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-03-02 23:07:53 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-03-03 00:41:11 +0100
commit93bd458f3f60b47ccb4f1d1d0f2688b267eab55f (patch)
treec4d6e0a4d9836b5a1edfb580d4c6113be93a21ff /data
parent5d61ae1855a017eadee8018f9c7345ef11478868 (diff)
downloadbugzilla-triage-93bd458f3f60b47ccb4f1d1d0f2688b267eab55f.tar.gz
Make script working with Mozilla bugzilla.
* Store all functions in an array and store just indexes in the SELECT * add pageMod options for other bugzillas
Diffstat (limited to 'data')
-rw-r--r--data/lib/bzpage.js12
-rw-r--r--data/lib/logging-front.js4
2 files changed, 11 insertions, 5 deletions
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js
index bd8e6ce..1a3e6b4 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]);
}
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();
+}