diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-03-02 23:07:53 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-03-03 00:41:11 +0100 |
commit | 93bd458f3f60b47ccb4f1d1d0f2688b267eab55f (patch) | |
tree | c4d6e0a4d9836b5a1edfb580d4c6113be93a21ff /data/lib/bzpage.js | |
parent | 5d61ae1855a017eadee8018f9c7345ef11478868 (diff) | |
download | bugzilla-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/lib/bzpage.js')
-rw-r--r-- | data/lib/bzpage.js | 12 |
1 files changed, 8 insertions, 4 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]); } |