2 * Scripts for action=delete at domready
6 var colonSeparator
= mw
.message( 'colon-separator' ).text(),
7 summaryCodePointLimit
= mw
.config
.get( 'wgCommentCodePointLimit' ),
8 summaryByteLimit
= mw
.config
.get( 'wgCommentByteLimit' ),
9 reasonList
= OO
.ui
.infuse( $( '#wpDeleteReasonList' ).closest( '.oo-ui-widget' ) ),
10 reason
= OO
.ui
.infuse( $( '#wpReason' ).closest( '.oo-ui-widget' ) ),
11 filterFn = function ( input
) {
12 // Should be built the same as in Article::delete()
13 var comment
= reasonList
.getValue();
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 reason
.$input
.codePointLimit( summaryCodePointLimit
, filterFn
);
26 } else if ( summaryByteLimit
) {
27 reason
.$input
.bytePointLimit( summaryByteLimit
, filterFn
);
30 }( mediaWiki
, jQuery
) );