From 1c33d3550bf47af11fe72e92e9adaa020d21d90e Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 21 Feb 2024 11:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=87=E7=AD=BE=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MobileSupport/MobileSupport.user.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js b/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js index 4e4f309..b620458 100644 --- a/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js +++ b/NGA_BBS_plugins/MobileSupport/MobileSupport.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name NGA优化摸鱼体验插件-移动端支持 // @namespace https://github.com/lifegpc/userscript/tree/master/NGA_BBS_plugins/MobileSupport -// @version 1.0.4 +// @version 1.0.5 // @author lifegpc // @description 支持移动端页面 // @license MIT @@ -29,6 +29,11 @@ key: 'authorMark', title: '标记楼主', default: true + }, + { + key: "showRemark", + title: "显示标签", + default: false }], buttons: [], beforeSaveSettingFunc(settings) { @@ -44,6 +49,9 @@ if (typeof this.pluginSettings['authorMark'] === 'string') { this.pluginSettings['authorMark'] = true; } + if (typeof this.pluginSettings['showRemark'] === 'string') { + this.pluginSettings['showRemark'] = false; + } }, currentThread: {}, async renderThreadsFunc($el) { @@ -67,6 +75,9 @@ } }, async renderFormsFunc($el) { + let e = $el.find(".c1"); + let es = window.getComputedStyle(e[0], null); + if (es.display !== 'none') return; if (this.pluginSettings['showPostReadingRecord']) { const postReadingRecord = this.mainScript.getModule('PostReadingRecord'); if (postReadingRecord) { @@ -104,6 +115,23 @@ }) } } + if (this.pluginSettings['showRemark']) { + const $ = this.mainScript.libs.$; + const markAndBan = this.mainScript.getModule('MarkAndBan'); + if (markAndBan) { + $el.find('a.b').each(function () { + const name = $(this).attr('hld-mark-before-name') || $(this).text().replace('[', '').replace(']', '') + const uid = ($(this).attr('href') && $(this).attr('href').indexOf('uid=') > -1) ? $(this).attr('href').split('uid=')[1] + '' : '' + console.log(uid, name); + const marks = markAndBan.getUserMarks({ name, uid }) + if (marks) { + let marksDom = '' + marks.marks.forEach(item => marksDom += `${item.mark}`); + $(this).after(marksDom); + } + }) + } + } }, style: `` }