diff --git a/experimental/gw-capture-filename.js b/experimental/gw-capture-filename.js index 9a6f70a14..c5c3c4dbc 100644 --- a/experimental/gw-capture-filename.js +++ b/experimental/gw-capture-filename.js @@ -12,8 +12,8 @@ var uploadFieldId = 4; var targetFieldId = 5; var template = '{filename}'; -var $uploadField = $( '#input_GFFORMID_{0}'.format( uploadFieldId ) ); -var $targetField = $( '#input_GFFORMID_{0}'.format( targetFieldId ) ); +var $uploadField = $( '#input_GFFORMID_{0}'.gformFormat( uploadFieldId ) ); +var $targetField = $( '#input_GFFORMID_{0}'.gformFormat( targetFieldId ) ); $uploadField.on( 'change', function() { var filename = $( this ).val().split("\\").pop(); diff --git a/gp-advanced-calculations/gpac-recalculate-on-checkbox-change.js b/gp-advanced-calculations/gpac-recalculate-on-checkbox-change.js index 4a73c181e..2242470bc 100644 --- a/gp-advanced-calculations/gpac-recalculate-on-checkbox-change.js +++ b/gp-advanced-calculations/gpac-recalculate-on-checkbox-change.js @@ -8,6 +8,6 @@ * https://gravitywiz.com/gravity-forms-custom-javascript/ */ $( '#gform_GFFORMID input:checkbox' ).on( 'change', function () { - var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.format( GFFORMID ) ); + var _GFCalc = rgars( window, 'gf_global/gfcalc/{0}'.gformFormat( GFFORMID ) ); _GFCalc.runCalcs( formId, _GFCalc.formulaFields ); } ); diff --git a/gp-auto-list-field/gpalf-dynamic-row-labels.js b/gp-auto-list-field/gpalf-dynamic-row-labels.js index f51d43f40..584770813 100644 --- a/gp-auto-list-field/gpalf-dynamic-row-labels.js +++ b/gp-auto-list-field/gpalf-dynamic-row-labels.js @@ -2,12 +2,12 @@ * Gravity Perks // Auto List Field // Dynamic Row Labels for List Fields * https://gravitywiz.com/documentation/gravity-forms-auto-list-field/ * - * Dynamically populate the first column of a List field with a dynamic value that includes the row number. + * Dynamically populate the first column of a List field with a dynamic value that includes the row number. * For example, if your List field represents attendees to an event, you could label each row, "Attendee #1, * Attendee #2, etc). - + * Instructions: - * + * * 1. Install this snippet with our free Custom JavaScript plugin. * https://gravitywiz.com/gravity-forms-custom-javascript/ * 2. Update variables to match your form by following the inline instructions. @@ -30,11 +30,11 @@ function gw_apply_list_field_value_template( $container, $row ) { $( this ) .find( 'input' ) .eq( 0 ) - .val( template.format( rowIndex + 1 ) ); + .val( template.gformFormat( rowIndex + 1 ) ); } ); } -gw_apply_list_field_value_template( $( '#field_GFFORMID_{0}'.format( listFieldId ) ) ); +gw_apply_list_field_value_template( $( '#field_GFFORMID_{0}'.gformFormat( listFieldId ) ) ); gform.addAction( 'gform_list_post_item_add', function ( $row, $container ) { if ( gf_get_input_id_by_html_id( $container.parents( '.gfield' ).attr( 'id' ) ) == listFieldId ) { diff --git a/gp-conditional-pricing/gpcp-show-original-price.js b/gp-conditional-pricing/gpcp-show-original-price.js index 94a982225..27fdf1235 100644 --- a/gp-conditional-pricing/gpcp-show-original-price.js +++ b/gp-conditional-pricing/gpcp-show-original-price.js @@ -14,12 +14,12 @@ return; } - var $input = $( '#input_{0}_{1}'.format( GWConditionalPricing._formId, productId ) ); + var $input = $( '#input_{0}_{1}'.gformFormat( GWConditionalPricing._formId, productId ) ); if ( ! $input.length ) { return; } - var $basePrice = $( '#base_price_{0}_{1}'.format( GWConditionalPricing._formId, productId ) ); + var $basePrice = $( '#base_price_{0}_{1}'.gformFormat( GWConditionalPricing._formId, productId ) ); // Remove base price if there is no discounted price. if ( $input.text() === basePrice ) { @@ -27,7 +27,7 @@ } // Otherwise, add base price if it has not been added. else if ( ! $basePrice.length ) { - $basePrice = '{2}'.format( GWConditionalPricing._formId, productId, basePrice ); + $basePrice = '{2}'.gformFormat( GWConditionalPricing._formId, productId, basePrice ); $input.before( $basePrice ); } diff --git a/gp-copy-cat/gpcc-clear-values-by-trigger.php b/gp-copy-cat/gpcc-clear-values-by-trigger.php index 04b28d1de..6e13f7f51 100644 --- a/gp-copy-cat/gpcc-clear-values-by-trigger.php +++ b/gp-copy-cat/gpcc-clear-values-by-trigger.php @@ -19,7 +19,7 @@ gform.addFilter( 'gpcc_copied_value', function( value, $targetElem, field ) { // Update "4" to the field ID of your choice-based trigger field. var triggerFieldId = 4; - if ( triggerFieldId == field.trigger && jQuery( '#choice_{0}_{1}_1'.format( field.targetFormId, triggerFieldId ) ).is( ':checked' ) ) { + if ( triggerFieldId == field.trigger && jQuery( '#choice_{0}_{1}_1'.gformFormat( field.targetFormId, triggerFieldId ) ).is( ':checked' ) ) { value = ''; } return value; diff --git a/gp-date-time-calculator/gpdtc-format-hours-mins.php b/gp-date-time-calculator/gpdtc-format-hours-mins.php index 0e4703927..cfef08ee6 100644 --- a/gp-date-time-calculator/gpdtc-format-hours-mins.php +++ b/gp-date-time-calculator/gpdtc-format-hours-mins.php @@ -69,7 +69,7 @@ public function output_script() { var hours = Math.floor( result ); var diff = hours - result; var mins = Math.round( Math.abs( diff * 60 ) ); - result = '{0} hours, {1} minutes'.format( hours, mins ); + result = '{0} hours, {1} minutes'.gformFormat( hours, mins ); } return result; } ); diff --git a/gp-ecommerce-fields/gpecf-conditional-logic-performance-enhancer.js b/gp-ecommerce-fields/gpecf-conditional-logic-performance-enhancer.js index aa16fcbbc..8b6d5b74e 100644 --- a/gp-ecommerce-fields/gpecf-conditional-logic-performance-enhancer.js +++ b/gp-ecommerce-fields/gpecf-conditional-logic-performance-enhancer.js @@ -24,9 +24,9 @@ function gwizDebounce(func, wait, immediate) { }; } -$(document).off("gform_post_conditional_logic.gfCalc_{0}".format(GFFORMID)) +$(document).off("gform_post_conditional_logic.gfCalc_{0}".gformFormat(GFFORMID)) -$(document).on("gform_post_conditional_logic.gfCalc_{0}".format(GFFORMID), gwizDebounce(function () { - var _GFCalc = rgars(window, 'gf_global/gfcalc/{0}'.format(GFFORMID)); +$(document).on("gform_post_conditional_logic.gfCalc_{0}".gformFormat(GFFORMID), gwizDebounce(function () { + var _GFCalc = rgars(window, 'gf_global/gfcalc/{0}'.gformFormat(GFFORMID)); _GFCalc.runCalcs(formId, _GFCalc.formulaFields); }, 15)); diff --git a/gp-limit-checkboxes/gplcb-gppt-min-limit-soft-validation.js b/gp-limit-checkboxes/gplcb-gppt-min-limit-soft-validation.js index 58011f86c..d33b77328 100644 --- a/gp-limit-checkboxes/gplcb-gppt-min-limit-soft-validation.js +++ b/gp-limit-checkboxes/gplcb-gppt-min-limit-soft-validation.js @@ -28,7 +28,7 @@ window.gform.addFilter('gppt_validation_result', function (result, gppt, formId) var group = gplc.groups[i]; var fields = group.fields; var fieldsVisible = true; - var groupValidationMessage = validationMessage.format(group.min); + var groupValidationMessage = validationMessage.gformFormat(group.min); $(gplc.getSelector(group.fields)).each(function () { var fieldVisible = $(this).is(':visible'); diff --git a/gp-limit-checkboxes/gplcb-set-max-by-field-value.js b/gp-limit-checkboxes/gplcb-set-max-by-field-value.js index f0ea88cd9..298669086 100644 --- a/gp-limit-checkboxes/gplcb-set-max-by-field-value.js +++ b/gp-limit-checkboxes/gplcb-set-max-by-field-value.js @@ -1,12 +1,12 @@ /** * Gravity Perks // GP Limit Checkboxes // Set Max Limit by Field Value * https://gravitywiz.com/documentation/gravity-forms-limit-checkboxes/ - * + * * Set the max number of checkboxes that can be checked in a Checkbox field based * on the value entered/selected in another field. - * + * * Instructions: - * + * * 1. Install this snippet with our free Custom JavaScript plugin. * https://gravitywiz.com/gravity-forms-custom-javascript/ * 2. Configure based on the inline instructions. @@ -15,15 +15,15 @@ gform.addFilter( 'gplc_group', function( group, fieldId, $elem, gplc ) { // Update "3" to the ID of your Checkbox field. var checkboxFieldId = 3; - + // Update "4" to the ID of your field whose value whould be used to set the max checkbox limit. var maxFieldId = 4; if ( group.fields.indexOf( checkboxFieldId ) === -1 ) { return group; } - - var $maxField = $( '#input_{0}_{1}'.format( GFFORMID, maxFieldId ) ); + + var $maxField = $( '#input_{0}_{1}'.gformFormat( GFFORMID, maxFieldId ) ); var isRadio = $maxField.hasClass( 'gfield_radio' ); if ( isRadio ) { @@ -42,7 +42,7 @@ gform.addFilter( 'gplc_group', function( group, fieldId, $elem, gplc ) { if ( ! $maxField.data( 'gplcIsBound' ) ) { // If our max field value changes, reset the checkboxes and reinitialize GPLC. $maxField.on( 'change', function() { - $( '#field_{0}_{1}'.format( GFFORMID, checkboxFieldId ) ).find( 'input' ).prop( 'checked', false ); + $( '#field_{0}_{1}'.gformFormat( GFFORMID, checkboxFieldId ) ).find( 'input' ).prop( 'checked', false ); gplc.handleCheckboxClick( $elem ); } ); $maxField.data( 'gplcIsBound', true ); diff --git a/gp-limit-choices/gplc-field-groups.php b/gp-limit-choices/gplc-field-groups.php index 62d7cfc76..5091ce921 100644 --- a/gp-limit-choices/gplc-field-groups.php +++ b/gp-limit-choices/gplc-field-groups.php @@ -221,7 +221,7 @@ public static function output_script() { var groupsToRefresh = []; for ( var i = 0, max = GPLCFieldGroupConditionalLogic.length; i < max; i ++ ) { var group = GPLCFieldGroupConditionalLogic[i]; - var formFieldId = "{0}_{1}".format( group.formId, group.targetFieldId ); + var formFieldId = "{0}_{1}".gformFormat( group.formId, group.targetFieldId ); // Skip inapplicable and hidden target fields if ( formId != group.formId || groupsToRefresh[formFieldId] || ! group.$targetField.is( ':visible' ) ) { @@ -255,8 +255,8 @@ public static function output_script() { self.init = function () { - self.$form = $( '#gform_wrapper_{0}'.format( self.formId ) ); - self.$targetField = $( '#field_{0}_{1}'.format( self.formId, self.targetFieldId ) ); + self.$form = $( '#gform_wrapper_{0}'.gformFormat( self.formId ) ); + self.$targetField = $( '#field_{0}_{1}'.gformFormat( self.formId, self.targetFieldId ) ); gform.addAction( 'gform_input_change', function ( elem, formId, fieldId ) { if ( $.inArray( parseInt( fieldId ), self.triggerFieldIds ) !== - 1 ) { diff --git a/gp-multi-page-navigation/gpmpn-page-permalinks.php b/gp-multi-page-navigation/gpmpn-page-permalinks.php index 0e07f079a..6bf8d21c4 100644 --- a/gp-multi-page-navigation/gpmpn-page-permalinks.php +++ b/gp-multi-page-navigation/gpmpn-page-permalinks.php @@ -119,11 +119,11 @@ public function output_script() { self.init = function() { - if ( typeof window[ 'GPMPNPagePermalinks_{0}'.format( self.formId ) ] !== 'undefined' ) { + if ( typeof window[ 'GPMPNPagePermalinks_{0}'.gformFormat( self.formId ) ] !== 'undefined' ) { return; } - window[ 'GPMPNPagePermalinks_{0}'.format( self.formId ) ] = self; + window[ 'GPMPNPagePermalinks_{0}'.gformFormat( self.formId ) ] = self; self.history.push( { gpmpnPage: self.defaultPage } ); @@ -149,7 +149,7 @@ public function output_script() { // $( '.gform_previous_button:visible' ).click(); // } // Temporary solution: reload first page when user uses browser's back/next buttons. - window.location = window.location.origin + '/{0}/{1}/'.format( self.pagename, self.permalinks[1] ); + window.location = window.location.origin + '/{0}/{1}/'.gformFormat( self.pagename, self.permalinks[1] ); } ); self.isInit = true; @@ -163,7 +163,7 @@ public function output_script() { var state = { gpmpnPage: self.currentPage }; self.history.push( state ); - window.history.pushState( state, null, '/{0}/{1}/'.format( self.pagename, self.permalinks[ currentPage ] ) ); + window.history.pushState( state, null, '/{0}/{1}/'.gformFormat( self.pagename, self.permalinks[ currentPage ] ) ); } diff --git a/gp-nested-forms/gpnf-copy-parent-value-manually.js b/gp-nested-forms/gpnf-copy-parent-value-manually.js index 0054626bc..c4b7be784 100644 --- a/gp-nested-forms/gpnf-copy-parent-value-manually.js +++ b/gp-nested-forms/gpnf-copy-parent-value-manually.js @@ -7,13 +7,13 @@ * cannot differentiate between them and will populate incorrect values. */ gform.addAction( 'gpnf_init_nested_form', function( childFormId, gpnf ) { - + // Update "123" to your the ID of your child form. - var targetChildFormId = 123; - + var targetChildFormId = 123; + // Update "4" to the ID of the child field in which the parent form ID will be populated. var childFieldId = 4; - + // Update "5" to the ID of the parent field whose value will be copied to the child field. var parentFieldId = 5; @@ -24,12 +24,12 @@ gform.addAction( 'gpnf_init_nested_form', function( childFormId, gpnf ) { } ); function copyParentFormValue( parentFormId, parentFieldId, childFormId, childFieldId ) { - - var value = jQuery ( '#input_{0}_{1}'.format( parentFormId, parentFieldId ) ).val(); - - // Delaying setting value so Populate Anything can pick up the change event. + + var value = jQuery ( '#input_{0}_{1}'.gformFormat( parentFormId, parentFieldId ) ).val(); + + // Delaying setting value so Populate Anything can pick up the change event. setTimeout( function() { $( '#input_' + childFormId + '_' + childFieldId ).val( value ).change(); } ); - + } diff --git a/gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php b/gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php index 61eb35ea0..50fbe03b9 100644 --- a/gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php +++ b/gp-nested-forms/gpnf-hide-nested-entries-table-if-empty.php @@ -45,11 +45,11 @@ diff --git a/gp-nested-forms/gpnf-limit-entry-min-max-from-field.php b/gp-nested-forms/gpnf-limit-entry-min-max-from-field.php index 7eced271c..28b8e9298 100644 --- a/gp-nested-forms/gpnf-limit-entry-min-max-from-field.php +++ b/gp-nested-forms/gpnf-limit-entry-min-max-from-field.php @@ -154,7 +154,7 @@ public function output_script() { gform.addAction( 'gform_input_change', function( el, formId, fieldId ) { if ( el.id === maxFieldId ) { // Force Knockout to recalculate the max when the number has changed - window[ 'GPNestedForms_{0}_{1}'.format( self.parentFormId, self.nestedFormFieldId ) ].viewModel.entries.valueHasMutated(); + window[ 'GPNestedForms_{0}_{1}'.gformFormat( self.parentFormId, self.nestedFormFieldId ) ].viewModel.entries.valueHasMutated(); } } ); diff --git a/gp-nested-forms/gpnf-open-edit-modal-after-child-entry-is-duplicated.js b/gp-nested-forms/gpnf-open-edit-modal-after-child-entry-is-duplicated.js index 84cee7acd..574121a54 100644 --- a/gp-nested-forms/gpnf-open-edit-modal-after-child-entry-is-duplicated.js +++ b/gp-nested-forms/gpnf-open-edit-modal-after-child-entry-is-duplicated.js @@ -3,10 +3,10 @@ * https://gravitywiz.com/documentation/gravity-forms-nested-forms/ * * Instructions: - * + * * 1. Install this snippet with our free Custom JavaScript plugin. * https://gravitywiz.com/gravity-forms-custom-javascript/ */ gform.addAction( 'gpnf_post_duplicate_entry', function( entry, data, response ) { - $( 'tr[data-entryId="{0}"]'.format( entry.id ) ).find( '.edit a' ).click(); + $( 'tr[data-entryId="{0}"]'.gformFormat( entry.id ) ).find( '.edit a' ).click(); } ); diff --git a/gp-nested-forms/gpnf-template-single-submission-child-form.php b/gp-nested-forms/gpnf-template-single-submission-child-form.php index dc0e57de2..ce9b92800 100644 --- a/gp-nested-forms/gpnf-template-single-submission-child-form.php +++ b/gp-nested-forms/gpnf-template-single-submission-child-form.php @@ -26,8 +26,8 @@
✅ Child form submitted! - - +
diff --git a/gp-nested-forms/gpnf-triggered-population.php b/gp-nested-forms/gpnf-triggered-population.php index 4a83b7f88..9c9a9bdfb 100644 --- a/gp-nested-forms/gpnf-triggered-population.php +++ b/gp-nested-forms/gpnf-triggered-population.php @@ -74,9 +74,9 @@ public function output_script() { self.init = function() { - $form = $( '#gform_{0}'.format( self.formId ) ); + $form = $( '#gform_{0}'.gformFormat( self.formId ) ); - $( '#field_{0}_{1}'.format( self.formId, self.triggerFieldId ) ).find( 'input' ).on( 'change', function() { + $( '#field_{0}_{1}'.gformFormat( self.formId, self.triggerFieldId ) ).find( 'input' ).on( 'change', function() { var input = $( this ); var value = input.val(); var checked = input[0].checked; diff --git a/gp-populate-anything/gppa-populate-child-entries.php b/gp-populate-anything/gppa-populate-child-entries.php index 27166934c..fcaf80c91 100644 --- a/gp-populate-anything/gppa-populate-child-entries.php +++ b/gp-populate-anything/gppa-populate-child-entries.php @@ -117,7 +117,7 @@ public function output_script() { self.init = function() { - self.$peidField = $( '#input_{0}_{1}'.format( self.formId, self.fieldId ) ); + self.$peidField = $( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); if ( typeof window[ 'gpnfSessionPromise_' + self.formId ] === 'undefined' ) { gform.addAction( 'gpnf_session_initialized', function() { @@ -131,7 +131,7 @@ public function output_script() { self.setupPeidField = function() { - var gpnfCookie = $.parseJSON( self.getCookie( 'gpnf_form_session_{0}'.format( self.formId ) ) ); + var gpnfCookie = $.parseJSON( self.getCookie( 'gpnf_form_session_{0}'.gformFormat( self.formId ) ) ); if ( ! self.$peidField.val() ) { self.$peidField @@ -140,7 +140,7 @@ public function output_script() { } for ( var i = 0; i < self.nestedFormFieldIds.length; i++ ) { - window[ 'GPNestedForms_{0}_{1}'.format( self.formId, self.nestedFormFieldIds[ i ] ) ].viewModel.entries.subscribe( function( entries ) { + window[ 'GPNestedForms_{0}_{1}'.gformFormat( self.formId, self.nestedFormFieldIds[ i ] ) ].viewModel.entries.subscribe( function( entries ) { self.$peidField.data( 'lastValue', '' ).change(); } ); } diff --git a/gp-populate-anything/gppa-wait-for-population-on-enter-press.js b/gp-populate-anything/gppa-wait-for-population-on-enter-press.js index f1f4636f3..0b12050f1 100644 --- a/gp-populate-anything/gppa-wait-for-population-on-enter-press.js +++ b/gp-populate-anything/gppa-wait-for-population-on-enter-press.js @@ -1,18 +1,18 @@ /** * Gravity Perks // Populate Anything // Wait for Population Before Submitting When Enter Key Pressed * https://gravitywiz.com/documentation/gravity-forms-populate-anything/ - * - * By default, the form is immediately submitted after the Enter key is pressed. This means if the field triggers + * + * By default, the form is immediately submitted after the Enter key is pressed. This means if the field triggers * dynamic population of other fields via Populate Anything, that population will not occur before the form is submitted. * * This snippet allows to to specify trigger fields that should wait for Populate Anything to finish populating before * allowing the Enter-keypress-triggered submission from continuing. - * + * * Instructions: - * + * * 1. Install this snippet with our free Custom JavaScript plugin. * https://gravitywiz.com/gravity-forms-custom-javascript/ - * + * * 2. Add "gppa-wait-for-pop" to the CSS Class Name setting for field that will trigger the population. */ $( document ).on( 'keypress', '.gppa-wait-for-pop', function( e ) { @@ -25,7 +25,7 @@ $( document ).on( 'keypress', '.gppa-wait-for-pop', function( e ) { .off( 'gppa_updated_batch_fields.gpqr' ) .on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) { setTimeout( function() { - $( '#gform_{0}'.format( formId ) ).submit(); + $( '#gform_{0}'.gformFormat( formId ) ).submit(); } ); } ); return false; diff --git a/gp-preview-submission/gpps-live-refresh.php b/gp-preview-submission/gpps-live-refresh.php index 367280476..657ba753b 100644 --- a/gp-preview-submission/gpps-live-refresh.php +++ b/gp-preview-submission/gpps-live-refresh.php @@ -64,8 +64,8 @@ public function output_script() { self.init = function() { - self.$form = $( '#gform_wrapper_{0}'.format( self.formId ) ); - self.$targetField = $( '#field_{0}_{1}'.format( self.formId, self.targetFieldId ) ); + self.$form = $( '#gform_wrapper_{0}'.gformFormat( self.formId ) ); + self.$targetField = $( '#field_{0}_{1}'.gformFormat( self.formId, self.targetFieldId ) ); self.$form.find( 'input, select, textarea' ).on( 'change', function() { self.refresh(); diff --git a/gp-qr-code/gpqr-auto-submit-on-scan-with-gppa.js b/gp-qr-code/gpqr-auto-submit-on-scan-with-gppa.js index 6f1439078..522f7ec38 100644 --- a/gp-qr-code/gpqr-auto-submit-on-scan-with-gppa.js +++ b/gp-qr-code/gpqr-auto-submit-on-scan-with-gppa.js @@ -12,10 +12,10 @@ */ gform.addAction( 'gpqr_on_scan_success', function( decodedText, decodedResult, gpqrObj ) { $( document ).off( 'gppa_updated_batch_fields.gpqr' ); - $( document ).on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) { + $( document ).on( 'gppa_updated_batch_fields.gpqr', function( event, formId ) { if ( gpqrObj.formId == formId ) { setTimeout( function() { - $( '#gform_{0}'.format( formId ) ).submit(); + $( '#gform_{0}'.gformFormat( formId ) ).submit(); } ); } } ); diff --git a/gravity-forms/gw-check-all-checkboxes-by-default.js b/gravity-forms/gw-check-all-checkboxes-by-default.js index bd165522e..d4704d8ed 100644 --- a/gravity-forms/gw-check-all-checkboxes-by-default.js +++ b/gravity-forms/gw-check-all-checkboxes-by-default.js @@ -13,7 +13,7 @@ */ // Update "4" and "5" to Checkbox field IDs which should be selected by default. $.each( [ 4, 5 ], function( index, fieldId ) { - $checkboxes = $( '#field_GFFORMID_{0}'.format( fieldId ) ).find( 'input' ); + $checkboxes = $( '#field_GFFORMID_{0}'.gformFormat( fieldId ) ).find( 'input' ); if ( $checkboxes.filter( ':checked' ).length === 0 ) { $checkboxes.prop( 'checked', true ); } diff --git a/gravity-forms/gw-dynamic-range.php b/gravity-forms/gw-dynamic-range.php index 84f30aa6b..f36495ba4 100644 --- a/gravity-forms/gw-dynamic-range.php +++ b/gravity-forms/gw-dynamic-range.php @@ -111,17 +111,17 @@ public function output_script() { self.init = function() { - self.$target = $( '#input_{0}_{1}'.format( self.formId, self.fieldId ) ); + self.$target = $( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); if ( self.minFieldId ) { - self.$min = $( '#input_{0}_{1}'.format( self.formId, self.minFieldId ) ); + self.$min = $( '#input_{0}_{1}'.gformFormat( self.formId, self.minFieldId ) ); self.$min.on( 'change', function() { self.setDynamicRange(); } ); } if ( self.maxFieldId ) { - self.$max = $( '#input_{0}_{1}'.format( self.formId, self.maxFieldId ) ); + self.$max = $( '#input_{0}_{1}'.gformFormat( self.formId, self.maxFieldId ) ); self.$max.on( 'change', function() { self.setDynamicRange(); } ); @@ -192,23 +192,23 @@ public function output_script() { message = self.messages.both .replace( '%1$s', '{0}' ) .replace( '%2$s', '{1}' ) - .format( '' + min + '', '' + max + '' ); + .gformFormat( '' + min + '', '' + max + '' ); } else if ( min ) { message = self.messages.min .replace( '%s', '{0}' ) - .format( '' + min + '' ); + .gformFormat( '' + min + '' ); } else if ( max ) { message = self.messages.max .replace( '%s', '{0}' ) - .format( '' + max + '' ); + .gformFormat( '' + max + '' ); } - let $instruct = $( '#gfield_instruction_{0}_{1}'.format( self.formId, self.fieldId ) ); + let $instruct = $( '#gfield_instruction_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); if ( ! $instruct.length ) { - $instruct = $( '#validation_message_{0}_{1}'.format( self.formId, self.fieldId ) ); + $instruct = $( '#validation_message_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); } if ( ! $instruct.length && message ) { - $instruct = $( '
'.format( self.formId, self.fieldId ) ); + $instruct = $( '
'.gformFormat( self.formId, self.fieldId ) ); self.$target.after( $instruct ); } diff --git a/gravity-forms/gw-feed-specific-submit-button.php b/gravity-forms/gw-feed-specific-submit-button.php index 1c5e1be15..62ac4ceeb 100644 --- a/gravity-forms/gw-feed-specific-submit-button.php +++ b/gravity-forms/gw-feed-specific-submit-button.php @@ -87,7 +87,7 @@ public function output_script() { gform.addAction( 'gform_frontend_feeds_evaluated', function( feeds, formId ) { - var $submitButton = $( '#gform_submit_button_{0}'.format( formId ) ), + var $submitButton = $( '#gform_submit_button_{0}'.gformFormat( formId ) ), originalLabel = $submitButton.data( 'default-label' ); if( originalLabel ) { diff --git a/gravity-forms/gw-field-to-field-conditional-logic.php b/gravity-forms/gw-field-to-field-conditional-logic.php index 2fbc841b7..e138c92d0 100644 --- a/gravity-forms/gw-field-to-field-conditional-logic.php +++ b/gravity-forms/gw-field-to-field-conditional-logic.php @@ -66,7 +66,7 @@ public function output_admin_inline_script() { } var value = '{:' + field.id + ':value}'; var isSelected = value === selectedValue; - fieldOptions.push( ''.format( value, GetLabel( field ), isSelected ? 'selected' : '' ) ); + fieldOptions.push( ''.gformFormat( value, GetLabel( field ), isSelected ? 'selected' : '' ) ); if ( isSelected ) { var $choiceSelect = jQuery( '' ); $choiceSelect.find( 'option:selected' ).remove(); @@ -75,7 +75,7 @@ public function output_admin_inline_script() { } } - markup = '{0}{1}{2}{3}'.format( + markup = '{0}{1}{2}{3}'.gformFormat( match ? match[1] : '', choiceOptions, fieldOptions.join( "\n" ), diff --git a/gravity-forms/gw-gravity-forms-rounding.php b/gravity-forms/gw-gravity-forms-rounding.php index c05e59195..734dbd003 100644 --- a/gravity-forms/gw-gravity-forms-rounding.php +++ b/gravity-forms/gw-gravity-forms-rounding.php @@ -276,7 +276,7 @@ function output_script() { * @param int value Current input value to be rounded * @param int actionValue Custom value passed in CSS class name (e.g. gw-round-custom-10, actionValue = 10) */ - value = window.gform.applyFilters( 'gw_round_{0}'.format(action), value, actionValue ); + value = window.gform.applyFilters( 'gw_round_{0}'.gformFormat(action), value, actionValue ); break; } diff --git a/gravity-forms/gw-manual-entries.php b/gravity-forms/gw-manual-entries.php index d295203b6..2e804199f 100644 --- a/gravity-forms/gw-manual-entries.php +++ b/gravity-forms/gw-manual-entries.php @@ -91,7 +91,7 @@ public function output_entry_button_script() { a.title = ''; a.href = ''; var marginLeft = document.querySelectorAll( '.tablenav-pages.no-pages' ).length > 0 ? 'auto' : '0.375rem;' - a.style = 'margin-left:{0};'.format( marginLeft ); + a.style = 'margin-left:{0};'.gformFormat( marginLeft ); a.className = 'button'; tableNavTop.appendChild( a ); } diff --git a/gravity-forms/gw-populate-date.php b/gravity-forms/gw-populate-date.php index ab022f521..fbc5dcdf4 100644 --- a/gravity-forms/gw-populate-date.php +++ b/gravity-forms/gw-populate-date.php @@ -351,7 +351,7 @@ public static function output_script() { case 'field': var inputId = self.modifier.inputId, value = self.getFieldValue( inputId ), - modifier = value !== '' ? self.modifier.modifier.format( value ) : false; + modifier = value !== '' ? self.modifier.modifier.gformFormat( value ) : false; break; } @@ -396,7 +396,7 @@ public static function output_script() { var fieldId = gformExtractFieldId( inputId ), inputIndex = gformExtractInputIndex( inputId ), id = inputIndex !== fieldId ? '#input_{0}_{1}' : '#input_{0}_{1}_{2}', - $input = $( id.format( self.formId, fieldId, inputIndex ) ); + $input = $( id.gformFormat( self.formId, fieldId, inputIndex ) ); return $input; }; diff --git a/gravity-forms/gw-prevent-duplicate-selections.php b/gravity-forms/gw-prevent-duplicate-selections.php index e4a6edf0f..c393af11d 100644 --- a/gravity-forms/gw-prevent-duplicate-selections.php +++ b/gravity-forms/gw-prevent-duplicate-selections.php @@ -64,8 +64,8 @@ public function output_script() { /** * Given a select element, determines which option was changed. - * - * @param {HTMLSelectElement} $select + * + * @param {HTMLSelectElement} $select * @param {object} selected * @param {string} selected.selected * @param {string} selected.deselected @@ -79,7 +79,7 @@ function getChangedOptionElFromSelect( $select, selected ) { * on the jQuery event which indicates which option was selected/deselected. * * - If the option was selected, then selected.selected will be the value of the selected option. - * - If the option was deselected, the selected.deslected will be the value of the deselected option. + * - If the option was deselected, the selected.deslected will be the value of the deselected option. */ if ( selected ) { let value = selected.selected ? selected.selected : selected.deselected; @@ -166,14 +166,14 @@ function gwDisableDuplicates( $elem, $group, selected ) { $elem.parents( '.gfield' ).data( 'previous-value', $elem.val() ); if ( previousValue ) { $targets - .filter( '[value="{0}"]'.format( previousValue ) ) + .filter( '[value="{0}"]'.gformFormat( previousValue ) ) .prop( 'disabled', false ) .removeClass( disabledClass ); } } let $filteredTargets = $targets - .filter( '[value="{0}"]'.format( value ) ) + .filter( '[value="{0}"]'.gformFormat( value ) ) .prop( 'disabled', isChecked ); // For Drop Down and Multi Selects, we need to loop through each field and select the first available option - and - diff --git a/gravity-forms/gw-set-list-field-rows-by-field-value.php b/gravity-forms/gw-set-list-field-rows-by-field-value.php index 49a80ea26..c4bc6a4ae 100644 --- a/gravity-forms/gw-set-list-field-rows-by-field-value.php +++ b/gravity-forms/gw-set-list-field-rows-by-field-value.php @@ -83,7 +83,7 @@ public function output_script() { // Hide add/remove buttons // Also align list column title - $("#field_{0}_{1}".format( this.formId, this.listFieldId ) ).find( '.gfield_header_item--icons, .gfield_list_icons' ).hide(); + $("#field_{0}_{1}".gformFormat( this.formId, this.listFieldId ) ).find( '.gfield_header_item--icons, .gfield_list_icons' ).hide(); } diff --git a/gravity-forms/gw-time-sensitive-choices.php b/gravity-forms/gw-time-sensitive-choices.php index e80abd94c..1a1767a1c 100644 --- a/gravity-forms/gw-time-sensitive-choices.php +++ b/gravity-forms/gw-time-sensitive-choices.php @@ -77,9 +77,9 @@ public function output_script() { self.init = function() { - self.$target = $( '#input_{0}_{1}'.format( self.formId, self.fieldId ) ); + self.$target = $( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); if ( self.dateFieldId ) { - self.$date = $( '#input_{0}_{1}'.format( self.formId, self.dateFieldId ) ); + self.$date = $( '#input_{0}_{1}'.gformFormat( self.formId, self.dateFieldId ) ); self.bindEvents(); setTimeout( function() { self.initializeChoices(); @@ -95,14 +95,14 @@ public function output_script() { gform.addAction( 'gpi_field_refreshed', function( $targetField, $triggerField, initialLoad ) { if ( gf_get_input_id_by_html_id( self.$target.attr( 'id' ) ) == gf_get_input_id_by_html_id( $targetField.attr( 'id' ) ) ) { - self.$target = $targetField.find( '#input_{0}_{1}'.format( self.formId, self.fieldId ) ); + self.$target = $targetField.find( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); self.initializeChoices(); } } ); $( document ).on( 'gppa_updated_batch_fields', function ( event, formId, updatedFieldIds ) { if ( updatedFieldIds.indexOf( gf_get_input_id_by_html_id( self.$target.attr( 'id' ) ) ) !== - 1 ) { - self.$target = $( '#input_{0}_{1}'.format( self.formId, self.fieldId ) ); + self.$target = $( '#input_{0}_{1}'.gformFormat( self.formId, self.fieldId ) ); self.initializeChoices(); } } ); diff --git a/gravity-forms/gw-validate-that-a-value-exists.php b/gravity-forms/gw-validate-that-a-value-exists.php index f573c5101..6cb0cbe5b 100644 --- a/gravity-forms/gw-validate-that-a-value-exists.php +++ b/gravity-forms/gw-validate-that-a-value-exists.php @@ -281,7 +281,7 @@ public function output_script() { } self.getIndicatorId = function( inputId ) { - return 'response_{0}_{1}'.format( self.targetFormId, inputId ); + return 'response_{0}_{1}'.gformFormat( self.targetFormId, inputId ); } self.getIndicatorTemplate = function() { @@ -307,7 +307,7 @@ public function output_script() { } self.addIndicator = function( $elem, inputId, cssClass, icon ) { - $elem.after( self.getIndicatorTemplate().format( self.getIndicatorId( inputId ), cssClass, icon ) ); + $elem.after( self.getIndicatorTemplate().gformFormat( self.getIndicatorId( inputId ), cssClass, icon ) ); } self.spinner = function( elem, imageSrc, inlineStyles ) {