]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Autocomplete/AutocompletePlugin.php
[ROUTES] Allow accept-header specification during router creation
[quix0rs-gnu-social.git] / plugins / Autocomplete / AutocompletePlugin.php
index 1479ead602995935018cdbaa7093ccc4aa7bf670..1a9252d5a5b05d75be3a89aaea8782bacf026a73 100644 (file)
@@ -34,52 +34,35 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
 
 class AutocompletePlugin extends Plugin
 {
+    const PLUGIN_VERSION = '2.0.0';
     function __construct()
     {
         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->element('span', array('id' => 'autocomplete-api',
                                            'data-url' => common_local_url('autocomplete')));
-            $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->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',
+                    ['action' => 'autocomplete']);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Autocomplete',
-                            'version' => STATUSNET_VERSION,
+                            'version' => self::PLUGIN_VERSION,
                             'author' => 'Craig Andrews',
-                            'homepage' => 'http://status.net/wiki/Plugin:Autocomplete',
+                            'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/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;
     }
 }