summaryrefslogtreecommitdiff
path: root/plugins/Autocomplete/Autocomplete.js
blob: 759ed60ae9c4f6592767542e9e027c3f179970b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$(document).ready(function(){
    $.getJSON($('address .url')[0].href+'/api/statuses/friends.json?user_id=' + current_user['id'] + '&lite=true&callback=?',
        function(friends){
            $('#notice_data-text').autocomplete(friends, {
                multiple: true,
                multipleSeparator: " ",
                formatItem: function(row, i, max){
                    return '@' + row.screen_name + ' (' + row.name + ')';
                },
                formatMatch: function(row, i, max){
                    return '@' + row.screen_name;
                },
                formatResult: function(row){
                    return '@' + row.screen_name;
                }
            });
        }
    );
});