| Name | Size | Mode | Actions |
|---|---|---|---|
| admin/ | - | 0755 | rm |
| components/ | - | 0755 | rm |
| integrations/ | - | 0755 | rm |
| admin-builder-providers.js | 14581 | 0644 | editdlrm |
| admin-builder-providers.min.js | 7372 | 0644 | editdlrm |
| admin-builder-utils.min.js | 1160 | 0644 | editdlrm |
| admin-builder.js | 252097 | 0644 | editdlrm |
| admin-builder.min.js | 122167 | 0644 | editdlrm |
| admin-editor.js | 1569 | 0644 | editdlrm |
| admin-editor.min.js | 994 | 0644 | editdlrm |
| admin-notifications.js | 3909 | 0644 | editdlrm |
| admin-notifications.min.js | 2055 | 0644 | editdlrm |
| admin-utils.js | 26629 | 0644 | editdlrm |
| admin-utils.min.js | 11679 | 0644 | editdlrm |
| admin.js | 64027 | 0644 | editdlrm |
| admin.min.js | 33027 | 0644 | editdlrm |
| text-limit.es5.js | 26687 | 0644 | editdlrm |
| text-limit.es5.min.js | 2887 | 0644 | editdlrm |
| text-limit.js | 6942 | 0644 | editdlrm |
| utils.js | 2233 | 0644 | editdlrm |
| utils.min.js | 340 | 0644 | editdlrm |
| wpforms-confirmation.js | 603 | 0644 | editdlrm |
| wpforms-confirmation.min.js | 418 | 0644 | editdlrm |
| wpforms-modern.js | 13574 | 0644 | editdlrm |
| wpforms-modern.min.js | 5585 | 0644 | editdlrm |
| wpforms.js | 82605 | 0644 | editdlrm |
| wpforms.min.js | 35242 | 0644 | editdlrm |
/home/altere25/infinet.finance/wp-content/plugins/wpforms/assets/js/admin-builder-providers.js (14581B)
' + wpforms_builder_providers.error_name + '
', modalContent = namePrompt + nameField + nameError; modalContent = modalContent.replace( /%type%/g, type ); $.confirm( { title: false, content: modalContent, icon: 'fa fa-info-circle', type: 'blue', buttons: { confirm: { text: wpforms_builder.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function() { var name = this.$content.find( 'input#provider-connection-name' ).val().trim(); var error = this.$content.find( '.error' ); if ( name === '' ) { error.show(); return false; } else { // Disable button. WPFormsProviders.inputToggle( $this, 'disable' ); // Fire AJAX. var data = { action : 'wpforms_provider_ajax_' + provider, provider: provider, task : 'new_connection', name : name, id : s.form.data( 'id' ), nonce : wpforms_builder.nonce, }; WPFormsProviders.fireAJAX( $this, data, function( res ) { if ( res.success ) { $connections.find( '.wpforms-builder-provider-connections-default' ).addClass( 'wpforms-hidden' ); $connections.find( '.wpforms-provider-connections' ).prepend( res.data.html ); // Process and load the accounts if they exist. var $connection = $connections.find( '.wpforms-provider-connection' ).first(); if ( $connection.find( '.wpforms-provider-accounts option:selected' ) ) { $connection.find( '.wpforms-provider-accounts option' ).first().prop( 'selected', true ); $connection.find( '.wpforms-provider-accounts select' ).trigger( 'change' ); } } else { WPFormsProviders.errorDisplay( res.data.error, $container ); } } ); } }, }, cancel: { text: wpforms_builder.cancel, }, }, } ); }, /** * Add and authorize provider account. * * @since 1.0.0 */ accountAdd: function( el, e ) { e.preventDefault(); var $this = $( el ), provider = $this.data( 'provider' ), $connection = $this.closest( '.wpforms-provider-connection' ), $container = $this.parent(), $fields = $container.find( ':input' ), errors = WPFormsProviders.requiredCheck( $fields, $container ); // Disable button. WPFormsProviders.inputToggle( $this, 'disable' ); // Bail if we have any errors. if ( errors ) { $this.prop( 'disabled', false ).find( 'i' ).remove(); return false; } // Fire AJAX. var data = { action : 'wpforms_provider_ajax_' + provider, provider : provider, connection_id: $connection.data( 'connection_id' ), task : 'new_account', data : WPFormsProviders.fakeSerialize( $fields ), }; WPFormsProviders.fireAJAX( $this, data, function( res ) { if ( res.success ) { $container.nextAll( '.wpforms-connection-block' ).remove(); $container.nextAll( '.wpforms-conditional-block' ).remove(); $container.after( res.data.html ); $container.slideUp(); $connection.find( '.wpforms-provider-accounts select' ).trigger( 'change' ); } else { WPFormsProviders.errorDisplay( res.data.error, $container ); } } ); }, /** * Selecting a provider account * * @since 1.0.0 */ accountSelect: function( el, e ) { e.preventDefault(); var $this = $( el ), $connection = $this.closest( '.wpforms-provider-connection' ), $container = $this.parent(), provider = $connection.data( 'provider' ); // Disable select, show loading. WPFormsProviders.inputToggle( $this, 'disable' ); // Remove any blocks that might exist as we prep for new account. $container.nextAll( '.wpforms-connection-block' ).remove(); $container.nextAll( '.wpforms-conditional-block' ).remove(); if ( ! $this.val() ) { // User selected to option to add new account. $connection.find( '.wpforms-provider-account-add input' ).val( '' ); $connection.find( '.wpforms-provider-account-add' ).slideDown(); WPFormsProviders.inputToggle( $this, 'enable' ); } else { $connection.find( '.wpforms-provider-account-add' ).slideUp(); // Fire AJAX. var data = { action : 'wpforms_provider_ajax_' + provider, provider : provider, connection_id: $connection.data( 'connection_id' ), task : 'select_account', account_id : $this.find( ':selected' ).val(), }; WPFormsProviders.fireAJAX( $this, data, function( res ) { if ( res.success ) { $container.after( res.data.html ); // Process first list found. $connection.find( '.wpforms-provider-lists option' ).first().prop( 'selected', true ); $connection.find( '.wpforms-provider-lists select' ).trigger( 'change' ); } else { WPFormsProviders.errorDisplay( res.data.error, $container ); } } ); } }, /** * Selecting a provider account list. * * @since 1.0.0 */ accountListSelect: function( el, e ) { e.preventDefault(); var $this = $( el ), $connection = $this.closest( '.wpforms-provider-connection' ), $container = $this.parent(), provider = $connection.data( 'provider' ); // Disable select, show loading. WPFormsProviders.inputToggle( $this, 'disable' ); // Remove any blocks that might exist as we prep for new account. $container.nextAll( '.wpforms-connection-block' ).remove(); $container.nextAll( '.wpforms-conditional-block' ).remove(); var data = { action : 'wpforms_provider_ajax_' + provider, provider : provider, connection_id: $connection.data( 'connection_id' ), task : 'select_list', account_id : $connection.find( '.wpforms-provider-accounts option:selected' ).val(), list_id : $this.find( ':selected' ).val(), form_id : s.form.data( 'id' ), }; WPFormsProviders.fireAJAX( $this, data, function( res ) { if ( res.success ) { $container.after( res.data.html ); // Re-init tooltips for new fields. wpf.initTooltips(); } else { WPFormsProviders.errorDisplay( res.data.error, $container ); } } ); }, /** * Confirm form save before loading Provider panel. * If confirmed, save and reload panel. * * @since 1.0.0 */ providerPanelConfirm: function( targetPanel ) { wpforms_panel_switch = true; if ( targetPanel === 'providers' && ! s.form.data( 'revision' ) ) { if ( wpf.savedState != wpf.getFormState( '#wpforms-builder-form' ) ) { wpforms_panel_switch = false; $.confirm( { title: false, content: wpforms_builder_providers.confirm_save, icon: 'fa fa-info-circle', type: 'blue', buttons: { confirm: { text: wpforms_builder.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function() { $( '#wpforms-save' ).trigger( 'click' ); $( document ).on( 'wpformsSaved', function() { window.location.href = wpforms_builder_providers.url; } ); }, }, cancel: { text: wpforms_builder.cancel, }, }, } ); } } }, //--------------------------------------------------------------------// // Helper functions. //--------------------------------------------------------------------// /** * Fire AJAX call. * * @since 1.0.0 */ fireAJAX: function( el, d, success ) { var $this = $( el ); var data = { id : $( '#wpforms-builder-form' ).data( 'id' ), nonce : wpforms_builder.nonce, }; $.extend( data, d ); $.post( wpforms_builder.ajax_url, data, function( res ) { success( res ); WPFormsProviders.inputToggle( $this, 'enable' ); } ).fail( function( xhr, textStatus, e ) { console.log( xhr.responseText ); } ); }, /** * Toggle input with loading indicator. * * @since 1.0.0 */ inputToggle: function( el, status ) { var $this = $( el ); if ( status === 'enable' ) { if ( $this.is( 'select' ) ) { $this.prop( 'disabled', false ).next( 'i' ).remove(); } else { $this.prop( 'disabled', false ).find( 'i' ).remove(); } } else if ( status === 'disable' ) { if ( $this.is( 'select' ) ) { $this.prop( 'disabled', true ).after( s.spinner ); } else { $this.prop( 'disabled', true ).prepend( s.spinnerWhite ); } } }, /** * Display error. * * @since 1.0.0 */ errorDisplay: function( msg, location ) { location.find( '.wpforms-error-msg' ).remove(); location.prepend( '' + msg + '
' ); }, /** * Check for required fields. * * @since 1.0.0 */ requiredCheck: function( fields, location ) { var error = false; // Remove any previous errors. location.find( '.wpforms-alert-required' ).remove(); // Loop through input fields and check for values. fields.each( function( index, el ) { if ( $( el ).hasClass( 'wpforms-required' ) && $( el ).val().length === 0 ) { $( el ).addClass( 'wpforms-error' ); error = true; } else { $( el ).removeClass( 'wpforms-error' ); } } ); if ( error ) { location.prepend( '' + wpforms_builder_providers.required_field + '
' ); } return error; }, /** * Pseudo serializing. Fake it until you make it. * * @since 1.0.0 */ fakeSerialize: function( els ) { var fields = els.clone(); fields.each( function( index, el ) { if ( $( el ).data( 'name' ) ) { $( el ).attr( 'name', $( el ).data( 'name' ) ); } } ); return fields.serialize(); }, }; WPFormsProviders.init(); } )( jQuery );