o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984316.37745: @value"´{I" class:EFI"ProcessedAsset;FI"logical_path;FI",locomotive/views/snippets/_form_view.js;TI" pathname;FI"s/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-03T11:01:13+02:00;FI" length;FiÞ I" digest;F"%1c47c412229ff72563ef683eb88a6ffeI" 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"%2072ed5806bc0d191798aa89f7267c7eI"required_paths;F[I"p/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI"s/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;TI"dependency_paths;F[{I" path;FI"s/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%d8ff720a0094e7ec8b206028d6697092{I" path;FI"p/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%a6e3a1e43e6f34490cc614f779383a34I" _version;F"%6776f581a4329e299531e1d52aa59832