2 * JavaScript for Special:UserRights
5 var convertmessagebox
= require( 'mediawiki.notification.convertmessagebox' ),
6 summaryCodePointLimit
= mw
.config
.get( 'wgCommentCodePointLimit' ),
7 summaryByteLimit
= mw
.config
.get( 'wgCommentByteLimit' ),
8 $wpReason
= $( '#wpReason' );
10 // Replace successbox with notifications
13 // Dynamically show/hide the "other time" input under each dropdown
14 $( '.mw-userrights-nested select' ).on( 'change', function ( e
) {
15 $( e
.target
.parentNode
).find( 'input' ).toggle( $( e
.target
).val() === 'other' );
18 // Limit to bytes or UTF-8 codepoints, depending on MediaWiki's configuration
19 if ( summaryCodePointLimit
) {
20 $wpReason
.codePointLimit( summaryCodePointLimit
);
21 } else if ( summaryByteLimit
) {
22 $wpReason
.byteLimit( summaryByteLimit
);
25 }( mediaWiki
, jQuery
) );