commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1612066 - in /commons/proper/validator/trunk/src: changes/ javascript/org/apache/commons/validator/javascript/
Date Sun, 20 Jul 2014 09:23:19 GMT
Author: britter
Date: Sun Jul 20 09:23:18 2014
New Revision: 1612066

URL: http://svn.apache.org/r1612066
Log:
VALIDATOR-337: Deprecate the JS part of commons validator. This closes #1 from github. Thanks
to Ben Ripkens.

Modified:
    commons/proper/validator/trunk/src/changes/changes.xml
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
    commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js

Modified: commons/proper/validator/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/changes/changes.xml (original)
+++ commons/proper/validator/trunk/src/changes/changes.xml Sun Jul 20 09:23:18 2014
@@ -43,6 +43,9 @@ The <action> type attribute can be add,u
   <body>
 
   <release version="1.4.1" date="TBA" description="TBA">
+    <action dev="britter" type="update" issue="VALIDATOR-337" due-to="Ben Ripkens" >
+      Deprecate the JS part of commons validator
+    </action>
     <action dev="britter" type="fix" issue="VALIDATOR-266" due-to="Bruce Collie" >
       DomainValidator uses an O(n) method where an O(1) would be more appropriate
     </action>

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid byte.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateByte(form) {
         var bValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid creditcard number based on Luhn checksum.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateCreditCard(form) {
         var bValid = true;
@@ -58,6 +61,10 @@
      * Checks whether a given credit card number has a valid Luhn checksum.
      * This allows you to spot most randomly made-up or garbled credit card numbers immediately.
      * Reference: http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html
+     *
+     * @deprecated The JS part of commons validation is deprecated
+     *   Please consider using http://parsleyjs.org/ or another 
+     *   validation library.
      */
     function jcv_luhnCheck(cardNumber) {
         if (jcv_isLuhnNum(cardNumber)) {
@@ -78,6 +85,11 @@
         return false;
     }
 
+    /**
+     * @deprecated The JS part of commons validation is deprecated
+     *   Please consider using http://parsleyjs.org/ or another 
+     *   validation library.
+     */
     function jcv_isLuhnNum(argvalue) {
         argvalue = argvalue.toString();
         if (argvalue.length == 0) {

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid date.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateDate(form) {
        var bValid = true;
@@ -183,6 +186,11 @@
        return bValid;
     }
     
+    /**
+     * @deprecated The JS part of commons validation is deprecated
+     *   Please consider using http://parsleyjs.org/ or another 
+     *   validation library.
+     */
     function jcv_isValidDate(day, month, year) {
 	    if (month < 1 || month > 12) {
             return false;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid email address.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateEmail(form) {
         var bValid = true;
@@ -58,6 +61,9 @@
     /**
      * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
      * http://javascript.internet.com
+     * @deprecated The JS part of commons validation is deprecated
+     *   Please consider using http://parsleyjs.org/ or another 
+     *   validation library.
      */
     function jcv_checkEmail(emailStr) {
         if (emailStr.length == 0) {

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid float.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateFloat(form) {
         var bValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are in a valid float range.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateFloatRange(form) {
         var isValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields is in a valid integer range.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateIntRange(form) {
         var isValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid integer.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateInteger(form) {
         var bValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
Sun Jul 20 09:23:18 2014
@@ -19,6 +19,9 @@
     * Check to see if fields are a valid using a regular expression.
     * Fields are not checked if they are disabled.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateMask(form) {
         var isValid = true;
@@ -58,6 +61,11 @@
         return isValid;
     }
 
+    /**
+     * @deprecated The JS part of commons validation is deprecated
+     *   Please consider using http://parsleyjs.org/ or another 
+     *   validation library.
+     */
     function jcv_matchPattern(value, mask) {
        return mask.exec(value);
     }

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
Sun Jul 20 09:23:18 2014
@@ -23,6 +23,9 @@
     *  login page gives unnecessary information away to hackers. While it only slightly
     *  weakens security, we suggest using it only when modifying a password.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateMaxLength(form) {
         var isValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
Sun Jul 20 09:23:18 2014
@@ -23,6 +23,9 @@
     *  login page gives unnecessary information away to hackers. While it only slightly
     *  weakens security, we suggest using it only when modifying a password.
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateMinLength(form) {
         var isValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
Sun Jul 20 09:23:18 2014
@@ -20,8 +20,10 @@
     * Fields are not checked if they are disabled.
     *
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
-
     function validateRequired(form) {
         var isValid = true;
         var focusField = null;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
Sun Jul 20 09:23:18 2014
@@ -20,6 +20,9 @@
     * Fields are not checked if they are disabled.
     *
     * @param form The form validation is taking place on.
+    * @deprecated The JS part of commons validation is deprecated
+    *   Please consider using http://parsleyjs.org/ or another 
+    *   validation library.
     */
     function validateShort(form) {
         var bValid = true;

Modified: commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js?rev=1612066&r1=1612065&r2=1612066&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
(original)
+++ commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
Sun Jul 20 09:23:18 2014
@@ -23,6 +23,9 @@
   /**
    * Retreive the name of the form
    * @param form The form validation is taking place on.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_retrieveFormName(form) {
 
@@ -62,6 +65,9 @@
    * Handle error messages.
    * @param messages Array of error messages.
    * @param focusField Field to set focus on.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_handleErrors(messages, focusField) {
       if (focusField && focusField != null) {
@@ -90,6 +96,9 @@
    * all objects, including Arrays).
    * @param name The element name.
    * @param value The element value.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_verifyArrayElement(name, element) {
       if (element && element.length && element.length == 3) {
@@ -102,6 +111,9 @@
   /**
    * Checks whether the field is present on the form.
    * @param field The form field.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_isFieldPresent(field) {
       var fieldPresent = true;
@@ -118,6 +130,9 @@
   /**
    * Check a value only contains valid numeric digits
    * @param argvalue The value to check.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_isAllDigits(argvalue) {
       argvalue = argvalue.toString();
@@ -142,6 +157,9 @@
   /**
    * Check a value only contains valid decimal digits
    * @param argvalue The value to check.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
    */
   function jcv_isDecimalDigits(argvalue) {
       argvalue = argvalue.toString();
@@ -158,7 +176,21 @@
       return true;
   }
     
-    // Trim whitespace from left and right sides of s.
-    function trim(s) {
-        return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
-    }
+  /**
+   * Trim whitespace from left and right sides of s.
+   * @deprecated The JS part of commons validation is deprecated
+   *   Please consider using http://parsleyjs.org/ or another 
+   *   validation library.
+   */
+  function trim(s) {
+      return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
+  }
+
+
+  // Log a message to the console which states that this validation library 
+  // is deprecated.
+  if (typeof(console) !== 'undefined' && typeof(console.warn) === 'function') {
+      console.warn('The JS part of commons validation is deprecated. ' +
+          'Please consider using http://parsleyjs.org/ or another ' +
+          'validation library.');
+  }



Mime
View raw message