o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383239454.826716: @value"{I" class:ETI"ProcessedAsset;FI"logical_path;TI"+locomotive/views/sites/domains_view.js;FI" pathname;TI"›/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-10-31T17:26:43+01:00;TI" length;TiðI" digest;TI"%7bfd2ed81da9a47d6dffb7418327ccdc;FI" source;TI"ð(function() { var _base, _ref, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; (_base = Locomotive.Views).Sites || (_base.Sites = {}); Locomotive.Views.Sites.DomainsView = (function(_super) { var _entry_views; __extends(DomainsView, _super); function DomainsView() { _ref = DomainsView.__super__.constructor.apply(this, arguments); return _ref; } DomainsView.prototype.tagName = 'div'; DomainsView.prototype.className = 'list'; _entry_views = []; DomainsView.prototype.events = { 'click .new-entry a.add': 'add_entry', 'keypress .new-entry input[type=text]': 'add_on_entry_from_enter' }; DomainsView.prototype.render = function() { $(this.el).html(ich.domains_list(this.model.toJSON())); this.render_entries(); this.enable_ui_effects(); return this; }; DomainsView.prototype.add_entry = function(event) { var domain, input; event.stopPropagation() & event.preventDefault(); input = this.$('.new-entry input[name=domain]'); if (input.val() !== '') { domain = new Locomotive.Models.Domain({ name: input.val() }); this.model.get('domains').push(domain); this._insert_entry(domain); this.$('ul li.domain:last input[type=text]').editableField(); this.$('.empty').hide(); return input.val(''); } }; DomainsView.prototype.add_on_entry_from_enter = function(event) { if (event.keyCode !== 13) { return; } return this.add_entry(event); }; DomainsView.prototype.change_entry = function(domain, value) { return domain.set({ name: value }); }; DomainsView.prototype.remove_entry = function(domain) { var list, _this = this; list = _.reject(this.model.get('domains'), function(_domain) { return _domain === domain; }); this.model.set({ domains: list }); if (this.model.get('domains').length === 0) { return this.$('.empty').show(); } }; DomainsView.prototype.render_entries = function() { var _this = this; if (this.model.get('domains').length === 0) { return this.$('.empty').show(); } else { _.each(this.model.get('domains'), function(domain) { return _this._insert_entry(domain); }); return this.show_errors(); } }; DomainsView.prototype.show_errors = function() { var _this = this; return _.each(this.options.errors.domain || [], function(message) { return _this.show_error(message); }); }; DomainsView.prototype.show_error = function(message) { return _.each(this._entry_views || [], function(view) { var html; if (new RegExp("^" + (view.model.get('name'))).test(message)) { html = $('').addClass('inline-errors').html(message); return view.$('input[type=text].path').after(html); } }); }; DomainsView.prototype.enable_ui_effects = function() { return this.$('.domain input[type=text]').editableField(); }; DomainsView.prototype._insert_entry = function(domain) { var view; view = new Locomotive.Views.Sites.DomainEntryView({ model: domain, parent_view: this }); (this._entry_views || (this._entry_views = [])).push(view); return this.$('ul').append(view.render().el); }; return DomainsView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%420387182fc3cfef90855075f6a99fc6;FI"required_paths;T[I"›/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee;FI"dependency_paths;T[{I" path;TI"›/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee;FI" mtime;TI"2013-10-31T17:26:43+01:00;TI" digest;TI"%1e3c50655b4cbf1908edc109ee95288c;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F