Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade jQuery from 3.5.1 to 3.7.1 #5799

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DNN Platform/JavaScript Libraries/jQuery/jQuery.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="jQuery" type="JavaScript_Library" version="03.05.01" isSystem="true">
<package name="jQuery" type="JavaScript_Library" version="03.07.01" isSystem="true">
<friendlyName>jQuery JavaScript Library</friendlyName>
<description>jQuery is a JavaScript library that is used to manipulate the Document Object Model (DOM).</description>
<iconFile>Icons\Sigma\Extensions_32x32_Standard.png</iconFile>
Expand All @@ -19,7 +19,7 @@
<libraryName>jQuery</libraryName>
<fileName>jquery.js</fileName>
<objectName>jQuery</objectName>
<CDNPath>https://code.jquery.com/jquery-3.5.1.min.js</CDNPath>
<CDNPath>https://code.jquery.com/jquery-3.7.1.min.js</CDNPath>
</javaScriptLibrary>
</component>
<component type="JavaScriptFile">
Expand Down
4 changes: 2 additions & 2 deletions DNN Platform/JavaScript Libraries/jQuery/jquery.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="jQuery-Migrate" type="JavaScript_Library" version="03.04.00" isSystem="true">
<package name="jQuery-Migrate" type="JavaScript_Library" version="03.04.01" isSystem="true">
<friendlyName>jQuery Migrate JavaScript Library</friendlyName>
<description>A development tool to help migrate away from APIs and features that have been or will be removed from jQuery core</description>
<iconFile>Icons\Sigma\Extensions_32x32_Standard.png</iconFile>
Expand All @@ -21,7 +21,7 @@
<javaScriptLibrary>
<libraryName>jQuery-Migrate</libraryName>
<fileName>jquery-migrate.js</fileName>
<CDNPath>https://code.jquery.com/jquery-migrate-3.4.0.min.js</CDNPath>
<CDNPath>https://code.jquery.com/jquery-migrate-3.4.1.min.js</CDNPath>
</javaScriptLibrary>
</component>
<component type="JavaScriptFile">
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DNN Platform/Library/Framework/jQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial class jQuery
/// Using the hosted version increases the likelihood that the file is already
/// cached in the user's browser.
/// </remarks>
public const string DefaultHostedUrl = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
public const string DefaultHostedUrl = "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js";

public const string DefaultUIHostedUrl = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js";
private const string JQueryDebugFile = "~/Resources/Shared/Scripts/jquery/jquery.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Migrate - v3.4.0 - 2022-03-24T16:30Z
* jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z
* Copyright OpenJS Foundation and other contributors
*/
( function( factory ) {
Expand All @@ -24,7 +24,7 @@
} )( function( jQuery, window ) {
"use strict";

jQuery.migrateVersion = "3.4.0";
jQuery.migrateVersion = "3.4.1";

// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
function compareVersions( v1, v2 ) {
Expand Down Expand Up @@ -91,9 +91,10 @@ jQuery.migrateIsPatchEnabled = function( patchCode ) {
return;
}

// Need jQuery 3.0.0+ and no older Migrate loaded
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
// Need jQuery 3.x-4.x and no older Migrate loaded
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ||
jQueryVersionSince( "5.0.0" ) ) {
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" );
}
if ( jQuery.migrateWarnings ) {
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
Expand Down Expand Up @@ -206,9 +207,9 @@ var findProp,
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,

// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
// Require that the "whitespace run" starts from a non-whitespace
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;

migratePatchFunc( jQuery.fn, "init", function( arg1 ) {
var args = Array.prototype.slice.call( arguments );
Expand Down Expand Up @@ -300,7 +301,7 @@ if ( jQueryVersionSince( "3.1.1" ) ) {
migratePatchAndWarnFunc( jQuery, "trim", function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
( text + "" ).replace( rtrim, "$1" );
}, "trim",
"jQuery.trim is deprecated; use String.prototype.trim" );
}
Expand Down Expand Up @@ -419,10 +420,24 @@ var oldRemoveAttr = jQuery.fn.removeAttr,
rmatchNonSpace = /\S+/g;

migratePatchFunc( jQuery.fn, "removeAttr", function( name ) {
var self = this;
var self = this,
patchNeeded = false;

jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
if ( jQuery.expr.match.bool.test( attr ) ) {

// Only warn if at least a single node had the property set to
// something else than `false`. Otherwise, this Migrate patch
// doesn't influence the behavior and there's no need to set or warn.
self.each( function() {
if ( jQuery( this ).prop( attr ) !== false ) {
patchNeeded = true;
return false;
}
} );
}

if ( patchNeeded ) {
migrateWarn( "removeAttr-bool",
"jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
self.prop( attr, false );
Expand Down Expand Up @@ -470,7 +485,7 @@ function camelCase( string ) {
} );
}

var origFnCss,
var origFnCss, internalCssNumber,
internalSwapCall = false,
ralphaStart = /^[a-z]/,

Expand Down Expand Up @@ -552,8 +567,11 @@ if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233
// This way, number values for the CSS properties below won't start triggering
// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438).
if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) {
jQuery.cssNumber = new Proxy( {
if ( jQueryVersionSince( "4.0.0" ) ) {

// We need to keep this as a local variable as we need it internally
// in a `jQuery.fn.css` patch and this usage shouldn't warn.
internalCssNumber = {
animationIterationCount: true,
columnCount: true,
fillOpacity: true,
Expand All @@ -574,16 +592,31 @@ if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) {
widows: true,
zIndex: true,
zoom: true
}, {
get: function() {
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
return Reflect.get.apply( this, arguments );
},
set: function() {
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
return Reflect.set.apply( this, arguments );
}
} );
};

if ( typeof Proxy !== "undefined" ) {
jQuery.cssNumber = new Proxy( internalCssNumber, {
get: function() {
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
return Reflect.get.apply( this, arguments );
},
set: function() {
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
return Reflect.set.apply( this, arguments );
}
} );
} else {

// Support: IE 9-11+
// IE doesn't support proxies, but we still want to restore the legacy
// jQuery.cssNumber there.
jQuery.cssNumber = internalCssNumber;
}
} else {

// Make `internalCssNumber` defined for jQuery <4 as well as it's needed
// in the `jQuery.fn.css` patch below.
internalCssNumber = jQuery.cssNumber;
}

function isAutoPx( prop ) {
Expand All @@ -610,7 +643,10 @@ migratePatchFunc( jQuery.fn, "css", function( name, value ) {

if ( typeof value === "number" ) {
camelName = camelCase( name );
if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) {

// Use `internalCssNumber` to avoid triggering our warnings in this
// internal check.
if ( !isAutoPx( camelName ) && !internalCssNumber[ camelName ] ) {
migrateWarn( "css-number",
"Number-typed values are deprecated for jQuery.fn.css( \"" +
name + "\", value )" );
Expand Down
Loading