11// ==UserScript==
22// @name XMOJ
3- // @version 3.3.3
3+ // @version 3.3.4
44// @description XMOJ增强脚本
55// @author @XMOJ -Script-dev, @langningchen and the community
66// @namespace https://github/langningchen
@@ -3043,13 +3043,15 @@ async function main() {
30433043 HeaderCells [ 2 ] . innerText = "昵称" ;
30443044 HeaderCells [ 3 ] . innerText = "AC数" ;
30453045 HeaderCells [ 4 ] . innerText = "得分" ;
3046- for ( let j = 0 ; j < HeaderCells . length ; j ++ ) {
3047- HeaderCells [ j ] . removeAttribute ( "bgcolor" ) ;
3048- HeaderCells [ j ] . style . setProperty ( "background-color" , "black" , "important" ) ;
3049- HeaderCells [ j ] . style . setProperty ( "color" , "white" , "important" ) ;
3050- let Links = HeaderCells [ j ] . querySelectorAll ( "a" ) ;
3051- for ( let k = 0 ; k < Links . length ; k ++ ) {
3052- Links [ k ] . style . setProperty ( "color" , "white" , "important" ) ;
3046+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3047+ for ( let j = 0 ; j < HeaderCells . length ; j ++ ) {
3048+ HeaderCells [ j ] . removeAttribute ( "bgcolor" ) ;
3049+ HeaderCells [ j ] . style . setProperty ( "background-color" , "black" , "important" ) ;
3050+ HeaderCells [ j ] . style . setProperty ( "color" , "white" , "important" ) ;
3051+ let Links = HeaderCells [ j ] . querySelectorAll ( "a" ) ;
3052+ for ( let k = 0 ; k < Links . length ; k ++ ) {
3053+ Links [ k ] . style . setProperty ( "color" , "white" , "important" ) ;
3054+ }
30533055 }
30543056 }
30553057 let RefreshOIRank = async ( ) => {
@@ -3062,7 +3064,9 @@ async function main() {
30623064 TidyTable ( ParsedDocument . getElementById ( "rank" ) ) ;
30633065 let Temp = ParsedDocument . getElementById ( "rank" ) . rows ;
30643066 for ( var i = 1 ; i < Temp . length ; i ++ ) {
3065- Temp [ i ] . style . backgroundColor = "" ;
3067+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3068+ Temp [ i ] . style . backgroundColor = "" ;
3069+ }
30663070 let MetalCell = Temp [ i ] . cells [ 0 ] ;
30673071 let Metal = document . createElement ( "span" ) ;
30683072 Metal . innerText = MetalCell . innerText ;
@@ -3072,9 +3076,11 @@ async function main() {
30723076 GetUsernameHTML ( Temp [ i ] . cells [ 1 ] , Temp [ i ] . cells [ 1 ] . innerText ) ;
30733077 Temp [ i ] . cells [ 2 ] . innerHTML = Temp [ i ] . cells [ 2 ] . innerText ;
30743078 Temp [ i ] . cells [ 3 ] . innerHTML = Temp [ i ] . cells [ 3 ] . innerText ;
3075- for ( let j = 0 ; j < 5 && j < Temp [ i ] . cells . length ; j ++ ) {
3076- Temp [ i ] . cells [ j ] . style . backgroundColor = "" ;
3077- Temp [ i ] . cells [ j ] . style . color = "" ;
3079+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3080+ for ( let j = 0 ; j < 5 && j < Temp [ i ] . cells . length ; j ++ ) {
3081+ Temp [ i ] . cells [ j ] . style . backgroundColor = "" ;
3082+ Temp [ i ] . cells [ j ] . style . color = "" ;
3083+ }
30783084 }
30793085 for ( let j = 5 ; j < Temp [ i ] . cells . length ; j ++ ) {
30803086 let InnerText = Temp [ i ] . cells [ j ] . innerText ;
@@ -3144,13 +3150,15 @@ async function main() {
31443150 HeaderCells [ 2 ] . innerText = "昵称" ;
31453151 HeaderCells [ 3 ] . innerText = "AC数" ;
31463152 HeaderCells [ 4 ] . innerText = "得分" ;
3147- for ( let j = 0 ; j < HeaderCells . length ; j ++ ) {
3148- HeaderCells [ j ] . removeAttribute ( "bgcolor" ) ;
3149- HeaderCells [ j ] . style . setProperty ( "background-color" , "black" , "important" ) ;
3150- HeaderCells [ j ] . style . setProperty ( "color" , "white" , "important" ) ;
3151- let Links = HeaderCells [ j ] . querySelectorAll ( "a" ) ;
3152- for ( let k = 0 ; k < Links . length ; k ++ ) {
3153- Links [ k ] . style . setProperty ( "color" , "white" , "important" ) ;
3153+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3154+ for ( let j = 0 ; j < HeaderCells . length ; j ++ ) {
3155+ HeaderCells [ j ] . removeAttribute ( "bgcolor" ) ;
3156+ HeaderCells [ j ] . style . setProperty ( "background-color" , "black" , "important" ) ;
3157+ HeaderCells [ j ] . style . setProperty ( "color" , "white" , "important" ) ;
3158+ let Links = HeaderCells [ j ] . querySelectorAll ( "a" ) ;
3159+ for ( let k = 0 ; k < Links . length ; k ++ ) {
3160+ Links [ k ] . style . setProperty ( "color" , "white" , "important" ) ;
3161+ }
31543162 }
31553163 }
31563164 let RefreshCorrectRank = async ( ) => {
@@ -3163,7 +3171,9 @@ async function main() {
31633171 TidyTable ( ParsedDocument . getElementById ( "rank" ) ) ;
31643172 let Temp = ParsedDocument . getElementById ( "rank" ) . rows ;
31653173 for ( var i = 1 ; i < Temp . length ; i ++ ) {
3166- Temp [ i ] . style . backgroundColor = "" ;
3174+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3175+ Temp [ i ] . style . backgroundColor = "" ;
3176+ }
31673177 let MetalCell = Temp [ i ] . cells [ 0 ] ;
31683178 let Metal = document . createElement ( "span" ) ;
31693179 Metal . innerText = MetalCell . innerText ;
@@ -3173,9 +3183,11 @@ async function main() {
31733183 GetUsernameHTML ( Temp [ i ] . cells [ 1 ] , Temp [ i ] . cells [ 1 ] . innerText ) ;
31743184 Temp [ i ] . cells [ 2 ] . innerHTML = Temp [ i ] . cells [ 2 ] . innerText ;
31753185 Temp [ i ] . cells [ 3 ] . innerHTML = Temp [ i ] . cells [ 3 ] . innerText ;
3176- for ( let j = 0 ; j < 5 && j < Temp [ i ] . cells . length ; j ++ ) {
3177- Temp [ i ] . cells [ j ] . style . backgroundColor = "" ;
3178- Temp [ i ] . cells [ j ] . style . color = "" ;
3186+ if ( UtilityEnabled ( "MonochromeUI" ) ) {
3187+ for ( let j = 0 ; j < 5 && j < Temp [ i ] . cells . length ; j ++ ) {
3188+ Temp [ i ] . cells [ j ] . style . backgroundColor = "" ;
3189+ Temp [ i ] . cells [ j ] . style . color = "" ;
3190+ }
31793191 }
31803192 for ( let j = 5 ; j < Temp [ i ] . cells . length ; j ++ ) {
31813193 let InnerText = Temp [ i ] . cells [ j ] . innerText ;
0 commit comments