diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-07-29 16:26:53 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-07-29 16:29:19 +0200 |
commit | 2aabaeb3efb7419f400f639ab75a98a48bf1fd81 (patch) | |
tree | 2bf16314de2495d9ab3252d8d44f0269694bfe2f | |
parent | fe64972133d1fdc55515b5473638dace774ea69e (diff) | |
download | bugzilla-triage-2aabaeb3efb7419f400f639ab75a98a48bf1fd81.tar.gz |
Regexps for matching URLs is configuration and should be in JSON, not
statically included in data/ subdirectory.
(cherry picked from commit 0728e2ad4809619cd3ba5215252a52df85697940)
-rw-r--r-- | data/matches.json | 15 | ||||
-rw-r--r-- | lib/main.js | 10 |
2 files changed, 5 insertions, 20 deletions
diff --git a/data/matches.json b/data/matches.json deleted file mode 100644 index 25329d6..0000000 --- a/data/matches.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "matches": [ - "https://bugzilla.redhat.com/show_bug.cgi", - "https://bz-web2-test.devel.redhat.com/show_bug.cgi", - "https://bugs.freedesktop.org/show_bug.cgi", - "https://bugzilla.mozilla.org/show_bug.cgi" - ], - "skipMatches": [ - "https://bugzilla.redhat.com/(process|post)_bug.cgi", - "https://bz-web2-test.devel.redhat.com/(process|post)_bug.cgi", - "https://bugzilla.mozilla.org/post_bug.cgi", - "https://bugzilla.mozilla.org/process_bug.cgi", - "https://bugzilla.(redhat.com|mozilla.org)/attachment.cgi$" - ] -}
\ No newline at end of file diff --git a/lib/main.js b/lib/main.js index 43fa87d..a8bae4c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -24,11 +24,6 @@ var JSONURLDefault = "https://fedorahosted.org/released"+ "/bugzilla-triage-scripts/Config_data.json"; var config = {}; -(function (){ - var matchesAll = JSON.parse(selfMod.data.load("matches.json")); - config.matches = matchesAll.matches; - config.skipMatches = matchesAll.skipMatches; -})(); function isOurPage(window, matchingURLs) { var url = window.location.href; @@ -105,6 +100,11 @@ function initialize(callback) { config.logger = new logConstructor(myStorage.logs, JSON.parse(selfMod.data.load("bugzillalabelAbbreviations.json"))); + config.matches = config.gJSONData.configData.matches; + config.skipMatches = config.matches.map(function(x) { + return x.replace("show_bug.cgi.*","(process|post)_bug.cgi"); + }); + callback(config); } } |