{I" class:ETI"ProcessedAsset;FI"logical_path;TI"curate/proxy_rights.js;FI" pathname;TI"]/Users/jfriesen/Repositories/curate/app/assets/javascripts/curate/proxy_rights.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+†¾ëRI" length;Tiä I" digest;TI"%b63dccbab9a43e98ccafea362be7a36b;FI" source;TI"ä (function() { (function($, window, document) { var $this, methods, _internals, _settings; $this = void 0; _settings = { "default": 'cool!' }; methods = { init: function(options) { $this = $(this); $.extend(_settings, options || {}); $this.each(function(index, el) { $('#user').each(function(index, el) { return _internals.autocompleteUsers(el); }); return $(el).on('click', '.remove-proxy-button', _internals.removeContributor); }); return $this; }, destroy: function() { return $this; } }; _internals = { addContributor: function(name, id) { var row, source, template; source = $("#tmpl-proxy-row").html(); template = Handlebars.compile(source); row = template({ name: name, id: id }); $('#authorizedProxies tbody', $this).append(row); $.ajax({ type: "POST", url: 'depositors', dataType: 'json', data: { grantee_id: id } }); return false; }, removeContributor: function() { $.ajax({ url: $(this).closest('a').prop('href'), type: "post", dataType: "json", data: { "_method": "delete" } }); $(this).closest('tr').remove(); return false; }, autocompleteUsers: function(el) { var $targetElement; $targetElement = $(el); return $targetElement.autocomplete({ source: function(request, response) { $targetElement.data('url'); return $.getJSON($targetElement.data('url'), { q: request.term, user: true }, function(data, status, xhr) { var matches; matches = []; $.each(data.response.docs, function(idx, val) { return matches.push({ label: val['desc_metadata__name_tesim'][0], value: val['id'] }); }); return response(matches); }); }, minLength: 2, focus: function(event, ui) { $targetElement.val(ui.item.label); return event.preventDefault(); }, select: function(event, ui) { _internals.addContributor(ui.item.label, ui.item.value); $targetElement.val(''); return event.preventDefault(); } }); } }; return $.fn.proxyRights = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === "object" || !method) { return methods.init.apply(this, arguments); } else { return $.error("Method " + method + " does not exist on jquery.proxyRights"); } }; })(jQuery, window, document); }).call(this); ;TI"dependency_digest;TI"%75adcfad4dab008a14745cfbb09bdbac;FI"required_paths;T[I"]/Users/jfriesen/Repositories/curate/app/assets/javascripts/curate/proxy_rights.js.coffee;FI"dependency_paths;T[{I" path;TI"]/Users/jfriesen/Repositories/curate/app/assets/javascripts/curate/proxy_rights.js.coffee;FI" mtime;TI"2014-01-31T10:17:26-05:00;TI" digest;TI"%36ded9ec412c875e71013c210e9295d7;FI" _version;TI"%1005ed9f20e25fb0a0599a7017dd0e6b;F