o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984309.187105: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"1locomotive/views/content_types/_form_view.js;TI" pathname;FI"x/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-03T11:01:13+02:00;FI" length;FiI" digest;F"%1216bfd61566169d2b06444cca9c8d8fI" source;FI"(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).ContentTypes || (_base.ContentTypes = {}); Locomotive.Views.ContentTypes.FormView = (function(_super) { __extends(FormView, _super); function FormView() { _ref = FormView.__super__.constructor.apply(this, arguments); return _ref; } FormView.prototype.el = '#content'; FormView.prototype.events = { 'submit': 'save' }; FormView.prototype.initialize = function() { this.model = new Locomotive.Models.ContentType(this.options.content_type); return Backbone.ModelBinding.bind(this); }; FormView.prototype.render = function() { FormView.__super__.render.call(this); this.render_custom_fields(); this.slugify_name(); this.enable_liquid_editing(); this.enable_public_submission_checkbox(); this.enable_order_by_toggler(); return this; }; FormView.prototype.render_custom_fields = function() { this.custom_fields_view = new Locomotive.Views.ContentTypes.CustomFieldsView({ model: this.model, inverse_of_list: this.options.inverse_of_list }); return this.$('#custom_fields_input').append(this.custom_fields_view.render().el); }; FormView.prototype.slugify_name = function() { return this.$('#content_type_name').slugify({ target: this.$('#content_type_slug'), url: window.permalink_service_url, underscore: true }); }; FormView.prototype.enable_liquid_editing = function() { var input, _this = this; input = this.$('#content_type_raw_item_template'); 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({ raw_item_template: editor.getValue() }); } }); }; FormView.prototype.after_inputs_fold = function() { return this.editor.refresh(); }; FormView.prototype.enable_public_submission_checkbox = function() { var _this = this; return this._enable_checkbox('public_submission_enabled', { on_callback: function() { return _this.$('#content_type_public_submission_accounts_input').show(); }, off_callback: function() { return _this.$('#content_type_public_submission_accounts_input').hide(); } }); }; FormView.prototype.enable_order_by_toggler = function() { var _this = this; return this.$('#content_type_order_by_input').bind('change', function(event) { var target; target = _this.$('#content_type_order_direction_input'); if ($(event.target).val() === '_position') { return target.hide(); } else { return target.show(); } }); }; FormView.prototype.show_error = function(attribute, message, html) { var _this = this; if (attribute !== 'entries_custom_fields') { return FormView.__super__.show_error.apply(this, arguments); } else { if (_.isEmpty(message)) { return; } return _.each(_.keys(message), function(key) { var view, _messages; _messages = message[key]; if (key === 'base') { html = $("

" + _messages[0] + "

"); return _this.$('#custom_fields_input .list').after(html); } else { view = _this.custom_fields_view.find_entry_view(key); if (view != null) { return view.show_error(_messages[0]); } } }); } }; FormView.prototype.remove = function() { this.custom_fields_view.remove(); return FormView.__super__.remove.apply(this, arguments); }; return FormView; })(Locomotive.Views.Shared.FormView); }).call(this); ;TI"dependency_digest;F"%ebf188502d24713cbf03bf60ee5821f4I"required_paths;F[I"p/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI"x/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee;TI"dependency_paths;F[{I" path;FI"x/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%03a27f46db226a41994952a0c466c42e{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"%a6e3a1e43e6f34490cc614f779383a34I" _version;F"%6776f581a4329e299531e1d52aa59832