Changeset 5201
- Timestamp:
- 08/09/06 01:24:37 (2 years ago)
- Location:
- trunk/src/widget
- Files:
-
- 2 added
- 4 modified
-
nls (added)
-
nls/validate.js (added)
-
Spinner.js (modified) (1 diff)
-
templates/Spinner.html (modified) (1 diff)
-
templates/ValidationTextbox.html (modified) (1 diff)
-
validate.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/widget/Spinner.js
r5197 r5201 218 218 219 219 postMixInProperties: function(args, frag){ 220 this.inherited("postMixInProperties"); 221 220 222 // set image size before instantiating template; 221 223 // changing it aftwards doesn't work on FF -
trunk/src/widget/templates/Spinner.html
r5163 r5201 18 18 </td> 19 19 </tr> 20 </table> <!--21 --><span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.invalidMessage}</span><!--22 --><span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.missingMessage}</span><!--23 --><span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.rangeMessage}</span><!--24 --></span>20 </table> 21 <span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span> 22 <span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span> 23 <span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span> 24 </span> -
trunk/src/widget/templates/ValidationTextbox.html
r5044 r5201 3 3 id='${this.widgetId}' name='${this.name}' size='${this.size}' maxlength='${this.maxlength}' 4 4 value='${this.value}' class='${this.className}' style=''> 5 <span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this. invalidMessage}</span>6 <span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.m issingMessage}</span>7 <span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this. rangeMessage}</span>5 <span dojoAttachPoint='invalidSpan' class='${this.invalidClass}'>${this.messages.invalidMessage}</span> 6 <span dojoAttachPoint='missingSpan' class='${this.missingClass}'>${this.messages.missingMessage}</span> 7 <span dojoAttachPoint='rangeSpan' class='${this.rangeClass}'>${this.messages.rangeMessage}</span> 8 8 </span> -
trunk/src/widget/validate.js
r5121 r5201 6 6 dojo.require("dojo.widget.Parse"); 7 7 dojo.require("dojo.xml.Parse"); 8 dojo.require("dojo.lang"); 8 dojo.require("dojo.lang.array"); 9 dojo.require("dojo.lang.common"); 9 10 10 11 dojo.require("dojo.validate.common"); … … 13 14 dojo.require("dojo.validate.web"); 14 15 dojo.require("dojo.validate.us"); 16 17 dojo.require("dojo.i18n.common"); 18 dojo.requireLocalization("dojo.widget", "validate"); 15 19 16 20 dojo.widget.manager.registerWidgetPackage("dojo.widget.validate"); … … 138 142 maxlength: "", 139 143 promptMessage: "", 140 invalidMessage: " * The value entered is not valid.",141 missingMessage: " * This value is required.",142 rangeMessage: " * This value out of range.",144 invalidMessage: "", 145 missingMessage: "", 146 rangeMessage: "", 143 147 listenOnKeyPress: true, 144 148 htmlfloat: "none", … … 234 238 } 235 239 }, 240 241 postMixInProperties: function(localProperties, frag) { 242 dojo.widget.validate.ValidationTextbox.superclass.postMixInProperties.apply(this, arguments); 243 this.messages = dojo.i18n.getLocalization("dojo.widget", "validate"); 244 dojo.lang.forEach(["invalidMessage", "missingMessage", "rangeMessage"], function(prop) { 245 if(this[prop]){ this.messages[prop] = this[prop]; } 246 }, this); 247 }, 236 248 237 249 // FIXME: why are there to fillInTemplate methods defined here? … … 370 382 Has 5 new properties that can be specified as attributes in the markup. 371 383 372 @attr cents The two decimal places for cents. Can be true or false, optional if omitted.384 @attr fractional The decimal places (e.g. for cents). Can be true or false, optional if omitted. 373 385 @attr symbol A currency symbol such as Yen "???", Pound "???", or the Euro "???". Default is "$". 374 386 @attr separator Default is "," instead of no separator as in IntegerTextbox. … … 385 397 386 398 // Get properties from markup attributes, and assign to flags object. 387 if ( localProperties.cents ) { 388 this.flags.cents = ( localProperties.cents == "true" ); 399 if ( localProperties.fractional ) { 400 this.flags.fractional = ( localProperties.fractional == "true" ); 401 } else if ( localProperties.cents ) { 402 dojo.deprecated("dojo.widget.validate.IntegerTextbox", "use fractional attr instead of cents", "0.5"); 403 this.flags.fractional = ( localProperties.cents == "true" ); 389 404 } 390 405 if ( localProperties.symbol ) {