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 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.provide("dojo.widget.IntegerTextbox");
|
|
|
14 |
dojo.require("dojo.widget.ValidationTextbox");
|
|
|
15 |
dojo.require("dojo.validate.common");
|
|
|
16 |
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
|
|
|
17 |
dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
|
|
|
18 |
if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
|
|
|
19 |
this.flags.signed = true;
|
|
|
20 |
} else {
|
|
|
21 |
if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
|
|
|
22 |
this.flags.signed = false;
|
|
|
23 |
this.flags.min = 0;
|
|
|
24 |
} else {
|
|
|
25 |
this.flags.signed = [true, false];
|
|
|
26 |
}
|
|
|
27 |
}
|
|
|
28 |
if (localProperties.separator) {
|
|
|
29 |
this.flags.separator = localProperties.separator;
|
|
|
30 |
}
|
|
|
31 |
if (localProperties.min) {
|
|
|
32 |
this.flags.min = parseInt(localProperties.min);
|
|
|
33 |
}
|
|
|
34 |
if (localProperties.max) {
|
|
|
35 |
this.flags.max = parseInt(localProperties.max);
|
|
|
36 |
}
|
|
|
37 |
}, isValid:function () {
|
|
|
38 |
return dojo.validate.isInteger(this.textbox.value, this.flags);
|
|
|
39 |
}, isInRange:function () {
|
|
|
40 |
return dojo.validate.isInRange(this.textbox.value, this.flags);
|
|
|
41 |
}});
|
|
|
42 |
|