洛谷用户名优化 Luogu username optimize

让你的洛谷用户名变成紫色并添加管理员标签,让自己变成管理员QAQ

目前為 2019-01-11 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         洛谷用户名优化 Luogu username optimize
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  让你的洛谷用户名变成紫色并添加管理员标签,让自己变成管理员QAQ
// @author       andyli
// @match        https://www.luogu.org*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var tar = document.getElementsByClassName("lg-fg-red lg-bold");
    var ele = "&nbsp;<span class=\"am-badge am-radius lg-bg-purple\">管理员</span>";
    for (var i = 0; i < tar.length; i++)
    {
        if (tar[i].attributes['href'].value == "/space/show?uid=84282")
        {
            $(tar[i]).after(ele);
            tar[i].className="lg-fg-purple lg-bold";
        }
    }
})();