summaryrefslogtreecommitdiff
path: root/plugins/Autocomplete
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-07 18:00:04 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-07 18:00:04 -0400
commit11086c78239a30dc47622837a2800d899ebf9b0f (patch)
tree94e5f2a8bff5d20008731aa293753cc24a6dcc7d /plugins/Autocomplete
parent63cedb7c31078d018069640a1a4b00d9de45e89c (diff)
Implemented the list_all and list groups API methods as defined at http://laconi.ca/trac/wiki/ProposedGroupsAPI
Made the Autocomplete plugin also autocomplete groups
Diffstat (limited to 'plugins/Autocomplete')
-rw-r--r--plugins/Autocomplete/Autocomplete.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/Autocomplete/Autocomplete.js b/plugins/Autocomplete/Autocomplete.js
index 759ed60ae..e799c11e5 100644
--- a/plugins/Autocomplete/Autocomplete.js
+++ b/plugins/Autocomplete/Autocomplete.js
@@ -4,6 +4,7 @@ $(document).ready(function(){
$('#notice_data-text').autocomplete(friends, {
multiple: true,
multipleSeparator: " ",
+ minChars: 1,
formatItem: function(row, i, max){
return '@' + row.screen_name + ' (' + row.name + ')';
},
@@ -16,4 +17,22 @@ $(document).ready(function(){
});
}
);
+ $.getJSON($('address .url')[0].href+'/api/laconica/groups/list.json?user_id=' + current_user['id'] + '&callback=?',
+ function(groups){
+ $('#notice_data-text').autocomplete(groups, {
+ multiple: true,
+ multipleSeparator: " ",
+ minChars: 1,
+ formatItem: function(row, i, max){
+ return '!' + row.nickname + ' (' + row.fullname + ')';
+ },
+ formatMatch: function(row, i, max){
+ return '!' + row.nickname;
+ },
+ formatResult: function(row){
+ return '!' + row.nickname;
+ }
+ });
+ }
+ );
});