aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-03-02 16:56:57 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-03-02 17:53:57 +0100
commit093d38ebf3716b2d9ab7397afbc4f479682e28fc (patch)
treeb5cf82598bc894947cf60e12e642e804333a1990
parentea71f2b3c7d6b7e8a2a63669aa818d79ad85ffa0 (diff)
downloadbugzilla-triage-093d38ebf3716b2d9ab7397afbc4f479682e28fc.tar.gz
Add a 'n' accesskey to Next link to next bug
-rw-r--r--data/lib/jumpNextBug.js15
-rw-r--r--lib/main.js1
2 files changed, 16 insertions, 0 deletions
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/lib/main.js b/lib/main.js
index fe97964..34feb32 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -113,6 +113,7 @@ var messageHandler = exports.messageHandler = function messageHandler(worker, ms
var contentScriptLibraries = {
"bugzilla.redhat.com": [
+ self.data.url("lib/jumpNextBug.js"),
self.data.url("lib/util.js"),
self.data.url("lib/color.js"),
self.data.url("lib/logging-front.js"),