Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Go to most recent revision | Details | Compare with Previous | 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.InternetTextbox");
12
dojo.require("dojo.widget.ValidationTextbox");
13
dojo.require("dojo.validate.web");
14
dojo.widget.defineWidget("dojo.widget.IpAddressTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties) {
15
	dojo.widget.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);
16
	if (localProperties.allowdotteddecimal) {
17
		this.flags.allowDottedDecimal = (localProperties.allowdotteddecimal == "true");
18
	}
19
	if (localProperties.allowdottedhex) {
20
		this.flags.allowDottedHex = (localProperties.allowdottedhex == "true");
21
	}
22
	if (localProperties.allowdottedoctal) {
23
		this.flags.allowDottedOctal = (localProperties.allowdottedoctal == "true");
24
	}
25
	if (localProperties.allowdecimal) {
26
		this.flags.allowDecimal = (localProperties.allowdecimal == "true");
27
	}
28
	if (localProperties.allowhex) {
29
		this.flags.allowHex = (localProperties.allowhex == "true");
30
	}
31
	if (localProperties.allowipv6) {
32
		this.flags.allowIPv6 = (localProperties.allowipv6 == "true");
33
	}
34
	if (localProperties.allowhybrid) {
35
		this.flags.allowHybrid = (localProperties.allowhybrid == "true");
36
	}
37
}, isValid:function () {
38
	return dojo.validate.isIpAddress(this.textbox.value, this.flags);
39
}});
40
dojo.widget.defineWidget("dojo.widget.UrlTextbox", dojo.widget.IpAddressTextbox, {mixInProperties:function (localProperties) {
41
	dojo.widget.UrlTextbox.superclass.mixInProperties.apply(this, arguments);
42
	if (localProperties.scheme) {
43
		this.flags.scheme = (localProperties.scheme == "true");
44
	}
45
	if (localProperties.allowip) {
46
		this.flags.allowIP = (localProperties.allowip == "true");
47
	}
48
	if (localProperties.allowlocal) {
49
		this.flags.allowLocal = (localProperties.allowlocal == "true");
50
	}
51
	if (localProperties.allowcc) {
52
		this.flags.allowCC = (localProperties.allowcc == "true");
53
	}
54
	if (localProperties.allowgeneric) {
55
		this.flags.allowGeneric = (localProperties.allowgeneric == "true");
56
	}
57
}, isValid:function () {
58
	return dojo.validate.isUrl(this.textbox.value, this.flags);
59
}});
60
dojo.widget.defineWidget("dojo.widget.EmailTextbox", dojo.widget.UrlTextbox, {mixInProperties:function (localProperties) {
61
	dojo.widget.EmailTextbox.superclass.mixInProperties.apply(this, arguments);
62
	if (localProperties.allowcruft) {
63
		this.flags.allowCruft = (localProperties.allowcruft == "true");
64
	}
65
}, isValid:function () {
66
	return dojo.validate.isEmailAddress(this.textbox.value, this.flags);
67
}});
68
dojo.widget.defineWidget("dojo.widget.EmailListTextbox", dojo.widget.EmailTextbox, {mixInProperties:function (localProperties) {
69
	dojo.widget.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);
70
	if (localProperties.listseparator) {
71
		this.flags.listSeparator = localProperties.listseparator;
72
	}
73
}, isValid:function () {
74
	return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);
75
}});
76