-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextend.php
70 lines (60 loc) · 3.1 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/*
* This file is part of club-1/flarum-ext-server-side-highlight.
*
* Copyright (c) 2023 Nicolas Peugnet <nicolas@club1.fr>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
use Club1\ServerSideHighlight\Console\DownloadCommand;
use Club1\ServerSideHighlight\Controller\PreviewController;
use Club1\ServerSideHighlight\Formatter\Configurator;
use Club1\ServerSideHighlight\Formatter\Renderer;
use Club1\ServerSideHighlight\Frontend\Content;
use Club1\ServerSideHighlight\Serializer\HighlightThemeSerializer;
use Flarum\Extend;
return [
(new Extend\Formatter)
->configure(Configurator::class)
->render(Renderer::class),
(new Extend\Frontend('forum'))
->content(Content::class)
->js(__DIR__.'/js/forum.js')
->css(__DIR__.'/css/forum.css'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/admin.js')
->css(__DIR__.'/css/admin.css'),
(new Extend\Routes('api'))
->get('/highlight-preview', 'club-1-server-side-highlight.preview', PreviewController::class),
(new Extend\Settings())
->default('club-1-server-side-highlight.light_theme_bg_color', '#f7f7f7')
->default('club-1-server-side-highlight.light_theme_text_color', '#000000')
->default('club-1-server-side-highlight.light_theme_highlight_theme', 'github')
->default('club-1-server-side-highlight.dark_theme_bg_color', '#0e1115')
->default('club-1-server-side-highlight.dark_theme_text_color', '#ffffff')
->default('club-1-server-side-highlight.dark_theme_highlight_theme', 'github-dark')
->serializeToForum('lightThemeBgColor', 'club-1-server-side-highlight.light_theme_bg_color')
->serializeToForum('lightThemeTextColor', 'club-1-server-side-highlight.light_theme_text_color')
->serializeToForum('lightThemeHighlightTheme', 'club-1-server-side-highlight.light_theme_highlight_theme', HighlightThemeSerializer::class)
->serializeToForum('darkThemeBgColor', 'club-1-server-side-highlight.dark_theme_bg_color')
->serializeToForum('darkThemeTextColor', 'club-1-server-side-highlight.dark_theme_text_color')
->serializeToForum('darkThemeHighlightTheme', 'club-1-server-side-highlight.dark_theme_highlight_theme', HighlightThemeSerializer::class),
(new Extend\Console())
->command(DownloadCommand::class),
(new Extend\View)
->namespace('club-1.server-side-highlight', __DIR__.'/views'),
new Extend\Locales(__DIR__.'/locale'),
];