Skip to content

Commit 3d6ca28

Browse files
committed
新增 [飞客网内论坛] 支持
1 parent f958bef commit 3d6ca28

1 file changed

Lines changed: 45 additions & 17 deletions

File tree

Autopage.user.js

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 1.8.9
3+
// @version 1.9.0
44
// @author X.I.U
55
// @description 无缝拼接下一页内容,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画DB、HiComic(嗨漫画)、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl...
66
// @match *://*/*
@@ -61,7 +61,7 @@
6161

6262
} else if (menuAll[i][0] === 'menu_discuz_thread_page') { // 帖子内自动翻页 (仅论坛)
6363

64-
if (webType === 2 || location.host === 'cs.rin.ru') {
64+
if (webType === 2 || location.host === 'cs.rin.ru' || location.host === 'www.flyert.com') {
6565
menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
6666
}
6767

@@ -72,6 +72,7 @@
7272
menuId[menuId.length] = GM_registerMenuCommand('💬 反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412212/feedback', {active: true,insert: true,setParent: true});});
7373
}
7474

75+
// 网站规则
7576
function setDBSite() {
7677
/*
7778
自动翻页规则
@@ -350,7 +351,7 @@
350351
nextText: '查看更多c',
351352
scrollDelta: 1000
352353
}
353-
}, // 微博评论
354+
}, // 微博评论
354355
nga_thread: {
355356
SiteTypeID: 0,
356357
host: 'bbs.nga.cn',
@@ -371,7 +372,7 @@
371372
function: {
372373
after: nga_thread_functionAfter
373374
}
374-
}, // NGA - 各版块帖子列表
375+
}, // NGA - 各版块帖子列表
375376
nga_read: {
376377
SiteTypeID: 0,
377378
pager: {
@@ -383,7 +384,7 @@
383384
scriptType: 2,
384385
scrollDelta: 1000
385386
}
386-
}, // NGA - 帖子内
387+
}, // NGA - 帖子内
387388
v2ex_recent: {
388389
SiteTypeID: 0,
389390
host: ['v2ex.com', 'www.v2ex.com'],
@@ -416,7 +417,7 @@
416417
after: v2ex_functionAfter,
417418
parameter: '#Main a.topic-link:not([target])'
418419
}
419-
}, // V2EX - 最近主题页
420+
}, // V2EX - 最近主题页
420421
v2ex_notifications: {
421422
SiteTypeID: 0,
422423
pager: {
@@ -431,7 +432,7 @@
431432
after: v2ex_functionAfter,
432433
parameter: '#Main a[href^="/t/"]:not([target])'
433434
}
434-
}, // V2EX - 提醒消息页
435+
}, // V2EX - 提醒消息页
435436
v2ex_replies: {
436437
SiteTypeID: 0,
437438
pager: {
@@ -446,7 +447,7 @@
446447
after: v2ex_functionAfter,
447448
parameter: '#Main a[href^="/t/"]:not([target])'
448449
}
449-
}, // V2EX - 用户回复页
450+
}, // V2EX - 用户回复页
450451
v2ex_go: {
451452
SiteTypeID: 0,
452453
pager: {
@@ -461,7 +462,7 @@
461462
after: v2ex_functionAfter,
462463
parameter: '#Main a.topic-link:not([target])'
463464
}
464-
}, // V2EX - 分类主题页
465+
}, // V2EX - 分类主题页
465466
v2ex_balance: {
466467
SiteTypeID: 0,
467468
pager: {
@@ -472,7 +473,7 @@
472473
replaceE: 'css;#Main > .box > .cell[style] > table',
473474
scrollDelta: 1000
474475
}
475-
}, // V2EX - 账户余额页
476+
}, // V2EX - 账户余额页
476477
xcar_forumdisplay: {
477478
SiteTypeID: 0,
478479
host: 'www.xcar.com.cn',
@@ -485,7 +486,35 @@
485486
replaceE: 'css;.forumList_page',
486487
scrollDelta: 2000
487488
}
488-
}, // 爱卡汽车网论坛 - 各版块帖子列表
489+
}, // 爱卡汽车网论坛 - 各版块帖子列表
490+
flyert_forumdisplay: {
491+
SiteTypeID: 0,
492+
host: 'www.flyert.com',
493+
functionStart: function() {if (location.search.indexOf('mod=forumdisplay') > -1) {
494+
curSite = DBSite.flyert_forumdisplay;
495+
} else if (location.search.indexOf('mod=viewthread') > -1) {
496+
if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;}
497+
}},
498+
pager: {
499+
type: 1,
500+
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
501+
pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]',
502+
insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
503+
replaceE: 'css;.pg',
504+
scrollDelta: 2500
505+
}
506+
}, // 飞客网论坛 - 各版块帖子列表
507+
flyert_viewthread: {
508+
SiteTypeID: 0,
509+
pager: {
510+
type: 1,
511+
nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
512+
pageElement: 'css;#postlist > .comiis_viewbox',
513+
insertPosition: ['css;#postlist', 3],
514+
replaceE: 'css;.comiis_pgs > .pg',
515+
scrollDelta: 3000
516+
}
517+
}, // 飞客网论坛 - 帖子内
489518
expreview: {
490519
SiteTypeID: 0,
491520
host: 'www.expreview.com',
@@ -495,7 +524,7 @@
495524
intervals: 1500,
496525
scrollDelta: 1500
497526
}
498-
}, // 超能网
527+
}, // 超能网
499528
ithome: {
500529
SiteTypeID: 0,
501530
host: 'www.ithome.com',
@@ -505,7 +534,7 @@
505534
intervals: 1500,
506535
scrollDelta: 1500
507536
}
508-
}, // IT 之家
537+
}, // IT 之家
509538
_58pic: {
510539
SiteTypeID: 0,
511540
host: 'www.58pic.com',
@@ -525,7 +554,7 @@
525554
function: {
526555
before: _58pic_functionBefore
527556
}
528-
}, // 千图网 - 分类/搜索页
557+
}, // 千图网 - 分类/搜索页
529558
_58pic_c: {
530559
SiteTypeID: 0,
531560
pager: {
@@ -539,7 +568,7 @@
539568
function: {
540569
before: _58pic_functionBefore
541570
}
542-
}, // 千图网 - 专题/收藏夹
571+
}, // 千图网 - 专题/收藏夹
543572
pixabay: {
544573
SiteTypeID: 0,
545574
host: 'pixabay.com',
@@ -2249,8 +2278,6 @@
22492278
console.info('[自动无缝翻页] - Flarum 论坛'); return 3;
22502279
} else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
22512280
console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4;
2252-
} else if (location.host === 'www.flyert.com') {
2253-
console.info('[自动无缝翻页] - 部分內嵌的 Discuz! 论坛'); return 2;
22542281
}
22552282
return 0;
22562283
}
@@ -2425,6 +2452,7 @@
24252452
try {
24262453
let oriE = getAllElements(curSite.pager.replaceE),
24272454
repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
2455+
//console.log(oriE, repE);
24282456
if (oriE.length === repE.length) {
24292457
for (let i = 0; i < oriE.length; i++) {
24302458
oriE[i].outerHTML = repE[i].outerHTML;

0 commit comments

Comments
 (0)