var version = '2.2.7'; var sp = location.pathname.lastIndexOf('/'); var ep = location.pathname.lastIndexOf('.html'); var curPage = sp < ep ? location.pathname.slice(sp + 1, ep) : 'index'; var enVersion = location.href.indexOf('-en.html') != -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.option = './doc'; loc.spreadsheet = './doc'; loc.start = './doc'; loc.img = './doc'; break; case 'feature' : case 'example' : case 'doc' : case 'option' : case 'spreadsheet' : 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.option = extSub + '../../doc'; loc.spreadsheet = extSub + '../../doc'; loc.start = extSub + '../../doc'; loc.img = extSub + '../../doc'; break; } // Those pages only exist in echarts-www project, // but not in http://ecomfe.github.io/echarts/ and doc in echarts project. if (location.href.indexOf('.baidu.com') < 0) { loc.option = 'http://echarts.baidu.com/doc'; loc.spreadsheet = 'http://echarts.baidu.com/doc'; } $('#head')[0].innerHTML = '
' + (enVersion ? 'Link' : 'ECharts团队出品') + '
' + '' + '' + (enVersion ? 'More' : '更多') + '
' + '' + (enVersion ? 'Contact Us' : '联系我们') + '
' + '© 2015 Baidu
' + '