MDL-76911 lib: Update jQuery to 3.6.4

This commit is contained in:
Huong Nguyen
2023-03-14 08:45:31 +07:00
parent 5e1df25566
commit d2ae030fa7
8 changed files with 79 additions and 23 deletions
File diff suppressed because one or more lines are too long
+70 -14
View File
@@ -1,5 +1,5 @@
/*!
* jQuery JavaScript Library v3.6.1
* jQuery JavaScript Library v3.6.4
* https://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2022-08-26T17:52Z
* Date: 2023-03-08T15:28Z
*/
( function( global, factory ) {
@@ -151,7 +151,7 @@ function toType( obj ) {
var
version = "3.6.1",
version = "3.6.4",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -522,14 +522,14 @@ function isArrayLike( obj ) {
}
var Sizzle =
/*!
* Sizzle CSS Selector Engine v2.3.6
* Sizzle CSS Selector Engine v2.3.10
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
* Date: 2023-02-14
*/
( function( window ) {
var i,
@@ -633,7 +633,7 @@ var i,
whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
"*" ),
rdescend = new RegExp( whitespace + "|>" ),
@@ -850,7 +850,7 @@ function Sizzle( selector, context, results, seed ) {
// as such selectors are not recognized by querySelectorAll.
// Thanks to Andrew Dupont for this technique.
if ( nodeType === 1 &&
( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
// Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
@@ -1174,6 +1174,24 @@ setDocument = Sizzle.setDocument = function( node ) {
!el.querySelectorAll( ":scope fieldset div" ).length;
} );
// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
// Make sure the the `:has()` argument is parsed unforgivingly.
// We include `*` in the test to detect buggy implementations that are
// _selectively_ forgiving (specifically when the list includes at least
// one valid selector).
// Note that we treat complete lack of support for `:has()` as if it were
// spec-compliant support, which is fine because use of `:has()` in such
// environments will fail in the qSA path and fall back to jQuery traversal
// anyway.
support.cssHas = assert( function() {
try {
document.querySelector( ":has(*,:jqfake)" );
return false;
} catch ( e ) {
return true;
}
} );
/* Attributes
---------------------------------------------------------------------- */
@@ -1440,6 +1458,17 @@ setDocument = Sizzle.setDocument = function( node ) {
} );
}
if ( !support.cssHas ) {
// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
// Our regular `try-catch` mechanism fails to detect natively-unsupported
// pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
// in browsers that parse the `:has()` argument as a forgiving selector list.
// https://drafts.csswg.org/selectors/#relational now requires the argument
// to be parsed unforgivingly, but browsers have not yet fully adjusted.
rbuggyQSA.push( ":has" );
}
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
@@ -1452,7 +1481,14 @@ setDocument = Sizzle.setDocument = function( node ) {
// As in, an element does not contain itself
contains = hasCompare || rnative.test( docElem.contains ) ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
// Support: IE <9 only
// IE doesn't have `contains` on `document` so we need to check for
// `documentElement` presence.
// We need to fall back to `a` when `documentElement` is missing
// as `ownerDocument` of elements within `<template/>` may have
// a null one - a default behavior of all modern browsers.
var adown = a.nodeType === 9 && a.documentElement || a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
@@ -2242,7 +2278,7 @@ Expr = Sizzle.selectors = {
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
// Support: IE<8
// Support: IE <10 only
// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
( ( attr = elem.getAttribute( "type" ) ) == null ||
attr.toLowerCase() === "text" );
@@ -2342,7 +2378,7 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
matched = false;
// Combinators
if ( ( match = rcombinators.exec( soFar ) ) ) {
if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
matched = match.shift();
tokens.push( {
value: matched,
@@ -6608,17 +6644,37 @@ function curCSS( elem, name, computed ) {
// .css('filter') (IE 9 only, trac-12537)
// .css('--customProperty) (gh-3144)
if ( computed ) {
// Support: IE <=9 - 11+
// IE only supports `"float"` in `getPropertyValue`; in computed styles
// it's only available as `"cssFloat"`. We no longer modify properties
// sent to `.css()` apart from camelCasing, so we need to check both.
// Normally, this would create difference in behavior: if
// `getPropertyValue` returns an empty string, the value returned
// by `.css()` would be `undefined`. This is usually the case for
// disconnected elements. However, in IE even disconnected elements
// with no styles return `"none"` for `getPropertyValue( "float" )`
ret = computed.getPropertyValue( name ) || computed[ name ];
// trim whitespace for custom property (issue gh-4926)
if ( isCustomProp ) {
if ( isCustomProp && ret ) {
// rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
// Support: Firefox 105+, Chrome <=105+
// Spec requires trimming whitespace for custom properties (gh-4926).
// Firefox only trims leading whitespace. Chrome just collapses
// both leading & trailing whitespace to a single space.
//
// Fall back to `undefined` if empty string returned.
// This collapses a missing definition with property defined
// and set to an empty string but there's no standard API
// allowing us to differentiate them without a performance penalty
// and returning `undefined` aligns with older jQuery.
//
// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
// as whitespace while CSS does not, but this is not a problem
// because CSS preprocessing replaces them with U+000A LINE FEED
// (which *is* CSS whitespace)
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
ret = ret.replace( rtrimCSS, "$1" );
ret = ret.replace( rtrimCSS, "$1" ) || undefined;
}
if ( ret === "" && !isAttached( elem ) ) {
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -36,7 +36,7 @@
*/
$plugins = array(
'jquery' => array('files' => array('jquery-3.6.1.min.js')),
'jquery' => array('files' => array('jquery-3.6.4.min.js')),
'ui' => array('files' => array('ui-1.13.2/jquery-ui.min.js')),
'ui-css' => array('files' => array('ui-1.13.2/theme/smoothness/jquery-ui.min.css')),
);
+1 -1
View File
@@ -6,7 +6,7 @@ var require = {
waitSeconds : 0,
paths: {
jquery: '[JSURL]lib/jquery/jquery-3.6.1[JSMIN][JSEXT]',
jquery: '[JSURL]lib/jquery/jquery-3.6.4[JSMIN][JSEXT]',
jqueryui: '[JSURL]lib/jquery/ui-1.13.2/jquery-ui[JSMIN][JSEXT]',
jqueryprivate: '[JSURL]lib/requirejs/jquery-private[JSEXT]'
},
+1 -1
View File
@@ -212,7 +212,7 @@
<location>jquery</location>
<name>jQuery</name>
<description>jQuery is a fast, small, and feature-rich JavaScript library widely used on moodle.</description>
<version>3.6.1</version>
<version>3.6.4</version>
<license>MIT</license>
<repository>https://github.com/jquery/jquery</repository>
<copyrights>
@@ -622,8 +622,8 @@ class moodle_content_writer implements content_writer {
$targetpath = ['js', 'general.js'];
$this->copy_data($jspath, $targetpath);
$jquery = ['lib', 'jquery', 'jquery-3.6.1.min.js'];
$jquerydestination = ['js', 'jquery-3.6.1.min.js'];
$jquery = ['lib', 'jquery', 'jquery-3.6.4.min.js'];
$jquerydestination = ['js', 'jquery-3.6.4.min.js'];
$this->copy_data($jquery, $jquerydestination);
$requirecurrentpath = ['lib', 'requirejs', 'require.min.js'];
+2 -2
View File
@@ -65,7 +65,7 @@
<div data-main-content class="jumbotron bg-light border">
<h2 class="display-8">{{#str}}viewdata, core_privacy{{/str}}</h2>
</div>
<script src="js/jquery-3.6.1.min.js"></script>
<script src="js/jquery-3.6.4.min.js"></script>
<script src="js/data_index.js"></script>
<script src="js/general.js"></script>
<script src="js/require.min.js"></script>
@@ -74,7 +74,7 @@
"baseUrl": "./",
"paths": {
"app": "./",
"jquery": "./js/jquery-3.6.1.min",
"jquery": "./js/jquery-3.6.4.min",
"core/tree": "./js/tree.min"
}
});