( function () {
var ProtectionForm,
+ config = require( './config.json' ),
reasonCodePointLimit = mw.config.get( 'wgCommentCodePointLimit' ),
reasonByteLimit = mw.config.get( 'wgCommentByteLimit' );
- ProtectionForm = window.ProtectionForm = {
+ ProtectionForm = {
/**
* Set up the protection chaining interface (i.e. "unlock move permissions" checkbox)
* on the protection form
return false;
}
- if ( mw.config.get( 'wgCascadeableLevels' ) !== undefined ) {
- $( 'form#mw-Protect-Form' ).on( 'submit', this.toggleUnchainedInputs.bind( ProtectionForm, true ) );
- }
+ $( 'form#mw-Protect-Form' ).on( 'submit', this.toggleUnchainedInputs.bind( ProtectionForm, true ) );
this.getExpirySelectors().each( function () {
$( this ).on( 'change', ProtectionForm.updateExpiryList.bind( ProtectionForm, this ) );
} );
* @return {boolean}
*/
isCascadeableLevel: function ( level ) {
- var cascadeableLevels = mw.config.get( 'wgCascadeableLevels' );
-
- if ( !Array.isArray( cascadeableLevels ) ) {
- return false;
- }
-
- return cascadeableLevels.indexOf( level ) !== -1;
+ return config.CascadingRestrictionLevels.indexOf( level ) !== -1;
},
/**
* @return {boolean}
*/
matchAttribute: function ( objects, attrName ) {
- // eslint-disable-next-line jquery/no-map-util
+ // eslint-disable-next-line no-jquery/no-map-util
return $.map( objects, function ( object ) {
return object[ attrName ];
} ).filter( function ( item, index, a ) {