Link: http://flarum.org/docs/extend/start
The alert does not show...
Bootstrap.php (Path: /)
<?php
use Flagrow\RTL\Listener;
use Illuminate\Contracts\Events\Dispatcher;
return function (Dispatcher $events) {
$events->subscribe(Listener\ChangeDirection::class);
};
ChangeDirection.php (Path: /src/Listener)
<?php
namespace Flagrow\RTL\Listener;
use Flarum\Event\ConfigureClientView;
use Illuminate\Contracts\Events\Dispatcher;
class ChangeDirection
{
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureClientView::class, [$this, 'addAssets']);
}
public function addAssets(ConfigureClientView $event)
{
if ($event->isForum()) {
$event->addAssets(__DIR__ . '/../../js/forum/dist/extension.js');
$event->addBootstrapper('hazanpro/flarum-ext-rtl/main');
}
}
}
extension.js (Path: /js/forum/dist)
System.register('hazanpro/forum-ext-rtl/main', [], function (_export) {
'use strict';
return {
setters: [],
execute: function () {
app.initializers.add('hazanpro-flarum-ext-rtl', function () {
alert('Hello, world!');
});
}
};
});
Someone know why?