o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142258.761604: @value"6{I" class:EFI"ProcessedAsset;FI"logical_path;FI",locomotive/views/snippets/_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/snippets/_form_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-07T10:55:40+02:00;FI" length;FiÞ I" digest;F"%c1ec66b17b93e0c726410245fb4f6fccI" 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).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'); return this.editor = CodeMirror.fromTextArea(input.get()[0], { mode: 'liquid', autoMatchParens: false, lineNumbers: false, passDelay: 50, tabMode: 'shift', theme: 'default medium', onChange: function(editor) { 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;F"%11a8322a8cee2f82b16214db982130a0I"required_paths;F[I"„/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI"‡/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;TI"dependency_paths;F[{I" path;FI"‡/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%0460f7fb76fbb6d79f6f9cbeba1112f6{I" path;FI"„/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%e4f8acd406d0d29f928f278bc23eee51I" _version;F"%ffd318ca8b794f42f5029101c2cf5d91