]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Autocomplete/Autocomplete.js
Merge branch '0.8.x' into testing
[quix0rs-gnu-social.git] / plugins / Autocomplete / Autocomplete.js
1 $(document).ready(function(){
2     $.getJSON($('address .url')[0].href+'/api/statuses/friends.json?user_id=' + current_user['id'] + '&lite=true&callback=?',
3         function(friends){
4             $('#notice_data-text').autocomplete(friends, {
5                 multiple: true,
6                 multipleSeparator: " ",
7                 minChars: 1,
8                 formatItem: function(row, i, max){
9                     return '@' + row.screen_name + ' (' + row.name + ')';
10                 },
11                 formatMatch: function(row, i, max){
12                     return '@' + row.screen_name;
13                 },
14                 formatResult: function(row){
15                     return '@' + row.screen_name;
16                 }
17             });
18         }
19     );
20     $.getJSON($('address .url')[0].href+'/api/laconica/groups/list.json?user_id=' + current_user['id'] + '&callback=?',
21         function(groups){
22             $('#notice_data-text').autocomplete(groups, {
23                 multiple: true,
24                 multipleSeparator: " ",
25                 minChars: 1,
26                 formatItem: function(row, i, max){
27                     return '!' + row.nickname + ' (' + row.fullname + ')';
28                 },
29                 formatMatch: function(row, i, max){
30                     return '!' + row.nickname;
31                 },
32                 formatResult: function(row){
33                     return '!' + row.nickname;
34                 }
35             });
36         }
37     );
38 });