diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-01-03 00:31:40 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-01-03 00:31:40 +0100 |
commit | fb662574627c9bc3477ccfaacd4e96bfda1f3e29 (patch) | |
tree | 2fe65d0da0f7adfcc848705bdaffd6c3395d07a5 | |
parent | 7eccc88d90b9e4967199519b3adf2e189ec02235 (diff) | |
download | bugzilla-triage-fb662574627c9bc3477ccfaacd4e96bfda1f3e29.tar.gz |
Hopefully fixes compatibility with bugs.eclipse.org.
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | data/lib/skip-bug.js | 19 | ||||
-rw-r--r-- | lib/main.js | 9 |
3 files changed, 25 insertions, 10 deletions
@@ -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") + ] }); }); |