aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-01-03 00:31:40 +0100
committerMatěj Cepl <mcepl@redhat.com>2012-01-03 00:31:40 +0100
commitfb662574627c9bc3477ccfaacd4e96bfda1f3e29 (patch)
tree2fe65d0da0f7adfcc848705bdaffd6c3395d07a5
parent7eccc88d90b9e4967199519b3adf2e189ec02235 (diff)
downloadbugzilla-triage-fb662574627c9bc3477ccfaacd4e96bfda1f3e29.tar.gz
Hopefully fixes compatibility with bugs.eclipse.org.
-rw-r--r--Makefile7
-rw-r--r--data/lib/skip-bug.js19
-rw-r--r--lib/main.js9
3 files changed, 25 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 10aed5c..f5eaced 100644
--- a/Makefile
+++ b/Makefile
@@ -5,12 +5,14 @@ UPDATE_URL=https://fedorahosted.org/released/bugzilla-triage-scripts/update.rdf
all: bugzilla-triage-$(VERNO).xpi update.rdf
+amo: bugzilla-triage.xpi
+
install: local-install
make -C $(WEBDIR)
websync
local-install: bugzilla-triage-$(VERNO).xpi update.rdf
- rsync -av bugzilla-triage*.xpi $(WEBDIR)
+ rsync -av bugzilla-triage-*.xpi $(WEBDIR)
rsync -av jsons/Config_data.json $(WEBDIR)
bugzilla-triage-$(VERNO).xpi: package.json lib/*.js
@@ -21,6 +23,9 @@ bugzilla-triage-$(VERNO).xpi: package.json lib/*.js
tidy -i -xml -utf8 -m bugzilla-triage.update.rdf
mv bugzilla-triage.xpi bugzilla-triage-$(VERNO).xpi
+bugzilla-triage.xpi: package.json lib/*.js
+ cfx xpi
+
update.rdf: bugzilla-triage-$(VERNO).xpi
tidy -i -xml -utf8 -m update.rdf
diff --git a/data/lib/skip-bug.js b/data/lib/skip-bug.js
index 389eb54..4b4cd34 100644
--- a/data/lib/skip-bug.js
+++ b/data/lib/skip-bug.js
@@ -3,14 +3,17 @@
// "use strict";
function reloadPage() {
- var titleElems = document.getElementsByTagName('title');
- if (titleElems) {
- var REArr = new RegExp('[bB]ug\\s+([0-9]+)')
- .exec(titleElems[0].textContent);
- if (REArr) {
- document.location = '/show_bug.cgi?id=' + REArr[1];
- }
- }
+ var titleElems = document.getElementsByTagName('title');
+ if (titleElems) {
+ var REArr = new RegExp('[bB]ug\\s+([0-9]+)')
+ .exec(titleElems[0].textContent);
+ if (REArr) {
+ var URLArr = document.location.path.split("/");
+ document.location = URLArr.slice(0, URLArr.length - 1).join("/")
+ + "/show_bug.cgi?id=" + REArr[1];
+ }
+ }
}
+console.log("asdasd");
reloadPage();
diff --git a/lib/main.js b/lib/main.js
index d204b95..7b475a5 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -115,6 +115,8 @@ var contentScriptLibraries = [
];
libbz.initialize(function(config) {
+ console.log("config.configData.bugPageMatch = " +
+ config.configData.bugPageMatch);
pageMod.PageMod({
include : config.configData.bugPageMatch,
contentScriptWhen : 'ready',
@@ -133,10 +135,15 @@ libbz.initialize(function(config) {
}
});
+ console.log("config.configData.skipMatch = " +
+ config.configData.skipMatch);
pageMod.PageMod({
include : config.configData.skipMatch,
contentScriptWhen : 'ready',
- contentScriptFile : self.data.url("lib/skip-bug.js")
+ contentScriptFile : [
+ self.data.url("lib/util.js"),
+ self.data.url("lib/skip-bug.js")
+ ]
});
});