From 2599f454acff9ad87c43beae7cb41dfbe655126f Mon Sep 17 00:00:00 2001 From: Gravity Forms Date: Thu, 26 Oct 2023 10:05:30 +0000 Subject: [PATCH] Updates to 2.7.16 --- change_log.txt | 9 ++++ form_display.php | 2 +- gravityforms.php | 4 +- includes/fields/class-gf-field-checkbox.php | 1 - .../block-styles/block-styles-handler.php | 2 +- includes/libraries/gf-background-process.php | 10 ++++- .../telemetry/class-gf-telemetry-data.php | 44 ++++++++++++------- .../class-gf-telemetry-processor.php | 42 ++++++------------ .../class-gf-telemetry-service-provider.php | 25 ++++++----- js/conditional_logic.js | 10 ++--- js/conditional_logic.min.js | 2 +- js/form_editor.js | 21 +++++++-- js/form_editor.min.js | 2 +- js/gravityforms.js | 20 +++++---- js/gravityforms.min.js | 2 +- js/preview.js | 8 ++-- js/preview.min.js | 2 +- languages/gravityforms.pot | 12 ++--- 18 files changed, 125 insertions(+), 93 deletions(-) diff --git a/change_log.txt b/change_log.txt index 8ba3571..7a794a4 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,12 @@ +### 2.7.16 | 2023-10-25 +- Updated the API endpoint for telemetry data. +- Fixed a bug that causes values of checkbox fields to appear twice on the entry list page. +- Fixed a bug that prevents form block style settings from being applied. +- Fixed jQuery deprecation notices in the form preview for the following fields: email, product, total, and stripe fields, as well as some conditional logic. +- Fixed "undefined index" errors that sometimes appear when a form is embedded with a shortcode. Credit: The GravityKit team. +- AF: Updated the background processor to include additional logging statements around batch processing. +- API: Added a new JavaScript action hook [gform_post_set_field_property](https://docs.gravityforms.com/gform_post_set_field_property/) in the form editor to listen for field property changes. + ### 2.7.15 | 2023-10-05 - Added a new global setting to select the default form theme. On new sites, "Orbital" will be the default theme. - Added a 'theme' parameter to the Gravity Forms shortcode. diff --git a/form_display.php b/form_display.php index 0f61a1f..3218f5f 100644 --- a/form_display.php +++ b/form_display.php @@ -3571,7 +3571,7 @@ public static function get_form_init_scripts( $form ) { "} " . //keep the space. needed to prevent plugins from replacing }} with ]} "} );" . - "jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){"; + "jQuery(document).on('gform_post_conditional_logic', function(event, formId, fields, isInit){"; foreach ( $init_scripts as $init_script ) { if ( $init_script['location'] == self::ON_CONDITIONAL_LOGIC ) { $script_body .= $init_script['script']; diff --git a/gravityforms.php b/gravityforms.php index 857533e..6edd240 100644 --- a/gravityforms.php +++ b/gravityforms.php @@ -3,7 +3,7 @@ Plugin Name: Gravity Forms Plugin URI: https://gravityforms.com Description: Easily create web forms and manage form entries within the WordPress admin. -Version: 2.7.15 +Version: 2.7.16 Requires at least: 4.0 Requires PHP: 5.6 Author: Gravity Forms @@ -245,7 +245,7 @@ class GFForms { * * @var string $version The version number. */ - public static $version = '2.7.15'; + public static $version = '2.7.16'; /** * Handles background upgrade tasks. diff --git a/includes/fields/class-gf-field-checkbox.php b/includes/fields/class-gf-field-checkbox.php index ad20ce4..9bc9715 100644 --- a/includes/fields/class-gf-field-checkbox.php +++ b/includes/fields/class-gf-field-checkbox.php @@ -393,7 +393,6 @@ public function get_value_entry_list( $value, $entry, $field_id, $columns, $form foreach ( $lead_field_keys as $input_id ) { if ( is_numeric( $input_id ) && absint( $input_id ) == $field_id ) { - $items[] = GFCommon::selection_display( rgar( $entry, $input_id ), null, $entry['currency'], false ); $items[] = $this->get_selected_choice_output( rgar( $entry, $input_id ), rgar( $entry, 'currency' ) ); } } diff --git a/includes/form-display/block-styles/block-styles-handler.php b/includes/form-display/block-styles/block-styles-handler.php index a08fe75..559733c 100644 --- a/includes/form-display/block-styles/block-styles-handler.php +++ b/includes/form-display/block-styles/block-styles-handler.php @@ -32,7 +32,7 @@ public function handle() { public function form_css_properties( $form_id, $settings, $block_settings, $form = array() ) { - if ( $form['styles'] === false ) { + if ( rgar( $form, 'styles' ) === false ) { return array(); } diff --git a/includes/libraries/gf-background-process.php b/includes/libraries/gf-background-process.php index e4c688f..a3d4e08 100755 --- a/includes/libraries/gf-background-process.php +++ b/includes/libraries/gf-background-process.php @@ -196,6 +196,7 @@ public function update( $key, $data ) { if ( ! empty( $data ) ) { $old_value = get_site_option( $key ); if ( $old_value ) { + GFCommon::log_debug( sprintf( '%s(): Updating batch %s. Tasks remaining: %d.', __METHOD__, $key, count( $data ) ) ); $data = array( 'blog_id' => get_current_blog_id(), 'data' => $data, @@ -215,6 +216,7 @@ public function update( $key, $data ) { * @return $this */ public function delete( $key ) { + GFCommon::log_debug( sprintf( '%s(): Deleting batch %s.', __METHOD__, $key ) ); delete_site_option( $key ); return $this; @@ -432,15 +434,19 @@ protected function handle() { } } - GFCommon::log_debug( sprintf( '%s(): Processing batch for %s.', __METHOD__, $this->action ) ); + GFCommon::log_debug( sprintf( '%s(): Processing batch %s; Tasks: %d.', __METHOD__, $batch->key, count( $batch->data ) ) ); - foreach ( $batch->data as $key => $value ) { + $task_num = 0; + foreach ( $batch->data as $key => $value ) { + GFCommon::log_debug( sprintf( '%s(): Processing task %d.', __METHOD__, ++$task_num ) ); $task = $this->task( $value ); if ( $task !== false ) { + GFCommon::log_debug( sprintf( '%s(): Keeping task %d in batch.', __METHOD__, $task_num ) ); $batch->data[ $key ] = $task; } else { + GFCommon::log_debug( sprintf( '%s(): Removing task %d from batch.', __METHOD__, $task_num ) ); unset( $batch->data[ $key ] ); } diff --git a/includes/telemetry/class-gf-telemetry-data.php b/includes/telemetry/class-gf-telemetry-data.php index a3f17bd..99bc0cb 100644 --- a/includes/telemetry/class-gf-telemetry-data.php +++ b/includes/telemetry/class-gf-telemetry-data.php @@ -24,6 +24,11 @@ abstract class GF_Telemetry_Data { */ public $key = ''; + /** + * @var string + */ + const TELEMETRY_ENDPOINT = 'https://in.gravity.io/'; + /** * Get the current telemetry data. * @@ -62,7 +67,7 @@ public static function save_data( GF_Telemetry_Data $data ) { $existing_data['events'][] = $data; } - update_option( 'gf_telemetry_data', $existing_data ); + update_option( 'gf_telemetry_data', $existing_data, false ); } /** @@ -82,24 +87,33 @@ public static function take_snapshot() { * * @since 2.8 * - * @param array $data The data to send. - * @param string $endpoint The endpoint to send the data to. + * @param array $entries The data to send. * * @return array|WP_Error */ - public static function send_data( $data, $endpoint = 'telemetry' ) { - - $options = array( - 'headers' => array( - 'referrer' => 'GF_Telemetry', - 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ), - 'User-Agent' => 'WordPress/' . get_bloginfo( 'version' ), - ), - 'method' => 'POST', - 'timeout' => 15, - 'body' => $data, + public static function send_data( $entries ) { + // allow overriding the endpoint to use the local or staging environment for testing purposes. + $endpoint = defined( 'GF_TELEMETRY_ENDPOINT' ) ? GF_TELEMETRY_ENDPOINT : self::TELEMETRY_ENDPOINT; + $site_url = get_site_url(); + $data = array( + 'license_key_md5' => md5( get_option( 'rg_gforms_key', '' ) ), + 'site_url' => $site_url, + 'product' => 'gravityforms', + 'tag' => 'system_report', + 'data' => $entries, ); - return GFCommon::post_to_manager( $endpoint, 'nocache=1', $options ); + return wp_remote_post( + $endpoint . 'api/telemetry_data_bulk', + array( + 'headers' => array( + 'Content-Type' => 'application/json', + 'Authorization' => sha1( $site_url ), + ), + 'method' => 'POST', + 'data_format' => 'body', + 'body' => json_encode( $data ), + ) + ); } } diff --git a/includes/telemetry/class-gf-telemetry-processor.php b/includes/telemetry/class-gf-telemetry-processor.php index 69c2f66..9e4d771 100644 --- a/includes/telemetry/class-gf-telemetry-processor.php +++ b/includes/telemetry/class-gf-telemetry-processor.php @@ -32,43 +32,29 @@ class GF_Telemetry_Processor extends \GF_Background_Process { */ protected function task( $batch ) { - if ( ! isset( $batch['data'] ) ) { - \GFCommon::log_debug( __METHOD__ . sprintf( '(): Batch data is missing. Aborting sending telemetry data.' ) ); - return false; + if ( ! is_array( $batch ) ) { + $batch = array( $batch ); } $raw_response = null; - if ( is_array( $batch['data'] ) ) { - \GFCommon::log_debug( __METHOD__ . sprintf( '(): Processing a batch of %d telemetry events.', count( $batch['data'] ) ) ); - $data = array(); - foreach ( $batch['data'] as $item ) { + \GFCommon::log_debug( __METHOD__ . sprintf( '(): Processing a batch of %d telemetry data.', count( $batch ) ) ); + $data = array(); + foreach ( $batch as $item ) { - if ( ! is_object( $item ) || ! property_exists( $item, 'data' ) ) { - continue; - } - - $data[] = $item->data; - } - $raw_response = GF_Telemetry_Data::send_data( $data ); - } else { - \GFCommon::log_debug( __METHOD__ . sprintf( '(): Processing a batch with snapshot data.' ) ); - - if ( ! is_object( $batch['data'] ) || ! property_exists( $batch['data'], 'data' ) ) { - \GFCommon::log_debug( __METHOD__ . sprintf( '(): Snapshot data is missing. Aborting sending telemetry data.' ) ); - return false; + if ( ! is_object( $item ) || ! property_exists( $item, 'data' ) ) { + continue; } - // snapshot data is sent to a different endpoint. - $raw_response = GF_Telemetry_Data::send_data( $batch['data']->data, 'version.php' ); - } - - if ( ! is_array( $batch['data'] ) ) { - $batch['data'] = array( $batch['data'] ); + // attach type & tag, required by the telemetry API. + $item->data['type'] = $item->key === 'snapshot' ? 'snapshot' : 'event'; + $item->data['tag'] = $item->key; + $data[] = $item->data; } + $raw_response = GF_Telemetry_Data::send_data( $data ); - foreach ( $batch['data'] as $item ) { + foreach ( $batch as $item ) { if ( ! is_object( $item ) ) { - \GFCommon::log_debug( __METHOD__ . sprintf( '(): Snapshot data is missing. Aborting running data_sent method on this entry.' ) ); + \GFCommon::log_debug( __METHOD__ . sprintf( '(): Telemetry data is missing. Aborting running data_sent method on this entry.' ) ); continue; } $classname = get_class( $item ); diff --git a/includes/telemetry/class-gf-telemetry-service-provider.php b/includes/telemetry/class-gf-telemetry-service-provider.php index 06af6ad..cf0cb6a 100644 --- a/includes/telemetry/class-gf-telemetry-service-provider.php +++ b/includes/telemetry/class-gf-telemetry-service-provider.php @@ -45,13 +45,21 @@ public function init( GF_Service_Container $container ) { } /** - * Enqueue telemetry batches to be processed in the background. + * Enqueue batches of telemetry events to be processed in the background. * * @since * * @return void */ public function enqueue_telemetry_batches() { + // Only run once a week. + $last_run = get_option( 'gf_last_telemetry_run', 0 ); + $current_time = time(); + if ( $current_time - $last_run < 60 * 60 * 24 * 7 ) { + return; + } + update_option( 'gf_last_telemetry_run', $current_time ); + \GFCommon::log_debug( __METHOD__ . sprintf( '(): Enqueuing telemetry batches' ) ); GF_Telemetry_Data::take_snapshot(); @@ -62,20 +70,12 @@ public function enqueue_telemetry_batches() { $snapshot = $full_telemetry_data['snapshot']; // Enqueue the snapshot first, alone, to be sent to its own endpoint. - $processor->push_to_queue( - array( - 'data' => $snapshot, - ) - ); + $processor->push_to_queue( $snapshot ); $processor->save()->dispatch(); $full_telemetry_data = array_chunk( $full_telemetry_data['events'], self::BATCH_SIZE, true ); foreach ( $full_telemetry_data as $batch ) { - $processor->push_to_queue( - array( - 'data' => $batch, - ) - ); + $processor->push_to_queue( $batch ); $processor->save()->dispatch(); } @@ -85,7 +85,8 @@ public function enqueue_telemetry_batches() { array( 'snapshot' => $snapshot, 'events' => array(), - ) + ), + false ); } } diff --git a/js/conditional_logic.js b/js/conditional_logic.js index 1afe65e..8136890 100644 --- a/js/conditional_logic.js +++ b/js/conditional_logic.js @@ -438,9 +438,9 @@ function gf_do_action(action, targetId, useAnimation, defaultValues, isInit, cal if(useAnimation && !isInit){ if($target.length > 0){ - $target.find(':input:hidden:not(.gf-default-disabled)').removeAttr( 'disabled' ); + $target.find(':input:hidden:not(.gf-default-disabled)').prop( 'disabled', false ); if ( $target.is( 'input[type="submit"]' ) || $target.hasClass( 'gform_next_button' ) ) { - $target.removeAttr( 'disabled' ).css( 'display', '' ); + $target.prop( 'disabled', false ).css( 'display', '' ); $target.attr( 'data-conditional-logic', 'hidden' ); if ( '1' == gf_legacy.is_legacy ) { // for legacy markup, remove screen reader class. @@ -460,11 +460,11 @@ function gf_do_action(action, targetId, useAnimation, defaultValues, isInit, cal if ( display == '' || display == 'none' ){ display = '1' === gf_legacy.is_legacy ? 'list-item' : 'block'; } - $target.find(':input:hidden:not(.gf-default-disabled)').removeAttr( 'disabled' ).attr( 'data-conditional-logic', 'visible' ); + $target.find(':input:hidden:not(.gf-default-disabled)').prop( 'disabled', false ).attr( 'data-conditional-logic', 'visible' ); // Handle conditional submit and next buttons. if ( $target.is( 'input[type="submit"]' ) || $target.hasClass( 'gform_next_button' ) ) { - $target.removeAttr( 'disabled' ).css( 'display', '' ); + $target.prop( 'disabled', false ).css( 'display', '' ); $target.attr( 'data-conditional-logic', 'visible' ); if ( '1' == gf_legacy.is_legacy ) { // for legacy markup, remove screen reader class. @@ -614,7 +614,7 @@ function gf_reset_to_default(targetId, defaultValue){ if(radio_button_name == "gf_other_choice"){ val = element.attr("value"); } - else if( jQuery.isArray( defaultValue ) && ! element.is( 'select[multiple]' ) ) { + else if( Array.isArray( defaultValue ) && ! element.is( 'select[multiple]' ) ) { val = defaultValue[target_index]; } else if(jQuery.isPlainObject(defaultValue)){ diff --git a/js/conditional_logic.min.js b/js/conditional_logic.min.js index 5438402..8e9b2b5 100644 --- a/js/conditional_logic.min.js +++ b/js/conditional_logic.min.js @@ -1 +1 @@ -var __gf_timeout_handle;function gf_apply_rules(t,e,i){jQuery(document).trigger("gform_pre_conditional_logic",[t,e,i]),gform.utils.trigger({event:"gform/conditionalLogic/applyRules/start",native:!1,data:{formId:t,fields:e,isInit:i}});for(var a=0;a=e.length-1&&(jQuery(document).trigger("gform_post_conditional_logic",[t,e,i]),gform.utils.trigger({event:"gform/conditionalLogic/applyRules/end",native:!1,data:{formId:t,fields:e,isInit:i}}),window.gformCalculateTotalPrice)&&window.gformCalculateTotalPrice(t)})}function gf_check_field_rule(t,e,i,a){var n,e=gf_get_field_logic(t,e);return e?"hide"!=(n=gf_get_field_action(t,e.section))?gf_get_field_action(t,e.field):n:"show"}function gf_get_field_logic(t,e){var i=rgars(window,"gf_form_conditional_logic/"+t);if(i){t=rgars(i,"logic/"+e);if(t)return t;var a=rgar(i,"dependents");if(a)for(var n in a)if(-1!==a[n].indexOf(e))return rgars(i,"logic/"+n)}return!1}function gf_apply_field_rule(t,e,i,a){gf_do_field_action(t,gf_check_field_rule(t,e,i,a),e,i,a);a=window.gf_form_conditional_logic[t].logic[e];a.nextButton&&gf_do_next_button_action(t,gf_get_field_action(t,a.nextButton),e,i)}function gf_get_field_action(t,e){if(!e)return"show";for(var i=0,a=0;a"]),a=-1!==jQuery.inArray(n.operator,["contains","starts_with","ends_with"]);if(e==n.value||i||a)return t.is(":checked")?"gf_other_choice"==e&&(e=jQuery("#input_{0}_{1}_other".gformFormat(r,o)).val()):e="",gf_matches_operation(e,n.value,n.operator)?!(l=!0):void 0}),l)}function gf_is_checkable_empty(t){var e=!0;return t.each(function(){jQuery(this).is(":checked")&&(e=!1)}),e}function gf_is_match_default(t,e,i,a){for(var t=t.val(),n=t instanceof Array?t:[t],r=0,o=Math.max(n.length,1),l=0;l":return t=gf_try_convert_float(t),e=gf_try_convert_float(e),!(!gformIsNumber(t)||!gformIsNumber(e))&&e=e.length-1&&(jQuery(document).trigger("gform_post_conditional_logic",[t,e,i]),gform.utils.trigger({event:"gform/conditionalLogic/applyRules/end",native:!1,data:{formId:t,fields:e,isInit:i}}),window.gformCalculateTotalPrice)&&window.gformCalculateTotalPrice(t)})}function gf_check_field_rule(t,e,i,a){var n,e=gf_get_field_logic(t,e);return e?"hide"!=(n=gf_get_field_action(t,e.section))?gf_get_field_action(t,e.field):n:"show"}function gf_get_field_logic(t,e){var i=rgars(window,"gf_form_conditional_logic/"+t);if(i){t=rgars(i,"logic/"+e);if(t)return t;var a=rgar(i,"dependents");if(a)for(var n in a)if(-1!==a[n].indexOf(e))return rgars(i,"logic/"+n)}return!1}function gf_apply_field_rule(t,e,i,a){gf_do_field_action(t,gf_check_field_rule(t,e,i,a),e,i,a);a=window.gf_form_conditional_logic[t].logic[e];a.nextButton&&gf_do_next_button_action(t,gf_get_field_action(t,a.nextButton),e,i)}function gf_get_field_action(t,e){if(!e)return"show";for(var i=0,a=0;a"]),a=-1!==jQuery.inArray(n.operator,["contains","starts_with","ends_with"]);if(e==n.value||i||a)return t.is(":checked")?"gf_other_choice"==e&&(e=jQuery("#input_{0}_{1}_other".gformFormat(r,o)).val()):e="",gf_matches_operation(e,n.value,n.operator)?!(l=!0):void 0}),l)}function gf_is_checkable_empty(t){var e=!0;return t.each(function(){jQuery(this).is(":checked")&&(e=!1)}),e}function gf_is_match_default(t,e,i,a){for(var t=t.val(),n=t instanceof Array?t:[t],r=0,o=Math.max(n.length,1),l=0;l":return t=gf_try_convert_float(t),e=gf_try_convert_float(e),!(!gformIsNumber(t)||!gformIsNumber(e))&&e input").on("keyup change click paste",function(e){FieldSearch(this),addClearButton(this)}),jQuery(".search-button > input").on("keyup paste",function(e){jQuery(".sidebar").tabs({active:0})}),jQuery(".clear-button").on("click",function(e){clearInput(this)}),jQuery(".gf-topmenu-dynamic").on("click",function(e){var t=jQuery(this).position(),t=(jQuery(".gf-popover").css("left",t.left+jQuery(this).width()/2+6+"px"),jQuery(".gf-popover").css("display"));jQuery(".gf-popover").css("display","block"===t?"none":"block")}),jQuery(".gf-popover__button").on("click",function(){var e=jQuery(this).data("url");""!==e&&(window.location.href=e)}),jQuery(document).on("click",function(e){var t=jQuery(".gf-topmenu-dynamic");t.is(e.target)||0!==t.has(e.target).length||jQuery(".gf-popover").hide()}),jQuery(".add-buttons button").each(function(){var e=jQuery(this),t=e.attr("data-type"),i=e.attr("onclick");void 0===t&&i&&-1")}),ResetFieldAccordions(),jQuery(".panel-block > .field_settings").on("keydown",function(e){var t,i;27===e.keyCode?jQuery(".gfield.field_selected .gfield-edit").focus():9===e.keyCode&&(t=(i=gform.tools.getFocusable(this))[0],i=i[i.length-1],e.shiftKey?document.activeElement===t&&(i.focus(),e.preventDefault()):document.activeElement===i&&(t.focus(),e.preventDefault()))}),jQuery("#field_submit #gform_ppcp_smart_payment_buttons").remove()}function InitializeFieldSettings(){gform.addFilter("gform_editor_field_settings","hideDefaultMarginOnTopLabelAlignment"),jQuery("#field_max_file_size").on("input propertychange",function(){var e=jQuery(this),e=parseInt(e.val());SetFieldProperty("maxFileSize",e||"")}).on("change",function(){var e=GetSelectedField(),e=e.maxFileSize||"";this.value=""===e?"":e+"MB"}),jQuery(document).on("input propertychange",".field_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(document).on("input propertychange",".field_placeholder, .field_placeholder_textarea",function(){SetFieldPlaceholder(this.value),""===GetSelectedField().label&&(setFieldError("label_setting","below"),""!==this.value)&&resetFieldError("label_setting")}),jQuery("#field_choices").on("change",".field-choice-price",function(){var e=GetSelectedField(),t=jQuery(this).parent("li").index(),e=e.choices[t].price;this.value=e}),jQuery(".field_input_choices").on("input propertychange","input",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress","input:radio, input:checkbox",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress",".field-input-insert-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");InsertInputChoice(t,e.data("input_id"),i+1)}).on("click keypress",".field-input-delete-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");DeleteInputChoice(t,e.data("input_id"),i)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var e=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(e,this.checked),SetInputChoices(e.find("ul"))}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var e=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,e)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var e,t=GetSelectedField();this.checked?(e=!0,HasConditionalLogicDependency(t.id,t.value)&&!confirm(gf_vars.conditionalLogicRichTextEditorWarning)&&(jQuery("#field_rich_text_editor").prop("checked",!1),e=!1),e&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none"))}),jQuery(".prepopulate_field_setting").on("input propertychange",".field_input_name",function(){var e=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,e)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("change",".gform-field__toggle-input",function(){var e=jQuery(this).closest(".gform-field__toggle").data("input_id");ToggleInputHidden(jQuery(this),e)}).on("click","#field_password_fields_container .gform-field__toggle",function(){var e=jQuery(this).data("input_id"),t=jQuery(this).find(".gform-field__toggle-input");t[0].focus(),t[0].checked=!t[0].checked,ToggleInputHidden(t,e)}).on("input propertychange",".field_custom_input_default_label",function(){var e=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,e)}).on("input propertychange",".field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var e=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,e)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(e){var t=jQuery(this),i=t.closest("li.field-choice-row");SetFieldChoice(i.data("input_type"),i.data("index")),(t.hasClass("field-choice-text")||t.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),e.stopPropagation())}),jQuery("#field_enable_copy_values_option").on("click keypress",function(){SetCopyValuesOptionProperties(this.checked),ToggleCopyValuesOption(!1),0==this.checked&&ToggleCopyValuesActivated(!1)}),jQuery("#field_copy_values_option_label").on("input propertychange",function(){SetCopyValuesOptionLabel(this.value)}),jQuery("#field_copy_values_option_field").on("change",function(){SetFieldProperty("copyValuesOptionField",jQuery(this).val())}),jQuery("#field_copy_values_option_default").on("change",function(){SetFieldProperty("copyValuesOptionDefault",1==this.checked?1:0),ToggleCopyValuesActivated(this.checked)}),jQuery("#field_label").on("input propertychange",function(){SetFieldLabel(this.value),SetAriaLabel(this.value),""!==this.value&&(resetFieldError("label_setting"),ResetFieldAccessibilityWarning("label_setting"))}).on("blur",function(){""===this.value&&setFieldError("label_setting","below")}),jQuery("#submit_text").on("input propertychange",function(){jQuery("#gform_submit_button_"+form.id).val(this.value)}),jQuery("#submit_image").on("input propertychange",function(){ToggleSubmitType(!1)}),jQuery("#field_description").on("blur",function(){var e=GetSelectedField();e.description!=this.value&&(SetFieldDescription(this.value),RefreshSelectedFieldPreview()),""===e.label&&(setFieldError("label_setting","below"),""!==this.value)&&resetFieldError("label_setting")}),jQuery('input[ name="field_visibility" ]').on("DOMSubTreeModified change",function(){var e=GetSelectedField(),t=(SetFieldProperty("visibility",this.value),'
Hidden
');"hidden"===e.visibility?(jQuery("#field_"+e.id).addClass("admin-hidden"),jQuery("#field_"+e.id+" .gfield_label").before(t),jQuery("#field_"+e.id+" .gsection_title").before(t)):(jQuery("#field_"+e.id).removeClass("admin-hidden"),jQuery("#field_"+e.id+" .admin-hidden-markup").remove())}),jQuery("#field_checkbox_label").on("input propertychange",function(){GetSelectedField().checkboxLabel!=this.value&&(SetFieldCheckboxLabel(this.value),RefreshSelectedFieldPreview())}),jQuery("#field_content").on("input propertychange",function(){SetFieldProperty("content",this.value)}),jQuery("#next_button_text_input, #next_button_image_url").on("input propertychange",function(){SetPageButton("next")}),jQuery("#previous_button_image_url, #previous_button_text_input").on("input propertychange",function(){SetPageButton("previous")}),jQuery("#field_custom_field_name_text").on("input propertychange",function(){SetFieldProperty("postCustomFieldName",this.value)}),jQuery("#field_customfield_content_template").on("input propertychange",function(){SetCustomFieldTemplate()}),jQuery("#gfield_calendar_icon_url").on("input propertychange",function(){SetFieldProperty("calendarIconUrl",this.value)}),jQuery("#field_max_files").on("input propertychange",function(){SetFieldProperty("maxFiles",this.value)}),jQuery("#field_maxrows").on("input propertychange",function(){SetFieldProperty("maxRows",this.value)}),jQuery("#field_mask_text").on("input propertychange",function(){SetFieldProperty("inputMaskValue",this.value)}),jQuery("#field_file_extension").on("input propertychange",function(){SetFieldProperty("allowedExtensions",this.value)}),jQuery("#field_maxlen").on("keypress",function(e){return ValidateKeyPress(e,GetMaxLengthPattern(),!1)}).on("change keyup",function(){SetMaxLength(this)}),jQuery("#field_range_min").on("input propertychange",function(){SetFieldProperty("rangeMin",this.value)}),jQuery("#field_range_max").on("input propertychange",function(){SetFieldProperty("rangeMax",this.value)}),jQuery("#field_calculation_formula").on("input propertychange",function(){SetFieldProperty("calculationFormula",this.value.trim())}),jQuery("#field_error_message").on("input propertychange",function(){SetFieldProperty("errorMessage",this.value)}),jQuery("#field_css_class").on("focus",function(){jQuery(this).data("previousClass",this.value)}).on("change",function(){SetFieldProperty("cssClass",this.value),previousClass=jQuery(this).data("previousClass"),jQuery("#field_"+field.id).removeClass(previousClass).addClass(this.value),CheckDeprecatedReadyClass(field)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",this.value)}),jQuery(".autocomplete_setting").on("input propertychange",".input_autocomplete",function(){var e=jQuery(this).closest(".input_autocomplete_row").data("input_id");SetInputAutocomplete(this.value,e)}).on("input propertychange","#field_autocomplete_attribute",function(){SetFieldProperty("autocompleteAttribute",this.value)}),jQuery("#field_add_icon_url").on("input propertychange",function(){SetFieldProperty("addIconUrl",this.value)}),jQuery("#field_delete_icon_url").on("input propertychange",function(){SetFieldProperty("deleteIconUrl",this.value)})}function hideDefaultMarginOnTopLabelAlignment(e,t){if("top_label"===form.labelPlacement)for(var i in e)if(".disable_margins_setting"===e[i]){e.splice(i,1);break}return e}function InitializeForm(e){jQuery("#submit_text").val(e.button.text),jQuery("#submit_image").val(e.button.imageUrl),(e.button.width?jQuery("#submit_width_"+e.button.width):jQuery("#submit_width_auto")).prop("checked",!0),(e.button.location?jQuery("#submit_location_"+e.button.location):jQuery("#submit_location_bottom")).prop("checked",!0),(e.button.type?jQuery("#submit_type_"+e.button.type):jQuery("#submit_type_")).prop("checked",!0),e.lastPageButton&&"image"===e.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):e.lastPageButton&&"image"===e.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(e.lastPageButton?e.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(e.lastPageButton?e.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),e.postStatus&&jQuery("#field_post_status").val(e.postStatus),e.postAuthor&&jQuery("#field_post_author").val(e.postAuthor),void 0===e.useCurrentUserAsAuthor&&(e.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!e.useCurrentUserAsAuthor),e.postCategory&&jQuery("#field_post_category").val(e.postCategory),e.postFormat&&jQuery("#field_post_format").val(e.postFormat),e.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(e.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),e.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(e.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_pagination, #gform_last_page_settings").on("click",function(e){FieldClick(this),e.stopPropagation()}),jQuery("#gform_fields").on("click",".gfield",function(e){FieldClick(this),e.stopPropagation()});var t=e.pagination&&e.pagination.type?e.pagination.type:"percentage",i="percentage"===t,l="none"===t;"steps"===t?jQuery("#pagination_type_steps").prop("checked",!0):i?jQuery("#pagination_type_percentage").prop("checked",!0):l&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(e.firstPageCssClass),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var e=GetInputType(field),t=(resetAllFieldAccessibilityWarnings(),resetAllFieldErrors(),resetAllFieldNotices(),resetDeprecatedReadyClassNotice(),jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".tooltip_form_field_label").hide(),jQuery(".tooltip_form_field_label_html").show()):(jQuery(".tooltip_form_field_label").show(),jQuery(".tooltip_form_field_label_html").hide()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(null==field.content?"":field.content),jQuery("#post_custom_field_type").val(field.inputType),jQuery("#post_tag_type").val(field.inputType),jQuery("#field_size").val(field.size),jQuery("#field_required").prop("checked",1==field.isRequired),jQuery("#field_margins").prop("checked",1==field.disableMargins),jQuery("#field_no_duplicates").prop("checked",1==field.noDuplicates),jQuery("#field_default_value").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_autocomplete_attribute").val(field.autocompleteAttribute),jQuery("#field_description").val(null==field.description?"":field.description),jQuery("#field_description").attr("placeholder",null==field.descriptionPlaceholder?"":field.descriptionPlaceholder),jQuery("#field_checkbox_label").val(null==field.checkboxLabel?"":field.checkboxLabel),jQuery("#field_css_class").val(null==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(null==field.rangeMin||!1===field.rangeMin?"":field.rangeMin),jQuery("#field_range_max").val(null==field.rangeMax||!1===field.rangeMax?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),""!==field.cssClass&&CheckDeprecatedReadyClass(field),field.useRichTextEditor?(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block")):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")),void 0===field.labelPlacement&&(field.labelPlacement=""),void 0===field.descriptionPlacement&&(field.descriptionPlacement=""),void 0===field.subLabelPlacement&&(field.subLabelPlacement=""),jQuery("#field_label_placement").val(field.labelPlacement),jQuery("#field_description_placement").val(field.descriptionPlacement),jQuery("#field_sub_label_placement").val(field.subLabelPlacement),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?jQuery("#field_description_placement_container").hide():jQuery("#field_description_placement_container").show(),SetFieldVisibility(field.visibility,!0),void 0===field.placeholder&&(field.placeholder=""),jQuery("#field_placeholder, #field_placeholder_textarea").val(field.placeholder),jQuery("#field_file_extension").val(null==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles||""),jQuery("#field_max_file_size").val(field.maxFileSize?field.maxFileSize+"MB":""),ToggleMultiFile(!0),jQuery("#field_phone_format").val(field.phoneFormat),jQuery("#field_error_message").val(field.errorMessage),jQuery("#field_select_all_choices").prop("checked",!!field.enableSelectAll),jQuery("#field_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl||""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl||""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_password_visibility_enabled").prop("checked",1==field.passwordVisibilityEnabled),TogglePasswordVisibility(!0),jQuery("#gfield_min_strength").val(null==field.minPasswordStrength?"":field.minPasswordStrength),TogglePasswordStrength(!0),jQuery("#gfield_email_confirm_enabled").prop("checked",1==field.emailConfirmEnabled),field.numberFormat?jQuery("#field_number_format_blank").remove():0==jQuery("#field_number_format #field_number_format_blank").length&&jQuery("#field_number_format").prepend(""),jQuery("#field_number_format").val(field.numberFormat||""),"product"==field.type&&"calculation"==field.inputType?(field.enableCalculation=!0,jQuery(".field_calculation_rounding").hide(),jQuery(".field_enable_calculation").hide()):(jQuery(".field_enable_calculation").show(),"number"==field.type&&"currency"==field.numberFormat?jQuery(".field_calculation_rounding").hide():jQuery(".field_calculation_rounding").show()),jQuery("#field_enable_calculation").prop("checked",!!field.enableCalculation),ToggleCalculationOptions(field.enableCalculation,field),jQuery("#field_calculation_formula").val(field.calculationFormula),gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding"),t=(jQuery("#field_calculation_rounding").val(t),jQuery("#option_field_type").val(field.inputType),jQuery("#product_field_type")),t=(t.val(field.inputType),has_entry(field.id)?t.prop("disabled",!0):t.prop("disabled",!1),jQuery("#donation_field_type").val(field.inputType),jQuery("#quantity_field_type").val(field.inputType),"hiddenproduct"!=field.inputType&&"singleproduct"!=field.inputType&&"singleshipping"!=field.inputType&&"calculation"!=field.inputType||(t=null==field.basePrice?"":field.basePrice,jQuery("#field_base_price").val(null==field.basePrice?"":field.basePrice),SetBasePrice(t)),jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity),!!field.enablePasswordInput),t=(jQuery("#field_password").prop("checked",t),jQuery("#field_maxlen").val(void 0===field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val(void 0===field.maxRows?"":field.maxRows),null==field.addressType?"international":field.addressType),i=(jQuery("#field_address_type").val(t),null==(field="consent"===(field="email"!=(field="address"==field.type?UpgradeAddressField(field):field).type&&"email"!=field.inputType?field:UpgradeEmailField(field)).type?UpgradeConsentField(field):field).defaultState?"":field.defaultState),l=null==field.defaultProvince?"":field.defaultProvince,l="canadian"==t&&""==i?l:i,i=(jQuery("#field_address_default_state_"+t).val(l),jQuery("#field_address_default_country_"+t).val(null==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),jQuery("#gfield_display_alt").prop("checked",1==field.displayAlt),jQuery("#gfield_display_title").prop("checked",1==field.displayTitle),jQuery("#gfield_display_caption").prop("checked",1==field.displayCaption),jQuery("#gfield_display_description").prop("checked",1==field.displayDescription),CustomFieldExists(field.postCustomFieldName)),l=(jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),(i?jQuery("#field_custom_field_name_select"):jQuery("#field_custom_field_name_text")).val(field.postCustomFieldName),(i?jQuery("#field_custom_existing"):jQuery("#field_custom_new")).prop("checked",!0),ToggleCustomField(!0),jQuery("#gfield_customfield_content_enabled").prop("checked",!!field.customFieldTemplateEnabled),jQuery("#field_customfield_content_template").val(field.customFieldTemplateEnabled?field.customFieldTemplate:""),ToggleCustomFieldTemplate(!0),(field.displayAllCategories?jQuery("#gfield_category_all"):jQuery("#gfield_category_select")).prop("checked",!0),ToggleCategory(!0),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!!field.categoryInitialItemEnabled),jQuery("#field_post_category_initial_item").val(field.categoryInitialItemEnabled?field.categoryInitialItem:""),TogglePostCategoryInitialItem(!0),!!field.postFeaturedImage),t=(jQuery("#gfield_featured_image").prop("checked",l),"boolean"!=typeof field.inputMaskIsCustom&&(field.inputMaskIsCustom=!IsStandardMask(field.inputMaskValue)),!field.inputMaskIsCustom);if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),(t?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select")):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text"))).val(field.inputMaskValue),ToggleInputMask(!0),ToggleInputMaskOptions(!0),InitAutocompleteOptions(!0),"creditcard"==e)for(d in(!(field=UpgradeCreditCardField(field)).creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]),field.creditCards)field.creditCards.hasOwnProperty(d)&&jQuery("#field_credit_card_"+field.creditCards[d]).prop("checked",!0);"date"==e&&(field=UpgradeDateField(field)),"time"==e&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=e||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(null==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val(null==field.dateFormat?"mdy":field.dateFormat),jQuery("#field_time_format").val("24"==field.timeFormat?"24":"12"),SetCalendarIconType(field.calendarIconType,!0),ToggleDateCalendar(!0),LoadDateInputs(),LoadTimeInputs(),field.allowsPrepopulate=!!field.allowsPrepopulate,field.useRichTextEditor=!!field.useRichTextEditor,jQuery("#field_prepopulate").prop("checked",!!field.allowsPrepopulate),jQuery("#field_rich_text_editor").prop("checked",!!field.useRichTextEditor),has_entry(field.id)?jQuery("#field_rich_text_editor").prop("disabled",!0):jQuery("#field_rich_text_editor").prop("disabled",!1),CreateInputNames(field),ToggleInputName(!0);i=0'+i.data("multiselect")+""),i.val("multiselect"),i.data("multiselect",null)),l="post_tags"===field.type?"post_tag_type_setting":"post_category_field_type_setting",SetFieldAccessibilityWarning(l,"below"))),"quantity"==field.type&&jQuery(".calculation_setting").hide(),jQuery("#post_category_field_type").val(field.inputType);t=null==field.simpleCaptchaFontColor?"":field.simpleCaptchaFontColor,jQuery("#field_captcha_fg").val(t),SetColorPickerColor("field_captcha_fg",t),i=null==field.simpleCaptchaBackgroundColor?"":field.simpleCaptchaBackgroundColor;jQuery("#field_captcha_bg").val(i),SetColorPickerColor("field_captcha_bg",i),jQuery("#field_captcha_type").val(null==field.captchaType?"captcha":field.captchaType),jQuery("#field_captcha_badge").val(null==field.captchaBadge?"bottomright":field.captchaBadge),jQuery("#field_captcha_size").val(null==field.simpleCaptchaSize?"medium":field.simpleCaptchaSize),"captcha"==field.type&&(SetFieldAccessibilityWarning("captcha","above"),l=".captcha_language_setting, .captcha_theme_setting",t=".captcha_size_setting, .captcha_fg_setting, .captcha_bg_setting","simple_captcha"==field.captchaType||"math"==field.captchaType?(jQuery(t).show(),jQuery(l).hide()):(jQuery(t).hide(),jQuery(l).show()),i=null==field.captchaTheme||["blackglass","dark"].indexOf(field.captchaTheme)<0?"light":"dark",jQuery("#field_captcha_theme").val(i).show(),t=null==field.captchaLanguage?"en":field.captchaLanguage,jQuery("#field_captcha_language").val(t).show(),jQuery('#field_captcha_type option[value="captcha"]').length<1)&&jQuery("#field_captcha_type").prepend(''),"post_custom_field"!=field.type||"textarea"!=field.inputType&&"text"!=field.inputType||jQuery(".customfield_content_template_setting").show(),"name"==field.type&&(void 0===field.nameFormat||"advanced"!=field.nameFormat?field=MaybeUpgradeNameField(field):SetUpAdvancedNameField(),"simple"==field.nameFormat?(jQuery(".default_value_setting").show(),jQuery(".size_setting").show(),jQuery("#field_name_fields_container").html("").hide(),jQuery(".sub_label_placement_setting").hide(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".default_value_setting").show()):"extended"==field.nameFormat&&(jQuery(".name_format_setting").show(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".input_placeholders_setting").hide())),-1!=jQuery.inArray(field.type,["product","option","shipping"])&&jQuery(".other_choice_setting").hide(),field.enableCalculation&&jQuery("li.range_setting").hide(),"text"==field.type&&(field.inputMask?jQuery(".maxlen_setting").hide():jQuery(".maxlen_setting").show()),"date"==e&&ToggleDateSettings(field),"email"==e&&ToggleEmailSettings(field),"password"!==field.type&&"password"!==field.inputType||(field=UpgradePasswordField(field),l=GetCustomizeInputsUI(field),jQuery("#field_password_fields_container").html(l),jQuery("#field_password_fields_container table tr:eq(1) td:eq(0) div").remove(),"undefined"!=field.inputs[1].isHidden&&field.inputs[1].isHidden||jQuery(".size_setting").hide(),jQuery(".password_setting .custom_inputs_setting ").on("click keypress",".gform-field__toggle",function(){var e=GetSelectedField(),t=!e.inputs[1].isHidden,e=jQuery('label[for="input_'+e.id+'"]');t?(e.show(),jQuery(".size_setting").hide()):(e.hide(),jQuery(".size_setting").show())})),"multiselect"!==field.type&&"select"!==field.type||!field.enableEnhancedUI||SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"),"multiselect"===field.type&&SetFieldAccessibilityWarning("multiselect","above"),"hidden_label"===field.labelPlacement&&SetFieldAccessibilityWarning("label_placement_setting","above"),""===field.label&&setFieldError("label_setting","below"),"datepicker"===field.dateType&&SetFieldAccessibilityWarning("date_input_type_setting","above"),"submit"===field.type&&(HasPageField()&&SetFieldNotification("submit_location_setting","above"),"image"===form.button.type)&&(SetFieldAccessibilityWarning("submit_type_setting","below"),form.button.imageUrl||SetFieldNotification("submit_image_setting","below")),ToggleSubmitType(!0),jQuery(document).trigger("gform_load_field_settings",[field,form]),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field),Placeholders.enable()}function getAllFieldSettings(e){var t=fieldSettings[e.type],i=(e.inputType&&"post_category"!=e.type&&0<(i=fieldSettings[e.inputType]).length&&(t+=", "+i),t.split(", "));return(i=gform.applyFilters("gform_editor_field_settings",i,e)).join(", ")}function ToggleDateSettings(e){var t="datefield"==e.dateType,i="datepicker"==e.dateType,e="datedropdown"==e.dateType;jQuery(".placeholder_setting").toggle(i),jQuery(".default_value_setting").toggle(i),jQuery(".sub_label_placement_setting").toggle(t),jQuery(".sub_labels_setting").toggle(t),jQuery(".default_input_values_setting").toggle(e||t),jQuery(".input_placeholders_setting").toggle(e||t)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var e=GetCustomizeInputsUI(field),e=(jQuery("#field_name_fields_container").html(e).show(),GetInput(field,field.id+".2")),t=GetInputChoices(e);jQuery("#field_prefix_choices").html(t),ToggleNamePrefixUI(!e.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".gform-field__toggle",function(){0<=jQuery(this).data("input_id").toString().indexOf(".2")&&ToggleNamePrefixUI(jQuery(this).find(".gform-field__toggle-input").is(":checked"))}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(e,t){for(var i,l,d,r=[],o=GetInputType(t),a=0;a"+i+"",r.push(l));return r.join("")}function ToggleNamePrefixUI(e){jQuery(".name_prefix_choices_setting").toggle(e)}function TogglePageBreakSettings(){HasPageBreak()?(jQuery("#gform_last_page_settings").show(),jQuery("#gform_pagination").show()):(jQuery("#gform_last_page_settings").hide(),jQuery("#gform_pagination").hide())}function SetDisableQuantity(e){SetFieldProperty("disableQuantity",e),e?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(e){e=e||0;e=GetCurrentCurrency().toMoney(e);0==e&&(e=0),jQuery("#field_base_price").val(e),SetFieldProperty("basePrice",e),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(e),jQuery(".field_selected .ginput_amount").val(e)}function ChangeAddressType(){var e,t;"address"==(field=GetSelectedField()).type&&(t=jQuery("#field_address_type").val(),e=GetInput(field,field.id+".6"),t=jQuery("#field_address_country_"+t).val(),e.isHidden=""!=t,SetAddressType(!1))}function SetAddressType(e){"address"==(field=GetSelectedField()).type&&(SetAddressProperties(),jQuery(".gfield_address_type_container").hide(),jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(),CreatePlaceholdersUI(field),CreateAutocompleteUI(field))}function UpdateAddressFields(){var e=jQuery("#field_address_type").val(),t=(field=GetSelectedField(),GetCustomizeInputsUI(field)),t=(jQuery("#field_address_fields_container").html(t),GetInput(field,field.id+".5")),i=jQuery("#field_address_zip_label_"+e).val(),t=(jQuery("#field_custom_input_default_label_"+field.id+"_5").text(i),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",i),t.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(i),GetInput(field,field.id+".4")),i=jQuery("#field_address_state_label_"+e).val(),t=(jQuery("#field_custom_input_default_label_"+field.id+"_4").text(i),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",i),t.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(i),""==jQuery("#field_address_country_"+e).val()),i=!t,t=!t||!jQuery('#field_address_fields_container [id="gforms-editor-toggle-'+field.id+'.6"').is(":checked");i?jQuery(".field_custom_input_row_input_"+field.id+"_6").hide():jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show(),t?jQuery(".field_selected #input_"+field.id+"_6_container").hide():(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+e).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show()),(""!=jQuery("#field_address_has_states_"+e).val()?(jQuery(".field_selected .state_text").hide(),i=jQuery("#field_address_default_state_"+e).val(),(t=jQuery(".field_selected .state_dropdown")).append(jQuery("").val(i).html(i)),t.val(i)):(jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text"))).show()}function SetAddressProperties(){field=GetSelectedField();var e=jQuery("#field_address_type").val(),t=(SetFieldProperty("addressType",e),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+e).val()),SetFieldProperty("defaultProvince",""),jQuery("#field_address_country_"+e).val());SetFieldProperty("defaultCountry",t=""==t?jQuery("#field_address_default_country_"+e).val():t),UpdateAddressFields()}function MaybeUpgradeNameField(e){return e=void 0!==e.nameFormat&&""!=e.nameFormat&&"normal"!=e.nameFormat&&("simple"!=e.nameFormat||has_entry(e.id))?e:UpgradeNameField(e,!0,!0,!0)}function UpgradeNameField(e,t,i,l){return e.nameFormat="advanced",e.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(e,t,i,l),e.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),e}function UpgradeDateField(e){return"date"!=e.type&&"date"!=e.inputType||void 0===e.dateType||"datepicker"==e.dateType||e.inputs||(e.inputs=GetDateFieldInputs(e)),e}function UpgradeTimeField(e){return"time"!=e.type&&"time"!=e.inputType||e.inputs||(e.inputs=GetTimeFieldInputs(e)),e}function UpgradeEmailField(e){return"email"!=e.type&&"email"!=e.inputType||e.emailConfirmEnabled&&!e.inputs&&(e.inputs=GetEmailFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradePasswordField(e){return"password"!=e.type&&"password"!=e.inputType||e.inputs||(e.inputs=GetPasswordFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradeAddressField(e){return e.hideCountry&&(GetInput(e,e.id+".6").isHidden=!0),delete e.hideCountry,e.hideAddress2&&(GetInput(e,e.id+".2").isHidden=!0),delete e.hideAddress2,e.hideState&&(GetInput(e,e.id+".4").isHidden=!0),delete e.hideState,e}function UpgradeConsentField(e){return"consent"===e.type&&e.choices[1]&&"0"===e.choices[1].value&&e.choices.pop(),e}function TogglePasswordVisibility(e){jQuery("#gfield_password_visibility_enabled").is(":checked")?jQuery(".gfield.field_selected .ginput_container_password span button").show():jQuery(".gfield.field_selected .ginput_container_password span button").hide()}function TogglePasswordStrength(e){jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show():jQuery("#gfield_min_strength_container").hide()}function ToggleCategory(e){jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(e){SetFieldProperty("copyValuesOptionLabel",e),jQuery(".field_selected .copy_values_option_label").html(e)}function SetCustomFieldTemplate(){var e=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",e?jQuery("#field_customfield_content_template").val():null),SetFieldProperty("customFieldTemplateEnabled",e)}function SetCategoryInitialItem(){var e=jQuery("#gfield_post_category_initial_item_enabled").is(":checked");SetFieldProperty("categoryInitialItem",e?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",e)}function PopulateContentTemplate(e){var t;0==jQuery("#"+e).val().length&&(t=GetSelectedField(),jQuery("#"+e).val("{"+t.label+":"+t.id+"}"))}function TogglePostContentTemplate(e){jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(),e||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide()}function TogglePostTitleTemplate(e){jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(),e||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide()}function ToggleCustomFieldTemplate(e){jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(),e||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide()}function ToggleInputName(e){jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show():(jQuery("#field_input_name_container").hide(),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(e){var t=GetSelectedField(),i=t.enablePrice?"_and_price":"",l=jQuery("#gfield_settings_choices_container");l.removeClass("choice_with_price choice_with_value choice_with_value_and_price"),jQuery("#field_choice_values_enabled").is(":checked")?l.addClass("choice_with_value"+i):t.enablePrice&&l.addClass("choice_with_price")}function ToggleInputChoiceValue(e,t){void 0===t&&(t=!1);var i=GetSelectedField(),l=e.find("li").data("input_id");GetInput(i,l).enableChoiceValue=t,e.removeClass("choice_with_value"),t&&e.addClass("choice_with_value")}function ToggleCopyValuesActivated(e){jQuery(".field_selected .copy_values_activated").prop("checked",e);var t=GetSelectedField();jQuery("#input_"+t.id).toggle(!e)}function TogglePageButton(e,t){var i=jQuery("#"+e+"_button_text").is(":checked");show_element=i?"#"+e+"_button_text_container":"#"+e+"_button_image_container",hide_element=i?"#"+e+"_button_image_container":"#"+e+"_button_text_container",t?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(e){field=GetSelectedField();var t=jQuery("#"+e+"_button_image").is(":checked")?"image":"text";"image"==(field[e+"Button"].type=t)?(field[e+"Button"].text="",field[e+"Button"].imageUrl=jQuery("#"+e+"_button_image_url").val()):(field[e+"Button"].text=jQuery("#"+e+"_button_text_input").val(),field[e+"Button"].imageUrl="")}function ToggleCustomField(e){var t=jQuery("#field_custom_existing").is(":checked");show_element=t?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=t?"#field_custom_field_name_text":"#field_custom_field_name_select",jQuery(hide_element).hide(),jQuery(show_element).show()}function ToggleInputMask(e){jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!1))}function ToggleInputMaskOptions(e){var t=jQuery("#field_mask_standard").is(":checked"),i=t?"#field_mask_select":"#field_mask_text, .mask_text_description";jQuery(t?"#field_mask_text, .mask_text_description":"#field_mask_select").val("").hide(),jQuery(i).show(),e||(SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!t))}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(e){var t;jQuery("#field_multiple_files").prop("checked")?(jQuery("#gform_multiple_files_options").show(),(t=jQuery(".gform_fileupload_multifile").data("settings"))&&void 0!==t.chunk_size&&jQuery("#gform_server_max_file_size_notice").hide(),SetFieldProperty("multipleFiles",!0)):(jQuery("#gform_multiple_files_options").hide(),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","")),e||(t=GetSelectedField(),StartChangeInputType("fileupload",t))}function SetAutocompleteProperty(e,t){SetFieldProperty("enableAutocomplete",t),ToggleAutocompleteAttribute(e)}function ToggleAutocompleteAttribute(e){jQuery("#field_enable_autocomplete").is(":checked")?jQuery("#autocomplete_attribute_container").show():jQuery("#autocomplete_attribute_container").hide()}function InitAutocompleteOptions(e){jQuery("#field_enable_autocomplete").prop("checked",!!field.enableAutocomplete),ToggleAutocompleteAttribute(!0)}function HasPostContentField(){for(var e=0;et&&(t=parseFloat(form.fields[i].id));if(form.deletedFields)for(i=0;it&&(t=parseFloat(form.deletedFields[i]));e=parseFloat(t)+1}else e=parseInt(form.nextFieldId);return form.nextFieldId=e+1,e}function GetFirstField(){var e=0;if(e'):jQuery("#sidebar_field_icon").addClass(d),jQuery(".panel-block-tabs__body--settings").each(function(e,t){t=jQuery(t).attr("id");0===jQuery("#"+t+" > li").filter(function(){return"none"!==jQuery(this).css("display")}).length?(jQuery("#"+t+"_toggle").hide(),jQuery("#"+t).hide()):jQuery("#"+t+"_toggle").show()}),jQuery("#sidebar_field_info").removeClass("panel-block--hidden"),jQuery("#sidebar_field_info").addClass("panel-block--flex"),jQuery(".field_settings").show(),jQuery(".sidebar").tabs("option","active",1),gform.tools.getNodes('[data-js="choices-ui-content"] > li',!0,document,!0).filter(function(e){return"none"!==window.getComputedStyle(e).getPropertyValue("display")}).length||gform.tools.trigger("gform/flyout/close-all"),gform.tools.trigger("gform/form_editor/setting_selected",document,!1,e)}function TogglePercentageStyle(e){"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show():jQuery(".percentage_custom_container").hide()}function TogglePercentageConfirmationText(e){jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show():jQuery(".percentage_confirmation_page_name_setting").hide()}function CustomFieldExists(e){if(!e)return!0;for(var t=jQuery("#field_custom_field_name_select option"),i=0;i";for(key in gform_custom_choices)gform_custom_choices.hasOwnProperty(key)&&(e='SelectCustomChoice( jQuery(this).data("key") );',t+="
  • "+escapeHtml(key)+"
  • ");t+="
  • "+gf_vars.predefinedChoices+"
  • ",jQuery("#bulk_items").prepend(t)}}function SelectCustomChoice(e){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[e].join("\n")),gform_selected_custom_choice=e,InitBulkCustomPanel()}function SelectPredefinedChoice(e){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[e].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(e){(field=GetSelectedField()).choices=new Array;for(var t,i=!1,l=0;l"+field.choices[d].text+"";break;case"checkbox":for(d=0;d")}5"+gf_vars.editToViewAll.replace("%d",field.choices.length)+""),field.enableSelectAll&&(t+='");break;case"radio":for(var a,d=0;d");t+=field.enableOtherChoice?"<"+i+">":"",5"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"");break;case"list":RefreshSelectedFieldPreview()}jQuery(".field_selected "+(".gfield_"+e)).html(t)}function UpdateInputChoices(e){for(var t="",i=0;i"+e.choices[i].text+""}var d=e.id.toString().replace(".","_");jQuery(".field_selected #input_"+d).html(t)}function InsertFieldChoice(e){field=GetSelectedField();var t=GetInputType(field),i="",l="",d=field.enablePrice?"0.00":"",i=("list"===t&&(i=window.gf_vars.column+" "+(e+1),l=window.gf_vars.column+" "+(e+1)),new Choice(i,l,d));window["gform_new_choice_"+field.type]&&(i=window["gform_new_choice_"+field.type](field,i)),"object"!=typeof field.choices&&(field.choices=[]),field.choices.splice(e,0,i),LoadFieldChoices(field),UpdateFieldChoices(t)}function InsertInputChoice(e,t,i){var l=GetSelectedField(),l=GetInput(l,t),t=new Choice("","");l.choices.splice(i,0,t),LoadInputChoices(e,l),UpdateInputChoices(l)}function DeleteFieldChoice(e){field=GetSelectedField();var t=jQuery("#"+GetInputType(field)+"_choice_value_"+e).val();HasConditionalLogicDependency(field.id,t)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(e,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(e,t,i){var l=GetSelectedField(),l=GetInput(l,t);l.choices.splice(i,1),LoadInputChoices(e,l),UpdateInputChoices(l)}function MoveFieldChoice(e,t){var i=(field=GetSelectedField()).choices[e];field.choices.splice(e,1),field.choices.splice(t,0,i),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(e,t,i,l){var d=GetSelectedField(),d=GetInput(d,t),t=d.choices[i];d.choices.splice(i,1),d.choices.splice(l,0,t),LoadInputChoices(e,d),UpdateInputChoices(d)}function GetFieldType(e){return e.substr(0,e.lastIndexOf("_"))}function GetSelectedField(){var e=jQuery(".field_selected");return!(e.length<=0)&&(e=e[0].id.substr(6),GetFieldById(e))}function SetPasswordProperty(e){SetFieldProperty("enablePasswordInput",e)}function ToggleDateCalendar(e){var t=jQuery("#field_date_input_type").val();"datefield"==t||"datedropdown"==t?(jQuery("#date_picker_container").hide(),SetCalendarIconType("none")):jQuery("#date_picker_container").show()}function ToggleCalendarIconUrl(e){jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show():(jQuery("#gfield_icon_url_container").hide(),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(e){SetFieldProperty("timeFormat",e),LoadTimeInputs()}function LoadTimeInputs(){var e=GetSelectedField();"time"!=e.type&&"time"!=e.inputType||("24"==jQuery("#field_time_format").val()?(jQuery("#input_default_value_row_input_"+e.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+e.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+e.id+"_3").hide())}function SetDateFormat(e){SetFieldProperty("dateFormat",e);var t,e=GetSelectedField();"datepicker"===e.dateType&&(t=jQuery("#field_date_format option:selected").text(),""===e.placeholder)&&jQuery('.field_selected input[name="ginput_datepicker"]').attr("placeholder",t),LoadDateInputs()}function LoadDateInputs(){var e=jQuery("#field_date_input_type").val(),t=jQuery("#field_date_format").val(),t=t?t.substr(0,3):"mdy";if("datefield"==e){switch(t){case"ymd":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day"),jQuery(".field_selected #gfield_input_date_year").remove().insertBefore(".field_selected #gfield_input_date_month");break;case"mdy":jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day");break;case"dmy":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_month")}jQuery(".field_selected [id^='gfield_input_date']").show(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==e){switch(t){case"ymd":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day"),jQuery(".field_selected #gfield_dropdown_date_year").remove().insertBefore(".field_selected #gfield_dropdown_date_month");break;case"mdy":jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day");break;case"dmy":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_month")}jQuery(".field_selected [id^='gfield_dropdown_date']").css("display","inline"),jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").show(),jQuery("#gsetting_icon_calendar").is(":checked")?jQuery(".field_selected #gfield_input_datepicker_icon").show():jQuery(".field_selected #gfield_input_datepicker_icon").hide()}function SetCalendarIconType(e,t){field=GetSelectedField(),"date"==GetInputType(field)&&("none"==(e=null==e?"none":e)?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==e?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==e&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",e),ToggleCalendarIconUrl(t),LoadDateInputs())}function SetDateInputType(e){field=GetSelectedField(),"date"==GetInputType(field)&&("datepicker"===e?SetFieldAccessibilityWarning("date_input_type_setting","above"):resetAllFieldAccessibilityWarnings(),field.dateType=e,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var e=jQuery("#gfield_display_alt").is(":checked"),t=jQuery("#gfield_display_title").is(":checked"),i=jQuery("#gfield_display_caption").is(":checked"),l=jQuery("#gfield_display_description").is(":checked"),d=e||t||i||l;SetFieldProperty("displayAlt",e),SetFieldProperty("displayTitle",t),SetFieldProperty("displayCaption",i),SetFieldProperty("displayDescription",l),jQuery(".field_selected .ginput_post_image_alt").css("display",e?"block":"none"),jQuery(".field_selected .ginput_post_image_title").css("display",t?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",i?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",l?"block":"none"),jQuery(".field_selected .ginput_post_image_file").css("display",d?"block":"none")}function SetFeaturedImage(){if(jQuery("#gfield_featured_image").is(":checked")){for(i in form.fields)form.fields.hasOwnProperty(i)&&(form.fields[i].postFeaturedImage=!1);SetFieldProperty("postFeaturedImage",!0)}else SetFieldProperty("postFeaturedImage",!1)}function SetFieldProperty(e,t){null==t&&(t=""),GetSelectedField()[e]=t}function SetInputName(e,t){var i=GetSelectedField();if(e=e&&e.trim(),t){for(var l=0;lt.text.toLowerCase()})}function SetFieldLabel(e){var t=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(e).append(t),SetFieldProperty("label",e)}function SetAriaLabel(e){var t=jQuery(".field_selected")[0].id.split("_")[1],t=GetFieldById(t),e=window.gf_vars.fieldLabelAriaLabel.replace("{field_label}",e).replace("{field_type}",t.type);jQuery(".field_selected .gfield-edit").attr("aria-label",e)}function SetCaptchaTheme(e,t){jQuery(".field_selected .gfield_captcha").attr("src",t),SetFieldProperty("captchaTheme",e)}function SetCaptchaSize(e){var t=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",e),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(t+"_small").removeClass(t+"_medium").removeClass(t+"_large").addClass(t+"_"+e)}function SetCaptchaFontColor(e){SetFieldProperty("simpleCaptchaFontColor",e),RedrawCaptcha()}function SetCaptchaBackgroundColor(e){SetFieldProperty("simpleCaptchaBackgroundColor",e),RedrawCaptcha()}function RedrawCaptcha(){"math"==jQuery("#field_captcha_type").val()?(url_1=GetCaptchaUrl(1),url_2=GetCaptchaUrl(2),url_3=GetCaptchaUrl(3),jQuery(".field_selected .gfield_captcha:eq(0)").attr("src",url_1),jQuery(".field_selected .gfield_captcha:eq(1)").attr("src",url_2),jQuery(".field_selected .gfield_captcha:eq(2)").attr("src",url_3)):(url=GetCaptchaUrl(),jQuery(".field_selected .gfield_captcha").attr("src",url))}function SetFieldEnhancedUI(e){SetFieldProperty("enableEnhancedUI",e?1:0),e?SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"):resetAllFieldAccessibilityWarnings()}function SetFieldSize(e){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(e),SetFieldProperty("size",e)}function SetFieldLabelPlacement(e){var t=e||form.labelPlacement;SetFieldProperty("labelPlacement",e),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(t),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?(jQuery("#field_description_placement").val(""),SetFieldProperty("descriptionPlacement",""),jQuery("#field_description_placement_container").hide("slow")):jQuery("#field_description_placement_container").show("slow"),"hidden_label"==field.labelPlacement?SetFieldAccessibilityWarning("label_placement_setting","above"):resetAllFieldAccessibilityWarnings(),SetFieldProperty("labelPlacement",e),SetFieldRequired(field.isRequired),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(e){var t="above"==e||""==e&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",e),RefreshSelectedFieldPreview(function(){t?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(e){SetFieldProperty("subLabelPlacement",e),RefreshSelectedFieldPreview(function(){"above"===e?jQuery(".field_selected").addClass("field_sublabel_above").removeClass("field_sublabel_below"):jQuery(".field_selected").addClass("field_sublabel_below").removeClass("field_sublabel_above")})}function SetFieldVisibility(e,t,i){if(!i&&"administrative"==e&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var l=!1,d=0;d div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(e),SetFieldProperty("defaultValue",e)}function SetFieldPlaceholder(i){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var e=this.nodeName,t=jQuery(this);"INPUT"==e||"TEXTAREA"==e?jQuery(this).prop("placeholder",i):"SELECT"==e&&(0<(e=t.find('option[value=""]')).length?0'+i+""),t.val("")))}),SetFieldProperty("placeholder",i)}function SetFieldDescription(e){SetFieldProperty("description",e=null==e?"":e)}function SetFieldCheckboxLabel(e){SetFieldProperty("checkboxLabel",e=null==e?"":e)}function SetPasswordStrength(e){e?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",e)}function ToggleEmailSettings(e){e=void 0!==e.emailConfirmEnabled&&1==e.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!e),jQuery(".default_value_setting").toggle(!e),jQuery(".sub_label_placement_setting").toggle(e),jQuery(".sub_labels_setting").toggle(e),jQuery(".default_input_values_setting").toggle(e),jQuery(".input_placeholders_setting").toggle(e)}function SetEmailConfirmation(e){var t=GetSelectedField();(e?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email")):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email"))).show(),t.emailConfirmEnabled=e,t.inputs=GetEmailFieldInputs(t),CreateDefaultValuesUI(t),CreatePlaceholdersUI(t),CreateAutocompleteUI(t),CreateCustomizeInputsUI(t),CreateInputLabelsUI(t),ToggleEmailSettings(t)}function SetCardType(e,t){var i=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;jQuery(e).is(":checked")?-1==jQuery.inArray(t,i)&&(jQuery(".gform_card_icon_"+t).fadeIn(),i[i.length]=t):-1!=(e=jQuery.inArray(t,i))&&(jQuery(".gform_card_icon_"+t).fadeOut(),i.splice(e,1)),SetFieldProperty("creditCards",i)}function SetFieldRequired(e){var t=gform_form_strings.requiredIndicator,i=".field_selected .gfield_required",l=!1;"consent"===field.type?(jQuery(i).remove(),e&&(l=!0)):0'+t+"")),SetFieldProperty("isRequired",e)}function SetMaxLength(e){var t=GetMaxLengthPattern(),l="",d=e.value.split("");for(i in d)!d.hasOwnProperty(i)||t.test(d[i])||(l+=d[i]);SetFieldProperty("maxLength",e.value=l)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(e,t,i){var i=void 0===i||i,l=e.which||e.keyCode,t=t.test(String.fromCharCode(l));return!!e.ctrlKey||(i?t:!t)}function IndexOf(e,t){for(var i=0;i',o=(r=(r+='')+('
    '+(i=void 0===i?getFieldErrorMessage(e):i)+"
    ")+"",jQuery("."+e));o.addClass("error"),jQuery('.gform-alert--error[data-field-setting="'+e+'"]').remove(),"above"===t?o.before(r):o.after(r)}}function resetFieldError(e){var t=GetSelectedField(),t=t.hasOwnProperty("errors")?t.errors:[];void 0!==e&&(jQuery('.gform-alert--error[data-field-setting="'+e+'"]').remove(),jQuery("."+e).removeClass("error"),-1<(e=t.indexOf(e)))&&(1').appendTo("body"),jQuery(document.createElement("div")).attr("id","iColorPickerBg").click(function(){jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut()}).appendTo("body"),jQuery("table.pickerTable td").css({width:"12px",height:"14px",border:"1px solid #000",cursor:"pointer"}),jQuery("#iColorPicker table.pickerTable").css({"border-collapse":"collapse"}),jQuery("#iColorPicker").css({border:"1px solid #ccc",background:"#333",padding:"5px",color:"#fff","z-index":9999})),jQuery("#colorPreview").css({height:"50px"})})},jQuery(function(){iColorPicker()}),jQuery(document).mouseup(function(e){var t=jQuery("#iColorPicker");t.is(e.target)||0!==t.has(e.target).length||(jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut())}),jQuery.fn.gfSlide=function(e){var t=jQuery(".field_settings").is(":visible");return"up"==e?t?this.slideUp():this.hide():t?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(e,t){return e="administrative"!=t.visibility&&t.id!=GetSelectedField().id?e:!1}); \ No newline at end of file +function InitializeEditor(){if(jQuery(".search-button > input").on("keyup change click paste",function(e){FieldSearch(this),addClearButton(this)}),jQuery(".search-button > input").on("keyup paste",function(e){jQuery(".sidebar").tabs({active:0})}),jQuery(".clear-button").on("click",function(e){clearInput(this)}),jQuery(".gf-topmenu-dynamic").on("click",function(e){var t=jQuery(this).position(),t=(jQuery(".gf-popover").css("left",t.left+jQuery(this).width()/2+6+"px"),jQuery(".gf-popover").css("display"));jQuery(".gf-popover").css("display","block"===t?"none":"block")}),jQuery(".gf-popover__button").on("click",function(){var e=jQuery(this).data("url");""!==e&&(window.location.href=e)}),jQuery(document).on("click",function(e){var t=jQuery(".gf-topmenu-dynamic");t.is(e.target)||0!==t.has(e.target).length||jQuery(".gf-popover").hide()}),jQuery(".add-buttons button").each(function(){var e=jQuery(this),t=e.attr("data-type"),i=e.attr("onclick");void 0===t&&i&&-1")}),ResetFieldAccordions(),jQuery(".panel-block > .field_settings").on("keydown",function(e){var t,i;27===e.keyCode?jQuery(".gfield.field_selected .gfield-edit").focus():9===e.keyCode&&(t=(i=gform.tools.getFocusable(this))[0],i=i[i.length-1],e.shiftKey?document.activeElement===t&&(i.focus(),e.preventDefault()):document.activeElement===i&&(t.focus(),e.preventDefault()))}),jQuery("#field_submit #gform_ppcp_smart_payment_buttons").remove()}function InitializeFieldSettings(){gform.addFilter("gform_editor_field_settings","hideDefaultMarginOnTopLabelAlignment"),jQuery("#field_max_file_size").on("input propertychange",function(){var e=jQuery(this),e=parseInt(e.val());SetFieldProperty("maxFileSize",e||"")}).on("change",function(){var e=GetSelectedField(),e=e.maxFileSize||"";this.value=""===e?"":e+"MB"}),jQuery(document).on("input propertychange",".field_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(document).on("input propertychange",".field_placeholder, .field_placeholder_textarea",function(){SetFieldPlaceholder(this.value),""===GetSelectedField().label&&(setFieldError("label_setting","below"),""!==this.value)&&resetFieldError("label_setting")}),jQuery("#field_choices").on("change",".field-choice-price",function(){var e=GetSelectedField(),t=jQuery(this).parent("li").index(),e=e.choices[t].price;this.value=e}),jQuery(".field_input_choices").on("input propertychange","input",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress","input:radio, input:checkbox",function(){var e=jQuery(this).closest("li"),t=e.data("index");SetInputChoice(e.data("input_id"),t,e.find(".field-choice-value").val(),e.find(".field-choice-text").val())}).on("click keypress",".field-input-insert-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");InsertInputChoice(t,e.data("input_id"),i+1)}).on("click keypress",".field-input-delete-choice",function(){var e=jQuery(this).closest("li"),t=e.closest("ul"),i=e.data("index");DeleteInputChoice(t,e.data("input_id"),i)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var e=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(e,this.checked),SetInputChoices(e.find("ul"))}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var e=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,e)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var e,t=GetSelectedField();this.checked?(e=!0,HasConditionalLogicDependency(t.id,t.value)&&!confirm(gf_vars.conditionalLogicRichTextEditorWarning)&&(jQuery("#field_rich_text_editor").prop("checked",!1),e=!1),e&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none"))}),jQuery(".prepopulate_field_setting").on("input propertychange",".field_input_name",function(){var e=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,e)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("change",".gform-field__toggle-input",function(){var e=jQuery(this).closest(".gform-field__toggle").data("input_id");ToggleInputHidden(jQuery(this),e)}).on("click","#field_password_fields_container .gform-field__toggle",function(){var e=jQuery(this).data("input_id"),t=jQuery(this).find(".gform-field__toggle-input");t[0].focus(),t[0].checked=!t[0].checked,ToggleInputHidden(t,e)}).on("input propertychange",".field_custom_input_default_label",function(){var e=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,e)}).on("input propertychange",".field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var e=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,e)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(e){var t=jQuery(this),i=t.closest("li.field-choice-row");SetFieldChoice(i.data("input_type"),i.data("index")),(t.hasClass("field-choice-text")||t.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),e.stopPropagation())}),jQuery("#field_enable_copy_values_option").on("click keypress",function(){SetCopyValuesOptionProperties(this.checked),ToggleCopyValuesOption(!1),0==this.checked&&ToggleCopyValuesActivated(!1)}),jQuery("#field_copy_values_option_label").on("input propertychange",function(){SetCopyValuesOptionLabel(this.value)}),jQuery("#field_copy_values_option_field").on("change",function(){SetFieldProperty("copyValuesOptionField",jQuery(this).val())}),jQuery("#field_copy_values_option_default").on("change",function(){SetFieldProperty("copyValuesOptionDefault",1==this.checked?1:0),ToggleCopyValuesActivated(this.checked)}),jQuery("#field_label").on("input propertychange",function(){SetFieldLabel(this.value),SetAriaLabel(this.value),""!==this.value&&(resetFieldError("label_setting"),ResetFieldAccessibilityWarning("label_setting"))}).on("blur",function(){""===this.value&&setFieldError("label_setting","below")}),jQuery("#submit_text").on("input propertychange",function(){jQuery("#gform_submit_button_"+form.id).val(this.value)}),jQuery("#submit_image").on("input propertychange",function(){ToggleSubmitType(!1)}),jQuery("#field_description").on("blur",function(){var e=GetSelectedField();e.description!=this.value&&(SetFieldDescription(this.value),RefreshSelectedFieldPreview()),""===e.label&&(setFieldError("label_setting","below"),""!==this.value)&&resetFieldError("label_setting")}),jQuery('input[ name="field_visibility" ]').on("DOMSubTreeModified change",function(){var e=GetSelectedField(),t=(SetFieldProperty("visibility",this.value),'
    Hidden
    ');"hidden"===e.visibility?(jQuery("#field_"+e.id).addClass("admin-hidden"),jQuery("#field_"+e.id+" .gfield_label").before(t),jQuery("#field_"+e.id+" .gsection_title").before(t)):(jQuery("#field_"+e.id).removeClass("admin-hidden"),jQuery("#field_"+e.id+" .admin-hidden-markup").remove())}),jQuery("#field_checkbox_label").on("input propertychange",function(){GetSelectedField().checkboxLabel!=this.value&&(SetFieldCheckboxLabel(this.value),RefreshSelectedFieldPreview())}),jQuery("#field_content").on("input propertychange",function(){SetFieldProperty("content",this.value)}),jQuery("#next_button_text_input, #next_button_image_url").on("input propertychange",function(){SetPageButton("next")}),jQuery("#previous_button_image_url, #previous_button_text_input").on("input propertychange",function(){SetPageButton("previous")}),jQuery("#field_custom_field_name_text").on("input propertychange",function(){SetFieldProperty("postCustomFieldName",this.value)}),jQuery("#field_customfield_content_template").on("input propertychange",function(){SetCustomFieldTemplate()}),jQuery("#gfield_calendar_icon_url").on("input propertychange",function(){SetFieldProperty("calendarIconUrl",this.value)}),jQuery("#field_max_files").on("input propertychange",function(){SetFieldProperty("maxFiles",this.value)}),jQuery("#field_maxrows").on("input propertychange",function(){SetFieldProperty("maxRows",this.value)}),jQuery("#field_mask_text").on("input propertychange",function(){SetFieldProperty("inputMaskValue",this.value)}),jQuery("#field_file_extension").on("input propertychange",function(){SetFieldProperty("allowedExtensions",this.value)}),jQuery("#field_maxlen").on("keypress",function(e){return ValidateKeyPress(e,GetMaxLengthPattern(),!1)}).on("change keyup",function(){SetMaxLength(this)}),jQuery("#field_range_min").on("input propertychange",function(){SetFieldProperty("rangeMin",this.value)}),jQuery("#field_range_max").on("input propertychange",function(){SetFieldProperty("rangeMax",this.value)}),jQuery("#field_calculation_formula").on("input propertychange",function(){SetFieldProperty("calculationFormula",this.value.trim())}),jQuery("#field_error_message").on("input propertychange",function(){SetFieldProperty("errorMessage",this.value)}),jQuery("#field_css_class").on("focus",function(){jQuery(this).data("previousClass",this.value)}).on("change",function(){SetFieldProperty("cssClass",this.value),previousClass=jQuery(this).data("previousClass"),jQuery("#field_"+field.id).removeClass(previousClass).addClass(this.value),CheckDeprecatedReadyClass(field)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",this.value)}),jQuery(".autocomplete_setting").on("input propertychange",".input_autocomplete",function(){var e=jQuery(this).closest(".input_autocomplete_row").data("input_id");SetInputAutocomplete(this.value,e)}).on("input propertychange","#field_autocomplete_attribute",function(){SetFieldProperty("autocompleteAttribute",this.value)}),jQuery("#field_add_icon_url").on("input propertychange",function(){SetFieldProperty("addIconUrl",this.value)}),jQuery("#field_delete_icon_url").on("input propertychange",function(){SetFieldProperty("deleteIconUrl",this.value)})}function hideDefaultMarginOnTopLabelAlignment(e,t){if("top_label"===form.labelPlacement)for(var i in e)if(".disable_margins_setting"===e[i]){e.splice(i,1);break}return e}function InitializeForm(e){jQuery("#submit_text").val(e.button.text),jQuery("#submit_image").val(e.button.imageUrl),(e.button.width?jQuery("#submit_width_"+e.button.width):jQuery("#submit_width_auto")).prop("checked",!0),(e.button.location?jQuery("#submit_location_"+e.button.location):jQuery("#submit_location_bottom")).prop("checked",!0),(e.button.type?jQuery("#submit_type_"+e.button.type):jQuery("#submit_type_")).prop("checked",!0),e.lastPageButton&&"image"===e.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):e.lastPageButton&&"image"===e.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(e.lastPageButton?e.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(e.lastPageButton?e.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),e.postStatus&&jQuery("#field_post_status").val(e.postStatus),e.postAuthor&&jQuery("#field_post_author").val(e.postAuthor),void 0===e.useCurrentUserAsAuthor&&(e.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!e.useCurrentUserAsAuthor),e.postCategory&&jQuery("#field_post_category").val(e.postCategory),e.postFormat&&jQuery("#field_post_format").val(e.postFormat),e.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(e.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),e.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(e.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_pagination, #gform_last_page_settings").on("click",function(e){FieldClick(this),e.stopPropagation()}),jQuery("#gform_fields").on("click",".gfield",function(e){FieldClick(this),e.stopPropagation()});var t=e.pagination&&e.pagination.type?e.pagination.type:"percentage",i="percentage"===t,l="none"===t;"steps"===t?jQuery("#pagination_type_steps").prop("checked",!0):i?jQuery("#pagination_type_percentage").prop("checked",!0):l&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(e.firstPageCssClass),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var e=GetInputType(field),t=(resetAllFieldAccessibilityWarnings(),resetAllFieldErrors(),resetAllFieldNotices(),resetDeprecatedReadyClassNotice(),jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".tooltip_form_field_label").hide(),jQuery(".tooltip_form_field_label_html").show()):(jQuery(".tooltip_form_field_label").show(),jQuery(".tooltip_form_field_label_html").hide()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(null==field.content?"":field.content),jQuery("#post_custom_field_type").val(field.inputType),jQuery("#post_tag_type").val(field.inputType),jQuery("#field_size").val(field.size),jQuery("#field_required").prop("checked",1==field.isRequired),jQuery("#field_margins").prop("checked",1==field.disableMargins),jQuery("#field_no_duplicates").prop("checked",1==field.noDuplicates),jQuery("#field_default_value").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(null==field.defaultValue?"":field.defaultValue),jQuery("#field_autocomplete_attribute").val(field.autocompleteAttribute),jQuery("#field_description").val(null==field.description?"":field.description),jQuery("#field_description").attr("placeholder",null==field.descriptionPlaceholder?"":field.descriptionPlaceholder),jQuery("#field_checkbox_label").val(null==field.checkboxLabel?"":field.checkboxLabel),jQuery("#field_css_class").val(null==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(null==field.rangeMin||!1===field.rangeMin?"":field.rangeMin),jQuery("#field_range_max").val(null==field.rangeMax||!1===field.rangeMax?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),""!==field.cssClass&&CheckDeprecatedReadyClass(field),field.useRichTextEditor?(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block")):(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!1),jQuery("span#placeholder_warning").css("display","none")),void 0===field.labelPlacement&&(field.labelPlacement=""),void 0===field.descriptionPlacement&&(field.descriptionPlacement=""),void 0===field.subLabelPlacement&&(field.subLabelPlacement=""),jQuery("#field_label_placement").val(field.labelPlacement),jQuery("#field_description_placement").val(field.descriptionPlacement),jQuery("#field_sub_label_placement").val(field.subLabelPlacement),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?jQuery("#field_description_placement_container").hide():jQuery("#field_description_placement_container").show(),SetFieldVisibility(field.visibility,!0),void 0===field.placeholder&&(field.placeholder=""),jQuery("#field_placeholder, #field_placeholder_textarea").val(field.placeholder),jQuery("#field_file_extension").val(null==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles||""),jQuery("#field_max_file_size").val(field.maxFileSize?field.maxFileSize+"MB":""),ToggleMultiFile(!0),jQuery("#field_phone_format").val(field.phoneFormat),jQuery("#field_error_message").val(field.errorMessage),jQuery("#field_select_all_choices").prop("checked",!!field.enableSelectAll),jQuery("#field_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl||""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl||""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_password_visibility_enabled").prop("checked",1==field.passwordVisibilityEnabled),TogglePasswordVisibility(!0),jQuery("#gfield_min_strength").val(null==field.minPasswordStrength?"":field.minPasswordStrength),TogglePasswordStrength(!0),jQuery("#gfield_email_confirm_enabled").prop("checked",1==field.emailConfirmEnabled),field.numberFormat?jQuery("#field_number_format_blank").remove():0==jQuery("#field_number_format #field_number_format_blank").length&&jQuery("#field_number_format").prepend(""),jQuery("#field_number_format").val(field.numberFormat||""),"product"==field.type&&"calculation"==field.inputType?(field.enableCalculation=!0,jQuery(".field_calculation_rounding").hide(),jQuery(".field_enable_calculation").hide()):(jQuery(".field_enable_calculation").show(),"number"==field.type&&"currency"==field.numberFormat?jQuery(".field_calculation_rounding").hide():jQuery(".field_calculation_rounding").show()),jQuery("#field_enable_calculation").prop("checked",!!field.enableCalculation),ToggleCalculationOptions(field.enableCalculation,field),jQuery("#field_calculation_formula").val(field.calculationFormula),gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding"),t=(jQuery("#field_calculation_rounding").val(t),jQuery("#option_field_type").val(field.inputType),jQuery("#product_field_type")),t=(t.val(field.inputType),has_entry(field.id)?t.prop("disabled",!0):t.prop("disabled",!1),jQuery("#donation_field_type").val(field.inputType),jQuery("#quantity_field_type").val(field.inputType),"hiddenproduct"!=field.inputType&&"singleproduct"!=field.inputType&&"singleshipping"!=field.inputType&&"calculation"!=field.inputType||(t=null==field.basePrice?"":field.basePrice,jQuery("#field_base_price").val(null==field.basePrice?"":field.basePrice),SetBasePrice(t)),jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity),!!field.enablePasswordInput),t=(jQuery("#field_password").prop("checked",t),jQuery("#field_maxlen").val(void 0===field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val(void 0===field.maxRows?"":field.maxRows),null==field.addressType?"international":field.addressType),i=(jQuery("#field_address_type").val(t),null==(field="consent"===(field="email"!=(field="address"==field.type?UpgradeAddressField(field):field).type&&"email"!=field.inputType?field:UpgradeEmailField(field)).type?UpgradeConsentField(field):field).defaultState?"":field.defaultState),l=null==field.defaultProvince?"":field.defaultProvince,l="canadian"==t&&""==i?l:i,i=(jQuery("#field_address_default_state_"+t).val(l),jQuery("#field_address_default_country_"+t).val(null==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),jQuery("#gfield_display_alt").prop("checked",1==field.displayAlt),jQuery("#gfield_display_title").prop("checked",1==field.displayTitle),jQuery("#gfield_display_caption").prop("checked",1==field.displayCaption),jQuery("#gfield_display_description").prop("checked",1==field.displayDescription),CustomFieldExists(field.postCustomFieldName)),l=(jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),(i?jQuery("#field_custom_field_name_select"):jQuery("#field_custom_field_name_text")).val(field.postCustomFieldName),(i?jQuery("#field_custom_existing"):jQuery("#field_custom_new")).prop("checked",!0),ToggleCustomField(!0),jQuery("#gfield_customfield_content_enabled").prop("checked",!!field.customFieldTemplateEnabled),jQuery("#field_customfield_content_template").val(field.customFieldTemplateEnabled?field.customFieldTemplate:""),ToggleCustomFieldTemplate(!0),(field.displayAllCategories?jQuery("#gfield_category_all"):jQuery("#gfield_category_select")).prop("checked",!0),ToggleCategory(!0),jQuery("#gfield_post_category_initial_item_enabled").prop("checked",!!field.categoryInitialItemEnabled),jQuery("#field_post_category_initial_item").val(field.categoryInitialItemEnabled?field.categoryInitialItem:""),TogglePostCategoryInitialItem(!0),!!field.postFeaturedImage),t=(jQuery("#gfield_featured_image").prop("checked",l),"boolean"!=typeof field.inputMaskIsCustom&&(field.inputMaskIsCustom=!IsStandardMask(field.inputMaskValue)),!field.inputMaskIsCustom);if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),(t?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select")):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text"))).val(field.inputMaskValue),ToggleInputMask(!0),ToggleInputMaskOptions(!0),InitAutocompleteOptions(!0),"creditcard"==e)for(d in(!(field=UpgradeCreditCardField(field)).creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]),field.creditCards)field.creditCards.hasOwnProperty(d)&&jQuery("#field_credit_card_"+field.creditCards[d]).prop("checked",!0);"date"==e&&(field=UpgradeDateField(field)),"time"==e&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=e||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(null==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val(null==field.dateFormat?"mdy":field.dateFormat),jQuery("#field_time_format").val("24"==field.timeFormat?"24":"12"),SetCalendarIconType(field.calendarIconType,!0),ToggleDateCalendar(!0),LoadDateInputs(),LoadTimeInputs(),field.allowsPrepopulate=!!field.allowsPrepopulate,field.useRichTextEditor=!!field.useRichTextEditor,jQuery("#field_prepopulate").prop("checked",!!field.allowsPrepopulate),jQuery("#field_rich_text_editor").prop("checked",!!field.useRichTextEditor),has_entry(field.id)?jQuery("#field_rich_text_editor").prop("disabled",!0):jQuery("#field_rich_text_editor").prop("disabled",!1),CreateInputNames(field),ToggleInputName(!0);i=0'+i.data("multiselect")+""),i.val("multiselect"),i.data("multiselect",null)),l="post_tags"===field.type?"post_tag_type_setting":"post_category_field_type_setting",SetFieldAccessibilityWarning(l,"below"))),"quantity"==field.type&&jQuery(".calculation_setting").hide(),jQuery("#post_category_field_type").val(field.inputType);t=null==field.simpleCaptchaFontColor?"":field.simpleCaptchaFontColor,jQuery("#field_captcha_fg").val(t),SetColorPickerColor("field_captcha_fg",t),i=null==field.simpleCaptchaBackgroundColor?"":field.simpleCaptchaBackgroundColor;jQuery("#field_captcha_bg").val(i),SetColorPickerColor("field_captcha_bg",i),jQuery("#field_captcha_type").val(null==field.captchaType?"captcha":field.captchaType),jQuery("#field_captcha_badge").val(null==field.captchaBadge?"bottomright":field.captchaBadge),jQuery("#field_captcha_size").val(null==field.simpleCaptchaSize?"medium":field.simpleCaptchaSize),"captcha"==field.type&&(SetFieldAccessibilityWarning("captcha","above"),l=".captcha_language_setting, .captcha_theme_setting",t=".captcha_size_setting, .captcha_fg_setting, .captcha_bg_setting","simple_captcha"==field.captchaType||"math"==field.captchaType?(jQuery(t).show(),jQuery(l).hide()):(jQuery(t).hide(),jQuery(l).show()),i=null==field.captchaTheme||["blackglass","dark"].indexOf(field.captchaTheme)<0?"light":"dark",jQuery("#field_captcha_theme").val(i).show(),t=null==field.captchaLanguage?"en":field.captchaLanguage,jQuery("#field_captcha_language").val(t).show(),jQuery('#field_captcha_type option[value="captcha"]').length<1)&&jQuery("#field_captcha_type").prepend(''),"post_custom_field"!=field.type||"textarea"!=field.inputType&&"text"!=field.inputType||jQuery(".customfield_content_template_setting").show(),"name"==field.type&&(void 0===field.nameFormat||"advanced"!=field.nameFormat?field=MaybeUpgradeNameField(field):SetUpAdvancedNameField(),"simple"==field.nameFormat?(jQuery(".default_value_setting").show(),jQuery(".size_setting").show(),jQuery("#field_name_fields_container").html("").hide(),jQuery(".sub_label_placement_setting").hide(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".default_value_setting").show()):"extended"==field.nameFormat&&(jQuery(".name_format_setting").show(),jQuery(".name_prefix_choices_setting").hide(),jQuery(".name_setting").hide(),jQuery(".default_input_values_setting").hide(),jQuery(".input_placeholders_setting").hide())),-1!=jQuery.inArray(field.type,["product","option","shipping"])&&jQuery(".other_choice_setting").hide(),field.enableCalculation&&jQuery("li.range_setting").hide(),"text"==field.type&&(field.inputMask?jQuery(".maxlen_setting").hide():jQuery(".maxlen_setting").show()),"date"==e&&ToggleDateSettings(field),"email"==e&&ToggleEmailSettings(field),"password"!==field.type&&"password"!==field.inputType||(field=UpgradePasswordField(field),l=GetCustomizeInputsUI(field),jQuery("#field_password_fields_container").html(l),jQuery("#field_password_fields_container table tr:eq(1) td:eq(0) div").remove(),"undefined"!=field.inputs[1].isHidden&&field.inputs[1].isHidden||jQuery(".size_setting").hide(),jQuery(".password_setting .custom_inputs_setting ").on("click keypress",".gform-field__toggle",function(){var e=GetSelectedField(),t=!e.inputs[1].isHidden,e=jQuery('label[for="input_'+e.id+'"]');t?(e.show(),jQuery(".size_setting").hide()):(e.hide(),jQuery(".size_setting").show())})),"multiselect"!==field.type&&"select"!==field.type||!field.enableEnhancedUI||SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"),"multiselect"===field.type&&SetFieldAccessibilityWarning("multiselect","above"),"hidden_label"===field.labelPlacement&&SetFieldAccessibilityWarning("label_placement_setting","above"),""===field.label&&setFieldError("label_setting","below"),"datepicker"===field.dateType&&SetFieldAccessibilityWarning("date_input_type_setting","above"),"submit"===field.type&&(HasPageField()&&SetFieldNotification("submit_location_setting","above"),"image"===form.button.type)&&(SetFieldAccessibilityWarning("submit_type_setting","below"),form.button.imageUrl||SetFieldNotification("submit_image_setting","below")),ToggleSubmitType(!0),jQuery(document).trigger("gform_load_field_settings",[field,form]),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field),Placeholders.enable()}function getAllFieldSettings(e){var t=fieldSettings[e.type],i=(e.inputType&&"post_category"!=e.type&&0<(i=fieldSettings[e.inputType]).length&&(t+=", "+i),t.split(", "));return(i=gform.applyFilters("gform_editor_field_settings",i,e)).join(", ")}function ToggleDateSettings(e){var t="datefield"==e.dateType,i="datepicker"==e.dateType,e="datedropdown"==e.dateType;jQuery(".placeholder_setting").toggle(i),jQuery(".default_value_setting").toggle(i),jQuery(".sub_label_placement_setting").toggle(t),jQuery(".sub_labels_setting").toggle(t),jQuery(".default_input_values_setting").toggle(e||t),jQuery(".input_placeholders_setting").toggle(e||t)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var e=GetCustomizeInputsUI(field),e=(jQuery("#field_name_fields_container").html(e).show(),GetInput(field,field.id+".2")),t=GetInputChoices(e);jQuery("#field_prefix_choices").html(t),ToggleNamePrefixUI(!e.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".gform-field__toggle",function(){0<=jQuery(this).data("input_id").toString().indexOf(".2")&&ToggleNamePrefixUI(jQuery(this).find(".gform-field__toggle-input").is(":checked"))}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateAutocompleteUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(e,t){for(var i,l,d,r=[],o=GetInputType(t),a=0;a"+i+"",r.push(l));return r.join("")}function ToggleNamePrefixUI(e){jQuery(".name_prefix_choices_setting").toggle(e)}function TogglePageBreakSettings(){HasPageBreak()?(jQuery("#gform_last_page_settings").show(),jQuery("#gform_pagination").show()):(jQuery("#gform_last_page_settings").hide(),jQuery("#gform_pagination").hide())}function SetDisableQuantity(e){SetFieldProperty("disableQuantity",e),e?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(e){e=e||0;e=GetCurrentCurrency().toMoney(e);0==e&&(e=0),jQuery("#field_base_price").val(e),SetFieldProperty("basePrice",e),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(e),jQuery(".field_selected .ginput_amount").val(e)}function ChangeAddressType(){var e,t;"address"==(field=GetSelectedField()).type&&(t=jQuery("#field_address_type").val(),e=GetInput(field,field.id+".6"),t=jQuery("#field_address_country_"+t).val(),e.isHidden=""!=t,SetAddressType(!1))}function SetAddressType(e){"address"==(field=GetSelectedField()).type&&(SetAddressProperties(),jQuery(".gfield_address_type_container").hide(),jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(),CreatePlaceholdersUI(field),CreateAutocompleteUI(field))}function UpdateAddressFields(){var e=jQuery("#field_address_type").val(),t=(field=GetSelectedField(),GetCustomizeInputsUI(field)),t=(jQuery("#field_address_fields_container").html(t),GetInput(field,field.id+".5")),i=jQuery("#field_address_zip_label_"+e).val(),t=(jQuery("#field_custom_input_default_label_"+field.id+"_5").text(i),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",i),t.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(i),GetInput(field,field.id+".4")),i=jQuery("#field_address_state_label_"+e).val(),t=(jQuery("#field_custom_input_default_label_"+field.id+"_4").text(i),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",i),t.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(i),""==jQuery("#field_address_country_"+e).val()),i=!t,t=!t||!jQuery('#field_address_fields_container [id="gforms-editor-toggle-'+field.id+'.6"').is(":checked");i?jQuery(".field_custom_input_row_input_"+field.id+"_6").hide():jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show(),t?jQuery(".field_selected #input_"+field.id+"_6_container").hide():(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+e).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show()),(""!=jQuery("#field_address_has_states_"+e).val()?(jQuery(".field_selected .state_text").hide(),i=jQuery("#field_address_default_state_"+e).val(),(t=jQuery(".field_selected .state_dropdown")).append(jQuery("").val(i).html(i)),t.val(i)):(jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text"))).show()}function SetAddressProperties(){field=GetSelectedField();var e=jQuery("#field_address_type").val(),t=(SetFieldProperty("addressType",e),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+e).val()),SetFieldProperty("defaultProvince",""),jQuery("#field_address_country_"+e).val());SetFieldProperty("defaultCountry",t=""==t?jQuery("#field_address_default_country_"+e).val():t),UpdateAddressFields()}function MaybeUpgradeNameField(e){return e=void 0!==e.nameFormat&&""!=e.nameFormat&&"normal"!=e.nameFormat&&("simple"!=e.nameFormat||has_entry(e.id))?e:UpgradeNameField(e,!0,!0,!0)}function UpgradeNameField(e,t,i,l){return e.nameFormat="advanced",e.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(e,t,i,l),e.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),e}function UpgradeDateField(e){return"date"!=e.type&&"date"!=e.inputType||void 0===e.dateType||"datepicker"==e.dateType||e.inputs||(e.inputs=GetDateFieldInputs(e)),e}function UpgradeTimeField(e){return"time"!=e.type&&"time"!=e.inputType||e.inputs||(e.inputs=GetTimeFieldInputs(e)),e}function UpgradeEmailField(e){return"email"!=e.type&&"email"!=e.inputType||e.emailConfirmEnabled&&!e.inputs&&(e.inputs=GetEmailFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradePasswordField(e){return"password"!=e.type&&"password"!=e.inputType||e.inputs||(e.inputs=GetPasswordFieldInputs(e),e.inputs[0].placeholder=e.placeholder),e}function UpgradeAddressField(e){return e.hideCountry&&(GetInput(e,e.id+".6").isHidden=!0),delete e.hideCountry,e.hideAddress2&&(GetInput(e,e.id+".2").isHidden=!0),delete e.hideAddress2,e.hideState&&(GetInput(e,e.id+".4").isHidden=!0),delete e.hideState,e}function UpgradeConsentField(e){return"consent"===e.type&&e.choices[1]&&"0"===e.choices[1].value&&e.choices.pop(),e}function TogglePasswordVisibility(e){jQuery("#gfield_password_visibility_enabled").is(":checked")?jQuery(".gfield.field_selected .ginput_container_password span button").show():jQuery(".gfield.field_selected .ginput_container_password span button").hide()}function TogglePasswordStrength(e){jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show():jQuery("#gfield_min_strength_container").hide()}function ToggleCategory(e){jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(e){SetFieldProperty("copyValuesOptionLabel",e),jQuery(".field_selected .copy_values_option_label").html(e)}function SetCustomFieldTemplate(){var e=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",e?jQuery("#field_customfield_content_template").val():null),SetFieldProperty("customFieldTemplateEnabled",e)}function SetCategoryInitialItem(){var e=jQuery("#gfield_post_category_initial_item_enabled").is(":checked");SetFieldProperty("categoryInitialItem",e?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",e)}function PopulateContentTemplate(e){var t;0==jQuery("#"+e).val().length&&(t=GetSelectedField(),jQuery("#"+e).val("{"+t.label+":"+t.id+"}"))}function TogglePostContentTemplate(e){jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(),e||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide()}function TogglePostTitleTemplate(e){jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(),e||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide()}function ToggleCustomFieldTemplate(e){jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(),e||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide()}function ToggleInputName(e){jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show():(jQuery("#field_input_name_container").hide(),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(e){var t=GetSelectedField(),i=t.enablePrice?"_and_price":"",l=jQuery("#gfield_settings_choices_container");l.removeClass("choice_with_price choice_with_value choice_with_value_and_price"),jQuery("#field_choice_values_enabled").is(":checked")?l.addClass("choice_with_value"+i):t.enablePrice&&l.addClass("choice_with_price")}function ToggleInputChoiceValue(e,t){void 0===t&&(t=!1);var i=GetSelectedField(),l=e.find("li").data("input_id");GetInput(i,l).enableChoiceValue=t,e.removeClass("choice_with_value"),t&&e.addClass("choice_with_value")}function ToggleCopyValuesActivated(e){jQuery(".field_selected .copy_values_activated").prop("checked",e);var t=GetSelectedField();jQuery("#input_"+t.id).toggle(!e)}function TogglePageButton(e,t){var i=jQuery("#"+e+"_button_text").is(":checked");show_element=i?"#"+e+"_button_text_container":"#"+e+"_button_image_container",hide_element=i?"#"+e+"_button_image_container":"#"+e+"_button_text_container",t?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(e){field=GetSelectedField();var t=jQuery("#"+e+"_button_image").is(":checked")?"image":"text";"image"==(field[e+"Button"].type=t)?(field[e+"Button"].text="",field[e+"Button"].imageUrl=jQuery("#"+e+"_button_image_url").val()):(field[e+"Button"].text=jQuery("#"+e+"_button_text_input").val(),field[e+"Button"].imageUrl="")}function ToggleCustomField(e){var t=jQuery("#field_custom_existing").is(":checked");show_element=t?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=t?"#field_custom_field_name_text":"#field_custom_field_name_select",jQuery(hide_element).hide(),jQuery(show_element).show()}function ToggleInputMask(e){jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!1))}function ToggleInputMaskOptions(e){var t=jQuery("#field_mask_standard").is(":checked"),i=t?"#field_mask_select":"#field_mask_text, .mask_text_description";jQuery(t?"#field_mask_text, .mask_text_description":"#field_mask_select").val("").hide(),jQuery(i).show(),e||(SetFieldProperty("inputMaskValue",""),SetFieldProperty("inputMaskIsCustom",!t))}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(e){var t;jQuery("#field_multiple_files").prop("checked")?(jQuery("#gform_multiple_files_options").show(),(t=jQuery(".gform_fileupload_multifile").data("settings"))&&void 0!==t.chunk_size&&jQuery("#gform_server_max_file_size_notice").hide(),SetFieldProperty("multipleFiles",!0)):(jQuery("#gform_multiple_files_options").hide(),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","")),e||(t=GetSelectedField(),StartChangeInputType("fileupload",t))}function SetAutocompleteProperty(e,t){SetFieldProperty("enableAutocomplete",t),ToggleAutocompleteAttribute(e)}function ToggleAutocompleteAttribute(e){jQuery("#field_enable_autocomplete").is(":checked")?jQuery("#autocomplete_attribute_container").show():jQuery("#autocomplete_attribute_container").hide()}function InitAutocompleteOptions(e){jQuery("#field_enable_autocomplete").prop("checked",!!field.enableAutocomplete),ToggleAutocompleteAttribute(!0)}function HasPostContentField(){for(var e=0;et&&(t=parseFloat(form.fields[i].id));if(form.deletedFields)for(i=0;it&&(t=parseFloat(form.deletedFields[i]));e=parseFloat(t)+1}else e=parseInt(form.nextFieldId);return form.nextFieldId=e+1,e}function GetFirstField(){var e=0;if(e'):jQuery("#sidebar_field_icon").addClass(d),jQuery(".panel-block-tabs__body--settings").each(function(e,t){t=jQuery(t).attr("id");0===jQuery("#"+t+" > li").filter(function(){return"none"!==jQuery(this).css("display")}).length?(jQuery("#"+t+"_toggle").hide(),jQuery("#"+t).hide()):jQuery("#"+t+"_toggle").show()}),jQuery("#sidebar_field_info").removeClass("panel-block--hidden"),jQuery("#sidebar_field_info").addClass("panel-block--flex"),jQuery(".field_settings").show(),jQuery(".sidebar").tabs("option","active",1),gform.tools.getNodes('[data-js="choices-ui-content"] > li',!0,document,!0).filter(function(e){return"none"!==window.getComputedStyle(e).getPropertyValue("display")}).length||gform.tools.trigger("gform/flyout/close-all"),gform.tools.trigger("gform/form_editor/setting_selected",document,!1,e)}function TogglePercentageStyle(e){"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show():jQuery(".percentage_custom_container").hide()}function TogglePercentageConfirmationText(e){jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show():jQuery(".percentage_confirmation_page_name_setting").hide()}function CustomFieldExists(e){if(!e)return!0;for(var t=jQuery("#field_custom_field_name_select option"),i=0;i";for(key in gform_custom_choices)gform_custom_choices.hasOwnProperty(key)&&(e='SelectCustomChoice( jQuery(this).data("key") );',t+="
  • "+escapeHtml(key)+"
  • ");t+="
  • "+gf_vars.predefinedChoices+"
  • ",jQuery("#bulk_items").prepend(t)}}function SelectCustomChoice(e){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[e].join("\n")),gform_selected_custom_choice=e,InitBulkCustomPanel()}function SelectPredefinedChoice(e){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[e].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(e){(field=GetSelectedField()).choices=new Array;for(var t,i=!1,l=0;l"+field.choices[d].text+"";break;case"checkbox":for(d=0;d")}5"+gf_vars.editToViewAll.replace("%d",field.choices.length)+""),field.enableSelectAll&&(t+='");break;case"radio":for(var a,d=0;d");t+=field.enableOtherChoice?"<"+i+">":"",5"+gf_vars.editToViewAll.replace("%d",field.choices.length)+"");break;case"list":RefreshSelectedFieldPreview()}jQuery(".field_selected "+(".gfield_"+e)).html(t)}function UpdateInputChoices(e){for(var t="",i=0;i"+e.choices[i].text+""}var d=e.id.toString().replace(".","_");jQuery(".field_selected #input_"+d).html(t)}function InsertFieldChoice(e){field=GetSelectedField();var t=GetInputType(field),i="",l="",d=field.enablePrice?"0.00":"",i=("list"===t&&(i=window.gf_vars.column+" "+(e+1),l=window.gf_vars.column+" "+(e+1)),new Choice(i,l,d));window["gform_new_choice_"+field.type]&&(i=window["gform_new_choice_"+field.type](field,i)),"object"!=typeof field.choices&&(field.choices=[]),field.choices.splice(e,0,i),LoadFieldChoices(field),UpdateFieldChoices(t)}function InsertInputChoice(e,t,i){var l=GetSelectedField(),l=GetInput(l,t),t=new Choice("","");l.choices.splice(i,0,t),LoadInputChoices(e,l),UpdateInputChoices(l)}function DeleteFieldChoice(e){field=GetSelectedField();var t=jQuery("#"+GetInputType(field)+"_choice_value_"+e).val();HasConditionalLogicDependency(field.id,t)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(e,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(e,t,i){var l=GetSelectedField(),l=GetInput(l,t);l.choices.splice(i,1),LoadInputChoices(e,l),UpdateInputChoices(l)}function MoveFieldChoice(e,t){var i=(field=GetSelectedField()).choices[e];field.choices.splice(e,1),field.choices.splice(t,0,i),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(e,t,i,l){var d=GetSelectedField(),d=GetInput(d,t),t=d.choices[i];d.choices.splice(i,1),d.choices.splice(l,0,t),LoadInputChoices(e,d),UpdateInputChoices(d)}function GetFieldType(e){return e.substr(0,e.lastIndexOf("_"))}function GetSelectedField(){var e=jQuery(".field_selected");return!(e.length<=0)&&(e=e[0].id.substr(6),GetFieldById(e))}function SetPasswordProperty(e){SetFieldProperty("enablePasswordInput",e)}function ToggleDateCalendar(e){var t=jQuery("#field_date_input_type").val();"datefield"==t||"datedropdown"==t?(jQuery("#date_picker_container").hide(),SetCalendarIconType("none")):jQuery("#date_picker_container").show()}function ToggleCalendarIconUrl(e){jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show():(jQuery("#gfield_icon_url_container").hide(),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(e){SetFieldProperty("timeFormat",e),LoadTimeInputs()}function LoadTimeInputs(){var e=GetSelectedField();"time"!=e.type&&"time"!=e.inputType||("24"==jQuery("#field_time_format").val()?(jQuery("#input_default_value_row_input_"+e.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+e.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+e.id+"_3").hide())}function SetDateFormat(e){SetFieldProperty("dateFormat",e);var t,e=GetSelectedField();"datepicker"===e.dateType&&(t=jQuery("#field_date_format option:selected").text(),""===e.placeholder)&&jQuery('.field_selected input[name="ginput_datepicker"]').attr("placeholder",t),LoadDateInputs()}function LoadDateInputs(){var e=jQuery("#field_date_input_type").val(),t=jQuery("#field_date_format").val(),t=t?t.substr(0,3):"mdy";if("datefield"==e){switch(t){case"ymd":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day"),jQuery(".field_selected #gfield_input_date_year").remove().insertBefore(".field_selected #gfield_input_date_month");break;case"mdy":jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_day");break;case"dmy":jQuery(".field_selected #gfield_input_date_month").remove().insertBefore(".field_selected #gfield_input_date_year"),jQuery(".field_selected #gfield_input_date_day").remove().insertBefore(".field_selected #gfield_input_date_month")}jQuery(".field_selected [id^='gfield_input_date']").show(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==e){switch(t){case"ymd":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day"),jQuery(".field_selected #gfield_dropdown_date_year").remove().insertBefore(".field_selected #gfield_dropdown_date_month");break;case"mdy":jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_day");break;case"dmy":jQuery(".field_selected #gfield_dropdown_date_month").remove().insertBefore(".field_selected #gfield_dropdown_date_year"),jQuery(".field_selected #gfield_dropdown_date_day").remove().insertBefore(".field_selected #gfield_dropdown_date_month")}jQuery(".field_selected [id^='gfield_dropdown_date']").css("display","inline"),jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected [id^='gfield_input_date']").hide(),jQuery(".field_selected [id^='gfield_dropdown_date']").hide(),jQuery(".field_selected #gfield_input_datepicker").show(),jQuery("#gsetting_icon_calendar").is(":checked")?jQuery(".field_selected #gfield_input_datepicker_icon").show():jQuery(".field_selected #gfield_input_datepicker_icon").hide()}function SetCalendarIconType(e,t){field=GetSelectedField(),"date"==GetInputType(field)&&("none"==(e=null==e?"none":e)?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==e?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==e&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",e),ToggleCalendarIconUrl(t),LoadDateInputs())}function SetDateInputType(e){field=GetSelectedField(),"date"==GetInputType(field)&&("datepicker"===e?SetFieldAccessibilityWarning("date_input_type_setting","above"):resetAllFieldAccessibilityWarnings(),field.dateType=e,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var e=jQuery("#gfield_display_alt").is(":checked"),t=jQuery("#gfield_display_title").is(":checked"),i=jQuery("#gfield_display_caption").is(":checked"),l=jQuery("#gfield_display_description").is(":checked"),d=e||t||i||l;SetFieldProperty("displayAlt",e),SetFieldProperty("displayTitle",t),SetFieldProperty("displayCaption",i),SetFieldProperty("displayDescription",l),jQuery(".field_selected .ginput_post_image_alt").css("display",e?"block":"none"),jQuery(".field_selected .ginput_post_image_title").css("display",t?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",i?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",l?"block":"none"),jQuery(".field_selected .ginput_post_image_file").css("display",d?"block":"none")}function SetFeaturedImage(){if(jQuery("#gfield_featured_image").is(":checked")){for(i in form.fields)form.fields.hasOwnProperty(i)&&(form.fields[i].postFeaturedImage=!1);SetFieldProperty("postFeaturedImage",!0)}else SetFieldProperty("postFeaturedImage",!1)}function SetFieldProperty(e,t){null==t&&(t="");var i=GetSelectedField(),l=rgar(i,e);i[e]=t,window.gform.doAction("gform_post_set_field_property",e,i,t,l)}function SetInputName(e,t){var i=GetSelectedField();if(e=e&&e.trim(),t){for(var l=0;lt.text.toLowerCase()})}function SetFieldLabel(e){var t=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(e).append(t),SetFieldProperty("label",e)}function SetAriaLabel(e){var t=jQuery(".field_selected")[0].id.split("_")[1],t=GetFieldById(t),e=window.gf_vars.fieldLabelAriaLabel.replace("{field_label}",e).replace("{field_type}",t.type);jQuery(".field_selected .gfield-edit").attr("aria-label",e)}function SetCaptchaTheme(e,t){jQuery(".field_selected .gfield_captcha").attr("src",t),SetFieldProperty("captchaTheme",e)}function SetCaptchaSize(e){var t=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",e),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(t+"_small").removeClass(t+"_medium").removeClass(t+"_large").addClass(t+"_"+e)}function SetCaptchaFontColor(e){SetFieldProperty("simpleCaptchaFontColor",e),RedrawCaptcha()}function SetCaptchaBackgroundColor(e){SetFieldProperty("simpleCaptchaBackgroundColor",e),RedrawCaptcha()}function RedrawCaptcha(){"math"==jQuery("#field_captcha_type").val()?(url_1=GetCaptchaUrl(1),url_2=GetCaptchaUrl(2),url_3=GetCaptchaUrl(3),jQuery(".field_selected .gfield_captcha:eq(0)").attr("src",url_1),jQuery(".field_selected .gfield_captcha:eq(1)").attr("src",url_2),jQuery(".field_selected .gfield_captcha:eq(2)").attr("src",url_3)):(url=GetCaptchaUrl(),jQuery(".field_selected .gfield_captcha").attr("src",url))}function SetFieldEnhancedUI(e){SetFieldProperty("enableEnhancedUI",e?1:0),e?SetFieldAccessibilityWarning("enable_enhanced_ui_setting","below"):resetAllFieldAccessibilityWarnings()}function SetFieldSize(e){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(e),SetFieldProperty("size",e)}function SetFieldLabelPlacement(e){var t=e||form.labelPlacement;SetFieldProperty("labelPlacement",e),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(t),"left_label"==field.labelPlacement||"right_label"==field.labelPlacement||""==field.labelPlacement&&"top_label"!=form.labelPlacement?(jQuery("#field_description_placement").val(""),SetFieldProperty("descriptionPlacement",""),jQuery("#field_description_placement_container").hide("slow")):jQuery("#field_description_placement_container").show("slow"),"hidden_label"==field.labelPlacement?SetFieldAccessibilityWarning("label_placement_setting","above"):resetAllFieldAccessibilityWarnings(),SetFieldProperty("labelPlacement",e),SetFieldRequired(field.isRequired),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(e){var t="above"==e||""==e&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",e),RefreshSelectedFieldPreview(function(){t?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(e){SetFieldProperty("subLabelPlacement",e),RefreshSelectedFieldPreview(function(){"above"===e?jQuery(".field_selected").addClass("field_sublabel_above").removeClass("field_sublabel_below"):jQuery(".field_selected").addClass("field_sublabel_below").removeClass("field_sublabel_above")})}function SetFieldVisibility(e,t,i){if(!i&&"administrative"==e&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var l=!1,d=0;d div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(e),SetFieldProperty("defaultValue",e)}function SetFieldPlaceholder(i){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var e=this.nodeName,t=jQuery(this);"INPUT"==e||"TEXTAREA"==e?jQuery(this).prop("placeholder",i):"SELECT"==e&&(0<(e=t.find('option[value=""]')).length?0'+i+""),t.val("")))}),SetFieldProperty("placeholder",i)}function SetFieldDescription(e){SetFieldProperty("description",e=null==e?"":e)}function SetFieldCheckboxLabel(e){SetFieldProperty("checkboxLabel",e=null==e?"":e)}function SetPasswordStrength(e){e?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",e)}function ToggleEmailSettings(e){e=void 0!==e.emailConfirmEnabled&&1==e.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!e),jQuery(".default_value_setting").toggle(!e),jQuery(".sub_label_placement_setting").toggle(e),jQuery(".sub_labels_setting").toggle(e),jQuery(".default_input_values_setting").toggle(e),jQuery(".input_placeholders_setting").toggle(e)}function SetEmailConfirmation(e){var t=GetSelectedField();(e?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email")):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email"))).show(),t.emailConfirmEnabled=e,t.inputs=GetEmailFieldInputs(t),CreateDefaultValuesUI(t),CreatePlaceholdersUI(t),CreateAutocompleteUI(t),CreateCustomizeInputsUI(t),CreateInputLabelsUI(t),ToggleEmailSettings(t)}function SetCardType(e,t){var i=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;jQuery(e).is(":checked")?-1==jQuery.inArray(t,i)&&(jQuery(".gform_card_icon_"+t).fadeIn(),i[i.length]=t):-1!=(e=jQuery.inArray(t,i))&&(jQuery(".gform_card_icon_"+t).fadeOut(),i.splice(e,1)),SetFieldProperty("creditCards",i)}function SetFieldRequired(e){var t=gform_form_strings.requiredIndicator,i=".field_selected .gfield_required",l=!1;"consent"===field.type?(jQuery(i).remove(),e&&(l=!0)):0'+t+"")),SetFieldProperty("isRequired",e)}function SetMaxLength(e){var t=GetMaxLengthPattern(),l="",d=e.value.split("");for(i in d)!d.hasOwnProperty(i)||t.test(d[i])||(l+=d[i]);SetFieldProperty("maxLength",e.value=l)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(e,t,i){var i=void 0===i||i,l=e.which||e.keyCode,t=t.test(String.fromCharCode(l));return!!e.ctrlKey||(i?t:!t)}function IndexOf(e,t){for(var i=0;i',o=(r=(r+='')+('
    '+(i=void 0===i?getFieldErrorMessage(e):i)+"
    ")+"",jQuery("."+e));o.addClass("error"),jQuery('.gform-alert--error[data-field-setting="'+e+'"]').remove(),"above"===t?o.before(r):o.after(r)}}function resetFieldError(e){var t=GetSelectedField(),t=t.hasOwnProperty("errors")?t.errors:[];void 0!==e&&(jQuery('.gform-alert--error[data-field-setting="'+e+'"]').remove(),jQuery("."+e).removeClass("error"),-1<(e=t.indexOf(e)))&&(1').appendTo("body"),jQuery(document.createElement("div")).attr("id","iColorPickerBg").click(function(){jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut()}).appendTo("body"),jQuery("table.pickerTable td").css({width:"12px",height:"14px",border:"1px solid #000",cursor:"pointer"}),jQuery("#iColorPicker table.pickerTable").css({"border-collapse":"collapse"}),jQuery("#iColorPicker").css({border:"1px solid #ccc",background:"#333",padding:"5px",color:"#fff","z-index":9999})),jQuery("#colorPreview").css({height:"50px"})})},jQuery(function(){iColorPicker()}),jQuery(document).mouseup(function(e){var t=jQuery("#iColorPicker");t.is(e.target)||0!==t.has(e.target).length||(jQuery("#iColorPickerBg").hide(),jQuery("#iColorPicker").fadeOut())}),jQuery.fn.gfSlide=function(e){var t=jQuery(".field_settings").is(":visible");return"up"==e?t?this.slideUp():this.hide():t?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(e,t){return e="administrative"!=t.visibility&&t.id!=GetSelectedField().id?e:!1}); \ No newline at end of file diff --git a/js/gravityforms.js b/js/gravityforms.js index de18afa..dc5418c 100644 --- a/js/gravityforms.js +++ b/js/gravityforms.js @@ -33,7 +33,7 @@ function announceAJAXValidationErrors() { } //Formatting free form currency fields to currency -jQuery( document ).bind( 'gform_post_render', gformBindFormatPricingFields ); +jQuery( document ).on( 'gform_post_render', gformBindFormatPricingFields ); function gformBindFormatPricingFields(){ // Namespace the event and remove before adding to prevent double binding. @@ -2746,14 +2746,14 @@ function gformValidateFileSize( field, max_file_size ) { var imagesUrl = typeof gform_gravityforms != 'undefined' ? gform_gravityforms.vars.images_url : ""; - $(document).bind('gform_post_render', function(e, formID){ + $(document).on('gform_post_render', function(e, formID){ $("form#gform_" + formID + " .gform_fileupload_multifile").each(function(){ setup(this); }); var $form = $("form#gform_" + formID); if($form.length > 0){ - $form.submit(function(){ + $form.on( 'submit', function(){ var pendingUploads = false; $.each(gfMultiFileUploader.uploaders, function(i, uploader){ if(uploader.total.queued>0){ @@ -2772,7 +2772,7 @@ function gformValidateFileSize( field, max_file_size ) { }); - $(document).bind("gform_post_conditional_logic", function(e,formID, fields, isInit){ + $(document).on("gform_post_conditional_logic", function(e,formID, fields, isInit){ if(!isInit){ $.each(gfMultiFileUploader.uploaders, function(i, uploader){ uploader.refresh(); @@ -3135,7 +3135,7 @@ function gformInitSpinner(formId, spinnerUrl, isLegacy = true) { isLegacy = true; } - jQuery('#gform_' + formId).submit(function () { + jQuery('#gform_' + formId).on( 'submit', function () { if ( isLegacy ) { gformAddSpinner(formId, spinnerUrl); return; @@ -3484,16 +3484,18 @@ String.prototype.format = function() { * @since 2.5 */ jQuery( document ).ready( function() { - jQuery( '#gform-form-toolbar__menu > li' ) - .hover( function() { + jQuery( '#gform-form-toolbar__menu' ) + .on( 'mouseenter', '> li',function() { jQuery( this ).find( '.gform-form-toolbar__submenu' ).toggleClass( 'open' ); jQuery( this ).find( '.has_submenu' ).toggleClass( 'submenu-open' ); - }, function() { + } ); + jQuery( '#gform-form-toolbar__menu' ) + .on( 'mouseleave', '> li',function() { jQuery( '.gform-form-toolbar__submenu.open' ).removeClass( 'open' ); jQuery( '.has_submenu.submenu-open' ).removeClass( 'submenu-open' ); } ); jQuery( '#gform-form-toolbar__menu .has_submenu' ) - .click( function( e ) { + .on( 'click', function( e ) { e.preventDefault(); } ); } ); diff --git a/js/gravityforms.min.js b/js/gravityforms.min.js index 216be46..e2d2033 100644 --- a/js/gravityforms.min.js +++ b/js/gravityforms.min.js @@ -1 +1 @@ -var gform=window.gform||{};function announceAJAXValidationErrors(){var e;jQuery(".gform_validation_errors").length&&((e=document.querySelector('[data-js="gform-focus-validation-error"]'))&&(e.setAttribute("tabindex","-1"),e.focus()),setTimeout(function(){wp.a11y.speak(jQuery(".gform_validation_errors > h2").text())},1e3))}function gformBindFormatPricingFields(){jQuery(".ginput_amount, .ginput_donation_amount").off("change.gform").on("change.gform",function(){gformFormatPricingField(this)}),jQuery(".ginput_amount, .ginput_donation_amount").each(function(){gformFormatPricingField(this)})}function Currency(e){this.currency=e,this.toNumber=function(e){return this.isNumeric(e)?parseFloat(e):gformCleanNumber(e,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)},this.toMoney=function(e,t){if(!1===(e=(t=t||!1)?e:gformCleanNumber(e,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)))return"";"-"==(e+=negative="")[0]&&(e=parseFloat(e.substr(1)),negative="-"),"0.00"==(money=this.numberFormat(e,this.currency.decimals,this.currency.decimal_separator,this.currency.thousand_separator))&&(negative="");t=this.currency.symbol_left?this.currency.symbol_left+this.currency.symbol_padding:"",e=this.currency.symbol_right?this.currency.symbol_padding+this.currency.symbol_right:"";return money=negative+this.htmlDecode(t)+money+this.htmlDecode(e)},this.numberFormat=function(e,t,r,i,n){n=void 0===n||n,e=(e+"").replace(",","").replace(" ","");var e=isFinite(+e)?+e:0,o=isFinite(+t)?Math.abs(t):0,i=void 0===i?",":i,r=void 0===r?".":r,a="";return 3<(a=("0"==t?(e+=1e-10,""+Math.round(e)):-1==t?""+e:function(e,t){t=Math.pow(10,t);return""+Math.round(e*t)/t}(e+=1e-10,o)).split("."))[0].length&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),n&&(a[1]||"").length/i,"").replace(o,""),a=0==gformToNumber(a=gformGetPriceDifference(r,t))?"":" "+a,e=(e.attr("price",a),"option"==e[0].tagName.toLowerCase()?a:""+a+""),a=o+e;return a=window.gform_format_option_label?gform_format_option_label(a,o,e,r,t,i,n):a}function gformGetProductIds(e,t){for(var r=(jQuery(t).hasClass(e)?jQuery(t):jQuery(t).parents("."+e)).attr("class").split(" "),i=0;it?(r.text(e.name+" - "+gform_gravityforms.strings.file_exceeds_limit),wp.a11y.speak(e.name+" - "+gform_gravityforms.strings.file_exceeds_limit)):r.remove())}function gformInitSpinner(t,r,i=!0){gform.applyFilters("gform_spinner_url",r,t)!=r&&(i=!0),jQuery("#gform_"+t).submit(function(){var e;i?gformAddSpinner(t,r):(e=gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+t+", #gform_wrapper_"+t+" .gform_next_button, #gform_send_resume_link_button_"+t),t),gformInitializeSpinner(t,e))})}function gformInitializeSpinner(e,t,r="gform-ajax-spinner"){0==jQuery("#gform_ajax_spinner_"+e).length&&(r='',(t instanceof jQuery?t:jQuery(t)).after(r))}function gformRemoveSpinner(e="gform-ajax-spinner"){e=document.querySelector('[data-js-spinner-id="'+e+'"]');e&&e.remove()}function gformAddSpinner(e,t){void 0!==t&&t||(t=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e)),0==jQuery("#gform_ajax_spinner_"+e).length&&gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e).after('')}function gformReInitTinymceInstance(e,t){var r,i,n;e&&t?(r=window.tinymce)?(i=r.get("input_"+e+"_"+t))?(n=jQuery.extend({},i.settings),i.remove(),r.init(n),gform.console.log("gformReInitTinymceInstance reinitialized TinyMCE on input_"+e+"_"+t+".")):gform.console.error("gformReInitTinymceInstance did not find an instance for input_"+e+"_"+t+"."):gform.console.error("gformReInitTinymceInstance requires tinymce to be available."):gform.console.error("gformReInitTinymceInstance requires a form and field id.")}function gf_raw_input_change(e,t){clearTimeout(__gf_keyup_timeout);var r=jQuery(t),i=r.attr("id"),n=gf_get_input_id_by_html_id(i),o=gf_get_form_id_by_html_id(i),i=gform.applyFilters("gform_field_meta_raw_input_change",{fieldId:n,formId:o},r,e),n=i.fieldId,o=i.formId;n&&(r=!(i=r.is(":checkbox")||r.is(":radio")||r.is("select"))||r.is("textarea"),"keyup"==e.type&&!r||"change"==e.type&&!i&&!r||("keyup"==e.type?__gf_keyup_timeout=setTimeout(function(){gf_input_change(t,o,n)},300):gf_input_change(t,o,n)))}function gf_get_input_id_by_html_id(e){var e=gf_get_ids_by_html_id(e),t=e[e.length-1];return 3==e.length&&(e.shift(),t=e.join(".")),t}function gf_get_form_id_by_html_id(e){return gf_get_ids_by_html_id(e)[0]}function gf_get_ids_by_html_id(e){for(var t=e?e.split("_"):[],r=t.length-1;0<=r;r--)gformIsNumber(t[r])||t.splice(r,1);return t}function gf_input_change(e,t,r){gform.doAction("gform_input_change",e,t,r)}function gformExtractFieldId(e){var t=parseInt(e.toString().split(".")[0],10);return t||e}function gformExtractInputIndex(e){e=parseInt(e.toString().split(".")[1],10);return e||!1}gform.recaptcha={renderRecaptcha:function(){jQuery(".ginput_recaptcha:not(.gform-initialized)").each(function(){var t=jQuery(this),e={sitekey:t.data("sitekey"),theme:t.data("theme"),tabindex:t.data("tabindex")},r=(t.data("stoken")&&(e.stoken=t.data("stoken")),!1);"invisible"==t.data("size")&&(r=function(e){e&&t.closest("form").submit()}),(r=gform.applyFilters("gform_recaptcha_callback",r,t))&&(e.callback=r),t.data("widget-id",grecaptcha.render(this.id,e)),e.tabindex&&t.find("iframe").attr("tabindex",e.tabindex),t.addClass("gform-initialized"),gform.doAction("gform_post_recaptcha_render",t)})},gformIsRecaptchaPending:function(e){var e=e.find(".ginput_recaptcha");return!(!e.length||"invisible"!==e.data("size")||(e=e.find(".g-recaptcha-response")).length&&e.val())},needsRender:function(){return document.querySelectorAll(".ginput_recaptcha:not(.gform-initialized)")[0]},renderOnRecaptchaLoaded:function(){var e;gform.recaptcha.needsRender()&&(e=setInterval(function(){window.grecaptcha&&window.grecaptcha.render&&(this.renderRecaptcha(),clearInterval(e))},100))}},gform.initializeOnLoaded(gform.recaptcha.renderOnRecaptchaLoaded),jQuery(document).on("gform_post_render",gform.recaptcha.renderOnRecaptchaLoaded),window.renderRecaptcha=gform.recaptcha.renderRecaptcha,window.gformIsRecaptchaPending=gform.recaptcha.gformIsRecaptchaPending,!function(g,m){g.uploaders={};var _="undefined"!=typeof gform_gravityforms?gform_gravityforms.strings:{},p="undefined"!=typeof gform_gravityforms?gform_gravityforms.vars.images_url:"";function i(o){var f,r,e=m(o).data("settings"),t=new plupload.Uploader(e);function d(e,t){m("#"+e).prepend("
  • "+h(t)+"
  • "),setTimeout(function(){wp.a11y.speak(m("#"+e).text())},1e3)}function l(e){var t=parseInt(e.gf_vars.max_files,10);0{1}{2}{5}',t,r,_,i,o).gformFormat(t.id,h(t.name),r,_.cancel_upload,i,_.cancel),m("#"+o.settings.filelist).prepend(n),s++)}),o.refresh(),0==(t=m("form#gform_"+f+" "+(e="input:hidden[name='gform_unique_id']"))).length&&(t=m(e)),""===(r=t.val())&&(r="xxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),t.val(r)),0'+plupload.formatSize(t.size)+"",a+=''+t.percent+"%",n=e.settings.multipart_params.form_id,i=e.settings.multipart_params.field_id,a="undefined"!=typeof gf_legacy&&gf_legacy.is_legacy?""+_.delete_file+" "+a:a+"",a=gform.applyFilters("gform_file_upload_markup",a,t,e,_,p,r),m("#"+t.id).html(a),m("#"+t.id+" span.gfield_fileupload_progressbar_progress").css("width",t.percent+"%"),100==t.percent&&(r.status&&"ok"==r.status?(n=i,o=r.data,(a=c(n)).unshift(o),i=n,r=a,o=s(),n=m("#gform_uploaded_files_"+f),i=u(i),o[i]=r,n.val(m.toJSON(o))):d(e.settings.gf_vars.message_id,_.unknown_error+": "+t.name))))}),t.bind("FilesRemoved",function(e,t){l(e.settings)}),m("#"+e.drop_element).on({dragenter:n,dragover:n})}function h(e){return m("
    ").text(e).html()}m(document).bind("gform_post_render",function(e,t){m("form#gform_"+t+" .gform_fileupload_multifile").each(function(){i(this)});var r=m("form#gform_"+t);0 li").hover(function(){jQuery(this).find(".gform-form-toolbar__submenu").toggleClass("open"),jQuery(this).find(".has_submenu").toggleClass("submenu-open")},function(){jQuery(".gform-form-toolbar__submenu.open").removeClass("open"),jQuery(".has_submenu.submenu-open").removeClass("submenu-open")}),jQuery("#gform-form-toolbar__menu .has_submenu").click(function(e){e.preventDefault()})}),jQuery(document).ready(function(){jQuery(".gform-settings-field").each(function(){1 .gform-settings-input__container").length&&jQuery(this).addClass("gform-settings-field--multiple-inputs")})}),jQuery(function(){gform.tools.trigger("gform_main_scripts_loaded")}); \ No newline at end of file +var gform=window.gform||{};function announceAJAXValidationErrors(){var e;jQuery(".gform_validation_errors").length&&((e=document.querySelector('[data-js="gform-focus-validation-error"]'))&&(e.setAttribute("tabindex","-1"),e.focus()),setTimeout(function(){wp.a11y.speak(jQuery(".gform_validation_errors > h2").text())},1e3))}function gformBindFormatPricingFields(){jQuery(".ginput_amount, .ginput_donation_amount").off("change.gform").on("change.gform",function(){gformFormatPricingField(this)}),jQuery(".ginput_amount, .ginput_donation_amount").each(function(){gformFormatPricingField(this)})}function Currency(e){this.currency=e,this.toNumber=function(e){return this.isNumeric(e)?parseFloat(e):gformCleanNumber(e,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)},this.toMoney=function(e,t){if(!1===(e=(t=t||!1)?e:gformCleanNumber(e,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)))return"";"-"==(e+=negative="")[0]&&(e=parseFloat(e.substr(1)),negative="-"),"0.00"==(money=this.numberFormat(e,this.currency.decimals,this.currency.decimal_separator,this.currency.thousand_separator))&&(negative="");t=this.currency.symbol_left?this.currency.symbol_left+this.currency.symbol_padding:"",e=this.currency.symbol_right?this.currency.symbol_padding+this.currency.symbol_right:"";return money=negative+this.htmlDecode(t)+money+this.htmlDecode(e)},this.numberFormat=function(e,t,r,i,n){n=void 0===n||n,e=(e+"").replace(",","").replace(" ","");var e=isFinite(+e)?+e:0,o=isFinite(+t)?Math.abs(t):0,i=void 0===i?",":i,r=void 0===r?".":r,a="";return 3<(a=("0"==t?(e+=1e-10,""+Math.round(e)):-1==t?""+e:function(e,t){t=Math.pow(10,t);return""+Math.round(e*t)/t}(e+=1e-10,o)).split("."))[0].length&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),n&&(a[1]||"").length/i,"").replace(o,""),a=0==gformToNumber(a=gformGetPriceDifference(r,t))?"":" "+a,e=(e.attr("price",a),"option"==e[0].tagName.toLowerCase()?a:""+a+""),a=o+e;return a=window.gform_format_option_label?gform_format_option_label(a,o,e,r,t,i,n):a}function gformGetProductIds(e,t){for(var r=(jQuery(t).hasClass(e)?jQuery(t):jQuery(t).parents("."+e)).attr("class").split(" "),i=0;it?(r.text(e.name+" - "+gform_gravityforms.strings.file_exceeds_limit),wp.a11y.speak(e.name+" - "+gform_gravityforms.strings.file_exceeds_limit)):r.remove())}function gformInitSpinner(t,r,i=!0){gform.applyFilters("gform_spinner_url",r,t)!=r&&(i=!0),jQuery("#gform_"+t).on("submit",function(){var e;i?gformAddSpinner(t,r):(e=gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+t+", #gform_wrapper_"+t+" .gform_next_button, #gform_send_resume_link_button_"+t),t),gformInitializeSpinner(t,e))})}function gformInitializeSpinner(e,t,r="gform-ajax-spinner"){0==jQuery("#gform_ajax_spinner_"+e).length&&(r='',(t instanceof jQuery?t:jQuery(t)).after(r))}function gformRemoveSpinner(e="gform-ajax-spinner"){e=document.querySelector('[data-js-spinner-id="'+e+'"]');e&&e.remove()}function gformAddSpinner(e,t){void 0!==t&&t||(t=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e)),0==jQuery("#gform_ajax_spinner_"+e).length&&gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e).after('')}function gformReInitTinymceInstance(e,t){var r,i,n;e&&t?(r=window.tinymce)?(i=r.get("input_"+e+"_"+t))?(n=jQuery.extend({},i.settings),i.remove(),r.init(n),gform.console.log("gformReInitTinymceInstance reinitialized TinyMCE on input_"+e+"_"+t+".")):gform.console.error("gformReInitTinymceInstance did not find an instance for input_"+e+"_"+t+"."):gform.console.error("gformReInitTinymceInstance requires tinymce to be available."):gform.console.error("gformReInitTinymceInstance requires a form and field id.")}function gf_raw_input_change(e,t){clearTimeout(__gf_keyup_timeout);var r=jQuery(t),i=r.attr("id"),n=gf_get_input_id_by_html_id(i),o=gf_get_form_id_by_html_id(i),i=gform.applyFilters("gform_field_meta_raw_input_change",{fieldId:n,formId:o},r,e),n=i.fieldId,o=i.formId;n&&(r=!(i=r.is(":checkbox")||r.is(":radio")||r.is("select"))||r.is("textarea"),"keyup"==e.type&&!r||"change"==e.type&&!i&&!r||("keyup"==e.type?__gf_keyup_timeout=setTimeout(function(){gf_input_change(t,o,n)},300):gf_input_change(t,o,n)))}function gf_get_input_id_by_html_id(e){var e=gf_get_ids_by_html_id(e),t=e[e.length-1];return 3==e.length&&(e.shift(),t=e.join(".")),t}function gf_get_form_id_by_html_id(e){return gf_get_ids_by_html_id(e)[0]}function gf_get_ids_by_html_id(e){for(var t=e?e.split("_"):[],r=t.length-1;0<=r;r--)gformIsNumber(t[r])||t.splice(r,1);return t}function gf_input_change(e,t,r){gform.doAction("gform_input_change",e,t,r)}function gformExtractFieldId(e){var t=parseInt(e.toString().split(".")[0],10);return t||e}function gformExtractInputIndex(e){e=parseInt(e.toString().split(".")[1],10);return e||!1}gform.recaptcha={renderRecaptcha:function(){jQuery(".ginput_recaptcha:not(.gform-initialized)").each(function(){var t=jQuery(this),e={sitekey:t.data("sitekey"),theme:t.data("theme"),tabindex:t.data("tabindex")},r=(t.data("stoken")&&(e.stoken=t.data("stoken")),!1);"invisible"==t.data("size")&&(r=function(e){e&&t.closest("form").submit()}),(r=gform.applyFilters("gform_recaptcha_callback",r,t))&&(e.callback=r),t.data("widget-id",grecaptcha.render(this.id,e)),e.tabindex&&t.find("iframe").attr("tabindex",e.tabindex),t.addClass("gform-initialized"),gform.doAction("gform_post_recaptcha_render",t)})},gformIsRecaptchaPending:function(e){var e=e.find(".ginput_recaptcha");return!(!e.length||"invisible"!==e.data("size")||(e=e.find(".g-recaptcha-response")).length&&e.val())},needsRender:function(){return document.querySelectorAll(".ginput_recaptcha:not(.gform-initialized)")[0]},renderOnRecaptchaLoaded:function(){var e;gform.recaptcha.needsRender()&&(e=setInterval(function(){window.grecaptcha&&window.grecaptcha.render&&(this.renderRecaptcha(),clearInterval(e))},100))}},gform.initializeOnLoaded(gform.recaptcha.renderOnRecaptchaLoaded),jQuery(document).on("gform_post_render",gform.recaptcha.renderOnRecaptchaLoaded),window.renderRecaptcha=gform.recaptcha.renderRecaptcha,window.gformIsRecaptchaPending=gform.recaptcha.gformIsRecaptchaPending,!function(g,m){g.uploaders={};var _="undefined"!=typeof gform_gravityforms?gform_gravityforms.strings:{},p="undefined"!=typeof gform_gravityforms?gform_gravityforms.vars.images_url:"";function i(o){var f,r,e=m(o).data("settings"),t=new plupload.Uploader(e);function d(e,t){m("#"+e).prepend("
  • "+h(t)+"
  • "),setTimeout(function(){wp.a11y.speak(m("#"+e).text())},1e3)}function l(e){var t=parseInt(e.gf_vars.max_files,10);0{1}{2}{5}',t,r,_,i,o).gformFormat(t.id,h(t.name),r,_.cancel_upload,i,_.cancel),m("#"+o.settings.filelist).prepend(n),s++)}),o.refresh(),0==(t=m("form#gform_"+f+" "+(e="input:hidden[name='gform_unique_id']"))).length&&(t=m(e)),""===(r=t.val())&&(r="xxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),t.val(r)),0'+plupload.formatSize(t.size)+"",a+=''+t.percent+"%",n=e.settings.multipart_params.form_id,i=e.settings.multipart_params.field_id,a="undefined"!=typeof gf_legacy&&gf_legacy.is_legacy?""+_.delete_file+" "+a:a+"",a=gform.applyFilters("gform_file_upload_markup",a,t,e,_,p,r),m("#"+t.id).html(a),m("#"+t.id+" span.gfield_fileupload_progressbar_progress").css("width",t.percent+"%"),100==t.percent&&(r.status&&"ok"==r.status?(n=i,o=r.data,(a=c(n)).unshift(o),i=n,r=a,o=s(),n=m("#gform_uploaded_files_"+f),i=u(i),o[i]=r,n.val(m.toJSON(o))):d(e.settings.gf_vars.message_id,_.unknown_error+": "+t.name))))}),t.bind("FilesRemoved",function(e,t){l(e.settings)}),m("#"+e.drop_element).on({dragenter:n,dragover:n})}function h(e){return m("
    ").text(e).html()}m(document).on("gform_post_render",function(e,t){m("form#gform_"+t+" .gform_fileupload_multifile").each(function(){i(this)});var r=m("form#gform_"+t);0 li",function(){jQuery(this).find(".gform-form-toolbar__submenu").toggleClass("open"),jQuery(this).find(".has_submenu").toggleClass("submenu-open")}),jQuery("#gform-form-toolbar__menu").on("mouseleave","> li",function(){jQuery(".gform-form-toolbar__submenu.open").removeClass("open"),jQuery(".has_submenu.submenu-open").removeClass("submenu-open")}),jQuery("#gform-form-toolbar__menu .has_submenu").on("click",function(e){e.preventDefault()})}),jQuery(document).ready(function(){jQuery(".gform-settings-field").each(function(){1 .gform-settings-input__container").length&&jQuery(this).addClass("gform-settings-field--multiple-inputs")})}),jQuery(function(){gform.tools.trigger("gform_main_scripts_loaded")}); \ No newline at end of file diff --git a/js/preview.js b/js/preview.js index a07248e..916fb83 100644 --- a/js/preview.js +++ b/js/preview.js @@ -3,7 +3,7 @@ jQuery( document ).ready(function() { // toggle the helper classes that show the form structure jQuery( '.toggle_helpers input[type=checkbox]' ).prop( 'checked',false ); - jQuery('#showgrid').click(function(){ + jQuery('#showgrid').on( 'click', function(){ if(jQuery(this).is(":checked")) { jQuery('#preview_form_container').addClass("showgrid"); } else { @@ -11,7 +11,7 @@ jQuery( document ).ready(function() { } }); - jQuery('#showme').click(function(){ + jQuery('#showme').on( 'click', function(){ if(jQuery(this).is(":checked")) { jQuery('.gform_wrapper form').addClass("gf_showme"); jQuery('#helper_legend_container').css("display", "inline-block"); @@ -26,7 +26,7 @@ jQuery( document ).ready(function() { if (GetCookie("dismissed-notifications")) { jQuery(GetCookie("dismissed-notifications")).hide(); } - jQuery(".hidenotice").click(function () { + jQuery(".hidenotice").on( 'click', function () { var alertId = jQuery(this).closest(".preview_notice").attr("id"); var dismissedNotifications = GetCookie("dismissed-notifications") + ",#" + alertId; jQuery(this).closest(".preview_notice").slideToggle('slow'); @@ -61,7 +61,7 @@ jQuery( document ).ready(function() { jQuery('#browser_size_info').text('Viewport ( Width : ' + jQuery(window).width() + 'px , Height :' + jQuery(window).height() + 'px )'); - jQuery(window).resize(function () { + jQuery(window).on( 'resize', function () { jQuery('#browser_size_info').text('Viewport ( Width : ' + jQuery(window).width() + 'px , Height :' + jQuery(window).height() + 'px )'); }); diff --git a/js/preview.min.js b/js/preview.min.js index 73565e4..021f6cb 100644 --- a/js/preview.min.js +++ b/js/preview.min.js @@ -1 +1 @@ -jQuery(document).ready(function(){function r(e){for(var i=document.cookie.split("; "),r=0;r\n" "Language-Team: Gravity Forms \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-10-05T18:44:03+00:00\n" +"POT-Creation-Date: 2023-10-25T18:08:55+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.8.1\n" "X-Domain: gravityforms\n" @@ -437,7 +437,7 @@ msgstr "" #: export.php:435 #: export.php:558 #: includes/fields/class-gf-field-checkbox.php:170 -#: includes/fields/class-gf-field-checkbox.php:709 +#: includes/fields/class-gf-field-checkbox.php:708 msgid "Select All" msgstr "" @@ -1708,7 +1708,7 @@ msgstr "" #: export.php:435 #: export.php:558 #: includes/fields/class-gf-field-checkbox.php:181 -#: includes/fields/class-gf-field-checkbox.php:720 +#: includes/fields/class-gf-field-checkbox.php:719 msgid "Deselect All" msgstr "" @@ -8636,7 +8636,7 @@ msgstr "" msgid "Allows users to select one or many checkboxes." msgstr "" -#: includes/fields/class-gf-field-checkbox.php:827 +#: includes/fields/class-gf-field-checkbox.php:826 #: includes/fields/class-gf-field-radio.php:185 msgid "%d of %d items shown. Edit field to view all" msgstr "" @@ -9520,7 +9520,7 @@ msgstr "" msgid "There was a problem while inserting the field values" msgstr "" -#: includes/libraries/gf-background-process.php:623 +#: includes/libraries/gf-background-process.php:629 msgid "Every %d Minutes" msgstr ""