Index: trunk/extensions/Storyboard/jquery/jquery.validate.js |
— | — | @@ -204,8 +204,8 @@ |
205 | 205 | messages: {}, |
206 | 206 | groups: {}, |
207 | 207 | rules: {}, |
208 | | - errorClass: "error", |
209 | | - validClass: "valid", |
| 208 | + errorClass: "validationerror", |
| 209 | + validClass: "validationvalid", |
210 | 210 | errorElement: "label", |
211 | 211 | focusInvalid: true, |
212 | 212 | errorContainer: $( [] ), |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -47,8 +47,8 @@ |
48 | 48 | * @param array $args |
49 | 49 | * @return HTML |
50 | 50 | * |
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 |
53 | 53 | */ |
54 | 54 | private static function getFrom( Parser $parser, array $args ) { |
55 | 55 | global $wgUser, $wgStyleVersion, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -189,7 +189,8 @@ |
190 | 190 | * |
191 | 191 | * @param $story |
192 | 192 | * |
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 |
194 | 195 | */ |
195 | 196 | private function showStoryForm( $story ) { |
196 | 197 | global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
— | — | @@ -262,7 +263,8 @@ |
263 | 264 | array( |
264 | 265 | 'size' => $fieldSize, |
265 | 266 | 'maxlength' => 255, |
266 | | - 'minlength' => 7 |
| 267 | + 'minlength' => 7, |
| 268 | + 'class' => 'required email' |
267 | 269 | ) |
268 | 270 | ) . '</td></tr>'; |
269 | 271 | |
— | — | @@ -351,6 +353,9 @@ |
352 | 354 | stbValidateStory( document.getElementById('storytext'), $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' ) |
353 | 355 | } |
354 | 356 | ); |
| 357 | +jQuery(document).ready(function(){ |
| 358 | + jQuery("#storyform").validate(); |
| 359 | +}); |
355 | 360 | jQuery( "#storyform" ).validate({ |
356 | 361 | rules: { |
357 | 362 | storytitle: { |