blob: dfbb47bbf34e8eba346f21f11934979e614eba8d [file] [log] [blame]
function changeLang(e){"en"!==e||"echarts.apache.org"===location.hostname?location.href=location.href.replace(new RegExp("/(zh|en)/","g"),"/"+e+"/"):(e=new RegExp("/zh/","g"),e="https://echarts.apache.org"+location.pathname.replace(e,"/en/")+location.search+location.hash,location.href=e)}function closeApacheBanner(e){var t=document.getElementById("apache-banner");t&&t.remove(),e&&(_hmt.push(["_trackEvent","apacheBanner","close"]),Cookies.set("apache-banner-closed","true",{expires:7}))}function logApache(){_hmt.push(["_trackEvent","apacheBanner","visit"])}$(document).ready(function(){"echarts.apache.org"===location.host||(e=document.getElementById("apache-banner"))&&(e.style.display="block"),"true"===Cookies.get("apache-banner-closed")&&closeApacheBanner(!1);var e=$(".page-detail h2");0<e.length&&e.each(function(e){var t='href="#'+$(this).attr("id")+'"',n=$(this).text();$(this).next(".time")&&(n+=" "+$(this).next(".time").text());n=$("<a "+t+(0===e?' class="active"':" ")+">"+n+"</a>").click(function(){$(".page-nav a").removeClass("active"),$(this).addClass("active")});$(".page-nav ul").append($("<li></li>").append(n))});var t=$(".page-content").find("iframe");function n(){t.filter(function(){var e=$(this);if(e.attr("src"))return!1;e=e[0].getClientRects();return 0<e.length&&0<e[0].top&&e[0].top<$(window).height()}).each(function(){$(this).attr("src",$(this).data("src"))})}n(),$(window).scroll(function(){n()}),$(".slide-btn").click(function(){var e=$(this).parent().parent();e.hasClass("slide-up")?($(this).text("收起目录"),e.removeClass("slide-up")):($(this).text("展开目录"),e.addClass("slide-up"))}),$(".page-nav")&&$(window).scroll(function(){var e=Math.max(120-(window.pageYOffset-120),70);$(".page-nav").css("top",e)})}),function(){function r(){for(var e=0,t={};e<arguments.length;e++){var n,a=arguments[e];for(n in a)t[n]=a[n]}return t}function p(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}(function e(s){function c(){}function n(e,t,n){if("undefined"!=typeof document){"number"==typeof(n=r({path:"/"},c.defaults,n)).expires&&(n.expires=new Date(+new Date+864e5*n.expires)),n.expires=n.expires?n.expires.toUTCString():"";try{var a=JSON.stringify(t);/^[\{\[]/.test(a)&&(t=a)}catch(e){}t=s.write?s.write(t,e):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var o,i="";for(o in n)n[o]&&(i+="; "+o,!0!==n[o]&&(i+="="+n[o].split(";")[0]));return document.cookie=e+"="+t+i}}function t(e,t){if("undefined"!=typeof document){for(var n={},a=document.cookie?document.cookie.split("; "):[],o=0;o<a.length;o++){var i=a[o].split("="),c=i.slice(1).join("=");t||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var r=p(i[0]),c=(s.read||s)(c,r)||p(c);if(t)try{c=JSON.parse(c)}catch(e){}if(n[r]=c,e===r)break}catch(e){}}return e?n[e]:n}}return(window.Cookies=c).set=n,c.get=function(e){return t(e,!1)},c.getJSON=function(e){return t(e,!0)},c.remove=function(e,t){n(e,"",r(t,{expires:-1}))},c.defaults={},c.withConverter=e,c})(function(){})}();