o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142254.1878579:@value"ˆ{I" class:EFI"ProcessedAsset; FI"logical_path; FI"1locomotive/views/content_types/_form_view.js; TI" pathname; FI"Œ/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee; TI"content_type; FI"application/javascript; FI" mtime; FI"2013-10-07T10:55:40+02:00; FI"length; FiI"digest; F"%40c178ac13a09ae3d813eb4f395679eeI"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] + "