var version = '2.2.1'; var sp = location.href.lastIndexOf('/'); var ep = location.href.lastIndexOf('.html'); var curPage = sp < ep ? location.href.slice(sp + 1, ep) : 'index'; var enVersion = (location.hash && location.hash.indexOf('-en') != -1) || location.href.indexOf('-en') != -1; var activeClass = {}; var loc = {}; var forkWidth = 149; curPage = curPage.replace('-en', ''); var isExample = false; switch (curPage) { case 'index' : activeClass[curPage] = 'active'; loc[curPage] = '.'; loc.feature = './doc'; loc.example = './doc'; loc.doc = './doc'; loc.about = './doc'; loc.changelog = './doc'; loc.start = './doc'; loc.img = './doc'; break; case 'feature' : case 'example' : case 'doc' : case 'about' : case 'changelog' : case 'start' : activeClass[curPage] = 'active'; loc.index = '..'; break; default : isExample = true; forkWidth = 60; activeClass['example'] = 'active'; var extSub = location.href.indexOf('extension') != -1 ? '../' : ''; loc.index = extSub + '../..'; loc.feature = extSub + '../../doc'; loc.example = extSub + '../../doc'; loc.doc = extSub + '../../doc'; loc.about = extSub + '../../doc'; loc.changelog = extSub + '../../doc'; loc.start = extSub + '../../doc'; loc.img = extSub + '../../doc'; break; } $('#head')[0].innerHTML = '
' + (enVersion ? 'Link' : 'ECharts团队出品') + '
' + '' + '' + (enVersion ? 'More' : '更多') + '
' + '' + (enVersion ? 'Contact Us' : '联系我们') + '
' + '© 2015 Baidu
' + '