o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338216582.376895: @value" {I" class:EFI"ProcessedAsset;FI"logical_path;FI"9ems/active_admin/components/jquery.aa.tagcomplete.js;FI" pathname;FI"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.tagcomplete.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-05-18T14:12:51+01:00;FI" length;Fi' I" digest;F"%4a4c00a0f5e3c6ceddd33727974337b1I" 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"%610b76a69f4225fd1c6c67f773f2427fI"required_paths;F[I"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.tagcomplete.js.coffee;FI"dependency_paths;F[{I" path;FI"‡/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/active_admin/components/jquery.aa.tagcomplete.js.coffee;FI" mtime;FI"2012-05-18T14:12:51+01:00;FI" digest;F"%67f3892cc47bffe850e3c92706742304I" _version;F"%7270767b2a9e9fff880aa5de378ca791