Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
dojo.provide("dojo.widget.CurrencyTextbox");
12
dojo.require("dojo.widget.IntegerTextbox");
13
dojo.require("dojo.validate.common");
14
dojo.widget.defineWidget("dojo.widget.CurrencyTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
15
	dojo.widget.CurrencyTextbox.superclass.mixInProperties.apply(this, arguments);
16
	if (localProperties.fractional) {
17
		this.flags.fractional = (localProperties.fractional == "true");
18
	} else {
19
		if (localProperties.cents) {
20
			dojo.deprecated("dojo.widget.IntegerTextbox", "use fractional attr instead of cents", "0.5");
21
			this.flags.fractional = (localProperties.cents == "true");
22
		}
23
	}
24
	if (localProperties.symbol) {
25
		this.flags.symbol = localProperties.symbol;
26
	}
27
	if (localProperties.min) {
28
		this.flags.min = parseFloat(localProperties.min);
29
	}
30
	if (localProperties.max) {
31
		this.flags.max = parseFloat(localProperties.max);
32
	}
33
}, isValid:function () {
34
	return dojo.validate.isCurrency(this.textbox.value, this.flags);
35
}, isInRange:function () {
36
	return dojo.validate.isInRange(this.textbox.value, this.flags);
37
}});
38