From 5b84916bdbe2caeec7f6c4d09dcc7d7a6a7fdc3f Mon Sep 17 00:00:00 2001
From: Sherv ' +
- frmPlugSearch.legend +
- ' ${
+ frmPlugSearch.legend
+ } ' + response.message + ' ${ response.message } ' + res.data.name + ': ' + res.data.msg + ' ${ res.data.name }: ${ res.data.msg } Imported ' + res.data.name + ' Imported ${ res.data.name }
';
- msg += addHtmlTags( '' + frmAdminJs.reserved_words + '', 'div' );
+ msg += addHtmlTags( `${ frmAdminJs.reserved_words }`, 'div' );
infoModal( msg );
}
}
@@ -84,7 +84,7 @@
while ( match !== null ) {
if ( Array.isArray( frmAdminJs.unsafe_params ) && frmAdminJs.unsafe_params.includes( match[ 1 ] ) ) {
if ( unsafeParams !== '' ) {
- unsafeParams += '", "' + match[ 1 ];
+ unsafeParams += `", "${ match[ 1 ] }`;
} else {
unsafeParams = match[ 1 ];
}
@@ -96,7 +96,7 @@
let msg = frmAdminJs.param_is_reserved;
msg = msg.replace( '****', addHtmlTags( unsafeParams, 'strong' ) );
msg += '
';
- msg += ' ' + frmAdminJs.reserved_words + '';
+ msg += ` ${ frmAdminJs.reserved_words }`;
infoModal( msg );
}
@@ -104,7 +104,7 @@
function addHtmlTags( text, tag ) {
tag = tag ? tag : 'p';
- return '<' + tag + '>' + text + '' + tag + '>';
+ return `<${ tag }>${ text }${ tag }>`;
}
function initToggleShortcodes() {
@@ -192,7 +192,7 @@
} else {
fields.classList.add( 'frm_fixed' );
if ( desiredOffset !== 32 ) {
- fields.style.top = desiredOffset + 'px';
+ fields.style.top = `${ desiredOffset }px`;
}
}
}
@@ -279,7 +279,7 @@
link.closest( '.nav-tab-wrapper' ).find( 'a' ).removeClass( 'nav-tab-active' );
link.addClass( 'nav-tab-active' );
jQuery( '.nav-menu-content' ).not( t ).not( c ).hide();
- jQuery( t + ',' + c ).show();
+ jQuery( `${ t },${ c }` ).show();
return false;
}
@@ -320,8 +320,8 @@
function insertWhereOptions() {
/*jshint validthis:true */
- const value = this.value,
- whereKey = jQuery( this ).closest( '.frm_where_row' ).attr( 'id' ).replace( 'frm_where_field_', '' );
+ const { value } = this;
+ const whereKey = jQuery( this ).closest( '.frm_where_row' ).attr( 'id' ).replace( 'frm_where_field_', '' );
jQuery.ajax( {
type: 'POST',
@@ -333,20 +333,20 @@
nonce: frmGlobal.nonce
},
success( html ) {
- jQuery( document.getElementById( 'where_field_options_' + whereKey ) ).html( html );
+ jQuery( document.getElementById( `where_field_options_${ whereKey }` ) ).html( html );
}
} );
}
function hideWhereOptions() {
/*jshint validthis:true */
- const value = this.value,
- whereKey = jQuery( this ).closest( '.frm_where_row' ).attr( 'id' ).replace( 'frm_where_field_', '' );
+ const { value } = this;
+ const whereKey = jQuery( this ).closest( '.frm_where_row' ).attr( 'id' ).replace( 'frm_where_field_', '' );
if ( value === 'group_by' || value === 'group_by_newest' ) {
- document.getElementById( 'where_field_options_' + whereKey ).style.display = 'none';
+ document.getElementById( `where_field_options_${ whereKey }` ).style.display = 'none';
} else {
- document.getElementById( 'where_field_options_' + whereKey ).style.display = 'inline-block';
+ document.getElementById( `where_field_options_${ whereKey }` ).style.display = 'inline-block';
}
}
@@ -358,7 +358,9 @@
}
function toggleAllowedShortcodes( id ) {
- let c, clickedID;
+ let c;
+ let clickedID;
+
if ( id === undefined ) {
id = '';
}
@@ -377,7 +379,7 @@
} else {
id = d.trim();
}
- c = c + ' ' + d;
+ c = `${ c } ${ d }`;
c = c.replace( 'widefat', '' ).replace( 'frm_with_left_label', '' );
}
}
@@ -395,10 +397,10 @@
if ( jQuery.inArray( id, a ) >= 0 ) {
jQuery( '.frm_code_list a' ).removeClass( 'frm_noallow' ).addClass( 'frm_allow' );
- jQuery( '.frm_code_list a.hide_' + id ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
+ jQuery( `.frm_code_list a.hide_${ id }` ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
} else if ( jQuery.inArray( id, b ) >= 0 ) {
- jQuery( '.frm_code_list:not(.frm-dropdown-menu) a:not(.show_' + id + ')' ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
- jQuery( '.frm_code_list a.show_' + id ).removeClass( 'frm_noallow' ).addClass( 'frm_allow' );
+ jQuery( `.frm_code_list:not(.frm-dropdown-menu) a:not(.show_${ id })` ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
+ jQuery( `.frm_code_list a.show_${ id }` ).removeClass( 'frm_noallow' ).addClass( 'frm_allow' );
} else {
jQuery( '.frm_code_list:not(.frm-dropdown-menu) a' ).addClass( 'frm_noallow' ).removeClass( 'frm_allow' );
}
@@ -406,9 +408,9 @@
// Automatically select a tab.
if ( id === 'dyn_default_value' ) {
clickedID = 'frm_dynamic_values';
- document.getElementById( clickedID + '_tab' ).click();
- jQuery( '#' + clickedID.replace( /_/g, '-' ) + ' .frm_show_inactive' ).addClass( 'frm_hidden' );
- jQuery( '#' + clickedID.replace( /_/g, '-' ) + ' .frm_show_active' ).removeClass( 'frm_hidden' );
+ document.getElementById( `${ clickedID }_tab` ).click();
+ jQuery( `#${ clickedID.replace( /_/g, '-' ) } .frm_show_inactive` ).addClass( 'frm_hidden' );
+ jQuery( `#${ clickedID.replace( /_/g, '-' ) } .frm_show_active` ).removeClass( 'frm_hidden' );
}
}
}() );
diff --git a/js/admin/settings.js b/js/admin/settings.js
index 062949fbab..d62f618324 100644
--- a/js/admin/settings.js
+++ b/js/admin/settings.js
@@ -58,7 +58,7 @@
const styleEl = e.target.closest( '.frm-email-style' );
styleEl.classList.add( 'frm-email-style--selected' );
- const styleKey = styleEl.dataset.styleKey;
+ const { styleKey } = styleEl.dataset;
document.getElementById( 'frm-email-style-value' ).value = styleKey;
}
diff --git a/js/admin/style.js b/js/admin/style.js
index 3bfaaadf0e..f8d63e26a5 100644
--- a/js/admin/style.js
+++ b/js/admin/style.js
@@ -256,7 +256,7 @@
* @return {void}
*/
function handleCommonClickEvents( event ) {
- const target = event.target;
+ const { target } = event;
if ( 'frm_toggle_sample_form' === target.id || target.closest( '#frm_toggle_sample_form' ) ) {
toggleSampleForm();
@@ -322,7 +322,7 @@
* @return {void}
*/
function handleClickEventsForListPage( event ) {
- const target = event.target;
+ const { target } = event;
if ( target.classList.contains( 'frm-style-card' ) || target.closest( '.frm-style-card' ) ) {
handleStyleCardClick( event );
@@ -337,7 +337,7 @@
* @return {void}
*/
function handleStyleCardClick( event ) {
- const target = event.target;
+ const { target } = event;
if ( target.closest( '.dropdown' ) ) {
// Ignore the hamburger menu inside of the card.
@@ -562,7 +562,7 @@
}
const anchor = clickTarget.hasAttribute( 'href' ) ? clickTarget : clickTarget.querySelector( 'a[href]' );
- anchor.setAttribute( 'href', anchor.getAttribute( 'href' ) + '&sample=1' );
+ anchor.setAttribute( 'href', `${ anchor.getAttribute( 'href' ) }&sample=1` );
}
/**
@@ -684,7 +684,7 @@
} );
const isRtl = document.body.classList.contains( 'rtl' );
- dropdownMenu.classList.add( 'dropdown-menu-' + ( isRtl ? 'left' : 'right' ) );
+ dropdownMenu.classList.add( `dropdown-menu-${ isRtl ? 'left' : 'right' }` );
dropdownMenu.setAttribute( 'role', 'menu' );
@@ -798,7 +798,7 @@
const form = tag(
'form',
{
- child: labelledTextInput( 'frm_' + context + '_style_name_input', __( 'Style name', 'formidable' ), 'style_name' )
+ child: labelledTextInput( `frm_${ context }_style_name_input`, __( 'Style name', 'formidable' ), 'style_name' )
}
);
form.addEventListener(
@@ -917,7 +917,7 @@
* @return {HTMLElement} The card element.
*/
function getCardByStyleId( styleId ) {
- const defaultCard = document.querySelector( '#frm_default_style_cards_wrapper > div[data-style-id="' + styleId + '"]' );
+ const defaultCard = document.querySelector( `#frm_default_style_cards_wrapper > div[data-style-id="${ styleId }"]` );
if ( defaultCard ) {
return defaultCard;
}
@@ -930,7 +930,7 @@
* @return {void}
*/
function addIconToOption( option, iconId ) {
- const icon = frmDom.svg( { href: '#' + iconId } );
+ const icon = frmDom.svg( { href: `#${ iconId }` } );
option.insertBefore( icon, option.firstChild );
}
@@ -1050,14 +1050,14 @@
}
for ( const key in defaultValues ) {
- let targetInput = document.querySelector( 'input[name$="[' + key + ']"], select[name$="[' + key + ']"]' );
+ let targetInput = document.querySelector( `input[name$="[${ key }]"], select[name$="[${ key }]"]` );
if ( ! targetInput ) {
continue;
}
if ( 'radio' === targetInput.getAttribute( 'type' ) ) {
// Reset the repeater icon dropdown.
- targetInput = document.querySelector( 'input[name$="[' + key + ']"][value="' + defaultValues[ key ] + '"]' );
+ targetInput = document.querySelector( `input[name$="[${ key }]"][value="${ defaultValues[ key ] }"]` );
if ( targetInput ) {
targetInput.checked = true;
jQuery( targetInput ).trigger( 'change' );
@@ -1108,7 +1108,7 @@
const newStyle = document.createElement( 'link' );
newStyle.rel = 'stylesheet';
newStyle.type = 'text/css';
- newStyle.href = style.href + '&key=' + getAutoId(); // Make the URL unique so the old stylesheet doesn't get picked up by cache.
+ newStyle.href = `${ style.href }&key=${ getAutoId() }`; // Make the URL unique so the old stylesheet doesn't get picked up by cache.
// Listen for the new style to load before removing the old style to avoid having no styles while the new style is loading.
newStyle.addEventListener(
@@ -1138,7 +1138,7 @@
*/
function wrapDropdownItem( { anchor, type } ) {
return div( {
- className: 'dropdown-item frm-' + type + '-style',
+ className: `dropdown-item frm-${ type }-style`,
child: anchor
} );
}
@@ -1301,7 +1301,7 @@
select.value = radio.value;
}
- jQuery( btnGrp ).children( 'button' ).html( radio.nextElementSibling.innerHTML + ' ' );
+ jQuery( btnGrp ).children( 'button' ).html( `${ radio.nextElementSibling.innerHTML } ` );
const activeItem = btnGrp.querySelector( '.dropdown-item.active' );
if ( activeItem ) {
@@ -1374,7 +1374,7 @@
*/
function setPosClass() {
/*jshint validthis:true */
- let value = this.value;
+ let { value } = this;
if ( value === 'none' ) {
value = 'top';
} else if ( value === 'no_label' ) {
@@ -1387,7 +1387,7 @@
const currentValue = shouldForceTopStyling ? 'top' : value;
container.classList.remove( 'frm_top_container', 'frm_left_container', 'frm_right_container', 'frm_none_container', 'frm_inside_container' );
- container.classList.add( 'frm_' + currentValue + '_container' );
+ container.classList.add( `frm_${ currentValue }_container` );
if ( 'inside' === currentValue ) {
checkFloatingLabelsForStyles( input, container );
diff --git a/js/formidable.js b/js/formidable.js
index 1f26a41ca7..571a3aad11 100644
--- a/js/formidable.js
+++ b/js/formidable.js
@@ -36,9 +36,10 @@ function frmFrontFormJS() {
* @return {string|number} Field ID.
*/
function getFieldId( field, fullID ) {
- let nameParts, fieldId,
- isRepeating = false,
- fieldName = '';
+ let nameParts;
+ let fieldId;
+ let isRepeating = false;
+ let fieldName = '';
if ( field instanceof jQuery ) {
field = field.get( 0 );
@@ -83,7 +84,7 @@ function frmFrontFormJS() {
}
// Check if 'this' is in a repeating section
- if ( document.querySelector( 'input[name="item_meta[' + fieldId + '][form]"]' ) ) {
+ if ( document.querySelector( `input[name="item_meta[${ fieldId }][form]"]` ) ) {
// this is a repeatable section with name: item_meta[repeating-section-id][row-id][field-id]
fieldId = nameParts[ 2 ].replace( '[', '' );
isRepeating = true;
@@ -103,9 +104,9 @@ function frmFrontFormJS() {
if ( fullID === true ) {
// For use in the container div id
if ( fieldId === nameParts[ 0 ] ) {
- fieldId = fieldId + '-' + nameParts[ 1 ].replace( '[', '' );
+ fieldId = `${ fieldId }-${ nameParts[ 1 ].replace( '[', '' ) }`;
} else {
- fieldId = fieldId + '-' + nameParts[ 0 ] + '-' + nameParts[ 1 ].replace( '[', '' );
+ fieldId = `${ fieldId }-${ nameParts[ 0 ] }-${ nameParts[ 1 ].replace( '[', '' ) }`;
}
}
@@ -297,7 +298,7 @@ function frmFrontFormJS() {
const url = field.value;
const matches = url.match( /^(https?|ftps?|mailto|news|feed|telnet):/ );
if ( field.value !== '' && matches === null ) {
- field.value = 'https://' + url;
+ field.value = `https://${ url }`;
}
}
@@ -309,7 +310,8 @@ function frmFrontFormJS() {
* @return {void}
*/
function validateField( field ) {
- let errors, key;
+ let errors;
+ let key;
errors = [];
const fieldContainer = field.closest( '.frm_form_field' );
@@ -379,17 +381,19 @@ function frmFrontFormJS() {
* @return {Array} Errors
*/
function checkRequiredField( field, errors ) {
- let tempVal, i, placeholder,
- val = '',
- fieldID = '',
- fileID = field.getAttribute( 'data-frmfile' );
+ let tempVal;
+ let i;
+ let placeholder;
+ let val = '';
+ let fieldID = '';
+ let fileID = field.getAttribute( 'data-frmfile' );
if ( field.type === 'hidden' && fileID === null && ! isAppointmentField( field ) && ! isInlineDatepickerField( field ) ) {
return errors;
}
if ( field.type === 'checkbox' || field.type === 'radio' ) {
- document.querySelectorAll( 'input[name="' + field.name + '"]' ).forEach( function( input ) {
+ document.querySelectorAll( `input[name="${ field.name }"]` ).forEach( function( input ) {
const requiredField = input.closest( '.frm_required_field' );
if ( ! requiredField ) {
return;
@@ -452,7 +456,7 @@ function frmFrontFormJS() {
} else if ( isSignatureField( field ) ) {
if ( val === '' ) {
const fieldContainer = field.closest( '.frm_form_field' );
- const outputField = fieldContainer ? fieldContainer.querySelector( '[name="' + field.getAttribute( 'name' ).replace( '[typed]', '[output]' ) + '"]' ) : null;
+ const outputField = fieldContainer ? fieldContainer.querySelector( `[name="${ field.getAttribute( 'name' ).replace( '[typed]', '[output]' ) }"]` ) : null;
val = outputField ? outputField.value : '';
}
fieldID = fieldID.replace( '-typed', '' );
@@ -507,7 +511,7 @@ function frmFrontFormJS() {
*/
function getFileVals( fileID ) {
let val = '';
- const fileFields = document.querySelectorAll( 'input[name="file' + fileID + '"], input[name="file' + fileID + '[]"], input[name^="item_meta[' + fileID + ']"]' );
+ const fileFields = document.querySelectorAll( `input[name="file${ fileID }"], input[name="file${ fileID }[]"], input[name^="item_meta[${ fileID }]"]` );
fileFields.forEach( function( field ) {
if ( val === '' ) {
@@ -523,8 +527,8 @@ function frmFrontFormJS() {
* @return {void}
*/
function checkUrlField( field, errors ) {
- let fieldID,
- url = field.value;
+ let fieldID;
+ const url = field.value;
if ( url !== '' && ! /^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i.test( url ) ) {
fieldID = getFieldId( field, true );
@@ -567,8 +571,8 @@ function frmFrontFormJS() {
* @param {boolean} onSubmit Is `true` if the form is being submitted.
*/
function checkEmailField( field, errors, onSubmit ) {
- const fieldID = getFieldId( field, true ),
- pattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
+ const fieldID = getFieldId( field, true );
+ const pattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
// validate the current field we're editing first
if ( '' !== field.value && pattern.test( field.value ) === false ) {
@@ -601,13 +605,15 @@ function frmFrontFormJS() {
* @return {void}
*/
function confirmField( field, errors ) {
- let value, confirmValue, firstField,
- fieldID = getFieldId( field, true ),
- strippedId = field.id.replace( 'conf_', '' ),
- strippedFieldID = fieldID.replace( 'conf_', '' ),
- confirmField = document.getElementById( strippedId.replace( 'field_', 'field_conf_' ) );
-
- if ( confirmField === null || errors[ 'conf_' + strippedFieldID ] !== undefined ) {
+ let value;
+ let confirmValue;
+ let firstField;
+ const fieldID = getFieldId( field, true );
+ const strippedId = field.id.replace( 'conf_', '' );
+ const strippedFieldID = fieldID.replace( 'conf_', '' );
+ const confirmField = document.getElementById( strippedId.replace( 'field_', 'field_conf_' ) );
+
+ if ( confirmField === null || errors[ `conf_${ strippedFieldID }` ] !== undefined ) {
return;
}
@@ -616,7 +622,7 @@ function frmFrontFormJS() {
value = firstField.value;
confirmValue = confirmField.value;
if ( value !== confirmValue ) {
- errors[ 'conf_' + strippedFieldID ] = getFieldValidationMessage( confirmField, 'data-confmsg' );
+ errors[ `conf_${ strippedFieldID }` ] = getFieldValidationMessage( confirmField, 'data-confmsg' );
}
} else {
validateField( confirmField );
@@ -629,8 +635,8 @@ function frmFrontFormJS() {
* @return {void}
*/
function checkNumberField( field, errors ) {
- let fieldID,
- number = field.value;
+ let fieldID;
+ const number = field.value;
if ( number !== '' && isNaN( number / 1 ) !== false ) {
fieldID = getFieldId( field, true );
@@ -646,9 +652,9 @@ function frmFrontFormJS() {
* @return {void}
*/
function checkPatternField( field, errors ) {
- let fieldID,
- text = field.value,
- format = getFieldValidationMessage( field, 'pattern' );
+ let fieldID;
+ const text = field.value;
+ let format = getFieldValidationMessage( field, 'pattern' );
if ( format !== '' && text !== '' ) {
fieldID = getFieldId( field, true );
@@ -658,7 +664,7 @@ function frmFrontFormJS() {
errors[ fieldID ] = getFieldValidationMessage( field, 'data-invmsg' );
}
} else {
- format = new RegExp( '^' + format + '$', 'i' );
+ format = new RegExp( `^${ format }$`, 'i' );
if ( format.test( text ) === false ) {
errors[ fieldID ] = getFieldValidationMessage( field, 'data-invmsg' );
}
@@ -673,10 +679,10 @@ function frmFrontFormJS() {
* @since 6.5.1
*/
function setSelectPlaceholderColor() {
- let selects = document.querySelectorAll( '.form-field select' ),
- styleElement = document.querySelector( '.with_frm_style' ),
- textColorDisabled = styleElement ? getComputedStyle( styleElement ).getPropertyValue( '--text-color-disabled' ).trim() : '',
- changeSelectColor;
+ const selects = document.querySelectorAll( '.form-field select' );
+ const styleElement = document.querySelector( '.with_frm_style' );
+ const textColorDisabled = styleElement ? getComputedStyle( styleElement ).getPropertyValue( '--text-color-disabled' ).trim() : '';
+ let changeSelectColor;
// Exit if there are no select elements or the textColorDisabled property is missing
if ( ! selects.length || ! textColorDisabled ) {
@@ -845,12 +851,15 @@ function frmFrontFormJS() {
* @return {void}
*/
function getFormErrors( object, action ) {
- let data, success, error, shouldTriggerEvent;
+ let data;
+ let success;
+ let error;
+ let shouldTriggerEvent;
const fieldsets = object.querySelectorAll( '.frm_form_field' );
fieldsets.forEach( field => field.classList.add( 'frm_doing_ajax' ) );
- data = jQuery( object ).serialize() + '&action=frm_entries_' + action + '&nonce=' + frm_js.nonce; // eslint-disable-line no-jquery/no-serialize
+ data = `${ jQuery( object ).serialize() }&action=frm_entries_${ action }&nonce=${ frm_js.nonce }`; // eslint-disable-line no-jquery/no-serialize
shouldTriggerEvent = object.classList.contains( 'frm_trigger_event_on_submit' );
const doRedirect = response => {
@@ -865,13 +874,22 @@ function frmFrontFormJS() {
// We don't return here because we're opening in a new tab, the old tab will still update.
const newTab = window.open( response.redirect, '_blank' );
if ( ! newTab && response.fallbackMsg && response.content ) {
- response.content = response.content.trim().replace( /(<\/div><\/div>)$/, ' ' + response.fallbackMsg + '' );
+ response.content = response.content.trim().replace( /(<\/div><\/div>)$/, ` ${ response.fallbackMsg }` );
}
};
success = function( response ) {
- let defaultResponse, formID, replaceContent, pageOrder, formReturned, contSubmit, delay,
- $fieldCont, key, inCollapsedSection, frmTrigger;
+ let defaultResponse;
+ let formID;
+ let replaceContent;
+ let pageOrder;
+ let formReturned;
+ let contSubmit;
+ let delay;
+ let $fieldCont;
+ let key;
+ let inCollapsedSection;
+ let frmTrigger;
defaultResponse = {
content: '',
@@ -935,7 +953,7 @@ function frmFrontFormJS() {
addUrlParam( response );
if ( typeof frmThemeOverride_frmAfterSubmit === 'function' ) { // eslint-disable-line camelcase
- const pageOrderInput = document.querySelector( 'input[name="frm_page_order_' + formID + '"]' );
+ const pageOrderInput = document.querySelector( `input[name="frm_page_order_${ formID }"]` );
pageOrder = pageOrderInput ? pageOrderInput.value : '';
const tempDiv = document.createElement( 'div' );
tempDiv.innerHTML = response.content;
@@ -959,7 +977,7 @@ function frmFrontFormJS() {
$fieldCont = null;
for ( key in response.errors ) {
- const fieldContEl = object.querySelector( '#frm_field_' + key + '_container' );
+ const fieldContEl = object.querySelector( `#frm_field_${ key }_container` );
$fieldCont = fieldContEl ? jQuery( fieldContEl ) : jQuery();
if ( $fieldCont.length ) {
@@ -1035,7 +1053,9 @@ function frmFrontFormJS() {
}
function postToAjaxUrl( form, data, success, error ) {
- let ajaxUrl, action, ajaxParams;
+ let ajaxUrl;
+ let action;
+ let ajaxParams;
ajaxUrl = frm_js.ajax_url;
action = form.getAttribute( 'action' );
@@ -1088,16 +1108,16 @@ function frmFrontFormJS() {
}
function removeAddedScripts( formContainer, formID ) {
- const endReplace = document.querySelectorAll( '.frm_end_ajax_' + formID );
+ const endReplace = document.querySelectorAll( `.frm_end_ajax_${ formID }` );
if ( endReplace.length ) {
- formContainer.nextUntil( '.frm_end_ajax_' + formID ).remove();
+ formContainer.nextUntil( `.frm_end_ajax_${ formID }` ).remove();
endReplace.forEach( el => el.remove() );
}
}
function maybeSlideOut( oldContent, newContent ) {
- let c,
- newClass = 'frm_slideout';
+ let c;
+ let newClass = 'frm_slideout';
if ( newContent.includes( ' frm_slide' ) ) {
c = oldContent.children();
if ( newContent.includes( ' frm_going_back' ) ) {
@@ -1114,12 +1134,14 @@ function frmFrontFormJS() {
let url;
if ( history.pushState && response.page !== undefined ) {
url = addQueryVar( 'frm_page', response.page );
- window.history.pushState( { html: response.html }, '', '?' + url );
+ window.history.pushState( { html: response.html }, '', `?${ url }` );
}
}
function addQueryVar( key, value ) {
- let kvp, i, x;
+ let kvp;
+ let i;
+ let x;
key = encodeURI( key );
value = encodeURI( value );
@@ -1145,8 +1167,11 @@ function frmFrontFormJS() {
}
function addFieldError( $fieldCont, key, jsErrors ) {
- let id, describedBy, roleString;
+ let id;
+ let describedBy;
+ let roleString;
const container = $fieldCont instanceof jQuery ? $fieldCont.get( 0 ) : $fieldCont;
+
if ( ! container || container.offsetParent === null ) {
return;
}
@@ -1165,7 +1190,7 @@ function frmFrontFormJS() {
errorHtml = jsErrors[ key ];
} else {
roleString = frm_js.include_alert_role ? 'role="alert"' : '';
- errorHtml = '
' );
+ jQuery( '#frm_create_entry p' ).replaceWith( `
` );
jQuery.ajax( {
type: 'POST',
url: ajaxurl,
@@ -126,24 +129,27 @@ function frmAdminPopupJS() {
jQuery( '.frm_switch_sc' ).removeClass( 'active' );
jQuery( this ).addClass( 'active' );
toggleMenu();
- jQuery( '#frm_popup_content .media-frame-title h1' ).html( jQuery( this ).children( '.howto' ).text() + ' ' );
+ jQuery( '#frm_popup_content .media-frame-title h1' ).html( `${ jQuery( this ).children( '.howto' ).text() } ` );
val = this.id.replace( 'sc-link-', '' );
populateOpts( val );
return false;
}
function populateOpts( val ) {
- let $settings, $scOpts, $spinner,
- sc = document.getElementById( 'frm_complete_shortcode' );
+ let $settings;
+ let $scOpts;
+ let $spinner;
+ const sc = document.getElementById( 'frm_complete_shortcode' );
+
if ( sc !== null ) {
- sc.value = '[' + val + ']';
+ sc.value = `[${ val }]`;
}
jQuery( '.frm_shortcode_option' ).hide();
- $settings = document.getElementById( 'sc-opts-' + val );
+ $settings = document.getElementById( `sc-opts-${ val }` );
if ( $settings !== null ) {
$settings.style.display = '';
- jQuery( document.getElementById( 'sc-' + val ) ).trigger( 'click' );
+ jQuery( document.getElementById( `sc-${ val }` ) ).trigger( 'click' );
} else {
$scOpts = jQuery( document.getElementById( 'frm_shortcode_options' ) );
$spinner = jQuery( '.media-frame-title .spinner' );
@@ -159,7 +165,7 @@ function frmAdminPopupJS() {
success( html ) {
$spinner.hide();
$scOpts.append( html );
- jQuery( document.getElementById( 'sc-' + val ) ).trigger( 'click' );
+ jQuery( document.getElementById( `sc-${ val }` ) ).trigger( 'click' );
}
} );
}
@@ -167,18 +173,21 @@ function frmAdminPopupJS() {
function addToShortcode() {
const sc = jQuery( 'input[name=frmsc]:checked' ).val();
- const inputs = jQuery( document.getElementById( 'sc-opts-' + sc ) ).find( 'input, select' );
- let output = '[' + sc;
+ const inputs = jQuery( document.getElementById( `sc-opts-${ sc }` ) ).find( 'input, select' );
+ let output = `[${ sc }`;
+
inputs.each( function() {
- let attrName, attrVal,
- $thisInput = jQuery( this ),
- attrId = this.id;
+ let attrName;
+ let attrVal;
+ const $thisInput = jQuery( this );
+ const attrId = this.id;
+
if ( attrId.indexOf( 'frmsc_' ) === 0 ) {
- attrName = attrId.replace( 'frmsc_' + sc + '_', '' );
+ attrName = attrId.replace( `frmsc_${ sc }_`, '' );
attrVal = $thisInput.val();
if ( ( $thisInput.attr( 'type' ) !== 'checkbox' || this.checked ) && ( ( $thisInput.attr( 'type' ) !== 'text' && ! $thisInput.is( 'select' ) ) || attrVal !== '' ) ) {
- output += ' ' + attrName + '="' + attrVal + '"';
+ output += ` ${ attrName }="${ attrVal }"`;
}
}
} );
@@ -192,8 +201,8 @@ function frmAdminPopupJS() {
}
function getFieldSelection() {
- let thisId,
- formId = this.value;
+ let thisId;
+ const formId = this.value;
if ( formId ) {
thisId = this.id;
jQuery.ajax( {
@@ -207,8 +216,8 @@ function frmAdminPopupJS() {
},
success( msg ) {
const baseId = thisId.replace( '_form', '' );
- msg = msg.replace( 'name="field_options[form_select_0]"', 'id="frmsc_' + baseId + '_fields"' );
- jQuery( document.getElementById( baseId + '_fields_container' ) ).html( msg );
+ msg = msg.replace( 'name="field_options[form_select_0]"', `id="frmsc_${ baseId }_fields"` );
+ jQuery( document.getElementById( `${ baseId }_fields_container` ) ).html( msg );
}
} );
}
@@ -251,8 +260,8 @@ function frmWidgetsJS() {
}
function getFields() {
- let widget,
- displayId = this.value;
+ let widget;
+ const displayId = this.value;
if ( displayId !== '' ) {
widget = jQuery( this ).closest( '.widget-content' );
@@ -266,8 +275,8 @@ function frmWidgetsJS() {
nonce: frmGlobal.nonce
},
success( opts ) {
- let titleField,
- catField = widget.find( '.frm_list_items_cat_id' );
+ let titleField;
+ const catField = widget.find( '.frm_list_items_cat_id' );
catField.find( 'option' ).remove().end();
catField.append( jQuery( '' ) );
jQuery.each( opts.catValues, function( key, value ) {
diff --git a/js/packages/floating-links/s11-floating-links.js b/js/packages/floating-links/s11-floating-links.js
index d5a0d5a4f1..cb08a29ebc 100644
--- a/js/packages/floating-links/s11-floating-links.js
+++ b/js/packages/floating-links/s11-floating-links.js
@@ -119,7 +119,7 @@ class S11FloatingLinks {
slideIn.append( frmDom.span( { child: dismissIcon } ) );
slideIn.querySelector( 'a[href].frm-button-primary' )?.setAttribute(
'aria-description',
- ( frmGlobal.inboxSlideIn.subject + ' ' + frmGlobal.inboxSlideIn.slidein ).replace( '&', '&' )
+ ( `${ frmGlobal.inboxSlideIn.subject } ${ frmGlobal.inboxSlideIn.slidein }` ).replace( '&', '&' )
);
this.slideIn = slideIn;
return slideIn;
diff --git a/js/plugin-search.js b/js/plugin-search.js
index fe5cc3378a..b91b22d3f9 100644
--- a/js/plugin-search.js
+++ b/js/plugin-search.js
@@ -27,11 +27,11 @@ function frmPS() {
const hint = FormidablePSH.getCard();
if ( 'object' === typeof hint && null !== hint ) {
hint.querySelector( '.plugin-card-bottom' ).outerHTML =
- '
Imported '+r.data.name+"
",e.find(".status").prepend(n),e.find(".status").show(),C.importQueue=jQuery.grep(C.importQueue,function(e){return e!=t}),C.imported++,0===C.importQueue.length?(e.find(".process-count").hide(),e.find(".forms-completed").text(C.imported),e.find(".process-completed").show()):(e.find(".form-current").text(C.imported+1),Zi(e)))})}function eo(e){e.preventDefault();var t=!1,r=jQuery('input[name="frm_export_forms[]"]');jQuery('input[name="frm_export_forms[]"]:checked').val()||(r.closest(".frm-table-box").addClass("frm_blank_field"),t="stop");var n=jQuery('input[name="type[]"]');if(jQuery('input[name="type[]"]:checked').val()||"checkbox"!==n.attr("type")||(n.closest("p").addClass("frm_blank_field"),t="stop"),"stop"===t)return!1;e.stopPropagation(),this.submit()}function to(){var e=jQuery(this).closest(".frm_blank_field");if(void 0!==e){var t=this.name;("type[]"===t&&jQuery('input[name="type[]"]:checked').val()||"frm_export_forms[]"===t&&jQuery(this).val())&&e.removeClass("frm_blank_field")}}function ro(){null!==jQuery(this).val().match(/\.csv$/i)?jQuery(".show_csv").fadeIn():jQuery(".show_csv").fadeOut()}function no(){var e=document.querySelector('select[name="format"]');return e?e.value:""}function io(e){var t,r,n=e.target.value;ao(n),oo.call(e.target),t=n,r=document.getElementById("frm-export-select-all"),"csv"===t?(r.checked=!1,r.disabled=!0):r.disabled=!1}function oo(){var e=jQuery(this),t=e.find(":selected"),r=t.data("support"),n=r.indexOf("|");jQuery('input[name="type[]"]').each(function(){this.checked=!1,r.includes(this.value)?(this.disabled=!1,-1===n&&(this.checked=!0)):this.disabled=!0}),"csv"===e.val()?(jQuery(".csv_opts").show(),jQuery(".xml_opts").hide()):(jQuery(".csv_opts").hide(),jQuery(".xml_opts").show());var i=t.data("count"),o=jQuery('input[name="frm_export_forms[]"]');"single"===i?(o.prop("multiple",!1),o.prop("checked",!1)):(o.prop("multiple",!0),o.prop("disabled",!1)),e.trigger("change")}function ao(e){if(""!==e){var t=document.querySelectorAll(".frm-is-repeater");t.length&&("csv"===e?t.forEach(function(e){e.classList.remove("frm_hidden")}):t.forEach(function(e){e.classList.add("frm_hidden")}),Qo.call(document.querySelector(".frm-auto-search")))}}function lo(){var e=jQuery("select[name=format]").find(":selected").data("count"),t=jQuery('input[name="frm_export_forms[]"]');"single"===e&&this.checked?(t.prop("disabled",!0),this.removeAttribute("disabled")):t.prop("disabled",!1)}function so(){jQuery(".frm_multiselect").hide().each(frmDom.bootstrap.multiselect.init)}function co(e){e.preventDefault(),mo(this,"frm_multiple_addons")}function uo(e){e.preventDefault(),mo(this,"frm_activate_addon")}function fo(e){e.preventDefault(),mo(this,"frm_install_addon")}function mo(e,t){r(1105).toggleAddonState(e,t)}function _o(){go()}function po(e){!function(e,t,r){var n=jQuery("#frm_leave_email_error");n.removeClass("frm_hidden").attr("frm-error",r),jQuery("#frm_leave_email").one("keyup",function(){n.addClass("frm_hidden")})}(0,0,e)}function go(){var e=document.getElementById("frmapi-email-form");jQuery.ajax({dataType:"json",url:e.getAttribute("data-url"),success:function(t){var r=t.renderedHtml;r=r.replace(/]*(formidableforms.css|action=frmpro_css)[^>]*>/gi,""),e.innerHTML=r}})}function yo(e){frmDom.autocomplete.initSelectionAutocomplete(e)}function ho(e){var t=this.parentNode.parentNode,r=t.elements.type.value;e.preventDefault(),this.classList.add("frm_loading_button"),bo(t,r,this)}function vo(e){var t=this.elements.type.value,r=this.querySelector("button");e.preventDefault(),r.classList.add("frm_loading_button"),bo(this,t,r)}function bo(e,t,r){var n=function(e){var t,r,n={},i=e.elements;for(r=0;r'.concat(e.message,"
Imported ').concat(n.data.name,"
"),e.find(".status").prepend(r),e.find(".status").show(),C.importQueue=jQuery.grep(C.importQueue,function(e){return e!=t}),C.imported++,0===C.importQueue.length?(e.find(".process-count").hide(),e.find(".forms-completed").text(C.imported),e.find(".process-completed").show()):(e.find(".form-current").text(C.imported+1),ei(e)))})}function ti(e){e.preventDefault();var t=!1,n=jQuery('input[name="frm_export_forms[]"]');jQuery('input[name="frm_export_forms[]"]:checked').val()||(n.closest(".frm-table-box").addClass("frm_blank_field"),t="stop");var r=jQuery('input[name="type[]"]');if(jQuery('input[name="type[]"]:checked').val()||"checkbox"!==r.attr("type")||(r.closest("p").addClass("frm_blank_field"),t="stop"),"stop"===t)return!1;e.stopPropagation(),this.submit()}function ni(){var e=jQuery(this).closest(".frm_blank_field");if(void 0!==e){var t=this.name;("type[]"===t&&jQuery('input[name="type[]"]:checked').val()||"frm_export_forms[]"===t&&jQuery(this).val())&&e.removeClass("frm_blank_field")}}function ri(){null!==jQuery(this).val().match(/\.csv$/i)?jQuery(".show_csv").fadeIn():jQuery(".show_csv").fadeOut()}function oi(){var e=document.querySelector('select[name="format"]');return e?e.value:""}function ii(e){var t,n,r=e.target.value;li(r),ai.call(e.target),t=r,n=document.getElementById("frm-export-select-all"),"csv"===t?(n.checked=!1,n.disabled=!0):n.disabled=!1}function ai(){var e=jQuery(this),t=e.find(":selected"),n=t.data("support"),r=n.indexOf("|");jQuery('input[name="type[]"]').each(function(){this.checked=!1,n.includes(this.value)?(this.disabled=!1,-1===r&&(this.checked=!0)):this.disabled=!0}),"csv"===e.val()?(jQuery(".csv_opts").show(),jQuery(".xml_opts").hide()):(jQuery(".csv_opts").hide(),jQuery(".xml_opts").show());var o=t.data("count"),i=jQuery('input[name="frm_export_forms[]"]');"single"===o?(i.prop("multiple",!1),i.prop("checked",!1)):(i.prop("multiple",!0),i.prop("disabled",!1)),e.trigger("change")}function li(e){if(""!==e){var t=document.querySelectorAll(".frm-is-repeater");t.length&&("csv"===e?t.forEach(function(e){e.classList.remove("frm_hidden")}):t.forEach(function(e){e.classList.add("frm_hidden")}),Qi.call(document.querySelector(".frm-auto-search")))}}function si(){var e=jQuery("select[name=format]").find(":selected").data("count"),t=jQuery('input[name="frm_export_forms[]"]');"single"===e&&this.checked?(t.prop("disabled",!0),this.removeAttribute("disabled")):t.prop("disabled",!1)}function ci(){jQuery(".frm_multiselect").hide().each(frmDom.bootstrap.multiselect.init)}function di(e){e.preventDefault(),mi(this,"frm_multiple_addons")}function ui(e){e.preventDefault(),mi(this,"frm_activate_addon")}function fi(e){e.preventDefault(),mi(this,"frm_install_addon")}function mi(e,t){n(1105).toggleAddonState(e,t)}function _i(){gi()}function pi(e){!function(e,t,n){var r=jQuery("#frm_leave_email_error");r.removeClass("frm_hidden").attr("frm-error",n),jQuery("#frm_leave_email").one("keyup",function(){r.addClass("frm_hidden")})}(0,0,e)}function gi(){var e=document.getElementById("frmapi-email-form");jQuery.ajax({dataType:"json",url:e.getAttribute("data-url"),success:function(t){var n=t.renderedHtml;n=n.replace(/]*(formidableforms.css|action=frmpro_css)[^>]*>/gi,""),e.innerHTML=n}})}function yi(e){frmDom.autocomplete.initSelectionAutocomplete(e)}function vi(e){var t=this.parentNode.parentNode,n=t.elements.type.value;e.preventDefault(),this.classList.add("frm_loading_button"),bi(t,n,this)}function hi(e){var t=this.elements.type.value,n=this.querySelector("button");e.preventDefault(),n.classList.add("frm_loading_button"),bi(this,t,n)}function bi(e,t,n){var r=function(e){var t,n,r={},o=e.elements;for(n=0;n'+e.message+"
'.concat(e.message,"
'.concat(e.message,"
Imported ').concat(n.data.name,"
"),e.find(".status").prepend(r),e.find(".status").show(),C.importQueue=jQuery.grep(C.importQueue,function(e){return e!=t}),C.imported++,0===C.importQueue.length?(e.find(".process-count").hide(),e.find(".forms-completed").text(C.imported),e.find(".process-completed").show()):(e.find(".form-current").text(C.imported+1),ei(e)))})}function ti(e){e.preventDefault();var t=!1,n=jQuery('input[name="frm_export_forms[]"]');jQuery('input[name="frm_export_forms[]"]:checked').val()||(n.closest(".frm-table-box").addClass("frm_blank_field"),t="stop");var r=jQuery('input[name="type[]"]');if(jQuery('input[name="type[]"]:checked').val()||"checkbox"!==r.attr("type")||(r.closest("p").addClass("frm_blank_field"),t="stop"),"stop"===t)return!1;e.stopPropagation(),this.submit()}function ni(){var e=jQuery(this).closest(".frm_blank_field");if(void 0!==e){var t=this.name;("type[]"===t&&jQuery('input[name="type[]"]:checked').val()||"frm_export_forms[]"===t&&jQuery(this).val())&&e.removeClass("frm_blank_field")}}function ri(){null!==jQuery(this).val().match(/\.csv$/i)?jQuery(".show_csv").fadeIn():jQuery(".show_csv").fadeOut()}function oi(){var e=document.querySelector('select[name="format"]');return e?e.value:""}function ii(e){var t,n,r=e.target.value;li(r),ai.call(e.target),t=r,n=document.getElementById("frm-export-select-all"),"csv"===t?(n.checked=!1,n.disabled=!0):n.disabled=!1}function ai(){var e=jQuery(this),t=e.find(":selected"),n=t.data("support"),r=n.indexOf("|");jQuery('input[name="type[]"]').each(function(){this.checked=!1,n.includes(this.value)?(this.disabled=!1,-1===r&&(this.checked=!0)):this.disabled=!0}),"csv"===e.val()?(jQuery(".csv_opts").show(),jQuery(".xml_opts").hide()):(jQuery(".csv_opts").hide(),jQuery(".xml_opts").show());var o=t.data("count"),i=jQuery('input[name="frm_export_forms[]"]');"single"===o?(i.prop("multiple",!1),i.prop("checked",!1)):(i.prop("multiple",!0),i.prop("disabled",!1)),e.trigger("change")}function li(e){if(""!==e){var t=document.querySelectorAll(".frm-is-repeater");t.length&&("csv"===e?t.forEach(function(e){e.classList.remove("frm_hidden")}):t.forEach(function(e){e.classList.add("frm_hidden")}),Qi.call(document.querySelector(".frm-auto-search")))}}function si(){var e=jQuery("select[name=format]").find(":selected").data("count"),t=jQuery('input[name="frm_export_forms[]"]');"single"===e&&this.checked?(t.prop("disabled",!0),this.removeAttribute("disabled")):t.prop("disabled",!1)}function ci(){jQuery(".frm_multiselect").hide().each(frmDom.bootstrap.multiselect.init)}function di(e){e.preventDefault(),mi(this,"frm_multiple_addons")}function ui(e){e.preventDefault(),mi(this,"frm_activate_addon")}function fi(e){e.preventDefault(),mi(this,"frm_install_addon")}function mi(e,t){n(1105).toggleAddonState(e,t)}function _i(){gi()}function pi(e){!function(e,t,n){var r=jQuery("#frm_leave_email_error");r.removeClass("frm_hidden").attr("frm-error",n),jQuery("#frm_leave_email").one("keyup",function(){r.addClass("frm_hidden")})}(0,0,e)}function gi(){var e=document.getElementById("frmapi-email-form");jQuery.ajax({dataType:"json",url:e.getAttribute("data-url"),success:function(t){var n=t.renderedHtml;n=n.replace(/]*(formidableforms.css|action=frmpro_css)[^>]*>/gi,""),e.innerHTML=n}})}function yi(e){frmDom.autocomplete.initSelectionAutocomplete(e)}function vi(e){var t=this.parentNode.parentNode,n=t.elements.type.value;e.preventDefault(),this.classList.add("frm_loading_button"),bi(t,n,this)}function hi(e){var t=this.elements.type.value,n=this.querySelector("button");e.preventDefault(),n.classList.add("frm_loading_button"),bi(this,t,n)}function bi(e,t,n){var r=function(e){var t,n,r={},o=e.elements;for(n=0;n'.concat(e.message,"
Imported ').concat(n.data.name,"
"),e.find(".status").prepend(r),e.find(".status").show(),C.importQueue=jQuery.grep(C.importQueue,function(e){return e!=t}),C.imported++,0===C.importQueue.length?(e.find(".process-count").hide(),e.find(".forms-completed").text(C.imported),e.find(".process-completed").show()):(e.find(".form-current").text(C.imported+1),ei(e)))})}function ti(e){e.preventDefault();var t=!1,n=jQuery('input[name="frm_export_forms[]"]');jQuery('input[name="frm_export_forms[]"]:checked').val()||(n.closest(".frm-table-box").addClass("frm_blank_field"),t="stop");var r=jQuery('input[name="type[]"]');if(jQuery('input[name="type[]"]:checked').val()||"checkbox"!==r.attr("type")||(r.closest("p").addClass("frm_blank_field"),t="stop"),"stop"===t)return!1;e.stopPropagation(),this.submit()}function ni(){var e=jQuery(this).closest(".frm_blank_field");if(void 0!==e){var t=this.name;("type[]"===t&&jQuery('input[name="type[]"]:checked').val()||"frm_export_forms[]"===t&&jQuery(this).val())&&e.removeClass("frm_blank_field")}}function ri(){null!==jQuery(this).val().match(/\.csv$/i)?jQuery(".show_csv").fadeIn():jQuery(".show_csv").fadeOut()}function oi(){var e=document.querySelector('select[name="format"]');return e?e.value:""}function ii(e){var t,n,r=e.target.value;li(r),ai.call(e.target),t=r,n=document.getElementById("frm-export-select-all"),"csv"===t?(n.checked=!1,n.disabled=!0):n.disabled=!1}function ai(){var e=jQuery(this),t=e.find(":selected"),n=t.data("support"),r=n.indexOf("|");jQuery('input[name="type[]"]').each(function(){this.checked=!1,n.includes(this.value)?(this.disabled=!1,-1===r&&(this.checked=!0)):this.disabled=!0}),"csv"===e.val()?(jQuery(".csv_opts").show(),jQuery(".xml_opts").hide()):(jQuery(".csv_opts").hide(),jQuery(".xml_opts").show());var o=t.data("count"),i=jQuery('input[name="frm_export_forms[]"]');"single"===o?(i.prop("multiple",!1),i.prop("checked",!1)):(i.prop("multiple",!0),i.prop("disabled",!1)),e.trigger("change")}function li(e){if(""!==e){var t=document.querySelectorAll(".frm-is-repeater");t.length&&("csv"===e?t.forEach(function(e){e.classList.remove("frm_hidden")}):t.forEach(function(e){e.classList.add("frm_hidden")}),Qi.call(document.querySelector(".frm-auto-search")))}}function si(){var e=jQuery("select[name=format]").find(":selected").data("count"),t=jQuery('input[name="frm_export_forms[]"]');"single"===e&&this.checked?(t.prop("disabled",!0),this.removeAttribute("disabled")):t.prop("disabled",!1)}function ci(){jQuery(".frm_multiselect").hide().each(frmDom.bootstrap.multiselect.init)}function di(e){e.preventDefault(),mi(this,"frm_multiple_addons")}function ui(e){e.preventDefault(),mi(this,"frm_activate_addon")}function fi(e){e.preventDefault(),mi(this,"frm_install_addon")}function mi(e,t){n(1105).toggleAddonState(e,t)}function _i(){gi()}function pi(e){!function(e,t,n){var r=jQuery("#frm_leave_email_error");r.removeClass("frm_hidden").attr("frm-error",n),jQuery("#frm_leave_email").one("keyup",function(){r.addClass("frm_hidden")})}(0,0,e)}function gi(){var e=document.getElementById("frmapi-email-form");jQuery.ajax({dataType:"json",url:e.getAttribute("data-url"),success:function(t){var n=t.renderedHtml;n=n.replace(/]*(formidableforms.css|action=frmpro_css)[^>]*>/gi,""),e.innerHTML=n}})}function yi(e){frmDom.autocomplete.initSelectionAutocomplete(e)}function vi(e){var t=this.parentNode.parentNode,n=t.elements.type.value;e.preventDefault(),this.classList.add("frm_loading_button"),bi(t,n,this)}function hi(e){var t=this.elements.type.value,n=this.querySelector("button");e.preventDefault(),n.classList.add("frm_loading_button"),bi(this,t,n)}function bi(e,t,n){var r=function(e){var t,n,r={},o=e.elements;for(n=0;n