You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2023/10/11 01:02:34 UTC
[echarts-examples] branch gh-pages updated (94fd6dd9 -> fb7f86fa)
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a change to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
from 94fd6dd9 fix(explore): remove wp image accelerator CDN due to potential rate limit for zh users
new 00774938 reuse jQuery lib from parent context if possible & fix the typo of `handleMessage`
new fb7f86fa update lib version
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
public/en/editor.html | 8 ++++----
public/en/index.html | 8 ++++----
public/en/view.html | 8 ++++----
public/zh/editor.html | 10 +++++-----
public/zh/index.html | 10 +++++-----
public/zh/view.html | 10 +++++-----
src/editor/sandbox/index.js | 36 ++++++++++++++++++++++++++++--------
7 files changed, 55 insertions(+), 35 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[echarts-examples] 02/02: update lib version
Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit fb7f86fa5f179e7498572e89207ee672adb94ad5
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Oct 11 08:57:34 2023 +0800
update lib version
---
public/en/editor.html | 8 ++++----
public/en/index.html | 8 ++++----
public/en/view.html | 8 ++++----
public/zh/editor.html | 10 +++++-----
public/zh/index.html | 10 +++++-----
public/zh/view.html | 10 +++++-----
6 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/public/en/editor.html b/public/en/editor.html
index b790de66..2f685dce 100644
--- a/public/en/editor.html
+++ b/public/en/editor.html
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.15.13/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.13/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
diff --git a/public/en/index.html b/public/en/index.html
index 31567081..626de2ae 100644
--- a/public/en/index.html
+++ b/public/en/index.html
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
diff --git a/public/en/view.html b/public/en/view.html
index cd6a517e..6db8604a 100644
--- a/public/en/view.html
+++ b/public/en/view.html
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
diff --git a/public/zh/editor.html b/public/zh/editor.html
index 3ee7a541..2e8ff2c8 100644
--- a/public/zh/editor.html
+++ b/public/zh/editor.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.15.13/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.13/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
diff --git a/public/zh/index.html b/public/zh/index.html
index 093b889a..cb34d927 100644
--- a/public/zh/index.html
+++ b/public/zh/index.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
diff --git a/public/zh/view.html b/public/zh/view.html
index 935a3450..c85347a2 100644
--- a/public/zh/view.html
+++ b/public/zh/view.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -24,12 +24,12 @@
/>
<link
rel="stylesheet"
- href="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css"
+ href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css"
/>
- <script src="https://fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>
- <script src="https://fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
+ <script src="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/index.js"></script>
</head>
<body>
<div id="main"></div>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[echarts-examples] 01/02: reuse jQuery lib from parent context if possible & fix the typo of `handleMessage`
Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit 007749385bfcc99266c25d5401691f5be2f5a629
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Oct 11 08:55:12 2023 +0800
reuse jQuery lib from parent context if possible & fix the typo of `handleMessage`
---
src/editor/sandbox/index.js | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
diff --git a/src/editor/sandbox/index.js b/src/editor/sandbox/index.js
index 0dc3d816..6019cffa 100644
--- a/src/editor/sandbox/index.js
+++ b/src/editor/sandbox/index.js
@@ -32,11 +32,31 @@ export function createSandbox(
onOptionUpdated,
onCSSParsed
) {
- const commonLibs = [
- SCRIPT_URLS.jQueryJS,
- SCRIPT_URLS.seedrandomJS,
- SCRIPT_URLS.acornJS
- ].map((src) => ({ src }));
+ const commonLibs = [SCRIPT_URLS.seedrandomJS, SCRIPT_URLS.acornJS].map(
+ (src) => ({ src })
+ );
+ commonLibs.unshift({
+ content: `
+ (() => {
+ let _win = window;
+ while (_win) {
+ if (_win.jQuery) {
+ if (_win !== window) {
+ window.jQuery = window.$ = _win.jQuery;
+ }
+ return;
+ }
+ if (_win === top) {
+ break;
+ }
+ _win = _win.parent;
+ }
+ const jqLib = document.createElement('script');
+ jqLib.src = '${SCRIPT_URLS.jQueryJS}';
+ document.head.appendChild(jqLib);
+ })();
+ `
+ });
scripts = commonLibs.concat(scripts, prepareSetupScript(isShared));
const sandbox = document.createElement('iframe');
@@ -133,7 +153,7 @@ export function createSandbox(
sandbox.onerror = onerror;
container.appendChild(sandbox);
- function hanldeMessage(e) {
+ function handleMessage(e) {
if (e.source !== sandbox.contentWindow) {
return;
}
@@ -162,12 +182,12 @@ export function createSandbox(
sandbox.contentWindow.postMessage({ action, ...argumentMap }, '*');
}
- window.addEventListener('message', hanldeMessage, false);
+ window.addEventListener('message', handleMessage, false);
return {
dispose() {
sendMessage('dispose');
- window.removeEventListener('message', hanldeMessage);
+ window.removeEventListener('message', handleMessage);
container.removeChild(sandbox);
},
run(store, recreateInstance) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org