o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1416672647.302335: @value"¡{I" class:ETI"ProcessedAsset;FI"logical_path;TI",locomotive/views/snippets/_form_view.js;FI" pathname;TI"—/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-11-22T16:47:36+01:00;TI" length;Tiþ I" digest;TI"%5f7753cbb4237453f0a1f3837a3ce60f;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).Snippets || (_base.Snippets = {}); Locomotive.Views.Snippets.FormView = (function(_super) { __extends(FormView, _super); function FormView() { return FormView.__super__.constructor.apply(this, arguments); } 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 }); }; 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; event.stopPropagation() & event.preventDefault(); link = $(event.target).closest('a'); return $.rails.ajax({ url: link.attr('href'), type: 'get', dataType: 'json', success: (function(_this) { return function(data) { return _this.editor.setValue(data.template); }; })(this) }); }; FormView.prototype.enable_liquid_editing = function() { var input; 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(_this) { return function(editor, change) { return _this.model.set({ template: editor.getValue() }); }; })(this)); }; FormView.prototype.after_inputs_fold = function() { return this.editor.refresh(); }; return FormView; })(Locomotive.Views.Shared.FormView); }).call(this); ;TI"dependency_digest;TI"%439e2666779ac41ec10debca87c051a3;FI"required_paths;T[I"”/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI"—/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI"dependency_paths;T[{I" path;TI"—/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;FI" mtime;TI"2014-11-22T16:47:36+01:00;TI" digest;TI"%ecc3df716571c51fa0172192bcc35918;F{@I"”/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;F@ I"2014-11-22T16:47:36+01:00;T@"I"%6b625a8f368e04b11585748da811b133;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F