2009-08-06 19:39:59 +01:00
|
|
|
$(document).ready(function(){
|
2009-09-14 02:44:17 +01:00
|
|
|
$('#notice_data-text').autocomplete($('address .url')[0].href+'/plugins/Autocomplete/autocomplete.json', {
|
2009-08-06 19:39:59 +01:00
|
|
|
multiple: true,
|
|
|
|
multipleSeparator: " ",
|
2009-08-07 23:00:04 +01:00
|
|
|
minChars: 1,
|
2009-08-06 19:39:59 +01:00
|
|
|
formatItem: function(row, i, max){
|
2009-09-14 02:44:17 +01:00
|
|
|
row = eval("(" + row + ")");
|
|
|
|
switch(row.type)
|
|
|
|
{
|
|
|
|
case 'user':
|
|
|
|
return row.nickname + ' (' + row.fullname + ')';
|
|
|
|
case 'group':
|
|
|
|
return row.nickname + ' (' + row.fullname + ')';
|
|
|
|
}
|
2009-08-06 19:39:59 +01:00
|
|
|
},
|
|
|
|
formatMatch: function(row, i, max){
|
2009-09-14 02:44:17 +01:00
|
|
|
row = eval("(" + row + ")");
|
|
|
|
switch(row.type)
|
|
|
|
{
|
|
|
|
case 'user':
|
|
|
|
return row.nickname;
|
|
|
|
case 'group':
|
|
|
|
return row.nickname;
|
|
|
|
}
|
2009-08-06 19:39:59 +01:00
|
|
|
},
|
|
|
|
formatResult: function(row){
|
2009-09-14 02:44:17 +01:00
|
|
|
row = eval("(" + row + ")");
|
|
|
|
switch(row.type)
|
|
|
|
{
|
|
|
|
case 'user':
|
|
|
|
return '@' + row.nickname;
|
|
|
|
case 'group':
|
|
|
|
return '!' + row.nickname;
|
|
|
|
}
|
2009-08-06 19:39:59 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|