o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1416672648.080825: @value"û{I" class:ETI"ProcessedAsset;FI"logical_path;TI"0locomotive/views/theme_assets/index_view.js;FI" pathname;TI"›/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-11-22T16:47:36+01:00;TI" length;TiÏI" digest;TI"%28ca09e1be5fc402b24a51243c067f5a;FI" source;TI"Ï(function() { var _base, __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() { return IndexView.__super__.constructor.apply(this, arguments); } 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; 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(_this) { return 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 } }); }); }; })(this)); }; 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; 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(_this) { return function(view) { return view.options.type === type; }; })(this)); }; IndexView.prototype.remove = function() { _.each(this._lists_views, (function(_this) { return function(view) { return view.remove(); }; })(this)); return IndexView.__super__.remove.apply(this, arguments); }; return IndexView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%2449ace4349e96e6a4d8aad816f760e1;FI"required_paths;T[I"›/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;FI"dependency_paths;T[{I" path;TI"›/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee;FI" mtime;TI"2014-11-22T16:47:36+01:00;TI" digest;TI"%498ff5145c7c9c3a94fe36fd31e5e853;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F