Skip to content

Commit

Permalink
use China CDN for Chinese website
Browse files Browse the repository at this point in the history
  • Loading branch information
plainheart committed Dec 8, 2023
1 parent d26c81d commit 813fe22
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 53 deletions.
12 changes: 6 additions & 6 deletions public/en/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ <h1></h1>


<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.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/element-ui@2.15.14/lib/index.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/en/option-gl.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1></h1>
</script>

<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.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/element-ui@2.15.14/lib/index.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/en/option.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ <h1></h1>

<div id="app"></div>

<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.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/element-ui@2.15.14/lib/index.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/en/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ <h1></h1>


<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.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/element-ui@2.15.14/lib/index.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/zh/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1></h1>
</script>

<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.15.14/theme-chalk/index.min.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://lib.baomitu.com/element-ui/2.15.14/index.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/codemirror.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://lib.baomitu.com/js-beautify/1.11.0/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/zh/option-gl.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1></h1>
</script>

<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.15.14/theme-chalk/index.min.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://lib.baomitu.com/element-ui/2.15.14/index.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/codemirror.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://lib.baomitu.com/js-beautify/1.11.0/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/zh/option.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1></h1>
</script>

<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.15.14/theme-chalk/index.min.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://lib.baomitu.com/element-ui/2.15.14/index.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/codemirror.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://lib.baomitu.com/js-beautify/1.11.0/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
12 changes: 6 additions & 6 deletions public/zh/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1></h1>
</script>

<div id="app"></div>
<link rel="stylesheet" href="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://lib.baomitu.com/element-ui/2.15.14/theme-chalk/index.min.css">
<link rel="stylesheet" href="../css/doc-bundle.css">
<script src="//fastly.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/element-ui@2.13.2/lib/index.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js"></script>
<script src="//fastly.jsdelivr.net/npm/codemirror@5.56.0/mode/javascript/javascript.js"></script>
<script src="//fastly.jsdelivr.net/npm/js-beautify@1.11.0/js/lib/beautifier.min.js"></script>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://lib.baomitu.com/element-ui/2.15.14/index.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/codemirror.min.js"></script>
<script src="https://lib.baomitu.com/codemirror/5.56.0/mode/javascript/javascript.min.js"></script>
<script src="https://lib.baomitu.com/js-beautify/1.11.0/beautifier.min.js"></script>
<script src="../js/doc-bundle.js"></script>
<script>
echartsDoc.init('#app', {
Expand Down
5 changes: 3 additions & 2 deletions src/components/LiveExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ import 'codemirror/theme/dracula.css';
import beautifier from 'js-beautify';
import {throttle} from 'lodash-es';
import arrayDiff from 'zrender/lib/core/arrayDiff';
import {ECHARTS_LIB} from '../config';
import { compressToBase64 } from 'lz-string';
let echartsLoadPromise;
function fetchECharts() {
return echartsLoadPromise || (echartsLoadPromise = new Promise(function (resolve, reject) {
const script = document.createElement('script');
script.src = ECHARTS_LIB;
script.src = store.locale === 'zh'
? 'https://lib.baomitu.com/echarts/latest/echarts.min.js'
: 'https://fastly.jsdelivr.net/npm/echarts@latest/dist/echarts.min.js';
script.async = true;
script.onload = function () {
echartsLoadPromise = null;
Expand Down
3 changes: 0 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

export const ECHARTS_LIB = 'https://fastly.jsdelivr.net/npm/echarts@5/dist/echarts.min.js';

// Properties that will not be expanded by default.
// To reduce the display of unnecessary info.
export const PROPERTIES_NOT_EXPAND = [
Expand Down

0 comments on commit 813fe22

Please sign in to comment.