diff --git a/.deepsource.toml b/.deepsource.toml
index 36c7f81786..95db5ce2c8 100644
--- a/.deepsource.toml
+++ b/.deepsource.toml
@@ -1,24 +1,39 @@
version = 1
# 1. Global Exclude Patterns
-# Tell DeepSource which files to completely ignore (e.g., external libraries).
exclude_patterns = [
"**/node_modules/**",
"**/vendor/**",
"**/venv/**",
"**/dist/**",
- "**/build/**"
+ "**/build/**",
+ "**/coverage/**",
+ "**/*.min.js",
+ "**/*.js.map",
+ "js/formidable_blocks.js",
+ "js/formidable_overlay.js",
+ "js/form-templates.js",
+ "js/formidable_dashboard.js",
+ "js/onboarding-wizard.js",
+ "js/addons-page.js",
+ "js/formidable_styles.js",
+ "js/formidable_admin.js",
+ "js/bootstrap-multiselect.js",
+ "js/formidable-settings-components.js",
+ "js/formidable-web-components.js",
+ "js/frm_testing_mode.js",
+ "js/welcome-tour.js",
+ "eslint-rules/**"
]
# 2. Test Patterns
-# Tell DeepSource which files are tests. This prevents false positives
-# (e.g., allowing "assert" statements in test files).
test_patterns = [
- "**/tests/**"
+ "**/tests/**",
+ "**/phpunit/**",
+ "**/cypress/**"
]
# 3. Analyzers
-# Add a block like this for every language you use.
[[analyzers]]
name = "php"
enabled = true
@@ -26,3 +41,73 @@ enabled = true
[[analyzers]]
name = "javascript"
enabled = true
+
+ [analyzers.meta]
+ plugins = ["react"]
+ dependency_file_paths = ["package.json"]
+ environment = [
+ "browser",
+ "jquery",
+ "cypress",
+ "mocha"
+ ]
+ module_system = "es-modules"
+ globals = [
+ # WordPress core globals
+ "ajaxurl",
+ "wp",
+ "wpApiSettings",
+ "tinyMCE",
+ "tb_remove",
+ "adminpage",
+ "pagenow",
+ # Google reCAPTCHA / hCaptcha / Turnstile
+ "grecaptcha",
+ "hcaptcha",
+ "turnstile",
+ # Formidable globals (via wp_localize_script)
+ "frmGlobal",
+ "frm_js",
+ "frm_admin_js",
+ "frmDom",
+ "frmFormTemplatesVars",
+ "FrmDeactivationFeedbackI18n",
+ "formidable_form_selector",
+ "frmSettings",
+ "s11FloatingLinksData",
+ "frmPlugSearch",
+ "frmAddonsVars",
+ "frmOnboardingWizardVars",
+ "frmApplicationsVars",
+ "frmWelcomeTourVars",
+ "frm_stripe_vars",
+ "frm_trans_vars",
+ "frmSquareVars",
+ # Formidable window globals
+ "frmFrontForm",
+ "frmAdminBuild",
+ "frmAdminBuildJS",
+ "FrmFormsConnect",
+ "frmAdminPopup",
+ "frmOverlay",
+ "frmDropdownComponent",
+ "frmStylerFunctions",
+ "frmProForm",
+ "frmThemeOverride_jsErrors",
+ "frmThemeOverride_frmPlaceError",
+ "frmThemeOverride_frmAfterSubmit",
+ "frm_add_logic_row",
+ "frm_remove_tag",
+ "frm_show_div",
+ "frmCheckAll",
+ "frmCheckAllLevel",
+ "frmGetFieldValues",
+ "frmImportCsv",
+ "FormidablePSH",
+ "__FRMURLVARS",
+ "frm_password_checks",
+ "formidable_block_calculator",
+ "formidable_view_selector",
+ "frmdates_admin_js",
+ "frm_abdn"
+ ]
diff --git a/.oxlintrc.json b/.oxlintrc.json
index 0b0f15c3cc..07be9139c9 100644
--- a/.oxlintrc.json
+++ b/.oxlintrc.json
@@ -45,7 +45,6 @@
"eslint/sort-keys": "off",
"eslint/no-magic-numbers": "off",
"eslint/radix": "off",
- "eslint/prefer-template": "off",
"eslint/prefer-const": "off",
"eslint/prefer-object-spread": "off",
"eslint/prefer-destructuring": "off",
diff --git a/.windsurf/rules/enterprise/code-change-principles.md b/.windsurf/rules/enterprise/code-change-principles.md
index 1725730fe6..a7929a2dcb 100644
--- a/.windsurf/rules/enterprise/code-change-principles.md
+++ b/.windsurf/rules/enterprise/code-change-principles.md
@@ -17,6 +17,7 @@ Critical principles for enterprise-level plugin development.
4. **No custom solutions**: Never invent new patterns. Use existing ones or search the web to review best practices, then follow the official WordPress standards or VIP guidelines.
5. **User changes are final**: If user makes manual changes, treat as authoritative
6. **Multi-issue fixes**: When fixing multiple issues in one request, run all 6 phases independently for each issue. Findings from one issue's phases may inform the next, but every phase is mandatory for every issue, even when issues share a root cause.
+7. **Don't commit changes**: Never commit changes locally or remotely. I’ll handle that manually.
---
diff --git a/.windsurf/skills/eslint-rules/SKILL.md b/.windsurf/skills/eslint-rules/SKILL.md
index 8b6f3c00d2..d3630086f5 100644
--- a/.windsurf/skills/eslint-rules/SKILL.md
+++ b/.windsurf/skills/eslint-rules/SKILL.md
@@ -20,14 +20,17 @@ Workflow for creating and maintaining custom ESLint rules in the Formidable Form
Custom ESLint rules live in `/eslint-rules/` at the project root.
-```
+```text
eslint-rules/
├── index.js # Plugin entry point, exports all rules
└── rules/ # Individual rule files
├── prefer-strict-comparison.js
├── no-redundant-undefined-check.js
├── prefer-includes.js
- └── no-typeof-undefined.js
+ ├── no-typeof-undefined.js
+ ├── no-optional-chaining-queryselectorall.js
+ ├── no-repeated-selector.js
+ └── prefer-document-fragment.js
```
The plugin is imported in `eslint.config.mjs` as `formidable` and rules are referenced as `formidable/ '+e.message+"
';
- 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..e2568b2bf5 100644
--- a/js/admin/style.js
+++ b/js/admin/style.js
@@ -3,7 +3,6 @@
* Pro-specific features are in the style-settings.js file in Pro.
*/
( function() {
- /* globals frmDom, frmAdminBuild */
'use strict';
if ( ! document.getElementById( 'frm_active_style_form' ) ) {
@@ -256,7 +255,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 +321,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 +336,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 +561,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 +683,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 +797,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 +916,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 +929,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 +1049,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 +1107,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 +1137,7 @@
*/
function wrapDropdownItem( { anchor, type } ) {
return div( {
- className: 'dropdown-item frm-' + type + '-style',
+ className: `dropdown-item frm-${ type }-style`,
child: anchor
} );
}
@@ -1301,7 +1300,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 +1373,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 +1386,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/form-templates.js b/js/form-templates.js
index e59dfd294f..d97f74de3e 100644
--- a/js/form-templates.js
+++ b/js/form-templates.js
@@ -1,2 +1,2 @@
/*! For license information please see form-templates.js.LICENSE.txt */
-(()=>{var t={8616:t=>{t.exports=function(t,e){var n,r,o=0;function a(){var a,i,c=n,l=arguments.length;t:for(;c;){if(c.args.length===arguments.length){for(i=0;i3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(G(n)&&N(r))if("function"==typeof o)if("number"==typeof a){var c={callback:o,priority:a,namespace:r};if(i[n]){var l,u=i[n].handlers;for(l=u.length;l>0&&!(a>=u[l-1].priority);l--);l===u.length?u[l]=c:u.splice(l,0,c),i.__current.forEach(function(t){t.name===n&&t.currentIndex>=l&&t.currentIndex++})}else i[n]={handlers:[c],runs:0};"hookAdded"!==n&&t.doAction("hookAdded",n,r,o,a)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},z=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,o){var a=t[e];if(G(r)&&(n||N(o))){if(!a[r])return 0;var i=0;if(n)i=a[r].handlers.length,a[r]={runs:a[r].runs,handlers:[]};else for(var c=a[r].handlers,l=function(t){c[t].namespace===o&&(c.splice(t,1),i++,a.__current.forEach(function(e){e.name===r&&e.currentIndex>=t&&e.currentIndex--}))},u=c.length-1;u>=0;u--)l(u);return"hookRemoved"!==r&&t.doAction("hookRemoved",r,o),i}}},V=function(t,e){return function(n,r){var o=t[e];return void 0!==r?n in o&&o[n].handlers.some(function(t){return t.namespace===r}):n in o}},$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var o=t[e];o[r]||(o[r]={handlers:[],runs:0}),o[r].runs++;for(var a=o[r].handlers,i=arguments.length,c=new Array(i>1?i-1:0),l=1;l1&&void 0!==arguments[1]?arguments[1]:"default";r.data[e]=D(D(D({},M),r.data[e]),t),r.data[e][""]=D(D({},M[""]),r.data[e][""])},c=function(t,e){i(t,e),a()},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return r.data[t]||i(void 0,t),r.dcnpgettext(t,e,n,o,a)},u=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},s=function(t,e,r){var o=l(r,e,t);return n?(o=n.applyFilters("i18n.gettext_with_context",o,t,e,r),n.applyFilters("i18n.gettext_with_context_"+u(r),o,t,e,r)):o};if(n){var m=function(t){q.test(t)&&a()};n.addAction("hookAdded","core/i18n",m),n.addAction("hookRemoved","core/i18n",m)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[t]},setLocaleData:c,resetLocaleData:function(t,e){r.data={},r.pluralForms={},c(t,e)},subscribe:function(t){return o.add(t),function(){return o.delete(t)}},__:function(t,e){var r=l(e,void 0,t);return n?(r=n.applyFilters("i18n.gettext",r,t,e),n.applyFilters("i18n.gettext_"+u(e),r,t,e)):r},_x:s,_n:function(t,e,r,o){var a=l(o,void 0,t,e,r);return n?(a=n.applyFilters("i18n.ngettext",a,t,e,r,o),n.applyFilters("i18n.ngettext_"+u(o),a,t,e,r,o)):a},_nx:function(t,e,r,o,a){var i=l(a,o,t,e,r);return n?(i=n.applyFilters("i18n.ngettext_with_context",i,t,e,r,o,a),n.applyFilters("i18n.ngettext_with_context_"+u(a),i,t,e,r,o,a)):i},isRTL:function(){return"rtl"===s("ltr","text direction")},hasTranslation:function(t,e,o){var a,i,c=e?e+""+t:t,l=!(null===(a=r.data)||void 0===a||null===(i=a[null!=o?o:"default"])||void 0===i||!i[c]);return n&&(l=n.applyFilters("i18n.has_translation",l,t,e,o),l=n.applyFilters("i18n.has_translation_"+u(o),l,t,e,o)),l}}}(0,0,Y));K.getLocaleData.bind(K),K.setLocaleData.bind(K),K.resetLocaleData.bind(K),K.subscribe.bind(K);var X=K.__.bind(K),W=(K._x.bind(K),K._n.bind(K),K._nx.bind(K),K.isRTL.bind(K),K.hasTranslation.bind(K),window.frmGlobal),Q=W.url,tt=(W.nonce,"frm_hidden"),et="frm-hide-js",nt="frm-current",rt=window.frmDom,ot=rt.tag,at=rt.div,it=rt.a,ct=rt.img;function lt(t){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt(t)}function ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function st(t,e,n){return(e=function(t){var e=function(t){if("object"!=lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var mt,ft=document.getElementById("post-body-content"),pt=document.getElementById("".concat(y,"-sidebar")),dt=((mt=it({className:"button button-primary frm-button-primary"})).setAttribute("role","button"),at({id:"".concat(y,"-empty-state"),className:"frm-flex-col frm-flex-center frm-gap-md ".concat(tt),children:[ct({src:"".concat(Q,"/images/page-skeleton/empty-state.svg"),alt:X("Empty State","formidable")}),at({className:"frmcenter",children:[ot("h2",{className:"".concat(y,"-title frm-mb-0")}),ot("p",{className:"".concat(y,"-text frm-mb-0")})]}),mt]}));null==ft||ft.append(dt);var yt=function(){var t=document.querySelector("#".concat(y,"-empty-state"));return{emptyState:t,emptyStateTitle:null==t?void 0:t.querySelector(".".concat(y,"-title")),emptyStateText:null==t?void 0:t.querySelector(".".concat(y,"-text")),emptyStateButton:null==t?void 0:t.querySelector(".button")}}(),vt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==w(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==w(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=b(b({},e),t)}}}(function(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:10,i=t[e];if(G(n)&&N(r))if("function"==typeof o)if("number"==typeof a){var c={callback:o,priority:a,namespace:r};if(i[n]){var l,u=i[n].handlers;for(l=u.length;l>0&&!(a>=u[l-1].priority);l--);l===u.length?u[l]=c:u.splice(l,0,c),i.__current.forEach(function(t){t.name===n&&t.currentIndex>=l&&t.currentIndex++})}else i[n]={handlers:[c],runs:0};"hookAdded"!==n&&t.doAction("hookAdded",n,r,o,a)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},z=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,o){var a=t[e];if(G(r)&&(n||N(o))){if(!a[r])return 0;var i=0;if(n)i=a[r].handlers.length,a[r]={runs:a[r].runs,handlers:[]};else for(var c=a[r].handlers,l=function(t){c[t].namespace===o&&(c.splice(t,1),i++,a.__current.forEach(function(e){e.name===r&&e.currentIndex>=t&&e.currentIndex--}))},u=c.length-1;u>=0;u--)l(u);return"hookRemoved"!==r&&t.doAction("hookRemoved",r,o),i}}},V=function(t,e){return function(n,r){var o=t[e];return void 0!==r?n in o&&o[n].handlers.some(function(t){return t.namespace===r}):n in o}},$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var o=t[e];o[r]||(o[r]={handlers:[],runs:0}),o[r].runs++;for(var a=o[r].handlers,i=arguments.length,c=new Array(i>1?i-1:0),l=1;l1&&void 0!==arguments[1]?arguments[1]:"default";r.data[e]=D(D(D({},M),r.data[e]),t),r.data[e][""]=D(D({},M[""]),r.data[e][""])},c=function(t,e){i(t,e),a()},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return r.data[t]||i(void 0,t),r.dcnpgettext(t,e,n,o,a)},u=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},s=function(t,e,r){var o=l(r,e,t);return n?(o=n.applyFilters("i18n.gettext_with_context",o,t,e,r),n.applyFilters("i18n.gettext_with_context_"+u(r),o,t,e,r)):o};if(n){var m=function(t){q.test(t)&&a()};n.addAction("hookAdded","core/i18n",m),n.addAction("hookRemoved","core/i18n",m)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[t]},setLocaleData:c,resetLocaleData:function(t,e){r.data={},r.pluralForms={},c(t,e)},subscribe:function(t){return o.add(t),function(){return o.delete(t)}},__:function(t,e){var r=l(e,void 0,t);return n?(r=n.applyFilters("i18n.gettext",r,t,e),n.applyFilters("i18n.gettext_"+u(e),r,t,e)):r},_x:s,_n:function(t,e,r,o){var a=l(o,void 0,t,e,r);return n?(a=n.applyFilters("i18n.ngettext",a,t,e,r,o),n.applyFilters("i18n.ngettext_"+u(o),a,t,e,r,o)):a},_nx:function(t,e,r,o,a){var i=l(a,o,t,e,r);return n?(i=n.applyFilters("i18n.ngettext_with_context",i,t,e,r,o,a),n.applyFilters("i18n.ngettext_with_context_"+u(a),i,t,e,r,o,a)):i},isRTL:function(){return"rtl"===s("ltr","text direction")},hasTranslation:function(t,e,o){var a,i,c=e?e+""+t:t,l=!(null===(a=r.data)||void 0===a||null===(i=a[null!=o?o:"default"])||void 0===i||!i[c]);return n&&(l=n.applyFilters("i18n.has_translation",l,t,e,o),l=n.applyFilters("i18n.has_translation_"+u(o),l,t,e,o)),l}}}(0,0,Y));K.getLocaleData.bind(K),K.setLocaleData.bind(K),K.resetLocaleData.bind(K),K.subscribe.bind(K);var X=K.__.bind(K),W=(K._x.bind(K),K._n.bind(K),K._nx.bind(K),K.isRTL.bind(K),K.hasTranslation.bind(K),window.frmGlobal),Q=W.url,tt=(W.nonce,"frm_hidden"),et="frm-hide-js",nt="frm-current",rt=window.frmDom,ot=rt.tag,at=rt.div,it=rt.a,ct=rt.img;function lt(t){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt(t)}function ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function st(t,e,n){return(e=function(t){var e=function(t){if("object"!=lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var mt,ft=document.getElementById("post-body-content"),pt=document.getElementById("".concat(y,"-sidebar")),dt=((mt=it({className:"button button-primary frm-button-primary"})).setAttribute("role","button"),at({id:"".concat(y,"-empty-state"),className:"frm-flex-col frm-flex-center frm-gap-md ".concat(tt),children:[ct({src:"".concat(Q,"/images/page-skeleton/empty-state.svg"),alt:X("Empty State","formidable")}),at({className:"frmcenter",children:[ot("h2",{className:"".concat(y,"-title frm-mb-0")}),ot("p",{className:"".concat(y,"-text frm-mb-0")})]}),mt]}));null==ft||ft.append(dt);var yt=function(){var t=document.querySelector("#".concat(y,"-empty-state"));return{emptyState:t,emptyStateTitle:null==t?void 0:t.querySelector(".".concat(y,"-title")),emptyStateText:null==t?void 0:t.querySelector(".".concat(y,"-text")),emptyStateButton:null==t?void 0:t.querySelector(".button")}}(),vt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==w(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==w(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=b(b({},e),t)}}}(function(t){for(var e=1;e{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return function(e,t){var r,n,a,l,s,d,c,u,f,m=1,_=e.length,p="";for(n=0;n<_;n++)if("string"==typeof e[n])p+=e[n];else if("object"==typeof e[n]){if((l=e[n]).keys)for(r=t[m],a=0;a").addClass("frm_grid_container frm_sorting").append(e)))}),r}function We(e){var t=s("ul",{className:"frm_grid_container frm_sorting"}),r=s("li",{className:"frm_field_box",child:t});e.replaceWith(r),t.append(e),$(t),X(r,".frm-move")}function Ue(e,t){var r,n,i=/id="(\S+)"/.exec(e),o=document.getElementById(i[1]),l="#"+i[1]+".edit_field_type_divider ul.frm_sorting.start_divider",s=jQuery(l),c=o.getAttribute("data-type");r=e,(n=d()).innerHTML=r,n.querySelectorAll(".form-field").forEach(Ve);var u,f,m=!1;if(Mi(),V(l),"quantity"===c&&function(e){var t=e.getAttribute("data-fid"),r=document.getElementById("field_options[product_field_"+t+"]");null!==r&&(rt(r),ii(document.getElementById("frm-single-settings-"+t)))}(o),"product"!==c&&"quantity"!==c||Ie(),s.length)s.parent(".frm_field_box").children(".frm_no_section_fields").addClass("frm_block");else{var _=jQuery(o).closest("ul.frm_sorting.start_divider");_.length&&(An(_),m=!0)}e.includes("frm-collapse-page")&&Fr(),f="frm-newly-added",(u=o).classList?u.classList.add(f):u.className+=" "+f,setTimeout(function(){o.classList.remove("frm-newly-added")},1e3);var p,g=o.querySelector("#frm-last-row-fields-order");if(g&&((p=JSON.parse(g.value))&&"object"===a(p)&&Object.keys(p).forEach(function(e){var t=document.querySelector('input[name="field_options[field_order_'+e+']"]');t&&(t.value=p[e])})),t){var y=o.getBoundingClientRect(),h=document.getElementById("post-body-content");y.top>=0&&y.left>=0&&y.right<=(window.innerWidth||document.documentElement.clientWidth)&&y.bottom<=(window.innerHeight||document.documentElement.clientHeight)||h.scroll({top:h.scrollHeight,left:0,behavior:"smooth"}),!1===m&&An(s)}Ke(),so(),document.getElementById("frm-show-fields").classList.remove("frm-over-droppable"),function(e){var t=document.getElementById(e);t&&t.dataset.limit&&kr(e)>=t.dataset.limit&&t.classList.add("frm_at_limit")}(c),o.querySelectorAll("[data-toggle]").forEach(function(e){return e.setAttribute("data-bs-toggle",e.getAttribute("data-toggle"))}),o.querySelectorAll(".frm-dropdown-menu").forEach(function(e){return e.classList.add("dropdown-menu")});var v=new Event("frm_added_field",{bubbles:!1});v.frmField=o,v.frmSection=l,v.frmType=c,v.frmToggles=m,document.dispatchEvent(v)}function Ve(e){if(e.dataset.fid){var t=document.getElementById("draft_fields");t&&(""===t.value?t.value=e.dataset.fid:t.value.split(",").includes(e.dataset.fid)||(t.value+=","+e.dataset.fid))}}function $e(e){jQuery("#new_fields .frm-single-settings").addClass("frm_hidden"),jQuery("#frm-options-panel > .frm-single-settings").removeClass("frm_hidden"),Ke(e)}function Ke(e){jQuery("li.ui-state-default.selected").removeClass("selected"),jQuery(".frm-show-field-settings.selected").removeClass("selected"),e||yr()}function Je(){var e=this.value,t=function(e){var t,r=[],n=e.split(""),i=n.length,a=["{","[","("],l={"}":"{",")":"(","]":"["},s=!1;for(t=0;t0||s?o.unmatched_parens+"\n\n":""}(e);t+=function(e,t){var r=function(e,t){var r="";return function(e){return jQuery(e).siblings('label[for^="calc_type"]').children("input").prop("checked")}(t)||/\[(date|time|email|ip)\]/.test(e)&&(r=o.text_shortcodes+"\n\n"),r}(e,t);return r+=function(e){var t="";return/\[id\]|\[key\]|\[if\s\w+\]|\[foreach\s\w+\]|\[created-at(\s*)?/g.test(e)&&(t+=o.view_shortcodes+"\n\n"),t}(e)}(e,this),""!==t&&M(e+"\n\n"+t)}function Xe(e,t){for(var r=!1,n=0;n
6?(t.append(Gt(e,"even")),t):(5!==e&&t.append(Gt(e,"even")),e%2==1&&t.append(Gt(e,"middle")),e<6?(t.append(Gt(e,"left")),t.append(Gt(e,"right"))):((r=d()).classList.add("frm_fourth"),t.prepend(r)),t)}(e),null!==(o=t.closest("ul.frm_sorting"))&&function(e,t){var r,n,i;for(r=t.children.length,n=0;n
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
' );
+ jQuery( '#frm_create_entry p' ).replaceWith( `
` );
jQuery.ajax( {
type: 'POST',
url: ajaxurl,
@@ -122,31 +120,30 @@ function frmCreatePostEntry( id, postId ) {
function frmAdminPopupJS() {
function switchSc() {
- let val;
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() + ' ' );
- val = this.id.replace( 'sc-link-', '' );
+ jQuery( '#frm_popup_content .media-frame-title h1' ).html( `${ jQuery( this ).children( '.howto' ).text() } ` );
+ const val = this.id.replace( 'sc-link-', '' );
populateOpts( val );
return false;
}
function populateOpts( val ) {
- let $settings, $scOpts, $spinner,
- sc = document.getElementById( 'frm_complete_shortcode' );
+ 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 );
+ const $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' );
+ const $scOpts = jQuery( document.getElementById( 'frm_shortcode_options' ) );
+ const $spinner = jQuery( '.media-frame-title .spinner' );
$spinner.show();
jQuery.ajax( {
type: 'POST',
@@ -159,7 +156,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 +164,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 +192,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 +207,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 );
}
} );
}
@@ -220,15 +220,13 @@ function frmAdminPopupJS() {
return {
init() {
- let $scOptsDiv;
-
jQuery( '.frm_switch_sc' ).on( 'click', switchSc );
jQuery( '.button.frm_insert_form' ).on( 'click', function() {
populateOpts( 'formidable' );
} );
jQuery( document.getElementById( 'frm_insert_shortcode' ) ).on( 'click', insertShortcode );
- $scOptsDiv = jQuery( document.getElementById( 'frm_shortcode_options' ) );
+ const $scOptsDiv = jQuery( document.getElementById( 'frm_shortcode_options' ) );
$scOptsDiv.on( 'change', 'select, input', addToShortcode );
$scOptsDiv.on( 'change', '.frm_get_field_selection', getFieldSelection );
@@ -251,8 +249,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,15 +264,14 @@ function frmWidgetsJS() {
nonce: frmGlobal.nonce
},
success( opts ) {
- let titleField,
- catField = widget.find( '.frm_list_items_cat_id' );
+ const catField = widget.find( '.frm_list_items_cat_id' );
catField.find( 'option' ).remove().end();
catField.append( jQuery( '' ) );
jQuery.each( opts.catValues, function( key, value ) {
catField.append( jQuery( '' ).attr( 'value', key ).text( value ) );
} );
- titleField = widget.find( '.frm_list_items_title_id' );
+ const titleField = widget.find( '.frm_list_items_title_id' );
titleField.find( 'option' ).remove().end();
titleField.append( jQuery( '' ) );
jQuery.each( opts.titleValues, function( key, value ) {
diff --git a/js/formidable_blocks.js b/js/formidable_blocks.js
index efc2d448cb..726527dba6 100644
--- a/js/formidable_blocks.js
+++ b/js/formidable_blocks.js
@@ -1 +1 @@
-(()=>{var e={2532:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(6314),o=r.n(n)()(function(e){return e[1]});o.push([e.id,'button.X_GKlxRFRHSOWckGcSPJ {\n\tcursor: progress;\n\topacity: 0.7;\n\tposition: relative;\n\ttext-indent: -999px;\n\tmin-width: 70px;\n\toverflow: hidden;\n}\n\nbutton.X_GKlxRFRHSOWckGcSPJ::before {\n\tcontent: "";\n\tdisplay: inline-block;\n\tposition: absolute;\n\tbackground: transparent;\n\tborder: 1px solid #fff;\n\tborder-top-color: transparent;\n\tborder-left-color: transparent;\n\tborder-radius: 50%;\n\n\tbox-sizing: border-box;\n\ttop: 50%;\n\tleft: 50%;\n\tmargin-top: -10px;\n\tmargin-left: -10px;\n\twidth: 20px;\n\theight: 20px;\n\n\tanimation: _3ywaXb1_tykjJGTtxpG 2s linear infinite;\n}\n',""]),o.locals={"frm-loading":"X_GKlxRFRHSOWckGcSPJ",spin:"_3ywaXb1_tykjJGTtxpG"};const i=o},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r}).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i'+e.message+"
'.concat(e.message,"
' + - frmPlugSearch.legend + - '
' + - ''; + `${ frmPlugSearch.legend }
' + response.message + '
${ response.message }