diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-08-06 14:39:59 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-08-06 14:39:59 -0400 |
commit | 153248b48230a342648577480e36224eaee85535 (patch) | |
tree | 960a7c8a5fb96c7391502c64326e41f05bbd70dc /plugins/Autocomplete/Autocomplete.js | |
parent | e386a75d1b5271cfcd51825d0d2a420ef66d3622 (diff) |
Added the Autocomplete plugin
Diffstat (limited to 'plugins/Autocomplete/Autocomplete.js')
-rw-r--r-- | plugins/Autocomplete/Autocomplete.js | 19 |
1 files changed, 19 insertions, 0 deletions
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; + } + }); + } + ); +}); |