o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1337588134.4508889: @value"†{I" class:EFI"ProcessedAsset;FI"logical_path;F"9ems/active_admin/components/jquery.aa.asset-store.jsI" pathname;F"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.asset-store.js.coffeeI"content_type;FI"application/javascript;FI" mtime;FI"2012-05-21T08:59:08+01:00;FI" length;Fiµ I" digest;F"%45f91aa32e7801cc3e13b6f6528098feI" source;FI"µ (function() { window.AssetStore = (function() { function AssetStore(options, el) { var defaults; this.options = options; defaults = {}; this.options = $.extend({}, defaults, options); this.el = $(el); this.items = this.el.find('.asset-item'); this._init(); } AssetStore.prototype._init = function() { this._initDel(); return this._initText(); }; AssetStore.prototype._initText = function() { var _this = this; return this.items.on('dblclick', '.asset-text', function(e) { return _this._editText($(e.target)); }); }; AssetStore.prototype._initDel = function() { var suffix, _this = this; suffix = "_destroy"; return this.items.each(function(i, el) { var $el, hid, name; $el = $(el); hid = $el.find('.asset-id-hidden').clone().val(1).attr("class", "asset-destroy-hidden"); if (!hid.length) { return false; } name = hid.attr('name').split('['); name.splice(-2, 1); name[name.length] = suffix + "]"; $el.data('assetstore-delete', hid.attr({ 'name': name.join('[') })); return _this._bindCheck($el); }); }; AssetStore.prototype._bindCheck = function($el) { var _this = this; return $el.on('change', '.asset-check', function(e) { if ($(e.target).is(':checked')) { return _this._keep($el); } else { return _this._delete($el); } }); }; AssetStore.prototype._delete = function($el) { var delEl; console.log("DELETE"); delEl = $el.data().assetstoreDelete; return $el.append(delEl); }; AssetStore.prototype._keep = function($el) { console.log("UN-DELETE"); return $('#' + $el.data().assetstoreDelete.attr('id')).remove(); }; AssetStore.prototype._editText = function($el) { var input, _this = this; input = $(""); $el.hide().after(input); input.focus(); return input.bind('keydown', function(e) { if (e.keyCode === 13) { e.preventDefault(); _this._changeText($el, input.val()); $el.show(); return input.remove(); } }); }; AssetStore.prototype._changeText = function($el, text) { $el.text(text).closest('.asset').find('.asset-title-hidden').val(text); return console.log($el, $el.closest('.asset').find('.asset-title-hidden')); }; return AssetStore; })(); (function($) { return $.widget.bridge('assetStore', window.AssetStore); })(jQuery); }).call(this); ;TI"dependency_digest;F"%b08792b260f704070ef3ddd0b7240682I"required_paths;F["‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.asset-store.js.coffeeI"dependency_paths;F[{I" path;F"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.asset-store.js.coffeeI" mtime;FI"2012-05-21T08:59:08+01:00;FI" digest;F"%e0e0e846ed6d07dfd1a79ae17e0803e8I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862