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
@ -37,14 +37,6 @@
|
||||
// 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>
|
||||
<p>《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新增的语法特性。</p>
|
||||
<p>本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。</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 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user