Skip to content

Commit 93d79f3

Browse files
committed
新增 [收起预览帖子] 功能; 新增 [显示是否在线] 功能; 优化 [屏蔽阅读权限 255 帖子] 功能
1 parent d528973 commit 93d79f3

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

Hostloc-Enhanced.user.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,6 @@
169169
if(menu_value('menu_autoSignIn'))autoSignIn(); // 自动签到(访问空间 10 次 = 20 积分)
170170

171171

172-
// 显示在线状态
173-
function onlineStatus() {
174-
document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子
175-
let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚';
176-
let divStatus = document.createElement('div');
177-
divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;';
178-
divStatus.innerText = icon;
179-
let mochu = item.querySelector('.avatar');
180-
mochu.parentNode.insertBefore(divStatus,mochu);
181-
})
182-
}
183-
184172
// 自动签到(访问空间 10 次 = 20 积分)
185173
function autoSignIn() {
186174
if (!loginStatus) return
@@ -374,7 +362,7 @@
374362
}
375363

376364

377-
// 回到顶部(右键左右两侧空白处)
365+
// 快捷回到顶部(右键左右两侧空白处)
378366
function backToTop() {
379367
document.body.oncontextmenu = function(event){
380368
if (event.target==this) {
@@ -385,9 +373,8 @@
385373
}
386374

387375

388-
// 收起当前帖子预览(左键左右两侧空白处)
376+
// 收起帖子预览(左键左右两侧空白处)
389377
function collapsedNowPost() {
390-
//if (!menu_value('menu_collapsedNowAnswer')) return
391378
document.body.onclick = function(event){
392379
if (event.target==this) {
393380
document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) {
@@ -398,6 +385,19 @@
398385
}
399386

400387

388+
// 显示在线状态
389+
function onlineStatus() {
390+
document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子
391+
let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚';
392+
let divStatus = document.createElement('div');
393+
divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;';
394+
divStatus.innerText = icon;
395+
let mochu = item.querySelector('.avatar');
396+
mochu.parentNode.insertBefore(divStatus,mochu);
397+
})
398+
}
399+
400+
401401
// 自动隐藏阅读权限 255 的帖子
402402
function delate255() {
403403
if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){

0 commit comments

Comments
 (0)