diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-03-02 23:07:53 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-03-03 00:41:11 +0100 |
commit | 93bd458f3f60b47ccb4f1d1d0f2688b267eab55f (patch) | |
tree | c4d6e0a4d9836b5a1edfb580d4c6113be93a21ff /lib/main.js | |
parent | 5d61ae1855a017eadee8018f9c7345ef11478868 (diff) | |
download | bugzilla-triage-93bd458f3f60b47ccb4f1d1d0f2688b267eab55f.tar.gz |
Make script working with Mozilla bugzilla.
* Store all functions in an array and store just indexes in the SELECT
* add pageMod options for other bugzillas
Diffstat (limited to 'lib/main.js')
-rw-r--r-- | lib/main.js | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/main.js b/lib/main.js index 34feb32..b553f6f 100644 --- a/lib/main.js +++ b/lib/main.js @@ -111,24 +111,24 @@ 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"), - self.data.url("lib/rhbzpage.js"), - self.data.url("lib/bzpage.js") - ] -}; +var contentScriptLibraries = [ + 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"), + self.data.url("lib/rhbzpage.js"), + self.data.url("lib/bzpage.js") +]; libbz.initialize(libbz.config, function () { pageMod.PageMod({ include: [ - "https://bugzilla.redhat.com/show_bug.cgi?id=*" + "https://bugzilla.redhat.com/show_bug.cgi?id=*", + "https://bugzilla.mozilla.org/show_bug.cgi?id=*", + "https://bugzilla.gnome.org/show_bug.cgi?id=*" ], contentScriptWhen: 'ready', - contentScriptFile: contentScriptLibraries["bugzilla.redhat.com"], + contentScriptFile: contentScriptLibraries, onAttach: function onAttach(worker, msg) { worker.on('message', function (msg) { messageHandler(worker, msg); @@ -140,7 +140,14 @@ libbz.initialize(libbz.config, function () { pageMod.PageMod({ include: [ "https://bugzilla.redhat.com/process_bug.cgi", - "https://bugzilla.redhat.com/attachment.cgi" + "https://bugzilla.redhat.com/post_bug.cgi", + "https://bugzilla.redhat.com/attachment.cgi", + "https://bugzilla.mozilla.org/process_bug.cgi", + "https://bugzilla.mozilla.org/post_bug.cgi", + "https://bugzilla.mozilla.org/attachment.cgi", + "https://bugzilla.gnome.org/process_bug.cgi", + "https://bugzilla.gnome.org/post_bug.cgi", + "https://bugzilla.gnome.org/attachment.cgi" ], contentScriptWhen: 'ready', contentScriptFile: self.data.url("lib/skip-bug.js") |