diff --git a/plugins/Autocomplete/Autocomplete.js b/plugins/Autocomplete/Autocomplete.js new file mode 100644 index 0000000000..759ed60ae9 --- /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; + } + }); + } + ); +}); diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php new file mode 100644 index 0000000000..ddb0dea329 --- /dev/null +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -0,0 +1,58 @@ +. + * + * @category Plugin + * @package Laconica + * @author Craig Andrews + * @copyright 2009 Craig Andrews http://candrews.integralblue.com + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +class AutocompletePlugin extends Plugin +{ + function __construct() + { + parent::__construct(); + } + + function onEndShowScripts($action){ + $js_string = << +var current_user = { screen_name: 'CANDREWS', id: '1' }; + +EOT; + $action->raw($js_string); + $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); + $action->script('plugins/Autocomplete/Autocomplete.js'); + } + + function onEndShowLaconicaStyles($action) + { + $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css'); + } + +} +?> diff --git a/plugins/Autocomplete/jquery-autocomplete/changelog.txt b/plugins/Autocomplete/jquery-autocomplete/changelog.txt new file mode 100644 index 0000000000..94cb5ccde7 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/changelog.txt @@ -0,0 +1,20 @@ +1.0.2 +----- +* Fixed missing semicolon + +1.0.1 +----- +* Fixed element creation (