o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984307.8281221: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"3locomotive/views/content_assets/picker_view.js;TI" pathname;FI"z/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_assets/picker_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-18T09:21:50+01:00;FI" length;Fi I" digest;F"%3644ac71ddc0a4d072d9c557c53dbfecI" 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"%dc9acb3db39f4796c6507911f01622c9I"required_paths;F[I"x/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/asset_picker_view.js.coffee;TI"z/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_assets/picker_view.js.coffee;TI"dependency_paths;F[{I" path;FI"z/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/content_assets/picker_view.js.coffee;TI" mtime;FI"2013-01-18T09:21:50+01:00;FI" digest;F"%4bebb7ff45b4834892333160636a3f4d{I" path;FI"x/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/views/shared/asset_picker_view.js.coffee;TI" mtime;FI"2013-01-18T09:21:50+01:00;FI" digest;F"%68ddf826fc50b6f06e9989bfc2f9c8ccI" _version;F"%6776f581a4329e299531e1d52aa59832