M
Matej Cepl
Hi,
still struggling with greasemonkeying RedHat bugzilla and I am not able
to switch programatically status of the bug to NEEDINFO (to Reporter).
See this piece of script (whole thing is available on http://
www.ceplovi.cz/matej/tmp/bugzillaCopyOwnerToCC.user.js ):
function needinfoHandler(evt) {
/** set bug to NEEDINFO reporter.
*/
var sel = document.forms[1].elements.namedItem("newstatus");
var statesList = [];
var state = "";
for (var i=0; i < sel.length; i++) {
state = sel.getAttribute("value");
state = state.replace(/\s*(.*)\s*/,"$1");
statesList[statesList.length] = state;
}
var stateIndex = statesList.indexOf("needinfo");
var selectedState = sel.getElementsByTagName("option") [stateIndex];
document.getElementById("knob-leave").checked = false;
document.getElementById("knob-changestatus").checked = true;
// myToggleNeedinfo(document.forms[1]);
unsafeWindow.toggleNeedinfo(document.changeform);
GM_log("after");
// for testing purpose to avoid actual commit of the form
evt.stopPropagation();
evt.preventDefault();
return false;
selectedState.selected = true;
var newOptions = document.getElementById("requestee_actor-16");
GM_log(newOptions);
var newOptionList = newOptions.getElementsByTagName("option");
var newOptionReporter = pickElement(newOptionList,
function(elem) {
return elem.innerHTML.test(/Reporter/);
});
}
Even when using unsafeWindow (there shouldn't be any security problem
with that -- after all, it is my employer's bugzilla) I cannot make the
switch to NEEDINFO correct.
Because, I expect that you don't get the same scripts as I (common users
get much more bland page), I uploaded an example page on http://
www.ceplovi.cz/matej/tmp/bugzilla-example.html .
Do you see anything how to make the switch, please?
I tried this on greasemonkey NG, but got no answer, will any Javascript
guru be able to help me here?
Thanks a lot for any answer,
Matej Cepl
still struggling with greasemonkeying RedHat bugzilla and I am not able
to switch programatically status of the bug to NEEDINFO (to Reporter).
See this piece of script (whole thing is available on http://
www.ceplovi.cz/matej/tmp/bugzillaCopyOwnerToCC.user.js ):
function needinfoHandler(evt) {
/** set bug to NEEDINFO reporter.
*/
var sel = document.forms[1].elements.namedItem("newstatus");
var statesList = [];
var state = "";
for (var i=0; i < sel.length; i++) {
state = sel.getAttribute("value");
state = state.replace(/\s*(.*)\s*/,"$1");
statesList[statesList.length] = state;
}
var stateIndex = statesList.indexOf("needinfo");
var selectedState = sel.getElementsByTagName("option") [stateIndex];
document.getElementById("knob-leave").checked = false;
document.getElementById("knob-changestatus").checked = true;
// myToggleNeedinfo(document.forms[1]);
unsafeWindow.toggleNeedinfo(document.changeform);
GM_log("after");
// for testing purpose to avoid actual commit of the form
evt.stopPropagation();
evt.preventDefault();
return false;
selectedState.selected = true;
var newOptions = document.getElementById("requestee_actor-16");
GM_log(newOptions);
var newOptionList = newOptions.getElementsByTagName("option");
var newOptionReporter = pickElement(newOptionList,
function(elem) {
return elem.innerHTML.test(/Reporter/);
});
}
Even when using unsafeWindow (there shouldn't be any security problem
with that -- after all, it is my employer's bugzilla) I cannot make the
switch to NEEDINFO correct.
Because, I expect that you don't get the same scripts as I (common users
get much more bland page), I uploaded an example page on http://
www.ceplovi.cz/matej/tmp/bugzilla-example.html .
Do you see anything how to make the switch, please?
I tried this on greasemonkey NG, but got no answer, will any Javascript
guru be able to help me here?
Thanks a lot for any answer,
Matej Cepl