Skip to content

Commit 010daf6

Browse files
committed
refactor: adjust wwads banner
1 parent 536ac22 commit 010daf6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/ditto.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ var getHash = function (hash) {
4545
};
4646

4747
var disqusCode = '<h3>留言</h3><div id="disqus_thread"></div>';
48-
var wwadsCode = '<div class="wwads-cn wwads-horizontal" data-id="197" style="max-width:100%;"></div>';
4948
var menu = new Array();
5049

5150
function initialize() {
@@ -126,7 +125,7 @@ function searchbar_listener(event) {
126125
if (q !== '') {
127126
var url = 'https://github.com/ruanyf/es6tutorial/search?utf8=✓&q=' + encodeURIComponent(q);
128127
window.open(url, '_blank');
129-
win.focus();
128+
window.focus();
130129
}
131130
return false;
132131
/*
@@ -244,6 +243,9 @@ function li_create_linkage(li_tag, header_level) {
244243
}
245244

246245
function create_banner(element) {
246+
var banner = $('<div class="wwads-cn wwads-horizontal" data-id="197" style="max-width:100%;"></div>')
247+
.insertAfter(element);
248+
/*
247249
// 2022年8月25日
248250
var deadline = new Date(2022, 7, 25);
249251
if (deadline - (new Date()) < 0) return;
@@ -265,6 +267,7 @@ function create_banner(element) {
265267
var banner = $('<a href="http://www.apeclass.com?did=12" style="color: #333333;" target="_blank"><div style="' + styleStr + '">' + text + '</div></a>')
266268
.insertAfter(element);
267269
setTimeout(function () {if (banner.css('display') === 'none') {show_loading();show_error();} }, 500);
270+
*/
268271
}
269272

270273
function create_page_anchors() {
@@ -358,7 +361,8 @@ function statistics() {
358361
s.parentNode.insertBefore(hm, s);
359362
}
360363

361-
function router() {
364+
function router() {
365+
window.focus();
362366
var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1');
363367

364368
var hashArr = location.hash.split('#');
@@ -394,7 +398,7 @@ function router() {
394398

395399
$.get(path, function(data) {
396400
$(ditto.error_id).hide();
397-
$(ditto.content_id).html(marked(data) + wwadsCode + disqusCode);
401+
$(ditto.content_id).html(marked(data) + disqusCode);
398402
if ($(ditto.content_id + " h1").text() === ditto.document_title) {
399403
document.title = ditto.document_title;
400404
} else {

0 commit comments

Comments
 (0)