Subversion Repositories Applications.papyrus

Rev

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.RegexpTextbox");
12
dojo.require("dojo.widget.ValidationTextbox");
13
dojo.widget.defineWidget("dojo.widget.RegexpTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
14
	dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);
15
	if (localProperties.regexp) {
16
		this.flags.regexp = localProperties.regexp;
17
	}
18
	if (localProperties.flags) {
19
		this.flags.flags = localProperties.flags;
20
	}
21
}, isValid:function () {
22
	var regexp = new RegExp(this.flags.regexp, this.flags.flags);
23
	return regexp.test(this.textbox.value);
24
}});
25