o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142253.029084: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"3locomotive/views/content_assets/picker_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/content_assets/picker_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"%72782a9ed8712836e03b8ab194b05047I" 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).ContentAssets || (_base.ContentAssets = {}); Locomotive.Views.ContentAssets.PickerView = (function(_super) { __extends(PickerView, _super); function PickerView() { _ref = PickerView.__super__.constructor.apply(this, arguments); return _ref; } PickerView.prototype.number_items_per_row = 4; PickerView.prototype._item_views = []; PickerView.prototype.template = function() { return ich.content_asset_picker; }; PickerView.prototype.fetch_assets = function() { var _this = this; this._reset(); return this.collection.fetch({ success: function() { return _this.open(); } }); }; PickerView.prototype.build_uploader = function(el, link) { var _this = this; link.bind('click', function(event) { event.stopPropagation() & event.preventDefault(); return el.click(); }); return el.bind('change', function(event) { return _.each(event.target.files, function(file) { var asset; asset = new Locomotive.Models.ContentAsset({ source: file }); return asset.save({}, { headers: { 'X-Flash': true }, success: function(model, response) { return _this.collection.add(model.prepare()); }, error: function() { return _this.shake(); } }); }); }); }; PickerView.prototype.add_asset = function(asset, first) { var view; view = new Locomotive.Views.ContentAssets.PickerItemView({ model: asset, parent: this }); (this._item_views || (this._item_views = [])).push(view); this.$('ul.list .clear').before(view.render().el); this._refresh(); if (first !== true) { return this._move_to_last_asset(); } }; PickerView.prototype.remove_asset = function(asset) { var view; view = _.find(this._item_views, function(tmp) { return tmp.model === asset; }); if (view != null) { view.remove(); } return this._refresh(); }; PickerView.prototype._on_refresh = function() { var self; self = this; return this.$('ul.list li.asset').each(function(index) { if ((index + 1) % self.number_items_per_row === 0) { return $(this).addClass('last'); } else { return $(this).removeClass('last'); } }); }; PickerView.prototype._reset = function() { _.each(this._item_views || [], function(view) { return view.remove(); }); return PickerView.__super__._reset.call(this); }; return PickerView; })(Locomotive.Views.Shared.AssetPickerView); }).call(this); ;TI"dependency_digest;F"%84508f1c4d7350cbb0051f0c1f7243c2I"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/asset_picker_view.js.coffee;TI"/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/content_assets/picker_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/content_assets/picker_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%b2197eb50890108b4fb9905784d6bf49{I" path;FI"/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/asset_picker_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%fcd46d674e5401eae1d7f4538e3fbb37I" _version;F"%ffd318ca8b794f42f5029101c2cf5d91