o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384093248.0229561: @value"ì{I" class:ETI"ProcessedAsset;FI"logical_path;TI",locomotive/views/snippets/_form_view.js;FI" pathname;TI"w/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-06-27T10:24:20+02:00;TI" length;Tié I" digest;TI"%2f7122683c344c6873868708f670cc98;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).Snippets || (_base.Snippets = {}); Locomotive.Views.Snippets.FormView = (function(_super) { __extends(FormView, _super); function FormView() { _ref = FormView.__super__.constructor.apply(this, arguments); return _ref; } FormView.prototype.el = '#content'; FormView.prototype.events = { 'click a#image-picker-link': 'open_image_picker', 'click a#copy-template-link': 'replace_template', 'submit': 'save' }; FormView.prototype.initialize = function() { _.bindAll(this, 'insert_image'); this.model = new Locomotive.Models.Snippet(this.options.snippet); this.image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView({ collection: new Locomotive.Models.ThemeAssetsCollection(), on_select: this.insert_image }); this.image_picker_view.render(); return Backbone.ModelBinding.bind(this); }; FormView.prototype.render = function() { FormView.__super__.render.call(this); this.slugify_name(); this.enable_liquid_editing(); return this; }; FormView.prototype.slugify_name = function() { return this.$('#snippet_name').slugify({ target: this.$('#snippet_slug'), url: window.permalink_service_url, underscore: true }); }; FormView.prototype.open_image_picker = function(event) { event.stopPropagation() & event.preventDefault(); this.image_picker_view.editor = this.editor; return this.image_picker_view.fetch_assets(); }; FormView.prototype.insert_image = function(path) { var text; text = "{{ '" + path + "' | theme_image_url }}"; this.editor.replaceSelection(text); return this.image_picker_view.close(); }; FormView.prototype.replace_template = function(event) { var link, _this = this; event.stopPropagation() & event.preventDefault(); link = $(event.target).closest('a'); return $.rails.ajax({ url: link.attr('href'), type: 'get', dataType: 'json', success: function(data) { return _this.editor.setValue(data.template); } }); }; FormView.prototype.enable_liquid_editing = function() { var input, _this = this; input = this.$('#snippet_template'); this.editor = CodeMirror.fromTextArea(input.get()[0], { mode: 'liquid', autoMatchParens: false, lineNumbers: false, passDelay: 50, tabMode: 'shift', theme: 'default medium' }); return this.editor.on('change', function(editor, change) { return _this.model.set({ template: editor.getValue() }); }); }; FormView.prototype.after_inputs_fold = function() { return this.editor.refresh(); }; return FormView; })(Locomotive.Views.Shared.FormView); }).call(this); ;TI"dependency_digest;TI"%2bdc9ccec10f30f86fe05070b2abb10f;FI"required_paths;T[I"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI"w/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI"dependency_paths;T[{I" path;TI"w/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI" mtime;TI"2013-06-27T10:24:20+02:00;TI" digest;TI"%0ad3863cbf8f7347bd2f123c0d338d48;F{I" path;TI"t/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI" mtime;TI"2013-10-25T15:32:29+02:00;TI" digest;TI"%530d8faa1e59d267e84e809bd2f80524;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F