123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class AutocompletePlugin extends Plugin
- {
- const PLUGIN_VERSION = '2.0.0';
- function __construct()
- {
- parent::__construct();
- }
- function onEndShowScripts($action){
- if (common_logged_in()) {
- $action->element('span', array('id' => 'autocomplete-api',
- 'data-url' => common_local_url('autocomplete')));
- $action->script($this->path('js/autocomplete.go.js'));
- }
- }
- function onRouterInitialized($m)
- {
- $m->connect('main/autocomplete/suggest',
- ['action' => 'autocomplete']);
- }
- public function onPluginVersion(array &$versions): bool
- {
- $versions[] = array('name' => 'Autocomplete',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Craig Andrews',
- 'homepage' => GNUSOCIAL_ENGINE_REPO_URL . 'tree/master/plugins/Autocomplete',
- 'rawdescription' =>
-
- _m('The autocomplete plugin adds autocompletion for @ replies.'));
- return true;
- }
- }
|