修复层主名称提取BUG

This commit is contained in:
2024-02-22 14:27:41 +08:00
parent 98c1c5ed58
commit 069539f62a
2 changed files with 6 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name NGA优化摸鱼体验插件-移动端支持
// @namespace https://github.com/lifegpc/userscript/tree/master/NGA_BBS_plugins/MobileSupport
// @version 1.0.8
// @version 1.0.9
// @author lifegpc
// @description 支持移动端页面
// @license MIT
@@ -124,7 +124,7 @@
const marks = markAndBan.getUserMarks({ name, uid })
if (marks) {
let marksDom = ''
marks.marks.forEach(item => marksDom += `<span ${item.desc ? 'class="hld__help" help="' + item.desc + '"' : 'class="hld__post-author"'} style="color: ${item.text_color};background-color: ${item.bg_color};">${item.mark}</span>`);
marks.marks.forEach(item => marksDom += `<span ${item.desc ? 'class="hld__help hld__post-author" help="' + item.desc + '"' : 'class="hld__post-author"'} style="color: ${item.text_color};background-color: ${item.bg_color};">${item.mark}</span>`);
$(this).after(marksDom);
}
})
@@ -135,7 +135,7 @@
const markAndBan = this.mainScript.getModule('MarkAndBan');
if (markAndBan) {
const currentUid = $el.find("a.userlink").attr("href").split("uid=")[1] + '';
const currentName = $el.find("a.userlink").text().replace('楼主', '');
const currentName = $el.find("a.userlink")[0].innerText.replace('楼主', '');
$el.find(".posterInfoLineB").each(function () {
$(this).prepend(`<a class="cell rep b txtbtnx nobr block_txt_big postbtmb hld__extra-icon hld__mobile_extra-icon" data-type="mark" title="标签此用户" data-name="${currentName}" data-uid="${currentUid}"><svg t="1686732786072" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2385"><path d="M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z" fill="#3970fe" p-id="2386" data-spm-anchor-id="a313x.7781069.0.i0" class="selected"></path></svg></a><a class="cell rep b txtbtnx nobr block_txt_big postbtmb hld__extra-icon hld__mobile_extra-icon" title="拉黑此用户(屏蔽所有言论)" data-type="ban" data-name="${currentName}" data-uid="${currentUid}"><svg t="1686733137783" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12682"><path d="M512 0a512 512 0 1 0 0 1024 512 512 0 0 0 0-1024zM204.8 409.6h614.4v204.8H204.8V409.6z" fill="#d00309" p-id="12683" data-spm-anchor-id="a313x.7781069.0.i10" class="selected"></path></svg></a>`)
})

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name NGA优化摸鱼体验插件-移动端支持
// @namespace https://github.com/lifegpc/userscript/tree/master/NGA_BBS_plugins/MobileSupport
// @version 1.0.8
// @version 1.0.9
// @author lifegpc
// @description 支持移动端页面
// @license MIT
@@ -125,7 +125,7 @@
const marks = markAndBan.getUserMarks({ name, uid })
if (marks) {
let marksDom = ''
marks.marks.forEach(item => marksDom += `<span ${item.desc ? 'class="hld__help" help="' + item.desc + '"' : 'class="hld__post-author"'} style="color: ${item.text_color};background-color: ${item.bg_color};">${item.mark}</span>`);
marks.marks.forEach(item => marksDom += `<span ${item.desc ? 'class="hld__help hld__post-author" help="' + item.desc + '"' : 'class="hld__post-author"'} style="color: ${item.text_color};background-color: ${item.bg_color};">${item.mark}</span>`);
$(this).after(marksDom);
}
})
@@ -136,7 +136,7 @@
const markAndBan = this.mainScript.getModule('MarkAndBan');
if (markAndBan) {
const currentUid = $el.find("a.userlink").attr("href").split("uid=")[1] + '';
const currentName = $el.find("a.userlink").text().replace('楼主', '');
const currentName = $el.find("a.userlink")[0].innerText.replace('楼主', '');
$el.find(".posterInfoLineB").each(function () {
$(this).prepend(`<a class="cell rep b txtbtnx nobr block_txt_big postbtmb hld__extra-icon hld__mobile_extra-icon" data-type="mark" title="标签此用户" data-name="${currentName}" data-uid="${currentUid}"><svg t="1686732786072" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2385"><path d="M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z" fill="#3970fe" p-id="2386" data-spm-anchor-id="a313x.7781069.0.i0" class="selected"></path></svg></a><a class="cell rep b txtbtnx nobr block_txt_big postbtmb hld__extra-icon hld__mobile_extra-icon" title="拉黑此用户(屏蔽所有言论)" data-type="ban" data-name="${currentName}" data-uid="${currentUid}"><svg t="1686733137783" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12682"><path d="M512 0a512 512 0 1 0 0 1024 512 512 0 0 0 0-1024zM204.8 409.6h614.4v204.8H204.8V409.6z" fill="#d00309" p-id="12683" data-spm-anchor-id="a313x.7781069.0.i10" class="selected"></path></svg></a>`)
})