/
home
/
suroeste
/
public_html
/
wp-content
/
plugins
/
woocommerce
/
assets
/
js
/
frontend
/
/home/suroeste/public_html/wp-content/plugins/woocommerce/assets/js/frontend
mkdir
upload
Name
Size
Mode
Actions
add-payment-method.js
1415
0644
edit
dl
rm
add-payment-method.min.js
905
0644
edit
dl
rm
add-to-cart-variation.js
28571
0644
edit
dl
rm
add-to-cart-variation.min.js
13786
0644
edit
dl
rm
add-to-cart.js
5799
0644
edit
dl
rm
add-to-cart.min.js
3058
0644
edit
dl
rm
address-i18n.js
4971
0644
edit
dl
rm
address-i18n.min.js
2654
0644
edit
dl
rm
cart-fragments.js
5639
0644
edit
dl
rm
cart-fragments.min.js
2939
0644
edit
dl
rm
cart.js
16403
0644
edit
dl
rm
cart.min.js
7990
0644
edit
dl
rm
checkout.js
26297
0644
edit
dl
rm
checkout.min.js
15171
0644
edit
dl
rm
country-select.js
6239
0644
edit
dl
rm
country-select.min.js
3408
0644
edit
dl
rm
credit-card-form.js
588
0644
edit
dl
rm
credit-card-form.min.js
518
0644
edit
dl
rm
geolocation.js
3845
0644
edit
dl
rm
geolocation.min.js
1286
0644
edit
dl
rm
lost-password.js
159
0644
edit
dl
rm
lost-password.min.js
132
0644
edit
dl
rm
order-attribution.js
6699
0644
edit
dl
rm
order-attribution.min.js
2356
0644
edit
dl
rm
password-strength-meter.js
3800
0644
edit
dl
rm
password-strength-meter.min.js
2030
0644
edit
dl
rm
price-slider.js
3065
0644
edit
dl
rm
price-slider.min.js
2138
0644
edit
dl
rm
single-product.js
10450
0644
edit
dl
rm
single-product.min.js
6429
0644
edit
dl
rm
tokenization-form.js
3841
0644
edit
dl
rm
tokenization-form.min.js
2264
0644
edit
dl
rm
woocommerce.js
3927
0644
edit
dl
rm
woocommerce.min.js
2467
0644
edit
dl
rm
wp-consent-api-integration.js
727
0644
edit
dl
rm
wp-consent-api-integration.min.js
435
0644
edit
dl
rm
Edit:
/home/suroeste/public_html/wp-content/plugins/woocommerce/assets/js/frontend/tokenization-form.js
(3841B)
/*global wc_tokenization_form_params */ jQuery( function( $ ) { /** * WCTokenizationForm class. */ var TokenizationForm = function( $target ) { this.$target = $target; this.$formWrap = $target.closest( '.payment_box' ); // Params. this.params = $.extend( {}, { 'is_registration_required': false, 'is_logged_in' : false }, wc_tokenization_form_params ); // Bind functions to this. this.onDisplay = this.onDisplay.bind( this ); this.hideForm = this.hideForm.bind( this ); this.showForm = this.showForm.bind( this ); this.showSaveNewCheckbox = this.showSaveNewCheckbox.bind( this ); this.hideSaveNewCheckbox = this.hideSaveNewCheckbox.bind( this ); // When a radio button is changed, make sure to show/hide our new CC info area. this.$target.on( 'click change', ':input.woocommerce-SavedPaymentMethods-tokenInput', { tokenizationForm: this }, this.onTokenChange ); // OR if create account is checked. $( 'input#createaccount' ).on( 'change', { tokenizationForm: this }, this.onCreateAccountChange ); // First display. this.onDisplay(); }; TokenizationForm.prototype.onDisplay = function() { // Make sure a radio button is selected if there is no is_default for this payment method.. if ( 0 === $( ':input.woocommerce-SavedPaymentMethods-tokenInput:checked', this.$target ).length ) { $( ':input.woocommerce-SavedPaymentMethods-tokenInput:last', this.$target ).prop( 'checked', true ); } // Don't show the "use new" radio button if we only have one method.. if ( 0 === this.$target.data( 'count' ) ) { $( '.woocommerce-SavedPaymentMethods-new', this.$target ).remove(); } // Hide "save card" if "Create Account" is not checked and registration is not forced. var hasCreateAccountCheckbox = 0 < $( 'input#createaccount' ).length, createAccount = hasCreateAccountCheckbox && $( 'input#createaccount' ).is( ':checked' ); if ( createAccount || this.params.is_logged_in || this.params.is_registration_required ) { this.showSaveNewCheckbox(); } else { this.hideSaveNewCheckbox(); } // Trigger change event $( ':input.woocommerce-SavedPaymentMethods-tokenInput:checked', this.$target ).trigger( 'change' ); }; TokenizationForm.prototype.onTokenChange = function( event ) { if ( 'new' === $( this ).val() ) { event.data.tokenizationForm.showForm(); event.data.tokenizationForm.showSaveNewCheckbox(); } else { event.data.tokenizationForm.hideForm(); event.data.tokenizationForm.hideSaveNewCheckbox(); } }; TokenizationForm.prototype.onCreateAccountChange = function( event ) { if ( $( this ).is( ':checked' ) ) { event.data.tokenizationForm.showSaveNewCheckbox(); } else { event.data.tokenizationForm.hideSaveNewCheckbox(); } }; TokenizationForm.prototype.hideForm = function() { $( '.wc-payment-form', this.$formWrap ).hide(); }; TokenizationForm.prototype.showForm = function() { $( '.wc-payment-form', this.$formWrap ).show(); }; TokenizationForm.prototype.showSaveNewCheckbox = function() { $( '.woocommerce-SavedPaymentMethods-saveNew', this.$formWrap ).show(); }; TokenizationForm.prototype.hideSaveNewCheckbox = function() { $( '.woocommerce-SavedPaymentMethods-saveNew', this.$formWrap ).hide(); }; /** * Function to call wc_product_gallery on jquery selector. */ $.fn.wc_tokenization_form = function( args ) { new TokenizationForm( this, args ); return this; }; /** * Initialize. */ $( document.body ).on( 'updated_checkout wc-credit-card-form-init', function() { // Loop over gateways with saved payment methods var $saved_payment_methods = $( 'ul.woocommerce-SavedPaymentMethods' ); $saved_payment_methods.each( function() { $( this ).wc_tokenization_form(); } ); } ); } );
Save
cmd:
run