aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan@mozilla.com>2011-04-26 15:02:15 -0400
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:42:16 +0200
commit74d114c5558ea9d17b86bb74831be335c976c643 (patch)
treeb5d94a4be829a664094c2f17290b66c192a6633d
parent195a45e8a52a5663cc9678ae295a279712544f36 (diff)
downloadbugzilla-triage-74d114c5558ea9d17b86bb74831be335c976c643.tar.gz
Correct the linkification of flags based on the changes in Bugzilla 4.0
-rw-r--r--data/js/bug-page-mod.js34
1 files changed, 16 insertions, 18 deletions
diff --git a/data/js/bug-page-mod.js b/data/js/bug-page-mod.js
index 596e2c7..96dbbf9 100644
--- a/data/js/bug-page-mod.js
+++ b/data/js/bug-page-mod.js
@@ -137,29 +137,27 @@ function tweakBugzilla(d) {
}
var flagCounter = 1;
function findFlag(item) {
- function lookup(name) {
- name = name.replace('\u2011', '-', 'g');
- for (var i = 0; i < flagNames.length; ++i) {
- var quotedFlagName = flagNames[i].replace('.', '\\.', 'g')
- .replace('\u2011', '-', 'g');
- if ((new RegExp('^' + quotedFlagName)).test(name)) {
- return [flagNames[i]];
+ function lookup(names) {
+ names = names.split(", ");
+ var results = [];
+ for (var j = 0; j < names.length; ++j) {
+ var name = names[j].replace('\u2011', '-', 'g');
+ for (var i = 0; i < flagNames.length; ++i) {
+ var quotedFlagName = flagNames[i].replace('.', '\\.', 'g')
+ .replace('\u2011', '-', 'g');
+ if ((new RegExp('^' + quotedFlagName)).test(name)) {
+ results.push(flagNames[i]);
+ break;
+ }
}
}
- return [];
+ return results;
}
var base = item[4] ? 2 : 0;
// handle normal flags
- if (trimContent(item[base]) == 'Flag') {
- var result = [];
- var tmp = lookup(trimContent(item[base + 1]));
- if (tmp.length) {
- result.push(tmp[0]);
- }
- tmp = lookup(trimContent(item[base + 2]));
- if (tmp.length) {
- result.push(tmp[0]);
- }
+ if (trimContent(item[base]) == 'Flags') {
+ var result = lookup(trimContent(item[base + 1])).
+ concat(lookup(trimContent(item[base + 2])));
return result;
}
// handle special pseudo-flags