Mercurial > bugzilla-dashboard
view js/find-user.js @ 26:f9b1d429f9ab
Added a user-finder.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Thu, 11 Mar 2010 04:26:11 -0800 |
parents | |
children | c631a02f9f63 |
line wrap: on
line source
$(window).ready( function() { var currReq; var options = { minLength: 2, source: function(request, response) { function success(result) { var suggs = []; result.users.forEach( function(user) { suggs.push(user.real_name + " (" + user.name + ")"); }); response(suggs); } currReq = Bugzilla.ajax({url: "/user", data: {match: request.term, username: $("#username").val(), password: $("#password").val()}, success: success}); } }; $("input#query").autocomplete(options); });