nodebb-plugin-web-push 0.7.4 → 0.7.6

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.4",
3
+ "version": "0.7.6",
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.0",
42
- "@commitlint/config-angular": "19.8.0",
41
+ "@commitlint/cli": "20.1.0",
42
+ "@commitlint/config-angular": "20.0.0",
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": "15.5.1"
47
+ "lint-staged": "16.2.6"
48
48
  },
49
49
  "dependencies": {
50
50
  "validator": "^13.12.0",
@@ -0,0 +1,11 @@
1
+ {
2
+ "profile.label": "网站通知",
3
+ "profile.introduction": "除了论坛内通知和电子邮件通知外,您还可以选择接收网站通知。这样,即使论坛未在设备上打开,您也能收到通知。",
4
+ "profile.option": "在此设备上启用网站通知",
5
+ "profile.devices": "目前正在通知 <strong>%1</strong> 台设备。",
6
+ "profile.permissionBlocked": "您的设备目前不允许接收来自本网站的通知。请授予通知权限以继续。",
7
+ "profile.send-test": "发送测试通知",
8
+
9
+ "toast.test_success": "测试通知已发送。",
10
+ "toast.test_unavailable": "由于此设备未启用推送通知,因此无法发送测试通知。"
11
+ }
@@ -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('.account');
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>