diff options
Diffstat (limited to 'data/js/bug-page-mod.js')
-rw-r--r-- | data/js/bug-page-mod.js | 34 |
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 |