jenkins-bot has submitted this change and it was merged. Change subject: Use jquery.byteLimit to ensure we don't end up with truncated edit summaries ......................................................................
Use jquery.byteLimit to ensure we don't end up with truncated edit summaries Change-Id: Ie1f1ebed5765d3347dcb18c7535738db151a64a6 --- M MassMessage.php M SpecialMassMessage.php A ext.MassMessage.special.js 3 files changed, 17 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/MassMessage.php b/MassMessage.php index 1752a90..39bebc9 100644 --- a/MassMessage.php +++ b/MassMessage.php @@ -59,6 +59,15 @@ $wgAutoloadClasses['MassMessageJob'] = "$dir/MassMessageJob.php"; $wgJobClasses['massmessageJob'] = 'MassMessageJob'; +$wgResourceModules['ext.MassMessage.special'] = array( + 'scripts' => 'ext.MassMessage.special.js', + 'dependencies' => array( + 'jquery.byteLimit', + ), + + 'localBasePath' => $dir, +); + $wgLogTypes[] = 'massmessage'; $wgLogActionsHandlers['massmessage/*'] = 'LogFormatter'; $wgAvailableRights[] = 'massmessage'; // Local messaging diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php index 3b0bf65..49434cb 100644 --- a/SpecialMassMessage.php +++ b/SpecialMassMessage.php @@ -19,6 +19,7 @@ function execute( $par ) { $request = $this->getRequest(); $output = $this->getOutput(); + $output->addModules( 'ext.MassMessage.special' ); $this->setHeaders(); $this->outputHeader(); $this->checkPermissions(); @@ -60,7 +61,8 @@ 'id' => 'form-subject', 'type' => 'text', 'label-message' => 'massmessage-form-subject', - 'default' => $request->getText( 'subject' ) + 'default' => $request->getText( 'subject' ), + 'maxlength' => 240 ); // The message to send diff --git a/ext.MassMessage.special.js b/ext.MassMessage.special.js new file mode 100644 index 0000000..c0887f8 --- /dev/null +++ b/ext.MassMessage.special.js @@ -0,0 +1,5 @@ +// Limit edit summaries to 240 bytes +// Modified from mediawiki-core/resources/mediawiki.special/mediawiki.special.movePage.js +jQuery( function ( $ ) { + $( '#form-subject' ).byteLimit(); +} ); -- To view, visit https://gerrit.wikimedia.org/r/75473 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1f1ebed5765d3347dcb18c7535738db151a64a6 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: MZMcBride <w...@mzmcbride.com> Gerrit-Reviewer: Matmarex <matma....@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits