3 var origInit = SN.Init.NoticeFormSetup;
4 SN.Init.NoticeFormSetup = function(form) {
7 // Only attach to traditional-style forms
8 var textarea = form.find('.notice_data-text:first');
9 if (textarea.length == 0) {
13 function fullName(row) {
14 if (typeof row.fullname == "string" && row.fullname != '') {
15 return row.nickname + ' (' + row.fullname + ')';
21 var apiUrl = $('#autocomplete-api').attr('data-url');
22 textarea.autocomplete(apiUrl, {
24 multipleSeparator: " ",
26 formatItem: function(row, i, max){
27 row = eval("(" + row + ")");
28 // the display:inline is because our INSANE stylesheets
29 // override the standard display of all img tags for no
31 var div = $('<div><img style="display:inline; vertical-align: middle"> <span></span></div>')
32 .find('img').attr('src', row.avatar).end()
33 .find('span').text(fullName(row)).end()
36 formatMatch: function(row, i, max){
37 row = eval("(" + row + ")");
40 formatResult: function(row){
41 row = eval("(" + row + ")");
45 return '@' + row.nickname;
47 return '!' + row.nickname;