__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* global wpforms_builder, wpf */
/**
* Form Builder Panel Loader module.
*
* @since 1.8.6
*/
var WPForms = window.WPForms || {}; // eslint-disable-line no-var
WPForms.Admin = WPForms.Admin || {};
WPForms.Admin.Builder = WPForms.Admin.Builder || {};
WPForms.Admin.Builder.PanelLoader = WPForms.Admin.Builder.PanelLoader || ( function( document, window, $ ) {
/**
* Elements holder.
*
* @since 1.8.6
*
* @type {Object}
*/
const el = {};
/**
* Runtime variables.
*
* @since 1.8.6
*
* @type {Object}
*/
const vars = [];
/**
* Public functions and properties.
*
* @since 1.8.6
*
* @type {Object}
*/
const app = {
/**
* Start the engine.
*
* @since 1.8.6
*/
init() {
$( app.ready );
},
/**
* DOM is fully loaded.
*
* @since 1.8.6
*/
ready() {
app.setup();
app.events();
el.$builder.trigger( 'wpformsBuilderLoaderReady' );
},
/**
* Setup. Prepare some variables.
*
* @since 1.8.6
*/
setup() {
// Cache DOM elements.
el.$builder = $( '#wpforms-builder' );
el.$form = $( '#wpforms-builder-form' );
el.$panels = el.$builder.find( '.wpforms-panels' );
// Init vars.
vars.currentPanel = wpf.getQueryString( 'view' );
},
/**
* Bind events.
*
* @since 1.8.6
*/
events() {
// Panel switching.
el.$builder.on( 'wpformsPanelSwitch', function( e, panel ) {
// Skip if the panel is still loading.
if ( el.$builder.find( `.wpforms-panel-${ panel }-button .wpforms-loading-spinner` ).length ) {
e.preventDefault();
return;
}
// Open the panel if it is already loaded.
if ( el.$panels.find( '#wpforms-panel-' + panel ).length ) {
return;
}
// Load panel.
e.preventDefault();
app.loadPanel( panel );
} );
},
/**
* Load panel.
*
* @since 1.8.6
*
* @param {string} panel Panel name.
*/
loadPanel( panel ) {
app.showSpinner( panel );
// Load panel.
$.post( wpforms_builder.ajax_url, {
nonce: wpforms_builder.nonce,
action: 'wpforms_builder_load_panel',
panel,
form_id: wpf.getQueryString( 'form_id' ), // eslint-disable-line camelcase
} )
.done( function( response ) {
if ( ! response.success || ! response.data?.length ) {
// Show an error message.
app.displayErrorModal( `<p>${ wpforms_builder.error_load_templates }</p><p>${ wpforms_builder.error_contact_support }</p>` );
return;
}
// Append panel to the DOM.
app.embedPanel( panel, response.data );
// Finalize switching to the panel.
app.switchPanel( panel );
// Trigger panel loaded event.
el.$builder.trigger( 'wpformsBuilderPanelLoaded', [ panel ] );
} )
.fail( function() {
// Show an error message.
app.displayErrorModal( `<p>${ wpforms_builder.something_went_wrong }.</p><p>${ wpforms_builder.error_contact_support }</p>` );
} )
.always( function() {
// Hide loading spinner.
app.hideSpinner( panel );
} );
},
/**
* Show spinner.
*
* @since 1.8.6
*
* @param {string} panel Panel name.
*/
showSpinner( panel ) {
const $button = $( `.wpforms-panel-${ panel }-button` );
$button.find( `i.fa` ).addClass( 'wpforms-hidden' );
$button.prepend( '<i class="wpforms-loading-spinner wpforms-loading-white"></i>' );
},
/**
* Hide spinner.
*
* @since 1.8.6
*
* @param {string} panel Panel name.
*/
hideSpinner( panel ) {
const $button = $( `.wpforms-panel-${ panel }-button` );
$button.find( `i.fa` ).removeClass( 'wpforms-hidden' );
$button.find( `i.wpforms-loading-spinner` ).remove();
},
/**
* Embed panel to DOM.
*
* @since 1.8.6
*
* @param {string} panel Panel slug.
* @param {string} panelHtml Panel HTML.
*/
embedPanel( panel, panelHtml ) {
// Append panel to the DOM.
el.$panels.append( panelHtml );
},
/**
* Finalize switching to the panel.
*
* @since 1.8.6
*
* @param {string} panel Panel slug.
*/
switchPanel( panel ) {
$( '#wpforms-panels-toggle' ).find( 'button' ).removeClass( 'active' );
$( '.wpforms-panel' ).removeClass( 'active' );
$( `.wpforms-panel-${ panel }-button` ).addClass( 'active' );
$( `#wpforms-panel-${ panel }` ).addClass( 'active' );
history.replaceState( {}, null, wpf.updateQueryString( 'view', panel ) );
el.$builder.trigger( 'wpformsPanelSwitched', [ panel ] );
},
/**
* Display modal window with an error message.
*
* @since 1.8.6
*
* @param {string} content Modal content.
*/
displayErrorModal( content ) {
$.alert( {
title : wpforms_builder.uh_oh,
content,
icon : 'fa fa-exclamation-circle',
type : 'red',
buttons: {
cancel: {
text : wpforms_builder.close,
btnClass: 'btn-confirm',
keys : [ 'enter' ],
},
},
} );
},
};
// Provide access to public functions/properties.
return app;
}( document, window, jQuery ) );
// Initialize.
WPForms.Admin.Builder.PanelLoader.init();
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| fields | Folder | 0750 |
|
|
| themes | Folder | 0750 |
|
|
| admin-builder-providers.js | File | 17.4 KB | 0640 |
|
| admin-builder-providers.min.js | File | 8.26 KB | 0640 |
|
| admin-builder.js | File | 288.17 KB | 0640 |
|
| admin-builder.min.js | File | 134.37 KB | 0640 |
|
| chocolate-choices.js | File | 2.28 KB | 0640 |
|
| chocolate-choices.min.js | File | 470 B | 0640 |
|
| choices-list.js | File | 3.7 KB | 0640 |
|
| choices-list.min.js | File | 714 B | 0640 |
|
| context-menu.js | File | 18.11 KB | 0640 |
|
| context-menu.min.js | File | 7.99 KB | 0640 |
|
| drag-fields.js | File | 24.15 KB | 0640 |
|
| drag-fields.min.js | File | 9.43 KB | 0640 |
|
| dropdown-list.js | File | 9.76 KB | 0640 |
|
| dropdown-list.min.js | File | 3.77 KB | 0640 |
|
| email-template.js | File | 5.02 KB | 0640 |
|
| email-template.min.js | File | 1.41 KB | 0640 |
|
| field-map.js | File | 6.44 KB | 0640 |
|
| field-map.min.js | File | 2.32 KB | 0640 |
|
| form-templates.js | File | 19.36 KB | 0640 |
|
| form-templates.min.js | File | 8.11 KB | 0640 |
|
| help.js | File | 11.3 KB | 0640 |
|
| help.min.js | File | 4.9 KB | 0640 |
|
| panel-loader.js | File | 4.95 KB | 0640 |
|
| panel-loader.min.js | File | 2.2 KB | 0640 |
|
| payments-utils.js | File | 3.41 KB | 0640 |
|
| payments-utils.min.js | File | 1.92 KB | 0640 |
|
| providers.js | File | 34.67 KB | 0640 |
|
| providers.min.js | File | 12.49 KB | 0640 |
|
| search-fields.js | File | 4.56 KB | 0640 |
|
| search-fields.min.js | File | 2.45 KB | 0640 |
|
| settings.js | File | 11.14 KB | 0640 |
|
| settings.min.js | File | 4.71 KB | 0640 |
|
| setup.js | File | 19.81 KB | 0640 |
|
| setup.min.js | File | 9.32 KB | 0640 |
|
| smart-tags.js | File | 43.2 KB | 0640 |
|
| smart-tags.min.js | File | 14.51 KB | 0640 |
|
| templates.js | File | 3.97 KB | 0640 |
|
| templates.min.js | File | 1.05 KB | 0640 |
|
| wpforms-choicesjs.js | File | 6.38 KB | 0640 |
|
| wpforms-choicesjs.min.js | File | 2.22 KB | 0640 |
|