-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
extend.php
42 lines (34 loc) · 1.71 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
<?php
/*
* This file is part of datlechin/flarum-link-preview.
*
* Copyright (c) 2022 Ngo Quoc Dat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Datlechin\LinkPreview;
use Datlechin\LinkPreview\Api\Controllers\ScrapperController;
use Flarum\Extend;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/less/forum.less'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/locale'),
(new Extend\Routes('api'))
->get('/datlechin-link-preview', 'datlechin-link-preview', ScrapperController::class),
(new Extend\Settings())
->default('datlechin-link-preview.blacklist', '')
->default('datlechin-link-preview.whitelist', '')
->default('datlechin-link-preview.use_google_favicons', false)
->default('datlechin-link-preview.convert_media_urls', false)
->default('datlechin-link-preview.cache_time', 60)
->default('datlechin-link-preview.open_links_in_new_tab', true)
->serializeToForum('datlechin-link-preview.blacklist', 'datlechin-link-preview.blacklist')
->serializeToForum('datlechin-link-preview.whitelist', 'datlechin-link-preview.whitelist')
->serializeToForum('datlechin-link-preview.useGoogleFavicons', 'datlechin-link-preview.use_google_favicons', 'boolval')
->serializeToForum('datlechin-link-preview.convertMediaURLs', 'datlechin-link-preview.convert_media_urls', 'boolval')
->serializeToForum('datlechin-link-preview.openLinksInNewTab', 'datlechin-link-preview.open_links_in_new_tab', 'boolval'),
];