This commit is contained in:
Brion Vibber 2010-12-06 17:16:47 -08:00
parent febcf7258c
commit 6662141328

View File

@ -6,33 +6,33 @@ $(document).ready(function(){
return row.nickname; return row.nickname;
} }
} }
$('#notice_data-text').autocomplete($('address .url')[0].href+'main/autocomplete/suggest', { $('#notice_data-text').autocomplete($('address .url')[0].href+'main/autocomplete/suggest', {
multiple: true, multiple: true,
multipleSeparator: " ", multipleSeparator: " ",
minChars: 1, minChars: 1,
formatItem: function(row, i, max){ formatItem: function(row, i, max){
row = eval("(" + row + ")"); row = eval("(" + row + ")");
// the display:inline is because our INSANE stylesheets // the display:inline is because our INSANE stylesheets
// override the standard display of all img tags for no // override the standard display of all img tags for no
// good reason. // good reason.
var div = $('<div><img style="display:inline; vertical-align: middle"> <span></span></div>') var div = $('<div><img style="display:inline; vertical-align: middle"> <span></span></div>')
.find('img').attr('src', row.avatar).end() .find('img').attr('src', row.avatar).end()
.find('span').text(fullName(row)).end() .find('span').text(fullName(row)).end()
return div.html(); return div.html();
}, },
formatMatch: function(row, i, max){ formatMatch: function(row, i, max){
row = eval("(" + row + ")"); row = eval("(" + row + ")");
return row.nickname; return row.nickname;
}, },
formatResult: function(row){ formatResult: function(row){
row = eval("(" + row + ")"); row = eval("(" + row + ")");
switch(row.type) switch(row.type)
{ {
case 'user': case 'user':
return '@' + row.nickname; return '@' + row.nickname;
case 'group': case 'group':
return '!' + row.nickname; return '!' + row.nickname;
} }
} }
}); });
}); });