o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984311.011681: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"/locomotive/views/current_site/edit_view.js;TI" pathname;FI"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-03T11:01:13+02:00;FI" length;FiMI" digest;F"%b0f34545561a552bc1c42accd4c656cbI" source;FI"M(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).CurrentSite || (_base.CurrentSite = {}); Locomotive.Views.CurrentSite.EditView = (function(_super) { __extends(EditView, _super); function EditView() { _ref = EditView.__super__.constructor.apply(this, arguments); return _ref; } EditView.prototype.el = '#content'; EditView.prototype.events = { 'submit': 'save' }; EditView.prototype.initialize = function() { this.model = new Locomotive.Models.CurrentSite(this.options.site); return Backbone.ModelBinding.bind(this, { checkbox: 'class' }); }; EditView.prototype.render = function() { EditView.__super__.render.call(this); this.add_toggle_mode_for_locales(); this.make_locales_sortable(); this.render_domains(); this.render_memberships(); return this.enable_liquid_editing(); }; EditView.prototype.add_toggle_mode_for_locales = function() { return this.$('#site_locales_input .list input[type=checkbox]').bind('change', function(event) { var el; el = $(event.target); if (el.is(':checked')) { return el.closest('.entry').addClass('selected'); } else { return el.closest('.entry').removeClass('selected'); } }); }; EditView.prototype.make_locales_sortable = function() { var _this = this; return this.sortable_locales_list = this.$('#site_locales_input .list').sortable({ items: '.entry', tolerance: 'pointer', update: function() { var list; list = _.map(_this.$('#site_locales_input .list input:checked'), function(el) { return $(el).val(); }); return _this.model.set({ locales: list }); } }); }; EditView.prototype.render_domains = function() { this.domains_view = new Locomotive.Views.Sites.DomainsView({ model: this.model, errors: this.options.errors }); return this.$('#site_domains_input label').after(this.domains_view.render().el); }; EditView.prototype.render_memberships = function() { this.memberships_view = new Locomotive.Views.Sites.MembershipsView({ model: this.model }); return this.$('#site_memberships_input').append(this.memberships_view.render().el); }; EditView.prototype.enable_liquid_editing = function() { var input, _this = this; if (($('#site_robots_txt').length)) { input = this.$('#site_robots_txt'); return this.editor = CodeMirror.fromTextArea(input.get()[0], { mode: 'liquid', autoMatchParens: false, lineNumbers: false, passDelay: 50, tabMode: 'shift', theme: 'default', onChange: function(editor) { return _this.model.set({ robots_txt: editor.getValue() }); } }); } }; EditView.prototype.save = function(event) { if (!this.model.get('subdomain') || this.model.includes_domain(window.location.host)) { return this.save_in_ajax(event); } }; EditView.prototype.show_error = function(attribute, message, html) { if (attribute === 'domains') { return this.domains_view.show_error(message); } else { return EditView.__super__.show_error.apply(this, arguments); } }; EditView.prototype.after_inputs_fold = function() { return this.editor.refresh(); }; EditView.prototype.remove = function() { this.domains_view.remove(); this.memberships_view.remove(); return EditView.__super__.remove.apply(this, arguments); }; return EditView; })(Locomotive.Views.Shared.FormView); }).call(this); ;TI"dependency_digest;F"%85578e4335aa5cf1d5b536b564cbd342I"required_paths;F[I"p/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI"r/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee;TI"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee;TI"dependency_paths;F[{I" path;FI"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%fc8c4e1ecf007fed5e8ce6b6459ab705{I" path;FI"p/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%a6e3a1e43e6f34490cc614f779383a34{I" path;FI"r/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee;TI" mtime;FI"2013-01-18T09:21:50+01:00;FI" digest;F"%cb39d45f7d22031cf828d2fdb7b34613I" _version;F"%6776f581a4329e299531e1d52aa59832