From bb18aace54ed83f5f91957788fe301820bf220d8 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Thu, 31 Aug 2023 10:06:50 +0200 Subject: [PATCH] [IMP] web,*: removes jQuery.browser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes the $.browser as not used anymore and already removed in jQuery itself in v1.9, and reintroduced in our codebase to support jquery.ba-bbq (in odoo/odoo@4d07900cf7d1e6e4f0177a6439eb1734585e9bbf) which was also removed. Reference: https://api.jquery.com/jquery.browser/ task-3439226 closes odoo/odoo#133916 Related: odoo/enterprise#46736 Signed-off-by: Adrien Dieudonné (adr) --- addons/mrp_subcontracting/__manifest__.py | 1 - addons/point_of_sale/__manifest__.py | 1 - addons/project/__manifest__.py | 1 - addons/web/__manifest__.py | 2 - .../web/static/lib/jquery/jquery.browser.js | 37 ------------------- addons/web_editor/__manifest__.py | 1 - addons/website_slides/__manifest__.py | 1 - 7 files changed, 44 deletions(-) delete mode 100644 addons/web/static/lib/jquery/jquery.browser.js diff --git a/addons/mrp_subcontracting/__manifest__.py b/addons/mrp_subcontracting/__manifest__.py index 2bc9dcf9f60..9895d9df6eb 100644 --- a/addons/mrp_subcontracting/__manifest__.py +++ b/addons/mrp_subcontracting/__manifest__.py @@ -73,7 +73,6 @@ 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js', diff --git a/addons/point_of_sale/__manifest__.py b/addons/point_of_sale/__manifest__.py index c76d570c021..ce4135c68b9 100644 --- a/addons/point_of_sale/__manifest__.py +++ b/addons/point_of_sale/__manifest__.py @@ -156,7 +156,6 @@ 'web/static/tests/patch_translations.js', 'web/static/src/libs/owl.js', 'web/static/lib/jquery/jquery.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/src/legacy/js/**/*', ('remove', 'web/static/src/legacy/js/libs/**/*'), ('remove', 'web/static/src/legacy/js/public/**/*'), diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py index 8bc4e58ef53..ccfc445756d 100644 --- a/addons/project/__manifest__.py +++ b/addons/project/__manifest__.py @@ -124,7 +124,6 @@ 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js', diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index 671cd834a9b..bebbad8adc2 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -73,7 +73,6 @@ This module provides the core of the Odoo Web Client. 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js', @@ -212,7 +211,6 @@ This module provides the core of the Odoo Web Client. 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js', diff --git a/addons/web/static/lib/jquery/jquery.browser.js b/addons/web/static/lib/jquery/jquery.browser.js deleted file mode 100644 index acf9077caa3..00000000000 --- a/addons/web/static/lib/jquery/jquery.browser.js +++ /dev/null @@ -1,37 +0,0 @@ -(function() { - /** reimport deprecated $.browser, remove me when jquery.ba-bqq is dropped */ - $.uaMatch = function( ua ) { - var ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || - /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - // Don't clobber any existing jQuery.browser in case it's different - if ( !$.browser ) { - var matched = $.uaMatch( navigator.userAgent ); - var browser = {}; - - if ( matched.browser ) { - browser[ matched.browser ] = true; - browser.version = matched.version; - } - - // Chrome is Webkit, but Webkit is also Safari. - if ( browser.chrome ) { - browser.webkit = true; - } else if ( browser.webkit ) { - browser.safari = true; - } - - $.browser = browser; - } -})(); diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py index 1d0857da2b9..0cd1d6338fc 100644 --- a/addons/web_editor/__manifest__.py +++ b/addons/web_editor/__manifest__.py @@ -62,7 +62,6 @@ Odoo Web Editor widget. 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js', diff --git a/addons/website_slides/__manifest__.py b/addons/website_slides/__manifest__.py index bbf71b8a776..cd5518948cf 100644 --- a/addons/website_slides/__manifest__.py +++ b/addons/website_slides/__manifest__.py @@ -162,7 +162,6 @@ Featuring 'web/static/src/legacy/legacy_component.js', 'web/static/lib/jquery/jquery.js', 'web/static/lib/jquery.ui/jquery-ui.js', - 'web/static/lib/jquery/jquery.browser.js', 'web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js', 'web/static/lib/popper/popper.js', 'web/static/lib/bootstrap/js/dist/dom/data.js',