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