jekyll-theme-chirpy 5.2.0 → 5.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c81c39e181ad22387edde9225772bc693e4253c6a610023f730c343af2ccdc79
4
- data.tar.gz: dfea7d51da714436d588ede746cf1b65c2030c8b5327555134d8799ced5ea258
3
+ metadata.gz: 07ec420e8199940db60a4b2fb5f9d273cd5a0cd5c5bdcc7b071abf9b1e53d5e9
4
+ data.tar.gz: 9484cb86c473e6f55f64c2db905089c8d2a4bc2dd710115053c87ea64f160cf0
5
5
  SHA512:
6
- metadata.gz: 5d604d1a13948a5ad0c117a47555a073fa50228e3789a7934c567ede94eac30c66ff837673565733b9022fce08df91547f175e6cb9ece9af25a8a1a833542aaf
7
- data.tar.gz: 3c5d9126c604ad8ad0ebfc1b16891fa8d31223ceb6954ee33c34870cbe853c880f65ad0b96627b8b307a026433e654de7a180677d27804ceb62ab961c27d8f86
6
+ metadata.gz: bc7eb42cdb855cf88243105edf51e9a469a0981cbb15fa9212a65205d55916baeb22d83e646251941840bbb4ba78d2cba8def925ceaa3a3c25302a41ce9f5250
7
+ data.tar.gz: 03af5049961e1eddab3b029d54fe0780ac8f466ea7983b538bbe1ae2f508c964535d00ad654313d8dfff387693e8cac30a7e82a5b75ab68cc35c3110b185c956
data/_config.yml CHANGED
@@ -185,6 +185,7 @@ exclude:
185
185
  - '*.gemspec'
186
186
  - tools
187
187
  - README.md
188
+ - CHANGELOG.md
188
189
  - LICENSE
189
190
  - gulpfile.js
190
191
  - node_modules
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * The styles for Jekyll theme Chirpy
3
3
  *
4
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
4
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
5
5
  * © 2019 Cotes Chung
6
6
  * MIT Licensed
7
7
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v5.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
data/assets/js/pwa/app.js CHANGED
@@ -3,50 +3,37 @@ layout: compress
3
3
  permalink: '/app.js'
4
4
  ---
5
5
 
6
- const keyWaiting = 'sw-waiting';
7
6
  const $notification = $('#notification');
8
7
  const $btnRefresh = $('#notification .toast-body>button');
9
8
 
10
- function skipWating(registration) {
11
- registration.waiting.postMessage('SKIP_WAITING');
12
- localStorage.removeItem(keyWaiting);
13
- }
14
-
15
9
  if ('serviceWorker' in navigator) {
16
10
  /* Registering Service Worker */
17
11
  navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}')
18
12
  .then(registration => {
19
- if (registration) {
20
- registration.addEventListener('updatefound', () => {
21
- let serviceWorker = registration.installing;
22
-
23
- serviceWorker.addEventListener('statechange', () => {
24
- if (serviceWorker.state === 'installed') {
25
- if (navigator.serviceWorker.controller) {
26
- $notification.toast('show');
27
- /* in case the user ignores the notification */
28
- localStorage.setItem(keyWaiting, true);
29
- }
30
- }
31
- });
32
- });
33
13
 
34
- $btnRefresh.click(() => {
35
- skipWating(registration);
36
- $notification.toast('hide');
37
- });
14
+ /* in case the user ignores the notification */
15
+ if (registration.waiting) {
16
+ $notification.toast('show');
17
+ }
38
18
 
39
- if (localStorage.getItem(keyWaiting)) {
19
+ registration.addEventListener('updatefound', () => {
20
+ registration.installing.addEventListener('statechange', () => {
40
21
  if (registration.waiting) {
41
- /* there's a new Service Worker waiting to be activated */
42
- $notification.toast('show');
43
- } else {
44
- /* closed all open pages after receiving notification */
45
- localStorage.removeItem(keyWaiting);
22
+ if (navigator.serviceWorker.controller) {
23
+ $notification.toast('show');
24
+ }
46
25
  }
26
+ });
27
+ });
28
+
29
+ $btnRefresh.click(() => {
30
+ if (registration.waiting) {
31
+ registration.waiting.postMessage('SKIP_WAITING');
47
32
  }
48
- }
49
- });
33
+ $notification.toast('hide');
34
+ });
35
+ }
36
+ );
50
37
 
51
38
  let refreshing = false;
52
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-chirpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cotes Chung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll