From d9840a5e61ddb7bedf017716ab14c7cf5f2ef9f2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 28 Nov 2018 19:27:18 +0100 Subject: [PATCH 01/67] Build: Updating the master version to 1.19.1-pre. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa5835e3b..1393208bb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-validation", "title": "jQuery Validation Plugin", "description": "Client-side form validation made easy", - "version": "1.19.0-pre", + "version": "1.19.1-pre", "homepage": "https://jqueryvalidation.org/", "license": "MIT", "author": { From d1c73fe289d7d8f19c5b0ee91ece9b25a0949a6c Mon Sep 17 00:00:00 2001 From: Ryan Chang Date: Fri, 14 Dec 2018 03:43:54 +0800 Subject: [PATCH 02/67] Localization: Add zh_TW translation for step message (#2245) --- src/localization/messages_zh_TW.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/localization/messages_zh_TW.js b/src/localization/messages_zh_TW.js index f6d46c235..638a5452e 100644 --- a/src/localization/messages_zh_TW.js +++ b/src/localization/messages_zh_TW.js @@ -19,6 +19,7 @@ $.extend( $.validator.messages, { minlength: $.validator.format( "最少 {0} 個字" ), rangelength: $.validator.format( "請輸入長度為 {0} 至 {1} 之間的字串" ), range: $.validator.format( "請輸入 {0} 至 {1} 之間的數值" ), + step: $.validator.format( "請輸入 {0} 的整數倍值" ), max: $.validator.format( "請輸入不大於 {0} 的數值" ), min: $.validator.format( "請輸入不小於 {0} 的數值" ) } ); From a9c20ec280ce3a968abbca5611dcd63f412b5d34 Mon Sep 17 00:00:00 2001 From: Stephen Scott Date: Thu, 13 Dec 2018 19:46:59 +0000 Subject: [PATCH 03/67] Core: change focus() to trigger("focus") (#2243) Change focus() to trigger("focus") so that jQuery Migrate 3.x doesn't flag it as deprecated. --- src/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index 08352d41c..ccb8d4cbe 100644 --- a/src/core.js +++ b/src/core.js @@ -602,7 +602,7 @@ $.extend( $.validator, { try { $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) .filter( ":visible" ) - .focus() + .trigger( "focus" ) // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger( "focusin" ); From 824c9897b28f42a5dabc735a11f03c02cd5446cb Mon Sep 17 00:00:00 2001 From: Dusan Orlovic Date: Sun, 20 Jan 2019 22:28:06 +0100 Subject: [PATCH 04/67] Localization: Adding Serbian translation for step method message (#2251) --- src/localization/messages_sr.js | 3 ++- src/localization/messages_sr_lat.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/localization/messages_sr.js b/src/localization/messages_sr.js index 7cdd4297c..d6f9bec61 100644 --- a/src/localization/messages_sr.js +++ b/src/localization/messages_sr.js @@ -19,5 +19,6 @@ $.extend( $.validator.messages, { rangelength: $.validator.format( "Унесите вредност дугачку између {0} и {1} карактера." ), range: $.validator.format( "Унесите вредност између {0} и {1}." ), max: $.validator.format( "Унесите вредност мању или једнаку {0}." ), - min: $.validator.format( "Унесите вредност већу или једнаку {0}." ) + min: $.validator.format( "Унесите вредност већу или једнаку {0}." ), + step: $.validator.format( "Унесите вредност која је умножак броја {0}." ) } ); diff --git a/src/localization/messages_sr_lat.js b/src/localization/messages_sr_lat.js index f12bfb5e6..43666f98d 100644 --- a/src/localization/messages_sr_lat.js +++ b/src/localization/messages_sr_lat.js @@ -19,5 +19,6 @@ $.extend( $.validator.messages, { rangelength: $.validator.format( "Unesite vrednost dugačku između {0} i {1} karaktera." ), range: $.validator.format( "Unesite vrednost između {0} i {1}." ), max: $.validator.format( "Unesite vrednost manju ili jednaku {0}." ), - min: $.validator.format( "Unesite vrednost veću ili jednaku {0}." ) + min: $.validator.format( "Unesite vrednost veću ili jednaku {0}." ), + step: $.validator.format( "Unesite vrednost koja je umnožak broja {0}." ) } ); From 01ca87912d5e73eb15e285037fd46bdc023a5618 Mon Sep 17 00:00:00 2001 From: Ahmed Gaber Date: Sat, 26 Jan 2019 16:42:09 +0200 Subject: [PATCH 05/67] Build: Set jQuery as a peer dependency (#2248) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1393208bb..3ad550d54 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "dist/jquery.validate.min.js" ], "main": "dist/jquery.validate.js", - "dependencies": { + "peerDependencies": { "jquery": "^1.7 || ^2.0 || ^3.1" }, "devDependencies": { From 05e35ea40d8053ea93038dae8a867c3ec685b5d2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 15 Jun 2019 08:26:58 +0200 Subject: [PATCH 06/67] Build: Updating the master version to 1.19.2-pre. --- changelog.md | 35 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b4f142f8c..4d3fdff3f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,38 @@ +1.19.1 / 2019-06-15 +=================== + +## Core + * Change focus() to trigger("focus") (#2243) + +## Build + * Set jQuery as a peer dependency (#2248) + +## Localization + * Add zh_TW translation for step message (#2245) + * Adding Serbian translation for step method message (#2251) + +1.19.0 / 2018-11-28 +=================== + +## Subresource Integrity hashes + +As of 1.18.0, we started to provide Subresource Integrity hashes of all distribution files. + +The hashes for the 1.19.0 release can be found in the file [`jquery-validation-sri.json`](https://raw.githubusercontent.com/jquery-validation/jquery-validation/1.19.0/dist/jquery-validation-sri.json) under `dist` folder. + +## Additional + * Don't fail when field is optional in CNPJBR & CPFBR rules (#2236) + * Add validation rule for mobile number of Russia Federation (#2207) + * Add Brazillian CNPJ validation rule (#2222) + * Add Brazillian CNH number (Carteira Nacional de Habilitacao) (#2234) + * Add ABA Routing Number Validation (#2216) + +## Core + * Fix contenteditable detection's regression introduced in #2142 (#2235) + +## Localization + * Add Swedish translation for pattern (#2227) + 1.18.0 / 2018-09-09 =================== diff --git a/package.json b/package.json index 3ad550d54..fdecee0fc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-validation", "title": "jQuery Validation Plugin", "description": "Client-side form validation made easy", - "version": "1.19.1-pre", + "version": "1.19.2-pre", "homepage": "https://jqueryvalidation.org/", "license": "MIT", "author": { From 5426dcbd8cef2f8a8fac834f7f9b68754b5a4185 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 15 Jun 2019 08:40:07 +0200 Subject: [PATCH 07/67] chore: updated build docs (#2288) --- build/release.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/release.js b/build/release.js index a9576181f..7d78e7e61 100644 --- a/build/release.js +++ b/build/release.js @@ -1,9 +1,9 @@ /* Release checklist - Run `git changelog` and edit to match previous output (this should make use of jquey-release instead) - make sure the correct 'x.y.z-pre' version is defined in package.json -- cd into your local https://github.com/jquery/jquery-release fork -- pull latest https://github.com/jquery/jquery-release -- disable _generateChangelog task in release.js (BOOOO) +- `cd jquery-release` into your local https://github.com/jquery/jquery-release fork +- `git pull` latest https://github.com/jquery/jquery-release +- disable _generateChangelog task in release.js (BOOOO), by commenting this lines: https://github.com/jquery/jquery-release/blob/a9823df8a5dff4c96d1f6645b09daa591adc2f06/release.js#L43-L44 - run node release.js --remote=jquery-validation/jquery-validation - Wait a while, verify and confirm each step From 25a0f146dc860e8de69d16cd95d0f5987f86e51c Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 15 Jun 2019 08:50:18 +0200 Subject: [PATCH 08/67] Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..978bc43f5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [staabm, Arkni] From d3748a2271223be1c23742dbf79dd918eb2158ee Mon Sep 17 00:00:00 2001 From: Brighton Balfrey Date: Wed, 13 May 2020 13:47:44 -0700 Subject: [PATCH 09/67] Core: Fixes deprecated calls to jQuery trim (#2328) Fixes #2327 Co-authored-by: Brighton Balfrey --- src/core.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index ccb8d4cbe..b7b8f3b9b 100644 --- a/src/core.js +++ b/src/core.js @@ -198,18 +198,25 @@ $.extend( $.fn, { } } ); +// JQuery trim is deprecated, provide a trim method based on String.prototype.trim +var trim = function( str ) { + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill + return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" ); +}; + // Custom selectors $.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support // https://jqueryvalidation.org/blank-selector/ blank: function( a ) { - return !$.trim( "" + $( a ).val() ); + return !trim( "" + $( a ).val() ); }, // https://jqueryvalidation.org/filled-selector/ filled: function( a ) { var val = $( a ).val(); - return val !== null && !!$.trim( "" + val ); + return val !== null && !!trim( "" + val ); }, // https://jqueryvalidation.org/unchecked-selector/ From cd1ce52f794d86154917403c83d1ff83b829da4b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 23 May 2020 10:32:41 +0200 Subject: [PATCH 10/67] Build: Updating the master version to 1.19.3-pre. --- changelog.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4d3fdff3f..f36c5b70a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +1.19.2 / 2020-05-23 +=================== + +## Core + * Core: Fixes deprecated calls to jQuery trim for compat with newer jQuery core versions (#2328) + 1.19.1 / 2019-06-15 =================== diff --git a/package.json b/package.json index fdecee0fc..3becbbc83 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-validation", "title": "jQuery Validation Plugin", "description": "Client-side form validation made easy", - "version": "1.19.2-pre", + "version": "1.19.3-pre", "homepage": "https://jqueryvalidation.org/", "license": "MIT", "author": { From af445b30fc6bbe7431fd8677ddad1008b866bdda Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 23 May 2020 10:36:03 +0200 Subject: [PATCH 11/67] chore: added more release tasks --- build/release.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/release.js b/build/release.js index 7d78e7e61..a12d7c838 100644 --- a/build/release.js +++ b/build/release.js @@ -13,6 +13,7 @@ git fetch --tags upstream git checkout tags/X.YY.Z npm publish +- double check NPM for new release https://www.npmjs.com/package/jquery-validation - Update MS CDN (Ping Chris Sfanos) - Check jsdelivr CDN: new git tags are automatically pulled, tested & merged via https://github.com/jsdelivr/jsdelivr/pulls - Check cdnjs CDN: new git tags are automatically committed into https://github.com/cdnjs/cdnjs/commits/master or ping @cdnjs From 79bed393e6f4bf6876d0e917baed7ef6447efe6a Mon Sep 17 00:00:00 2001 From: Kieran Brahney Date: Tue, 23 Jun 2020 12:25:10 +0100 Subject: [PATCH 12/67] Core: Replaced deprecated jQuery functions Replaced $.isArray and $.isFunction --- src/core.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core.js b/src/core.js index b7b8f3b9b..4674710f4 100644 --- a/src/core.js +++ b/src/core.js @@ -1313,7 +1313,7 @@ $.extend( $.validator, { // Evaluate parameters $.each( rules, function( rule, parameter ) { - rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter; + rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter; } ); // Clean number parameters @@ -1325,7 +1325,7 @@ $.extend( $.validator, { $.each( [ "rangelength", "range" ], function() { var parts; if ( rules[ this ] ) { - if ( $.isArray( rules[ this ] ) ) { + if ( Array.isArray( rules[ this ] ) ) { rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; } else if ( typeof rules[ this ] === "string" ) { parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); @@ -1454,19 +1454,19 @@ $.extend( $.validator, { // https://jqueryvalidation.org/minlength-method/ minlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length >= param; }, // https://jqueryvalidation.org/maxlength-method/ maxlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || length <= param; }, // https://jqueryvalidation.org/rangelength-method/ rangelength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); }, From b0e3b11324a542813adf9a93c432a31d818f7c80 Mon Sep 17 00:00:00 2001 From: Joe Watkins Date: Tue, 18 Aug 2020 01:10:33 -0700 Subject: [PATCH 13/67] Add Accessibility section to Readme (#2149) * Add accessibility section to readme - speaks to errorElement * Add link to errorElement in doc Co-authored-by: Joe Watkins --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index f02786c1c..bf109300a 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,27 @@ $("#myForm").validate({ }); ``` +## Accessibility +For an invalid field, the default output for the jQuery Validation Plugin is an error message in a `