X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FAutocomplete%2FAutocompletePlugin.php;h=ff56b60fc463cb210f1c4e83f90cf0cc440e2106;hb=703443f152823584f035627a9b850cfcaef9228a;hp=ca495f79f4a8db1fa11e6b18bc2cb80d332dd2c1;hpb=91485718c4a07e217f41d395d7e7cf057875e751;p=quix0rs-gnu-social.git diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index ca495f79f4..ff56b60fc4 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){ if (common_logged_in()) { - $action->script($this->path('jquery-autocomplete/jquery.autocomplete.pack.js')); - $action->script($this->path('Autocomplete.js')); - } - } - - function onEndShowStatusNetStyles($action) - { - if (common_logged_in()) { - $action->cssLink($this->path('jquery-autocomplete/jquery.autocomplete.css')); + $action->element('span', array('id' => 'autocomplete-api', + 'data-url' => common_local_url('autocomplete'))); + $action->script($this->path('js/autocomplete.go.js')); } } 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) { $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; } }