r95039 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95038‎ | r95039 | r95040 >
Date:20:17, 19 August 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
made id field required
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -181,7 +181,8 @@
182182 _this.idFieldInput = $j( '<input type="text" id="' + idFieldId + '" name="' + idFieldId + '" class="mwe-idfield" maxlength="15"/>' );
183183
184184 _this.$form.append(
185 - $j( '<div class="mwe-upwiz-details-fieldname"></div>' ).text( mw.UploadWizard.config.idFieldLabel ),
 185+ $j( '<div class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' + idFieldId + '" generated="true"/></div>' ),
 186+ $j( '<div class="mwe-upwiz-details-fieldname"></div>' ).text( mw.UploadWizard.config.idFieldLabel ).requiredFieldLabel(),
186187 $j( '<div class="mwe-id-field"></div>' ).append( _this.idFieldInput )
187188 );
188189 }
@@ -253,6 +254,15 @@
254255 $this.data( 'open', 0 ).datepicker( 'hide' );
255256 }
256257 } );
 258+
 259+ if ( mw.UploadWizard.config.idField != '' ) {
 260+ _this.idFieldInput.rules( "add", {
 261+ required: true,
 262+ messages: {
 263+ required: gM( 'mwe-upwiz-error-blank' )
 264+ }
 265+ } );
 266+ }
257267
258268 mw.UploadWizardUtil.makeToggler( moreDetailsCtrlDiv, moreDetailsDiv );
259269

Status & tagging log