/home/suroeste/public_html/wp-content/plugins/woocommerce/assets/js/frontend
NameSizeModeActions
add-payment-method.js14150644editdlrm
add-payment-method.min.js9050644editdlrm
add-to-cart-variation.js285710644editdlrm
add-to-cart-variation.min.js137860644editdlrm
add-to-cart.js57990644editdlrm
add-to-cart.min.js30580644editdlrm
address-i18n.js49710644editdlrm
address-i18n.min.js26540644editdlrm
cart-fragments.js56390644editdlrm
cart-fragments.min.js29390644editdlrm
cart.js164030644editdlrm
cart.min.js79900644editdlrm
checkout.js262970644editdlrm
checkout.min.js151710644editdlrm
country-select.js62390644editdlrm
country-select.min.js34080644editdlrm
credit-card-form.js5880644editdlrm
credit-card-form.min.js5180644editdlrm
geolocation.js38450644editdlrm
geolocation.min.js12860644editdlrm
lost-password.js1590644editdlrm
lost-password.min.js1320644editdlrm
order-attribution.js66990644editdlrm
order-attribution.min.js23560644editdlrm
password-strength-meter.js38000644editdlrm
password-strength-meter.min.js20300644editdlrm
price-slider.js30650644editdlrm
price-slider.min.js21380644editdlrm
single-product.js104500644editdlrm
single-product.min.js64290644editdlrm
tokenization-form.js38410644editdlrm
tokenization-form.min.js22640644editdlrm
woocommerce.js39270644editdlrm
woocommerce.min.js24670644editdlrm
wp-consent-api-integration.js7270644editdlrm
wp-consent-api-integration.min.js4350644editdlrm
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(); } ); } ); } );