跳到正文

个人记录

回复消息脚本

Allen123456hello约 2 分钟
原文

这是 2025年10月11日 存档的第 4 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年5月23日
篇幅
约 2 分钟

版本

  1. v5当前
  2. v4
  3. v3
  4. v2
更早的 1 个版本
  1. v1

还改了一下

JavaScript
// ==UserScript==
// @name         NFLSOJ Comment Helper
// @namespace    none
// @version      0.0.4
// @description  NFLSOJ Comment Helper
// @author       Allen123456hello
// @license      GPL-3.0-or-later
// @match        http://www.nfls.com.cn:20035/article/*
// @match        http://192.168.188.77/article/*
// @icon         http://www.nfls.com.cn:10611/favicon.ico
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    const cur=window.location.pathname.split('/');
    var id=undefined;
    for (let i=1;i<cur.length;++i){if (cur[i]=='article'){if (cur.length==i+2){id=cur[i+1];}break;}}
    console.log(id);
    if (id=="0"){return;}
    const replyhtml=`<form class="ui reply form" method="post" action="/article/${id}/comment"><div class="field"><textarea name="comment" class="markdown-edit"></textarea></div><div style="text-align: center; "><button id="submit_button" type="submit" class="ui labeled submit icon button"><i class="icon edit"></i> 回复</button></div></form>`;
    if (id){document.querySelector(".padding").insertAdjacentHTML("beforeend",replyhtml);}else{console.log("Unknown Error");}
})();