o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381401974.10734: @value"N{I" class:EFI"ProcessedAsset;FI"logical_path;FI"0locomotive/views/theme_assets/index_view.js;TI" pathname;FI"‹/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.2.3/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-10T12:39:17+02:00;FI" length;FifI" digest;F"%47df2c81ccab6a889e77f4c175735e1dI" source;FI"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;F"%de14462c71762f5b689f8fa0de1c74efI"required_paths;F[I"‹/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.2.3/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;TI"dependency_paths;F[{I" path;FI"‹/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.2.3/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;TI" mtime;FI"2013-10-10T12:39:17+02:00;FI" digest;F"%498ff5145c7c9c3a94fe36fd31e5e853I" _version;F"%ffd318ca8b794f42f5029101c2cf5d91