mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
edit ditto.js
This commit is contained in:
parent
f731ea151c
commit
b440dc2a55
10
index.html
10
index.html
@ -37,15 +37,7 @@
|
|||||||
// run
|
// run
|
||||||
ditto.run();
|
ditto.run();
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
<noscript>
|
||||||
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>
|
|
||||||
<p>《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。</p>
|
<p>《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。</p>
|
||||||
<p>本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。</p>
|
<p>本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。</p>
|
||||||
<p>本书为中级难度,适合已有一定JavaScript语言基础的读者,了解这门语言的最新进展;也可当作参考手册,查寻新增的语法点。</p>
|
<p>本书为中级难度,适合已有一定JavaScript语言基础的读者,了解这门语言的最新进展;也可当作参考手册,查寻新增的语法点。</p>
|
||||||
|
28
js/ditto.js
28
js/ditto.js
@ -18,10 +18,6 @@ var ditto = {
|
|||||||
|
|
||||||
var disqusCode = '<h3>留言</h3><div id="disqus_thread"></div>';
|
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() {
|
function initialize() {
|
||||||
// initialize sidebar and buttons
|
// initialize sidebar and buttons
|
||||||
if (ditto.sidebar) {
|
if (ditto.sidebar) {
|
||||||
@ -200,20 +196,24 @@ function router() {
|
|||||||
normalize_paths();
|
normalize_paths();
|
||||||
create_page_anchors();
|
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() {
|
$('#content code').map(function() {
|
||||||
Prism.highlightElement(this);
|
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){
|
if(path.indexOf('README') === -1){
|
||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: $('#content').offset().top
|
scrollTop: $('#content').offset().top
|
||||||
|
Loading…
x
Reference in New Issue
Block a user