Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / form / field / VTypes.js
similarity index 93%
rename from src/widgets/form/VTypes.js
rename to src/form/field/VTypes.js
index 9de99f9..4681f0e 100644 (file)
@@ -1,20 +1,14 @@
-/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
 /**
- * @class Ext.form.VTypes
+ * @class Ext.form.field.VTypes
  * <p>This is a singleton object which contains a set of commonly used field validation functions.
  * The validations provided are basic and intended to be easily customizable and extended.</p>
- * <p>To add custom VTypes specify the <code>{@link Ext.form.TextField#vtype vtype}</code> validation
+ * <p>To add custom VTypes specify the <code>{@link Ext.form.field.Text#vtype vtype}</code> validation
  * test function, and optionally specify any corresponding error text to display and any keystroke
  * filtering mask to apply. For example:</p>
  * <pre><code>
 // custom Vtype for vtype:'time'
 var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;
-Ext.apply(Ext.form.VTypes, {
+Ext.apply(Ext.form.field.VTypes, {
     //  vtype validation function
     time: function(val, field) {
         return timeTest.test(val);
@@ -28,7 +22,7 @@ Ext.apply(Ext.form.VTypes, {
  * Another example:
  * <pre><code>
 // custom Vtype for vtype:'IPAddress'
-Ext.apply(Ext.form.VTypes, {
+Ext.apply(Ext.form.field.VTypes, {
     IPAddress:  function(v) {
         return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v);
     },
@@ -38,7 +32,7 @@ Ext.apply(Ext.form.VTypes, {
  * </code></pre>
  * @singleton
  */
-Ext.form.VTypes = function(){
+Ext.define('Ext.form.field.VTypes', (function(){
     // closure these in so they are only created once.
     var alpha = /^[a-zA-Z_]+$/,
         alphanum = /^[a-zA-Z0-9_]+$/,
@@ -47,6 +41,9 @@ Ext.form.VTypes = function(){
 
     // All these messages and functions are configurable
     return {
+        singleton: true,
+        alternateClassName: 'Ext.form.VTypes',
+
         /**
          * The function used to validate email addresses.  Note that this is a very basic validation -- complete
          * validation per the email RFC specifications is very complex and beyond the scope of this class, although
@@ -132,4 +129,4 @@ Ext.form.VTypes = function(){
          */
         'alphanumMask' : /[a-z0-9_]/i
     };
-}();
+})());