o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383239455.207534: @value".{I" class:ETI"ProcessedAsset;FI"logical_path;TI"4locomotive/views/editable_elements/file_view.js;FI" pathname;TI"¤/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/app/assets/javascripts/locomotive/views/editable_elements/file_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-10-31T17:26:43+01:00;TI" length;Tiã I" digest;TI"%83e1a670710d8b9ac6eb5a5dedf61c3d;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).EditableElements || (_base.EditableElements = {}); Locomotive.Views.EditableElements.FileView = (function(_super) { __extends(FileView, _super); function FileView() { _ref = FileView.__super__.constructor.apply(this, arguments); return _ref; } FileView.prototype.tagName = 'li'; FileView.prototype.className = 'file input'; FileView.prototype.states = { change: false, "delete": false }; FileView.prototype.events = { 'click a.change': 'toggle_change', 'click a.delete': 'toggle_delete' }; FileView.prototype.render = function() { var _this = this; $(this.el).html(ich.editable_file_input(this.model.toJSON())); this.$('input[type=file]').bind('change', function(event) { var input; input = $(event.target)[0]; if (input.files != null) { return _this.model.set({ source: input.files[0] }); } }); return this; }; FileView.prototype.after_render = function() {}; FileView.prototype.refresh = function() { this.$('input[type=file]').unbind('change'); this.states = { 'change': false, 'delete': false }; return this.render(); }; FileView.prototype.toggle_change = function(event) { var _this = this; return this._toggle(event, 'change', { on_change: function() { return _this.$('a:first').hide() & _this.$('input[type=file]').show() & _this.$('a.delete').hide(); }, on_cancel: function() { _this.model.set({ source: null }); return _this.$('a:first').show() & _this.$('input[type=file]').val('').hide() & _this.$('a.delete').show(); } }); }; FileView.prototype.toggle_delete = function(event) { var _this = this; return this._toggle(event, 'delete', { on_change: function() { _this.$('a:first').addClass('deleted') & _this.$('a.change').hide(); _this.$('input[type=hidden].remove-flag').val('1'); return _this.model.set({ 'remove_source': true }); }, on_cancel: function() { _this.$('a:first').removeClass('deleted') & _this.$('a.change').show(); _this.$('input[type=hidden].remove-flag').val('0'); return _this.model.set({ 'remove_source': false }); } }); }; FileView.prototype._toggle = function(event, state, options) { var button, label; event.stopPropagation() & event.preventDefault(); button = $(event.target); label = button.data('alt-label'); if (!this.states[state]) { options.on_change(); } else { options.on_cancel(); } button.data('alt-label', button.html()); button.html(label); return this.states[state] = !this.states[state]; }; FileView.prototype.remove = function() { this.$('input[type=file]').unbind('change'); return FileView.__super__.remove.apply(this, arguments); }; return FileView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%0967f2978d33a69c464709b4a551544c;FI"required_paths;T[I"¤/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/app/assets/javascripts/locomotive/views/editable_elements/file_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.0/app/assets/javascripts/locomotive/views/editable_elements/file_view.js.coffee;FI" mtime;TI"2013-10-31T17:26:43+01:00;TI" digest;TI"%1421108118d9e93c585924b912669f57;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F