2 * JavaScript for Special:UserRights
5 // Replace successbox with notifications
6 require( 'mediawiki.notification.convertmessagebox' )();
8 // Dynamically show/hide the "other time" input under each dropdown
9 $( '.mw-userrights-nested select' ).on( 'change', ( e ) => {
10 $( e.target.parentNode ).find( 'input' ).toggle( $( e.target ).val() === 'other' );
13 $( '#wpReason' ).codePointLimit( mw.config.get( 'wgCommentCodePointLimit' ) );
15 // Disable the watch field for cross-wiki userright changes
16 const userrightsInterwikiDelimiter = require( './config.json' ).UserrightsInterwikiDelimiter;
17 $( '#username' ).on( 'change', ( e ) => {
18 $( '#wpWatch' ).prop( 'disabled', e.target.value.indexOf( userrightsInterwikiDelimiter ) !== -1 );
19 } ).trigger( 'change' );