edit ditto.js

This commit is contained in:
ruanyf
2014-04-26 09:15:21 +08:00
parent f731ea151c
commit b440dc2a55
2 changed files with 15 additions and 23 deletions
+1 -9
View File
@@ -37,15 +37,7 @@
// run
ditto.run();
</script>
<script type="text/javascript">
var disqus_shortname = 'es6';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
<noscript>
<p>《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。</p>
<p>本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。</p>
<p>本书为中级难度,适合已有一定JavaScript语言基础的读者,了解这门语言的最新进展;也可当作参考手册,查寻新增的语法点。</p>
+14 -14
View File
@@ -18,10 +18,6 @@ var ditto = {
var disqusCode = '<h3>留言</h3><div id="disqus_thread"></div>';
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