From e2771d771d7be1413a5528f34f2c89cdb7fddbc4 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Fri, 14 Jun 2013 14:05:47 -0700 Subject: Better justification for manifest mangling --- src/js/fiveui/js/rules.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/js/fiveui/js/rules.js b/src/js/fiveui/js/rules.js index d87d606..7e55b4f 100644 --- a/src/js/fiveui/js/rules.js +++ b/src/js/fiveui/js/rules.js @@ -120,16 +120,20 @@ fiveui.RuleSet.load = function(manifest_url, options) { return; } + // set defaults in the parsed manifest var manifest = fiveui.RuleSet.sanitize(obj); - // explicitly zero out the patterns, they shouldn't be part of the // manifest. manifest.patterns = []; - var rules = manifest.rules; - manifest.rules = []; + // remove the rules, as they'll be added back once processed. + var rules = manifest.rules; + manifest.rules = []; + + // overwrite any source present with the one given by the user. manifest.source = manifest_url; + loadRules(manifest, rules); }, -- cgit v1.2.3