From 153248b48230a342648577480e36224eaee85535 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 6 Aug 2009 14:39:59 -0400 Subject: Added the Autocomplete plugin --- plugins/Autocomplete/Autocomplete.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/Autocomplete/Autocomplete.js (limited to 'plugins/Autocomplete/Autocomplete.js') diff --git a/plugins/Autocomplete/Autocomplete.js b/plugins/Autocomplete/Autocomplete.js new file mode 100644 index 000000000..759ed60ae --- /dev/null +++ b/plugins/Autocomplete/Autocomplete.js @@ -0,0 +1,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; + } + }); + } + ); +}); -- cgit v1.2.3-54-g00ecf