Skip to content

Commit fd545b3

Browse files
authored
Merge pull request #522 from skyverge/ch67466/update-jquery-usages
Update deprecated jQuery usages
2 parents 49fdd29 + 7cb49d5 commit fd545b3

18 files changed

+101
-92
lines changed

woocommerce/assets/js/admin/sv-wc-plugin-admin-setup-wizard.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# @since 5.3.0
77
###
8-
jQuery( document ).ready ( $ ) ->
8+
jQuery ( $ ) ->
99

1010
blockWizardUI = () ->
1111

woocommerce/assets/js/admin/sv-wc-plugin-admin-setup-wizard.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

woocommerce/assets/js/admin/sv-wc-plugin-admin-setup-wizard.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

woocommerce/assets/js/admin/sv-wp-admin-job-batch-handler.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# @since 4.8.0
55
###
66

7-
jQuery( document ).ready ( $ ) ->
7+
jQuery ( $ ) ->
88
'use strict'
99

1010

woocommerce/assets/js/admin/sv-wp-admin-job-batch-handler.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

woocommerce/assets/js/admin/sv-wp-admin-job-batch-handler.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

woocommerce/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** SkyVerge WooCommerce Plugin Framework Changelog ***
22

3+
2020.nn.nn - version 5.10.2-dev.1
4+
* Misc - Updates deprecated jQuery usages
5+
36
2020.11.24 - version 5.10.1
47
* Fix - Prevent a deprecated notice for SV_WC_Payment_Gateway_Hosted::do_invalid_transaction_response() in PHP 8
58
* Fix - Prevent PHP Notices and fatal errors on wizard steps

woocommerce/class-sv-wc-admin-notice-handler.php

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -254,53 +254,56 @@ public function render_admin_notice_js() {
254254
self::$admin_notice_js_rendered = true;
255255

256256
ob_start();
257+
257258
?>
259+
( function( $ ) {
258260

259-
// Log dismissed notices
260-
$( '.js-wc-plugin-framework-admin-notice' ).on( 'click.wp-dismiss-notice', '.notice-dismiss', function( e ) {
261+
// log dismissed notices
262+
$( '.js-wc-plugin-framework-admin-notice' ).on( 'click.wp-dismiss-notice', '.notice-dismiss', function( e ) {
261263

262-
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
264+
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
263265

264-
log_dismissed_notice(
265-
$( $notice ).data( 'plugin-id' ),
266-
$( $notice ).data( 'message-id' )
267-
);
266+
log_dismissed_notice(
267+
$( $notice ).data( 'plugin-id' ),
268+
$( $notice ).data( 'message-id' )
269+
);
268270

269-
} );
271+
} );
270272

271-
// Log and hide legacy notices
272-
$( 'a.js-wc-plugin-framework-notice-dismiss' ).click( function( e ) {
273+
// Log and hide legacy notices
274+
$( 'a.js-wc-plugin-framework-notice-dismiss' ).click( function( e ) {
273275

274-
e.preventDefault();
276+
e.preventDefault();
275277

276-
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
278+
var $notice = $( this ).closest( '.js-wc-plugin-framework-admin-notice' );
277279

278-
log_dismissed_notice(
279-
$( $notice ).data( 'plugin-id' ),
280-
$( $notice ).data( 'message-id' )
281-
);
280+
log_dismissed_notice(
281+
$( $notice ).data( 'plugin-id' ),
282+
$( $notice ).data( 'message-id' )
283+
);
282284

283-
$( $notice ).fadeOut();
285+
$( $notice ).fadeOut();
284286

285-
} );
287+
} );
286288

287-
function log_dismissed_notice( pluginID, messageID ) {
289+
function log_dismissed_notice( pluginID, messageID ) {
288290

289-
$.get(
290-
ajaxurl,
291-
{
292-
action: 'wc_plugin_framework_' + pluginID + '_dismiss_notice',
293-
messageid: messageID
294-
}
295-
);
296-
}
291+
$.get(
292+
ajaxurl,
293+
{
294+
action: 'wc_plugin_framework_' + pluginID + '_dismiss_notice',
295+
messageid: messageID
296+
}
297+
);
298+
}
299+
300+
// move any delayed notices up into position .show();
301+
$( '.js-wc-plugin-framework-admin-notice:hidden' ).insertAfter( '.js-wc-<?php echo esc_js( $plugin_slug ); ?>-admin-notice-placeholder' ).show();
297302

298-
// move any delayed notices up into position .show();
299-
$( '.js-wc-plugin-framework-admin-notice:hidden' ).insertAfter( '.js-wc-<?php echo esc_js( $plugin_slug ); ?>-admin-notice-placeholder' ).show();
303+
} ) ( jQuery );
300304
<?php
301-
$javascript = ob_get_clean();
302305

303-
wc_enqueue_js( $javascript );
306+
wc_enqueue_js( ob_get_clean() );
304307
}
305308

306309

woocommerce/i18n/languages/woocommerce-plugin-framework-et.po

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ msgstr "Esines viga, palun proovi uuesti või kasuta teistsugust makseviisi."
528528

529529
#. translators: Placeholders: %s - a WooCommerce order ID
530530
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
531-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:445
531+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:449
532532
msgid "Could not find order %s"
533533
msgstr ""
534534

@@ -566,12 +566,12 @@ msgstr "Tehingu ID %s"
566566
#. translators: Placeholders: %s - payment gateway title (such as
567567
#. Authorize.net, Braintree, etc)
568568
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
569-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:509
569+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:513
570570
msgid "%s duplicate transaction received"
571571
msgstr "%s: duplikaattehing"
572572

573573
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
574-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:512
574+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:516
575575
msgid "Order %s is already paid for."
576576
msgstr ""
577577

@@ -1204,28 +1204,28 @@ msgstr "Deebet- või krediitkaart"
12041204
msgid "Bank Account"
12051205
msgstr "Pangakonto"
12061206

1207-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:297
1207+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:301
12081208
msgid "Thank you for your order, please click the button below to pay."
12091209
msgstr "Aitäh tellimuse eest. Palun kliki maksmiseks alloleval nupul."
12101210

1211-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:298
1211+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:302
12121212
msgid ""
12131213
"Thank you for your order. We are now redirecting you to complete payment."
12141214
msgstr "Aitäh tellimuse eest. Makse teostamiseks suunatakse sind nüüd edasi."
12151215

1216-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:299
1216+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:303
12171217
msgid "Pay Now"
12181218
msgstr "Maksa"
12191219

1220-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:300
1220+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:304
12211221
msgid "Cancel Order"
12221222
msgstr "Tühista tellimus"
12231223

12241224
#. translators: Placeholders: %1$s - payment gateway title (such as
12251225
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
12261226
#. account, etc), %3$s - last four digits of the card/account, %4$s -
12271227
#. card/account expiry date
1228-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:597
1228+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:601
12291229
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1115
12301230
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
12311231
msgstr ""
@@ -1234,21 +1234,21 @@ msgstr ""
12341234
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
12351235
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
12361236
#. available), %3$s - last four digits of the account
1237-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:608
1237+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:612
12381238
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1126
12391239
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
12401240
msgstr ""
12411241
"%1$s: e-tšeki maksevahend salvestatud: %2$s konto, lõpeb numbritega %3$s"
12421242

12431243
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
12441244
#. NETbilling, etc)
1245-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:617
1245+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:621
12461246
#, fuzzy
12471247
msgid "%s Payment Method Saved"
12481248
msgstr "Minu maksevahendid."
12491249

12501250
#. translators: Placeholders: %s - a failed tokenization API error
1251-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:626
1251+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:630
12521252
#, fuzzy
12531253
msgid "Tokenization failed. %s"
12541254
msgstr "Maksevahendi salvestamise päring ebaõnnestus: %s"

woocommerce/i18n/languages/woocommerce-plugin-framework.pot

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ msgid "An error occurred, please try again or try an alternate form of payment."
506506
msgstr ""
507507

508508
#: payment-gateway/Handlers/Abstract_Hosted_Payment_Handler.php:320
509-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:445
509+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:449
510510
#. translators: Placeholders: %s - a WooCommerce order ID
511511
msgid "Could not find order %s"
512512
msgstr ""
@@ -543,14 +543,14 @@ msgid "Transaction ID %s"
543543
msgstr ""
544544

545545
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:204
546-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:509
546+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:513
547547
#. translators: Placeholders: %s - payment gateway title (such as
548548
#. Authorize.net, Braintree, etc)
549549
msgid "%s duplicate transaction received"
550550
msgstr ""
551551

552552
#: payment-gateway/Handlers/Abstract_Payment_Handler.php:207
553-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:512
553+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:516
554554
msgid "Order %s is already paid for."
555555
msgstr ""
556556

@@ -1136,23 +1136,23 @@ msgstr ""
11361136
msgid "Bank Account"
11371137
msgstr ""
11381138

1139-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:297
1139+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:301
11401140
msgid "Thank you for your order, please click the button below to pay."
11411141
msgstr ""
11421142

1143-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:298
1143+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:302
11441144
msgid "Thank you for your order. We are now redirecting you to complete payment."
11451145
msgstr ""
11461146

1147-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:299
1147+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:303
11481148
msgid "Pay Now"
11491149
msgstr ""
11501150

1151-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:300
1151+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:304
11521152
msgid "Cancel Order"
11531153
msgstr ""
11541154

1155-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:597
1155+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:601
11561156
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1115
11571157
#. translators: Placeholders: %1$s - payment gateway title (such as
11581158
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
@@ -1161,21 +1161,21 @@ msgstr ""
11611161
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
11621162
msgstr ""
11631163

1164-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:608
1164+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:612
11651165
#: payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:1126
11661166
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
11671167
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
11681168
#. available), %3$s - last four digits of the account
11691169
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
11701170
msgstr ""
11711171

1172-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:617
1172+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:621
11731173
#. translators: Placeholders: %s - payment gateway title (such as CyberSouce,
11741174
#. NETbilling, etc)
11751175
msgid "%s Payment Method Saved"
11761176
msgstr ""
11771177

1178-
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:626
1178+
#: payment-gateway/class-sv-wc-payment-gateway-hosted.php:630
11791179
#. translators: Placeholders: %s - a failed tokenization API error
11801180
msgid "Tokenization failed. %s"
11811181
msgstr ""

0 commit comments

Comments
 (0)