mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
refactor: adjust wwads banner
This commit is contained in:
parent
536ac2251a
commit
010daf6830
10
js/ditto.js
10
js/ditto.js
@ -45,7 +45,6 @@ var getHash = function (hash) {
|
||||
};
|
||||
|
||||
var disqusCode = '<h3>留言</h3><div id="disqus_thread"></div>';
|
||||
var wwadsCode = '<div class="wwads-cn wwads-horizontal" data-id="197" style="max-width:100%;"></div>';
|
||||
var menu = new Array();
|
||||
|
||||
function initialize() {
|
||||
@ -126,7 +125,7 @@ function searchbar_listener(event) {
|
||||
if (q !== '') {
|
||||
var url = 'https://github.com/ruanyf/es6tutorial/search?utf8=✓&q=' + encodeURIComponent(q);
|
||||
window.open(url, '_blank');
|
||||
win.focus();
|
||||
window.focus();
|
||||
}
|
||||
return false;
|
||||
/*
|
||||
@ -244,6 +243,9 @@ function li_create_linkage(li_tag, header_level) {
|
||||
}
|
||||
|
||||
function create_banner(element) {
|
||||
var banner = $('<div class="wwads-cn wwads-horizontal" data-id="197" style="max-width:100%;"></div>')
|
||||
.insertAfter(element);
|
||||
/*
|
||||
// 2022年8月25日
|
||||
var deadline = new Date(2022, 7, 25);
|
||||
if (deadline - (new Date()) < 0) return;
|
||||
@ -265,6 +267,7 @@ function create_banner(element) {
|
||||
var banner = $('<a href="http://www.apeclass.com?did=12" style="color: #333333;" target="_blank"><div style="' + styleStr + '">' + text + '</div></a>')
|
||||
.insertAfter(element);
|
||||
setTimeout(function () {if (banner.css('display') === 'none') {show_loading();show_error();} }, 500);
|
||||
*/
|
||||
}
|
||||
|
||||
function create_page_anchors() {
|
||||
@ -359,6 +362,7 @@ function statistics() {
|
||||
}
|
||||
|
||||
function router() {
|
||||
window.focus();
|
||||
var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1');
|
||||
|
||||
var hashArr = location.hash.split('#');
|
||||
@ -394,7 +398,7 @@ function router() {
|
||||
|
||||
$.get(path, function(data) {
|
||||
$(ditto.error_id).hide();
|
||||
$(ditto.content_id).html(marked(data) + wwadsCode + disqusCode);
|
||||
$(ditto.content_id).html(marked(data) + disqusCode);
|
||||
if ($(ditto.content_id + " h1").text() === ditto.document_title) {
|
||||
document.title = ditto.document_title;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user