</td>
<td class='mw-input'>" .
Xml::input( 'mwProtect-reason', 60, $this->mReason, array( 'type' => 'text',
- 'id' => 'mwProtect-reason', 'maxlength' => 255 ) ) .
+ 'id' => 'mwProtect-reason', 'maxlength' => 180 ) ) .
+ // Limited maxlength as the database trims at 255 bytes and other texts
+ // chosen by dropdown menus on this page are also included in this database field.
+ // The byte limit of 180 bytes is enforced in javascript
"</td>
</tr>";
# Disallow watching is user is not logged in
$wgOut->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) );
$skin->setRelevantTitle( $this->oldTitle );
+
+ $wgOut->addModules( 'mediawiki.special.movePage' );
$newTitle = $this->newTitle;
"</td>
<td class='mw-input'>" .
Html::element( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2,
- 'maxlength' => 200 ), $this->reason ) .
+ 'maxlength' => 200 ), $this->reason ) . // maxlength byte limit is enforce in mediawiki.special.movePage.js
"</td>
</tr>"
);
'mediawiki.special.block' => array(
'scripts' => 'resources/mediawiki.special/mediawiki.special.block.js',
),
+ 'mediawiki.special.movePage' => array(
+ 'scripts' => 'resources/mediawiki.special/mediawiki.special.movePage.js',
+ 'dependencies' => 'jquery.byteLimit',
+ ),
'mediawiki.special.upload' => array(
// @TODO: merge in remainder of mediawiki.legacy.upload
'scripts' => 'resources/mediawiki.special/mediawiki.special.upload.js',
'scripts' => 'common/protect.js',
'remoteBasePath' => $GLOBALS['wgStylePath'],
'localBasePath' => "{$GLOBALS['IP']}/skins",
- 'dependencies' => 'mediawiki.legacy.wikibits',
+ 'dependencies' => array(
+ 'mediawiki.legacy.wikibits',
+ 'jquery.byteLimit',
+ ),
),
'mediawiki.legacy.search' => array(
'scripts' => 'common/search.js',
--- /dev/null
+/* JavaScript for Special:MovePage */
+
+jQuery( function( $ ) {
+ $( '#wpReason' ).byteLimit( 200 );
+});
check.checked = !this.areAllTypesMatching();
this.enableUnchainedInputs( check.checked );
}
+
+ $( '#mwProtect-reason' ).byteLimit( 180 );
this.updateCascadeCheckbox();