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
fb423940de
commit
1cd7e8b754
16
js/ditto.js
16
js/ditto.js
@ -18,9 +18,9 @@ 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;
|
var disqus_identifier;
|
||||||
var disqus_title;
|
var disqus_title;
|
||||||
var disqus_url='http://'+location.host+'/'+location.hash?location.hash.replace("#", ""):'index';
|
var disqus_url;
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
// initialize sidebar and buttons
|
// initialize sidebar and buttons
|
||||||
@ -187,9 +187,6 @@ function router() {
|
|||||||
path = path + ".md";
|
path = path + ".md";
|
||||||
}
|
}
|
||||||
|
|
||||||
window.disqus_identifier=location.hash;
|
|
||||||
window.disqus_url='http://'+location.host+'/'+location.hash?location.hash.replace("#", ""):'index';
|
|
||||||
|
|
||||||
// otherwise get the markdown and render it
|
// otherwise get the markdown and render it
|
||||||
var loading = show_loading();
|
var loading = show_loading();
|
||||||
$.get(path , function(data) {
|
$.get(path , function(data) {
|
||||||
@ -203,6 +200,15 @@ function router() {
|
|||||||
normalize_paths();
|
normalize_paths();
|
||||||
create_page_anchors();
|
create_page_anchors();
|
||||||
|
|
||||||
|
if(window.DISQUS){DISQUS.reset({
|
||||||
|
reload: true,
|
||||||
|
config: function () {
|
||||||
|
this.page.identifier = location.hash;
|
||||||
|
this.page.url = location.href;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$('#content code').map(function() {
|
$('#content code').map(function() {
|
||||||
Prism.highlightElement(this);
|
Prism.highlightElement(this);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user