ezuikit-js 0.6.6 → 0.7.2
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/demos/EZUIKitHD/EZUIKitHD.html +171 -0
- package/demos/EZUIKitHD/js/jsWebControl-1.0.0.min.js +80 -0
- package/demos/base-demo/base.html +116 -116
- package/demos/base-demo/ezuikit.js +4405 -258
- package/demos/base-demo/ezuikit_static/v65/v1/js/SuperRender_10.js +394 -394
- package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/DecodeWorker.js +617 -617
- package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/JSPlaySDKInterface.js +2052 -2052
- package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/SuperRender_10.js +395 -395
- package/demos/base-demo/ezuikit_static/v65/v1/js/transform/SystemTransform.js +22 -22
- package/demos/base-demo/ezuikit_static/v65/v1/js/tts-v4.js +346 -346
- package/demos/base-demo/ezuikit_static/v65/v1/rec/jquery.min.js +1 -1
- package/demos/base-demo/ezuikit_static/v65/v1/talk/tts-v4.js +346 -346
- package/demos/base-demo/ezuikit_static/v65/v2/rec/jquery.min.js +1 -1
- package/demos/base-demo/ezuikit_static/v65/v2/talk/tts-v4.js +343 -343
- package/demos/base-demo/ezuikit_static/v66/v1/css/theme.css +121 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/AudioRenderer.js +225 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/SuperRender_10.js +395 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/SystemTransform.js +22 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/SystemTransform.js.mem +0 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/jsPluginV1-1.0.0.min.js +26 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/AudioRenderer.js +225 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/DecodeWorker.js +618 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/Decoder.js +1 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/JSPlaySDKInterface.js +2052 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/SuperRender_10.js +396 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/playctrl/SuperRender_20.js +1 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/transform/SystemTransform.js +22 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/transform/SystemTransform.js.mem +0 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/transform/systemTransform-worker.min.js +1 -0
- package/demos/base-demo/ezuikit_static/v66/v1/js/tts-v4.js +346 -0
- package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.js +1522 -0
- package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.min.css +36 -0
- package/demos/base-demo/ezuikit_static/v66/v1/rec/datepicker.zh-CN.js +19 -0
- package/demos/base-demo/ezuikit_static/v66/v1/rec/jquery.min.js +2 -0
- package/demos/base-demo/ezuikit_static/v66/v1/speed/speed.css +144 -0
- package/demos/base-demo/ezuikit_static/v66/v1/talk/adapeter.js +5497 -0
- package/demos/base-demo/ezuikit_static/v66/v1/talk/janus.js +3507 -0
- package/demos/base-demo/ezuikit_static/v66/v1/talk/tts-v4.js +346 -0
- package/demos/base-demo/ezuikit_static/v66/v2/css/theme.css +121 -0
- package/demos/base-demo/ezuikit_static/v66/v2/js/Decoder.js +9198 -0
- package/demos/base-demo/ezuikit_static/v66/v2/js/Decoder.wasm +0 -0
- package/demos/base-demo/ezuikit_static/v66/v2/js/jsPluginV2-2.0.1.min.js +4662 -0
- package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.js +1522 -0
- package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.min.css +36 -0
- package/demos/base-demo/ezuikit_static/v66/v2/rec/datepicker.zh-CN.js +19 -0
- package/demos/base-demo/ezuikit_static/v66/v2/rec/jquery.min.js +2 -0
- package/demos/base-demo/ezuikit_static/v66/v2/speed/speed.css +144 -0
- package/demos/base-demo/ezuikit_static/v66/v2/talk/adapeter.js +5497 -0
- package/demos/base-demo/ezuikit_static/v66/v2/talk/janus.js +3507 -0
- package/demos/base-demo/ezuikit_static/v66/v2/talk/tts-v4.js +343 -0
- package/demos/base-demo/hls.html +23 -23
- package/demos/base-demo/index.html +116 -116
- package/demos/base-demo/localDecoder.html +117 -117
- package/demos/base-demo/mobileLive.html +116 -116
- package/demos/base-demo/mobileRec.html +115 -115
- package/demos/base-demo/multi.html +128 -128
- package/demos/base-demo/pcLive.html +116 -116
- package/demos/base-demo/pcRec.html +115 -115
- package/demos/base-demo/template.html +123 -123
- package/demos/base-demo/themeData.html +231 -231
- package/demos/nginx-demo/conf/fastcgi.conf +26 -26
- package/demos/nginx-demo/conf/fastcgi_params +25 -25
- package/demos/nginx-demo/conf/koi-utf +109 -109
- package/demos/nginx-demo/conf/koi-win +103 -103
- package/demos/nginx-demo/conf/mime.types +95 -95
- package/demos/nginx-demo/conf/nginx.conf +121 -121
- package/demos/nginx-demo/conf/scgi_params +17 -17
- package/demos/nginx-demo/conf/uwsgi_params +17 -17
- package/demos/nginx-demo/conf/win-utf +126 -126
- package/demos/nginx-demo/contrib/README +21 -21
- package/demos/nginx-demo/contrib/geo2nginx.pl +58 -58
- package/demos/nginx-demo/contrib/unicode2nginx/koi-utf +131 -131
- package/demos/nginx-demo/contrib/unicode2nginx/unicode-to-nginx.pl +48 -48
- package/demos/nginx-demo/contrib/unicode2nginx/win-utf +130 -130
- package/demos/nginx-demo/contrib/vim/ftdetect/nginx.vim +4 -4
- package/demos/nginx-demo/contrib/vim/ftplugin/nginx.vim +1 -1
- package/demos/nginx-demo/contrib/vim/indent/nginx.vim +11 -11
- package/demos/nginx-demo/contrib/vim/syntax/nginx.vim +2268 -2268
- package/demos/nginx-demo/docs/CHANGES +8115 -8115
- package/demos/nginx-demo/docs/CHANGES.ru +8252 -8252
- package/demos/nginx-demo/docs/LICENSE +26 -26
- package/demos/nginx-demo/docs/OpenSSL.LICENSE +127 -127
- package/demos/nginx-demo/docs/PCRE.LICENCE +93 -93
- package/demos/nginx-demo/docs/README +3 -3
- package/demos/nginx-demo/docs/zlib.LICENSE +20 -20
- package/demos/nginx-demo/html/50x.html +21 -21
- package/demos/nginx-demo/html/ezuikit5/ezuikit.js +29 -29
- package/demos/nginx-demo/html/ezuikit5/index.html +116 -116
- package/demos/nginx-demo/html/ezuikit5/server.js +67 -67
- package/demos/nginx-demo/html/index.html +16 -16
- package/demos/nginx-demo/html/js/adapeter.js +5496 -5496
- package/demos/nginx-demo/html/js/janus.js +3507 -3507
- package/demos/nginx-demo/html/js/jquery.min.js +1 -1
- package/demos/nginx-demo/html/js/sts.js +340 -340
- package/demos/nginx-demo/logs/access.log +109 -109
- package/demos/nginx-demo/logs/error.log +15 -15
- package/demos/nginx-demo/logs/nginx.pid +1 -1
- package/demos/react-demo/README.md +68 -68
- package/demos/react-demo/package.json +36 -36
- package/demos/react-demo/public/index.html +43 -43
- package/demos/react-demo/public/manifest.json +25 -25
- package/demos/react-demo/public/robots.txt +3 -3
- package/demos/react-demo/src/App.css +38 -38
- package/demos/react-demo/src/App.js +114 -114
- package/demos/react-demo/src/App.test.js +9 -9
- package/demos/react-demo/src/index.css +13 -13
- package/demos/react-demo/src/index.js +17 -17
- package/demos/react-demo/src/logo.svg +7 -7
- package/demos/react-demo/src/serviceWorker.js +141 -141
- package/demos/react-demo/src/setupTests.js +5 -5
- package/demos/vue-demo/README.md +24 -24
- package/demos/vue-demo/babel.config.js +5 -5
- package/demos/vue-demo/package.json +43 -43
- package/demos/vue-demo/public/index.html +17 -17
- package/demos/vue-demo/src/App.vue +27 -27
- package/demos/vue-demo/src/components/EZUIKitJs.vue +115 -115
- package/demos/vue-demo/src/main.js +8 -8
- package/ezuikit.js +4343 -219
- package/ezuikit_static/v65/v1/js/SuperRender_10.js +394 -394
- package/ezuikit_static/v65/v1/js/playctrl/DecodeWorker.js +617 -617
- package/ezuikit_static/v65/v1/js/playctrl/JSPlaySDKInterface.js +2052 -2052
- package/ezuikit_static/v65/v1/js/playctrl/SuperRender_10.js +395 -395
- package/ezuikit_static/v65/v1/js/transform/SystemTransform.js +22 -22
- package/ezuikit_static/v65/v1/js/tts-v4.js +346 -346
- package/ezuikit_static/v65/v1/rec/jquery.min.js +1 -1
- package/ezuikit_static/v65/v1/talk/tts-v4.js +346 -346
- package/ezuikit_static/v65/v2/js/jsPluginV2-2.0.1.min.js +74 -11
- package/ezuikit_static/v65/v2/rec/jquery.min.js +1 -1
- package/ezuikit_static/v65/v2/talk/tts-v4.js +343 -343
- package/ezuikit_static/v66/v1/css/theme.css +121 -0
- package/ezuikit_static/v66/v1/js/AudioRenderer.js +225 -0
- package/ezuikit_static/v66/v1/js/SuperRender_10.js +395 -0
- package/ezuikit_static/v66/v1/js/SystemTransform.js +22 -0
- package/ezuikit_static/v66/v1/js/SystemTransform.js.mem +0 -0
- package/ezuikit_static/v66/v1/js/jsPluginV1-1.0.0.min.js +26 -0
- package/ezuikit_static/v66/v1/js/playctrl/AudioRenderer.js +225 -0
- package/ezuikit_static/v66/v1/js/playctrl/DecodeWorker.js +618 -0
- package/ezuikit_static/v66/v1/js/playctrl/Decoder.js +1 -0
- package/ezuikit_static/v66/v1/js/playctrl/JSPlaySDKInterface.js +2052 -0
- package/ezuikit_static/v66/v1/js/playctrl/SuperRender_10.js +396 -0
- package/ezuikit_static/v66/v1/js/playctrl/SuperRender_20.js +1 -0
- package/ezuikit_static/v66/v1/js/transform/SystemTransform.js +22 -0
- package/ezuikit_static/v66/v1/js/transform/SystemTransform.js.mem +0 -0
- package/ezuikit_static/v66/v1/js/transform/systemTransform-worker.min.js +1 -0
- package/ezuikit_static/v66/v1/js/tts-v4.js +346 -0
- package/ezuikit_static/v66/v1/rec/datepicker.js +1522 -0
- package/ezuikit_static/v66/v1/rec/datepicker.min.css +36 -0
- package/ezuikit_static/v66/v1/rec/datepicker.zh-CN.js +19 -0
- package/ezuikit_static/v66/v1/rec/jquery.min.js +2 -0
- package/ezuikit_static/v66/v1/speed/speed.css +144 -0
- package/ezuikit_static/v66/v1/talk/adapeter.js +5497 -0
- package/ezuikit_static/v66/v1/talk/janus.js +3507 -0
- package/ezuikit_static/v66/v1/talk/tts-v4.js +346 -0
- package/ezuikit_static/v66/v2/css/theme.css +121 -0
- package/ezuikit_static/v66/v2/js/Decoder.js +9198 -0
- package/ezuikit_static/v66/v2/js/Decoder.wasm +0 -0
- package/ezuikit_static/v66/v2/js/jsPluginV2-2.0.1.min.js +4662 -0
- package/ezuikit_static/v66/v2/rec/datepicker.js +1522 -0
- package/ezuikit_static/v66/v2/rec/datepicker.min.css +36 -0
- package/ezuikit_static/v66/v2/rec/datepicker.zh-CN.js +19 -0
- package/ezuikit_static/v66/v2/rec/jquery.min.js +2 -0
- package/ezuikit_static/v66/v2/speed/speed.css +144 -0
- package/ezuikit_static/v66/v2/talk/adapeter.js +5497 -0
- package/ezuikit_static/v66/v2/talk/janus.js +3507 -0
- package/ezuikit_static/v66/v2/talk/tts-v4.js +343 -0
- package/package.json +1 -1
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
// This optional code is used to register a service worker.
|
|
2
|
-
// register() is not called by default.
|
|
3
|
-
|
|
4
|
-
// This lets the app load faster on subsequent visits in production, and gives
|
|
5
|
-
// it offline capabilities. However, it also means that developers (and users)
|
|
6
|
-
// will only see deployed updates on subsequent visits to a page, after all the
|
|
7
|
-
// existing tabs open on the page have been closed, since previously cached
|
|
8
|
-
// resources are updated in the background.
|
|
9
|
-
|
|
10
|
-
// To learn more about the benefits of this model and instructions on how to
|
|
11
|
-
// opt-in, read https://bit.ly/CRA-PWA
|
|
12
|
-
|
|
13
|
-
const isLocalhost = Boolean(
|
|
14
|
-
window.location.hostname === 'localhost' ||
|
|
15
|
-
// [::1] is the IPv6 localhost address.
|
|
16
|
-
window.location.hostname === '[::1]' ||
|
|
17
|
-
// 127.0.0.0/8 are considered localhost for IPv4.
|
|
18
|
-
window.location.hostname.match(
|
|
19
|
-
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
|
20
|
-
)
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export function register(config) {
|
|
24
|
-
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
25
|
-
// The URL constructor is available in all browsers that support SW.
|
|
26
|
-
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
|
27
|
-
if (publicUrl.origin !== window.location.origin) {
|
|
28
|
-
// Our service worker won't work if PUBLIC_URL is on a different origin
|
|
29
|
-
// from what our page is served on. This might happen if a CDN is used to
|
|
30
|
-
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
window.addEventListener('load', () => {
|
|
35
|
-
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
|
36
|
-
|
|
37
|
-
if (isLocalhost) {
|
|
38
|
-
// This is running on localhost. Let's check if a service worker still exists or not.
|
|
39
|
-
checkValidServiceWorker(swUrl, config);
|
|
40
|
-
|
|
41
|
-
// Add some additional logging to localhost, pointing developers to the
|
|
42
|
-
// service worker/PWA documentation.
|
|
43
|
-
navigator.serviceWorker.ready.then(() => {
|
|
44
|
-
console.log(
|
|
45
|
-
'This web app is being served cache-first by a service ' +
|
|
46
|
-
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
} else {
|
|
50
|
-
// Is not localhost. Just register service worker
|
|
51
|
-
registerValidSW(swUrl, config);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function registerValidSW(swUrl, config) {
|
|
58
|
-
navigator.serviceWorker
|
|
59
|
-
.register(swUrl)
|
|
60
|
-
.then(registration => {
|
|
61
|
-
registration.onupdatefound = () => {
|
|
62
|
-
const installingWorker = registration.installing;
|
|
63
|
-
if (installingWorker == null) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
installingWorker.onstatechange = () => {
|
|
67
|
-
if (installingWorker.state === 'installed') {
|
|
68
|
-
if (navigator.serviceWorker.controller) {
|
|
69
|
-
// At this point, the updated precached content has been fetched,
|
|
70
|
-
// but the previous service worker will still serve the older
|
|
71
|
-
// content until all client tabs are closed.
|
|
72
|
-
console.log(
|
|
73
|
-
'New content is available and will be used when all ' +
|
|
74
|
-
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Execute callback
|
|
78
|
-
if (config && config.onUpdate) {
|
|
79
|
-
config.onUpdate(registration);
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
// At this point, everything has been precached.
|
|
83
|
-
// It's the perfect time to display a
|
|
84
|
-
// "Content is cached for offline use." message.
|
|
85
|
-
console.log('Content is cached for offline use.');
|
|
86
|
-
|
|
87
|
-
// Execute callback
|
|
88
|
-
if (config && config.onSuccess) {
|
|
89
|
-
config.onSuccess(registration);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
})
|
|
96
|
-
.catch(error => {
|
|
97
|
-
console.error('Error during service worker registration:', error);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function checkValidServiceWorker(swUrl, config) {
|
|
102
|
-
// Check if the service worker can be found. If it can't reload the page.
|
|
103
|
-
fetch(swUrl, {
|
|
104
|
-
headers: { 'Service-Worker': 'script' },
|
|
105
|
-
})
|
|
106
|
-
.then(response => {
|
|
107
|
-
// Ensure service worker exists, and that we really are getting a JS file.
|
|
108
|
-
const contentType = response.headers.get('content-type');
|
|
109
|
-
if (
|
|
110
|
-
response.status === 404 ||
|
|
111
|
-
(contentType != null && contentType.indexOf('javascript') === -1)
|
|
112
|
-
) {
|
|
113
|
-
// No service worker found. Probably a different app. Reload the page.
|
|
114
|
-
navigator.serviceWorker.ready.then(registration => {
|
|
115
|
-
registration.unregister().then(() => {
|
|
116
|
-
window.location.reload();
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
} else {
|
|
120
|
-
// Service worker found. Proceed as normal.
|
|
121
|
-
registerValidSW(swUrl, config);
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
.catch(() => {
|
|
125
|
-
console.log(
|
|
126
|
-
'No internet connection found. App is running in offline mode.'
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function unregister() {
|
|
132
|
-
if ('serviceWorker' in navigator) {
|
|
133
|
-
navigator.serviceWorker.ready
|
|
134
|
-
.then(registration => {
|
|
135
|
-
registration.unregister();
|
|
136
|
-
})
|
|
137
|
-
.catch(error => {
|
|
138
|
-
console.error(error.message);
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
1
|
+
// This optional code is used to register a service worker.
|
|
2
|
+
// register() is not called by default.
|
|
3
|
+
|
|
4
|
+
// This lets the app load faster on subsequent visits in production, and gives
|
|
5
|
+
// it offline capabilities. However, it also means that developers (and users)
|
|
6
|
+
// will only see deployed updates on subsequent visits to a page, after all the
|
|
7
|
+
// existing tabs open on the page have been closed, since previously cached
|
|
8
|
+
// resources are updated in the background.
|
|
9
|
+
|
|
10
|
+
// To learn more about the benefits of this model and instructions on how to
|
|
11
|
+
// opt-in, read https://bit.ly/CRA-PWA
|
|
12
|
+
|
|
13
|
+
const isLocalhost = Boolean(
|
|
14
|
+
window.location.hostname === 'localhost' ||
|
|
15
|
+
// [::1] is the IPv6 localhost address.
|
|
16
|
+
window.location.hostname === '[::1]' ||
|
|
17
|
+
// 127.0.0.0/8 are considered localhost for IPv4.
|
|
18
|
+
window.location.hostname.match(
|
|
19
|
+
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export function register(config) {
|
|
24
|
+
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
25
|
+
// The URL constructor is available in all browsers that support SW.
|
|
26
|
+
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
|
27
|
+
if (publicUrl.origin !== window.location.origin) {
|
|
28
|
+
// Our service worker won't work if PUBLIC_URL is on a different origin
|
|
29
|
+
// from what our page is served on. This might happen if a CDN is used to
|
|
30
|
+
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
window.addEventListener('load', () => {
|
|
35
|
+
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
|
36
|
+
|
|
37
|
+
if (isLocalhost) {
|
|
38
|
+
// This is running on localhost. Let's check if a service worker still exists or not.
|
|
39
|
+
checkValidServiceWorker(swUrl, config);
|
|
40
|
+
|
|
41
|
+
// Add some additional logging to localhost, pointing developers to the
|
|
42
|
+
// service worker/PWA documentation.
|
|
43
|
+
navigator.serviceWorker.ready.then(() => {
|
|
44
|
+
console.log(
|
|
45
|
+
'This web app is being served cache-first by a service ' +
|
|
46
|
+
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
// Is not localhost. Just register service worker
|
|
51
|
+
registerValidSW(swUrl, config);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function registerValidSW(swUrl, config) {
|
|
58
|
+
navigator.serviceWorker
|
|
59
|
+
.register(swUrl)
|
|
60
|
+
.then(registration => {
|
|
61
|
+
registration.onupdatefound = () => {
|
|
62
|
+
const installingWorker = registration.installing;
|
|
63
|
+
if (installingWorker == null) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
installingWorker.onstatechange = () => {
|
|
67
|
+
if (installingWorker.state === 'installed') {
|
|
68
|
+
if (navigator.serviceWorker.controller) {
|
|
69
|
+
// At this point, the updated precached content has been fetched,
|
|
70
|
+
// but the previous service worker will still serve the older
|
|
71
|
+
// content until all client tabs are closed.
|
|
72
|
+
console.log(
|
|
73
|
+
'New content is available and will be used when all ' +
|
|
74
|
+
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
// Execute callback
|
|
78
|
+
if (config && config.onUpdate) {
|
|
79
|
+
config.onUpdate(registration);
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
// At this point, everything has been precached.
|
|
83
|
+
// It's the perfect time to display a
|
|
84
|
+
// "Content is cached for offline use." message.
|
|
85
|
+
console.log('Content is cached for offline use.');
|
|
86
|
+
|
|
87
|
+
// Execute callback
|
|
88
|
+
if (config && config.onSuccess) {
|
|
89
|
+
config.onSuccess(registration);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
})
|
|
96
|
+
.catch(error => {
|
|
97
|
+
console.error('Error during service worker registration:', error);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function checkValidServiceWorker(swUrl, config) {
|
|
102
|
+
// Check if the service worker can be found. If it can't reload the page.
|
|
103
|
+
fetch(swUrl, {
|
|
104
|
+
headers: { 'Service-Worker': 'script' },
|
|
105
|
+
})
|
|
106
|
+
.then(response => {
|
|
107
|
+
// Ensure service worker exists, and that we really are getting a JS file.
|
|
108
|
+
const contentType = response.headers.get('content-type');
|
|
109
|
+
if (
|
|
110
|
+
response.status === 404 ||
|
|
111
|
+
(contentType != null && contentType.indexOf('javascript') === -1)
|
|
112
|
+
) {
|
|
113
|
+
// No service worker found. Probably a different app. Reload the page.
|
|
114
|
+
navigator.serviceWorker.ready.then(registration => {
|
|
115
|
+
registration.unregister().then(() => {
|
|
116
|
+
window.location.reload();
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
// Service worker found. Proceed as normal.
|
|
121
|
+
registerValidSW(swUrl, config);
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
.catch(() => {
|
|
125
|
+
console.log(
|
|
126
|
+
'No internet connection found. App is running in offline mode.'
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function unregister() {
|
|
132
|
+
if ('serviceWorker' in navigator) {
|
|
133
|
+
navigator.serviceWorker.ready
|
|
134
|
+
.then(registration => {
|
|
135
|
+
registration.unregister();
|
|
136
|
+
})
|
|
137
|
+
.catch(error => {
|
|
138
|
+
console.error(error.message);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
2
|
-
// allows you to do things like:
|
|
3
|
-
// expect(element).toHaveTextContent(/react/i)
|
|
4
|
-
// learn more: https://github.com/testing-library/jest-dom
|
|
5
|
-
import '@testing-library/jest-dom/extend-expect';
|
|
1
|
+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
2
|
+
// allows you to do things like:
|
|
3
|
+
// expect(element).toHaveTextContent(/react/i)
|
|
4
|
+
// learn more: https://github.com/testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom/extend-expect';
|
package/demos/vue-demo/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# my-project
|
|
2
|
-
|
|
3
|
-
## Project setup
|
|
4
|
-
```
|
|
5
|
-
npm install
|
|
6
|
-
```
|
|
7
|
-
|
|
8
|
-
### Compiles and hot-reloads for development
|
|
9
|
-
```
|
|
10
|
-
npm run serve
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Compiles and minifies for production
|
|
14
|
-
```
|
|
15
|
-
npm run build
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Lints and fixes files
|
|
19
|
-
```
|
|
20
|
-
npm run lint
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Customize configuration
|
|
24
|
-
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
1
|
+
# my-project
|
|
2
|
+
|
|
3
|
+
## Project setup
|
|
4
|
+
```
|
|
5
|
+
npm install
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### Compiles and hot-reloads for development
|
|
9
|
+
```
|
|
10
|
+
npm run serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Compiles and minifies for production
|
|
14
|
+
```
|
|
15
|
+
npm run build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Lints and fixes files
|
|
19
|
+
```
|
|
20
|
+
npm run lint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Customize configuration
|
|
24
|
+
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
presets: [
|
|
3
|
-
'@vue/cli-plugin-babel/preset'
|
|
4
|
-
]
|
|
5
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
presets: [
|
|
3
|
+
'@vue/cli-plugin-babel/preset'
|
|
4
|
+
]
|
|
5
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-project",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"serve": "vue-cli-service serve",
|
|
7
|
-
"build": "vue-cli-service build",
|
|
8
|
-
"lint": "vue-cli-service lint"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"core-js": "^3.6.4",
|
|
12
|
-
"ezuikit-js": "^0.6.5",
|
|
13
|
-
"vue": "^2.6.11"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@vue/cli-plugin-babel": "~4.3.0",
|
|
17
|
-
"@vue/cli-plugin-eslint": "~4.3.0",
|
|
18
|
-
"@vue/cli-service": "~4.3.0",
|
|
19
|
-
"babel-eslint": "^10.1.0",
|
|
20
|
-
"eslint": "^6.7.2",
|
|
21
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
22
|
-
"vue-template-compiler": "^2.6.11"
|
|
23
|
-
},
|
|
24
|
-
"eslintConfig": {
|
|
25
|
-
"root": true,
|
|
26
|
-
"env": {
|
|
27
|
-
"node": true
|
|
28
|
-
},
|
|
29
|
-
"extends": [
|
|
30
|
-
"plugin:vue/essential",
|
|
31
|
-
"eslint:recommended"
|
|
32
|
-
],
|
|
33
|
-
"parserOptions": {
|
|
34
|
-
"parser": "babel-eslint"
|
|
35
|
-
},
|
|
36
|
-
"rules": {}
|
|
37
|
-
},
|
|
38
|
-
"browserslist": [
|
|
39
|
-
"> 1%",
|
|
40
|
-
"last 2 versions",
|
|
41
|
-
"not dead"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "my-project",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"serve": "vue-cli-service serve",
|
|
7
|
+
"build": "vue-cli-service build",
|
|
8
|
+
"lint": "vue-cli-service lint"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"core-js": "^3.6.4",
|
|
12
|
+
"ezuikit-js": "^0.6.5",
|
|
13
|
+
"vue": "^2.6.11"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@vue/cli-plugin-babel": "~4.3.0",
|
|
17
|
+
"@vue/cli-plugin-eslint": "~4.3.0",
|
|
18
|
+
"@vue/cli-service": "~4.3.0",
|
|
19
|
+
"babel-eslint": "^10.1.0",
|
|
20
|
+
"eslint": "^6.7.2",
|
|
21
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
22
|
+
"vue-template-compiler": "^2.6.11"
|
|
23
|
+
},
|
|
24
|
+
"eslintConfig": {
|
|
25
|
+
"root": true,
|
|
26
|
+
"env": {
|
|
27
|
+
"node": true
|
|
28
|
+
},
|
|
29
|
+
"extends": [
|
|
30
|
+
"plugin:vue/essential",
|
|
31
|
+
"eslint:recommended"
|
|
32
|
+
],
|
|
33
|
+
"parserOptions": {
|
|
34
|
+
"parser": "babel-eslint"
|
|
35
|
+
},
|
|
36
|
+
"rules": {}
|
|
37
|
+
},
|
|
38
|
+
"browserslist": [
|
|
39
|
+
"> 1%",
|
|
40
|
+
"last 2 versions",
|
|
41
|
+
"not dead"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
-
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<noscript>
|
|
12
|
-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
13
|
-
</noscript>
|
|
14
|
-
<div id="app"></div>
|
|
15
|
-
<!-- built files will be auto injected -->
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
<!-- built files will be auto injected -->
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="app">
|
|
3
|
-
<EZUIKitJs />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import EZUIKitJs from './components/EZUIKitJs.vue'
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
name: 'App',
|
|
12
|
-
components: {
|
|
13
|
-
EZUIKitJs
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<style>
|
|
19
|
-
#app {
|
|
20
|
-
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
21
|
-
-webkit-font-smoothing: antialiased;
|
|
22
|
-
-moz-osx-font-smoothing: grayscale;
|
|
23
|
-
text-align: center;
|
|
24
|
-
color: #2c3e50;
|
|
25
|
-
margin-top: 60px;
|
|
26
|
-
}
|
|
27
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div id="app">
|
|
3
|
+
<EZUIKitJs />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import EZUIKitJs from './components/EZUIKitJs.vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'App',
|
|
12
|
+
components: {
|
|
13
|
+
EZUIKitJs
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
#app {
|
|
20
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
21
|
+
-webkit-font-smoothing: antialiased;
|
|
22
|
+
-moz-osx-font-smoothing: grayscale;
|
|
23
|
+
text-align: center;
|
|
24
|
+
color: #2c3e50;
|
|
25
|
+
margin-top: 60px;
|
|
26
|
+
}
|
|
27
|
+
</style>
|