Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
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:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.widget.IntegerTextbox");
13
dojo.provide("dojo.widget.IntegerTextbox");
12
dojo.require("dojo.widget.ValidationTextbox");
14
dojo.require("dojo.widget.ValidationTextbox");
13
dojo.require("dojo.validate.common");
15
dojo.require("dojo.validate.common");
14
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
16
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
15
	dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
17
	dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
16
	if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
18
	if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
17
		this.flags.signed = true;
19
		this.flags.signed = true;
18
	} else {
20
	} else {
19
		if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
21
		if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
20
			this.flags.signed = false;
22
			this.flags.signed = false;
21
			this.flags.min = 0;
23
			this.flags.min = 0;
22
		} else {
24
		} else {
23
			this.flags.signed = [true, false];
25
			this.flags.signed = [true, false];
24
		}
26
		}
25
	}
27
	}
26
	if (localProperties.separator) {
28
	if (localProperties.separator) {
27
		this.flags.separator = localProperties.separator;
29
		this.flags.separator = localProperties.separator;
28
	}
30
	}
29
	if (localProperties.min) {
31
	if (localProperties.min) {
30
		this.flags.min = parseInt(localProperties.min);
32
		this.flags.min = parseInt(localProperties.min);
31
	}
33
	}
32
	if (localProperties.max) {
34
	if (localProperties.max) {
33
		this.flags.max = parseInt(localProperties.max);
35
		this.flags.max = parseInt(localProperties.max);
34
	}
36
	}
35
}, isValid:function () {
37
}, isValid:function () {
36
	return dojo.validate.isInteger(this.textbox.value, this.flags);
38
	return dojo.validate.isInteger(this.textbox.value, this.flags);
37
}, isInRange:function () {
39
}, isInRange:function () {
38
	return dojo.validate.isInRange(this.textbox.value, this.flags);
40
	return dojo.validate.isInRange(this.textbox.value, this.flags);
39
}});
41
}});
40
 
42