diff options
Diffstat (limited to 'src/js/fiveui/js/options.js')
-rw-r--r-- | src/js/fiveui/js/options.js | 55 |
1 files changed, 3 insertions, 52 deletions
diff --git a/src/js/fiveui/js/options.js b/src/js/fiveui/js/options.js index 598649f..2a4f00e 100644 --- a/src/js/fiveui/js/options.js +++ b/src/js/fiveui/js/options.js @@ -62,50 +62,6 @@ fiveui.options.init = function(port) { var update = new fiveui.UpdateManager(msg); ruleSets = new fiveui.RuleSets([], { url: msg }); - urlPats = new fiveui.UrlPats([], { url: msg }); - - - /** UrlPat list entries ****************************************************/ - - var urlPatEntries = jQuery('#urlPatEntries'); - var addUrlPat = jQuery('#addUrlPat'); - - addUrlPat.prop('disabled', true); - - addUrlPat.on('click', function() { - urlPats.add(new fiveui.UrlPatModel({}, { url : msg })); - }); - - // when a new rule set is sync'd, make sure that the add url pattern button is - // enabled. - ruleSets.on('sync', function() { - if(ruleSets.length > 0) { - addUrlPat.prop('disabled', false); - } - }); - - // when a rule set is destroyed, and the collection is now empty, disable the - // add url pattern button. - ruleSets.on('destroy', function(model,col) { - if(col.length <= 0) { - addUrlPat.prop('disabled', true); - } - }); - - // handle new url patterns being added to the collection. - urlPats.on('add', function(model) { - var view = new fiveui.UrlPatEntry({ - model: model, - rules: new fiveui.RulesView({ model: ruleSets }) - }); - urlPatEntries.append(view.$el); - - if(model.isNew()) { - view.edit(); - } else { - view.render(); - } - }); /** RuleSet list entries ***************************************************/ @@ -129,7 +85,6 @@ fiveui.options.init = function(port) { if(model.isNew()) { entry.edit(); } else { - addUrlPat.prop('disabled', false); entry.render(); } }); @@ -198,7 +153,7 @@ fiveui.options.init = function(port) { setClickHandler(jQuery('#rule-sets'), select('#tab-rule-sets')); setClickHandler(jQuery('#basics'), select('#tab-basics')); - // select the url patterns tab by default + // select the rule sets tab selectNav(jQuery('#rule-sets')); selectSection(jQuery('#tab-rule-sets')); @@ -209,12 +164,8 @@ fiveui.options.init = function(port) { jQuery('#windowDisplayDefault').prop('checked', def); }); - // pre-populate the rule set and url pattern lists - ruleSets.fetch({ - success:function() { - urlPats.fetch(); - } - }); + // pre-populate the rule sets + ruleSets.fetch(); }; |