NuGet update jquery validation

This commit is contained in:
Samuele E. Locatelli
2019-12-18 17:15:06 +01:00
parent 2142ce7e62
commit 57bfef7154
110 changed files with 6513 additions and 34647 deletions
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+7 -10
View File
@@ -159,18 +159,15 @@
<Content Include="fonts\fontawesome-webfont.eot" />
<None Include="Properties\PublishProfiles\IIS01.pubxml" />
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Scripts\jquery-3.1.1.js" />
<Content Include="Scripts\jquery-3.1.1.min.js" />
<Content Include="Scripts\jquery-3.1.1.slim.js" />
<Content Include="Scripts\jquery-3.1.1.slim.min.js" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\jquery-3.4.1.js" />
<Content Include="Scripts\jquery-3.4.1.min.js" />
<Content Include="Scripts\jquery-3.4.1.slim.js" />
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
<Content Include="Scripts\jquery.validate.js" />
<Content Include="Scripts\jquery.validate.min.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Scripts\respond.js" />
<Content Include="Scripts\respond.matchmedia.addListener.js" />
@@ -190,9 +187,9 @@
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Shared\_LoginPartial.cshtml" />
<Content Include="Scripts\jquery-3.1.1.slim.min.map" />
<Content Include="Scripts\jquery-3.1.1.min.map" />
<Content Include="Views\Shared\_footer.cshtml" />
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
+3 -3
View File
@@ -3,14 +3,14 @@
<package id="Antlr" version="3.5.0.2" targetFramework="net462" />
<package id="bootstrap" version="3.3.7" targetFramework="net462" />
<package id="FontAwesome" version="4.7.0" targetFramework="net462" />
<package id="jQuery" version="3.1.1" targetFramework="net462" />
<package id="jQuery.Validation" version="1.15.1" targetFramework="net462" />
<package id="jQuery" version="3.4.1" targetFramework="net462" />
<package id="jQuery.Validation" version="1.19.1" targetFramework="net462" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net462" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net462" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net462" />
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net462" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net462" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net462" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.11" targetFramework="net462" />
<package id="Microsoft.Net.Compilers" version="3.4.0" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net462" />
<package id="Modernizr" version="2.8.3" targetFramework="net462" />
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference path="jquery-3.2.1.js" />
/// <reference path="jquery-3.4.1.js" />
/// <autosync enabled="true" />
/// <reference path="bootstrap.min.js" />
/// <reference path="cldr.js" />
+4 -4
View File
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( root, factory ) {
@@ -299,7 +299,7 @@
maxBundle = coreLikelySubtags( Cldr, cldr, subtags );
minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle );
minBundle = minBundle.join( Cldr.localeSep );
existing = availableBundleMapQueue[ minBundle ];
existing = availableBundleMap[ minBundle ];
if ( existing && existing.length < bundle.length ) {
return;
}
+3 -3
View File
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
+3 -3
View File
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
+3 -3
View File
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
+17 -5
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
@@ -113,6 +113,18 @@ var createError = function( code, message, attributes ) {
var runtimeStringify = function( args ) {
return JSON.stringify( args, function( key, value ) {
if ( value && value.runtimeKey ) {
return value.runtimeKey;
}
return value;
} );
};
// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery
var stringHash = function( str ) {
return [].reduce.call( str, function( hash, i ) {
@@ -127,7 +139,7 @@ var stringHash = function( str ) {
var runtimeKey = function( fnName, locale, args, argsStr ) {
var hash;
argsStr = argsStr || JSON.stringify( args );
argsStr = argsStr || runtimeStringify( args );
hash = stringHash( fnName + locale + argsStr );
return hash > 0 ? "a" + hash : "b" + Math.abs( hash );
};
@@ -153,7 +165,7 @@ var functionName = function( fn ) {
var runtimeBind = function( args, cldr, fn, runtimeArgs ) {
var argsStr = JSON.stringify( args ),
var argsStr = runtimeStringify( args ),
fnName = functionName( fn ),
locale = cldr.locale;
+19 -7
View File
@@ -1,5 +1,5 @@
/*!
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,7 +7,7 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
(function( root, factory ) {
@@ -224,16 +224,25 @@ var regexpNotS = /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-
* Return pattern replacing `¤` with the appropriate currency symbol literal.
*/
var currencySymbolProperties = function( currency, cldr, options ) {
var currencySpacing, pattern,
var currencySpacing, pattern, symbol,
symbolEntries = [ "symbol" ],
regexp = {
"[:digit:]": /\d/,
"[:^S:]": regexpNotS
},
symbol = cldr.main([
};
// If options.symbolForm === "narrow" was passed, prepend it.
if ( options.symbolForm === "narrow" ) {
symbolEntries.unshift( "symbol-alt-narrow" );
}
symbolEntries.some(function( symbolEntry ) {
return symbol = cldr.main([
"numbers/currencies",
currency,
"symbol"
symbolEntry
]);
});
currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) {
return cldr.main([
@@ -313,7 +322,10 @@ var objectOmit = function( object, keys ) {
function validateRequiredCldr( path, value ) {
validateCldr( path, value, {
skip: [ /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ ]
skip: [
/numbers\/currencies\/[^/]+\/symbol-alt-/,
/supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/
]
});
}
+46 -21
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
@@ -190,30 +190,53 @@ var stringRepeat = function( str, count ) {
var dateExpandPatternAugmentFormat = function( requestedSkeleton, bestMatchFormat ) {
var i, j, matchedType, matchedLength, requestedType, requestedLength,
function expandBestMatchFormat( skeletonWithoutFractionalSeconds, bestMatchFormat ) {
var i, j, bestMatchFormatParts, matchedType, matchedLength, requestedType,
requestedLength, requestedSkeletonParts,
// Using an easier to read variable.
normalizePatternType = dateExpandPatternNormalizePatternType;
requestedSkeleton = requestedSkeleton.match( datePatternRe );
bestMatchFormat = bestMatchFormat.match( datePatternRe );
requestedSkeletonParts = skeletonWithoutFractionalSeconds.match( datePatternRe );
bestMatchFormatParts = bestMatchFormat.match( datePatternRe );
for ( i = 0; i < bestMatchFormat.length; i++ ) {
matchedType = bestMatchFormat[i].charAt( 0 );
matchedLength = bestMatchFormat[i].length;
for ( j = 0; j < requestedSkeleton.length; j++ ) {
requestedType = requestedSkeleton[j].charAt( 0 );
requestedLength = requestedSkeleton[j].length;
for ( i = 0; i < bestMatchFormatParts.length; i++ ) {
matchedType = bestMatchFormatParts[i].charAt( 0 );
matchedLength = bestMatchFormatParts[i].length;
for ( j = 0; j < requestedSkeletonParts.length; j++ ) {
requestedType = requestedSkeletonParts[j].charAt( 0 );
requestedLength = requestedSkeletonParts[j].length;
if ( normalizePatternType( matchedType ) === normalizePatternType( requestedType ) &&
matchedLength < requestedLength
) {
bestMatchFormat[i] = stringRepeat( matchedType, requestedLength );
bestMatchFormatParts[i] = stringRepeat( matchedType, requestedLength );
}
}
}
return bestMatchFormat.join( "" );
return bestMatchFormatParts.join( "" );
}
// See: http://www.unicode.org/reports/tr35/tr35-dates.html#Matching_Skeletons
var dateExpandPatternAugmentFormat = function( requestedSkeleton, bestMatchFormat, decimalSeparator ) {
var countOfFractionalSeconds, fractionalSecondMatch, lastSecondIdx,
skeletonWithoutFractionalSeconds;
fractionalSecondMatch = requestedSkeleton.match( /S/g );
countOfFractionalSeconds = fractionalSecondMatch ? fractionalSecondMatch.length : 0;
skeletonWithoutFractionalSeconds = requestedSkeleton.replace( /S/g, "" );
bestMatchFormat = expandBestMatchFormat( skeletonWithoutFractionalSeconds, bestMatchFormat );
lastSecondIdx = bestMatchFormat.lastIndexOf( "s" );
if ( lastSecondIdx !== -1 && countOfFractionalSeconds !== 0 ) {
bestMatchFormat =
bestMatchFormat.slice( 0, lastSecondIdx + 1 ) +
decimalSeparator +
stringRepeat( "S", countOfFractionalSeconds ) +
bestMatchFormat.slice( lastSecondIdx + 1 );
}
return bestMatchFormat;
};
@@ -275,7 +298,7 @@ var dateExpandPatternCompareFormats = function( formatA, formatB ) {
var dateExpandPatternGetBestMatchPattern = function( cldr, askedSkeleton ) {
var availableFormats, pattern, ratedFormats, skeleton,
var availableFormats, decimalSeparator, pattern, ratedFormats, skeleton,
path = "dates/calendars/gregorian/dateTimeFormats/availableFormats",
// Using easier to read variables.
@@ -305,7 +328,8 @@ var dateExpandPatternGetBestMatchPattern = function( cldr, askedSkeleton ) {
});
if ( ratedFormats.length ) {
pattern = augmentFormat( askedSkeleton, ratedFormats[0].pattern );
decimalSeparator = numberSymbol( "decimal", cldr );
pattern = augmentFormat( askedSkeleton, ratedFormats[0].pattern, decimalSeparator );
}
}
@@ -2957,7 +2981,7 @@ Globalize.prototype.dateFormatter = function( options ) {
Globalize.dateToPartsFormatter =
Globalize.prototype.dateToPartsFormatter = function( options ) {
var args, cldr, numberFormatters, pad, pattern, properties, returnFn,
timeZone;
timeZone, ianaListener;
validateParameterTypePlainObject( options, "options" );
@@ -2977,14 +3001,15 @@ Globalize.prototype.dateToPartsFormatter = function( options ) {
cldr.on( "get", validateRequiredCldr );
if ( timeZone ) {
cldr.on( "get", validateRequiredIana( timeZone ) );
ianaListener = validateRequiredIana( timeZone );
cldr.on( "get", ianaListener );
}
pattern = dateExpandPattern( options, cldr );
validateOptionsSkeleton( pattern, options.skeleton );
properties = dateFormatProperties( pattern, cldr, timeZone );
cldr.off( "get", validateRequiredCldr );
if ( timeZone ) {
cldr.off( "get", validateRequiredIana( timeZone ) );
if ( ianaListener ) {
cldr.off( "get", ianaListener );
}
// Create needed number formatters.
+3 -3
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
+338 -222
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
@@ -81,6 +81,27 @@ var validateParameterTypeString = function( value, name ) {
/**
* EBNF representation:
*
* compact_pattern_re = prefix?
* number_pattern_re
* suffix?
*
* number_pattern_re = 0+
*
* Regexp groups:
*
* 0: compact_pattern_re
* 1: prefix
* 2: number_pattern_re (the number pattern to use in compact mode)
* 3: suffix
*/
var numberCompactPatternRe = ( /^([^0]*)(0+)([^0]*)$/ );
/**
* goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize )
*
@@ -207,10 +228,6 @@ var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits,
var numberToPrecision = function( number, precision, round ) {
var roundOrder;
// Get number at two extra significant figure precision.
number = number.toPrecision( precision + 2 );
// Then, round it to the required significant figure precision.
roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) );
roundOrder -= precision;
@@ -269,217 +286,6 @@ var numberFormatSignificantDigits = function( number, minimumSignificantDigits,
/**
* removeLiteralQuotes( string )
*
* Return:
* - `` if input string is `''`.
* - `o'clock` if input string is `'o''clock'`.
* - `foo` if input string is `foo`, i.e., return the same value in case it isn't a single-quoted
* string.
*/
var removeLiteralQuotes = function( string ) {
if ( string[ 0 ] + string[ string.length - 1 ] !== "''" ) {
return string;
}
if ( string === "''" ) {
return "";
}
return string.replace( /''/g, "'" ).slice( 1, -1 );
};
/**
* format( number, properties )
*
* @number [Number].
*
* @properties [Object] Output of number/format-properties.
*
* Return the formatted number.
* ref: http://www.unicode.org/reports/tr35/tr35-numbers.html
*/
var numberFormat = function( number, properties ) {
var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits,
minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix,
primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix,
symbolMap;
padding = properties[ 1 ];
minimumIntegerDigits = properties[ 2 ];
minimumFractionDigits = properties[ 3 ];
maximumFractionDigits = properties[ 4 ];
minimumSignificantDigits = properties[ 5 ];
maximumSignificantDigits = properties[ 6 ];
roundIncrement = properties[ 7 ];
primaryGroupingSize = properties[ 8 ];
secondaryGroupingSize = properties[ 9 ];
round = properties[ 15 ];
infinitySymbol = properties[ 16 ];
nanSymbol = properties[ 17 ];
symbolMap = properties[ 18 ];
nuDigitsMap = properties[ 19 ];
// NaN
if ( isNaN( number ) ) {
return nanSymbol;
}
if ( number < 0 ) {
pattern = properties[ 12 ];
prefix = properties[ 13 ];
suffix = properties[ 14 ];
} else {
pattern = properties[ 11 ];
prefix = properties[ 0 ];
suffix = properties[ 10 ];
}
// Infinity
if ( !isFinite( number ) ) {
return prefix + infinitySymbol + suffix;
}
ret = prefix;
// Percent
if ( pattern.indexOf( "%" ) !== -1 ) {
number *= 100;
// Per mille
} else if ( pattern.indexOf( "\u2030" ) !== -1 ) {
number *= 1000;
}
// Significant digit format
if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) {
number = numberFormatSignificantDigits( number, minimumSignificantDigits,
maximumSignificantDigits, round );
// Integer and fractional format
} else {
number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits,
minimumFractionDigits, maximumFractionDigits, round, roundIncrement );
}
// Remove the possible number minus sign
number = number.replace( /^-/, "" );
// Grouping separators
if ( primaryGroupingSize ) {
number = numberFormatGroupingSeparator( number, primaryGroupingSize,
secondaryGroupingSize );
}
ret += number;
// Scientific notation
// TODO implement here
// Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g
// TODO implement here
ret += suffix;
return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) {
// Literals
if ( literal ) {
return removeLiteralQuotes( literal );
}
// Symbols
character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) {
return symbolMap[ symbol ];
});
// Numbering system
if ( nuDigitsMap ) {
character = character.replace( /[0-9]/, function( digit ) {
return nuDigitsMap[ +digit ];
});
}
return character;
});
};
var numberFormatterFn = function( properties ) {
return function numberFormatter( value ) {
validateParameterPresence( value, "value" );
validateParameterTypeNumber( value, "value" );
return numberFormat( value, properties );
};
};
/**
* NumberingSystem( cldr )
*
* - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems
* - http://cldr.unicode.org/index/bcp47-extension
* - http://www.unicode.org/reports/tr35/#u_Extension
*/
var numberNumberingSystem = function( cldr ) {
var nu = cldr.attributes[ "u-nu" ];
if ( nu ) {
if ( nu === "traditio" ) {
nu = "traditional";
}
if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) {
// Unicode locale extension `u-nu` is set using either (native, traditional or
// finance). So, lookup the respective locale's numberingSystem and return it.
return cldr.main([ "numbers/otherNumberingSystems", nu ]);
}
// Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it.
return nu;
}
// Return the default numberingSystem.
return cldr.main( "numbers/defaultNumberingSystem" );
};
/**
* nuMap( cldr )
*
* @cldr [Cldr instance].
*
* Return digits map if numbering system is different than `latn`.
*/
var numberNumberingSystemDigitsMap = function( cldr ) {
var aux,
nu = numberNumberingSystem( cldr );
if ( nu === "latn" ) {
return;
}
aux = cldr.supplemental([ "numberingSystems", nu ]);
if ( aux._type !== "numeric" ) {
throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" );
}
return aux._digits;
};
/**
* EBNF representation:
*
@@ -530,6 +336,288 @@ var numberPatternRe = ( /^(('([^']|'')*'|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0
/**
* removeLiteralQuotes( string )
*
* Return:
* - `` if input string is `''`.
* - `o'clock` if input string is `'o''clock'`.
* - `foo` if input string is `foo`, i.e., return the same value in case it isn't a single-quoted
* string.
*/
var removeLiteralQuotes = function( string ) {
if ( string[ 0 ] + string[ string.length - 1 ] !== "''" ) {
return string;
}
if ( string === "''" ) {
return "";
}
return string.replace( /''/g, "'" ).slice( 1, -1 );
};
/**
* format( number, properties )
*
* @number [Number].
*
* @properties [Object] Output of number/format-properties.
*
* Return the formatted number.
* ref: http://www.unicode.org/reports/tr35/tr35-numbers.html
*/
var numberFormat = function( number, properties, pluralGenerator ) {
var compactMap, infinitySymbol, maximumFractionDigits, maximumSignificantDigits,
minimumFractionDigits, minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap,
padding, prefix, primaryGroupingSize, pattern, ret, round, roundIncrement,
secondaryGroupingSize, suffix, symbolMap;
padding = properties[ 1 ];
minimumIntegerDigits = properties[ 2 ];
minimumFractionDigits = properties[ 3 ];
maximumFractionDigits = properties[ 4 ];
minimumSignificantDigits = properties[ 5 ];
maximumSignificantDigits = properties[ 6 ];
roundIncrement = properties[ 7 ];
primaryGroupingSize = properties[ 8 ];
secondaryGroupingSize = properties[ 9 ];
round = properties[ 15 ];
infinitySymbol = properties[ 16 ];
nanSymbol = properties[ 17 ];
symbolMap = properties[ 18 ];
nuDigitsMap = properties[ 19 ];
compactMap = properties[ 20 ];
// NaN
if ( isNaN( number ) ) {
return nanSymbol;
}
if ( number < 0 ) {
pattern = properties[ 12 ];
prefix = properties[ 13 ];
suffix = properties[ 14 ];
} else {
pattern = properties[ 11 ];
prefix = properties[ 0 ];
suffix = properties[ 10 ];
}
// Infinity
if ( !isFinite( number ) ) {
return prefix + infinitySymbol + suffix;
}
// Percent
if ( pattern.indexOf( "%" ) !== -1 ) {
number *= 100;
// Per mille
} else if ( pattern.indexOf( "\u2030" ) !== -1 ) {
number *= 1000;
}
var compactPattern, compactDigits, compactProperties, divisor, numberExponent, pluralForm;
// Compact mode: initial number digit processing
if ( compactMap ) {
numberExponent = Math.abs( Math.floor( number ) ).toString().length - 1;
numberExponent = Math.min( numberExponent, compactMap.maxExponent );
// Use default plural form to perform initial decimal shift
if ( numberExponent >= 3 ) {
compactPattern = compactMap[ numberExponent ] && compactMap[ numberExponent ].other;
}
if ( compactPattern === "0" ) {
compactPattern = null;
} else if ( compactPattern ) {
compactDigits = compactPattern.split( "0" ).length - 1;
divisor = numberExponent - ( compactDigits - 1 );
number = number / Math.pow( 10, divisor );
}
}
// Significant digit format
if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) {
number = numberFormatSignificantDigits( number, minimumSignificantDigits,
maximumSignificantDigits, round );
// Integer and fractional format
} else {
number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits,
minimumFractionDigits, maximumFractionDigits, round, roundIncrement );
}
// Compact mode: apply formatting
if ( compactMap && compactPattern ) {
// Get plural form after possible roundings
pluralForm = pluralGenerator ? pluralGenerator( +number ) : "other";
compactPattern = compactMap[ numberExponent ][ pluralForm ] || compactPattern;
compactProperties = compactPattern.match( numberCompactPatternRe );
// update prefix/suffix with compact prefix/suffix
prefix += compactProperties[ 1 ];
suffix = compactProperties[ 3 ] + suffix;
}
// Remove the possible number minus sign
number = number.replace( /^-/, "" );
// Grouping separators
if ( primaryGroupingSize ) {
number = numberFormatGroupingSeparator( number, primaryGroupingSize,
secondaryGroupingSize );
}
ret = prefix;
ret += number;
// Scientific notation
// TODO implement here
// Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g
// TODO implement here
ret += suffix;
return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) {
// Literals
if ( literal ) {
return removeLiteralQuotes( literal );
}
// Symbols
character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) {
return symbolMap[ symbol ];
});
// Numbering system
if ( nuDigitsMap ) {
character = character.replace( /[0-9]/, function( digit ) {
return nuDigitsMap[ +digit ];
});
}
return character;
});
};
var numberFormatterFn = function( properties, pluralGenerator ) {
return function numberFormatter( value ) {
validateParameterPresence( value, "value" );
validateParameterTypeNumber( value, "value" );
return numberFormat( value, properties, pluralGenerator );
};
};
/**
* NumberingSystem( cldr )
*
* - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems
* - http://cldr.unicode.org/index/bcp47-extension
* - http://www.unicode.org/reports/tr35/#u_Extension
*/
var numberNumberingSystem = function( cldr ) {
var nu = cldr.attributes[ "u-nu" ];
if ( nu ) {
if ( nu === "traditio" ) {
nu = "traditional";
}
if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) {
// Unicode locale extension `u-nu` is set using either (native, traditional or
// finance). So, lookup the respective locale's numberingSystem and return it.
return cldr.main([ "numbers/otherNumberingSystems", nu ]);
}
// Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it.
return nu;
}
// Return the default numberingSystem.
return cldr.main( "numbers/defaultNumberingSystem" );
};
/**
* Compact( name, cldr )
*
* @compactType [String] Compact mode, `short` or `long`.
*
* @cldr [Cldr instance].
*
* Return the localized compact map for the given compact mode.
*/
var numberCompact = function( compactType, cldr ) {
var maxExponent = 0;
var object = cldr.main([
"numbers/decimalFormats-numberSystem-" + numberNumberingSystem( cldr ),
compactType,
"decimalFormat"
]);
object = Object.keys( object ).reduce(function( newObject, compactKey ) {
var numberExponent = compactKey.split( "0" ).length - 1;
var pluralForm = compactKey.split( "-" )[ 2 ];
newObject[ numberExponent ] = newObject[ numberExponent ] || {};
newObject[ numberExponent ][ pluralForm ] = object[ compactKey ];
maxExponent = Math.max( numberExponent, maxExponent );
return newObject;
}, {});
object.maxExponent = maxExponent;
return object;
};
/**
* nuMap( cldr )
*
* @cldr [Cldr instance].
*
* Return digits map if numbering system is different than `latn`.
*/
var numberNumberingSystemDigitsMap = function( cldr ) {
var aux,
nu = numberNumberingSystem( cldr );
if ( nu === "latn" ) {
return;
}
aux = cldr.supplemental([ "numberingSystems", nu ]);
if ( aux._type !== "numeric" ) {
throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" );
}
return aux._digits;
};
/**
* format( number, pattern )
*
@@ -587,6 +675,9 @@ var numberPatternProperties = function( pattern ) {
// Maximum fraction digits
// 1: ignore decimal character
maximumFractionDigits = fractionPattern.length - 1 /* 1 */;
} else {
minimumFractionDigits = 0;
maximumFractionDigits = 0;
}
// Minimum integer digits
@@ -869,6 +960,22 @@ var numberFormatProperties = function( pattern, cldr, options ) {
numberNumberingSystemDigitsMap( cldr )
]);
if ( options.compact ) {
// The compact digits number pattern is always `0+`, so override the following properties.
// Note: minimumIntegerDigits would actually range from `0` to `000` based on the scale of
// the value to be formatted, though we're always using 1 as a simplification, because the
// number won't be zero-padded since we chose the right format based on the scale, i.e.,
// we'd never see something like `003M` anyway.
properties[ 2 ] = 1; // minimumIntegerDigits
properties[ 3 ] = 0; // minimumFractionDigits
properties[ 4 ] = 0; // maximumFractionDigits
properties[ 5 ] = // minimumSignificantDigits &
properties[ 6 ] = undefined ; // maximumSignificantDigits
properties[20] = numberCompact( options.compact, cldr );
}
getOptions( "minimumIntegerDigits", 2 );
getOptions( "minimumFractionDigits", 3 );
getOptions( "maximumFractionDigits", 4 );
@@ -904,6 +1011,7 @@ var numberFormatProperties = function( pattern, cldr, options ) {
// 17: @nanSymbol [String] NaN symbol.
// 18: @symbolMap [Object] A bunch of other symbols.
// 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`.
// 20: @compactMap [Object] Map of per-digit-count format patterns for specified compact mode.
return properties;
};
@@ -1368,7 +1476,7 @@ function validateDigits( properties ) {
*/
Globalize.numberFormatter =
Globalize.prototype.numberFormatter = function( options ) {
var args, cldr, pattern, properties, returnFn;
var args, cldr, fnArgs, pattern, properties, returnFn;
validateParameterTypePlainObject( options, "options" );
@@ -1388,14 +1496,17 @@ Globalize.prototype.numberFormatter = function( options ) {
}
properties = numberFormatProperties( pattern, cldr, options );
fnArgs = [ properties ];
cldr.off( "get", validateCldr );
validateDigits( properties );
returnFn = numberFormatterFn( properties );
runtimeBind( args, cldr, returnFn, [ properties ] );
if ( options.compact ) {
fnArgs.push( this.pluralGenerator() );
}
returnFn = numberFormatterFn.apply( null, fnArgs );
runtimeBind( args, cldr, returnFn, fnArgs );
return returnFn;
};
@@ -1420,6 +1531,11 @@ Globalize.prototype.numberParser = function( options ) {
args = [ options ];
validateDefaultLocale( cldr );
if ( options.compact ) {
throw createErrorUnsupportedFeature({
feature: "compact number parsing (not implemented)"
});
}
cldr.on( "get", validateCldr );
+3 -3
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
+7 -6
View File
@@ -1,5 +1,5 @@
/**
* Globalize v1.3.0
* Globalize v1.4.2
*
* http://github.com/jquery/globalize
*
@@ -7,10 +7,10 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-07-03T21:37Z
* Date: 2019-03-07T13:47Z
*/
/*!
* Globalize v1.3.0 2017-07-03T21:37Z Released under the MIT license
* Globalize v1.4.2 2019-03-07T13:47Z Released under the MIT license
* http://git.io/TrdQbw
*/
(function( root, factory ) {
@@ -67,7 +67,7 @@ var formatMessage = Globalize._formatMessage,
*/
var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperties ) {
var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties,
formattedValue, divisor, divisorProperties, message, pluralValue;
formattedValue, divisor, divisorProperties, message, pluralValue, oneProperty;
unitProperties = unitProperties.unitProperties;
formattedValue = numberFormatter( value );
@@ -77,9 +77,10 @@ var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperti
if ( unitProperties instanceof Array ) {
dividendProperties = unitProperties[ 0 ];
divisorProperties = unitProperties[ 1 ];
oneProperty = divisorProperties.hasOwnProperty( "one" ) ? "one" : "other";
dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] );
divisor = formatMessage( divisorProperties.one, [ "" ] ).trim();
dividend = formatMessage( dividendProperties[ pluralValue ], [ formattedValue ] );
divisor = formatMessage( divisorProperties[oneProperty], [ "" ] ).trim();
return formatMessage( compoundUnitPattern, [ dividend, divisor ] );
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+152 -76
View File
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.16.0
* jQuery Validation Plugin v1.19.1
*
* http://jqueryvalidation.org/
* https://jqueryvalidation.org/
*
* Copyright (c) 2016 Jörn Zaefferer
* Copyright (c) 2019 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@@ -18,7 +18,7 @@
$.extend( $.fn, {
// http://jqueryvalidation.org/validate/
// https://jqueryvalidation.org/validate/
validate: function( options ) {
// If nothing is selected, return nothing; can't chain anyway
@@ -44,9 +44,10 @@ $.extend( $.fn, {
if ( validator.settings.onsubmit ) {
this.on( "click.validate", ":submit", function( event ) {
if ( validator.settings.submitHandler ) {
validator.submitButton = event.target;
}
// Track the used submit button to properly handle scripted
// submits later.
validator.submitButton = event.currentTarget;
// Allow suppressing validation by adding a cancel class to the submit button
if ( $( this ).hasClass( "cancel" ) ) {
@@ -66,19 +67,25 @@ $.extend( $.fn, {
// Prevent form submit to be able to see console output
event.preventDefault();
}
function handle() {
var hidden, result;
if ( validator.settings.submitHandler ) {
if ( validator.submitButton ) {
// Insert a hidden input as a replacement for the missing submit button
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
// Insert a hidden input as a replacement for the missing submit button
// The hidden input is inserted in two cases:
// - A user defined a `submitHandler`
// - There was a pending request due to `remote` method and `stopRequest()`
// was called to submit the form in case it's valid
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) {
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
if ( validator.settings.submitHandler && !validator.settings.debug ) {
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
if ( validator.submitButton ) {
if ( hidden ) {
// And clean up afterwards; thanks to no-block-scope, hidden can be referenced
hidden.remove();
@@ -112,7 +119,7 @@ $.extend( $.fn, {
return validator;
},
// http://jqueryvalidation.org/valid/
// https://jqueryvalidation.org/valid/
valid: function() {
var valid, validator, errorList;
@@ -133,13 +140,23 @@ $.extend( $.fn, {
return valid;
},
// http://jqueryvalidation.org/rules/
// https://jqueryvalidation.org/rules/
rules: function( command, argument ) {
var element = this[ 0 ],
isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false",
settings, staticRules, existingRules, data, param, filtered;
// If nothing is selected, return empty object; can't chain anyway
if ( element == null || element.form == null ) {
if ( element == null ) {
return;
}
if ( !element.form && isContentEditable ) {
element.form = this.closest( "form" )[ 0 ];
element.name = this.attr( "name" );
}
if ( element.form == null ) {
return;
}
@@ -167,9 +184,6 @@ $.extend( $.fn, {
$.each( argument.split( /\s/ ), function( index, method ) {
filtered[ method ] = existingRules[ method ];
delete existingRules[ method ];
if ( method === "required" ) {
$( element ).removeAttr( "aria-required" );
}
} );
return filtered;
}
@@ -189,7 +203,6 @@ $.extend( $.fn, {
param = data.required;
delete data.required;
data = $.extend( { required: param }, data );
$( element ).attr( "aria-required", "true" );
}
// Make sure remote is at back
@@ -206,18 +219,18 @@ $.extend( $.fn, {
// 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
// http://jqueryvalidation.org/blank-selector/
// https://jqueryvalidation.org/blank-selector/
blank: function( a ) {
return !$.trim( "" + $( a ).val() );
},
// http://jqueryvalidation.org/filled-selector/
// https://jqueryvalidation.org/filled-selector/
filled: function( a ) {
var val = $( a ).val();
return val !== null && !!$.trim( "" + val );
},
// http://jqueryvalidation.org/unchecked-selector/
// https://jqueryvalidation.org/unchecked-selector/
unchecked: function( a ) {
return !$( a ).prop( "checked" );
}
@@ -230,7 +243,7 @@ $.validator = function( options, form ) {
this.init();
};
// http://jqueryvalidation.org/jQuery.validator.format/
// https://jqueryvalidation.org/jQuery.validator.format/
$.validator.format = function( source, params ) {
if ( arguments.length === 1 ) {
return function() {
@@ -343,7 +356,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.setDefaults/
// https://jqueryvalidation.org/jQuery.validator.setDefaults/
setDefaults: function( settings ) {
$.extend( $.validator.defaults, settings );
},
@@ -382,7 +395,8 @@ $.extend( $.validator, {
this.invalid = {};
this.reset();
var groups = ( this.groups = {} ),
var currentForm = this.currentForm,
groups = ( this.groups = {} ),
rules;
$.each( this.settings.groups, function( key, value ) {
if ( typeof value === "string" ) {
@@ -398,10 +412,18 @@ $.extend( $.validator, {
} );
function delegate( event ) {
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
// Set form expando on contenteditable
if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
if ( !this.form && isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = $( this ).attr( "name" );
}
// Ignore the element if it belongs to another form. This will happen mainly
// when setting the `form` attribute of an input to the id of another form.
if ( currentForm !== this.form ) {
return;
}
var validator = $.data( this.form, "validator" ),
@@ -426,13 +448,9 @@ $.extend( $.validator, {
if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
}
// Add aria-required to any Static/Data/Class required fields before first validation
// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
$( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
},
// http://jqueryvalidation.org/Validator.form/
// https://jqueryvalidation.org/Validator.form/
form: function() {
this.checkForm();
$.extend( this.submitted, this.errorMap );
@@ -452,7 +470,7 @@ $.extend( $.validator, {
return this.valid();
},
// http://jqueryvalidation.org/Validator.element/
// https://jqueryvalidation.org/Validator.element/
element: function( element ) {
var cleanElement = this.clean( element ),
checkElement = this.validationTargetFor( cleanElement ),
@@ -503,7 +521,7 @@ $.extend( $.validator, {
return result;
},
// http://jqueryvalidation.org/Validator.showErrors/
// https://jqueryvalidation.org/Validator.showErrors/
showErrors: function( errors ) {
if ( errors ) {
var validator = this;
@@ -529,7 +547,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/Validator.resetForm/
// https://jqueryvalidation.org/Validator.resetForm/
resetForm: function() {
if ( $.fn.resetForm ) {
$( this.currentForm ).resetForm();
@@ -570,7 +588,10 @@ $.extend( $.validator, {
var count = 0,
i;
for ( i in obj ) {
if ( obj[ i ] ) {
// This check allows counting elements with empty error
// message as invalid elements
if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) {
count++;
}
}
@@ -599,7 +620,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" );
@@ -628,13 +649,21 @@ $.extend( $.validator, {
.not( this.settings.ignore )
.filter( function() {
var name = this.name || $( this ).attr( "name" ); // For contenteditable
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
if ( !name && validator.settings.debug && window.console ) {
console.error( "%o has no name assigned", this );
}
// Set form expando on contenteditable
if ( this.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = name;
}
// Ignore elements that belong to other/nested forms
if ( this.form !== validator.currentForm ) {
return false;
}
// Select only the first element for each name, and only those with rules specified
@@ -682,6 +711,7 @@ $.extend( $.validator, {
elementValue: function( element ) {
var $element = $( element ),
type = element.type,
isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false",
val, idx;
if ( type === "radio" || type === "checkbox" ) {
@@ -690,7 +720,7 @@ $.extend( $.validator, {
return element.validity.badInput ? "NaN" : $element.val();
}
if ( element.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
val = $element.text();
} else {
val = $element.val();
@@ -735,21 +765,23 @@ $.extend( $.validator, {
} ).length,
dependencyMismatch = false,
val = this.elementValue( element ),
result, method, rule;
result, method, rule, normalizer;
// If a normalizer is defined for this element, then
// call it to retreive the changed value instead
// Prioritize the local normalizer defined for this element over the global one
// if the former exists, otherwise user the global one in case it exists.
if ( typeof rules.normalizer === "function" ) {
normalizer = rules.normalizer;
} else if ( typeof this.settings.normalizer === "function" ) {
normalizer = this.settings.normalizer;
}
// If normalizer is defined, then call it to retreive the changed value instead
// of using the real one.
// Note that `this` in the normalizer is `element`.
if ( typeof rules.normalizer === "function" ) {
val = rules.normalizer.call( element, val );
if ( normalizer ) {
val = normalizer.call( element, val );
if ( typeof val !== "string" ) {
throw new TypeError( "The normalizer should return a string value." );
}
// Delete the normalizer from rules to avoid treating
// it as a pre-defined method.
// Delete the normalizer from rules to avoid treating it as a pre-defined method.
delete rules.normalizer;
}
@@ -1089,6 +1121,15 @@ $.extend( $.validator, {
$( element ).removeClass( this.settings.pendingClass );
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
$( this.currentForm ).submit();
// Remove the hidden input that was used as a replacement for the
// missing submit button. The hidden input is added by `handle()`
// to ensure that the value of the used submit button is passed on
// for scripted submits triggered by this method
if ( this.submitButton ) {
$( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove();
}
this.formSubmitted = false;
} else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {
$( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
@@ -1115,7 +1156,19 @@ $.extend( $.validator, {
.removeData( "validator" )
.find( ".validate-equalTo-blur" )
.off( ".validate-equalTo" )
.removeClass( "validate-equalTo-blur" );
.removeClass( "validate-equalTo-blur" )
.find( ".validate-lessThan-blur" )
.off( ".validate-lessThan" )
.removeClass( "validate-lessThan-blur" )
.find( ".validate-lessThanEqual-blur" )
.off( ".validate-lessThanEqual" )
.removeClass( "validate-lessThanEqual-blur" )
.find( ".validate-greaterThanEqual-blur" )
.off( ".validate-greaterThanEqual" )
.removeClass( "validate-greaterThanEqual-blur" )
.find( ".validate-greaterThan-blur" )
.off( ".validate-greaterThan" )
.removeClass( "validate-greaterThan-blur" );
}
},
@@ -1219,6 +1272,12 @@ $.extend( $.validator, {
for ( method in $.validator.methods ) {
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
// Cast empty attributes like `data-rule-required` to `true`
if ( value === "" ) {
value = true;
}
this.normalizeAttributeRule( rules, type, method, value );
}
return rules;
@@ -1316,7 +1375,7 @@ $.extend( $.validator, {
return data;
},
// http://jqueryvalidation.org/jQuery.validator.addMethod/
// https://jqueryvalidation.org/jQuery.validator.addMethod/
addMethod: function( name, method, message ) {
$.validator.methods[ name ] = method;
$.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
@@ -1325,10 +1384,10 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.methods/
// https://jqueryvalidation.org/jQuery.validator.methods/
methods: {
// http://jqueryvalidation.org/required-method/
// https://jqueryvalidation.org/required-method/
required: function( value, element, param ) {
// Check if dependency is met
@@ -1344,10 +1403,10 @@ $.extend( $.validator, {
if ( this.checkable( element ) ) {
return this.getLength( value, element ) > 0;
}
return value.length > 0;
return value !== undefined && value !== null && value.length > 0;
},
// http://jqueryvalidation.org/email-method/
// https://jqueryvalidation.org/email-method/
email: function( value, element ) {
// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
@@ -1357,7 +1416,7 @@ $.extend( $.validator, {
return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
},
// http://jqueryvalidation.org/url-method/
// https://jqueryvalidation.org/url-method/
url: function( value, element ) {
// Copyright (c) 2010-2013 Diego Perini, MIT licensed
@@ -1367,60 +1426,77 @@ $.extend( $.validator, {
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
},
// http://jqueryvalidation.org/date-method/
date: function( value, element ) {
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
},
// https://jqueryvalidation.org/date-method/
date: ( function() {
var called = false;
// http://jqueryvalidation.org/dateISO-method/
return function( value, element ) {
if ( !called ) {
called = true;
if ( this.settings.debug && window.console ) {
console.warn(
"The `date` method is deprecated and will be removed in version '2.0.0'.\n" +
"Please don't use it, since it relies on the Date constructor, which\n" +
"behaves very differently across browsers and locales. Use `dateISO`\n" +
"instead or one of the locale specific methods in `localizations/`\n" +
"and `additional-methods.js`."
);
}
}
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
};
}() ),
// https://jqueryvalidation.org/dateISO-method/
dateISO: function( value, element ) {
return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
},
// http://jqueryvalidation.org/number-method/
// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},
// http://jqueryvalidation.org/digits-method/
// https://jqueryvalidation.org/digits-method/
digits: function( value, element ) {
return this.optional( element ) || /^\d+$/.test( value );
},
// http://jqueryvalidation.org/minlength-method/
// https://jqueryvalidation.org/minlength-method/
minlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length >= param;
},
// http://jqueryvalidation.org/maxlength-method/
// https://jqueryvalidation.org/maxlength-method/
maxlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length <= param;
},
// http://jqueryvalidation.org/rangelength-method/
// https://jqueryvalidation.org/rangelength-method/
rangelength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
},
// http://jqueryvalidation.org/min-method/
// https://jqueryvalidation.org/min-method/
min: function( value, element, param ) {
return this.optional( element ) || value >= param;
},
// http://jqueryvalidation.org/max-method/
// https://jqueryvalidation.org/max-method/
max: function( value, element, param ) {
return this.optional( element ) || value <= param;
},
// http://jqueryvalidation.org/range-method/
// https://jqueryvalidation.org/range-method/
range: function( value, element, param ) {
return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
},
// http://jqueryvalidation.org/step-method/
// https://jqueryvalidation.org/step-method/
step: function( value, element, param ) {
var type = $( element ).attr( "type" ),
errorMessage = "Step attribute on input type " + type + " is not supported.",
@@ -1458,7 +1534,7 @@ $.extend( $.validator, {
return this.optional( element ) || valid;
},
// http://jqueryvalidation.org/equalTo-method/
// https://jqueryvalidation.org/equalTo-method/
equalTo: function( value, element, param ) {
// Bind to the blur event of the target in order to revalidate whenever the target field is updated
@@ -1471,7 +1547,7 @@ $.extend( $.validator, {
return value === target.val();
},
// http://jqueryvalidation.org/remote-method/
// https://jqueryvalidation.org/remote-method/
remote: function( value, element, param, method ) {
if ( this.optional( element ) ) {
return "dependency-mismatch";
File diff suppressed because one or more lines are too long
+32 -29
View File
@@ -1,26 +1,23 @@
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. Insofar as a script file is dual licensed under GPL,
* Microsoft neither took the code under GPL nor distributes it thereunder but
* under the terms set out in this paragraph. All notices and licenses
* below are for informational purposes only.
*
* NUGET: END LICENSE TEXT */
/*!
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */
(function ($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation'));
} else {
// Browser global
jQuery.validator.unobtrusive = factory(jQuery);
}
}(function ($) {
var $jQval = $.validator,
adapters,
data_validation = "unobtrusiveValidation";
@@ -84,11 +81,12 @@
}
function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
var container = error.data("unobtrusiveContainer");
if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer");
@@ -120,7 +118,7 @@
.removeClass("field-validation-error")
.removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer");
.removeData("unobtrusiveContainer");
}
function validationInfo(form) {
@@ -131,7 +129,7 @@
execInContext = function (name, args) {
var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args);
}
};
if (!result) {
result = {
@@ -236,10 +234,10 @@
// element with data-val=true
var $selector = $(selector),
$forms = $selector.parents()
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
$selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true);
@@ -422,8 +420,13 @@
setValidationValues(options, "regex", options.params.regex);
}
});
adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions);
});
$(function () {
$jQval.unobtrusive.parse(document);
});
}(jQuery));
return $jQval.unobtrusive;
}));
File diff suppressed because one or more lines are too long
+7 -7
View File
@@ -466,11 +466,11 @@
<None Include="Properties\PublishProfiles\IIS02_TK.pubxml" />
<None Include="Properties\PublishProfiles\TK_prod.pubxml" />
<None Include="Properties\PublishProfiles\TK_test.pubxml" />
<None Include="Scripts\jquery-3.2.1.intellisense.js" />
<Content Include="Scripts\cldr.js" />
<Content Include="Scripts\cldr\event.js" />
<Content Include="Scripts\cldr\supplemental.js" />
<Content Include="Scripts\cldr\unresolved.js" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\globalize.js" />
<Content Include="Scripts\globalize\currency.js" />
<Content Include="Scripts\globalize\date.js" />
@@ -479,10 +479,10 @@
<Content Include="Scripts\globalize\plural.js" />
<Content Include="Scripts\globalize\relative-time.js" />
<Content Include="Scripts\globalize\unit.js" />
<Content Include="Scripts\jquery-3.2.1.js" />
<Content Include="Scripts\jquery-3.2.1.min.js" />
<Content Include="Scripts\jquery-3.2.1.slim.js" />
<Content Include="Scripts\jquery-3.2.1.slim.min.js" />
<Content Include="Scripts\jquery-3.4.1.js" />
<Content Include="Scripts\jquery-3.4.1.min.js" />
<Content Include="Scripts\jquery-3.4.1.slim.js" />
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
<Content Include="Scripts\jquery-ui-1.12.1.js" />
<Content Include="Scripts\jquery-ui-1.12.1.min.js" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
@@ -572,8 +572,8 @@
<Content Include="Views\Items\_Delete.cshtml" />
<Content Include="Views\ItemFluxes\_ListByItem.cshtml" />
<Content Include="Views\ItemFluxes\Read.cshtml" />
<Content Include="Scripts\jquery-3.2.1.slim.min.map" />
<Content Include="Scripts\jquery-3.2.1.min.map" />
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" />
<None Include="Web.IIS01.config">
<DependentUpon>Web.config</DependentUpon>
</None>
-3
View File
@@ -13,15 +13,12 @@
<package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net462" />
<package id="jQuery" version="3.2.1" targetFramework="net462" />
<package id="jQuery.UI.Combined" version="1.12.1" targetFramework="net462" />
<package id="jQuery.Validation" version="1.16.0" targetFramework="net462" />
<package id="jQuery.Validation.Globalize" version="1.1.0" targetFramework="net462" />
<package id="jquery-globalize" version="1.3" targetFramework="net462" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net462" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net462" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net462" />
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net462" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net462" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net462" />
<package id="Microsoft.Net.Compilers" version="3.4.0" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net462" />
<package id="Modernizr" version="2.8.3" targetFramework="net462" />
@@ -1,26 +1,23 @@
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. Insofar as a script file is dual licensed under GPL,
* Microsoft neither took the code under GPL nor distributes it thereunder but
* under the terms set out in this paragraph. All notices and licenses
* below are for informational purposes only.
*
* NUGET: END LICENSE TEXT */
/*!
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */
(function ($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation'));
} else {
// Browser global
jQuery.validator.unobtrusive = factory(jQuery);
}
}(function ($) {
var $jQval = $.validator,
adapters,
data_validation = "unobtrusiveValidation";
@@ -84,11 +81,12 @@
}
function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
var container = error.data("unobtrusiveContainer");
if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer");
@@ -120,7 +118,7 @@
.removeClass("field-validation-error")
.removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer");
.removeData("unobtrusiveContainer");
}
function validationInfo(form) {
@@ -131,7 +129,7 @@
execInContext = function (name, args) {
var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args);
}
};
if (!result) {
result = {
@@ -236,10 +234,10 @@
// element with data-val=true
var $selector = $(selector),
$forms = $selector.parents()
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
$selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true);
@@ -422,8 +420,13 @@
setValidationValues(options, "regex", options.params.regex);
}
});
adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions);
});
$(function () {
$jQval.unobtrusive.parse(document);
});
}(jQuery));
return $jQval.unobtrusive;
}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( root, factory ) {
@@ -299,7 +299,7 @@
maxBundle = coreLikelySubtags( Cldr, cldr, subtags );
minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle );
minBundle = minBundle.join( Cldr.localeSep );
existing = availableBundleMapQueue[ minBundle ];
existing = availableBundleMap[ minBundle ];
if ( existing && existing.length < bundle.length ) {
return;
}
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
@@ -1,15 +1,15 @@
/**
* CLDR JavaScript Library v0.5.0
* CLDR JavaScript Library v0.5.1
* http://jquery.com/
*
* Copyright 2013 Rafael Xavier de Souza
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2017-08-11T11:52Z
* Date: 2019-01-21T13:43Z
*/
/*!
* CLDR JavaScript Library v0.5.0 2017-08-11T11:52Z MIT license © Rafael Xavier
* CLDR JavaScript Library v0.5.1 2019-01-21T13:43Z MIT license © Rafael Xavier
* http://git.io/h4lmVg
*/
(function( factory ) {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-117
View File
@@ -1,117 +0,0 @@
function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $cryptoProvider.ComputeHash($stream)
$checksum = ''
foreach ($byte in $bytes) {
$checksum += $byte.ToString('x2')
}
$stream.Close() | Out-Null
return $checksum
}
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
# _references.js file not found
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
# File has no existing matching reference line
# Add the full reference line to the beginning of the file
"/// <reference path=""$newFileName"" />" | Add-Content $referencesTempFilePath -Encoding UTF8
Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
}
else {
# Loop through file and replace old file name with new file name
Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
}
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
# Delete the line referencing the file
Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
}
function Delete-ProjectItem($item) {
$itemDeleted = $false
for ($1=1; $i -le 5; $i++) {
try {
$item.Delete()
$itemDeleted = $true
break
}
catch {
# Try again in 200ms
[System.Threading.Thread]::Sleep(200)
}
}
if ($itemDeleted -eq $false) {
throw "Unable to delete project item after five attempts."
}
}
# Extract the version number from the jquery file in the package's content\scripts folder
$packageScriptsFolder = Join-Path $installPath Content\Scripts
$jqueryFileName = Join-Path $packageScriptsFolder "jquery-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js","*.slim.js" | Split-Path -Leaf
$jqueryFileNameRegEx = "jquery-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
$jqueryFileName -match $jqueryFileNameRegEx
$ver = $matches[1]
$intelliSenseFileName = "jquery-$ver.intellisense.js"
# Get the project item for the scripts folder
try {
$scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
$projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
}
catch {
# No Scripts folder
Write-Host "No scripts folder found"
}
-41
View File
@@ -1,41 +0,0 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersion = $vsVersion.Major
Write-Host "IntelliSense JS files are not supported by your version of Visual Studio: $displayVersion"
exit
}
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Delete the vsdoc file from the project
try {
$vsDocProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("jquery-$ver-vsdoc.js")
Delete-ProjectItem $vsDocProjectItem
}
catch {
Write-Host "Error deleting vsdoc file: " + $_.Exception -ForegroundColor Red
exit
}
# Copy the intellisense file to the project from the tools folder
$intelliSenseFileSourcePath = Join-Path $toolsPath $intelliSenseFileName
try {
$scriptsFolderProjectItem.ProjectItems.AddFromFileCopy($intelliSenseFileSourcePath)
}
catch {
# This will throw if the file already exists, so we need to catch here
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx $jqueryFileName
File diff suppressed because it is too large Load Diff
-41
View File
@@ -1,41 +0,0 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSenseFilePath) {
if ((Get-Checksum $projectIntelliSenseFilePath) -eq (Get-Checksum $origIntelliSenseFilePath)) {
# The intellisense file in the project matches the file in the tools folder, delete it
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
exit
}
try {
# Get the project item for the intellisense file
$intelliSenseFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item($intelliSenseFileName)
}
catch {
# The item wasn't found
exit
}
# Delete the project item
Delete-ProjectItem $intelliSenseFileProjectItem
}
else {
$projectScriptsFolderLeaf = Split-Path $projectScriptsFolderPath -Leaf
Write-Host "Skipping '$projectScriptsFolderLeaf\$intelliSenseFileName' because it was modified." -ForegroundColor Magenta
}
}
else {
# The intellisense file was not found in project
Write-Host "The intellisense file was not found in project at path $projectIntelliSenseFilePath"
}
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx
Binary file not shown.
Binary file not shown.
@@ -4,11 +4,11 @@
* intended to be used only for design-time IntelliSense. Please use the
* standard jQuery library for all runtime use.
*
* Comment version: 3.2.1
* Comment version: 3.4.1
*/
/*!
* jQuery JavaScript Library v3.2.1
* jQuery JavaScript Library v3.4.1
* http://jquery.com/
*
* Includes Sizzle.js
@@ -1722,7 +1722,7 @@
return select(selector.replace(rtrim, "$1"), context, results, seed);
};
jQuery.fn = {
"jquery": '3.2.1',
"jquery": '3.4.1',
"selector": '',
"length": 0
};
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
* intended to be used only for design-time IntelliSense. Please use the
* standard jQuery library for all production use.
*
* Comment version: 1.15.0
* Comment version: 1.19.1
*/
/*
@@ -15,7 +15,7 @@
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery Validation Plugin - v1.15.0 - 2/4/2013
* jQuery Validation Plugin - v1.19.1 - 12/5/2016
* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT
*
@@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.15.1
* jQuery Validation Plugin v1.19.1
*
* http://jqueryvalidation.org/
* https://jqueryvalidation.org/
*
* Copyright (c) 2016 Jörn Zaefferer
* Copyright (c) 2019 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@@ -18,7 +18,7 @@
$.extend( $.fn, {
// http://jqueryvalidation.org/validate/
// https://jqueryvalidation.org/validate/
validate: function( options ) {
// If nothing is selected, return nothing; can't chain anyway
@@ -44,9 +44,10 @@ $.extend( $.fn, {
if ( validator.settings.onsubmit ) {
this.on( "click.validate", ":submit", function( event ) {
if ( validator.settings.submitHandler ) {
validator.submitButton = event.target;
}
// Track the used submit button to properly handle scripted
// submits later.
validator.submitButton = event.currentTarget;
// Allow suppressing validation by adding a cancel class to the submit button
if ( $( this ).hasClass( "cancel" ) ) {
@@ -66,19 +67,25 @@ $.extend( $.fn, {
// Prevent form submit to be able to see console output
event.preventDefault();
}
function handle() {
var hidden, result;
if ( validator.settings.submitHandler ) {
if ( validator.submitButton ) {
// Insert a hidden input as a replacement for the missing submit button
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
// Insert a hidden input as a replacement for the missing submit button
// The hidden input is inserted in two cases:
// - A user defined a `submitHandler`
// - There was a pending request due to `remote` method and `stopRequest()`
// was called to submit the form in case it's valid
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) {
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
if ( validator.settings.submitHandler && !validator.settings.debug ) {
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
if ( validator.submitButton ) {
if ( hidden ) {
// And clean up afterwards; thanks to no-block-scope, hidden can be referenced
hidden.remove();
@@ -112,7 +119,7 @@ $.extend( $.fn, {
return validator;
},
// http://jqueryvalidation.org/valid/
// https://jqueryvalidation.org/valid/
valid: function() {
var valid, validator, errorList;
@@ -133,13 +140,23 @@ $.extend( $.fn, {
return valid;
},
// http://jqueryvalidation.org/rules/
// https://jqueryvalidation.org/rules/
rules: function( command, argument ) {
var element = this[ 0 ],
isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false",
settings, staticRules, existingRules, data, param, filtered;
// If nothing is selected, return empty object; can't chain anyway
if ( element == null || element.form == null ) {
if ( element == null ) {
return;
}
if ( !element.form && isContentEditable ) {
element.form = this.closest( "form" )[ 0 ];
element.name = this.attr( "name" );
}
if ( element.form == null ) {
return;
}
@@ -167,9 +184,6 @@ $.extend( $.fn, {
$.each( argument.split( /\s/ ), function( index, method ) {
filtered[ method ] = existingRules[ method ];
delete existingRules[ method ];
if ( method === "required" ) {
$( element ).removeAttr( "aria-required" );
}
} );
return filtered;
}
@@ -189,7 +203,6 @@ $.extend( $.fn, {
param = data.required;
delete data.required;
data = $.extend( { required: param }, data );
$( element ).attr( "aria-required", "true" );
}
// Make sure remote is at back
@@ -204,20 +217,20 @@ $.extend( $.fn, {
} );
// Custom selectors
$.extend( $.expr[ ":" ], {
$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
// http://jqueryvalidation.org/blank-selector/
// https://jqueryvalidation.org/blank-selector/
blank: function( a ) {
return !$.trim( "" + $( a ).val() );
},
// http://jqueryvalidation.org/filled-selector/
// https://jqueryvalidation.org/filled-selector/
filled: function( a ) {
var val = $( a ).val();
return val !== null && !!$.trim( "" + val );
},
// http://jqueryvalidation.org/unchecked-selector/
// https://jqueryvalidation.org/unchecked-selector/
unchecked: function( a ) {
return !$( a ).prop( "checked" );
}
@@ -230,7 +243,7 @@ $.validator = function( options, form ) {
this.init();
};
// http://jqueryvalidation.org/jQuery.validator.format/
// https://jqueryvalidation.org/jQuery.validator.format/
$.validator.format = function( source, params ) {
if ( arguments.length === 1 ) {
return function() {
@@ -343,7 +356,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.setDefaults/
// https://jqueryvalidation.org/jQuery.validator.setDefaults/
setDefaults: function( settings ) {
$.extend( $.validator.defaults, settings );
},
@@ -382,7 +395,8 @@ $.extend( $.validator, {
this.invalid = {};
this.reset();
var groups = ( this.groups = {} ),
var currentForm = this.currentForm,
groups = ( this.groups = {} ),
rules;
$.each( this.settings.groups, function( key, value ) {
if ( typeof value === "string" ) {
@@ -398,10 +412,18 @@ $.extend( $.validator, {
} );
function delegate( event ) {
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
// Set form expando on contenteditable
if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
if ( !this.form && isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = $( this ).attr( "name" );
}
// Ignore the element if it belongs to another form. This will happen mainly
// when setting the `form` attribute of an input to the id of another form.
if ( currentForm !== this.form ) {
return;
}
var validator = $.data( this.form, "validator" ),
@@ -417,7 +439,7 @@ $.extend( $.validator, {
":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [contenteditable]", delegate )
"[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate )
// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
@@ -426,13 +448,9 @@ $.extend( $.validator, {
if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
}
// Add aria-required to any Static/Data/Class required fields before first validation
// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
$( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
},
// http://jqueryvalidation.org/Validator.form/
// https://jqueryvalidation.org/Validator.form/
form: function() {
this.checkForm();
$.extend( this.submitted, this.errorMap );
@@ -452,7 +470,7 @@ $.extend( $.validator, {
return this.valid();
},
// http://jqueryvalidation.org/Validator.element/
// https://jqueryvalidation.org/Validator.element/
element: function( element ) {
var cleanElement = this.clean( element ),
checkElement = this.validationTargetFor( cleanElement ),
@@ -503,7 +521,7 @@ $.extend( $.validator, {
return result;
},
// http://jqueryvalidation.org/Validator.showErrors/
// https://jqueryvalidation.org/Validator.showErrors/
showErrors: function( errors ) {
if ( errors ) {
var validator = this;
@@ -529,7 +547,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/Validator.resetForm/
// https://jqueryvalidation.org/Validator.resetForm/
resetForm: function() {
if ( $.fn.resetForm ) {
$( this.currentForm ).resetForm();
@@ -570,7 +588,10 @@ $.extend( $.validator, {
var count = 0,
i;
for ( i in obj ) {
if ( obj[ i ] ) {
// This check allows counting elements with empty error
// message as invalid elements
if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) {
count++;
}
}
@@ -599,7 +620,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" );
@@ -628,13 +649,21 @@ $.extend( $.validator, {
.not( this.settings.ignore )
.filter( function() {
var name = this.name || $( this ).attr( "name" ); // For contenteditable
var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false";
if ( !name && validator.settings.debug && window.console ) {
console.error( "%o has no name assigned", this );
}
// Set form expando on contenteditable
if ( this.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = name;
}
// Ignore elements that belong to other/nested forms
if ( this.form !== validator.currentForm ) {
return false;
}
// Select only the first element for each name, and only those with rules specified
@@ -682,6 +711,7 @@ $.extend( $.validator, {
elementValue: function( element ) {
var $element = $( element ),
type = element.type,
isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false",
val, idx;
if ( type === "radio" || type === "checkbox" ) {
@@ -690,7 +720,7 @@ $.extend( $.validator, {
return element.validity.badInput ? "NaN" : $element.val();
}
if ( element.hasAttribute( "contenteditable" ) ) {
if ( isContentEditable ) {
val = $element.text();
} else {
val = $element.val();
@@ -735,21 +765,23 @@ $.extend( $.validator, {
} ).length,
dependencyMismatch = false,
val = this.elementValue( element ),
result, method, rule;
result, method, rule, normalizer;
// If a normalizer is defined for this element, then
// call it to retreive the changed value instead
// Prioritize the local normalizer defined for this element over the global one
// if the former exists, otherwise user the global one in case it exists.
if ( typeof rules.normalizer === "function" ) {
normalizer = rules.normalizer;
} else if ( typeof this.settings.normalizer === "function" ) {
normalizer = this.settings.normalizer;
}
// If normalizer is defined, then call it to retreive the changed value instead
// of using the real one.
// Note that `this` in the normalizer is `element`.
if ( typeof rules.normalizer === "function" ) {
val = rules.normalizer.call( element, val );
if ( normalizer ) {
val = normalizer.call( element, val );
if ( typeof val !== "string" ) {
throw new TypeError( "The normalizer should return a string value." );
}
// Delete the normalizer from rules to avoid treating
// it as a pre-defined method.
// Delete the normalizer from rules to avoid treating it as a pre-defined method.
delete rules.normalizer;
}
@@ -1089,6 +1121,15 @@ $.extend( $.validator, {
$( element ).removeClass( this.settings.pendingClass );
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
$( this.currentForm ).submit();
// Remove the hidden input that was used as a replacement for the
// missing submit button. The hidden input is added by `handle()`
// to ensure that the value of the used submit button is passed on
// for scripted submits triggered by this method
if ( this.submitButton ) {
$( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove();
}
this.formSubmitted = false;
} else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {
$( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
@@ -1115,7 +1156,19 @@ $.extend( $.validator, {
.removeData( "validator" )
.find( ".validate-equalTo-blur" )
.off( ".validate-equalTo" )
.removeClass( "validate-equalTo-blur" );
.removeClass( "validate-equalTo-blur" )
.find( ".validate-lessThan-blur" )
.off( ".validate-lessThan" )
.removeClass( "validate-lessThan-blur" )
.find( ".validate-lessThanEqual-blur" )
.off( ".validate-lessThanEqual" )
.removeClass( "validate-lessThanEqual-blur" )
.find( ".validate-greaterThanEqual-blur" )
.off( ".validate-greaterThanEqual" )
.removeClass( "validate-greaterThanEqual-blur" )
.find( ".validate-greaterThan-blur" )
.off( ".validate-greaterThan" )
.removeClass( "validate-greaterThan-blur" );
}
},
@@ -1219,6 +1272,12 @@ $.extend( $.validator, {
for ( method in $.validator.methods ) {
value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
// Cast empty attributes like `data-rule-required` to `true`
if ( value === "" ) {
value = true;
}
this.normalizeAttributeRule( rules, type, method, value );
}
return rules;
@@ -1316,7 +1375,7 @@ $.extend( $.validator, {
return data;
},
// http://jqueryvalidation.org/jQuery.validator.addMethod/
// https://jqueryvalidation.org/jQuery.validator.addMethod/
addMethod: function( name, method, message ) {
$.validator.methods[ name ] = method;
$.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
@@ -1325,10 +1384,10 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.methods/
// https://jqueryvalidation.org/jQuery.validator.methods/
methods: {
// http://jqueryvalidation.org/required-method/
// https://jqueryvalidation.org/required-method/
required: function( value, element, param ) {
// Check if dependency is met
@@ -1344,10 +1403,10 @@ $.extend( $.validator, {
if ( this.checkable( element ) ) {
return this.getLength( value, element ) > 0;
}
return value.length > 0;
return value !== undefined && value !== null && value.length > 0;
},
// http://jqueryvalidation.org/email-method/
// https://jqueryvalidation.org/email-method/
email: function( value, element ) {
// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
@@ -1357,7 +1416,7 @@ $.extend( $.validator, {
return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
},
// http://jqueryvalidation.org/url-method/
// https://jqueryvalidation.org/url-method/
url: function( value, element ) {
// Copyright (c) 2010-2013 Diego Perini, MIT licensed
@@ -1367,60 +1426,77 @@ $.extend( $.validator, {
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
},
// http://jqueryvalidation.org/date-method/
date: function( value, element ) {
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
},
// https://jqueryvalidation.org/date-method/
date: ( function() {
var called = false;
// http://jqueryvalidation.org/dateISO-method/
return function( value, element ) {
if ( !called ) {
called = true;
if ( this.settings.debug && window.console ) {
console.warn(
"The `date` method is deprecated and will be removed in version '2.0.0'.\n" +
"Please don't use it, since it relies on the Date constructor, which\n" +
"behaves very differently across browsers and locales. Use `dateISO`\n" +
"instead or one of the locale specific methods in `localizations/`\n" +
"and `additional-methods.js`."
);
}
}
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
};
}() ),
// https://jqueryvalidation.org/dateISO-method/
dateISO: function( value, element ) {
return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
},
// http://jqueryvalidation.org/number-method/
// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},
// http://jqueryvalidation.org/digits-method/
// https://jqueryvalidation.org/digits-method/
digits: function( value, element ) {
return this.optional( element ) || /^\d+$/.test( value );
},
// http://jqueryvalidation.org/minlength-method/
// https://jqueryvalidation.org/minlength-method/
minlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length >= param;
},
// http://jqueryvalidation.org/maxlength-method/
// https://jqueryvalidation.org/maxlength-method/
maxlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length <= param;
},
// http://jqueryvalidation.org/rangelength-method/
// https://jqueryvalidation.org/rangelength-method/
rangelength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
},
// http://jqueryvalidation.org/min-method/
// https://jqueryvalidation.org/min-method/
min: function( value, element, param ) {
return this.optional( element ) || value >= param;
},
// http://jqueryvalidation.org/max-method/
// https://jqueryvalidation.org/max-method/
max: function( value, element, param ) {
return this.optional( element ) || value <= param;
},
// http://jqueryvalidation.org/range-method/
// https://jqueryvalidation.org/range-method/
range: function( value, element, param ) {
return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
},
// http://jqueryvalidation.org/step-method/
// https://jqueryvalidation.org/step-method/
step: function( value, element, param ) {
var type = $( element ).attr( "type" ),
errorMessage = "Step attribute on input type " + type + " is not supported.",
@@ -1458,7 +1534,7 @@ $.extend( $.validator, {
return this.optional( element ) || valid;
},
// http://jqueryvalidation.org/equalTo-method/
// https://jqueryvalidation.org/equalTo-method/
equalTo: function( value, element, param ) {
// Bind to the blur event of the target in order to revalidate whenever the target field is updated
@@ -1471,7 +1547,7 @@ $.extend( $.validator, {
return value === target.val();
},
// http://jqueryvalidation.org/remote-method/
// https://jqueryvalidation.org/remote-method/
remote: function( value, element, param, method ) {
if ( this.optional( element ) ) {
return "dependency-mismatch";
@@ -1570,5 +1646,5 @@ if ( $.ajaxPrefilter ) {
return ajax.apply( this, arguments );
};
}
return $;
}));
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More