@@ -15,6 +15,7 @@ var ditto = {
15
15
theme_button : true ,
16
16
save_progress : true , // 保存阅读进度
17
17
search_bar : true ,
18
+ wwads : true ,
18
19
19
20
// initialize function
20
21
run : initialize
@@ -78,6 +79,10 @@ function init_sidebar_section() {
78
79
init_searchbar ( ) ;
79
80
}
80
81
82
+ if ( ditto . wwads ) {
83
+ init_wwads ( ) ;
84
+ }
85
+
81
86
// 初始化内容数组
82
87
var menuOL = $ ( ditto . sidebar_id + ' ol' ) ;
83
88
menuOL . attr ( 'start' , 0 ) ;
@@ -139,6 +144,11 @@ function searchbar_listener(event) {
139
144
*/
140
145
}
141
146
147
+ function init_wwads ( ) {
148
+ var wwads = '<div class="wwads-cn wwads-horizontal" data-id="197" style="max-width:100%;"></div>' ;
149
+ $ ( ditto . sidebar_id ) . find ( 'h2' ) . first ( ) . before ( $ ( wwads ) ) ;
150
+ }
151
+
142
152
function init_theme_button ( ) {
143
153
$ ( ditto . theme_id ) . show ( ) ;
144
154
// 默认主题
@@ -243,9 +253,6 @@ function li_create_linkage(li_tag, header_level) {
243
253
}
244
254
245
255
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
- /*
249
256
// 2022年8月25日
250
257
var deadline = new Date ( 2022 , 7 , 25 ) ;
251
258
if ( deadline - ( new Date ( ) ) < 0 ) return ;
@@ -267,7 +274,6 @@ function create_banner(element) {
267
274
var banner = $ ( '<a href="http://www.apeclass.com?did=12" style="color: #333333;" target="_blank"><div style="' + styleStr + '">' + text + '</div></a>' )
268
275
. insertAfter ( element ) ;
269
276
setTimeout ( function ( ) { if ( banner . css ( 'display' ) === 'none' ) { show_loading ( ) ; show_error ( ) ; } } , 500 ) ;
270
- */
271
277
}
272
278
273
279
function create_page_anchors ( ) {
@@ -362,7 +368,6 @@ function statistics() {
362
368
}
363
369
364
370
function router ( ) {
365
- window . focus ( ) ;
366
371
var path = location . hash . replace ( / # ( [ ^ # ] * ) ( # .* ) ? / , './$1' ) ;
367
372
368
373
var hashArr = location . hash . split ( '#' ) ;
0 commit comments