-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend.php
35 lines (26 loc) · 1.15 KB
/
extend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Nearata\EmbedTwitch;
use Flarum\Extend;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Post\Event\Saving as PostSaving;
use Nearata\EmbedTwitch\Api\Serializer\ExtendForumSerializer;
use Nearata\EmbedTwitch\Formatter\AddTwitchBBCode;
use Nearata\EmbedTwitch\Listener\PostSavingListener;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/resources/less/forum.less'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\Formatter)
->configure(AddTwitchBBCode::class),
(new Extend\Settings())
->serializeToForum('darkMode', 'theme_dark_mode', 'boolval')
->serializeToForum('embedTwitchAllowfullscreen', 'nearata-embed-twitch.settings.allowfullscreen', 'boolval')
->serializeToForum('embedTwitchAutoplay', 'nearata-embed-twitch.settings.autoplay', 'boolval'),
(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(ExtendForumSerializer::class),
(new Extend\Event)
->listen(PostSaving::class, PostSavingListener::class)
];