nodebb-plugin-web-push 0.7.3 → 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/eslint.config.mjs +10 -0
- package/package.json +11 -7
- package/public/lib/main.js +1 -1
- package/public/lib/settings.js +5 -3
- package/static/web-push.js +0 -2
- package/templates/account/web-push.tpl +1 -1
- package/.eslintrc +0 -3
- package/public/lib/.eslintrc +0 -3
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
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": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/nodebb/nodebb-plugin-web-push"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"lint": "eslint ."
|
|
13
|
+
},
|
|
10
14
|
"keywords": [
|
|
11
15
|
"nodebb",
|
|
12
16
|
"plugin",
|
|
@@ -34,13 +38,13 @@
|
|
|
34
38
|
"compatibility": "^4.0.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "19.
|
|
38
|
-
"@commitlint/config-angular": "19.
|
|
39
|
-
"eslint": "
|
|
40
|
-
"eslint-config-nodebb": "
|
|
41
|
-
"eslint-plugin-import": "2.
|
|
41
|
+
"@commitlint/cli": "19.8.1",
|
|
42
|
+
"@commitlint/config-angular": "19.8.1",
|
|
43
|
+
"eslint": "^9.25.1",
|
|
44
|
+
"eslint-config-nodebb": "^1.1.4",
|
|
45
|
+
"eslint-plugin-import": "^2.31.0",
|
|
42
46
|
"husky": "9.1.7",
|
|
43
|
-
"lint-staged": "
|
|
47
|
+
"lint-staged": "16.1.2"
|
|
44
48
|
},
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"validator": "^13.12.0",
|
package/public/lib/main.js
CHANGED
package/public/lib/settings.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/* eslint-disable import/no-unresolved */
|
|
2
1
|
|
|
3
2
|
'use strict';
|
|
4
3
|
|
|
5
4
|
import { post, del } from 'api';
|
|
6
5
|
import { success, warning } from 'alerts';
|
|
7
6
|
|
|
8
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
9
7
|
export async function init() {
|
|
10
|
-
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
|
+
}
|
|
11
13
|
const registration = await navigator.serviceWorker.ready;
|
|
12
14
|
let subscription = await registration.pushManager.getSubscription();
|
|
13
15
|
const convertedVapidKey = urlBase64ToUint8Array(config['web-push'].vapidKey);
|
package/static/web-push.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
1
|
|
|
3
2
|
'use strict';
|
|
4
3
|
|
|
@@ -39,7 +38,6 @@ self.addEventListener('notificationclick', (event) => {
|
|
|
39
38
|
self.clients
|
|
40
39
|
.matchAll({ type: 'window' })
|
|
41
40
|
.then((clientList) => {
|
|
42
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
43
41
|
for (const client of clientList) {
|
|
44
42
|
const { hostname } = new URL(client.url);
|
|
45
43
|
if (target && hostname === target.hostname && 'focus' in client) {
|
|
@@ -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>
|
package/.eslintrc
DELETED
package/public/lib/.eslintrc
DELETED