Skip to content

Commit 931a591

Browse files
committed
UnblockReview: detect old background color in {{Unblock}} templates
it appears some unblock templates are still using it
1 parent 8997884 commit 931a591

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

UnblockReview/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Many additional bugs fixed.
66
/* global importStylesheet */
77
// <nowiki>
88
( function () {
9-
const UNBLOCK_REQ_COLOR = 'var(--background-color-progressive-subtle, #EBF4FF)';
9+
const UNBLOCK_REQ_COLOR_PRE_2025 = 'rgb(235, 244, 255)';
10+
const UNBLOCK_REQ_COLOR_POST_2025 = 'var(--background-color-progressive-subtle, #EBF4FF)';
1011
const DEFAULT_DECLINE_REASON = '{{subst:Decline reason here}}';
1112
const ADVERT = ' ([[User:Novem Linguae/Scripts/UnblockReview.js|unblock-review]])';
1213

@@ -28,7 +29,10 @@ Many additional bugs fixed.
2829
// look for user-block HTML class, which will correspond to {{Unblock}} requests
2930
const userBlockBoxes = document.querySelectorAll( 'div.user-block' );
3031
for ( let i = 0, n = userBlockBoxes.length; i < n; i++ ) {
31-
if ( userBlockBoxes[ i ].style.background !== UNBLOCK_REQ_COLOR ) {
32+
if (
33+
userBlockBoxes[ i ].style[ 'background-color' ] !== UNBLOCK_REQ_COLOR_PRE_2025 &&
34+
userBlockBoxes[ i ].style.background !== UNBLOCK_REQ_COLOR_POST_2025
35+
) {
3236
continue;
3337
}
3438

0 commit comments

Comments
 (0)