Skip to content
Permalink
Browse files
add next example pages
  • Loading branch information
pissang committed Aug 13, 2020
1 parent 5d4966f commit ebf577f2fec765ad7b7a7c43f3b48ca9a17e83f4
Show file tree
Hide file tree
Showing 17 changed files with 194 additions and 5 deletions.
@@ -0,0 +1,15 @@
block variables

doctype html
html
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')

script(type='text/javascript').
var hash = (location.hash || '').replace('#', '');
var search = (location.search || '').replace('?', '');
var lang = navigator.language || navigator.userLanguage;
lang = lang.indexOf('zh') > -1 ? 'zh' : 'en';
location.href = '#{host}/examples/' + lang + '/#{redirectTo}'
+ (search ? '?' + search : '') + (hash ? '#' + hash : '');
@@ -0,0 +1,36 @@
extends basic

block extra_head
title Examples - Apache ECharts(incubating)
style.
html, body {
/* position: sticky should not have overflow parents.*/
overflow-x: hidden;
}
link(rel="stylesheet", href="#{cdnThirdParty.elementUICSS}")
link(rel="stylesheet", href="#{cdnPayRoot}/next/examples/css/example-bundle.css?_v_=#{homeVersion}")

block content

#ec-example-main

block extra_js
script(src="#{cdnThirdParty.vueJS}")
script(src="#{cdnThirdParty.elementUIJS}")
script(src="#{cdnPayRoot}/next/examples/js/example-bundle.js?_v_=#{homeVersion}")
script(type="text/javascript").
window.EC_WWW_CDN_PAY_ROOT = '#{cdnPayRoot}';

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra.version = '#{homeVersion}';
window.globalArgsExtra.cdnRoot = EC_WWW_CDN_PAY_ROOT + '/next/examples';
echartsExample.init('#ec-example-main', window.globalArgsExtra);

// Remove apache banner
const dom = document.getElementById('apache-banner');
if (dom && dom.parentNode) {
dom.parentNode.removeChild(dom);
}

@@ -0,0 +1,40 @@
extends basic

block extra_head
title Examples - Apache ECharts(incubating)
style.
html, body {
/* position: sticky should not have overflow parents.*/
overflow-x: hidden;
}
link(rel="stylesheet", href="#{cdnThirdParty.elementUICSS}")
link(rel="stylesheet", href="#{cdnPayRoot}/next/examples/css/example-bundle.css?_v_=#{homeVersion}")

block content

nav(class='navbar navbar-default navbar-fixed-top' id="ec-example-nav")
if ecWWWLang == 'en'
include ../en/nav
else
include ../components/nav

.page-main
block vars

#ec-example-main

block extra_js
script(src="#{cdnThirdParty.vueJS}")
script(src="#{cdnThirdParty.elementUIJS}")
script(src="#{cdnPayRoot}/next/examples/js/example-bundle.js?_v_=#{homeVersion}")
script(type="text/javascript").
window.EC_WWW_CDN_PAY_ROOT = '#{cdnPayRoot}';

block global_args_extra

script(type="text/javascript").
document.getElementById('nav-doc').className = 'active';
window.globalArgsExtra.version = '#{homeVersion}';
window.globalArgsExtra.cdnRoot = EC_WWW_CDN_PAY_ROOT + '/next/examples';
echartsExample.init('#ec-example-main', window.globalArgsExtra);

@@ -0,0 +1,4 @@
extends ../../layouts/next-example-redirect

block variables
- var redirectTo = 'editor.html'
@@ -0,0 +1,3 @@

- var ecWWWLang = 'en';
- var htmlAttrLang = 'en-US';
@@ -0,0 +1,12 @@
extends ../../../layouts/next-example

block variablesLang
include ./_variablesLang.jade

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'editor',
locale: 'en'
};
@@ -0,0 +1,12 @@
extends ../../../layouts/next-example

block variablesLang
include ./_variablesLang.jade

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'explore',
locale: 'en'
};
@@ -0,0 +1,12 @@
extends ../../../layouts/next-example-simple

block variablesLang
include ./_variablesLang.jade

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'view',
locale: 'en'
};
@@ -0,0 +1,4 @@
extends ../../layouts/next-example-redirect

block variables
- var redirectTo = 'index.html'
@@ -0,0 +1,4 @@
extends ../../layouts/next-example-redirect

block variables
- var redirectTo = 'view.html'
@@ -0,0 +1,9 @@
extends ../../../layouts/next-example

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'editor',
locale: 'zh'
};
@@ -0,0 +1,9 @@
extends ../../../layouts/next-example

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'explore',
locale: 'zh'
};
@@ -0,0 +1,9 @@
extends ../../../layouts/next-example-simple

block global_args_extra

script(type="text/javascript").
window.globalArgsExtra = {
page: 'view',
locale: 'zh'
};
@@ -0,0 +1,4 @@
// Override the nav position
#ec-example-main #left-container {
top: $nav-height + 20px;
}
@@ -71,8 +71,9 @@ body {
// styles only used in certain pages like index or examples
@import 'pages.index';
@import 'pages.index.feature';
@import 'pages.examples.nav';
@import 'pages.examples.charts';
// @import 'pages.examples.nav';
// @import 'pages.examples.charts';
@import 'pages.examples.next';

@import 'components.reset';
@import 'pages.download';
@@ -25,8 +25,9 @@ echo "Building with env type: ${envType}"
currWorkingDir=$(pwd)
thisScriptDir=$(cd `dirname $0`; pwd)
wwwProjectDir="${thisScriptDir}/..";
docProjectDir="${wwwProjectDir}/../incubator-echarts-doc";
docProjectDir="${wwwProjectDir}/../echarts-doc";
examplesProjectDir="${wwwProjectDir}/../echarts-examples";
nextExamplesProjectDir="${wwwProjectDir}/../echarts-examples-next";
themeProjectDir="${wwwProjectDir}/../ECharts-Theme-Builder";

cd ${wwwProjectDir}
@@ -71,6 +72,18 @@ node build.js --env ${envType}
cd ${currWorkingDir}
echo "Build examples done."

# Build examples next
echo "Build examples next..."
if [ ! -d "${nextExamplesProjectDir}" ]; then
echo "Directory ${nextExamplesProjectDir} DOES NOT exists."
exit 1
fi
cd ${nextExamplesProjectDir}
npm run release
cd ${currWorkingDir}
echo "Build examples done."


# Build www
echo "Build www ..."
cd ${wwwProjectDir}
@@ -1,7 +1,9 @@
$(document).ready(function () {
if (location.host !== 'echarts.apache.org') {
var banner = document.getElementById('apache-banner');
banner.style.display = 'block';
var banner = document.getElementById('apache-banner');
if (banner) {
banner.style.display = 'block';
}
}

// close apache banner when found in cookie

0 comments on commit ebf577f

Please sign in to comment.