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 to latest version, drop polyfills #34382

Merged
merged 1 commit into from
Nov 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

function populateStates(id_country, id_state)
{
if ($("#country option:selected").size() > 1)
if ($("#country option:selected").length > 1)
{
$("#zipcode-label").hide();
$("#zipcode").hide();
Expand Down
9 changes: 3 additions & 6 deletions classes/controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2657,12 +2657,9 @@ public function setMedia($isNewTheme = false)
$this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/' . $this->bo_theme . '/public/theme.css?v=' . _PS_VERSION_, 'all', 0);

// add Jquery 3 and its migration script
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-3.5.1.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-3.7.1.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/bo-migrate-mute.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-migrate-3.1.0.min.js');
// implement $.browser object and live method, that has been removed since jquery 1.9
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery.browser-0.1.0.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery.live-polyfill-1.1.2.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-migrate-3.4.0.min.js');

$this->addJqueryPlugin(['scrollTo', 'alerts', 'chosen', 'autosize', 'fancybox']);
$this->addJqueryPlugin('growl', null, false);
Expand Down Expand Up @@ -4023,7 +4020,7 @@ protected function ajaxProcessOpenHelp()
<title>PrestaShop Help</title>
<link href='//help.prestashop.com/css/help.css' rel='stylesheet'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet'>
<script src='" . _PS_JS_DIR_ . "jquery/jquery-1.11.0.min.js'></script>
<script src='" . _PS_JS_DIR_ . "jquery/jquery-3.7.1.min.js'></script>
<script src='" . _PS_JS_DIR_ . "admin.js'></script>
<script src='" . _PS_JS_DIR_ . "tools.js'></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct()

public function setMedia($isNewTheme = false)
{
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-3.4.1.min.js');
$this->addJs(_PS_JS_DIR_ . 'jquery/jquery-3.7.1.min.js');
$this->addjqueryPlugin('validate');
$this->addJS(_PS_JS_DIR_ . 'jquery/plugins/validate/localization/messages_' . $this->context->language->iso_code . '.js');
if ($this->context->language->is_rtl) {
Expand Down
4 changes: 2 additions & 2 deletions install-dev/theme/views/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<link rel="stylesheet" type="text/css" media="all" href="theme/rtl.css" />
<?php } ?>

<script type="text/javascript" src="../js/jquery/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../js/jquery/jquery-migrate-3.1.0.min.js"></script>
<script type="text/javascript" src="../js/jquery/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="../js/jquery/jquery-migrate-3.4.0.min.js"></script>
<script type="text/javascript" src="../js/jquery/plugins/jquery.chosen.js"></script>

<script src="theme/js/sprintf.min.js" integrity="sha512-pmG0OkYtZVB2EqETE5HPsEaok7sNZFfStp5rNdpHv0tGQjbt1z8Qjzhtx88/4wsttOtDwq5DZGJyKyzEe7ribg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Expand Down
9 changes: 0 additions & 9 deletions js/.htaccess

This file was deleted.

29 changes: 0 additions & 29 deletions js/jquery/bo-migrate-mute.js

This file was deleted.

26 changes: 0 additions & 26 deletions js/jquery/bo-migrate-mute.min.js

This file was deleted.

4 changes: 0 additions & 4 deletions js/jquery/jquery-1.11.0.min.js

This file was deleted.

1 change: 0 additions & 1 deletion js/jquery/jquery-1.11.0.min.map

This file was deleted.

2 changes: 0 additions & 2 deletions js/jquery/jquery-3.4.1.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions js/jquery/jquery-3.5.1.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions js/jquery/jquery-3.7.1.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions js/jquery/jquery-migrate-1.2.1.min.js

This file was deleted.