M
matej
I am trying to write new GM script after couple of months of not
working with Firefox at all, and I am hitting the wall even with the
simplest preliminary steps to it. What I would like to achieve is to
add key shortcut for setting status of the bug to NEEDINFO and
information required from the reporter (which is like 75 % of bugs I
manage). For that I would like to add new <A> element to the end of the
bottom button bar (see e.g.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212188 which is
the bug where I am testing my script) just behind the words "Format for
printing" with acceskey and event listener calling function in the
script.
However, just the preliminary attempts to add simple text node and an
empty element are miserably failing and I cannot find why (JavaScript
console is silent):
// Some embellishments to RH Bugzilla
// version 0.1 ALPHA!
// 2006-01-02
// Copyright (c) 2006, Matěj Cepl
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
//
// ==UserScript==
// @name Bugzilla Improved
// @namespace http://www.ceplovi.cz/matej/progs/scripts
// @description some embellishments for RH Bugzilla
// @include
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=*
// ==/UserScript==
//function needInfoReporter(event) {
// alert("Event happened!");
// event.preventDefault();
// return false;
//}
//var StatusSelectTag = document.getElementsByName("newstatus");
//id('navigate')/table/tbody/tr/td[2]/a[3]
//var buttonTab = document.evaluate(
// '//div[@id="navigate"]//td[@align="right"]',
// document.body,
// null,
// XPathResult.ANY_UNORDERED_NODE_TYPE,
// null);
var buttonTab =
document.getElementById("navigate").getElementsByTagName("TD")[1];
var delimiterNode = document.createTextNode(" | ");
//var newNode = document.createElement("a");
//var newNodeText = document.createTextNode("NEEDINFO from reporter");
//newNode.appendChild(newNodeText);
//newNode.accessKey = "R";
//newNode.addEventListener('click', needInfoReporter, false);
//if (buttonTab.lastChild.nodeType==3) {
buttonTab.replaceChild(delimiterNode,buttonTab.lastChild);
//};
//buttonTab.appendChild(delimiterNode);
//buttonTab.appendChild(newNode);
--------------------------------------------------------------------------------
Any idea what's going on, please?
Thanks a lot,
Matěj
working with Firefox at all, and I am hitting the wall even with the
simplest preliminary steps to it. What I would like to achieve is to
add key shortcut for setting status of the bug to NEEDINFO and
information required from the reporter (which is like 75 % of bugs I
manage). For that I would like to add new <A> element to the end of the
bottom button bar (see e.g.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212188 which is
the bug where I am testing my script) just behind the words "Format for
printing" with acceskey and event listener calling function in the
script.
However, just the preliminary attempts to add simple text node and an
empty element are miserably failing and I cannot find why (JavaScript
console is silent):
// Some embellishments to RH Bugzilla
// version 0.1 ALPHA!
// 2006-01-02
// Copyright (c) 2006, Matěj Cepl
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
//
// ==UserScript==
// @name Bugzilla Improved
// @namespace http://www.ceplovi.cz/matej/progs/scripts
// @description some embellishments for RH Bugzilla
// @include
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=*
// ==/UserScript==
//function needInfoReporter(event) {
// alert("Event happened!");
// event.preventDefault();
// return false;
//}
//var StatusSelectTag = document.getElementsByName("newstatus");
//id('navigate')/table/tbody/tr/td[2]/a[3]
//var buttonTab = document.evaluate(
// '//div[@id="navigate"]//td[@align="right"]',
// document.body,
// null,
// XPathResult.ANY_UNORDERED_NODE_TYPE,
// null);
var buttonTab =
document.getElementById("navigate").getElementsByTagName("TD")[1];
var delimiterNode = document.createTextNode(" | ");
//var newNode = document.createElement("a");
//var newNodeText = document.createTextNode("NEEDINFO from reporter");
//newNode.appendChild(newNodeText);
//newNode.accessKey = "R";
//newNode.addEventListener('click', needInfoReporter, false);
//if (buttonTab.lastChild.nodeType==3) {
buttonTab.replaceChild(delimiterNode,buttonTab.lastChild);
//};
//buttonTab.appendChild(delimiterNode);
//buttonTab.appendChild(newNode);
--------------------------------------------------------------------------------
Any idea what's going on, please?
Thanks a lot,
Matěj