o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1397508827.6106439:@value"ü{I" class:ETI"ProcessedAsset; FI"logical_path; TI"1locomotive/views/content_types/_form_view.js; FI" pathname; TI"¨/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-5337f0929131/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee; FI"content_type; TI"application/javascript; TI" mtime; TI"2014-04-10T01:06:58+02:00; TI"length; TiëI"digest; TI"%ab56960d205008f31f87e06a47a5af1c; FI"source; TI"ë(function() { var _base, __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() { return FormView.__super__.constructor.apply(this, arguments); } 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; input = this.$('#content_type_raw_item_template'); this.editor = CodeMirror.fromTextArea(input.get()[0], { mode: 'liquid', autoMatchParens: false, lineNumbers: false, passDelay: 50, tabMode: 'shift', theme: 'default' }); return this.editor.on('change', (function(_this) { return function(editor, change) { return _this.model.set({ raw_item_template: editor.getValue() }); }; })(this)); }; FormView.prototype.after_inputs_fold = function() { return this.editor.refresh(); }; FormView.prototype.enable_public_submission_checkbox = function() { return this._enable_checkbox('public_submission_enabled', { on_callback: (function(_this) { return function() { return _this.$('#content_type_public_submission_accounts_input').show(); }; })(this), off_callback: (function(_this) { return function() { return _this.$('#content_type_public_submission_accounts_input').hide(); }; })(this) }); }; FormView.prototype.enable_order_by_toggler = function() { return this.$('#content_type_order_by_input').bind('change', (function(_this) { return function(event) { var target; target = _this.$('#content_type_order_direction_input'); if ($(event.target).val() === '_position') { return target.hide(); } else { return target.show(); } }; })(this)); }; FormView.prototype.show_error = function(attribute, message, html) { if (attribute !== 'entries_custom_fields') { return FormView.__super__.show_error.apply(this, arguments); } else { if (_.isEmpty(message)) { return; } return _.each(_.keys(message), (function(_this) { return function(key) { var view, _messages; _messages = message[key]; if (key === 'base') { html = $("
" + _messages[0] + "