You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/10/26 06:01:45 UTC

[echarts-examples] branch gh-pages updated: fix echarts version in downloaded example code

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git


The following commit(s) were added to refs/heads/gh-pages by this push:
     new 8540865  fix echarts version in downloaded example code
8540865 is described below

commit 85408659559e991bb1d724cc412e591e50424d53
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Oct 26 14:01:01 2021 +0800

    fix echarts version in downloaded example code
---
 src/editor/downloadExample.js | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/editor/downloadExample.js b/src/editor/downloadExample.js
index d4235df..0fbf23d 100644
--- a/src/editor/downloadExample.js
+++ b/src/editor/downloadExample.js
@@ -6,6 +6,14 @@ const hasRootPath = store.sourceCode.indexOf('ROOT_PATH') >= 0;
 const rootPathCode = hasRootPath ? `var ROOT_PATH = '${store.cdnRoot}'` : '';
 
 export function download() {
+  const echartsMinJS = SCRIPT_URLS.echartsMinJS.replace(
+    '{{version}}',
+    store.echartsVersion
+  );
+  const echartsDir = SCRIPT_URLS.echartsDir.replace(
+    '{{version}}',
+    store.echartsVersion
+  );
   const code = `<!--
     THIS EXAMPLE WAS DOWNLOADED FROM ${window.location.href}
 -->
@@ -17,9 +25,9 @@ export function download() {
     <body style="height: 100%; margin: 0">
         <div id="container" style="height: 100%"></div>
 
-        <script type="text/javascript" src="${SCRIPT_URLS.echartsMinJS}"></script>
+        <script type="text/javascript" src="${echartsMinJS}"></script>
         <!-- Uncomment this line if you want to dataTool extension
-        <script type="text/javascript" src="${SCRIPT_URLS.echartsDir}/dist/extension/dataTool.min.js"></script>
+        <script type="text/javascript" src="${echartsDir}/dist/extension/dataTool.min.js"></script>
         -->
         <!-- Uncomment this line if you want to use gl extension
         <script type="text/javascript" src="${SCRIPT_URLS.echartsGLMinJS}"></script>
@@ -28,8 +36,8 @@ export function download() {
         <script type="text/javascript" src="${SCRIPT_URLS.echartsStatMinJS}"></script>
         -->
         <!-- Uncomment this line if you want to use map
-        <script type="text/javascript" src="${SCRIPT_URLS.echartsDir}/map/js/china.js"></script>
-        <script type="text/javascript" src="${SCRIPT_URLS.echartsDir}/map/js/world.js"></script>
+        <script type="text/javascript" src="${echartsDir}/map/js/china.js"></script>
+        <script type="text/javascript" src="${echartsDir}/map/js/world.js"></script>
         -->
         <!-- Uncomment these two lines if you want to use bmap extension
         <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<Your Key Here>"></script>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org