r64810 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64809‎ | r64810 | r64811 >
Date:17:35, 9 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changed validation for email field on Special:Story
Modified paths:
  • /trunk/extensions/Storyboard/jquery/jquery.validate.js (modified) (history)
  • /trunk/extensions/Storyboard/specials/Story/Story_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/jquery/jquery.validate.js
@@ -204,8 +204,8 @@
205205 messages: {},
206206 groups: {},
207207 rules: {},
208 - errorClass: "error",
209 - validClass: "valid",
 208+ errorClass: "validationerror",
 209+ validClass: "validationvalid",
210210 errorElement: "label",
211211 focusInvalid: true,
212212 errorContainer: $( [] ),
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -47,8 +47,8 @@
4848 * @param array $args
4949 * @return HTML
5050 *
51 - * TODO: Add live validation for all fields, esp checking if a story title doesn't exist yet.
52 - * TODO: use HTMLForm?
 51+ * TODO: Fix the validation for the story title
 52+ * TODO: use HTMLForm
5353 */
5454 private static function getFrom( Parser $parser, array $args ) {
5555 global $wgUser, $wgStyleVersion, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php
@@ -189,7 +189,8 @@
190190 *
191191 * @param $story
192192 *
193 - * TODO: Add live validation for all fields, esp checking if a story title doesn't exist yet.
 193+ * TODO: Fix the validation for the story title
 194+ * TODO: use HTMLForm
194195 */
195196 private function showStoryForm( $story ) {
196197 global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
@@ -262,7 +263,8 @@
263264 array(
264265 'size' => $fieldSize,
265266 'maxlength' => 255,
266 - 'minlength' => 7
 267+ 'minlength' => 7,
 268+ 'class' => 'required email'
267269 )
268270 ) . '</td></tr>';
269271
@@ -351,6 +353,9 @@
352354 stbValidateStory( document.getElementById('storytext'), $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )
353355 }
354356 );
 357+jQuery(document).ready(function(){
 358+ jQuery("#storyform").validate();
 359+});
355360 jQuery( "#storyform" ).validate({
356361 rules: {
357362 storytitle: {

Status & tagging log