Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 10:25 PM
Size
3 KB
Referenced Files
None
Subscribers
None
Index: skins/common/protect.js
===================================================================
--- skins/common/protect.js (revision 86816)
+++ skins/common/protect.js (working copy)
@@ -45,6 +45,8 @@
check.checked = !this.areAllTypesMatching();
this.enableUnchainedInputs( check.checked );
}
+
+ $( '#mwProtect-reason' ).byteLimit( 180 );
this.updateCascadeCheckbox();
Index: includes/ProtectionForm.php
===================================================================
--- includes/ProtectionForm.php (revision 86816)
+++ includes/ProtectionForm.php (working copy)
@@ -467,7 +467,10 @@
</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
Index: includes/specials/SpecialMovepage.php
===================================================================
--- includes/specials/SpecialMovepage.php (revision 86816)
+++ includes/specials/SpecialMovepage.php (working copy)
@@ -113,6 +113,8 @@
$wgOut->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) );
$skin->setRelevantTitle( $this->oldTitle );
+
+ $wgOut->addModules( 'mediawiki.special.movePage' );
$newTitle = $this->newTitle;
@@ -237,7 +239,7 @@
"</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>"
);
Index: resources/Resources.php
===================================================================
--- resources/Resources.php (revision 86816)
+++ resources/Resources.php (working copy)
@@ -455,6 +455,10 @@
'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',
@@ -586,7 +590,10 @@
'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',
Index: resources/mediawiki.special/mediawiki.special.movePage.js
===================================================================
--- resources/mediawiki.special/mediawiki.special.movePage.js (revision 0)
+++ resources/mediawiki.special/mediawiki.special.movePage.js (revision 0)
@@ -0,0 +1,5 @@
+/* JavaScript for Special:MovePage */
+
+jQuery( function( $ ) {
+ $( '#wpReason' ).byteLimit( 200 );
+});
Property changes on: resources/mediawiki.special/mediawiki.special.movePage.js
___________________________________________________________________
Added: svn:eol-style
+ native

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4850
Default Alt Text
16921 (3 KB)

Event Timeline