-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
elgg-plugin.php
73 lines (70 loc) · 1.59 KB
/
elgg-plugin.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
71
72
73
<?php
use ColdTrick\PWA\Bootstrap;
$composer_path = '';
if (is_dir(__DIR__ . '/vendor')) {
$composer_path = __DIR__ . '/';
}
return [
'plugin' => [
'version' => '5.0',
'name' => 'Progressive Web App',
],
'bootstrap' => Bootstrap::class,
'settings' => [
'background_color' => '#fafafa',
'display_mode' => 'standalone',
'theme_color' => '#0078ac',
'installable' => 'default',
'use_cached_service_worker' => false,
],
'routes' => [
'offline.html' => [
'path' => '/offline.html',
'resource' => 'pwa/offline.html',
'walled' => false,
],
'service-worker' => [
'path' => '/service-worker',
'controller' => '\ColdTrick\PWA\Controllers\ServiceWorker',
'walled' => false,
],
],
'events' => [
'action:validate' => [
'plugins/settings/save' => [
'\ColdTrick\PWA\PluginSettings::actionValidation' => [],
],
],
'entity:pwa:sizes' => [
'object' => [
'\ColdTrick\PWA\Icons::getPWASizes' => [],
],
],
'head' => [
'page' => [
'\ColdTrick\PWA\Head::addMetaHeaders' => [],
],
],
'register' => [
'menu:footer' => [
'\ColdTrick\PWA\Menus\Footer::registerInstall' => [],
],
],
],
'views' => [
'default' => [
'pwa/upup/upup.js' => $composer_path . 'vendor/npm-asset/upup/src/upup.js',
],
],
'view_extensions' => [
'pwa/upup/upup.js' => [
'pwa/upup.config.js' => [],
],
],
'view_options' => [
'page/elements/offline.css' => ['simplecache' => true],
'pwa/installable.mjs' => ['simplecache' => true],
'pwa/upup/upup.sw.js' => ['simplecache' => true],
'resources/pwa/offline.html' => ['simplecache' => true],
],
];