diff --git a/index.html b/index.html index 57dd87e..b9aacb1 100644 --- a/index.html +++ b/index.html @@ -37,15 +37,7 @@ // run ditto.run(); - - + 《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。 本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。 本书为中级难度,适合已有一定JavaScript语言基础的读者,了解这门语言的最新进展;也可当作参考手册,查寻新增的语法点。 diff --git a/js/ditto.js b/js/ditto.js index 87c3f4a..4d133f6 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -18,10 +18,6 @@ var ditto = { var disqusCode = '留言'; -var disqus_identifier=location.hash?location.hash:'index'; -var disqus_title=document.title; -var disqus_url='http://'+location.host+'/'+location.hash.replace("#", ""); - function initialize() { // initialize sidebar and buttons if (ditto.sidebar) { @@ -200,20 +196,24 @@ function router() { normalize_paths(); create_page_anchors(); - if(window.DISQUS){DISQUS.reset({ - reload: true, - config: function () { - window.disqus_identifier = location.hash; - window.disqus_title = document.title; - window.disqus_url = 'http://'+location.host+'/'+location.hash.replace("#", ""); - } - }); -} - $('#content code').map(function() { Prism.highlightElement(this); }); + function loadDisqus() { + // http://docs.disqus.com/help/2/ + window.disqus_shortname = 'es6'; + window.disqus_identifier = location.hash; + window.disqus_url = 'http://es6.ruanyifeng.com/' + location.hash?location.hash.replace("#", ""):'index'; + + // http://docs.disqus.com/developers/universal/ + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://es6.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + } + if(path.indexOf('README') === -1){ $('html, body').animate({ scrollTop: $('#content').offset().top
《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。
本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。
本书为中级难度,适合已有一定JavaScript语言基础的读者,了解这门语言的最新进展;也可当作参考手册,查寻新增的语法点。