mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 10:58:41 +08:00
Adapt new bootstrap format, use Asset extender
This commit is contained in:
parent
b10de3ba92
commit
5cb1fc4627
@ -9,17 +9,22 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Flarum\Extend;
|
||||||
use Flarum\Subscriptions\Listener;
|
use Flarum\Subscriptions\Listener;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
|
||||||
return function (Dispatcher $events, Factory $views) {
|
return [
|
||||||
$events->subscribe(Listener\AddClientAssets::class);
|
(new Extend\Assets('forum'))
|
||||||
$events->subscribe(Listener\AddDiscussionSubscriptionAttribute::class);
|
->defaultAssets(__DIR__)
|
||||||
$events->subscribe(Listener\FilterDiscussionListBySubscription::class);
|
->bootstrapper('flarum/subscriptions/main'),
|
||||||
$events->subscribe(Listener\SaveSubscriptionToDatabase::class);
|
function (Dispatcher $events, Factory $views) {
|
||||||
$events->subscribe(Listener\SendNotificationWhenReplyIsPosted::class);
|
$events->subscribe(Listener\AddDiscussionSubscriptionAttribute::class);
|
||||||
$events->subscribe(Listener\FollowAfterReply::class);
|
$events->subscribe(Listener\FilterDiscussionListBySubscription::class);
|
||||||
|
$events->subscribe(Listener\SaveSubscriptionToDatabase::class);
|
||||||
|
$events->subscribe(Listener\SendNotificationWhenReplyIsPosted::class);
|
||||||
|
$events->subscribe(Listener\FollowAfterReply::class);
|
||||||
|
|
||||||
$views->addNamespace('flarum-subscriptions', __DIR__.'/views');
|
$views->addNamespace('flarum-subscriptions', __DIR__.'/views');
|
||||||
};
|
}
|
||||||
|
];
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Flarum\Subscriptions\Listener;
|
|
||||||
|
|
||||||
use Flarum\Frontend\Event\Rendering;
|
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
|
||||||
|
|
||||||
class AddClientAssets
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @param Dispatcher $events
|
|
||||||
*/
|
|
||||||
public function subscribe(Dispatcher $events)
|
|
||||||
{
|
|
||||||
$events->listen(Rendering::class, [$this, 'addAssets']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Rendering $event
|
|
||||||
*/
|
|
||||||
public function addAssets(Rendering $event)
|
|
||||||
{
|
|
||||||
if ($event->isForum()) {
|
|
||||||
$event->addAssets([
|
|
||||||
__DIR__.'/../../js/forum/dist/extension.js',
|
|
||||||
__DIR__.'/../../less/forum/extension.less'
|
|
||||||
]);
|
|
||||||
$event->addBootstrapper('flarum/subscriptions/main');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user