( function ( mw, $ ) {
+ var ProtectionForm,
+ reasonCodePointLimit = mw.config.get( 'wgCommentCodePointLimit' ),
+ reasonByteLimit = mw.config.get( 'wgCommentByteLimit' );
- var ProtectionForm = window.ProtectionForm = {
+ ProtectionForm = window.ProtectionForm = {
/**
* Set up the protection chaining interface (i.e. "unlock move permissions" checkbox)
* on the protection form
this.toggleUnchainedInputs( !this.areAllTypesMatching() );
}
- $( '#mwProtect-reason' ).byteLimit( 180 );
+ // Arbitrary 75 to leave some space for the autogenerated null edit's summary
+ if ( reasonCodePointLimit ) {
+ $( '#mwProtect-reason' ).codePointLimit( reasonCodePointLimit - 75 );
+ } else if ( reasonByteLimit ) {
+ $( '#mwProtect-reason' ).byteLimit( reasonByteLimit - 75 );
+ }
this.updateCascadeCheckbox();
return true;