2 * JavaScript for Special:RevisionDelete
6 var colonSeparator
= mw
.message( 'colon-separator' ).text(),
7 summaryCodePointLimit
= mw
.config
.get( 'wgCommentCodePointLimit' ),
8 summaryByteLimit
= mw
.config
.get( 'wgCommentByteLimit' ),
9 $wpDeleteReasonList
= $( '#wpDeleteReasonList' ),
10 $wpReason
= $( '#wpReason' ),
11 filterFn = function ( input
) {
12 // Should be built the same as in SpecialRevisionDelete::submit()
13 var comment
= $wpDeleteReasonList
.val();
14 if ( comment
=== 'other' ) {
16 } else if ( input
!== '' ) {
17 // Entry from drop down menu + additional comment
18 comment
+= colonSeparator
+ input
;
23 // Limit to bytes or UTF-8 codepoints, depending on MediaWiki's configuration
24 if ( summaryCodePointLimit
) {
25 $wpReason
.codePointLimit( summaryCodePointLimit
, filterFn
);
26 } else if ( summaryByteLimit
) {
27 $wpReason
.bytePointLimit( summaryByteLimit
, filterFn
);
31 }( mediaWiki
, jQuery
) );