o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383239452.763078: @value"Á{I" class:ETI"ProcessedAsset;FI"logical_path;TI"3locomotive/views/content_assets/picker_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/content_assets/picker_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"%49307814a213108161b0346045b02a04;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).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(); console.log(el); window.foo = el; 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;TI"%9b146f51ce1aed9aa8451adf8c4f8200;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/shared/asset_picker_view.js.coffee;FI"£/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/content_assets/picker_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/content_assets/picker_view.js.coffee;FI" mtime;TI"2013-10-31T17:26:43+01:00;TI" digest;TI"%a8059e3ece0e851ae87bbcf9244a3597;F{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/shared/asset_picker_view.js.coffee;FI" mtime;TI"2013-10-31T17:26:43+01:00;TI" digest;TI"%fcd46d674e5401eae1d7f4538e3fbb37;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F