X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FAutocomplete%2FAutocompletePlugin.php;h=0d3fdfc91dceab86f73c52ff39bddd96aef8021a;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=ca495f79f4a8db1fa11e6b18bc2cb80d332dd2c1;hpb=061c8d959ba8351b145a27690d5a4caa477915ca;p=quix0rs-gnu-social.git diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index ca495f79f4..0d3fdfc91d 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -39,45 +39,28 @@ class AutocompletePlugin extends Plugin parent::__construct(); } - function onAutoload($cls) - { - switch ($cls) - { - case 'AutocompleteAction': - require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php'); - return false; - } - } - - function onEndShowScripts($action){ + function onEndShowScripts(Action $action){ if (common_logged_in()) { - $action->script($this->path('jquery-autocomplete/jquery.autocomplete.pack.js')); - $action->script($this->path('Autocomplete.js')); + $action->element('span', array('id' => 'autocomplete-api', + 'data-url' => common_local_url('autocomplete'))); + $action->script($this->path('js/autocomplete.go.js')); } } - function onEndShowStatusNetStyles($action) + function onRouterInitialized(URLMapper $m) { - if (common_logged_in()) { - $action->cssLink($this->path('jquery-autocomplete/jquery.autocomplete.css')); - } - } - - function onRouterInitialized($m) - { - if (common_logged_in()) { - $m->connect('main/autocomplete/suggest', array('action'=>'autocomplete')); - } + $m->connect('main/autocomplete/suggest', array('action'=>'autocomplete')); } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'Autocomplete', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Craig Andrews', 'homepage' => 'http://status.net/wiki/Plugin:Autocomplete', 'rawdescription' => - _m('The autocomplete plugin allows users to autocomplete screen names in @ replies. When an "@" is typed into the notice text area, an autocomplete box is displayed populated with the user\'s friend\' screen names.')); + // TRANS: Plugin description. + _m('The autocomplete plugin adds autocompletion for @ replies.')); return true; } }