o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384182743.410188: @value"Ç{I" class:ETI"ProcessedAsset;FI"logical_path;TI"0locomotive/views/theme_assets/_form_view.js;FI" pathname;TI" /Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/theme_assets/_form_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-11-11T00:40:29+01:00;TI" length;TiÝI" digest;TI"%95b8e88d20f5199230eab8cbeb451b82;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).ThemeAssets || (_base.ThemeAssets = {}); Locomotive.Views.ThemeAssets.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', 'submit': 'save' }; FormView.prototype.initialize = function() { _.bindAll(this, 'insert_image'); this.model = new Locomotive.Models.ThemeAsset(this.options.theme_asset); this.image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView({ 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.enable_toggle_between_file_and_text(); this.enable_source_editing(); this.bind_source_mode(); this.enable_source_file(); return this; }; FormView.prototype.enable_toggle_between_file_and_text = function() { var _this = this; this.$('div.hidden').hide(); this.model.set({ performing_plain_text: this.$('#theme_asset_performing_plain_text').val() }); return this.$('.selector > a.alt').click(function(event) { event.stopPropagation() & event.preventDefault(); if (_this.$('#file-selector').is(':hidden')) { return _this.$('#text-selector').slideUp('normal', function() { _this.$('#file-selector').slideDown(); _this.model.set({ performing_plain_text: false }); return _this.$('input#theme_asset_performing_plain_text').val(false); }); } else { return _this.$('#file-selector').slideUp('normal', function() { _this.$('#text-selector').slideDown('normal', function() { return _this.editor.refresh(); }); _this.model.set({ performing_plain_text: true }); return _this.$('#theme_asset_performing_plain_text').val(true); }); } }); }; FormView.prototype.enable_source_file = function() { var _this = this; return this.$('.formtastic #theme_asset_source').bind('change', function(event) { var input; input = $(event.target)[0]; if (input.files != null) { return _this.model.set({ source: input.files[0] }); } }); }; FormView.prototype.show_error = function(attribute, message, html) { switch (attribute) { case 'source': return this.$(this.model.get('performing_plain_text') ? '#theme_asset_plain_text_input .CodeMirror' : '#theme_asset_source').after(html); default: return FormView.__super__.show_error.apply(this, arguments); } }; 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 + "'"; this.editor.replaceSelection(text); return this.image_picker_view.close(); }; FormView.prototype.source_mode = function() { if (this.model.get('plain_text_type') === 'javascript') { return 'javascript'; } else { return 'css'; } }; FormView.prototype.enable_source_editing = function() { var input, _this = this; input = this.$('#theme_asset_plain_text'); if (input.size() === 0) { return; } this.editor = CodeMirror.fromTextArea(input.get()[0], { mode: this.source_mode(), autoMatchParens: false, lineNumbers: false, passDelay: 50, tabMode: 'shift', theme: 'default' }); return this.editor.on('change', function(editor, change) { return _this.model.set({ plain_text: editor.getValue() }); }); }; FormView.prototype.bind_source_mode = function() { var _this = this; return this.$('#theme_asset_plain_text_type').bind('change', function(event) { return _this.editor.setOption('mode', _this.source_mode()); }); }; FormView.prototype.after_inputs_fold = function() { if (this.editor != null) { return this.editor.refresh(); } }; return FormView; })(Locomotive.Views.Shared.FormView); }).call(this); ;TI"dependency_digest;TI"%94195810c4211c484983697249eedb86;FI"required_paths;T[I"™/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI" /Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/theme_assets/_form_view.js.coffee;FI"dependency_paths;T[{I" path;TI" /Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/theme_assets/_form_view.js.coffee;FI" mtime;TI"2013-11-11T00:40:29+01:00;TI" digest;TI"%c48ea4cae1e30dd8ecebb4408453a421;F{I" path;TI"™/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee;FI" mtime;TI"2013-11-11T00:40:29+01:00;TI" digest;TI"%530d8faa1e59d267e84e809bd2f80524;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F