/
home
/
vianto5
/
duettowers.mx
/
wp-content
/
plugins
/
wpforms
/
assets
/
js
/
admin
/
builder
/
/home/vianto5/duettowers.mx/wp-content/plugins/wpforms/assets/js/admin/builder
mkdir
upload
Name
Size
Mode
Actions
fields/
-
0755
rm
themes/
-
0755
rm
admin-builder-providers.js
17818
0644
edit
dl
rm
admin-builder-providers.min.js
8454
0644
edit
dl
rm
admin-builder.js
311448
0644
edit
dl
rm
admin-builder.min.js
142059
0644
edit
dl
rm
chocolate-choices.js
2334
0644
edit
dl
rm
chocolate-choices.min.js
470
0644
edit
dl
rm
choices-list.js
3784
0644
edit
dl
rm
choices-list.min.js
714
0644
edit
dl
rm
context-menu.js
18540
0644
edit
dl
rm
context-menu.min.js
8183
0644
edit
dl
rm
drag-fields.js
24725
0644
edit
dl
rm
drag-fields.min.js
9653
0644
edit
dl
rm
dropdown-list.js
9992
0644
edit
dl
rm
dropdown-list.min.js
3863
0644
edit
dl
rm
email-template.js
5144
0644
edit
dl
rm
email-template.min.js
1448
0644
edit
dl
rm
field-map.js
6592
0644
edit
dl
rm
field-map.min.js
2372
0644
edit
dl
rm
form-templates.js
19821
0644
edit
dl
rm
form-templates.min.js
8301
0644
edit
dl
rm
help.js
11572
0644
edit
dl
rm
help.min.js
5016
0644
edit
dl
rm
image-upload.js
4543
0644
edit
dl
rm
image-upload.min.js
2020
0644
edit
dl
rm
multiple-choices.js
15418
0644
edit
dl
rm
multiple-choices.min.js
6367
0644
edit
dl
rm
panel-loader.js
5071
0644
edit
dl
rm
panel-loader.min.js
2252
0644
edit
dl
rm
payments-utils.js
3493
0644
edit
dl
rm
payments-utils.min.js
1963
0644
edit
dl
rm
providers.js
35506
0644
edit
dl
rm
providers.min.js
12791
0644
edit
dl
rm
search-fields.js
4671
0644
edit
dl
rm
search-fields.min.js
2508
0644
edit
dl
rm
settings.js
11412
0644
edit
dl
rm
settings.min.js
4820
0644
edit
dl
rm
setup.js
20288
0644
edit
dl
rm
setup.min.js
9546
0644
edit
dl
rm
smart-tags.js
45899
0644
edit
dl
rm
smart-tags.min.js
15275
0644
edit
dl
rm
templates.js
4070
0644
edit
dl
rm
templates.min.js
1079
0644
edit
dl
rm
wpforms-choicesjs.js
8194
0644
edit
dl
rm
wpforms-choicesjs.min.js
2631
0644
edit
dl
rm
Edit:
/home/vianto5/duettowers.mx/wp-content/plugins/wpforms/assets/js/admin/builder/email-template.js
(5144B)
/* eslint-disable camelcase */ /* global wpforms_builder_email_template */ // noinspection ES6ConvertVarToLetConst /** * Script for manipulating DOM events in the "Builder" settings page. * This script will be accessible in the "WPForms" → "Builder" → "Notifications" tab/page. * * @since 1.8.5 */ // eslint-disable-next-line no-var var WPFormsBuilderEmailTemplate = window.WPFormsBuilderEmailTemplate || ( function( document, window, $, l10n ) { /** * Elements holder. * * @since 1.8.5 * * @type {Object} */ const el = {}; /** * Runtime variables. * * @since 1.8.5 * * @type {Object} */ const vars = { /** * Modal instance. * * @since 1.8.5 */ modal: null, /** * Generic CSS class names for applying visual changes. * * @since 1.8.5 */ classNames: { modalBox: 'wpforms-modal-content-box', modalOpen: 'wpforms-email-template-modal-open', }, }; /** * Public functions and properties. * * @since 1.8.5 */ const app = { /** * Start the engine. * * @since 1.8.5 */ init() { $( app.ready ); }, /** * Document ready. * * @since 1.8.5 */ ready() { app.setup(); app.bindEvents(); }, /** * Setup. Prepare some variables. * * @since 1.8.5 */ setup() { // Cache DOM elements. el.$document = $( document ); el.$body = $( 'body' ); }, /** * Bind events. * * @since 1.8.5 */ bindEvents() { el.$document .on( 'change', '.wpforms-email-template-modal-content input[type="radio"]', app.handleOnChangeTemplate ) .on( 'click', '.wpforms-all-email-template-modal', app.handleOnOpenModal ); }, /** * Handle the "change" event for the template radio buttons. * This function updates the select field based on the selected radio button. * * @since 1.8.5 * * @param {Object} event The DOM event that triggered the function. */ handleOnChangeTemplate( event ) { // Prevent the default action, which is to handle the change event. event.preventDefault(); // Extract the ID of the field from the element. const id = app.getIdFromElm( $( this ) ); // Get the corresponding select field. const $field = $( `#wpforms-panel-field-notifications-${ id }-template` ); // If the select field doesn't exist, no further action is needed. if ( ! $field.length ) { return; } // If the modal doesn't exist, no further action is needed. if ( ! vars.modal ) { return; } // Get the value of the radio button that triggered the change. const value = $( this ).val(); // Update the select field with the selected value and trigger the change event. $field.val( value ).trigger( 'change' ); // Close the modal. vars.modal.close(); }, /** * Handle the "click" event for opening the modal. * This will open the modal with the available templates. * * @since 1.8.5 */ handleOnOpenModal() { // Get the email template modal template. const template = wp.template( 'wpforms-email-template-modal' ); // If the template doesn't exist, exit the function. if ( ! template.length ) { return; } // Find the closest wrapper and select element. const $wrapper = $( this ).closest( '.wpforms-panel-field-email-template-wrap' ); const $select = $wrapper.find( 'select' ); // Get the selected value from the select element and its ID. const selected = $select.val() || ''; const id = app.getIdFromElm( $select ); // Extract relevant data from l10n. const { templates, is_pro } = l10n; // Prepare the data to be passed to the template. const data = { templates, selected, is_pro, id }; // Generate the modal's content using the template and data. const content = template( data ); // Open the modal. vars.modal = $.confirm( { content, title: '', boxWidth: 800, contentMaxHeight: 'none', backgroundDismiss: true, smoothContent: false, closeIcon: true, buttons: false, // Callback function before the modal opens. onOpenBefore() { this.$body.addClass( vars.classNames.modalBox ); el.$body.addClass( vars.classNames.modalOpen ); }, // Callback function when the modal is closed. onClose() { el.$body.removeClass( vars.classNames.modalOpen ); }, } ); }, /** * Get the ID from the element. * This is a helper function for extracting the numeric ID from an element's ID attribute. * * @since 1.8.5 * * @param {Object} $elm jQuery object representing the element. * * @return {number} The numeric ID extracted from the element's ID attribute. */ getIdFromElm( $elm ) { // Get the ID attribute from the element. const id = $elm.attr( 'id' ); // If no ID attribute is found, return 0. if ( ! id ) { return 0; } // Extract and parse the numeric part from the ID. return parseInt( id.match( /\d+/ )[ 0 ], 10 ); }, }; // Provide access to public functions/properties. return app; }( document, window, jQuery, wpforms_builder_email_template ) ); // Initialize. WPFormsBuilderEmailTemplate.init();
Save
cmd:
run