nodebb-plugin-web-push 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-web-push",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "A starter kit for quickly creating NodeBB plugins",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"compatibility": "^4.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@commitlint/cli": "19.8.
|
|
42
|
-
"@commitlint/config-angular": "19.8.
|
|
41
|
+
"@commitlint/cli": "19.8.1",
|
|
42
|
+
"@commitlint/config-angular": "19.8.1",
|
|
43
43
|
"eslint": "^9.25.1",
|
|
44
44
|
"eslint-config-nodebb": "^1.1.4",
|
|
45
45
|
"eslint-plugin-import": "^2.31.0",
|
|
46
46
|
"husky": "9.1.7",
|
|
47
|
-
"lint-staged": "
|
|
47
|
+
"lint-staged": "16.1.2"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"validator": "^13.12.0",
|
package/public/lib/settings.js
CHANGED
|
@@ -5,7 +5,11 @@ import { post, del } from 'api';
|
|
|
5
5
|
import { success, warning } from 'alerts';
|
|
6
6
|
|
|
7
7
|
export async function init() {
|
|
8
|
-
const containerEl = document.querySelector('
|
|
8
|
+
const containerEl = document.querySelector('[component="web-push-form"]');
|
|
9
|
+
if (!containerEl) {
|
|
10
|
+
console.error('Web Push form container not found');
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
9
13
|
const registration = await navigator.serviceWorker.ready;
|
|
10
14
|
let subscription = await registration.pushManager.getSubscription();
|
|
11
15
|
const convertedVapidKey = urlBase64ToUint8Array(config['web-push'].vapidKey);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div class="alert alert-warning d-none" id="permission-warning">[[web-push:profile.permissionBlocked]]</div>
|
|
8
8
|
|
|
9
|
-
<form role="form">
|
|
9
|
+
<form role="form" component="web-push-form">
|
|
10
10
|
<div class="form-check form-switch mb-3">
|
|
11
11
|
<input type="checkbox" class="form-check-input" id="enabled" name="enabled" autocomplete="off" data-action="toggle">
|
|
12
12
|
<label for="enabled" class="form-check-label">[[web-push:profile.option]]</label>
|