|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 自动无缝翻页 |
3 | | -// @version 2.0.4 |
| 3 | +// @version 2.0.5 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、看雪论坛、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic(嗨漫画)、动漫之家、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl(更多的写不下了... |
6 | 6 | // @match *://*/* |
|
108 | 108 | pager: { |
109 | 109 | type: 2, |
110 | 110 | nextLink: '#autopbn', |
111 | | - nextText: '下一页 »', |
| 111 | + nextTextOf: '下一页', |
112 | 112 | scrollDelta: 1500 |
113 | 113 | } |
114 | 114 | }, // Discuz! - 各版块帖子列表(自带无缝加载下一页按钮的) |
| 115 | + discuz_guide: { |
| 116 | + SiteTypeID: 0, |
| 117 | + pager: { |
| 118 | + type: 1, |
| 119 | + nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]', |
| 120 | + pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]', |
| 121 | + insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3], |
| 122 | + replaceE: 'css;.pg, .pages', |
| 123 | + scrollDelta: 1000 |
| 124 | + } |
| 125 | + }, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的) |
| 126 | + discuz_waterfall: { |
| 127 | + SiteTypeID: 0, |
| 128 | + pager: { |
| 129 | + type: 1, |
| 130 | + nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]', |
| 131 | + pageElement: 'css;#waterfall > li', |
| 132 | + insertPosition: ['css;#waterfall', 3], |
| 133 | + replaceE: 'css;.pg, .pages', |
| 134 | + scrollDelta: 1000 |
| 135 | + } |
| 136 | + }, // Discuz! - 图片模式的各版块帖子列表(不带无缝加载下一页按钮的) |
115 | 137 | discuz_thread: { |
116 | 138 | SiteTypeID: 0, |
117 | 139 | pager: { |
|
134 | 156 | scrollDelta: 1000 |
135 | 157 | } |
136 | 158 | }, // Discuz! - 搜索页 |
137 | | - discuz_guide: { |
138 | | - SiteTypeID: 0, |
139 | | - pager: { |
140 | | - type: 1, |
141 | | - nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]', |
142 | | - pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]', |
143 | | - insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3], |
144 | | - replaceE: 'css;.pg, .pages', |
145 | | - scrollDelta: 1000 |
146 | | - } |
147 | | - }, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的) |
148 | 159 | discuz_youspace: { |
149 | 160 | SiteTypeID: 0, |
150 | 161 | pager: { |
|
1847 | 1858 | if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 > |
1848 | 1859 | if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮 |
1849 | 1860 | curSite = DBSite.discuz_forum; |
| 1861 | + } else if (document.getElementById('waterfall')) { // 判断是否为图片模式 |
| 1862 | + curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理 |
1850 | 1863 | } else { |
1851 | 1864 | curSite = DBSite.discuz_guide; |
1852 | 1865 | } |
|
1862 | 1875 | if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 > |
1863 | 1876 | if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮 |
1864 | 1877 | curSite = DBSite.discuz_forum; |
| 1878 | + } else if (document.getElementById('waterfall')) { // 判断是否为图片模式 |
| 1879 | + curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理 |
1865 | 1880 | } else { |
1866 | 1881 | curSite = DBSite.discuz_guide; |
1867 | 1882 | } |
|
1904 | 1919 | document.lastChild.appendChild(document.createElement('style')).textContent = '.pgbtn {display: none;}'; |
1905 | 1920 | } |
1906 | 1921 |
|
| 1922 | + // [Discuz! 论坛] 图片模式列表样式预处理 |
| 1923 | + function waterfallStyle() { |
| 1924 | + let width = document.querySelector('#waterfall > li:first-child').style.width; |
| 1925 | + document.lastChild.appendChild(document.createElement('style')).textContent = `#waterfall {height: auto !important; width: 100% !important;} |
| 1926 | + #waterfall > li {width: ${width} !important; float: left !important; position: inherit !important; left: auto !important; top: auto !important;}`; |
| 1927 | + } |
| 1928 | + |
1907 | 1929 |
|
1908 | 1930 | // 通用型插入前函数(加载图片 data-original => src) |
1909 | 1931 | function src_original_functionBefore(pageElems) { |
|
0 commit comments