@@ -36,6 +36,9 @@ CHANGES BY NOVEM LINGUAE:
3636- Titles shouldn't have underscores
3737- Fixed bug where the script would always give "signature not found" error if you had MediaWiki:Gadget-CommentsInLocalTime.js gadget installed
3838
39+ CHANGES BY OTHERS SINCE THIS WAS FORKED
40+ - Added dark mode support
41+
3942NOVEM LINGUAE TODO:
4043- test unicode titles
4144- test titles with weird punctuation in section names, e.g. ending in ?
@@ -45,6 +48,41 @@ NOVEM LINGUAE TODO:
4548
4649// <nowiki>
4750
51+ const style = `.anrfc-box {
52+ margin: 16px 0px;
53+ padding: 16px;
54+ background-color: var(--background-color-neutral-subtle, #f8f9fa);
55+ color: inherit;
56+ border: 1px solid #a2a9b1;
57+ font-size: 14px;
58+ font-family: sans-serif;
59+ }
60+
61+ .anrfc-box > h3 {
62+ margin: 0 0 16px;
63+ }
64+
65+ .anrfc-box .anrfc-box-margins {
66+ margin-top: 8px;
67+ }
68+
69+ .mw-ANRFC {
70+ margin-left: 8px;
71+ font-size: small;
72+ font-family: sans-serif;
73+ }
74+
75+ #ca-anrfc .anrfc-link-active {
76+ color: var(--color-destructive, #bf3c2c);
77+ }
78+
79+ #ca-anrfc .anrfc-link-active:hover {
80+ color: var(--color-destructive--hover, #9f3526);
81+ }
82+ ` ;
83+
84+ mw . util . addCSS ( style ) ;
85+
4886class ANRFC {
4987 constructor ( document , mw , $ ) {
5088 this . document = document ;
@@ -85,11 +123,11 @@ class ANRFC {
85123
86124 toggle ( ) {
87125 const $anrfcListerLinkInMoreMenu = this . $ ( '#ca-anrfc a' ) ;
88- if ( $anrfcListerLinkInMoreMenu . css ( 'color ' ) === 'rgb(255, 0, 0)' ) {
89- $anrfcListerLinkInMoreMenu . css ( 'color' , '' ) ;
126+ if ( $anrfcListerLinkInMoreMenu . hasClass ( 'anrfc-link-active ' ) ) {
127+ $anrfcListerLinkInMoreMenu . removeClass ( 'anrfc-link-active' ) ;
90128 this . removeLabels ( ) ;
91129 } else {
92- $anrfcListerLinkInMoreMenu . css ( 'color' , 'red' ) ;
130+ $anrfcListerLinkInMoreMenu . addClass ( 'anrfc-link-active' ) ;
93131 this . addLabels ( ) ;
94132 }
95133 }
@@ -115,7 +153,6 @@ class ANRFC {
115153 that . $ ( 'a[indexkey="' + index + '"]' ) . on ( 'click' , function ( ) {
116154 that . addForm ( this ) ;
117155 } ) ;
118- that . $ ( 'a.mw-ANRFC' ) . css ( { 'margin-left' : '8px' , 'font-size' : 'small' , 'font-family' : 'sans-serif' } ) ;
119156 } ) ;
120157 }
121158
@@ -137,16 +174,8 @@ class ANRFC {
137174
138175 getFormHtmlAndSetFormListeners ( keyId ) {
139176 const $anrfcBox = this . $ ( '<div>' , {
140- id : keyId
141- } ) ;
142-
143- $anrfcBox . css ( {
144- margin : '16px 0' ,
145- padding : '16px' ,
146- 'background-color' : '#f3f3f3' ,
147- border : '1px solid grey' ,
148- 'font-size' : '14px' ,
149- 'font-family' : 'sans-serif'
177+ id : keyId ,
178+ class : "anrfc-box"
150179 } ) ;
151180
152181 const items = [ ] ;
@@ -184,21 +213,17 @@ class ANRFC {
184213 label : 'Cancel'
185214 } ) ;
186215
187- $anrfcBox . append ( '<h3 style="margin: 0 0 16px;" >List this discussion on <a href="/wiki/Wikipedia:Closure_requests" target="_blank">Wikipedia:Closure requests</a></h3>' ) ;
216+ $anrfcBox . append ( '<h3>List this discussion on <a href="/wiki/Wikipedia:Closure_requests" target="_blank">Wikipedia:Closure requests</a></h3>' ) ;
188217 let wrapper = this . document . createElement ( 'div' ) ;
189218 this . $ ( wrapper ) . append ( '<p>Under section: </p>' ) ;
190219 this . $ ( wrapper ) . append ( dropDown . $element ) ;
191220 $anrfcBox . append ( wrapper ) ;
192221
193222 wrapper = this . document . createElement ( 'div' ) ;
194- this . $ ( wrapper ) . css ( { 'margin-top' : '8px' } ) ;
223+ this . $ ( wrapper ) . addClass ( 'anrfc-box-margins' ) ;
195224 this . $ ( wrapper ) . append ( messageInput . $element ) ;
196- this . $ ( wrapper ) . append ( this . $ ( submitButton . $element ) . css ( {
197- 'margin-top' : '8px'
198- } ) ) ;
199- this . $ ( wrapper ) . append ( this . $ ( cancelButton . $element ) . css ( {
200- 'margin-top' : '8px'
201- } ) ) ;
225+ this . $ ( wrapper ) . append ( this . $ ( submitButton . $element ) . addClass ( 'anrfc-box-margins' ) ) ;
226+ this . $ ( wrapper ) . append ( this . $ ( cancelButton . $element ) . addClass ( 'anrfc-box-margins' ) ) ;
202227 $anrfcBox . append ( wrapper ) ;
203228
204229 submitButton . on ( 'click' , ( ) => {
0 commit comments