From bffb5405a895003aeb6c859f1f49ec658f5ad580 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:44:35 +0300 Subject: [PATCH] recover jquery removed api via compatibility script asset --- e2e/testcafe-devextreme/tests/container.html | 1 + packages/devextreme/jquery.compatibility.js | 69 +++++++++++++++++++ .../testing/runner/Views/Main/Index.cshtml | 1 + .../testing/runner/Views/Main/RunAll.cshtml | 1 + .../testing/runner/Views/Main/RunSuite.cshtml | 1 + 5 files changed, 73 insertions(+) create mode 100644 packages/devextreme/jquery.compatibility.js diff --git a/e2e/testcafe-devextreme/tests/container.html b/e2e/testcafe-devextreme/tests/container.html index 7ca423929c01..8b49a72861ba 100644 --- a/e2e/testcafe-devextreme/tests/container.html +++ b/e2e/testcafe-devextreme/tests/container.html @@ -17,6 +17,7 @@ + diff --git a/packages/devextreme/jquery.compatibility.js b/packages/devextreme/jquery.compatibility.js new file mode 100644 index 000000000000..bb02f6cbdb66 --- /dev/null +++ b/packages/devextreme/jquery.compatibility.js @@ -0,0 +1,69 @@ +/*! + * jQuery JavaScript Library v3.7.1 + * https://jquery.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2023-08-28T13:37Z + */ + +/* + * https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/ + * Deprecated APIs removed +*/ +( function( jQuery ) { + +"use strict"; + +var isFunction = function isFunction( obj ) { + return typeof obj === "function" && typeof obj.nodeType !== "number" && + typeof obj.item !== "function"; +}; +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; +}; + +function toType(obj) { + if ( obj == null ) { + return obj + ""; + } +} + +function nodeName( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); +} + +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} + +var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; + +jQuery.isArray = Array.isArray; +jQuery.parseJSON = JSON.parse; +jQuery.nodeName = nodeName; +jQuery.isFunction = isFunction; +jQuery.isWindow = isWindow; +jQuery.camelCase = camelCase; +jQuery.type = toType; +jQuery.now = Date.now; + +jQuery.isNumeric = function( obj ) { + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + !isNaN( obj - parseFloat( obj ) ); +}; +jQuery.trim = function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "$1" ); +}; + +} )(window.jQuery); diff --git a/packages/devextreme/testing/runner/Views/Main/Index.cshtml b/packages/devextreme/testing/runner/Views/Main/Index.cshtml index 3f2ebdb3ae11..9fb34e25eb27 100644 --- a/packages/devextreme/testing/runner/Views/Main/Index.cshtml +++ b/packages/devextreme/testing/runner/Views/Main/Index.cshtml @@ -1,6 +1,7 @@ + + +