o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384182743.883809: @value"¡{I" class:ETI"ProcessedAsset;FI"logical_path;TI"0locomotive/views/theme_assets/index_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/index_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-11-11T00:40:29+01:00;TI" length;TifI" digest;TI"%47df2c81ccab6a889e77f4c175735e1d;FI" source;TI"f(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.IndexView = (function(_super) { __extends(IndexView, _super); function IndexView() { _ref = IndexView.__super__.constructor.apply(this, arguments); return _ref; } IndexView.prototype.el = '#content'; IndexView.prototype._lists_views = []; IndexView.prototype.initialize = function() { return _.bindAll(this, 'insert_asset'); }; IndexView.prototype.render = function() { this.build_uploader(); this.render_snippets(); this.render_images(); this.render_js_and_css(); this.render_fonts(); this.render_media(); this.render_others(); return this; }; IndexView.prototype.build_uploader = function() { var form, input, link, _this = this; form = this.$('#theme-assets-quick-upload'); input = form.find('input[type=file]'); link = form.find('a.new'); form.formSubmitNotification(); link.bind('click', function(event) { event.stopPropagation() & event.preventDefault(); return input.click(); }); return input.bind('change', function(event) { form.trigger('ajax:beforeSend'); return _.each(event.target.files, function(file) { var asset; asset = new Locomotive.Models.ThemeAsset({ source: file }); return asset.save({}, { success: function(model, response, xhr) { form.trigger('ajax:complete'); return _this.insert_asset(model); }, error: (function() { return form.trigger('ajax:complete'); }), headers: { 'X-Flash': true } }); }); }); }; IndexView.prototype.insert_asset = function(model) { var list_view; list_view = this.pick_list_view(model.get('content_type')); if (list_view != null) { return list_view.collection.add(model); } }; IndexView.prototype.render_snippets = function() { return this.render_list('snippets', this.options.snippets, Locomotive.Views.Snippets.ListView); }; IndexView.prototype.render_images = function() { return this.render_list('images', this.options.images); }; IndexView.prototype.render_js_and_css = function() { return this.render_list('js-and-css', this.options.js_and_css_assets, Locomotive.Views.ThemeAssets.ListView, ich.js_and_css_list); }; IndexView.prototype.render_fonts = function() { return this.render_list('fonts', this.options.fonts, Locomotive.Views.ThemeAssets.ListView, ich.fonts_list); }; IndexView.prototype.render_media = function() { return this.render_list('media', this.options.media, Locomotive.Views.ThemeAssets.ListView, ich.media_list); }; IndexView.prototype.render_others = function() { return this.render_list('others', this.options.others, Locomotive.Views.ThemeAssets.ListView, ich.others_list); }; IndexView.prototype.render_list = function(type, collection, view_klass, template) { var view; if (this.$("#" + type + "-anchor").size() === 0) { return; } view_klass || (view_klass = Locomotive.Views.ThemeAssets.ListView); view = new view_klass({ collection: collection, type: type }); if (template != null) { view.template = function() { return template; }; } this.$("#" + type + "-anchor").replaceWith(view.render().el); return (this._lists_views || (this._lists_views = [])).push(view); }; IndexView.prototype.pick_list_view = function(content_type) { var type, _this = this; type = (function() { switch (content_type) { case 'image': return 'images'; case 'javascript': case 'stylesheet': return 'js-and-css'; case 'media': return 'media'; case 'font': return 'fonts'; case 'other': return 'others'; } })(); return _.find(this._lists_views, function(view) { return view.options.type === type; }); }; IndexView.prototype.remove = function() { var _this = this; _.each(this._lists_views, function(view) { return view.remove(); }); return IndexView.__super__.remove.apply(this, arguments); }; return IndexView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%de14462c71762f5b689f8fa0de1c74ef;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/theme_assets/index_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/index_view.js.coffee;FI" mtime;TI"2013-11-11T00:40:29+01:00;TI" digest;TI"%498ff5145c7c9c3a94fe36fd31e5e853;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F