Skip to content

Commit 8be1546

Browse files
committed
新增 [全站最近更新主题]; 优化 自动无缝翻页敏感度
1 parent cbe1dcc commit 8be1546

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

V2ex-Enhanced.user.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name V2EX 增强
3-
// @version 1.0.8
3+
// @version 1.0.9
44
// @author X.I.U
55
// @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼)
66
// @match *://v2ex.com/*
@@ -86,7 +86,7 @@
8686
pageElement: 'css;.cell.item',
8787
HT_insert: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
8888
replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table',
89-
scrollDelta: 600
89+
scrollDelta: 1000
9090
},
9191
function: {
9292
after: linksBlank,
@@ -131,7 +131,7 @@
131131
pageElement: 'css;#TopicsNode > div',
132132
HT_insert: ['css;#TopicsNode', 3],
133133
replaceE: 'css;#Main > .box > .cell[style] > table',
134-
scrollDelta: 700
134+
scrollDelta: 1000
135135
},
136136
function: {
137137
after: linksBlank,
@@ -146,7 +146,7 @@
146146
pageElement: 'css;.cell[id^="r_"]',
147147
HT_insert: ['//div[starts-with(@id, "r_")][last()]/following-sibling::div[@class="cell"][1]', 1],
148148
replaceE: 'css;#Main > .box > .cell[style] > table',
149-
scrollDelta: 700
149+
scrollDelta: 1000
150150
}
151151
},
152152
reply_positive: { // 帖子内容页(正序)
@@ -157,7 +157,7 @@
157157
pageElement: 'css;.cell[id^="r_"]',
158158
HT_insert: ['//div[starts-with(@id, "r_")][1]', 1],
159159
replaceE: 'css;#Main > .box > .cell[style] > table',
160-
scrollDelta: 700
160+
scrollDelta: 1000
161161
}
162162
},
163163
balance: { // 账户余额页
@@ -177,6 +177,7 @@
177177
switch (location.pathname) {
178178
case "/": // 首页
179179
linksBlank('#Main a.topic-link:not([target])');
180+
addChangesLink();
180181
break;
181182
case "/recent": // 最近主题页
182183
curSite = DBSite.recent;
@@ -350,6 +351,13 @@
350351
}
351352

352353

354+
// 添加全站最近更新主题链接
355+
function addChangesLink() {
356+
let links = document.querySelector('#Main .box .inner:last-child');if (!links) return
357+
links.innerHTML = `<div style="float: left;"><span class="chevron">»</span> &nbsp;<a href="/recent" target="_blank">更多新主题</a></div><div style="text-align: right;"><a href="/changes" target="_blank" style="text-align: right;">全站最近更新主题</a> &nbsp;<span class="chevron">«</span></div>`
358+
}
359+
360+
353361
// 自动无缝翻页
354362
function pageLoading() {
355363
if (curSite.SiteTypeID > 0){

0 commit comments

Comments
 (0)