o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1337347475.235085:@value"ø {I" class:EFI"ProcessedAsset; FI"logical_path; F"9ems/active_admin/components/jquery.aa.tagcomplete.jsI" pathname; F"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.tagcomplete.js.coffeeI"content_type; FI"application/javascript; FI" mtime; FI"2012-05-18T14:12:51+01:00; FI"length; Fi' I"digest; F"%a9a4c63338d0edd95f20d0dd256b80b8I"source; FI"' (function() { window.TagComplete = (function() { function TagComplete(options, el) { var defaults; this.options = options; defaults = {}; this.options = $.extend({}, defaults, options); this.el = $(el); this.hiddenEl = $("#article_tag_ids"); console.log(this.el.data('tagcomplete_pills'), this.el.data()); this.pills = $(this.el.data('tagcomplete_pills')); this._init(); this._bind(); } TagComplete.prototype._init = function() { var self, url; self = this; url = this.el.data('tagcomplete'); this.el.autocomplete({ minLength: 2, source: function(request, response) { var send; send = { "filters[like]": request.term }; return $.getJSON(url, send, function(data, status, xhr) { return response(data); }); }, focus: function(event, ui) { return false; }, select: function(event, ui) { if (!$("#tag-list-" + ui.item.id).length) { self._add(ui.item.title, ui.item.id); } return false; }, appendTo: this.el.parent() }); return this._customList(); }; TagComplete.prototype._bind = function() { var _this = this; return this.pills.on("click", ".close", function(e, el) { _this._remove($(e.target).parent().attr('id').replace('tag-list-', '')); return e.preventDefault(); }); }; TagComplete.prototype._customList = function() { return this.el.data("autocomplete")._renderItem = function(ul, item) { return $("
").data("item.autocomplete", item).append("" + item.title + "").appendTo(ul); }; }; TagComplete.prototype._add = function(title, id) { this.hiddenEl.find("[value=" + id + "]").attr('selected', 'selected'); return this._addToList(title, id); }; TagComplete.prototype._remove = function(id) { this.hiddenEl.find("[value=" + id + "]").removeAttr('selected'); return this._removeFromList(id); }; TagComplete.prototype._addToList = function(title, id) { return $("").append("" + title + " ×").appendTo('#tag-list'); }; TagComplete.prototype._removeFromList = function(id) { return $("#tag-list-" + id).remove(); }; return TagComplete; })(); (function($) { return $.widget.bridge('tagComplete', window.TagComplete); })(jQuery); }).call(this); ; TI"dependency_digest; F"%69b4df64679644e0f3629b60a2e093faI"required_paths; F["‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.tagcomplete.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.tagcomplete.js.coffeeI" mtime; FI"2012-05-18T14:12:51+01:00; FI"digest; F"%9db05c6b06608b50c4b02644c9d6728bI" _version; F"%9f3b95dd7ea3030dc35985c0a8020862