Add ban button

This commit is contained in:
2024-02-21 13:28:31 +08:00
parent c7c6d37201
commit 61d175fe03

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name NGA优化摸鱼体验插件-移动端支持
// @namespace https://github.com/lifegpc/userscript/tree/master/NGA_BBS_plugins/MobileSupport
// @version 1.0.6
// @version 1.0.7
// @author lifegpc
// @description 支持移动端页面
// @license MIT
@@ -33,7 +33,7 @@
{
key: "showRemark",
title: "显示标签",
default: false
default: true
}],
buttons: [],
beforeSaveSettingFunc(settings) {
@@ -50,7 +50,7 @@
this.pluginSettings['authorMark'] = true;
}
if (typeof this.pluginSettings['showRemark'] === 'string') {
this.pluginSettings['showRemark'] = false;
this.pluginSettings['showRemark'] = true;
}
},
currentThread: {},
@@ -119,8 +119,6 @@
const $ = this.mainScript.libs.$;
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('楼主', '');
$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] + '' : ''
@@ -132,8 +130,16 @@
$(this).after(marksDom);
}
})
}
}
{
const $ = this.mainScript.libs.$;
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('楼主', '');
$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>`)
$(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>`)
})
}
}