hexo-blog-encrypt 3.1.6 → 3.1.8

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.
@@ -8,4 +8,3 @@ Issue Fixed #
8
8
  - _
9
9
  - _
10
10
 
11
- @MikeCoder
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2016 TangDongxin
1
+ Copyright © 2022 D0n9X1n
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the "Software"),
package/ReadMe.md CHANGED
@@ -143,7 +143,16 @@ It will be called after the blog is decrypted.
143
143
  </script>
144
144
  ```
145
145
 
146
- Demo: [Callback Example](https://mhexo.github.io/2019/12/21/CallbackTest/).
146
+ Demo: [Callback Example](https://mhexo.github.io/2020/12/06/Callback-Test/).
147
+
148
+ ### After Decrypt Event
149
+ Thanks to @[f-dong](https://github.com/f-dong), we now will trigger a event named `hexo-blog-decrypt`, so you can add a call back to listen to that event.
150
+
151
+ ```
152
+ // trigger event
153
+ var event = new Event('hexo-blog-decrypt');
154
+ window.dispatchEvent(event);
155
+ ```
147
156
 
148
157
  ### Encrypt TOC
149
158
 
package/ReadMe.zh.md CHANGED
@@ -149,7 +149,16 @@ It will be called after the blog decrypted.
149
149
  </script>
150
150
  ```
151
151
 
152
- 例子在: [Callback 例子](https://mhexo.github.io/2019/12/21/CallbackTest/).
152
+ 例子在: [Callback 例子](https://mhexo.github.io/2020/12/06/Callback-Test/).
153
+
154
+ ### 解密后的触发事件
155
+ 感谢 @[f-dong](https://github.com/f-dong), 我们现在会在解密完成后触发一个 `hexo-blog-decrypt` 事件, 你们可以编写 callback 来监听该事件.
156
+
157
+ ```
158
+ // trigger event
159
+ var event = new Event('hexo-blog-decrypt');
160
+ window.dispatchEvent(event);
161
+ ```
153
162
 
154
163
  ### 对 TOC 进行加密
155
164
 
package/lib/hbe.js CHANGED
@@ -216,6 +216,10 @@ const knownPrefix = "<hbe-prefix></hbe-prefix>";
216
216
  tocDivs[idx].style.display = 'inline';
217
217
  }
218
218
  }
219
+
220
+ // trigger event
221
+ var event = new Event('hexo-blog-decrypt');
222
+ window.dispatchEvent(event);
219
223
 
220
224
  return await verifyContent(hmacKey, decoded);
221
225
  }).catch((e) => {
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "test": "echo \"Error: no test specified\" && exit 1",
30
30
  "lint": "eslint --ext .js ./"
31
31
  },
32
- "version": "3.1.6",
32
+ "version": "3.1.8",
33
33
  "devDependencies": {
34
34
  "eslint": "^6.2.2"
35
35
  }