aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/skip-bug.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-02-23 02:50:39 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-02-23 02:50:39 +0100
commit5b9f263ac1485c0ab18c2d42c5cd18746208bad4 (patch)
tree7a7ae6ac75e6156bb0c6d1fcf2bc970522f0a7ed /data/lib/skip-bug.js
parent7711a600699a0b51d06ab069cfbef2fbb578449c (diff)
downloadbugzilla-triage-5b9f263ac1485c0ab18c2d42c5cd18746208bad4.tar.gz
Moved .js files from data/ to data/lib/ so that we don't mix data and code.
Diffstat (limited to 'data/lib/skip-bug.js')
-rw-r--r--data/lib/skip-bug.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/data/lib/skip-bug.js b/data/lib/skip-bug.js
new file mode 100644
index 0000000..9fcb531
--- /dev/null
+++ b/data/lib/skip-bug.js
@@ -0,0 +1,20 @@
+// Released under the MIT/X11 license
+// http://www.opensource.org/licenses/mit-license.php
+// "use strict";
+
+function reloadPage() {
+ var stemURL = 'https://HOSTNAME/show_bug.cgi?id=';
+ var titleElems = document.getElementsByTagName('title');
+ if (titleElems) {
+ var REArr = new RegExp('[bB]ug\\s+([0-9]+)').
+ exec(titleElems[0].textContent);
+ var hostname = document.location.hostname;
+ if (REArr) {
+ console.log("Reloading bug " + REArr[1] + "!");
+ document.location = stemURL.
+ replace('HOSTNAME',hostname) + REArr[1];
+ }
+ }
+}
+
+reloadPage();