diff --git a/change_log.txt b/change_log.txt
index 3bd1a7e..d8ac874 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -1,10 +1,46 @@
------------------------------------------------------------------------------------------------------------------
-Version 2.2.1.2
- - Fixed an issue with license validation request that can prevent license key validation.
+Version 2.2.3
+ - Added security enhancements. Credit: Gennady Kovshenin.
+ - Added support for Mastercard 2-series number.
+ - Fixed an issue which could prevent the gravityhelp.com support forms being successfully submitted when including the System Report from some sites.
+ - Fixed an issue with the ID attribute of the accepted file types message container when multiple File Upload fields are present on the page.
+ - Fixed an issue where a new field could be assigned the same id as a field to be deleted resulting in the new field being lost when the original field is deleted on save.
+ - Fixed an issue with File Upload field URLs in text format notifications containing escaped ampersands.
+ - Fixed missing confirmation message anchor for AJAX enabled single page forms.
+ - Fixed an issue where the urls of deleted files could remain in the multi-file enabled upload field entry value when editing the entry, if a new file was added at the same time.
+ - AF: Added "description" settings field property to display description below settings field.
+ - AF: Added "no_choices" select settings field property to display message when no choice are available for field.
+ - API: Fixed a database error in gform_get_meta_values_for_entries() when searching for meta keys with special characters e.g. hyphens.
------------------------------------------------------------------------------------------------------------------
-Version 2.2.1.1
+Version 2.2.2
+ - Added 'gform_multifile_upload_field' filter to allow field object to be filtered.
+ - Added 'gform_duplicate_field' javascript filter to allow duplicated field to be changed.
+ - Added the 'gform_html_message_template_pre_send_email' filter allowing the html formatted notification message to be overridden.
+ - Updated delivery of files requested for download to prevent third-parties to corrupt the file content.
+ - Updated the System Report.
+ - Fixed issues with the Copy System Report button and the form switcher drop down when no-conflict mode is enabled.
+ - Fixed issue with special characters when defining a new choice group in the bulk editor popup.
+ - Fixed a PHP warning and fatal error related to the Forms toolbar menu.
+ - Fixed the extremely outdated version message remaining after updating to the latest version.
+ - Fixed 'undefined' appearing as a header in the bulk add / predefined choices modal.
+ - Fixed the Members plugin integration which was missing the System Status page capability (gravityforms_system_status).
+ - Fixed styling issue with Entry Updated message.
+ - Fixed the minimum width of the form switcher drop down when all the forms have titles which are only a few characters in length.
+ - Fixed a potential conflict with other plugins that load modified versions of the WP_Background_Process class.
+ - Fixed an issue where dynamic population of a field may fail when the value passed in the query string is 0.
+ - Fixed a PHP notice when using the gf-download file link if the output buffer is not set.
+ - Fixed currently selected multi-select field choices not being selected when editing an entry.
+ - Fixed an issue with the confirmation message markup for AJAX enabled forms containing an extra gforms_confirmation_message div.
+ - Fixed the Forms dashboard widget including trashed forms.
+ - Fixed a PHP fatal error which occurred on the global settings page of the installation wizard when the entry point was the Forms > Add-Ons page.
+ - Fixed an issue with the submission time evaluation of conditional logic rules using the contains operator when the rule value is 0.
+ - Fixed an inconsistency between the front-end and validation character counts for the Paragraph field.
+ - Fixed a fatal error which could occur when checking if the logging add-on is active in some environments.
+ - Fixed an issue with license validation request that can prevent license key validation.
- Fixed a PHP notice on the System Status page with PHP versions older than 5.4.
+ - AF: Fixed a PHP fatal error which could occur with add-ons using the field_map type setting with PHP versions older than 5.3.
+ - AF: Fixed an issue preventing feeds from being processed in the background.
------------------------------------------------------------------------------------------------------------------
Version 2.2.1
diff --git a/common.php b/common.php
index 273905f..47f30a7 100644
--- a/common.php
+++ b/common.php
@@ -2332,6 +2332,14 @@ public static function is_product_field( $field_type ) {
return in_array( $field_type, $product_fields );
}
+ /**
+ * Returns all the plugin capabilities.
+ *
+ * @since 2.2.1.12 Added gravityforms_system_status.
+ * @since unknown
+ *
+ * @return array
+ */
public static function all_caps() {
return array(
'gravityforms_edit_forms',
@@ -2349,6 +2357,7 @@ public static function all_caps() {
'gravityforms_view_updates',
'gravityforms_view_addons',
'gravityforms_preview_forms',
+ 'gravityforms_system_status',
);
}
@@ -2486,7 +2495,7 @@ public static function get_remote_post_params() {
'slug' => $slug,
'version' => $plugin['Version'],
'is_active' => $is_active,
- );
+ );
}
$plugins = json_encode( $plugins );
@@ -2611,15 +2620,15 @@ public static function cache_remote_message() {
public static function post_to_manager( $file, $query, $options ) {
$request_url = GRAVITY_MANAGER_URL . '/' . $file . '?' . $query;
- self::log_debug( 'Posting to manager: ' . $request_url );
+ self::log_debug( __METHOD__ . '(): endpoint: ' . $request_url );
$raw_response = wp_remote_post( $request_url, $options );
- self::log_debug( print_r( $raw_response, true ) );
+ self::log_remote_response( $raw_response );
if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] ) {
- self::log_error( 'Error from manager. Sending to proxy...' );
+ self::log_error( __METHOD__ . '(): Error from manager. Sending to proxy...' );
$request_url = GRAVITY_MANAGER_PROXY_URL . '/proxy.php?f=' . $file . '&' . $query;
$raw_response = wp_remote_post( $request_url, $options );
- self::log_debug( print_r( $raw_response, true ) );
+ self::log_remote_response( $raw_response );
}
return $raw_response;
@@ -3845,7 +3854,7 @@ public static function get_card_types() {
'name' => 'MasterCard',
'slug' => 'mastercard',
'lengths' => '16',
- 'prefixes' => '51,52,53,54,55',
+ 'prefixes' => '51,52,53,54,55,22,23,24,25,26,270,271,272',
'checksum' => true,
),
array(
@@ -3971,9 +3980,12 @@ public static function is_wp_version( $min_version ) {
*
* @return bool If the logging plugin is active.
*/
- public static function is_logging_plugin_active(){
+ public static function is_logging_plugin_active() {
+ if ( ! function_exists( 'is_plugin_active' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
- //In some scenarios, is_plugin_active() will return true when plugin file has been manually deleted.
+ // In some scenarios, is_plugin_active() will return true when plugin file has been manually deleted.
return is_plugin_active( 'gravityformslogging/logging.php' ) && file_exists( trailingslashit( WP_PLUGIN_DIR ) . 'gravityformslogging/logging.php' );
}
@@ -4259,6 +4271,21 @@ public static function log_debug( $message ) {
}
}
+ /**
+ * Log the remote request response.
+ *
+ * @since 2.2.2.1
+ *
+ * @param WP_Error|array $response The remote request response or WP_Error on failure.
+ */
+ public static function log_remote_response( $response ) {
+ if ( is_wp_error( $response ) || isset( $_GET['gform_debug'] ) ) {
+ self::log_error( __METHOD__ . '(): ' . print_r( $response, 1 ) );
+ } else {
+ self::log_debug( sprintf( '%s(): code: %s; body: %s', __METHOD__, wp_remote_retrieve_response_code( $response ), wp_remote_retrieve_body( $response ) ) );
+ }
+ }
+
public static function echo_if( $condition, $text ) {
_deprecated_function( 'GFCommon::echo_if() is deprecated', '1.9.9', 'Use checked() or selected() instead.' );
@@ -4362,8 +4389,8 @@ public static function gf_vars( $echo = true ) {
$gf_vars['removeFieldFilter'] = esc_html__( 'Remove a condition', 'gravityforms' );
$gf_vars['filterAndAny'] = esc_html__( 'Include results if {0} match:', 'gravityforms' );
- $gf_vars['customChoices'] = esc_html__( 'Custom Choices', 'gravityforms' );
-
+ $gf_vars['customChoices'] = esc_html__( 'Custom Choices', 'gravityforms' );
+ $gf_vars['predefinedChoices'] = esc_html__( 'Predefined Choices', 'gravityforms' );
if ( is_admin() && rgget( 'id' ) ) {
@@ -5503,23 +5530,38 @@ private static function format_text_message( $message ) {
}
/**
- * @param $message
- * @param $subject
+ * Maybe wrap the notification message in html tags.
+ *
+ * @since 2.2.0
+ *
+ * @param string $message The notification message. Merge tags have already been processed.
+ * @param string $subject The notification subject line. Merge tags have already been processed.
*
* @return string
*/
private static function format_html_message( $message, $subject ) {
if ( ! preg_match( '/
-
-
+
';
- $default_anchor = $has_pages || $ajax ? true : false;
- $use_anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form_id ), $default_anchor, $form );
- if ( $use_anchor !== false ) {
- $form_string .= "
";
- $action .= "#gf_$form_id";
- }
+ $anchor = self::get_anchor( $form, $ajax );
+ $form_string .= $anchor['tag'];
+ $action .= $anchor['id'];
+
$target = $ajax ? "target='gform_ajax_frame_{$form_id}'" : '';
$form_css_class = ! empty( $form['cssClass'] ) ? "class='{$form_css_class}'" : '';
@@ -1020,9 +1018,9 @@ public static function get_form( $form_id, $display_title = true, $display_descr
$spinner_url = gf_apply_filters( array( 'gform_ajax_spinner_url', $form_id ), GFCommon::get_base_url() . '/images/spinner.gif', $form );
$scroll_position = array( 'default' => '', 'confirmation' => '' );
- if ( $use_anchor !== false ) {
- $scroll_position['default'] = is_numeric( $use_anchor ) ? 'jQuery(document).scrollTop(' . intval( $use_anchor ) . ');' : "jQuery(document).scrollTop(jQuery('#gform_wrapper_{$form_id}').offset().top);";
- $scroll_position['confirmation'] = is_numeric( $use_anchor ) ? 'jQuery(document).scrollTop(' . intval( $use_anchor ) . ');' : "jQuery(document).scrollTop(jQuery('#gforms_confirmation_message_{$form_id}').offset().top);";
+ if ( $anchor['scroll'] !== false ) {
+ $scroll_position['default'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "jQuery(document).scrollTop(jQuery('#gform_wrapper_{$form_id}').offset().top);";
+ $scroll_position['confirmation'] = is_numeric( $anchor['scroll'] ) ? 'jQuery(document).scrollTop(' . intval( $anchor['scroll'] ) . ');' : "jQuery(document).scrollTop(jQuery('{$anchor['id']}').offset().top);";
}
$iframe_style = defined( 'GF_DEBUG' ) && GF_DEBUG ? 'display:block;width:600px;height:300px;border:1px solid #eee;' : 'display:none;width:0px;height:0px;';
@@ -1056,12 +1054,12 @@ public static function get_form( $form_id, $display_title = true, $display_descr
"window['gf_submitting_{$form_id}'] = false;" .
'}' .
'else if(!is_redirect){' .
- "var confirmation_content = jQuery(this).contents().find('#gforms_confirmation_message_{$form_id}').html();" .
+ "var confirmation_content = jQuery(this).contents().find('.GF_AJAX_POSTBACK').html();" .
'if(!confirmation_content){' .
'confirmation_content = contents;' .
'}' .
'setTimeout(function(){' .
- "jQuery('#gform_wrapper_{$form_id}').replaceWith('<' + 'div id=\'gforms_confirmation_message_{$form_id}\' class=\'gform_confirmation_message_{$form_id} gforms_confirmation_message\'' + '>' + confirmation_content + '<' + '/div' + '>');" .
+ "jQuery('#gform_wrapper_{$form_id}').replaceWith(confirmation_content);" .
"{$scroll_position['confirmation']}" .
"jQuery(document).trigger('gform_confirmation_loaded', [{$form_id}]);" .
"window['gf_submitting_{$form_id}'] = false;" .
@@ -1573,11 +1571,12 @@ public static function handle_confirmation( $form, $lead, $ajax = false, $aux_da
* @return string The confirmation message.
*/
public static function get_confirmation_message( $confirmation, $form, $entry, $aux_data = array() ) {
+ $ajax = isset( $_POST['gform_ajax'] );
+ $anchor = self::get_anchor( $form, $ajax );
+ $anchor = $anchor['tag'];
- $default_anchor = self::has_pages( $form ) ? 1 : 0;
- $anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form['id'] ), $default_anchor, $form ) ? "
" : '';
- $nl2br = rgar( $confirmation, 'disableAutoformat' ) ? false : true;
- $css_class = esc_attr( rgar( $form, 'cssClass' ) );
+ $nl2br = rgar( $confirmation, 'disableAutoformat' ) ? false : true;
+ $css_class = esc_attr( rgar( $form, 'cssClass' ) );
$message = GFCommon::replace_variables( $confirmation['message'], $form, $entry, false, true, $nl2br, 'html', $aux_data );
$message = self::maybe_sanitize_confirmation_message( $message );
@@ -3215,7 +3214,7 @@ public static function process_send_resume_link() {
public static function replace_save_variables( $text, $form, $resume_token, $email = null ) {
$resume_token = sanitize_key( $resume_token );
- $form_id = intval( $form['id'] );
+ $form_id = intval( $form['id'] );
/**
* Filters the 'Save and Continue' URL to be used with a partial entry submission.
@@ -3260,16 +3259,9 @@ public static function replace_save_variables( $text, $form, $resume_token, $ema
$action = esc_url( remove_query_arg( 'gf_token' ) );
- $ajax = isset( $_POST['gform_ajax'] );
-
- $has_pages = self::has_pages( $form );
-
- $default_anchor = $has_pages || $ajax ? true : false;
-
- $use_anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form_id ), $default_anchor, $form );
- if ( $use_anchor !== false ) {
- $action .= "#gf_$form_id";
- }
+ $ajax = isset( $_POST['gform_ajax'] );
+ $anchor = self::get_anchor( $form, $ajax );
+ $action .= $anchor['id'];
$html_input_type = RGFormsModel::is_html5_enabled() ? 'email' : 'text';
@@ -3311,9 +3303,10 @@ public static function replace_save_variables( $text, $form, $resume_token, $ema
}
public static function handle_save_email_confirmation( $form, $ajax ) {
- $resume_email = $_POST['gform_resume_email'];
+ $resume_email = $_POST['gform_resume_email'];
if ( ! GFCommon::is_valid_email( $resume_email ) ) {
GFCommon::log_debug( 'GFFormDisplay::handle_save_email_confirmation(): Invalid email address: ' . $resume_email );
+
return new WP_Error( 'invalid_email' );
}
$resume_token = $_POST['gform_resume_token'];
@@ -3328,23 +3321,12 @@ public static function handle_save_email_confirmation( $form, $ajax ) {
$confirmation = '
' . $confirmation_message . '
';
$nl2br = rgar( $form['confirmation'], 'disableAutoformat' ) ? false : true;
$save_email_confirmation = self::replace_save_variables( $confirmation, $form, $resume_token, $resume_email );
-
$save_email_confirmation = GFCommon::replace_variables( $save_email_confirmation, $form, $entry, false, true, $nl2br );
$save_email_confirmation = GFCommon::gform_do_shortcode( $save_email_confirmation );
-
$save_email_confirmation = self::maybe_sanitize_confirmation_message( $save_email_confirmation );
- $form_id = absint( $form['id'] );
-
- $has_pages = self::has_pages( $form );
-
- $default_anchor = $has_pages || $ajax ? true : false;
-
- $use_anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form_id ), $default_anchor, $form );
-
- if ( $use_anchor !== false ) {
- $save_email_confirmation = "
" . $save_email_confirmation;
- }
+ $anchor = self::get_anchor( $form, $ajax );
+ $save_email_confirmation = $anchor['tag'] . $save_email_confirmation;
if ( $ajax ) {
$save_email_confirmation = "
" . $save_email_confirmation . '';
@@ -3356,28 +3338,17 @@ public static function handle_save_email_confirmation( $form, $ajax ) {
}
public static function handle_save_confirmation( $form, $resume_token, $confirmation_message, $ajax ) {
- $resume_email = isset( $_POST['gform_resume_email'] ) ? $_POST['gform_resume_email'] : null;
+ $resume_email = isset( $_POST['gform_resume_email'] ) ? $_POST['gform_resume_email'] : null;
$confirmation_message = self::maybe_sanitize_confirmation_message( $confirmation_message );
-
$confirmation_message = self::replace_save_variables( $confirmation_message, $form, $resume_token, $resume_email );
-
$confirmation_message = GFCommon::gform_do_shortcode( $confirmation_message );
-
$confirmation_message = "
" . $confirmation_message . '
';
- $form_id = absint( $form['id'] );
-
- $has_pages = self::has_pages( $form );
-
- $default_anchor = $has_pages || $ajax ? true : false;
-
- $use_anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form_id ), $default_anchor, $form );
-
- if ( $use_anchor !== false ) {
- $confirmation_message = "
" . $confirmation_message;
- }
+ $anchor = self::get_anchor( $form, $ajax );
+ $confirmation_message = $anchor['tag'] . $confirmation_message;
+ $form_id = absint( $form['id'] );
$wrapper_css_class = GFCommon::get_browser_class() . ' gform_wrapper';
$confirmation_message = "
" . $confirmation_message . '
';
@@ -3391,7 +3362,6 @@ public static function handle_save_confirmation( $form, $resume_token, $confirma
return $confirmation_message;
}
-
/**
* Insert review page into form.
*
@@ -3435,4 +3405,36 @@ public static function insert_review_page( $form, $review_page ) {
}
+ /**
+ * Get the anchor config for the current form.
+ *
+ * @since 2.2.2.1
+ *
+ * @param array $form The current Form object.
+ * @param bool $ajax Indicates if AJAX is enabled for the current form.
+ *
+ * @return array
+ */
+ public static function get_anchor( $form, $ajax ) {
+ $form_id = absint( $form['id'] );
+ $anchor = $ajax || self::has_pages( $form ) ? true : false;
+
+ /**
+ * Allow the anchor to be enabled/disabled or set to a scroll distance.
+ *
+ * @since 1.9.17.12 Added the $form parameter.
+ * @since Unknown
+ *
+ * @param bool|int $anchor Is the form anchor enabled? True when ajax enabled or when the form has multiple pages.
+ * @param array $form The current Form object.
+ */
+ $anchor = gf_apply_filters( array( 'gform_confirmation_anchor', $form_id ), $anchor, $form );
+
+ return array(
+ 'scroll' => $anchor,
+ 'tag' => $anchor !== false ? "
" : '',
+ 'id' => $anchor !== false ? "#gf_{$form_id}" : ''
+ );
+ }
+
}
diff --git a/forms_model.php b/forms_model.php
index 7b8ed98..6f114f8 100644
--- a/forms_model.php
+++ b/forms_model.php
@@ -615,7 +615,7 @@ public static function get_form_summary() {
$lead_date_results = $wpdb->get_results( $sql, ARRAY_A );
- $sql = "SELECT id, title, '' as last_lead_date, 0 as unread_count
+ $sql = "SELECT id, title, is_trash, '' as last_lead_date, 0 as unread_count
FROM $form_table_name
WHERE is_active=1
ORDER BY title";
@@ -2530,7 +2530,7 @@ public static function matches_operation( $val1, $val2, $operation ) {
break;
case 'contains' :
- return ! empty( $val2 ) && strpos( $val1, $val2 ) !== false;
+ return ! rgblank( $val2 ) && strpos( $val1, $val2 ) !== false;
break;
case 'starts_with' :
@@ -2865,7 +2865,7 @@ public static function maybe_trim_input( $value, $form_id, $field ) {
public static function get_parameter_value( $name, $field_values, $field ) {
$value = stripslashes_deep( rgget( $name ) );
- if ( empty( $value ) ) {
+ if ( rgblank( $value ) ) {
$value = rgget( $name, $field_values );
}
@@ -4807,7 +4807,7 @@ public static function get_field( $form, $field_id ) {
$field_id = intval( $field_id );
} //removing floating part of field (i.e 1.3 -> 1) to return field by input id
- if ( ! is_array( $form['fields'] ) ) {
+ if ( ! isset( $form['fields'] ) || ! isset( $form['id'] ) || ! is_array( $form['fields'] ) ) {
return null;
}
@@ -6084,7 +6084,7 @@ public static function update_recent_forms( $form_id, $trashed = false ) {
}
$current_user_id = get_current_user_id();
- $recent_form_ids = get_user_meta( $current_user_id, 'gform_recent_forms', true );
+ $recent_form_ids = self::get_recent_forms( $current_user_id );
$i = array_search( $form_id, $recent_form_ids );
@@ -6102,6 +6102,34 @@ public static function update_recent_forms( $form_id, $trashed = false ) {
update_user_meta( $current_user_id, 'gform_recent_forms', $recent_form_ids );
}
+
+ /**
+ * Get the recent forms list for the current user.
+ *
+ * @since 2.2.1.14
+ *
+ * @param int $current_user_id The ID of the currently logged in user.
+ *
+ * @return array
+ */
+ public static function get_recent_forms( $current_user_id = 0 ) {
+ if ( ! $current_user_id ) {
+ $current_user_id = get_current_user_id();
+ }
+
+ $recent_form_ids = get_user_meta( $current_user_id, 'gform_recent_forms', true );
+
+ if ( empty( $recent_form_ids ) ) {
+ $all_form_ids = self::get_form_ids();
+ $all_form_ids = array_reverse( $all_form_ids );
+ $recent_form_ids = array_slice( $all_form_ids, 0, 10 );
+ if ( $recent_form_ids ) {
+ update_user_meta( $current_user_id, 'gform_recent_forms', $recent_form_ids );
+ }
+ }
+
+ return $recent_form_ids;
+ }
}
class RGFormsModel extends GFFormsModel {
@@ -6140,7 +6168,7 @@ function gform_get_meta_values_for_entries( $entry_ids, $meta_keys ) {
$meta_key_select_array = array();
foreach ( $meta_keys as $meta_key ) {
- $meta_key_select_array[] = "max(case when meta_key = '$meta_key' then meta_value end) as $meta_key";
+ $meta_key_select_array[] = "max(case when meta_key = '$meta_key' then meta_value end) as `$meta_key`";
}
$entry_ids_str = join( ',', $entry_ids );
diff --git a/gravityforms.php b/gravityforms.php
index 3077a4a..43d5e81 100644
--- a/gravityforms.php
+++ b/gravityforms.php
@@ -3,7 +3,7 @@
Plugin Name: Gravity Forms
Plugin URI: http://www.gravityforms.com
Description: Easily create web forms and manage form entries within the WordPress admin.
-Version: 2.2.1.2
+Version: 2.2.3
Author: rocketgenius
Author URI: http://www.rocketgenius.com
Text Domain: gravityforms
@@ -162,7 +162,6 @@
require_once( plugin_dir_path( __FILE__ ) . 'includes/class-gf-download.php' );
// Load Logging if Logging Add-On is not active.
-require_once ABSPATH . 'wp-admin/includes/plugin.php';
if ( ! GFCommon::is_logging_plugin_active() ) {
require_once( plugin_dir_path( __FILE__ ) . 'includes/logging/logging.php' );
}
@@ -209,7 +208,7 @@ class GFForms {
*
* @var string $version The version number.
*/
- public static $version = '2.2.1.2';
+ public static $version = '2.2.3';
/**
* Runs after Gravity Forms is loaded.
@@ -787,6 +786,7 @@ public static function no_conflict_mode_style() {
'media-views',
'buttons',
'wp-pointer',
+ 'gform_chosen'
),
'gf_edit_forms_notification' => array(
'thickbox',
@@ -796,7 +796,7 @@ public static function no_conflict_mode_style() {
'buttons',
),
'gf_new_form' => array( 'thickbox' ),
- 'gf_entries' => array( 'thickbox' ),
+ 'gf_entries' => array( 'thickbox', 'gform_chosen' ),
'gf_settings' => array(),
'gf_export' => array(),
'gf_help' => array(),
@@ -859,7 +859,8 @@ public static function no_conflict_mode_script() {
'wp-plupload',
'wpdialogs-popup',
'wplink',
- 'wp-pointer'
+ 'wp-pointer',
+ 'gform_chosen'
),
'gf_edit_forms_notification' => array(
'editor',
@@ -901,11 +902,13 @@ public static function no_conflict_mode_script() {
'gform_json',
'gform_field_filter',
'plupload-all',
- 'postbox'
+ 'postbox',
+ 'gform_chosen'
),
'gf_settings' => array(),
'gf_export' => array( 'gform_form_admin', 'jquery-ui-datepicker', 'gform_field_filter' ),
'gf_help' => array(),
+ 'gf_system_status' => array( 'gform_system_report_clipboard' )
);
self::no_conflict_mode( $wp_scripts, $wp_required_scripts, $gf_required_scripts, 'scripts' );
@@ -1209,7 +1212,7 @@ public static function is_gravity_page() {
// Gravity Forms pages
$current_page = trim( strtolower( self::get( 'page' ) ) );
- $gf_pages = array( 'gf_edit_forms', 'gf_new_form', 'gf_entries', 'gf_settings', 'gf_export', 'gf_help' );
+ $gf_pages = array( 'gf_edit_forms', 'gf_new_form', 'gf_entries', 'gf_settings', 'gf_export', 'gf_help', 'gf_addons', 'gf_system_status' );
return in_array( $current_page, $gf_pages );
}
@@ -1824,6 +1827,10 @@ public static function dashboard() {
@@ -4068,17 +4075,7 @@ public static function admin_bar() {
$wp_admin_bar->add_node( $args );
- $current_user_id = get_current_user_id();
- $recent_form_ids = get_user_meta( $current_user_id, 'gform_recent_forms', true );
-
- if ( empty( $recent_form_ids ) ) {
- $all_form_ids = GFFormsModel::get_form_ids();
- $all_form_ids = array_reverse( $all_form_ids );
- $recent_form_ids = array_slice( $all_form_ids, 0, 10 );
- if ( $recent_form_ids ) {
- update_user_meta( $current_user_id, 'gform_recent_forms', $recent_form_ids );
- }
- }
+ $recent_form_ids = GFFormsModel::get_recent_forms();
if ( $recent_form_ids ) {
$forms = GFFormsModel::get_form_meta_by_id( $recent_form_ids );
@@ -5173,7 +5170,7 @@ function rgexplode( $sep, $string, $count ) {
* @since Unknown
* @access public
*
- * @param string $filter The name of the filter.
+ * @param string|array $filter The name of the filter.
* @param mixed $value The value to filter.
*
* @return mixed The filtered value.
diff --git a/includes/addon/class-gf-addon.php b/includes/addon/class-gf-addon.php
index 1598714..eb3479e 100644
--- a/includes/addon/class-gf-addon.php
+++ b/includes/addon/class-gf-addon.php
@@ -1356,6 +1356,9 @@ public function single_setting_row( $field ) {
$display = rgar( $field, 'hidden' ) || rgar( $field, 'type' ) == 'hidden' ? 'style="display:none;"' : '';
+ // Prepare setting description.
+ $description = rgar( $field, 'description' ) ? '' . $field['description'] . ' ' : null;
+
?>
>
@@ -1363,7 +1366,10 @@ public function single_setting_row( $field ) {
single_setting_label( $field ); ?>
- single_setting( $field ); ?>
+ single_setting( $field );
+ echo $description;
+ ?>
@@ -1833,7 +1839,7 @@ public function settings_checkbox( $field, $echo = true ) {
*
* @return string - The markup of an individual checkbox item
*/
- public function checkbox_item( $choice, $horizontal_class, $attributes, $value, $tooltip, $error_icon='' ) {
+ public function checkbox_item( $choice, $horizontal_class, $attributes, $value, $tooltip, $error_icon = '' ) {
$hidden_field_value = $value == '1' ? '1' : '0';
$icon_class = rgar( $choice, 'icon' ) ? ' gaddon-setting-choice-visual' : '';
@@ -1846,7 +1852,7 @@ public function checkbox_item( $choice, $horizontal_class, $attributes, $value,
} else {
$markup = $this->checkbox_input( $choice, $attributes, $value, $tooltip );
}
-
+
$checkbox_item .= $markup . $error_icon . '';
return $checkbox_item;
@@ -2006,12 +2012,21 @@ public function settings_select( $field, $echo = true ) {
$value = $this->get_setting( $field['name'], rgar( $field, 'default_value' ) );
$name = '' . esc_attr( $field['name'] );
- $html = sprintf(
- '%3$s ',
- '_gaddon_setting_' . $name, implode( ' ', $attributes ), $this->get_select_options( $field['choices'], $value )
- );
-
- $html .= rgar( $field, 'after_select' );
+ // If no choices were provided and there is a no choices message, display it.
+ if ( ( empty( $field['choices'] ) || ! rgar( $field, 'choices' ) ) && rgar( $field, 'no_choices' ) ) {
+
+ $html = $field['no_choices'];
+
+ } else {
+
+ $html = sprintf(
+ '%3$s ',
+ '_gaddon_setting_' . $name, implode( ' ', $attributes ), $this->get_select_options( $field['choices'], $value )
+ );
+
+ $html .= rgar( $field, 'after_select' );
+
+ }
if ( $this->field_failed_validation( $field ) ) {
$html .= $this->get_error_icon( $field );
@@ -2816,12 +2831,14 @@ public static function get_field_map_choices( $form_id, $field_type = null, $exc
*/
$fields = apply_filters( 'gform_addon_field_map_choices', $fields, $form_id, $field_type, $exclude_field_types );
- $callable = array( get_called_class(), 'get_instance' );
- if ( is_callable( $callable ) ) {
- $addon = call_user_func( $callable );
- $slug = $addon->get_slug();
+ if ( function_exists( 'get_called_class' ) ) {
+ $callable = array( get_called_class(), 'get_instance' );
+ if ( is_callable( $callable ) ) {
+ $add_on = call_user_func( $callable );
+ $slug = $add_on->get_slug();
- $fields = apply_filters( "gform_{$slug}_field_map_choices", $fields, $form_id, $field_type, $exclude_field_types );
+ $fields = apply_filters( "gform_{$slug}_field_map_choices", $fields, $form_id, $field_type, $exclude_field_types );
+ }
}
return $fields;
diff --git a/includes/addon/class-gf-feed-addon.php b/includes/addon/class-gf-feed-addon.php
index c8302a9..b68c6ca 100644
--- a/includes/addon/class-gf-feed-addon.php
+++ b/includes/addon/class-gf-feed-addon.php
@@ -100,9 +100,6 @@ public function init_admin() {
* Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.
*/
public function setup() {
- global $wpdb;
- $table_name = $wpdb->prefix . 'gf_addon_feed';
-
// upgrading Feed Add-On base class
$installed_version = get_option( 'gravityformsaddon_feed-base_version' );
if ( $installed_version != $this->_feed_version ) {
@@ -297,8 +294,8 @@ public function maybe_process_feed( $entry, $form ) {
array(
'addon' => $this,
'feed' => $feed,
- 'entry' => $entry['id'],
- 'form' => $form['id'],
+ 'entry_id' => $entry['id'],
+ 'form_id' => $form['id'],
)
);
diff --git a/includes/addon/class-gf-feed-processor.php b/includes/addon/class-gf-feed-processor.php
index d4782cb..2254bf8 100644
--- a/includes/addon/class-gf-feed-processor.php
+++ b/includes/addon/class-gf-feed-processor.php
@@ -8,8 +8,8 @@
require_once( GFCommon::get_base_path() . '/includes/libraries/wp-async-request.php' );
}
-if ( ! class_exists( 'WP_Background_Process' ) ) {
- require_once( GFCommon::get_base_path() . '/includes/libraries/wp-background-process.php' );
+if ( ! class_exists( 'GF_Background_Process' ) ) {
+ require_once( GFCommon::get_base_path() . '/includes/libraries/gf-background-process.php' );
}
/**
@@ -17,7 +17,7 @@
*
* @since 2.2
*/
-class GF_Feed_Processor extends WP_Background_Process {
+class GF_Feed_Processor extends GF_Background_Process {
/**
* Contains an instance of this class, if available.
@@ -142,8 +142,8 @@ protected function task( $item ) {
// Extract items.
$addon = $item['addon'];
$feed = $item['feed'];
- $entry = GFAPI::get_entry( $item['entry'] );
- $form = GFAPI::get_form( $item['form'] );
+ $entry = GFAPI::get_entry( $item['entry_id'] );
+ $form = GFAPI::get_form( $item['form_id'] );
// Get feed name.
$feed_name = rgars( $feed, 'meta/feed_name' ) ? $feed['meta']['feed_name'] : rgars( $feed, 'meta/feedName' );
@@ -297,12 +297,12 @@ protected function increment_attempts( $item ) {
$batch = $this->get_batch();
$item_feed = rgar( $item, 'feed' );
- $item_entry = rgar( $item, 'entry' );
+ $item_entry_id = rgar( $item, 'entry_id' );
foreach ( $batch->data as $key => $task ) {
$task_feed = rgar( $task, 'feed' );
- $task_entry = rgar( $task, 'entry' );
- if ( $item_feed['id'] === $task_feed['id'] && $item_entry['id'] === $task_entry['id'] ) {
+ $task_entry_id = rgar( $task, 'entry_id' );
+ if ( $item_feed['id'] === $task_feed['id'] && $item_entry_id === $task_entry_id ) {
$batch->data[ $key ]['attempts'] = isset( $batch->data[ $key ]['attempts'] ) ? $batch->data[ $key ]['attempts'] + 1 : 1;
$item['attempts'] = $batch->data[ $key ]['attempts'];
break;
diff --git a/includes/addon/js/gaddon_feedorder.min.js b/includes/addon/js/gaddon_feedorder.min.js
index 6b11402..01faf32 100644
--- a/includes/addon/js/gaddon_feedorder.min.js
+++ b/includes/addon/js/gaddon_feedorder.min.js
@@ -1 +1 @@
-var GFFeedOrder=function(a){var b=this,c=jQuery;b.init=function(){b.options=a;var d=' ';c(".wp-list-table thead tr, .wp-list-table tfoot tr").append(' '),c(".wp-list-table tbody tr").append(d),b.initSorting()},b.initSorting=function(){c(".wp-list-table tbody").sortable({cursor:"move",handle:".feed-sort-handle",placeholder:"feed-placeholder",tolerance:"pointer",create:function(){c(".wp-list-table").addClass("feed-list-sortable")},helper:b.fixSortableColumnWidths,start:b.setPlaceholderHeight,update:b.updateFeedOrder})},b.fixSortableColumnWidths=function(a,b){var d=b.children(),e=b.clone();return e.children().each(function(a){c(this).width(d.eq(a).width())}),e},b.getFeedOrder=function(){var a=c('.wp-list-table tbody .check-column input[type="checkbox"]');return a.map(function(){return c(this).val()}).get()},b.setPlaceholderHeight=function(a,b){c(".wp-list-table .feed-placeholder").height(b.item.height())},b.updateFeedOrder=function(a,d){c.ajax(ajaxurl,{method:"POST",dataType:"JSON",data:{action:"gf_save_feed_order",addon:b.options.addon,form_id:b.options.formId,feed_order:b.getFeedOrder(),nonce:b.options.nonce}})},this.init()};
\ No newline at end of file
+var GFFeedOrder=function(a){var b=this,c=jQuery;b.init=function(){b.options=a,c(".wp-list-table thead tr, .wp-list-table tfoot tr").append(' '),c(".wp-list-table tbody tr").append(' '),b.initSorting()},b.initSorting=function(){c(".wp-list-table tbody").sortable({cursor:"move",handle:".feed-sort-handle",placeholder:"feed-placeholder",tolerance:"pointer",create:function(){c(".wp-list-table").addClass("feed-list-sortable")},helper:b.fixSortableColumnWidths,start:b.setPlaceholderHeight,update:b.updateFeedOrder})},b.fixSortableColumnWidths=function(a,b){var d=b.children(),e=b.clone();return e.children().each(function(a){c(this).width(d.eq(a).width())}),e},b.getFeedOrder=function(){return c('.wp-list-table tbody .check-column input[type="checkbox"]').map(function(){return c(this).val()}).get()},b.setPlaceholderHeight=function(a,b){c(".wp-list-table .feed-placeholder").height(b.item.height())},b.updateFeedOrder=function(a,d){c.ajax(ajaxurl,{method:"POST",dataType:"JSON",data:{action:"gf_save_feed_order",addon:b.options.addon,form_id:b.options.formId,feed_order:b.getFeedOrder(),nonce:b.options.nonce}})},this.init()};
\ No newline at end of file
diff --git a/includes/addon/js/gaddon_genericmap.min.js b/includes/addon/js/gaddon_genericmap.min.js
index b984239..66ec44f 100644
--- a/includes/addon/js/gaddon_genericmap.min.js
+++ b/includes/addon/js/gaddon_genericmap.min.js
@@ -1 +1 @@
-var GFGenericMap=function(a){var b=this;return b.options=a,b.UI=jQuery("#gaddon-setting-row-"+b.options.fieldName),b.init=function(){b.bindEvents(),b.setupData(),b.setupRepeater()},b.bindEvents=function(){b.UI.on("change",'select[name="_gaddon_setting_'+b.options.keyFieldName+'"]',function(){var a=jQuery(this),b=a.data("chosen")?a.siblings(".chosen-container"):a.data("select2")?a.siblings(".select2-container"):a,c=a.siblings(".custom-key-container");"gf_custom"==a.val()&&b.fadeOut(function(){c.fadeIn().focus()})}),b.UI.on("change",'select[name="_gaddon_setting_'+b.options.valueFieldName+'"]',function(){var a=jQuery(this),b=a.data("chosen")?a.siblings(".chosen-container"):a.data("select2")?a.siblings(".select2-container"):a,c=a.siblings(".custom-value-container");"gf_custom"==a.val()&&b.fadeOut(function(){c.fadeIn().focus()})}),b.UI.on("click","a.custom-key-reset",function(a){a.preventDefault();var b=jQuery(this),c=b.parents(".custom-key-container"),d=c.siblings("select.key"),e=d.data("chosen")?d.siblings(".chosen-container"):d.data("select2")?d.siblings(".select2-container"):d;c.fadeOut(function(){c.find("input").val("").change(),d.val("").trigger("change"),e.fadeIn().focus()})}),b.UI.on("click","a.custom-value-reset",function(a){a.preventDefault();var b=jQuery(this),c=b.parents(".custom-value-container"),d=c.siblings("select.value"),e=d.data("chosen")?d.siblings(".chosen-container"):d.data("select2")?d.siblings(".select2-container"):d;c.fadeOut(function(){c.find("input").val("").change(),d.val("").trigger("change"),e.fadeIn().focus()})}),b.UI.closest("form").on("submit",function(a){jQuery('[name^="_gaddon_setting_'+b.options.fieldName+'_"]').each(function(a){jQuery(this).removeAttr("name")})})},b.setupData=function(){b.data=jQuery.parseJSON(jQuery("#"+b.options.fieldId).val()),b.data||(b.data=[{key:"",value:"",custom_key:"",custom_value:""}])},b.setupMergeTags=function(a){a.bind("keydown",function(a){var b=jQuery(this).data("autocomplete")&&jQuery(this).data("autocomplete").menu?jQuery(this).data("autocomplete").menu.active:!1;a.keyCode===jQuery.ui.keyCode.TAB&&b&&a.preventDefault()}),a.autocomplete({minLength:1,source:function(b,c){var d=gfMergeTags.extractLast(b.term);if(d.length0?b.options.limit:0;b.UI.find("tbody.repeater").repeater({limit:a,items:b.data,addButtonMarkup:"+ ",removeButtonMarkup:"- ",callbacks:{add:function(a,c,d){var e=c.find('select[name="_gaddon_setting_'+b.options.keyFieldName+'"]');!d.custom_key&&e.length>0?c.find(".custom-key-container").hide():c.find(".key").hide();var f=c.find('select[name="_gaddon_setting_'+b.options.valueFieldName+'"]');!d.custom_value&&f.length>0?c.find(".custom-value-container").hide():c.find(".value").hide(),b.options.mergeTags&&b.setupMergeTags(c.find(".custom-value-container input")),window.hasOwnProperty("gform")&&gform.doAction("gform_fieldmap_add_row",a,c,d)},save:function(a,c){jQuery("#"+b.options.fieldId).val(JSON.stringify(c))}}})},b.init()};
\ No newline at end of file
+var GFGenericMap=function(a){var b=this;return b.options=a,b.UI=jQuery("#gaddon-setting-row-"+b.options.fieldName),b.init=function(){b.bindEvents(),b.setupData(),b.setupRepeater()},b.bindEvents=function(){b.UI.on("change",'select[name="_gaddon_setting_'+b.options.keyFieldName+'"]',function(){var a=jQuery(this),b=a.data("chosen")?a.siblings(".chosen-container"):a.data("select2")?a.siblings(".select2-container"):a,c=a.siblings(".custom-key-container");"gf_custom"==a.val()&&b.fadeOut(function(){c.fadeIn().focus()})}),b.UI.on("change",'select[name="_gaddon_setting_'+b.options.valueFieldName+'"]',function(){var a=jQuery(this),b=a.data("chosen")?a.siblings(".chosen-container"):a.data("select2")?a.siblings(".select2-container"):a,c=a.siblings(".custom-value-container");"gf_custom"==a.val()&&b.fadeOut(function(){c.fadeIn().focus()})}),b.UI.on("click","a.custom-key-reset",function(a){a.preventDefault();var b=jQuery(this),c=b.parents(".custom-key-container"),d=c.siblings("select.key"),e=d.data("chosen")?d.siblings(".chosen-container"):d.data("select2")?d.siblings(".select2-container"):d;c.fadeOut(function(){c.find("input").val("").change(),d.val("").trigger("change"),e.fadeIn().focus()})}),b.UI.on("click","a.custom-value-reset",function(a){a.preventDefault();var b=jQuery(this),c=b.parents(".custom-value-container"),d=c.siblings("select.value"),e=d.data("chosen")?d.siblings(".chosen-container"):d.data("select2")?d.siblings(".select2-container"):d;c.fadeOut(function(){c.find("input").val("").change(),d.val("").trigger("change"),e.fadeIn().focus()})}),b.UI.closest("form").on("submit",function(a){jQuery('[name^="_gaddon_setting_'+b.options.fieldName+'_"]').each(function(a){jQuery(this).removeAttr("name")})})},b.setupData=function(){b.data=jQuery.parseJSON(jQuery("#"+b.options.fieldId).val()),b.data||(b.data=[{key:"",value:"",custom_key:"",custom_value:""}])},b.setupMergeTags=function(a){a.bind("keydown",function(a){var b=!(!jQuery(this).data("autocomplete")||!jQuery(this).data("autocomplete").menu)&&jQuery(this).data("autocomplete").menu.active;a.keyCode===jQuery.ui.keyCode.TAB&&b&&a.preventDefault()}),a.autocomplete({minLength:1,source:function(b,c){var d=gfMergeTags.extractLast(b.term);if(d.length0?b.options.limit:0;b.UI.find("tbody.repeater").repeater({limit:a,items:b.data,addButtonMarkup:"+ ",removeButtonMarkup:"- ",callbacks:{add:function(a,c,d){var e=c.find('select[name="_gaddon_setting_'+b.options.keyFieldName+'"]');!d.custom_key&&e.length>0?c.find(".custom-key-container").hide():c.find(".key").hide();var f=c.find('select[name="_gaddon_setting_'+b.options.valueFieldName+'"]');!d.custom_value&&f.length>0?c.find(".custom-value-container").hide():c.find(".value").hide(),b.options.mergeTags&&b.setupMergeTags(c.find(".custom-value-container input")),window.hasOwnProperty("gform")&&gform.doAction("gform_fieldmap_add_row",a,c,d)},save:function(a,c){jQuery("#"+b.options.fieldId).val(JSON.stringify(c))}}})},b.init()};
\ No newline at end of file
diff --git a/includes/addon/js/gaddon_payment.min.js b/includes/addon/js/gaddon_payment.min.js
index e26a58c..193810a 100644
--- a/includes/addon/js/gaddon_payment.min.js
+++ b/includes/addon/js/gaddon_payment.min.js
@@ -1 +1 @@
-function loadBillingLength(a){var b=window[a+"_intervals"];if(b){for(var c=jQuery("#"+a+"_unit").val(),d=b[c].min,e=b[c].max,f=jQuery("#"+a+"_length"),g=f.val(),h="",i=d;e>=i;i++){var j=g==i?"selected='selected'":"";h+=""+i+" "}f.html(h)}}function cancel_subscription(a){confirm(gaddon_payment_strings.subscriptionCancelWarning)&&(jQuery("#subscription_cancel_spinner").show(),jQuery("#cancelsub").prop("disabled",!0),jQuery.post(ajaxurl,{action:"gaddon_cancel_subscription",entry_id:a,gaddon_cancel_subscription:gaddon_payment_strings.subscriptionCancelNonce},function(a){jQuery("#subscription_cancel_spinner").hide(),1==a?(jQuery("#gform_payment_status").html(gaddon_payment_strings.subscriptionCanceled),jQuery("#cancelsub").hide()):(jQuery("#cancelsub").prop("disabled",!1),alert(gaddon_payment_strings.subscriptionError))}))}
\ No newline at end of file
+function loadBillingLength(a){var b=window[a+"_intervals"];if(b){for(var c=jQuery("#"+a+"_unit").val(),d=b[c].min,e=b[c].max,f=jQuery("#"+a+"_length"),g=f.val(),h="",i=d;i<=e;i++){h+=""+i+" "}f.html(h)}}function cancel_subscription(a){confirm(gaddon_payment_strings.subscriptionCancelWarning)&&(jQuery("#subscription_cancel_spinner").show(),jQuery("#cancelsub").prop("disabled",!0),jQuery.post(ajaxurl,{action:"gaddon_cancel_subscription",entry_id:a,gaddon_cancel_subscription:gaddon_payment_strings.subscriptionCancelNonce},function(a){jQuery("#subscription_cancel_spinner").hide(),1==a?(jQuery("#gform_payment_status").html(gaddon_payment_strings.subscriptionCanceled),jQuery("#cancelsub").hide()):(jQuery("#cancelsub").prop("disabled",!1),alert(gaddon_payment_strings.subscriptionError))}))}
\ No newline at end of file
diff --git a/includes/addon/js/gaddon_results.min.js b/includes/addon/js/gaddon_results.min.js
index 91e06ee..14ca07b 100644
--- a/includes/addon/js/gaddon_results.min.js
+++ b/includes/addon/js/gaddon_results.min.js
@@ -1 +1 @@
-var gresultsAjaxRequest,gresults={drawCharts:function(){var a=jQuery(".gresults-chart-wrapper");a.each(function(a,b){var c,d=jQuery(b).attr("id"),e=jQuery(b).data("options"),f=jQuery(b).data("datatable"),g=jQuery(b).data("charttype"),h=f,i=google.visualization.arrayToDataTable(h),j=document.getElementById(d);"bar"==g?c=new google.visualization.BarChart(j):"pie"==g?c=new google.visualization.PieChart(j):"column"==g&&(c=new google.visualization.ColumnChart(j)),c.draw(i,e)})},renderStateData:function(a){var b=jQuery("#gresults-results");b.data("searchcriteria",a.searchCriteria),jQuery("#gresults-results-filter").html(a.filterUI),b.css("opacity",0),b.html(a.html),gresults.drawCharts(),b.fadeTo("slow",1);var c=jQuery("#gresults-results-field-filters-container");c.resizable(),c.resizable("destroy"),c.resizable({handles:"s"})},getResults:function(){gresults.recordFormState();var a=jQuery("#gresults-results-filter-form").serialize();gresults.sendRequest(a)},sendRequest:function(a,b,c){var d=jQuery("#gresults-results"),e=jQuery("#gresults-results-filter-buttons input"),f=jQuery(".gresults-filter-loading"),g=jQuery("#gresults-view-slug").val(),h="action=gresults_get_results_"+g+"&"+a;b&&(h+="&state="+b+"&checkSum="+c),gresultsAjaxRequest=jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:h,beforeSend:function(a,b){d.fadeTo("slow",.33),d.html(""),f.show(),e.attr("disabled","disabled")}}).done(function(c){if(c&&-1!==c)if("complete"===c.status){e.removeAttr("disabled"),f.hide(),d.html(c.html),jQuery("#gresults-results").data("searchcriteria",c.searchCriteria);var g=jQuery("#gresults-results-filter").html();gresults.drawCharts(),d.fadeTo("slow",1),window.history.replaceState&&(history.state?history.pushState({html:c.html,filterUI:g,searchCriteria:c.searchCriteria},"","?"+a):history.replaceState({html:c.html,filterUI:g,searchCriteria:c.searchCriteria},"","?"+a)),gresults.drawCharts(),window.gform_initialize_tooltips&&gform_initialize_tooltips()}else"incomplete"===c.status?(b=c.stateObject,gresults.sendRequest(a,b,c.checkSum),d.html(c.html)):(f.hide(),d.html(gresultsStrings.ajaxError));else f.hide(),d.html(gresultsStrings.ajaxError)}).fail(function(a){e.removeAttr("disabled"),d.fadeTo("fast",1);var b=a.statusText;f.hide(),b="abort"==b?"Request cancelled":gresultsStrings.ajaxError,d.html(b)})},getMoreResults:function(a,b){var c=jQuery("#gresults-results-field-content-"+b),d=jQuery("#gresults-results"),e=jQuery(c).data("offset"),f=jQuery("#gresults-view-slug").val(),g=d.data("searchcriteria");return jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"gresults_get_more_results_"+f,view:f,form_id:a,field_id:b,offset:e,search_criteria:g},success:function(a){-1===a||(a.html&&jQuery(c).append(a.html),a.more_remaining||jQuery("#gresults-results-field-more-link-"+b).hide(),jQuery(c).data("offset",a.offset))}}),!1},clearFilterForm:function(){jQuery("#gresults-results-field-filters-container").gfFilterUI(gresultsFilterSettings,[],!0),jQuery("#gresults-results-filter-form").find("input, select").each(function(){switch(this.type){case"text":case"select-one":jQuery(this).val("").change();break;case"checkbox":case"radio":this.checked=!1}})},recordFormState:function(){jQuery("#gresults-results-filter-form input[type='radio']").each(function(){this.checked?jQuery(this).prop("defaultChecked",!0):jQuery(this).prop("defaultChecked",!1)}),jQuery("#gresults-results-filter-form input[type='checkbox']").each(function(){this.checked?jQuery(this).prop("defaultChecked",!0):jQuery(this).prop("defaultChecked",!1)}),jQuery("#gresults-results-filter-form input[type='text']").each(function(){jQuery(this).prop("defaultValue",jQuery(this).val())}),jQuery("#gresults-results-filter-form select option").each(function(){jQuery(this).prop("defaultSelected",jQuery(this).prop("selected"))})},setCustomFilter:function(a,b){elementId="gresults-custom-"+a,0==jQuery("#"+elementId).length?jQuery("#gresults-results-filter-form").append(" "):jQuery("#"+elementId).val(b)}};google.load("visualization","1",{packages:["corechart"]}),google.setOnLoadCallback(gresults.drawCharts),jQuery(document).ready(function(){if(jQuery("#gresults-results").length>0){jQuery("#gresults-results-field-filters-container").gfFilterUI(gresultsFilterSettings,gresultsInitVars,!0);var a=jQuery(window);a.resize(function(a){a.target===window&&gresults.drawCharts()}),window.onpopstate=function(a){a.state&&gresults.renderStateData(a.state)},jQuery("#gresults-results-filter-date-start, #gresults-results-filter-date-end").datepicker({dateFormat:"yy-mm-dd",changeMonth:!0,changeYear:!0}),jQuery("#gresults-results-filter-form").submit(function(a){return gresults.getResults(),!1}),history.state?gresults.renderStateData(history.state):gresults.getResults(),window.gform_initialize_tooltips&&gform_initialize_tooltips()}});
\ No newline at end of file
+var gresultsAjaxRequest,gresults={drawCharts:function(){jQuery(".gresults-chart-wrapper").each(function(a,b){var c,d=jQuery(b).attr("id"),e=jQuery(b).data("options"),f=jQuery(b).data("datatable"),g=jQuery(b).data("charttype"),h=f,i=google.visualization.arrayToDataTable(h),j=document.getElementById(d);"bar"==g?c=new google.visualization.BarChart(j):"pie"==g?c=new google.visualization.PieChart(j):"column"==g&&(c=new google.visualization.ColumnChart(j)),c.draw(i,e)})},renderStateData:function(a){var b=jQuery("#gresults-results");b.data("searchcriteria",a.searchCriteria),jQuery("#gresults-results-filter").html(a.filterUI),b.css("opacity",0),b.html(a.html),gresults.drawCharts(),b.fadeTo("slow",1);var c=jQuery("#gresults-results-field-filters-container");c.resizable(),c.resizable("destroy"),c.resizable({handles:"s"})},getResults:function(){gresults.recordFormState();var a=jQuery("#gresults-results-filter-form").serialize();gresults.sendRequest(a)},sendRequest:function(a,b,c){var d=jQuery("#gresults-results"),e=jQuery("#gresults-results-filter-buttons input"),f=jQuery(".gresults-filter-loading"),g=jQuery("#gresults-view-slug").val(),h="action=gresults_get_results_"+g+"&"+a;b&&(h+="&state="+b+"&checkSum="+c),gresultsAjaxRequest=jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:h,beforeSend:function(a,b){d.fadeTo("slow",.33),d.html(""),f.show(),e.attr("disabled","disabled")}}).done(function(c){if(c&&-1!==c)if("complete"===c.status){e.removeAttr("disabled"),f.hide(),d.html(c.html),jQuery("#gresults-results").data("searchcriteria",c.searchCriteria);var g=jQuery("#gresults-results-filter").html();gresults.drawCharts(),d.fadeTo("slow",1),window.history.replaceState&&(history.state?history.pushState({html:c.html,filterUI:g,searchCriteria:c.searchCriteria},"","?"+a):history.replaceState({html:c.html,filterUI:g,searchCriteria:c.searchCriteria},"","?"+a)),gresults.drawCharts(),window.gform_initialize_tooltips&&gform_initialize_tooltips()}else"incomplete"===c.status?(b=c.stateObject,gresults.sendRequest(a,b,c.checkSum),d.html(c.html)):(f.hide(),d.html(gresultsStrings.ajaxError));else f.hide(),d.html(gresultsStrings.ajaxError)}).fail(function(a){e.removeAttr("disabled"),d.fadeTo("fast",1);var b=a.statusText;f.hide(),b="abort"==b?"Request cancelled":gresultsStrings.ajaxError,d.html(b)})},getMoreResults:function(a,b){var c=jQuery("#gresults-results-field-content-"+b),d=jQuery("#gresults-results"),e=jQuery(c).data("offset"),f=jQuery("#gresults-view-slug").val(),g=d.data("searchcriteria");return jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"gresults_get_more_results_"+f,view:f,form_id:a,field_id:b,offset:e,search_criteria:g},success:function(a){-1===a||(a.html&&jQuery(c).append(a.html),a.more_remaining||jQuery("#gresults-results-field-more-link-"+b).hide(),jQuery(c).data("offset",a.offset))}}),!1},clearFilterForm:function(){jQuery("#gresults-results-field-filters-container").gfFilterUI(gresultsFilterSettings,[],!0),jQuery("#gresults-results-filter-form").find("input, select").each(function(){switch(this.type){case"text":case"select-one":jQuery(this).val("").change();break;case"checkbox":case"radio":this.checked=!1}})},recordFormState:function(){jQuery("#gresults-results-filter-form input[type='radio']").each(function(){this.checked?jQuery(this).prop("defaultChecked",!0):jQuery(this).prop("defaultChecked",!1)}),jQuery("#gresults-results-filter-form input[type='checkbox']").each(function(){this.checked?jQuery(this).prop("defaultChecked",!0):jQuery(this).prop("defaultChecked",!1)}),jQuery("#gresults-results-filter-form input[type='text']").each(function(){jQuery(this).prop("defaultValue",jQuery(this).val())}),jQuery("#gresults-results-filter-form select option").each(function(){jQuery(this).prop("defaultSelected",jQuery(this).prop("selected"))})},setCustomFilter:function(a,b){elementId="gresults-custom-"+a,0==jQuery("#"+elementId).length?jQuery("#gresults-results-filter-form").append(" "):jQuery("#"+elementId).val(b)}};google.load("visualization","1",{packages:["corechart"]}),google.setOnLoadCallback(gresults.drawCharts),jQuery(document).ready(function(){if(jQuery("#gresults-results").length>0){jQuery("#gresults-results-field-filters-container").gfFilterUI(gresultsFilterSettings,gresultsInitVars,!0);jQuery(window).resize(function(a){a.target===window&&gresults.drawCharts()}),window.onpopstate=function(a){a.state&&gresults.renderStateData(a.state)},jQuery("#gresults-results-filter-date-start, #gresults-results-filter-date-end").datepicker({dateFormat:"yy-mm-dd",changeMonth:!0,changeYear:!0}),jQuery("#gresults-results-filter-form").submit(function(a){return gresults.getResults(),!1}),history.state?gresults.renderStateData(history.state):gresults.getResults(),window.gform_initialize_tooltips&&gform_initialize_tooltips()}});
\ No newline at end of file
diff --git a/includes/addon/js/repeater.min.js b/includes/addon/js/repeater.min.js
index 11eed17..66343dd 100644
--- a/includes/addon/js/repeater.min.js
+++ b/includes/addon/js/repeater.min.js
@@ -1 +1 @@
-jQuery.fn.repeater=function(a){var b=this,c={template:"",limit:5,items:[{}],saveEvents:"blur change",saveElements:"input, select",addButtonMarkup:"+",removeButtonMarkup:"-",minItemCount:1,callbacks:{save:function(){},beforeAdd:function(){},add:function(){},beforeAddNew:function(){},addNew:function(){},beforeRemove:function(){},remove:function(){},repeaterButtons:function(){return!1}}};return b.options=jQuery.extend(!0,{},c,a),b.elem=jQuery(this),b.items=b.options.items,b.callbacks=b.options.callbacks,b._template=b.options.template,b._baseObj=b.items[0],b.init=function(){return b.stashTemplate(),b.elem.addClass("repeater"),b.refresh(),b.bindEvents(),b},b.bindEvents=function(){b.options.saveEvents=b.getNamespacedEvents(b.options.saveEvents),b.elem.off("click.repeater","a.add-item"),b.elem.on("click.repeater","a.add-item:not(.inactive)",function(){b.addNewItem(this)}),b.elem.off("click.repeater","a.remove-item"),b.elem.on("click.repeater","a.remove-item",function(a){b.removeItem(this)}),b.elem.off(b.options.saveEvents,b.options.saveElements),b.elem.on(b.options.saveEvents,b.options.saveElements,function(){b.save()})},b.stashTemplate=function(){b._template||(b._template=b.elem.html()),b._template=jQuery.trim(b._template)},b.addItem=function(a,c){var d=b.getItemMarkup(a,c),e=jQuery(d).addClass("item-"+c);b.callbacks.beforeAdd(b,e,a,c),b.append(e),b.populateSelects(a,c),b.callbacks.add(b,e,a,c)},b.getItemMarkup=function(a,c){var d=b._template;for(var e in a)a.hasOwnProperty(e)&&(d=d.replace(/{i}/g,c),d=d.replace("{buttons}",b.getRepeaterButtonsMarkup(c)),d=d.replace(new RegExp("{"+e+"}","g"),a[e]));return d},b.getRepeaterButtonsMarkup=function(a){var c=b.callbacks.repeaterButtons(b,a);return c||(c=b.getDefaultButtonsMarkup(a)),c},b.getDefaultButtonsMarkup=function(a){var c=b.items.length>=b.options.limit&&0!==b.options.limit?"inactive":"",d=''+b.options.addButtonMarkup+" ";return b.items.length>b.options.minItemCount&&(d+=''+b.options.removeButtonMarkup+" "),''+d+"
"},b.populateSelects=function(a,c){for(var d in a)if(a.hasOwnProperty(d)){var e=b.elem.find("."+d+"_"+c);e.is("select")&&(jQuery.isArray(a[d])?e.val(a[d]):e.find('option[value="'+a[d]+'"]').prop("selected",!0))}},b.addNewItem=function(a,c){var d=b.isElement(a),c=parseInt("undefined"!=typeof c?c:d?jQuery(a).attr("data-index")+1:b.items.length),e=d?b.getBaseObject():a;return b.callbacks.beforeAddNew(b,c),b.items.splice(c,0,e),b.callbacks.addNew(b,c),b.refresh().save(),b},b.removeItem=function(a){var c=b.isElement(a)?jQuery(a).attr("data-index"):a;b.callbacks.beforeRemove(b,c),delete b.items[c],b.callbacks.remove(b,c),b.save().refresh()},b.refresh=function(){b.elem.empty();for(var a=0;a0?b.items:[b._baseObj],d=0;d=b.options.limit&&0!==b.options.limit?"inactive":"",d=''+b.options.addButtonMarkup+" ";return b.items.length>b.options.minItemCount&&(d+=''+b.options.removeButtonMarkup+" "),''+d+"
"},b.populateSelects=function(a,c){for(var d in a)if(a.hasOwnProperty(d)){var e=b.elem.find("."+d+"_"+c);e.is("select")&&(jQuery.isArray(a[d])?e.val(a[d]):e.find('option[value="'+a[d]+'"]').prop("selected",!0))}},b.addNewItem=function(a,c){var d=b.isElement(a),c=parseInt(void 0!==c?c:d?jQuery(a).attr("data-index")+1:b.items.length),e=d?b.getBaseObject():a;return b.callbacks.beforeAddNew(b,c),b.items.splice(c,0,e),b.callbacks.addNew(b,c),b.refresh().save(),b},b.removeItem=function(a){var c=b.isElement(a)?jQuery(a).attr("data-index"):a;b.callbacks.beforeRemove(b,c),delete b.items[c],b.callbacks.remove(b,c),b.save().refresh()},b.refresh=function(){b.elem.empty();for(var a=0;a0?b.items:[b._baseObj],d=0;dset_upgrade_started( $force_upgrade ) ) {
-
- //Upgrade can't be started. Abort.
+ // Upgrade can't be started. Abort.
return false;
}
@@ -139,6 +140,9 @@ public function upgrade( $from_db_version = null, $force_upgrade = false ) {
$this->flush_versions();
+ // Updating cached message so the extremely outdated version message is removed.
+ GFCommon::cache_remote_message();
+
}
/**
diff --git a/includes/fields/class-gf-field-fileupload.php b/includes/fields/class-gf-field-fileupload.php
index f0b19e0..c9df27c 100644
--- a/includes/fields/class-gf-field-fileupload.php
+++ b/includes/fields/class-gf-field-fileupload.php
@@ -144,6 +144,8 @@ public function get_field_input( $form, $value = '', $entry = null ) {
$extensions_message = '';
}
+ $extensions_message_id = 'extensions_message_' . $form_id . '_' . $id;
+
if ( $multiple_files ) {
$upload_action_url = trailingslashit( site_url() ) . '?gf_page=' . GFCommon::get_upload_page_slug();
$max_files = $this->maxFiles > 0 ? $this->maxFiles : 0;
@@ -208,11 +210,11 @@ public function get_field_input( $form, $value = '', $entry = null ) {
$upload = "";
if ( ! $is_admin ) {
- $upload .= "{$extensions_message} ";
+ $upload .= "{$extensions_message} ";
$upload .= "
@@ -228,10 +230,10 @@ public function get_field_input( $form, $value = '', $entry = null ) {
// MAX_FILE_SIZE > 2048MB fails. The file size is checked anyway once uploaded, so it's not necessary.
$upload = sprintf( "
", $max_upload_size );
}
- $upload .= sprintf( "
", $id, $field_id, esc_attr( $class ), esc_attr( $max_upload_size ), $disabled_text );
+ $upload .= sprintf( "
", $id, $field_id, esc_attr( $class ), $extensions_message_id, esc_attr( $max_upload_size ), $disabled_text );
if ( ! $is_admin ) {
- $upload .= "
{$extensions_message} ";
+ $upload .= "
{$extensions_message} ";
$upload .= "
";
}
}
@@ -324,7 +326,17 @@ public function is_value_submission_empty( $form_id ) {
}
public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lead ) {
- return $this->multipleFiles ? $this->get_multifile_value( $form['id'], $input_name, $value ) : $this->get_single_file_value( $form['id'], $input_name );
+ if ( ! $this->multipleFiles ) {
+ return $this->get_single_file_value( $form['id'], $input_name );
+ }
+
+ if ( $this->is_entry_detail() && empty( $lead ) ) {
+ // Deleted files remain in the $value from $_POST so use the updated entry value.
+ $lead = GFFormsModel::get_lead( $lead_id );
+ $value = rgar( $lead, strval( $this->id ) );
+ }
+
+ return $this->get_multifile_value( $form['id'], $input_name, $value );
}
public function get_multifile_value( $form_id, $input_name, $value ) {
@@ -481,10 +493,9 @@ public function get_value_entry_detail( $value, $currency = '', $use_text = fals
* @param string $file_path The file path of the download file.
* @param GF_Field_FileUpload $field The field object for further context.
*/
- $file_path = esc_attr( str_replace( ' ', '%20', apply_filters( 'gform_fileupload_entry_value_file_path', $file_path, $this ) ) );
- $base_name = $info['basename'];
- $click_to_view_text = esc_attr__( 'Click to view', 'gravityforms' );
- $output_arr[] = $format == 'text' ? $file_path . PHP_EOL : "
{$base_name} ";
+ $file_path = str_replace( ' ', '%20', apply_filters( 'gform_fileupload_entry_value_file_path', $file_path, $this ) );
+ $output_arr[] = $format == 'text' ? $file_path : sprintf( "
%s ", esc_attr( $file_path ), esc_attr__( 'Click to view', 'gravityforms' ), $info['basename'] );
+
}
$output = join( PHP_EOL, $output_arr );
}
diff --git a/includes/fields/class-gf-field-list.php b/includes/fields/class-gf-field-list.php
index 75c70dc..14db6a7 100644
--- a/includes/fields/class-gf-field-list.php
+++ b/includes/fields/class-gf-field-list.php
@@ -468,7 +468,7 @@ public function get_value_entry_detail( $value, $currency = '', $use_text = fals
$value = maybe_unserialize( $value );
- if( ! is_array( $value ) ) {
+ if( ! is_array( $value ) || ! isset( $value[0] ) ) {
return '';
}
diff --git a/includes/fields/class-gf-field-multiselect.php b/includes/fields/class-gf-field-multiselect.php
index 2bd7ac7..b3d765f 100644
--- a/includes/fields/class-gf-field-multiselect.php
+++ b/includes/fields/class-gf-field-multiselect.php
@@ -136,7 +136,12 @@ public function get_field_input( $form, $value = '', $entry = null ) {
* @return string Returns the choices available within the multi-select field.
*/
public function get_choices( $value ) {
+
+ // If we are in the entry editor, convert value to an array.
+ $value = $this->is_entry_detail() ? $this->to_array( $value ) : $value;
+
return GFCommon::get_select_choices( $this, $value, false );
+
}
/**
diff --git a/includes/fields/class-gf-field-textarea.php b/includes/fields/class-gf-field-textarea.php
index 67ae64b..fb2424f 100644
--- a/includes/fields/class-gf-field-textarea.php
+++ b/includes/fields/class-gf-field-textarea.php
@@ -144,7 +144,11 @@ public function validate( $value, $form ) {
return;
}
+ // Clean the string of characters not counted by the textareaCounter plugin.
$value = strip_tags( $value );
+ $value = str_replace( "\r", '', $value );
+ $value = trim( $value );
+
if ( GFCommon::safe_strlen( $value ) > $this->maxLength ) {
$this->failed_validation = true;
$this->validation_message = empty( $this->errorMessage ) ? esc_html__( 'The text entered exceeds the maximum number of characters.', 'gravityforms' ) : $this->errorMessage;
diff --git a/includes/fields/class-gf-field-website.php b/includes/fields/class-gf-field-website.php
index 95cc0e6..c2d409b 100644
--- a/includes/fields/class-gf-field-website.php
+++ b/includes/fields/class-gf-field-website.php
@@ -84,8 +84,8 @@ public function get_field_input( $form, $value = '', $entry = null ) {
}
public function get_value_entry_detail( $value, $currency = '', $use_text = false, $format = 'html', $media = 'screen' ) {
-
- return GFCommon::is_valid_url( $value ) && $format == 'html' ? "
$value " : $value;
+ $safe_value = esc_url( $value );
+ return GFCommon::is_valid_url( $value ) && $format == 'html' ? "
$safe_value " : $safe_value;
}
public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lead ) {
@@ -98,4 +98,4 @@ public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lea
}
}
-GF_Fields::register( new GF_Field_Website() );
\ No newline at end of file
+GF_Fields::register( new GF_Field_Website() );
diff --git a/includes/fields/class-gf-field.php b/includes/fields/class-gf-field.php
index 7215866..fb533c1 100644
--- a/includes/fields/class-gf-field.php
+++ b/includes/fields/class-gf-field.php
@@ -443,7 +443,7 @@ public function get_value_save_entry( $value, $form, $input_name, $lead_id, $lea
public function get_value_merge_tag( $value, $input_id, $entry, $form, $modifier, $raw_value, $url_encode, $esc_html, $format, $nl2br ) {
if ( $format === 'html' ) {
- $form_id = absint( $form['id'] );
+ $form_id = isset( $form['id'] ) ? absint( $form['id'] ) : null;
$allowable_tags = $this->get_allowable_tags( $form_id );
if ( $allowable_tags === false ) {
diff --git a/includes/libraries/wp-background-process.php b/includes/libraries/gf-background-process.php
similarity index 97%
rename from includes/libraries/wp-background-process.php
rename to includes/libraries/gf-background-process.php
index 7986f5d..4b821e6 100644
--- a/includes/libraries/wp-background-process.php
+++ b/includes/libraries/gf-background-process.php
@@ -1,19 +1,20 @@
').attr("src",e.lock_error.avatar_src.replace(/&/g,"&")),f.find("div.gform-locked-avatar").empty().append(g)),b("#gform-reject-lock-request-button").hide(),f.show().find(".currently-editing").text(e.lock_error.text)):e.lock_request&&b("#gform-lock-request-status").html(e.lock_request.text):(h.avatar_src&&(g=b('
').attr("src",h.avatar_src.replace(/&/g,"&")),f.find("div.gform-locked-avatar").empty().append(g)),f.show().find(".currently-editing").text(h.text),e.lock_request?b("#gform-reject-lock-request-button").show():b("#gform-reject-lock-request-button").hide(),f.find(".wp-tab-first").focus())}}),b(document).on("heartbeat-tick."+c,function(a,d){var e,f,g;if(d[c]&&(e=d[c],e.status)){if(g=e.status,f=b("#gform-lock-dialog"),!f.length)return;switch("pending"!=g&&(clearTimeout(k),k=!1,m=!1),g){case"granted":b("#gform-lock-request-status").html(h.gainedControl),b("#gform-take-over-button").show(),b("#gform-lock-request-button").hide(),i=!0;break;case"deleted":b("#gform-lock-request-button").text(h.requestAgain).attr("disabled",!1),b("#gform-lock-request-status").html(h.rejected);break;case"pending":b("#gform-lock-request-status").html(h.pending)}}})}b(document).ready(function(){a.init()});var f,g,h,i,j,k,l,m=!1;a.init=function(){i=gflockingVars.hasLock,f=gflockingVars.objectID,g=gflockingVars.objectType,j=gflockingVars.lockUI,h=gflockingVars.strings,e(),d()}}(window.gflocking=window.gflocking||{},jQuery);
\ No newline at end of file
+!function(a,b){function c(){b("#gform-lock-request-status").html(h.noResponse),b("#gform-lock-request-button").attr("disabled",!1).text(h.requestAgain),m=!1,l=!0,k=!1,wp.heartbeat.interval(30)}function d(){b("#gform-lock-request-button").click(function(){var a=b(this);a.text("Request sent"),a.attr("disabled",!0),b("#gform-lock-request-status").html(""),l=!1,m=!0,wp.heartbeat.interval(5),k=setTimeout(c,12e4),b.getJSON(ajaxurl,{action:"gf_lock_request_"+g,object_id:f}).done(function(a){b("#gform-lock-request-status").html(a.html)}).fail(function(a,c,d){var e=c+", "+d;b("#gform-lock-request-status").html(h.requestError+": "+e)})}),b("#gform-reject-lock-request-button").click(function(){b.getJSON(ajaxurl,{action:"gf_reject_lock_request_"+g,object_id:f,object_type:g}).done(function(a){b("#gform-lock-dialog").hide()}).fail(function(a,c,d){var e=c+", "+d;b("#gform-lock-request-status").html(h.requestError+": "+e),b("#gform-lock-dialog").hide()})})}function e(){wp.heartbeat.interval(30),b("#wpfooter").append(j);var a="gform-refresh-lock-"+g,c="gform-request-lock-"+g;b(document).on("heartbeat-send."+a,function(c,d){var e={};f&&b("#gform-lock-dialog").length&&0!=i&&(e.objectID=f,d[a]=e)}),b(document).on("heartbeat-send."+c,function(a,b){var d={};if(!m)return b;d.objectID=f,b[c]=d}),b(document).on("heartbeat-tick."+a,function(c,d){var e,f,g,h;if(d[a]&&(e=d[a],e.lock_error||e.lock_request)){if(h=e.lock_error?e.lock_error:e.lock_request,f=b("#gform-lock-dialog"),!f.length)return;f.is(":visible")?e.lock_error?b("#gform-reject-lock-request-button").is(":visible")&&(e.lock_error.avatar_src&&(g=b('
').attr("src",e.lock_error.avatar_src.replace(/&/g,"&")),f.find("div.gform-locked-avatar").empty().append(g)),b("#gform-reject-lock-request-button").hide(),f.show().find(".currently-editing").text(e.lock_error.text)):e.lock_request&&b("#gform-lock-request-status").html(e.lock_request.text):(h.avatar_src&&(g=b('
').attr("src",h.avatar_src.replace(/&/g,"&")),f.find("div.gform-locked-avatar").empty().append(g)),f.show().find(".currently-editing").text(h.text),e.lock_request?b("#gform-reject-lock-request-button").show():b("#gform-reject-lock-request-button").hide(),f.find(".wp-tab-first").focus())}}),b(document).on("heartbeat-tick."+c,function(a,d){var e,f,g;if(d[c]&&(e=d[c],e.status)){if(g=e.status,f=b("#gform-lock-dialog"),!f.length)return;switch("pending"!=g&&(clearTimeout(k),k=!1,m=!1),g){case"granted":b("#gform-lock-request-status").html(h.gainedControl),b("#gform-take-over-button").show(),b("#gform-lock-request-button").hide(),i=!0;break;case"deleted":b("#gform-lock-request-button").text(h.requestAgain).attr("disabled",!1),b("#gform-lock-request-status").html(h.rejected);break;case"pending":b("#gform-lock-request-status").html(h.pending)}}})}b(document).ready(function(){a.init()});var f,g,h,i,j,k,l,m=!1;a.init=function(){i=gflockingVars.hasLock,f=gflockingVars.objectID,g=gflockingVars.objectType,j=gflockingVars.lockUI,h=gflockingVars.strings,e(),d()}}(window.gflocking=window.gflocking||{},jQuery);
\ No newline at end of file
diff --git a/includes/system-status/class-gf-system-report.php b/includes/system-status/class-gf-system-report.php
index d25579d..4d2ea5c 100644
--- a/includes/system-status/class-gf-system-report.php
+++ b/includes/system-status/class-gf-system-report.php
@@ -189,6 +189,8 @@ public static function get_system_report_text( $sections ) {
}
+ $system_report_text = str_replace( '()', '', $system_report_text );
+
return $system_report_text;
}
@@ -405,9 +407,9 @@ public static function get_system_report() {
'label_export' => 'Version',
'value' => esc_html( phpversion() ),
'type' => 'version_check',
- 'version_compare' => '>',
- 'minimum_version' => '5.0.0',
- 'validation_message' => esc_html__( 'Gravity Forms requires PHP 5 or above.', 'gravityforms' ),
+ 'version_compare' => '>=',
+ 'minimum_version' => '5.6',
+ 'validation_message' => esc_html__( 'Gravity Forms requires PHP 5.6 or above.', 'gravityforms' ),
),
array(
'label' => esc_html__( 'Memory Limit', 'gravityforms' ) . ' (memory_limit)',
@@ -638,6 +640,11 @@ public static function get_gravityforms() {
$is_writable = wp_is_writable( $upload_path );
+ $disable_css = get_option( 'rg_gforms_disable_css' );
+ $enable_html5 = get_option( 'rg_gforms_enable_html5' );
+ $no_conflict_mode = get_option( 'gform_enable_noconflict' );
+ $updates = get_option( 'gform_enable_background_updates' );
+
// Prepare versions array.
$gravityforms = array(
array(
@@ -665,6 +672,35 @@ public static function get_gravityforms() {
'is_valid' => $is_writable,
'validation_message' => $is_writable ? '' : esc_html__( 'File uploads, entry exports, and logging will not function properly.', 'gravityforms' ),
),
+ array(
+ 'label' => esc_html__( 'Output CSS', 'gravityforms' ),
+ 'label_export' => 'Output CSS',
+ 'value' => ! $disable_css ? __( 'Yes', 'gravityforms' ) : __( 'No', 'gravityforms' ),
+ 'value_export' => ! $disable_css ? 'Yes' : 'No',
+ ),
+ array(
+ 'label' => esc_html__( 'Output HTML5', 'gravityforms' ),
+ 'label_export' => 'Output HTML5',
+ 'value' => $enable_html5 ? __( 'Yes', 'gravityforms' ) : __( 'No', 'gravityforms' ),
+ 'value_export' => $enable_html5 ? 'Yes' : 'No',
+ ),
+ array(
+ 'label' => esc_html__( 'No-Conflict Mode', 'gravityforms' ),
+ 'label_export' => 'No-Conflict Mode',
+ 'value' => $no_conflict_mode ? __( 'Yes', 'gravityforms' ) : __( 'No', 'gravityforms' ),
+ 'value_export' => $no_conflict_mode ? 'Yes' : 'No',
+ ),
+ array(
+ 'label' => esc_html__( 'Currency', 'gravityforms' ),
+ 'label_export' => 'Currency',
+ 'value' => get_option( 'rg_gforms_currency' ),
+ ),
+ array(
+ 'label' => esc_html__( 'Background updates', 'gravityforms' ),
+ 'label_export' => 'Background updates',
+ 'value' => $updates ? __( 'Yes', 'gravityforms' ) : __( 'No', 'gravityforms' ),
+ 'value_export' => $updates ? 'Yes' : 'No',
+ ),
);
@@ -886,7 +922,7 @@ public static function get_active_plugins( $include_gravity_forms = true, $inclu
$active_plugins = array();
// Get Gravity Forms version info.
- $version_info = GFCommon::get_version_info( false );
+ $version_info = GFCommon::get_version_info();
// Prepare active plugins.
foreach ( get_plugins() as $plugin_path => $plugin ) {
diff --git a/includes/upload.php b/includes/upload.php
index cea6ddc..e21e8fd 100644
--- a/includes/upload.php
+++ b/includes/upload.php
@@ -80,8 +80,8 @@ public static function upload() {
$uploaded_filename = $_FILES['file']['name'];
$file_name = isset( $_REQUEST['name'] ) ? $_REQUEST['name'] : '';
$field_id = rgpost( 'field_id' );
- $field_id = absint( $field_id );
- $field = GFFormsModel::get_field( $form, $field_id );
+ $field_id = absint( $field_id );
+ $field = gf_apply_filters( array( 'gform_multifile_upload_field', $form['id'], $field_id ), GFFormsModel::get_field( $form, $field_id ), $form, $field_id );
if ( empty( $field ) || GFFormsModel::get_input_type( $field ) != 'fileupload' ) {
die();
diff --git a/includes/webapi/js/enc-base64-min.min.js b/includes/webapi/js/enc-base64-min.min.js
index bb9a81c..e37a41c 100644
--- a/includes/webapi/js/enc-base64-min.min.js
+++ b/includes/webapi/js/enc-base64-min.min.js
@@ -1 +1 @@
-!function(){var a=CryptoJS,b=a.lib.WordArray;a.enc.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp(),a=[];for(var e=0;c>e;e+=3)for(var f=(b[e>>>2]>>>24-8*(e%4)&255)<<16|(b[e+1>>>2]>>>24-8*((e+1)%4)&255)<<8|b[e+2>>>2]>>>24-8*((e+2)%4)&255,g=0;4>g&&c>e+.75*g;g++)a.push(d.charAt(f>>>6*(3-g)&63));if(b=d.charAt(64))for(;a.length%4;)a.push(b);return a.join("")},parse:function(a){var c=a.length,d=this._map,e=d.charAt(64);e&&(e=a.indexOf(e),-1!=e&&(c=e));for(var e=[],f=0,g=0;c>g;g++)if(g%4){var h=d.indexOf(a.charAt(g-1))<<2*(g%4),i=d.indexOf(a.charAt(g))>>>6-2*(g%4);e[f>>>2]|=(h|i)<<24-8*(f%4),f++}return b.create(e,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();
\ No newline at end of file
+!function(){var a=CryptoJS,b=a.lib.WordArray;a.enc.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp(),a=[];for(var e=0;e
>>2]>>>24-e%4*8&255)<<16|(b[e+1>>>2]>>>24-(e+1)%4*8&255)<<8|b[e+2>>>2]>>>24-(e+2)%4*8&255,g=0;4>g&&e+.75*g>>6*(3-g)&63));if(b=d.charAt(64))for(;a.length%4;)a.push(b);return a.join("")},parse:function(a){var c=a.length,d=this._map,e=d.charAt(64);e&&-1!=(e=a.indexOf(e))&&(c=e);for(var e=[],f=0,g=0;g>>6-g%4*2;e[f>>>2]|=(h|i)<<24-f%4*8,f++}return b.create(e,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}();
\ No newline at end of file
diff --git a/includes/webapi/js/hmac-sha1.min.js b/includes/webapi/js/hmac-sha1.min.js
index 7ada53f..f8a2178 100644
--- a/includes/webapi/js/hmac-sha1.min.js
+++ b/includes/webapi/js/hmac-sha1.min.js
@@ -1 +1 @@
-var CryptoJS=CryptoJS||function(a,b){var c={},d=c.lib={},e=function(){},f=d.Base={extend:function(a){e.prototype=this;var b=new e;return a&&b.mixIn(a),b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},g=d.WordArray=f.extend({init:function(a,c){a=this.words=a||[],this.sigBytes=c!=b?c:4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes;if(a=a.sigBytes,this.clamp(),d%4)for(var e=0;a>e;e++)b[d+e>>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535e;e+=4)b[d+e>>>2]=c[e>>>2];else b.push.apply(b,c);return this.sigBytes+=a,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-8*(c%4),b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c=[],d=0;b>d;d+=4)c.push(4294967296*a.random()|0);return new g.init(c,b)}}),h=c.enc={},i=h.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],d=0;a>d;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16)),c.push((15&e).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],d=0;a>d;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-8*(d%4);return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=e/(4*f),h=b?a.ceil(h):a.max((0|h)-this._minBufferSize,0);if(b=h*f,e=a.min(4*b,e),b){for(var i=0;b>i;i+=f)this._doProcessBlock(d,i);i=d.splice(0,b),c.sigBytes-=e}return new g.init(i,e)},clone:function(){var a=f.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0});d.Hasher=l.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){return a&&this._append(a),this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new m.HMAC.init(a,c).finalize(b)}}});var m=c.algo={};return c}(Math);!function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,e=[],b=a.algo.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],f=c[1],g=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)e[j]=0|a[b+j];else{var k=e[j-3]^e[j-8]^e[j-14]^e[j-16];e[j]=k<<1|k>>>31}k=(d<<5|d>>>27)+i+e[j],k=20>j?k+((f&g|~f&h)+1518500249):40>j?k+((f^g^h)+1859775393):60>j?k+((f&g|f&h|g&h)-1894007588):k+((f^g^h)-899497514),i=h,h=g,g=f<<30|f>>>2,f=d,d=k}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+g|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.SHA1=d._createHelper(b),a.HmacSHA1=d._createHmacHelper(b)}(),function(){var a=CryptoJS,b=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=new a.init,"string"==typeof c&&(c=b.parse(c));var d=a.blockSize,e=4*d;c.sigBytes>e&&(c=a.finalize(c)),c.clamp();for(var f=this._oKey=c.clone(),g=this._iKey=c.clone(),h=f.words,i=g.words,j=0;d>j;j++)h[j]^=1549556828,i[j]^=909522486;f.sigBytes=g.sigBytes=e,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher;return a=b.finalize(a),b.reset(),b.finalize(this._oKey.clone().concat(a))}})}();
\ No newline at end of file
+var CryptoJS=CryptoJS||function(a,b){var c={},d=c.lib={},e=function(){},f=d.Base={extend:function(a){e.prototype=this;var b=new e;return a&&b.mixIn(a),b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},g=d.WordArray=f.extend({init:function(a,c){a=this.words=a||[],this.sigBytes=c!=b?c:4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes;if(a=a.sigBytes,this.clamp(),d%4)for(var e=0;e>>2]|=(c[e>>>2]>>>24-e%4*8&255)<<24-(d+e)%4*8;else if(65535>>2]=c[e>>>2];else b.push.apply(b,c);return this.sigBytes+=a,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c=[],d=0;d>>2]>>>24-d%4*8&255;c.push((e>>>4).toString(16)),c.push((15&e).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],d=0;d>>2]>>>24-d%4*8&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(a){throw Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=e/(4*f),h=b?a.ceil(h):a.max((0|h)-this._minBufferSize,0);if(b=h*f,e=a.min(4*b,e),b){for(var i=0;ij;j++){if(16>j)e[j]=0|a[b+j];else{var k=e[j-3]^e[j-8]^e[j-14]^e[j-16];e[j]=k<<1|k>>>31}k=(d<<5|d>>>27)+i+e[j],k=20>j?k+(1518500249+(f&g|~f&h)):40>j?k+(1859775393+(f^g^h)):60>j?k+((f&g|f&h|g&h)-1894007588):k+((f^g^h)-899497514),i=h,h=g,g=f<<30|f>>>2,f=d,d=k}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+g|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[14+(d+64>>>9<<4)]=Math.floor(c/4294967296),b[15+(d+64>>>9<<4)]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.SHA1=d._createHelper(b),a.HmacSHA1=d._createHmacHelper(b)}(),function(){var a=CryptoJS,b=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=new a.init,"string"==typeof c&&(c=b.parse(c));var d=a.blockSize,e=4*d;c.sigBytes>e&&(c=a.finalize(c)),c.clamp();for(var f=this._oKey=c.clone(),g=this._iKey=c.clone(),h=f.words,i=g.words,j=0;j0?b.actionType:"show"==b.actionType?"hide":"show"}function gf_is_match(a,b){var c,d=jQuery,e=b.fieldId,f=gformExtractFieldId(e),g=gformExtractInputIndex(e),h=g!==!1;c=d(h?"#input_{0}_{1}_{2}".format(a,f,g):'input[id="input_{0}_{1}"], input[id^="input_{0}_{1}_"], input[id^="choice_{0}_{1}_"], select#input_{0}_{1}, textarea#input_{0}_{1}'.format(a,b.fieldId));var i=-1!==d.inArray(c.attr("type"),["checkbox","radio"]),j=i?gf_is_match_checkable(c,b,a,f):gf_is_match_default(c.eq(0),b,a,f);return gform.applyFilters("gform_is_value_match",j,a,b)}function gf_is_match_checkable(a,b,c,d){var e=!1;return a.each(function(){var a=jQuery(this),f=gf_get_value(a.val()),g=-1!==jQuery.inArray(b.operator,["<",">"]),h=-1!==jQuery.inArray(b.operator,["contains","starts_with","ends_with"]);if(f==b.value||g||h)return a.is(":checked")?"gf_other_choice"==f&&(f=$("#input_{0}_{1}_other".format(c,d)).val()):f="",gf_matches_operation(f,b.value,b.operator)?(e=!0,!1):void 0}),e}function gf_is_match_default(a,b,c,d){for(var e=a.val(),f=e instanceof Array?e:[e],g=0,h=0;h=0:!0,j=gf_get_value(f[h]),k=gf_get_field_number_format(b.fieldId,c,"value");k&&!i&&(j=gf_format_number(j,k));var l=b.value;gf_matches_operation(j,l,b.operator)&&g++}var m="isnot"==b.operator?g==f.length:g>0;return m}function gf_format_number(a,b){return decimalSeparator=".","currency"==b?decimalSeparator=gformGetDecimalSeparator("currency"):"decimal_comma"==b?decimalSeparator=",":"decimal_dot"==b&&(decimalSeparator="."),a=gformCleanNumber(a,"","",decimalSeparator),a||(a=0),number=a.toString(),number}function gf_try_convert_float(a){var b="decimal_dot";if(gformIsNumeric(a,b)){var c="decimal_comma"==b?",":".";return gformCleanNumber(a,"","",c)}return a}function gf_matches_operation(a,b,c){switch(a=a?a.toLowerCase():"",b=b?b.toLowerCase():"",c){case"is":return a==b;case"isnot":return a!=b;case">":return a=gf_try_convert_float(a),b=gf_try_convert_float(b),gformIsNumber(a)&&gformIsNumber(b)?a>b:!1;case"<":return a=gf_try_convert_float(a),b=gf_try_convert_float(b),gformIsNumber(a)&&gformIsNumber(b)?b>a:!1;case"contains":return a.indexOf(b)>=0;case"starts_with":return 0==a.indexOf(b);case"ends_with":var d=a.length-b.length;if(0>d)return!1;var e=a.substring(d);return b==e}return!1}function gf_get_value(a){return a?(a=a.split("|"),a[0]):""}function gf_do_field_action(a,b,c,d,e){for(var f=window.gf_form_conditional_logic[a],g=f.dependents[c],h=0;h0?h.slideDown(f):f&&f();else{var i=h.data("gf_display");""!=i&&"none"!=i||(i="list-item"),h.css("display",i),f&&f()}else{var j=h.children().first();if(j.length>0){var k=gform.applyFilters("gform_reset_pre_conditional_logic_field_action",!0,g,b,d,e);k&&!gformIsHidden(j)&&gf_reset_to_default(b,d)}h.find("select").each(function(){$select=jQuery(this),$select.data("tabindex",$select.attr("tabindex")).removeAttr("tabindex")}),h.data("gf_display")||h.data("gf_display",h.css("display")),c&&!e?h.length>0&&h.is(":visible")?h.slideUp(f):f&&f():(h.hide(),f&&f())}}function gf_reset_to_default(a,b){var c=jQuery(a).find(".gfield_date_month input, .gfield_date_day input, .gfield_date_year input, .gfield_date_dropdown_month select, .gfield_date_dropdown_day select, .gfield_date_dropdown_year select");if(c.length>0)return void c.each(function(){var a=jQuery(this);if(b){var c="d";a.parents().hasClass("gfield_date_month")||a.parents().hasClass("gfield_date_dropdown_month")?c="m":(a.parents().hasClass("gfield_date_year")||a.parents().hasClass("gfield_date_dropdown_year"))&&(c="y"),val=b[c]}else val="";"SELECT"==a.prop("tagName")&&""!=val&&(val=parseInt(val)),a.val()!=val?a.val(val).trigger("change"):a.val(val)});var d=jQuery(a).find('select, input[type="text"]:not([id*="_shim"]), input[type="number"], textarea'),e=0;d.each(function(){var a="",c=jQuery(this),d=c.prev("input").attr("value");if("gf_other_choice"==d)a=c.attr("value");else if(jQuery.isArray(b))a=b[e];else if(jQuery.isPlainObject(b)){if(a=b[c.attr("name")],!a){var f=c.attr("id").split("_").slice(2).join(".");a=b[f]}}else b&&(a=b);c.is("select:not([multiple])")&&!a&&(a=c.find("option").not(":disabled").eq(0).val()),c.val()!=a?(c.val(a).trigger("change"),c.is("select")&&c.next().hasClass("chosen-container")&&c.trigger("chosen:updated")):c.val(a),e++});var f=jQuery(a).find('input[type="radio"], input[type="checkbox"]:not(".copy_values_activated")');f.each(function(){var a=!!jQuery(this).is(":checked"),c=b?jQuery.inArray(jQuery(this).attr("id"),b)>-1:!1;a!=c&&("checkbox"==jQuery(this).attr("type")?jQuery(this).trigger("click"):(jQuery(this).prop("checked",c),jQuery(this).trigger("click").prop("checked",c)))})}var __gf_timeout_handle;gform.addAction("gform_input_change",function(a,b,c){var d=rgars(gf_form_conditional_logic,[b,"fields",gformExtractFieldId(c)].join("/"));d&&gf_apply_rules(b,d)},10);
\ No newline at end of file
+function gf_apply_rules(a,b,c){var d=0;jQuery(document).trigger("gform_pre_conditional_logic",[a,b,c]);for(var e=0;e0?b.actionType:"show"==b.actionType?"hide":"show"}function gf_is_match(a,b){var c,d=jQuery,e=b.fieldId,f=gformExtractFieldId(e),g=gformExtractInputIndex(e),h=!1!==g;c=d(h?"#input_{0}_{1}_{2}".format(a,f,g):'input[id="input_{0}_{1}"], input[id^="input_{0}_{1}_"], input[id^="choice_{0}_{1}_"], select#input_{0}_{1}, textarea#input_{0}_{1}'.format(a,b.fieldId));var i=-1!==d.inArray(c.attr("type"),["checkbox","radio"]),j=i?gf_is_match_checkable(c,b,a,f):gf_is_match_default(c.eq(0),b,a,f);return gform.applyFilters("gform_is_value_match",j,a,b)}function gf_is_match_checkable(a,b,c,d){var e=!1;return a.each(function(){var a=jQuery(this),f=gf_get_value(a.val()),g=-1!==jQuery.inArray(b.operator,["<",">"]),h=-1!==jQuery.inArray(b.operator,["contains","starts_with","ends_with"]);if(f==b.value||g||h)return a.is(":checked")?"gf_other_choice"==f&&(f=$("#input_{0}_{1}_other".format(c,d)).val()):f="",gf_matches_operation(f,b.value,b.operator)?(e=!0,!1):void 0}),e}function gf_is_match_default(a,b,c,d){for(var e=a.val(),f=e instanceof Array?e:[e],g=0,h=0;h=0,j=gf_get_value(f[h]),k=gf_get_field_number_format(b.fieldId,c,"value");k&&!i&&(j=gf_format_number(j,k));gf_matches_operation(j,b.value,b.operator)&&g++}return"isnot"==b.operator?g==f.length:g>0}function gf_format_number(a,b){return decimalSeparator=".","currency"==b?decimalSeparator=gformGetDecimalSeparator("currency"):"decimal_comma"==b?decimalSeparator=",":"decimal_dot"==b&&(decimalSeparator="."),a=gformCleanNumber(a,"","",decimalSeparator),a||(a=0),number=a.toString(),number}function gf_try_convert_float(a){var b="decimal_dot";if(gformIsNumeric(a,b)){var c="decimal_comma"==b?",":".";return gformCleanNumber(a,"","",c)}return a}function gf_matches_operation(a,b,c){switch(a=a?a.toLowerCase():"",b=b?b.toLowerCase():"",c){case"is":return a==b;case"isnot":return a!=b;case">":return a=gf_try_convert_float(a),b=gf_try_convert_float(b),!(!gformIsNumber(a)||!gformIsNumber(b))&&a>b;case"<":return a=gf_try_convert_float(a),b=gf_try_convert_float(b),!(!gformIsNumber(a)||!gformIsNumber(b))&&a=0;case"starts_with":return 0==a.indexOf(b);case"ends_with":var d=a.length-b.length;if(d<0)return!1;return b==a.substring(d)}return!1}function gf_get_value(a){return a?(a=a.split("|"),a[0]):""}function gf_do_field_action(a,b,c,d,e){for(var f=window.gf_form_conditional_logic[a],g=f.dependents[c],h=0;h0?h.slideDown(f):f&&f();else{var i=h.data("gf_display");""!=i&&"none"!=i||(i="list-item"),h.css("display",i),f&&f()}else{var j=h.children().first();if(j.length>0){gform.applyFilters("gform_reset_pre_conditional_logic_field_action",!0,g,b,d,e)&&!gformIsHidden(j)&&gf_reset_to_default(b,d)}h.find("select").each(function(){$select=jQuery(this),$select.data("tabindex",$select.attr("tabindex")).removeAttr("tabindex")}),h.data("gf_display")||h.data("gf_display",h.css("display")),c&&!e?h.length>0&&h.is(":visible")?h.slideUp(f):f&&f():(h.hide(),f&&f())}}function gf_reset_to_default(a,b){var c=jQuery(a).find(".gfield_date_month input, .gfield_date_day input, .gfield_date_year input, .gfield_date_dropdown_month select, .gfield_date_dropdown_day select, .gfield_date_dropdown_year select");if(c.length>0)return void c.each(function(){var a=jQuery(this);if(b){var c="d";a.parents().hasClass("gfield_date_month")||a.parents().hasClass("gfield_date_dropdown_month")?c="m":(a.parents().hasClass("gfield_date_year")||a.parents().hasClass("gfield_date_dropdown_year"))&&(c="y"),val=b[c]}else val="";"SELECT"==a.prop("tagName")&&""!=val&&(val=parseInt(val)),a.val()!=val?a.val(val).trigger("change"):a.val(val)});var d=jQuery(a).find('select, input[type="text"]:not([id*="_shim"]), input[type="number"], textarea'),e=0;d.each(function(){var a="",c=jQuery(this);if("gf_other_choice"==c.prev("input").attr("value"))a=c.attr("value");else if(jQuery.isArray(b))a=b[e];else if(jQuery.isPlainObject(b)){if(!(a=b[c.attr("name")])){var d=c.attr("id").split("_").slice(2).join(".");a=b[d]}}else b&&(a=b);c.is("select:not([multiple])")&&!a&&(a=c.find("option").not(":disabled").eq(0).val()),c.val()!=a?(c.val(a).trigger("change"),c.is("select")&&c.next().hasClass("chosen-container")&&c.trigger("chosen:updated")):c.val(a),e++}),jQuery(a).find('input[type="radio"], input[type="checkbox"]:not(".copy_values_activated")').each(function(){var a=!!jQuery(this).is(":checked"),c=!!b&&jQuery.inArray(jQuery(this).attr("id"),b)>-1;a!=c&&("checkbox"==jQuery(this).attr("type")?jQuery(this).trigger("click"):(jQuery(this).prop("checked",c),jQuery(this).trigger("click").prop("checked",c)))})}var __gf_timeout_handle;gform.addAction("gform_input_change",function(a,b,c){var d=rgars(gf_form_conditional_logic,[b,"fields",gformExtractFieldId(c)].join("/"));d&&gf_apply_rules(b,d)},10);
\ No newline at end of file
diff --git a/js/form_admin.min.js b/js/form_admin.min.js
index d1c77e8..5b14e84 100644
--- a/js/form_admin.min.js
+++ b/js/form_admin.min.js
@@ -1 +1 @@
-function FormatCurrency(a){if(gf_vars.gf_currency_config){var b=new Currency(gf_vars.gf_currency_config),c=b.toMoney(jQuery(a).val());jQuery(a).val(c)}}function ToggleConditionalLogic(a,b){var c=a?"":"slow";if(jQuery("#"+b+"_conditional_logic").is(":checked")){var d=GetConditionalObject(b);CreateConditionalLogic(b,d),SetConditionalProperty(b,"actionType",jQuery("#"+b+"_action_type").val()),SetConditionalProperty(b,"logicType",jQuery("#"+b+"_logic_type").val()),SetRule(b,0),jQuery("#"+b+"_conditional_logic_container").show(c)}else jQuery("#"+b+"_conditional_logic_container").hide(c)}function GetConditionalObject(a){var b=!1;switch(a){case"page":case"field":b=GetSelectedField();break;case"next_button":var c=GetSelectedField();b=c.nextButton;break;case"confirmation":b=confirmation;break;case"notification":b=current_notification;break;default:b="undefined"!=typeof form?form.button:!1}return b=gform.applyFilters("gform_conditional_object",b,a)}function CreateConditionalLogic(a,b){b.conditionalLogic||(b.conditionalLogic=new ConditionalLogic);var c,d="hide"==b.conditionalLogic.actionType?"selected='selected'":"",e="show"==b.conditionalLogic.actionType?"selected='selected'":"",f="all"==b.conditionalLogic.logicType?"selected='selected'":"",g="any"==b.conditionalLogic.logicType?"selected='selected'":"";c="section"==b.type?gf_vars.thisSectionIf:"field"==a?gf_vars.thisFieldIf:"page"==a?gf_vars.thisPage:"confirmation"==a?gf_vars.thisConfirmation:"notification"==a?gf_vars.thisNotification:gf_vars.thisFormButton;var h={};h.actionType=""+gf_vars.show+" "+gf_vars.hide+" ",h.objectDescription=c,h.logicType=""+gf_vars.all+" "+gf_vars.any+" ",h.ofTheFollowingMatch=gf_vars.ofTheFollowingMatch;var i=makeArray(h),j=i.join(" ");j=gform.applyFilters("gform_conditional_logic_description",j,h,a,b);var k,l;for(k=0;k",j+=GetRuleFields(a,k,l.fieldId),j+=GetRuleOperators(a,k,l.fieldId,l.operator),j+=GetRuleValues(a,k,l.fieldId,l.value),j+=" ",b.conditionalLogic.rules.length>1&&(j+=" "),j+=" ";jQuery("#"+a+"_conditional_logic_container").html(j),Placeholders.enable()}function GetRuleOperators(a,b,c,d){var e,f,g,h;return f={is:"is",isnot:"isNot",">":"greaterThan","<":"lessThan",contains:"contains",starts_with:"startsWith",ends_with:"endsWith"},e="',g=IsEntryMeta(c)?GetOperatorsForMeta(f,c):f,g=gform.applyFilters("gform_conditional_logic_operators",g,a,c),jQuery.each(g,function(a,b){h=d==a?"selected='selected'":"",e+=""+gf_vars[b]+" "}),e+=" "}function GetOperatorsForMeta(a,b){var c={};return entry_meta[b]&&entry_meta[b].filter&&entry_meta[b].filter.operators?jQuery.each(a,function(a,d){jQuery.inArray(a,entry_meta[b].filter.operators)>=0&&(c[a]=d)}):c=a,c}function GetRuleFields(a,b,c){for(var d="",e=[],f=0;f"}function GetRuleFieldsOptions(a,b){for(var c="",d=0;d',c+=GetRuleFieldsOptions(e.options,b),c+="";else{var f=e.value==b?"selected='selected'":"";c+=""+e.label+" "}}return c}function GetEntryMetaFields(a){var b=[];return"undefined"==typeof entry_meta?b:(jQuery.each(entry_meta,function(c,d){"undefined"!=typeof d.filter&&b.push({label:d.label,value:c,isSelected:a==c?"selected='selected'":""})}),b)}function IsConditionalLogicField(a){var b=a.inputType?a.inputType:a.type,c=GetConditionalLogicFields(),d=jQuery.inArray(b,c),e=d>=0;return e=gform.applyFilters("gform_is_conditional_logic_field",e,a)}function IsEntryMeta(a){return"undefined"!=typeof entry_meta&&"undefined"!=typeof entry_meta[a]}function GetRuleValues(a,b,c,d,e){e||(e=!1);var f=0==e?a+"_rule_value_"+b:e;if(0==c&&(c=GetFirstRuleField()),0==c)return"";var g=GetFieldById(c),h=IsEntryMeta(c),i=GetConditionalObject(a),j=i.conditionalLogic.rules[b],k=j.operator,l="";if(g&&"post_category"==g.type&&g.displayAllCategories){var m=jQuery("#"+f+".gfield_category_dropdown");if(m.length>0){var n=m.html();n=n.replace(/ selected="selected"/g,""),n=n.replace('value="'+d+'"','value="'+d+'" selected="selected"'),l=""+n+" "}else{var o=0==e?"gfield_ajax_placeholder_"+b:e+"_placeholder";jQuery.post(ajaxurl,{action:"gf_get_post_categories",objectType:a,ruleIndex:b,inputName:e,selectedValue:d},function(c){c&&(jQuery("#"+o).replaceWith(c.trim()),SetRuleProperty(a,b,"value",jQuery("#"+f).val()))}),l=""+gf_vars.loading+" "}}else if(g&&g.choices&&jQuery.inArray(k,["is","isnot"])>-1){var p=g.placeholder?[{text:g.placeholder,value:""}].concat(g.choices):g.choices;l=GetRuleValuesDropDown(p,a,b,d,e)}else IsAddressSelect(c,g)?(jQuery.post(ajaxurl,{action:"gf_get_address_rule_values_select",address_type:g.addressType?g.addressType:gf_vars.defaultAddressType,value:d,id:f,form_id:g.formId},function(c){c&&($select=jQuery(c.trim()),$placeholder=jQuery("#"+f),$placeholder.replaceWith($select),SetRuleProperty(a,b,"value",$select.val()))}),l=""+gf_vars.loading+" "):h&&entry_meta&&entry_meta[c]&&entry_meta[c].filter&&"undefined"!=typeof entry_meta[c].filter.choices?l=GetRuleValuesDropDown(entry_meta[c].filter.choices,a,b,d,e):(d=d?d.replace(/'/g,"'"):"",l=" ');return l=gform.applyFilters("gform_conditional_logic_values_input",l,a,b,c,d)}function IsAddressSelect(a,b){if(!b||"address"!=GetInputType(b))return!1;var c=b.addressType?b.addressType:gf_vars.defaultAddressType;if(!gf_vars.addressTypes[c])return!1;var d=gf_vars.addressTypes[c],e=a==b.id+".6",f=a==b.id+".4";return e&&"international"==c||f&&"object"==typeof d.states}function GetFirstRuleField(){for(var a=0;a",h=!1,i=0;i"+a[i].text+"").text())?j:a[i].text;g+=""+m+" "}return!h&&d&&""!=d&&(g+=""+d+" "),g+=" "}function isEmpty(a){}function SetRuleProperty(a,b,c,d){var e=GetConditionalObject(a);e.conditionalLogic.rules[b][c]=d}function GetFieldById(a){a=parseInt(a);for(var b=0;b ',this.init=function(){return this.spinner=jQuery(this.image),jQuery(this.elem).after(this.spinner),this},this.destroy=function(){jQuery(this.spinner).remove()},this.init()}function InsertVariable(a,b,c){c||(c=jQuery("#"+a+"_variable_select").val());var d=document.getElementById(a),e=jQuery(d);if(document.selection)e[0].focus(),document.selection.createRange().text=c;else if("selectionStart"in d){var f=d.selectionStart;d.value=d.value.substr(0,f)+c+d.value.substr(d.selectionEnd,d.value.length),d.selectionStart=f+d.value.length,d.selectionEnd=f+d.value.length}else e.val(c+messageElement.val());var g=jQuery("#"+a+"_variable_select");g.length>0&&(g[0].selectedIndex=0),b&&window[b]&&window[b].call(null,a,c)}function InsertEditorVariable(a,b){if(!b){var c=jQuery("#"+a+"_variable_select");c[0].selectedIndex=0,b=c.val()}wpActiveEditor=a,window.send_to_editor(b)}function GetInputType(a){return a.inputType?a.inputType:a.type}function HasPostField(){for(var a=0;a0?a.adminLabel:a.label,null!=d?c?d.label:e+" ("+d.label+")":e}function DeleteNotification(a){jQuery("#action_argument").val(a),jQuery("#action").val("delete"),jQuery("#notification_list_form")[0].submit()}function DuplicateNotification(a){jQuery("#action_argument").val(a),jQuery("#action").val("duplicate"),jQuery("#notification_list_form")[0].submit()}function DeleteConfirmation(a){jQuery("#action_argument").val(a),jQuery("#action").val("delete"),jQuery("#confirmation_list_form")[0].submit()}function DuplicateConfirmation(a){jQuery("#action_argument").val(a),jQuery("#action").val("duplicate"),jQuery("#confirmation_list_form")[0].submit()}function SetConfirmationConditionalLogic(){confirmation.conditionalLogic=jQuery("#conditional_logic").val()?jQuery.parseJSON(jQuery("#conditional_logic").val()):new ConditionalLogic}function ToggleConfirmation(){var a,b="",c=jQuery("#form_confirmation_redirect").is(":checked"),d=jQuery("#form_confirmation_show_page").is(":checked");c?(a=".form_confirmation_redirect_container",b="#form_confirmation_message_container, .form_confirmation_page_container",ClearConfirmationSettings(["text","page"])):d?(a=".form_confirmation_page_container",b="#form_confirmation_message_container, .form_confirmation_redirect_container",ClearConfirmationSettings(["text","redirect"])):(a="#form_confirmation_message_container",b=".form_confirmation_page_container, .form_confirmation_redirect_container",ClearConfirmationSettings(["page","redirect"])),ToggleQueryString(),TogglePageQueryString(),jQuery(b).hide(),jQuery(a).show()}function ToggleQueryString(){jQuery("#form_redirect_use_querystring").is(":checked")?jQuery("#form_redirect_querystring_container").show():(jQuery("#form_redirect_querystring_container").hide(),jQuery("#form_redirect_querystring").val(""),jQuery("#form_redirect_use_querystring").val(""))}function TogglePageQueryString(){jQuery("#form_page_use_querystring").is(":checked")?jQuery("#form_page_querystring_container").show():(jQuery("#form_page_querystring_container").hide(),jQuery("#form_page_querystring").val(""),jQuery("#form_page_use_querystring").val(""))}function ClearConfirmationSettings(a){var b=jQuery.isArray(a)?a:[a];for(i in b)if(b.hasOwnProperty(i))switch(b[i]){case"text":jQuery("#form_confirmation_message").val(""),jQuery("#form_disable_autoformatting").prop("checked",!1);break;case"page":jQuery("#form_confirmation_page").val(""),jQuery("#form_page_querystring").val(""),jQuery("#form_page_use_querystring").prop("checked",!1);break;case"redirect":jQuery("#form_confirmation_url").val(""),jQuery("#form_redirect_querystring").val(""),jQuery("#form_redirect_use_querystring").prop("checked",!1)}}function StashConditionalLogic(){var a=JSON.stringify(confirmation.conditionalLogic);jQuery("#conditional_logic").val(a)}function ConfirmationObj(){this.id=!1,this.name=gf_vars.confirmationDefaultName,this.type="message",this.message=gf_vars.confirmationDefaultMessage,this.isDefault=0}function Copy(a){if(!a)return a;if("object"!=typeof a)return a;a=jQuery.isArray(a)?a.slice():jQuery.extend({},a);for(i in a)a[i]=Copy(a[i]);return a}function SimpleConditionObject(a,b){if(b.indexOf("simple_condition")<0)return a;var c=b.substring(17)+"_object";return window[c]}function FeedConditionConditionalObject(a,b){return"feed_condition"!=b?a:feedCondition.logicObject}function FeedConditionConditionalDescription(a,b,c,d){if("feed_condition"!=c)return a;b.actionType=b.actionType.replace("0){var c=b.data("gf_dismissible_key"),d=b.data("gf_dismissible_nonce");c&&jQuery.ajax({url:ajaxurl,data:{action:"gf_dismiss_message",message_key:c,nonce:d}})}})}),function(a,b,c){function d(a){return"undefined"!=typeof a}a.init=function(){f=window.form;var a=0;d(f)&&(a=f.id)},a.toggleFeedActive=function(a,b,c){var d=a.src.indexOf("active1.png")>=0?0:1;return a.src=a.src.replace("active1.png","spinner.gif"),a.src=a.src.replace("active0.png","spinner.gif"),jQuery.post(ajaxurl,{action:"gf_feed_is_active_"+b,feed_id:c,is_active:d},function(b){d?(a.src=a.src.replace("spinner.gif","active1.png"),jQuery(a).attr("title",gf_vars.inactive).attr("alt",gf_vars.inactive)):(a.src=a.src.replace("spinner.gif","active0.png"),jQuery(a).attr("title",gf_vars.active).attr("alt",gf_vars.active))}),!0},a.deleteFeed=function(a){b("#single_action").val("delete"),b("#single_action_argument").val(a),b("#gform-settings").submit()},a.duplicateFeed=function(a){b("#single_action").val("duplicate"),b("#single_action_argument").val(a),b("#gform-settings").submit()}}(window.gaddon=window.gaddon||{},jQuery);var gfMergeTagsObj=function(a){this.form=a,this.init=function(){var a=this;this.mergeTagList=jQuery(''),this.mergeTagListHover=!1,jQuery(".merge-tag-support").length<=0||(jQuery(".merge-tag-support").bind("keydown",function(a){var b=jQuery(this).data("autocomplete")&&jQuery(this).data("autocomplete").menu?jQuery(this).data("autocomplete").menu.active:!1;a.keyCode===jQuery.ui.keyCode.TAB&&b&&a.preventDefault()}).each(function(){var b=jQuery(this),c=b.is("input")?"input":"textarea";b.autocomplete({minLength:1,source:function(c,d){var e=a.extractLast(c.term);if(e.length ');if(e.data("targetElement",b.attr("id")),a.getClassProperty(this,"manual_position")){var f=".mt-"+b.attr("id");jQuery(f).append(e)}else b.after(e)}),jQuery(".tooltip-merge-tag").tooltip({show:{delay:1250},content:function(){return jQuery(this).prop("title")}}),jQuery(".all-merge-tags a.open-list").click(function(){var b=jQuery(this),c=a.getTargetElement(b);a.mergeTagList.html(a.getMergeTagListItems(c)),a.mergeTagList.insertAfter(b).show(),jQuery("ul#gf_merge_tag_list a").click(function(){var b=jQuery(this).data("value"),c=a.getTargetElement(this);a.isWpEditor(c)?InsertEditorVariable(c.attr("id"),b):InsertVariable(c.attr("id"),null,b),c.trigger("input").trigger("propertychange"),a.mergeTagList.hide()})}),this.getTargetElement=function(a){var a=jQuery(a);return jQuery("#"+a.parents("span.all-merge-tags").data("targetElement"))},this.mergeTagList.hover(function(){a.mergeTagListHover=!0},function(){a.mergeTagListHover=!1}),jQuery("body").mouseup(function(){a.mergeTagListHover||a.mergeTagList.hide()}))},this.split=function(a){return a.split(" ")},this.extractLast=function(a){return this.split(a).pop()},this.startsWith=function(a,b){return 0===a.indexOf(b)},this.getMergeTags=function(a,b,c,d,e,f){"undefined"==typeof a&&(a=[]),"undefined"==typeof d&&(d=[]);var g=[],h=[],j=[],k=[],l=[],m=[],n=[],o=[],p=[];if(c||k.push({tag:"{all_fields}",label:this.getMergeTagLabel("{all_fields}")}),!e){for(i in a)if(a.hasOwnProperty(i)){var q=a[i];if(!q.displayOnly){var r=GetInputType(q);if(-1==jQuery.inArray(r,d)){if(q.isRequired)switch(r){case"name":var s,t,u,v,w=Copy(q);"extended"==q.nameFormat?(s=GetInput(q,q.id+".2"),u=GetInput(q,q.id+".8"),v=Copy(q),v.inputs=[s,u],h.push(v),delete w.inputs[0],delete w.inputs[3]):"advanced"==q.nameFormat&&(s=GetInput(q,q.id+".2"),t=GetInput(q,q.id+".4"),u=GetInput(q,q.id+".8"),v=Copy(q),v.inputs=[s,t,u],h.push(v),delete w.inputs[0],delete w.inputs[2],delete w.inputs[4]),g.push(w);break;default:g.push(q)}else h.push(q);IsPricingField(q.type)&&j.push(q)}}}if(g.length>0)for(i in g)g.hasOwnProperty(i)&&(l=l.concat(this.getFieldMergeTags(g[i],f)));if(h.length>0)for(i in h)h.hasOwnProperty(i)&&(m=m.concat(this.getFieldMergeTags(h[i],f)));if(j.length>0){c||n.push({tag:"{pricing_fields}",label:this.getMergeTagLabel("{pricing_fields}")});for(i in j)j.hasOwnProperty(i)&&n.concat(this.getFieldMergeTags(j[i],f))}}o.push({tag:"{ip}",label:this.getMergeTagLabel("{ip}")}),o.push({tag:"{date_mdy}",label:this.getMergeTagLabel("{date_mdy}")}),o.push({tag:"{date_dmy}",label:this.getMergeTagLabel("{date_dmy}")}),o.push({tag:"{embed_post:ID}",label:this.getMergeTagLabel("{embed_post:ID}")}),o.push({tag:"{embed_post:post_title}",label:this.getMergeTagLabel("{embed_post:post_title}")}),o.push({tag:"{embed_url}",label:this.getMergeTagLabel("{embed_url}")}),e||(o.push({tag:"{entry_id}",label:this.getMergeTagLabel("{entry_id}")}),o.push({tag:"{entry_url}",label:this.getMergeTagLabel("{entry_url}")}),o.push({tag:"{form_id}",label:this.getMergeTagLabel("{form_id}")}),o.push({tag:"{form_title}",label:this.getMergeTagLabel("{form_title}")})),o.push({tag:"{user_agent}",label:this.getMergeTagLabel("{user_agent}")}),o.push({tag:"{referer}",label:this.getMergeTagLabel("{referer}")}),HasPostField()&&!e&&(o.push({tag:"{post_id}",label:this.getMergeTagLabel("{post_id}")}),o.push({tag:"{post_edit_url}",label:this.getMergeTagLabel("{post_edit_url}")})),o.push({tag:"{user:display_name}",label:this.getMergeTagLabel("{user:display_name}")}),o.push({tag:"{user:user_email}",label:this.getMergeTagLabel("{user:user_email}")}),o.push({tag:"{user:user_login}",label:this.getMergeTagLabel("{user:user_login}")});var x=this.getCustomMergeTags();if(x.tags.length>0)for(i in x.tags)if(x.tags.hasOwnProperty(i)){var y=x.tags[i];p.push({tag:y.tag,label:y.label})}var z={ungrouped:{label:this.getMergeGroupLabel("ungrouped"),tags:k},required:{label:this.getMergeGroupLabel("required"),tags:l},optional:{label:this.getMergeGroupLabel("optional"),tags:m},pricing:{label:this.getMergeGroupLabel("pricing"),tags:n},other:{label:this.getMergeGroupLabel("other"),tags:o},custom:{label:this.getMergeGroupLabel("custom"),tags:p}};return z=gform.applyFilters("gform_merge_tags",z,b,c,d,e,f,this)},this.getMergeTagLabel=function(a){for(groupName in gf_vars.mergeTags)if(gf_vars.mergeTags.hasOwnProperty(groupName)){var b=gf_vars.mergeTags[groupName].tags;for(i in b)if(b.hasOwnProperty(i)&&b[i].tag==a)return b[i].label}return""},this.getMergeGroupLabel=function(a){return gf_vars.mergeTags[a].label},this.getFieldMergeTags=function(a,b){"undefined"==typeof b&&(b="");var c=[],d=GetInputType(a),e="list"==d?":"+b:"",f="",g="";if(jQuery.inArray(d,["date","email","time","password"])>-1&&(a.inputs=null),"undefined"!=typeof a.inputs&&jQuery.isArray(a.inputs)){"checkbox"==d&&(g=GetLabel(a,a.id).replace("'","\\'"),f="{"+g+":"+a.id+e+"}",c.push({tag:f,label:g}));for(i in a.inputs)if(a.inputs.hasOwnProperty(i)){var h=a.inputs[i];"creditcard"==d&&jQuery.inArray(parseFloat(h.id),[parseFloat(a.id+".2"),parseFloat(a.id+".3"),parseFloat(a.id+".5")])>-1||(g=GetLabel(a,h.id).replace("'","\\'"),f="{"+g+":"+h.id+e+"}",c.push({tag:f,label:g}))}}else g=GetLabel(a).replace("'","\\'"),f="{"+g+":"+a.id+e+"}",c.push({tag:f,label:g});return c},this.getCustomMergeTags=function(){for(groupName in gf_vars.mergeTags)if(gf_vars.mergeTags.hasOwnProperty(groupName)&&"custom"==groupName)return gf_vars.mergeTags[groupName];return[]},this.getAutoCompleteMergeTags=function(a){var b=this.form.fields,c=a.attr("id"),d=1==this.getClassProperty(a,"hide_all_fields"),e=this.getClassProperty(a,"exclude"),f=this.getClassProperty(a,"option"),g=this.getClassProperty(a,"prepopulate");g&&(d=!0);var h=this.getMergeTags(b,c,d,e,g,f),j=[];for(group in h)if(h.hasOwnProperty(group)){var k=h[group].tags;for(i in k)k.hasOwnProperty(i)&&j.push(k[i].tag)}return j},this.getMergeTagListItems=function(a){var b=this.form.fields,c=a.attr("id"),d=1==this.getClassProperty(a,"hide_all_fields"),e=this.getClassProperty(a,"exclude"),f=this.getClassProperty(a,"prepopulate"),g=this.getClassProperty(a,"option");f&&(d=!0);var h=this.getMergeTags(b,c,d,e,f,g),j=this.hasMultipleGroups(h),k="";for(group in h)if(h.hasOwnProperty(group)){var l=h[group].label,m=h[group].tags;if(!(m.length<=0)){l&&j&&(k+='");for(i in m)if(m.hasOwnProperty(i)){var n=m[i];k+=''+n.label+" "}}}return k},this.hasMultipleGroups=function(a){var b=0;for(group in a)a.hasOwnProperty(group)&&a[group].tags.length>0&&b++;return b>1},this.getClassProperty=function(a,b){var a=jQuery(a),c=a.attr("class");if(!c)return"";var d=c.split(" ");for(i in d)if(d.hasOwnProperty(i)){var e=d[i].split("-");if("mt"==e[0]&&e[1]==b)return e.length>3?(delete e[0],delete e[1],e):2==e.length?!0:e[2]}return""},this.isWpEditor=function(a){var a=jQuery(a);return 1==this.getClassProperty(a,"wp_editor")},this.init()},FeedConditionObj=function(a){this.strings=isSet(a.strings)?a.strings:{},this.logicObject=a.logicObject,this.init=function(){var a=this;gform.addFilter("gform_conditional_object","FeedConditionConditionalObject"),gform.addFilter("gform_conditional_logic_description","FeedConditionConditionalDescription"),jQuery(document).ready(function(){ToggleConditionalLogic(!0,"feed_condition")}),jQuery("input#feed_condition_conditional_logic").parents("form").on("submit",function(){jQuery("input#feed_condition_conditional_logic_object").val(JSON.stringify(a.logicObject))})},this.init()};
\ No newline at end of file
+function FormatCurrency(a){if(gf_vars.gf_currency_config){var b=new Currency(gf_vars.gf_currency_config),c=b.toMoney(jQuery(a).val());jQuery(a).val(c)}}function ToggleConditionalLogic(a,b){var c=a?"":"slow";if(jQuery("#"+b+"_conditional_logic").is(":checked")){CreateConditionalLogic(b,GetConditionalObject(b)),SetConditionalProperty(b,"actionType",jQuery("#"+b+"_action_type").val()),SetConditionalProperty(b,"logicType",jQuery("#"+b+"_logic_type").val()),SetRule(b,0),jQuery("#"+b+"_conditional_logic_container").show(c)}else jQuery("#"+b+"_conditional_logic_container").hide(c)}function GetConditionalObject(a){var b=!1;switch(a){case"page":case"field":b=GetSelectedField();break;case"next_button":b=GetSelectedField().nextButton;break;case"confirmation":b=confirmation;break;case"notification":b=current_notification;break;default:b="undefined"!=typeof form&&form.button}return b=gform.applyFilters("gform_conditional_object",b,a)}function CreateConditionalLogic(a,b){b.conditionalLogic||(b.conditionalLogic=new ConditionalLogic);var c,d="hide"==b.conditionalLogic.actionType?"selected='selected'":"",e="show"==b.conditionalLogic.actionType?"selected='selected'":"",f="all"==b.conditionalLogic.logicType?"selected='selected'":"",g="any"==b.conditionalLogic.logicType?"selected='selected'":"";c="section"==b.type?gf_vars.thisSectionIf:"field"==a?gf_vars.thisFieldIf:"page"==a?gf_vars.thisPage:"confirmation"==a?gf_vars.thisConfirmation:"notification"==a?gf_vars.thisNotification:gf_vars.thisFormButton;var h={};h.actionType=""+gf_vars.show+" "+gf_vars.hide+" ",h.objectDescription=c,h.logicType=""+gf_vars.all+" "+gf_vars.any+" ",h.ofTheFollowingMatch=gf_vars.ofTheFollowingMatch;var i=makeArray(h),j=i.join(" ");j=gform.applyFilters("gform_conditional_logic_description",j,h,a,b);var k,l;for(k=0;k",j+=GetRuleFields(a,k,l.fieldId),j+=GetRuleOperators(a,k,l.fieldId,l.operator),j+=GetRuleValues(a,k,l.fieldId,l.value),j+=" ",b.conditionalLogic.rules.length>1&&(j+=" "),j+="";jQuery("#"+a+"_conditional_logic_container").html(j),Placeholders.enable()}function GetRuleOperators(a,b,c,d){var e,f,g,h;return f={is:"is",isnot:"isNot",">":"greaterThan","<":"lessThan",contains:"contains",starts_with:"startsWith",ends_with:"endsWith"},e="',g=IsEntryMeta(c)?GetOperatorsForMeta(f,c):f,g=gform.applyFilters("gform_conditional_logic_operators",g,a,c),jQuery.each(g,function(a,b){h=d==a?"selected='selected'":"",e+=""+gf_vars[b]+" "}),e+=" "}function GetOperatorsForMeta(a,b){var c={};return entry_meta[b]&&entry_meta[b].filter&&entry_meta[b].filter.operators?jQuery.each(a,function(a,d){jQuery.inArray(a,entry_meta[b].filter.operators)>=0&&(c[a]=d)}):c=a,c}function GetRuleFields(a,b,c){for(var d="",e=[],f=0;f"}function GetRuleFieldsOptions(a,b){for(var c="",d=0;d',c+=GetRuleFieldsOptions(e.options,b),c+="";else{var f=e.value==b?"selected='selected'":"";c+=""+e.label+" "}}return c}function GetEntryMetaFields(a){var b=[];return"undefined"==typeof entry_meta?b:(jQuery.each(entry_meta,function(c,d){void 0!==d.filter&&b.push({label:d.label,value:c,isSelected:a==c?"selected='selected'":""})}),b)}function IsConditionalLogicField(a){var b=a.inputType?a.inputType:a.type,c=GetConditionalLogicFields(),d=jQuery.inArray(b,c),e=d>=0;return e=gform.applyFilters("gform_is_conditional_logic_field",e,a)}function IsEntryMeta(a){return"undefined"!=typeof entry_meta&&void 0!==entry_meta[a]}function GetRuleValues(a,b,c,d,e){e||(e=!1);var f=0==e?a+"_rule_value_"+b:e;if(0==c&&(c=GetFirstRuleField()),0==c)return"";var g=GetFieldById(c),h=IsEntryMeta(c),i=GetConditionalObject(a),j=i.conditionalLogic.rules[b],k=j.operator,l="";if(g&&"post_category"==g.type&&g.displayAllCategories){var m=jQuery("#"+f+".gfield_category_dropdown");if(m.length>0){var n=m.html();n=n.replace(/ selected="selected"/g,""),n=n.replace('value="'+d+'"','value="'+d+'" selected="selected"'),l=""+n+" "}else{var o=0==e?"gfield_ajax_placeholder_"+b:e+"_placeholder";jQuery.post(ajaxurl,{action:"gf_get_post_categories",objectType:a,ruleIndex:b,inputName:e,selectedValue:d},function(c){c&&(jQuery("#"+o).replaceWith(c.trim()),SetRuleProperty(a,b,"value",jQuery("#"+f).val()))}),l=""+gf_vars.loading+" "}}else if(g&&g.choices&&jQuery.inArray(k,["is","isnot"])>-1){var p=g.placeholder?[{text:g.placeholder,value:""}].concat(g.choices):g.choices;l=GetRuleValuesDropDown(p,a,b,d,e)}else IsAddressSelect(c,g)?(jQuery.post(ajaxurl,{action:"gf_get_address_rule_values_select",address_type:g.addressType?g.addressType:gf_vars.defaultAddressType,value:d,id:f,form_id:g.formId},function(c){c&&($select=jQuery(c.trim()),$placeholder=jQuery("#"+f),$placeholder.replaceWith($select),SetRuleProperty(a,b,"value",$select.val()))}),l=""+gf_vars.loading+" "):h&&entry_meta&&entry_meta[c]&&entry_meta[c].filter&&void 0!==entry_meta[c].filter.choices?l=GetRuleValuesDropDown(entry_meta[c].filter.choices,a,b,d,e):(d=d?d.replace(/'/g,"'"):"",l=" ');return l=gform.applyFilters("gform_conditional_logic_values_input",l,a,b,c,d)}function IsAddressSelect(a,b){if(!b||"address"!=GetInputType(b))return!1;var c=b.addressType?b.addressType:gf_vars.defaultAddressType;if(!gf_vars.addressTypes[c])return!1;var d=gf_vars.addressTypes[c],e=a==b.id+".6",f=a==b.id+".4";return e&&"international"==c||f&&"object"==typeof d.states}function GetFirstRuleField(){for(var a=0;a",h=!1,i=0;i"+a[i].text+"").text())?j:a[i].text;g+=""+m+" "}return!h&&d&&""!=d&&(g+=""+d+" "),g+=" "}function isEmpty(a){}function SetRuleProperty(a,b,c,d){GetConditionalObject(a).conditionalLogic.rules[b][c]=d}function GetFieldById(a){a=parseInt(a);for(var b=0;b ',this.init=function(){return this.spinner=jQuery(this.image),jQuery(this.elem).after(this.spinner),this},this.destroy=function(){jQuery(this.spinner).remove()},this.init()}function InsertVariable(a,b,c){c||(c=jQuery("#"+a+"_variable_select").val());var d=document.getElementById(a),e=jQuery(d);if(document.selection)e[0].focus(),document.selection.createRange().text=c;else if("selectionStart"in d){var f=d.selectionStart;d.value=d.value.substr(0,f)+c+d.value.substr(d.selectionEnd,d.value.length),d.selectionStart=f+d.value.length,d.selectionEnd=f+d.value.length}else e.val(c+messageElement.val());var g=jQuery("#"+a+"_variable_select");g.length>0&&(g[0].selectedIndex=0),b&&window[b]&&window[b].call(null,a,c)}function InsertEditorVariable(a,b){if(!b){var c=jQuery("#"+a+"_variable_select");c[0].selectedIndex=0,b=c.val()}wpActiveEditor=a,window.send_to_editor(b)}function GetInputType(a){return a.inputType?a.inputType:a.type}function HasPostField(){for(var a=0;a0?a.adminLabel:a.label,null!=d?c?d.label:e+" ("+d.label+")":e}function DeleteNotification(a){jQuery("#action_argument").val(a),jQuery("#action").val("delete"),jQuery("#notification_list_form")[0].submit()}function DuplicateNotification(a){jQuery("#action_argument").val(a),jQuery("#action").val("duplicate"),jQuery("#notification_list_form")[0].submit()}function DeleteConfirmation(a){jQuery("#action_argument").val(a),jQuery("#action").val("delete"),jQuery("#confirmation_list_form")[0].submit()}function DuplicateConfirmation(a){jQuery("#action_argument").val(a),jQuery("#action").val("duplicate"),jQuery("#confirmation_list_form")[0].submit()}function SetConfirmationConditionalLogic(){confirmation.conditionalLogic=jQuery("#conditional_logic").val()?jQuery.parseJSON(jQuery("#conditional_logic").val()):new ConditionalLogic}function ToggleConfirmation(){var a,b="",c=jQuery("#form_confirmation_redirect").is(":checked"),d=jQuery("#form_confirmation_show_page").is(":checked");c?(a=".form_confirmation_redirect_container",b="#form_confirmation_message_container, .form_confirmation_page_container",ClearConfirmationSettings(["text","page"])):d?(a=".form_confirmation_page_container",b="#form_confirmation_message_container, .form_confirmation_redirect_container",ClearConfirmationSettings(["text","redirect"])):(a="#form_confirmation_message_container",b=".form_confirmation_page_container, .form_confirmation_redirect_container",ClearConfirmationSettings(["page","redirect"])),ToggleQueryString(),TogglePageQueryString(),jQuery(b).hide(),jQuery(a).show()}function ToggleQueryString(){jQuery("#form_redirect_use_querystring").is(":checked")?jQuery("#form_redirect_querystring_container").show():(jQuery("#form_redirect_querystring_container").hide(),jQuery("#form_redirect_querystring").val(""),jQuery("#form_redirect_use_querystring").val(""))}function TogglePageQueryString(){jQuery("#form_page_use_querystring").is(":checked")?jQuery("#form_page_querystring_container").show():(jQuery("#form_page_querystring_container").hide(),jQuery("#form_page_querystring").val(""),jQuery("#form_page_use_querystring").val(""))}function ClearConfirmationSettings(a){var b=jQuery.isArray(a)?a:[a];for(i in b)if(b.hasOwnProperty(i))switch(b[i]){case"text":jQuery("#form_confirmation_message").val(""),jQuery("#form_disable_autoformatting").prop("checked",!1);break;case"page":jQuery("#form_confirmation_page").val(""),jQuery("#form_page_querystring").val(""),jQuery("#form_page_use_querystring").prop("checked",!1);break;case"redirect":jQuery("#form_confirmation_url").val(""),jQuery("#form_redirect_querystring").val(""),jQuery("#form_redirect_use_querystring").prop("checked",!1)}}function StashConditionalLogic(){var a=JSON.stringify(confirmation.conditionalLogic);jQuery("#conditional_logic").val(a)}function ConfirmationObj(){this.id=!1,this.name=gf_vars.confirmationDefaultName,this.type="message",this.message=gf_vars.confirmationDefaultMessage,this.isDefault=0}function Copy(a){if(!a)return a;if("object"!=typeof a)return a;a=jQuery.isArray(a)?a.slice():jQuery.extend({},a);for(i in a)a[i]=Copy(a[i]);return a}function SimpleConditionObject(a,b){if(b.indexOf("simple_condition")<0)return a;var c=b.substring(17)+"_object";return window[c]}function FeedConditionConditionalObject(a,b){return"feed_condition"!=b?a:feedCondition.logicObject}function FeedConditionConditionalDescription(a,b,c,d){return"feed_condition"!=c?a:(b.actionType=b.actionType.replace("0){var c=b.data("gf_dismissible_key"),d=b.data("gf_dismissible_nonce");c&&jQuery.ajax({url:ajaxurl,data:{action:"gf_dismiss_message",message_key:c,nonce:d}})}})}),function(a,b,c){function d(a){return void 0!==a}a.init=function(){f=window.form;d(f)&&f.id},a.toggleFeedActive=function(a,b,c){var d=a.src.indexOf("active1.png")>=0?0:1;return a.src=a.src.replace("active1.png","spinner.gif"),a.src=a.src.replace("active0.png","spinner.gif"),jQuery.post(ajaxurl,{action:"gf_feed_is_active_"+b,feed_id:c,is_active:d},function(b){d?(a.src=a.src.replace("spinner.gif","active1.png"),jQuery(a).attr("title",gf_vars.inactive).attr("alt",gf_vars.inactive)):(a.src=a.src.replace("spinner.gif","active0.png"),jQuery(a).attr("title",gf_vars.active).attr("alt",gf_vars.active))}),!0},a.deleteFeed=function(a){b("#single_action").val("delete"),b("#single_action_argument").val(a),b("#gform-settings").submit()},a.duplicateFeed=function(a){b("#single_action").val("duplicate"),b("#single_action_argument").val(a),b("#gform-settings").submit()}}(window.gaddon=window.gaddon||{},jQuery);var gfMergeTagsObj=function(a){this.form=a,this.init=function(){var a=this;this.mergeTagList=jQuery(''),this.mergeTagListHover=!1,jQuery(".merge-tag-support").length<=0||(jQuery(".merge-tag-support").bind("keydown",function(a){var b=!(!jQuery(this).data("autocomplete")||!jQuery(this).data("autocomplete").menu)&&jQuery(this).data("autocomplete").menu.active;a.keyCode===jQuery.ui.keyCode.TAB&&b&&a.preventDefault()}).each(function(){var b=jQuery(this),c=b.is("input")?"input":"textarea";b.autocomplete({minLength:1,source:function(c,d){var e=a.extractLast(c.term);if(e.length ');if(e.data("targetElement",b.attr("id")),a.getClassProperty(this,"manual_position")){var f=".mt-"+b.attr("id");jQuery(f).append(e)}else b.after(e)}),jQuery(".tooltip-merge-tag").tooltip({show:{delay:1250},content:function(){return jQuery(this).prop("title")}}),jQuery(".all-merge-tags a.open-list").click(function(){var b=jQuery(this),c=a.getTargetElement(b);a.mergeTagList.html(a.getMergeTagListItems(c)),a.mergeTagList.insertAfter(b).show(),jQuery("ul#gf_merge_tag_list a").click(function(){var b=jQuery(this).data("value"),c=a.getTargetElement(this);a.isWpEditor(c)?InsertEditorVariable(c.attr("id"),b):InsertVariable(c.attr("id"),null,b),c.trigger("input").trigger("propertychange"),a.mergeTagList.hide()})}),this.getTargetElement=function(a){var a=jQuery(a);return jQuery("#"+a.parents("span.all-merge-tags").data("targetElement"))},this.mergeTagList.hover(function(){a.mergeTagListHover=!0},function(){a.mergeTagListHover=!1}),jQuery("body").mouseup(function(){a.mergeTagListHover||a.mergeTagList.hide()}))},this.split=function(a){return a.split(" ")},this.extractLast=function(a){return this.split(a).pop()},this.startsWith=function(a,b){return 0===a.indexOf(b)},this.getMergeTags=function(a,b,c,d,e,f){void 0===a&&(a=[]),void 0===d&&(d=[]);var g=[],h=[],j=[],k=[],l=[],m=[],n=[],o=[],p=[];if(c||k.push({tag:"{all_fields}",label:this.getMergeTagLabel("{all_fields}")}),!e){for(i in a)if(a.hasOwnProperty(i)){var q=a[i];if(!q.displayOnly){var r=GetInputType(q);if(-1==jQuery.inArray(r,d)){if(q.isRequired)switch(r){case"name":var s,t,u,v,w=Copy(q);"extended"==q.nameFormat?(s=GetInput(q,q.id+".2"),u=GetInput(q,q.id+".8"),v=Copy(q),v.inputs=[s,u],h.push(v),delete w.inputs[0],delete w.inputs[3]):"advanced"==q.nameFormat&&(s=GetInput(q,q.id+".2"),t=GetInput(q,q.id+".4"),u=GetInput(q,q.id+".8"),v=Copy(q),v.inputs=[s,t,u],h.push(v),delete w.inputs[0],delete w.inputs[2],delete w.inputs[4]),g.push(w);break;default:g.push(q)}else h.push(q);IsPricingField(q.type)&&j.push(q)}}}if(g.length>0)for(i in g)g.hasOwnProperty(i)&&(l=l.concat(this.getFieldMergeTags(g[i],f)));if(h.length>0)for(i in h)h.hasOwnProperty(i)&&(m=m.concat(this.getFieldMergeTags(h[i],f)));if(j.length>0){c||n.push({tag:"{pricing_fields}",label:this.getMergeTagLabel("{pricing_fields}")});for(i in j)j.hasOwnProperty(i)&&n.concat(this.getFieldMergeTags(j[i],f))}}o.push({tag:"{ip}",label:this.getMergeTagLabel("{ip}")}),o.push({tag:"{date_mdy}",label:this.getMergeTagLabel("{date_mdy}")}),o.push({tag:"{date_dmy}",label:this.getMergeTagLabel("{date_dmy}")}),o.push({tag:"{embed_post:ID}",label:this.getMergeTagLabel("{embed_post:ID}")}),o.push({tag:"{embed_post:post_title}",label:this.getMergeTagLabel("{embed_post:post_title}")}),o.push({tag:"{embed_url}",label:this.getMergeTagLabel("{embed_url}")}),e||(o.push({tag:"{entry_id}",label:this.getMergeTagLabel("{entry_id}")}),o.push({tag:"{entry_url}",label:this.getMergeTagLabel("{entry_url}")}),o.push({tag:"{form_id}",label:this.getMergeTagLabel("{form_id}")}),o.push({tag:"{form_title}",label:this.getMergeTagLabel("{form_title}")})),o.push({tag:"{user_agent}",label:this.getMergeTagLabel("{user_agent}")}),o.push({tag:"{referer}",label:this.getMergeTagLabel("{referer}")}),HasPostField()&&!e&&(o.push({tag:"{post_id}",label:this.getMergeTagLabel("{post_id}")}),o.push({tag:"{post_edit_url}",label:this.getMergeTagLabel("{post_edit_url}")})),o.push({tag:"{user:display_name}",label:this.getMergeTagLabel("{user:display_name}")}),o.push({tag:"{user:user_email}",label:this.getMergeTagLabel("{user:user_email}")}),o.push({tag:"{user:user_login}",label:this.getMergeTagLabel("{user:user_login}")});var x=this.getCustomMergeTags();if(x.tags.length>0)for(i in x.tags)if(x.tags.hasOwnProperty(i)){var y=x.tags[i];p.push({tag:y.tag,label:y.label})}var z={ungrouped:{label:this.getMergeGroupLabel("ungrouped"),tags:k},required:{label:this.getMergeGroupLabel("required"),tags:l},optional:{label:this.getMergeGroupLabel("optional"),tags:m},pricing:{label:this.getMergeGroupLabel("pricing"),tags:n},other:{label:this.getMergeGroupLabel("other"),tags:o},custom:{label:this.getMergeGroupLabel("custom"),tags:p}};return z=gform.applyFilters("gform_merge_tags",z,b,c,d,e,f,this)},this.getMergeTagLabel=function(a){for(groupName in gf_vars.mergeTags)if(gf_vars.mergeTags.hasOwnProperty(groupName)){var b=gf_vars.mergeTags[groupName].tags;for(i in b)if(b.hasOwnProperty(i)&&b[i].tag==a)return b[i].label}return""},this.getMergeGroupLabel=function(a){return gf_vars.mergeTags[a].label},this.getFieldMergeTags=function(a,b){void 0===b&&(b="");var c=[],d=GetInputType(a),e="list"==d?":"+b:"",f="",g="";if(jQuery.inArray(d,["date","email","time","password"])>-1&&(a.inputs=null),void 0!==a.inputs&&jQuery.isArray(a.inputs)){"checkbox"==d&&(g=GetLabel(a,a.id).replace("'","\\'"),f="{"+g+":"+a.id+e+"}",c.push({tag:f,label:g}));for(i in a.inputs)if(a.inputs.hasOwnProperty(i)){var h=a.inputs[i];"creditcard"==d&&jQuery.inArray(parseFloat(h.id),[parseFloat(a.id+".2"),parseFloat(a.id+".3"),parseFloat(a.id+".5")])>-1||(g=GetLabel(a,h.id).replace("'","\\'"),f="{"+g+":"+h.id+e+"}",c.push({tag:f,label:g}))}}else g=GetLabel(a).replace("'","\\'"),f="{"+g+":"+a.id+e+"}",c.push({tag:f,label:g});return c},this.getCustomMergeTags=function(){for(groupName in gf_vars.mergeTags)if(gf_vars.mergeTags.hasOwnProperty(groupName)&&"custom"==groupName)return gf_vars.mergeTags[groupName];return[]},this.getAutoCompleteMergeTags=function(a){var b=this.form.fields,c=a.attr("id"),d=1==this.getClassProperty(a,"hide_all_fields"),e=this.getClassProperty(a,"exclude"),f=this.getClassProperty(a,"option"),g=this.getClassProperty(a,"prepopulate");g&&(d=!0);var h=this.getMergeTags(b,c,d,e,g,f),j=[];for(group in h)if(h.hasOwnProperty(group)){var k=h[group].tags;for(i in k)k.hasOwnProperty(i)&&j.push(k[i].tag)}return j},this.getMergeTagListItems=function(a){var b=this.form.fields,c=a.attr("id"),d=1==this.getClassProperty(a,"hide_all_fields"),e=this.getClassProperty(a,"exclude"),f=this.getClassProperty(a,"prepopulate"),g=this.getClassProperty(a,"option");f&&(d=!0);var h=this.getMergeTags(b,c,d,e,f,g),j=this.hasMultipleGroups(h),k="";for(group in h)if(h.hasOwnProperty(group)){var l=h[group].label,m=h[group].tags;if(!(m.length<=0)){l&&j&&(k+='");for(i in m)if(m.hasOwnProperty(i)){var n=m[i];k+=''+n.label+" "}}}return k},this.hasMultipleGroups=function(a){var b=0;for(group in a)a.hasOwnProperty(group)&&a[group].tags.length>0&&b++;return b>1},this.getClassProperty=function(a,b){var a=jQuery(a),c=a.attr("class");if(!c)return"";var d=c.split(" ");for(i in d)if(d.hasOwnProperty(i)){var e=d[i].split("-");if("mt"==e[0]&&e[1]==b)return e.length>3?(delete e[0],delete e[1],e):2==e.length||e[2]}return""},this.isWpEditor=function(a){var a=jQuery(a);return 1==this.getClassProperty(a,"wp_editor")},this.init()},FeedConditionObj=function(a){this.strings=isSet(a.strings)?a.strings:{},this.logicObject=a.logicObject,this.init=function(){var a=this;gform.addFilter("gform_conditional_object","FeedConditionConditionalObject"),gform.addFilter("gform_conditional_logic_description","FeedConditionConditionalDescription"),jQuery(document).ready(function(){ToggleConditionalLogic(!0,"feed_condition")}),jQuery("input#feed_condition_conditional_logic").parents("form").on("submit",function(){jQuery("input#feed_condition_conditional_logic_object").val(JSON.stringify(a.logicObject))})},this.init()};
\ No newline at end of file
diff --git a/js/form_editor.js b/js/form_editor.js
index 1e9b1ba..9af61a4 100644
--- a/js/form_editor.js
+++ b/js/form_editor.js
@@ -2043,16 +2043,21 @@ function StartDuplicateField(element) {
var id = field.inputs[inputIndex]['id'] + "";
field.inputs[inputIndex]['id'] = id.replace(/(\d+\.)/, field.id + '.');
- /*
- if(inputId % 10 == 0)
- inputId++;
-
- field.inputs[inputIndex]['id'] = field.id + '.' + inputId;
- inputId++;*/
}
}
+ /**
+ * Modify the field that is being duplicated.
+ *
+ * @param object field The duplicated field.
+ * @param object form The current form object.
+ *
+ * @since @todo
+ */
+ field = gform.applyFilters( 'gform_duplicate_field', field, form );
+ field = gform.applyFilters( 'gform_duplicate_field_{0}'.format( GetInputType( field ) ), field, form );
+
form.fields.splice(fieldIndex, 0, field);
DuplicateField(field, sourcefieldId);
return;
@@ -2097,6 +2102,14 @@ function GetNextFieldId(){
if(parseFloat(form.fields[i].id) > max)
max = parseFloat(form.fields[i].id);
}
+
+ if (form.deletedFields) {
+ for (var i = 0; i < form.deletedFields.length; i++) {
+ if (parseFloat(form.deletedFields[i]) > max)
+ max = parseFloat(form.deletedFields[i]);
+ }
+ }
+
return parseFloat(max) + 1;
}
@@ -2477,14 +2490,41 @@ function LoadCustomChoices(){
if(!gform_custom_choices.hasOwnProperty(key))
continue;
- str += "" + key + " ";
+ var selectChoiceAction = 'SelectCustomChoice( jQuery(this).data("key") );';
+
+ str += "" + escapeHtml( key ) + " ";
}
str += "";
jQuery("#bulk_items").prepend(str);
}
}
-function SelectCustomChoice(name){
+
+var entityMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '/': '/',
+ '`': '`',
+ '=': '='
+};
+
+function escapeAttr (string) {
+
+ return String(string).replace(/["']/g, function (s) {
+ return entityMap[s];
+ });
+}
+
+function escapeHtml (string) {
+ return String(string).replace(/[&<>"'`=\/]/g, function (s) {
+ return entityMap[s];
+ });
+}
+
+function SelectCustomChoice( name ){
jQuery("#gfield_bulk_add_input").val(gform_custom_choices[name].join("\n"));
gform_selected_custom_choice = name;
@@ -2806,9 +2846,13 @@ function GetFieldType(fieldId){
return fieldId.substr(0, fieldId.lastIndexOf("_"));
}
-function GetSelectedField(){
- var id = jQuery(".field_selected")[0].id.substr(6);
- return GetFieldById(id);
+function GetSelectedField() {
+ var $field = jQuery( '.field_selected' );
+ if( $field.length <= 0 ) {
+ return false;
+ }
+ var id = $field[0].id.substr( 6 );
+ return GetFieldById( id );
}
function SetPasswordProperty(isChecked){
diff --git a/js/form_editor.min.js b/js/form_editor.min.js
index 4add2e1..765fcba 100644
--- a/js/form_editor.min.js
+++ b/js/form_editor.min.js
@@ -1,3 +1,3 @@
-function MakeNoFieldsDroppable(){jQuery("#no-fields").droppable({over:function(a,b){jQuery("#gform_fields").height(jQuery(this).height()),jQuery(this).hide()},out:function(a,b){jQuery(this).show()}})}function CloseStatus(){jQuery(".updated_base, .error_base").slideUp()}function InitializeFieldSettings(){jQuery("#field_max_file_size").on("input propertychange",function(){var a=jQuery(this),b=parseInt(a.val()),c=b?b:"";SetFieldProperty("maxFileSize",c)}).on("change",function(){var a=GetSelectedField(),b=a.maxFileSize?a.maxFileSize:"",c=""===b?"":b+"MB";this.value=c}),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)}),jQuery("#field_choices").on("change",".field-choice-price",function(){var a=GetSelectedField(),b=jQuery(this).parent("li").index(),c=a.choices[b].price;this.value=c}),jQuery(".field_input_choices").on("input propertychange","input",function(){var a=jQuery(this).closest("li"),b=a.data("index"),c=a.data("input_id"),d=a.find(".field-choice-value").val(),e=a.find(".field-choice-text").val();SetInputChoice(c,b,d,e)}).on("click keypress","input:radio, input:checkbox",function(){var a=jQuery(this).closest("li"),b=a.data("index"),c=a.data("input_id"),d=a.find(".field-choice-value").val(),e=a.find(".field-choice-text").val();SetInputChoice(c,b,d,e)}).on("click keypress",".field-input-insert-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index"),d=a.data("input_id");InsertInputChoice(b,d,c+1)}).on("click keypress",".field-input-delete-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index"),d=a.data("input_id");DeleteInputChoice(b,d,c)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var a=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(a,this.checked);var b=a.find("ul");SetInputChoices(b)}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var a=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,a)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var a=GetSelectedField();if(this.checked){var b=!0;HasConditionalLogicDependency(a.id,a.value)&&(confirm(gf_vars.conditionalLogicRichTextEditorWarning)||(jQuery("#field_rich_text_editor").prop("checked",!1),b=!1)),b&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))}else 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 a=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,a)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("click keypress",".input_active_icon",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");ToggleInputHidden(this,a)}).on("input propertychange",".field_custom_input_default_label",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,a)}).on("input propertychange","#field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var a=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,a)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(a){var b=jQuery(this),c=b.closest("li.field-choice-row"),d=c.data("input_type"),e=c.data("index");SetFieldChoice(d,e),(b.hasClass("field-choice-text")||b.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),a.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)}),jQuery("#field_description").on("blur",function(){var a=GetSelectedField();a.description!=this.value&&(SetFieldDescription(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(a){return ValidateKeyPress(a,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("input propertychange",function(){SetFieldProperty("cssClass",this.value)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",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 InitializeForm(a){a.fields.length>0&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),a.lastPageButton&&"image"==a.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):a.lastPageButton&&"image"==a.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(a.lastPageButton?a.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(a.lastPageButton?a.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),a.postStatus&&jQuery("#field_post_status").val(a.postStatus),a.postAuthor&&jQuery("#field_post_author").val(a.postAuthor),void 0==a.useCurrentUserAsAuthor&&(a.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!a.useCurrentUserAsAuthor),a.postCategory&&jQuery("#field_post_category").val(a.postCategory),a.postFormat&&jQuery("#field_post_format").val(a.postFormat),a.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(a.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),a.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(a.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_last_page_settings").bind("click",function(){FieldClick(this)}),jQuery("#gform_pagination").bind("click",function(){FieldClick(this)}),jQuery(".gfield").bind("click",function(){FieldClick(this)});var b=a.pagination&&a.pagination.type?a.pagination.type:"percentage",c="steps"==b,d="percentage"==b,e="none"==b;c?jQuery("#pagination_type_steps").prop("checked",!0):d?jQuery("#pagination_type_percentage").prop("checked",!0):e&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(a.firstPageCssClass),jQuery("#field_settings, #last_page_settings, #pagination_settings").tabs({selected:0}),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var a=GetInputType(field);jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".tooltip_form_field_label_html").show(),jQuery(".tooltip_form_field_label").hide()):(jQuery(".tooltip_form_field_label_html").hide(),jQuery(".tooltip_form_field_label").show()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(void 0==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(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_description").val(void 0==field.description?"":field.description),jQuery("#field_css_class").val(void 0==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(void 0==field.rangeMin||field.rangeMin===!1?"":field.rangeMin),jQuery("#field_range_max").val(void 0==field.rangeMax||field.rangeMax===!1?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),jQuery("#credit_card_style").val(field.creditCardStyle?field.creditCardStyle:"style1"),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")),"undefined"==typeof field.labelPlacement&&(field.labelPlacement=""),"undefined"==typeof field.descriptionPlacement&&(field.descriptionPlacement=""),"undefined"==typeof 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),"undefined"==typeof field.placeholder&&(field.placeholder=""),jQuery("#field_placeholder, #field_placeholder_textarea").val(field.placeholder),jQuery("#field_file_extension").val(void 0==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles?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_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl?field.addIconUrl:""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl?field.deleteIconUrl:""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_min_strength").val(void 0==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(""+gf_vars.selectFormat+" "),jQuery("#field_number_format").val(field.numberFormat?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);var b=gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding";jQuery("#field_calculation_rounding").val(b),jQuery("#option_field_type").val(field.inputType);var c=jQuery("#product_field_type");if(c.val(field.inputType),has_entry(field.id)?c.prop("disabled",!0):c.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){var d=void 0==field.basePrice?"":field.basePrice;jQuery("#field_base_price").val(void 0==field.basePrice?"":field.basePrice),SetBasePrice(d)}jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity);var e=!!field.enablePasswordInput;jQuery("#field_password").prop("checked",!!e),jQuery("#field_maxlen").val("undefined"==typeof field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val("undefined"==typeof field.maxRows?"":field.maxRows);var f=void 0==field.addressType?"international":field.addressType;jQuery("#field_address_type").val(f),"address"==field.type&&(field=UpgradeAddressField(field)),"email"!=field.type&&"email"!=field.inputType||(field=UpgradeEmailField(field)),"password"!=field.type&&"password"!=field.inputType||(field=UpgradePasswordField(field));var g=void 0==field.defaultState?"":field.defaultState,h=void 0==field.defaultProvince?"":field.defaultProvince,i="canadian"==f&&""==g?h:g;jQuery("#field_address_default_state_"+f).val(i),jQuery("#field_address_default_country_"+f).val(void 0==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),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);var j=CustomFieldExists(field.postCustomFieldName);jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),j?jQuery("#field_custom_field_name_select").val(field.postCustomFieldName):jQuery("#field_custom_field_name_text").val(field.postCustomFieldName),j?jQuery("#field_custom_existing").prop("checked",!0):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").prop("checked",!0):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);var k=!!field.postFeaturedImage;jQuery("#gfield_featured_image").prop("checked",k);var l=IsStandardMask(field.inputMaskValue);if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),l?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select").val(field.inputMaskValue)):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text").val(field.inputMaskValue)),ToggleInputMask(!0),ToggleInputMaskOptions(!0),"creditcard"==a){field=UpgradeCreditCardField(field),(!field.creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]);for(p in field.creditCards)field.creditCards.hasOwnProperty(p)&&jQuery("#field_credit_card_"+field.creditCards[p]).prop("checked",!0)}"date"==a&&(field=UpgradeDateField(field)),"time"==a&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=a||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(void 0==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val("dmy"==field.dateFormat?"dmy":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);var m=GetFirstRuleField()>0;"page"==field.type?(LoadFieldConditionalLogic(m,"next_button"),LoadFieldConditionalLogic(m,"page")):LoadFieldConditionalLogic(m,"field"),jQuery("#field_enable_copy_values_option").prop("checked",1==field.enableCopyValuesOption),jQuery("#field_copy_values_option_default").prop("checked",1==field.copyValuesOptionDefault);var n=GetCopyValuesFieldsOptions(field.copyValuesFieldId,field);n.length>0?(jQuery("#field_enable_copy_values_option").prop("disabled",!1),jQuery("#field_copy_values_disabled").hide(),jQuery("#field_copy_values_option_field").html(n)):(jQuery("#field_enable_copy_values_option").prop("disabled",!0),jQuery("#field_copy_values_disabled").show()),ToggleCopyValuesOption(field.enableCopyValuesOption,!0),field.nextButton&&("image"==field.nextButton.type?jQuery("#next_button_image").prop("checked",!0):jQuery("#next_button_text").prop("checked",!0),jQuery("#next_button_text_input").val(field.nextButton.text),jQuery("#next_button_image_url").val(field.nextButton.imageUrl)),field.previousButton&&("image"==field.previousButton.type?jQuery("#previous_button_image").prop("checked",!0):jQuery("#previous_button_text").prop("checked",!0),jQuery("#previous_button_text_input").val(field.previousButton.text),jQuery("#previous_button_image_url").val(field.previousButton.imageUrl)),TogglePageButton("next",!0),TogglePageButton("previous",!0),jQuery(".gfield_category_checkbox").each(function(){if(field.choices)for(var a=0;areCAPTCHA')}("post_custom_field"==field.type&&"textarea"==field.inputType||"text"==field.inputType)&&jQuery(".customfield_content_template_setting").show(),"name"==field.type&&("undefined"==typeof 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()),"product"==field.type&&("singleproduct"==field.inputType?jQuery(".admin_label_setting").hide():jQuery(".admin_label_setting").show()),"date"==a&&ToggleDateSettings(field),"email"==a&&ToggleEmailSettings(field),jQuery(document).trigger("gform_load_field_settings",[field,form]),jQuery("#field_settings").appendTo(".field_selected"),jQuery("#field_settings").tabs("option","active",0),ShowSettings("field_settings"),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field);var w=[],x=jQuery("#gform_tab_3 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")});0==x.length&&w.push(1);var y=jQuery("#gform_tab_2 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")});0==y.length&&w.push(2),w.length>0?jQuery("#field_settings").tabs({disabled:w}):jQuery("#field_settings").tabs({disabled:[]}),Placeholders.enable()}function ToggleDateSettings(a){var b="datefield"==a.dateType,c="datepicker"==a.dateType,d="datedropdown"==a.dateType;jQuery(".placeholder_setting").toggle(c),jQuery(".default_value_setting").toggle(c),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(d||b),jQuery(".input_placeholders_setting").toggle(d||b)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var a=GetCustomizeInputsUI(field);jQuery("#field_name_fields_container").html(a).show();var b=GetInput(field,field.id+".2"),c=GetInputChoices(b);jQuery("#field_prefix_choices").html(c),ToggleNamePrefixUI(!b.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".input_active_icon",function(){var a=jQuery(this).data("input_id");if(a.toString().indexOf(".2")>=0){var b=this.src.indexOf("active1.png")>=0;ToggleNamePrefixUI(b)}}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(a,b){for(var c,d,e,f,g=[],h=GetInputType(b),i=0;i"+c+"",g.push(e));return g.join("")}function ToggleNamePrefixUI(a){jQuery(".name_prefix_choices_setting").toggle(a)}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(a){SetFieldProperty("disableQuantity",a),a?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(a){a||(a=0);var b=GetCurrentCurrency(),c=b.toMoney(a);0==c&&(c=0),jQuery("#field_base_price").val(c),SetFieldProperty("basePrice",c),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(c),jQuery(".field_selected .ginput_amount").val(c)}function ChangeAddressType(){if(field=GetSelectedField(),"address"==field.type){var a=jQuery("#field_address_type").val(),b=GetInput(field,field.id+".6"),c=jQuery("#field_address_country_"+a).val();""==c?b.isHidden=!1:b.isHidden=!0,SetAddressType(!1)}}function SetAddressType(a){if(field=GetSelectedField(),"address"==field.type){SetAddressProperties(),jQuery(".gfield_address_type_container").hide();var b=a?"":"slow";jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(b),CreatePlaceholdersUI(field)}}function UpdateAddressFields(){var a=jQuery("#field_address_type").val();field=GetSelectedField();var b=GetCustomizeInputsUI(field);jQuery("#field_address_fields_container").html(b);var c=GetInput(field,field.id+".5"),d=jQuery("#field_address_zip_label_"+a).val();jQuery("#field_custom_input_default_label_"+field.id+"_5").text(d),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",d),c.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(d);var e=GetInput(field,field.id+".4"),f=jQuery("#field_address_state_label_"+a).val();jQuery("#field_custom_input_default_label_"+field.id+"_4").text(f),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",f),e.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(f);var g=""!=jQuery("#field_address_country_"+a).val();g?(jQuery(".field_selected #input_"+field.id+"_6_container").hide(),jQuery(".field_custom_input_row_input_"+field.id+"_6").hide()):(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+a).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show(),jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show());var h=""!=jQuery("#field_address_has_states_"+a).val();if(h){jQuery(".field_selected .state_text").hide();var i=jQuery("#field_address_default_state_"+a).val(),j=jQuery(".field_selected .state_dropdown");j.append(jQuery(" ").val(i).html(i)),j.val(i).show()}else jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text").show()}function SetAddressProperties(){field=GetSelectedField();var a=jQuery("#field_address_type").val();SetFieldProperty("addressType",a),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+a).val()),SetFieldProperty("defaultProvince","");var b=jQuery("#field_address_country_"+a).val();""==b&&(b=jQuery("#field_address_default_country_"+a).val()),SetFieldProperty("defaultCountry",b),UpdateAddressFields()}function MaybeUpgradeNameField(a){return("undefined"==typeof a.nameFormat||""==a.nameFormat||"normal"==a.nameFormat||"simple"==a.nameFormat&&!has_entry(a.id))&&(a=UpgradeNameField(a,!0,!0,!0)),a}function UpgradeNameField(a,b,c,d){return a.nameFormat="advanced",a.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(a,b,c,d),a.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),a}function UpgradeDateField(a){return"date"!=a.type&&"date"!=a.inputType?a:("undefined"==typeof a.dateType||"datepicker"==a.dateType||a.inputs||(a.inputs=GetDateFieldInputs(a)),a)}function UpgradeTimeField(a){return"time"!=a.type&&"time"!=a.inputType?a:(a.inputs||(a.inputs=GetTimeFieldInputs(a)),a)}function UpgradeEmailField(a){return"email"!=a.type&&"email"!=a.inputType?a:(a.emailConfirmEnabled&&!a.inputs&&(a.inputs=GetEmailFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradePasswordField(a){return"password"!=a.type&&"password"!=a.inputType?a:(a.inputs||(a.inputs=GetPasswordFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradeAddressField(a){if(a.hideCountry){var b=GetInput(a,a.id+".6");b.isHidden=!0}if(delete a.hideCountry,a.hideAddress2){var c=GetInput(a,a.id+".2");c.isHidden=!0}if(delete a.hideAddress2,a.hideState){var d=GetInput(a,a.id+".4");d.isHidden=!0}return delete a.hideState,a}function TogglePasswordStrength(a){var b=a?"":"slow";jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show(b):jQuery("#gfield_min_strength_container").hide(b)}function ToggleCategory(a){var b=a?"":"slow";jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(b),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(b),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(a){SetFieldProperty("copyValuesOptionLabel",a),jQuery(".field_selected .copy_values_option_label").html(a)}function SetCustomFieldTemplate(){var a=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",a?jQuery("#field_customfield_content_template").val():null),
-SetFieldProperty("customFieldTemplateEnabled",a)}function SetCategoryInitialItem(){var a=jQuery("#gfield_post_category_initial_item_enabled").is(":checked");SetFieldProperty("categoryInitialItem",a?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",a)}function PopulateContentTemplate(a){if(0==jQuery("#"+a).val().length){var b=GetSelectedField();jQuery("#"+a).val("{"+b.label+":"+b.id+"}")}}function TogglePostContentTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(b),a||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide(b)}function TogglePostTitleTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(b),a||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide(b)}function ToggleCustomFieldTemplate(a){var b=a?"":"slow";jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(b),a||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide(b)}function ToggleInputName(a){var b=a?"":"slow";jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show(b):(jQuery("#field_input_name_container").hide(b),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(a){var b=GetSelectedField(),c=b.enablePrice?"_and_price":"",d=jQuery("#gfield_settings_choices_container");d.removeClass("choice_with_price choice_with_value choice_with_value_and_price");var e=jQuery("#field_choice_values_enabled").is(":checked");e?d.addClass("choice_with_value"+c):b.enablePrice&&d.addClass("choice_with_price")}function ToggleInputChoiceValue(a,b){"undefined"==typeof b&&(b=!1);var c=GetSelectedField(),d=a.find("li").data("input_id"),e=GetInput(c,d);e.enableChoiceValue=b,a.removeClass("choice_with_value"),b&&a.addClass("choice_with_value")}function ToggleCopyValuesActivated(a){jQuery(".field_selected .copy_values_activated").prop("checked",a);var b=GetSelectedField();jQuery("#input_"+b.id).toggle(!a)}function TogglePageButton(a,b){var c=jQuery("#"+a+"_button_text").is(":checked");show_element=c?"#"+a+"_button_text_container":"#"+a+"_button_image_container",hide_element=c?"#"+a+"_button_image_container":"#"+a+"_button_text_container",b?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(a){field=GetSelectedField();var b=jQuery("#"+a+"_button_image").is(":checked")?"image":"text";field[a+"Button"].type=b,"image"==b?(field[a+"Button"].text="",field[a+"Button"].imageUrl=jQuery("#"+a+"_button_image_url").val()):(field[a+"Button"].text=jQuery("#"+a+"_button_text_input").val(),field[a+"Button"].imageUrl="")}function ToggleCustomField(a){var b=jQuery("#field_custom_existing").is(":checked");show_element=b?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=b?"#field_custom_field_name_text":"#field_custom_field_name_select";var c="";jQuery(hide_element).hide(c),jQuery(show_element).show(c)}function ToggleInputMask(a){var b=a?"":"slow";jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(b),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(b),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""))}function ToggleInputMaskOptions(a){var b=jQuery("#field_mask_standard").is(":checked");show_element=b?"#field_mask_select":"#field_mask_text, .mask_text_description",hide_element=b?"#field_mask_text, .mask_text_description":"#field_mask_select";var c="";jQuery(hide_element).val("").hide(c),jQuery(show_element).show(c),a||SetFieldProperty("inputMaskValue","")}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(a){var b=a?"":"slow";if(jQuery("#field_multiple_files").prop("checked")?(jQuery("#gform_multiple_files_options").show(b),SetFieldProperty("multipleFiles",!0)):(jQuery("#gform_multiple_files_options").hide(b),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","")),!a){var c=GetSelectedField();jQuery("#field_settings").slideUp(function(){StartChangeInputType("fileupload",c)})}}function HasPostContentField(){for(var a=0;a=0&&b.push(form.fields[c]);return b}function GetNextFieldId(){for(var a=0,b=0;ba&&(a=parseFloat(form.fields[b].id));return parseFloat(a)+1}function EndAddField(a,b,c){gf_vars.currentlyAddingField=!1,jQuery("#gform_adding_field_spinner").remove(),"undefined"!=typeof c?(form.fields.splice(c,0,a),0===c?jQuery("#gform_fields").prepend(b):jQuery("#gform_fields").children().eq(c-1).after(b)):(jQuery("#gform_fields").append(b),form.fields.push(a));var d=jQuery("#field_"+a.id);d.animate({backgroundColor:"#FFFBCC"},"fast",function(){jQuery(this).animate({backgroundColor:"#FFF"},"fast",function(){jQuery(this).css("background-color","")})}),d.bind("click",function(){FieldClick(this)}),0===jQuery("#no-fields-stash li").length&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),jQuery(".selectable").removeClass("field_selected"),HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),d.addClass("field_selected"),SetFieldSize(a.size),TogglePageBreakSettings(),InitializeFields(),d.removeClass("field_selected"),jQuery(document).trigger("gform_field_added",[form,a])}function StartChangeNameFormat(a){field=GetSelectedField(),UpgradeNameField(field,!1,!0,!1)}function StartChangeCaptchaType(a){field=GetSelectedField(),field.captchaType=a,SetFieldProperty("captchaType",a),jQuery("#field_settings").slideUp(function(){StartChangeInputType(field.type,field)}),ResetRecaptcha()}function ResetRecaptcha(){field=GetSelectedField(),field.captchaLanguage="en",field.captchaTheme="light"}function StartChangeProductType(a){return field=GetSelectedField(),"singleproduct"==a||"hiddenproduct"==a||"calculation"==field.inputType?field.enablePrice=null:field.enablePrice=!0,StartChangeInputType(a,field)}function StartChangeDonationType(a){return field=GetSelectedField(),"donation"!=a?field.enablePrice=!0:field.enablePrice=null,StartChangeInputType(a,field)}function StartChangeShippingType(a){return field=GetSelectedField(),"singleshipping"!=a&&(field.enablePrice=!0),StartChangeInputType(a,field)}function StartChangePostCategoryType(a){return"dropdown"==a?jQuery(".post_category_initial_item_setting").hide():jQuery(".post_category_initial_item_setting").show(),field=GetSelectedField(),StartChangeInputType(a,field)}function EndChangeInputType(a){var b=a.id,c=a.type,d=a.fieldString;jQuery("#field_"+b).html(d);var e=GetFieldById(b);e.inputType=e.type!=c?c:"",SetDefaultValues(e),SetFieldLabel(e.label),SetFieldSize(e.size),SetFieldDefaultValue(e.defaultValue),SetFieldDescription(e.description),SetFieldRequired(e.isRequired),InitializeFields(),LoadFieldSettings()}function InitializeFields(){jQuery(".selectable").hover(function(){jQuery(this).addClass("field_hover")},function(){jQuery(this).removeClass("field_hover")}),jQuery(".field_delete_icon, .field_duplicate_icon").bind("click",function(a){a.stopPropagation()}),jQuery("#field_settings, #form_settings, #last_page_settings, #pagination_settings, .captcha_message, .form_delete_icon, .all-merge-tags").bind("click",function(a){a.stopPropagation()})}function FieldClick(a){if(gforms_dragging==a.id)return void(gforms_dragging=0);if(jQuery(a).hasClass("field_selected")){var b="";switch(a.id){case"gform_heading":b="#form_settings",jQuery(".gf_form_toolbar_settings a").removeClass("gf_toolbar_active");break;case"gform_last_page_settings":b="#last_page_settings";break;case"gform_pagination":b="#pagination_settings";break;default:b="#field_settings"}return jQuery("input#gform_force_focus").focus(),void jQuery(b).slideUp(function(){jQuery(a).removeClass("field_selected").addClass("field_hover"),HideSettings("field_settings")})}jQuery(".selectable").removeClass("field_selected"),jQuery(a).removeClass("field_hover").addClass("field_selected"),"gform_heading"==a.id?(HideSettings("field_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),InitializeFormConditionalLogic(),ShowSettings("form_settings"),jQuery(".gf_form_toolbar_settings a").addClass("gf_toolbar_active")):"gform_last_page_settings"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("pagination_settings"),ShowSettings("last_page_settings")):"gform_pagination"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),InitPaginationOptions(),ShowSettings("pagination_settings")):(HideSettings("form_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),LoadFieldSettings())}function TogglePercentageStyle(a){var b=a?"":"slow";"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show(b):jQuery(".percentage_custom_container").hide(b)}function TogglePercentageConfirmationText(a){var b=a?"":"slow";jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show(b):jQuery(".percentage_confirmation_page_name_setting").hide(b)}function CustomFieldExists(a){if(!a)return!0;for(var b=jQuery("#field_custom_field_name_select option"),c=0;c";for(key in gform_custom_choices)gform_custom_choices.hasOwnProperty(key)&&(a+=""+key+" ");a+="",jQuery("#bulk_items").prepend(a)}}function SelectCustomChoice(a){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[a].join("\n")),gform_selected_custom_choice=a,InitBulkCustomPanel()}function SelectPredefinedChoice(a){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[a].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(a){field=GetSelectedField(),field.choices=new Array;for(var b=!1,c=0;c1){var d=GetCurrentCurrency();price=d.toMoney(text_price[1])}text_value=text_value.split("|"),field.choices.push(new Choice(jQuery.trim(text_value[0]),jQuery.trim(text_value[text_value.length-1]),jQuery.trim(price))),text_value.length>1&&(b=!0)}b&&(field.enableChoiceValue=!0,jQuery("#field_choice_values_enabled").prop("checked",!0),ToggleChoiceValue()),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InitBulkCustomPanel(){0==gform_selected_custom_choice.length?CloseCustomChoicesPanel():LoadCustomChoicesPanel()}function LoadCustomChoicesPanel(a,b){a?(jQuery("#custom_choice_name").val(""),jQuery("#bulk_save_button").html(gf_vars.save),jQuery("#bulk_cancel_link").show(),jQuery("#bulk_delete_link").hide()):(jQuery("#custom_choice_name").val(gform_selected_custom_choice),jQuery("#bulk_save_button").html(gf_vars.update),jQuery("#bulk_cancel_link").hide(),jQuery("#bulk_delete_link").show()),b||(b=""),jQuery("#bulk_save_as").hide(b),jQuery("#bulk_custom_edit").show(b)}function CloseCustomChoicesPanel(a){a||(a=""),jQuery("#bulk_save_as").show(a),jQuery("#bulk_custom_edit").hide(a)}function IsEmpty(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0}function SetFieldChoice(a,b){var c=jQuery("#"+a+"_choice_text_"+b).val(),d=jQuery("#"+a+"_choice_value_"+b).val(),e=jQuery("#"+a+"_choice_price_"+b).val();if(field=GetSelectedField(),field.choices[b].text=c,field.choices[b].value=field.enableChoiceValue?d:c,field.enablePrice){var f=GetCurrentCurrency(),e=f.toMoney(e);e||(e=""),field.choices[b].price=e}jQuery("#field_choices :radio, #field_choices :checkbox").each(function(a){field.choices[a].isSelected=this.checked}),LoadBulkChoices(field),UpdateFieldChoices(GetInputType(field))}function SetInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,a);a=a.toString().replace(".","_"),f.choices[b].text=d,f.choices[b].value=f.enableChoiceValue?c:d,jQuery(".field-input-choice-"+a+":radio, .field-input-choice-"+a+":checkbox").each(function(a){f.choices[a].isSelected=this.checked}),UpdateInputChoices(f)}function UpdateFieldChoices(a){var b="",c="";"checkbox"==a&&(field.inputs=new Array);var d=0;switch(GetInputType(field)){case"select":for(var e=0;e"+field.choices[e].text+""}break;case"checkbox":for(var e=0;ee&&(b+=""+field.choices[e].text+" ")}field.choices.length>5&&(b+=""+gf_vars.editToViewAll.replace("%d",field.choices.length)+" ");break;case"radio":for(var e=0;ee&&(b+=""+field.choices[e].text+" ")}b+=field.enableOtherChoice?" ":"",field.choices.length>5&&(b+=""+gf_vars.editToViewAll.replace("%d",field.choices.length)+" ");break;case"list":var i=null!=field.choices;columns=i?field.choices:[[]];var j="";if(i){b+="";for(var e=0;e"+columns[e].text+"";b+=" "}else j="class='gf_list_one_column'";b+="",b+="";for(var k=0;k ";b+=" ",b+=" "}c=".gfield_"+a,jQuery(".field_selected "+c).html(b)}function UpdateInputChoices(a){for(var b="",c=0;c"+a.choices[c].text+""}var f=a.id.toString().replace(".","_");jQuery(".field_selected #input_"+f).html(b)}function InsertFieldChoice(a){field=GetSelectedField();var b=field.enablePrice?"0.00":"",c=new Choice("","",b);window["gform_new_choice_"+field.type]&&(c=window["gform_new_choice_"+field.type](field,c)),field.choices.splice(a,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InsertInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b),f=new Choice("","");e.choices.splice(c,0,f),LoadInputChoices(a,e),UpdateInputChoices(e)}function DeleteFieldChoice(a){field=GetSelectedField();var b=jQuery("#"+GetInputType(field)+"_choice_value_"+a).val();HasConditionalLogicDependency(field.id,b)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(a,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b);e.choices.splice(c,1),LoadInputChoices(a,e),UpdateInputChoices(e)}function MoveFieldChoice(a,b){field=GetSelectedField();var c=field.choices[a];field.choices.splice(a,1),field.choices.splice(b,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,b),g=f.choices[c];f.choices.splice(c,1),f.choices.splice(d,0,g),LoadInputChoices(a,f),UpdateInputChoices(f)}function GetFieldType(a){return a.substr(0,a.lastIndexOf("_"))}function GetSelectedField(){var a=jQuery(".field_selected")[0].id.substr(6);return GetFieldById(a)}function SetPasswordProperty(a){SetFieldProperty("enablePasswordInput",a)}function ToggleDateCalendar(a){var b=a?"":"slow",c=jQuery("#field_date_input_type").val();"datefield"==c||"datedropdown"==c?(jQuery("#date_picker_container").hide(b),SetCalendarIconType("none")):jQuery("#date_picker_container").show(b)}function ToggleCalendarIconUrl(a){var b=a?"":"slow";jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show(b):(jQuery("#gfield_icon_url_container").hide(b),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(a){SetFieldProperty("timeFormat",a),LoadTimeInputs()}function LoadTimeInputs(){var a=GetSelectedField();if("time"==a.type||"time"==a.inputType){var b=jQuery("#field_time_format").val();"24"==b?(jQuery("#input_default_value_row_input_"+a.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+a.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+a.id+"_3").hide(),jQuery(".field_custom_input_row_"+a.id+"_3").hide()}}function SetDateFormat(a){SetFieldProperty("dateFormat",a),LoadDateInputs()}function LoadDateInputs(){var a=jQuery("#field_date_input_type").val(),b=jQuery("#field_date_format").val(),c=b?b.substr(0,3):"mdy";if("datefield"==a){switch(c){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 .ginput_date").show(),jQuery(".field_selected .ginput_date_dropdown").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==a){switch(c){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 .ginput_date_dropdown").css("display","inline"),jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected .ginput_date_dropdown").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(a,b){field=GetSelectedField(),"date"==GetInputType(field)&&(void 0==a&&(a="none"),"none"==a?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==a?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==a&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",a),ToggleCalendarIconUrl(b),LoadDateInputs())}function SetDateInputType(a){field=GetSelectedField(),"date"==GetInputType(field)&&(field.dateType=a,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ResetInputPlaceholders(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var a=jQuery(".field_selected #gfield_display_title").is(":checked"),b=jQuery(".field_selected #gfield_display_caption").is(":checked"),c=jQuery(".field_selected #gfield_display_description").is(":checked"),d=a||b||c;SetFieldProperty("displayTitle",a),SetFieldProperty("displayCaption",b),SetFieldProperty("displayDescription",c),jQuery(".field_selected .ginput_post_image_title").css("display",a?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",b?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",c?"block":"none"),jQuery(".field_selected .ginput_post_image_file").css("display",d?"block":"none")}function SetFeaturedImage(){var a=jQuery("#gfield_featured_image").is(":checked");if(a){for(i in form.fields)form.fields.hasOwnProperty(i)&&(form.fields[i].postFeaturedImage=!1);SetFieldProperty("postFeaturedImage",!0)}else SetFieldProperty("postFeaturedImage",!1)}function SetFieldProperty(a,b){void 0==b&&(b=""),GetSelectedField()[a]=b}function SetInputName(a,b){var c=GetSelectedField();if(a&&(a=a.trim()),b){for(var d=0;db.text.toLowerCase()})}function SetFieldLabel(a){var b=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(a).append(b),SetFieldProperty("label",a)}function SetCaptchaTheme(a,b){jQuery(".field_selected .gfield_captcha").attr("src",b),SetFieldProperty("captchaTheme",a)}function SetCaptchaSize(a){var b=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",a),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(b+"_small").removeClass(b+"_medium").removeClass(b+"_large").addClass(b+"_"+a)}function SetCaptchaFontColor(a){SetFieldProperty("simpleCaptchaFontColor",a),RedrawCaptcha()}function SetCaptchaBackgroundColor(a){SetFieldProperty("simpleCaptchaBackgroundColor",a),RedrawCaptcha()}function RedrawCaptcha(){var a=jQuery("#field_captcha_type").val();"math"==a?(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 SetFieldSize(a){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(a),SetFieldProperty("size",a)}function SetFieldLabelPlacement(a){var b=a?a:form.labelPlacement;SetFieldProperty("labelPlacement",a),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(b),"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"),SetFieldProperty("labelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(a){var b="above"==a||""==a&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",a),RefreshSelectedFieldPreview(function(){b?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(a){SetFieldProperty("subLabelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldVisibility(a,b,c){if(!c&&"administrative"==a&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var d=!1,e=0;e div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(a),SetFieldProperty("defaultValue",a)}function SetFieldPlaceholder(a){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var b=this.nodeName,c=jQuery(this);if("INPUT"==b||"TEXTAREA"==b)jQuery(this).prop("placeholder",a);else if("SELECT"==b){var d=c.find('option[value=""]');d.length>0?a.length>0?d.text(a):d.remove():(c.prepend(''+a+" "),c.val(""))}}),SetFieldProperty("placeholder",a)}function SetFieldDescription(a){void 0==a&&(a=""),SetFieldProperty("description",a)}function SetPasswordStrength(a){a?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",a)}function ToggleEmailSettings(a){var b="undefined"!=typeof a.emailConfirmEnabled&&1==a.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!b),jQuery(".default_value_setting").toggle(!b),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(b),jQuery(".input_placeholders_setting").toggle(b)}function SetEmailConfirmation(a){var b=GetSelectedField();a?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email").show()):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email").show()),b.emailConfirmEnabled=a,b.inputs=GetEmailFieldInputs(b),CreateDefaultValuesUI(b),CreatePlaceholdersUI(b),CreateCustomizeInputsUI(b),CreateInputLabelsUI(b),ToggleEmailSettings(b)}function SetCardType(a,b){var c=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;if(jQuery(a).is(":checked"))-1==jQuery.inArray(b,c)&&(jQuery(".gform_card_icon_"+b).fadeIn(),c[c.length]=b);else{var d=jQuery.inArray(b,c);-1!=d&&(jQuery(".gform_card_icon_"+b).fadeOut(),c.splice(d,1))}SetFieldProperty("creditCards",c)}function SetFieldRequired(a){var b=a?"*":"";jQuery(".field_selected .gfield_required").html(b),SetFieldProperty("isRequired",a)}function SetMaxLength(a){var b=GetMaxLengthPattern(),c="",d=a.value.split("");for(i in d)d.hasOwnProperty(i)&&(b.test(d[i])||(c+=d[i]));a.value=c,SetFieldProperty("maxLength",c)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(a,b,c){var c="undefined"==typeof c?!0:c,d=a.which?a.which:a.keyCode,e=b.test(String.fromCharCode(d));return a.ctrlKey?!0:c?e:!e}function IndexOf(a,b){for(var c=0;c-1&&/StartAddField\([ ]?'(.*?)[ ]?'/.test(c)&&(b=c.match(/'(.*?)'/)[1],a.data("type",b)),window.console&&console.log("Deprecated button for the "+this.value+' field. Since v1.9 the field type must be specified in the "type" data attribute.')),"undefined"==typeof b||"undefined"!=typeof c&&""!=c||jQuery(this).click(function(){StartAddField(b)})}),jQuery("#gform_fields").sortable({cancel:"#field_settings",handle:".gfield_admin_icons",start:function(a,b){gforms_dragging=b.item[0].id},tolerance:"pointer",over:function(a,b){if(jQuery("#no-fields").hide(),b.helper.hasClass("ui-draggable-dragging"))b.helper.data("original_width",b.helper.width()),b.helper.data("original_height",b.helper.height()),b.helper.width(b.sender.width()-25),b.helper.height(b.placeholder.height());else{var c=b.helper.height();c>300&&(c=300),b.placeholder.height(c)}},out:function(a,b){1===jQuery("#gform_fields li").length&&jQuery("#no-fields").show(),b.helper&&b.helper.hasClass("ui-draggable-dragging")&&(b.helper.width(b.helper.data("original_width")),b.helper.height(b.helper.data("original_height")))},placeholder:"field-drop-zone",beforeStop:function(a,b){jQuery("#gform_fields").height("100%");var c=b.helper.data("type");if("undefined"!=typeof c){var d=" ",e=b.item.index();b.item.replaceWith(d),StartAddField(c,e)}}}),jQuery(".field_type input").draggable({connectToSortable:"#gform_fields",helper:function(){return jQuery(this).clone(!0)},revert:"invalid",cancel:!1,appendTo:"#wpbody",containment:"document",start:function(a,b){return 1==gf_vars.currentlyAddingField?!1:void 0}}),jQuery("#field_choices, #field_columns").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){var c=b.item.data("index"),d=b.item.index();MoveFieldChoice(c,d)}}),jQuery(".field_input_choices").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){var c=b.item.data("index"),d=b.item.index(),e=b.item.data("input_id"),f=b.item.parent();MoveInputChoice(f,e,c,d)}}),MakeNoFieldsDroppable(),"undefined"!=typeof gf_global.view&&"settings"==gf_global.view||InitializeForm(form),jQuery(document).trigger("gform_load_form_settings",[form]),SetupUnsavedChangesWarning(),window.console){var a=jQuery(document)[0],b=jQuery.hasData(a)&&jQuery._data(a);if(b){var c=new Array("gform_load_form_settings");for(var d in b.events)-1!==jQuery.inArray(d,c)&&console.log('Gravity Forms API warning: The jQuery event "'+d+'" is deprecated on this page since version 1.7')}}jQuery(document).on("focus","#field_choices input.field-choice-text, #field_choices input.field-choice-value",function(){jQuery(this).data("previousValue",jQuery(this).val())}),InitializeFieldSettings()}),this.iColorPicker=function(){jQuery("input.iColorPicker").each(function(a){0==a&&(jQuery(document.createElement("div")).attr("id","iColorPicker").css("display","none").html('').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.fn.gfSlide=function(a){var b=jQuery("#field_settings").is(":visible");return"up"==a?b?this.slideUp():this.hide():b?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(a,b){return"administrative"==b.visibility?a=!1:b.id==GetSelectedField().id&&(a=!1),a});
\ No newline at end of file
+function MakeNoFieldsDroppable(){jQuery("#no-fields").droppable({over:function(a,b){jQuery("#gform_fields").height(jQuery(this).height()),jQuery(this).hide()},out:function(a,b){jQuery(this).show()}})}function CloseStatus(){jQuery(".updated_base, .error_base").slideUp()}function InitializeFieldSettings(){jQuery("#field_max_file_size").on("input propertychange",function(){var a=jQuery(this),b=parseInt(a.val());SetFieldProperty("maxFileSize",b||"")}).on("change",function(){var a=GetSelectedField(),b=a.maxFileSize?a.maxFileSize:"",c=""===b?"":b+"MB";this.value=c}),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)}),jQuery("#field_choices").on("change",".field-choice-price",function(){var a=GetSelectedField(),b=jQuery(this).parent("li").index(),c=a.choices[b].price;this.value=c}),jQuery(".field_input_choices").on("input propertychange","input",function(){var a=jQuery(this).closest("li"),b=a.data("index");SetInputChoice(a.data("input_id"),b,a.find(".field-choice-value").val(),a.find(".field-choice-text").val())}).on("click keypress","input:radio, input:checkbox",function(){var a=jQuery(this).closest("li"),b=a.data("index");SetInputChoice(a.data("input_id"),b,a.find(".field-choice-value").val(),a.find(".field-choice-text").val())}).on("click keypress",".field-input-insert-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index");InsertInputChoice(b,a.data("input_id"),c+1)}).on("click keypress",".field-input-delete-choice",function(){var a=jQuery(this).closest("li"),b=a.closest("ul"),c=a.data("index");DeleteInputChoice(b,a.data("input_id"),c)}),jQuery(".field_input_choice_values_enabled").on("click keypress",function(){var a=jQuery(this).parent().siblings(".gfield_settings_input_choices_container");ToggleInputChoiceValue(a,this.checked),SetInputChoices(a.find("ul"))}),jQuery(".input_placeholders_setting").on("input propertychange",".input_placeholder",function(){var a=jQuery(this).closest(".input_placeholder_row").data("input_id");SetInputPlaceholder(this.value,a)}).on("input propertychange","#field_single_placeholder",function(){SetFieldPlaceholder(this.value)}),jQuery("#field_rich_text_editor").on("click keypress",function(){var a=GetSelectedField();if(this.checked){var b=!0;HasConditionalLogicDependency(a.id,a.value)&&(confirm(gf_vars.conditionalLogicRichTextEditorWarning)||(jQuery("#field_rich_text_editor").prop("checked",!1),b=!1)),b&&(jQuery("#field_placeholder, #field_placeholder_textarea").prop("disabled",!0),jQuery("span#placeholder_warning").css("display","block"))}else 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 a=jQuery(this).closest(".field_input_name_row").data("input_id");SetInputName(this.value,a)}).on("input propertychange","#field_input_name",function(){SetInputName(this.value)}),jQuery(".custom_inputs_setting, .custom_inputs_sub_setting, .sub_labels_setting").on("click keypress",".input_active_icon",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");ToggleInputHidden(this,a)}).on("input propertychange",".field_custom_input_default_label",function(){var a=jQuery(this).closest(".field_custom_input_row").data("input_id");SetInputCustomLabel(this.value,a)}).on("input propertychange","#field_single_custom_label",function(){SetInputCustomLabel(this.value)}),jQuery(".default_input_values_setting").on("input propertychange",".default_input_value",function(){var a=jQuery(this).closest(".default_input_value_row").data("input_id");SetInputDefaultValue(this.value,a)}).on("input","#field_single_default_value",function(){SetFieldDefaultValue(this.value)}),jQuery(".choices_setting, .columns_setting").on("input propertychange",".field-choice-input",function(a){var b=jQuery(this),c=b.closest("li.field-choice-row");SetFieldChoice(c.data("input_type"),c.data("index")),(b.hasClass("field-choice-text")||b.hasClass("field-choice-value"))&&(CheckChoiceConditionalLogicDependency(this),a.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)}),jQuery("#field_description").on("blur",function(){GetSelectedField().description!=this.value&&(SetFieldDescription(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(a){return ValidateKeyPress(a,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("input propertychange",function(){SetFieldProperty("cssClass",this.value)}),jQuery("#field_admin_label").on("input propertychange",function(){SetFieldProperty("adminLabel",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 InitializeForm(a){a.fields.length>0&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),a.lastPageButton&&"image"==a.lastPageButton.type?jQuery("#last_page_button_image").prop("checked",!0):a.lastPageButton&&"image"==a.lastPageButton.type||jQuery("#last_page_button_text").prop("checked",!0),jQuery("#last_page_button_text_input").val(a.lastPageButton?a.lastPageButton.text:gf_vars.previousLabel),jQuery("#last_page_button_image_url").val(a.lastPageButton?a.lastPageButton.imageUrl:""),TogglePageButton("last_page",!0),a.postStatus&&jQuery("#field_post_status").val(a.postStatus),a.postAuthor&&jQuery("#field_post_author").val(a.postAuthor),void 0==a.useCurrentUserAsAuthor&&(a.useCurrentUserAsAuthor=!0),jQuery("#gfield_current_user_as_author").prop("checked",!!a.useCurrentUserAsAuthor),a.postCategory&&jQuery("#field_post_category").val(a.postCategory),a.postFormat&&jQuery("#field_post_format").val(a.postFormat),a.postContentTemplateEnabled?(jQuery("#gfield_post_content_enabled").prop("checked",!0),jQuery("#field_post_content_template").val(a.postContentTemplate)):(jQuery("#gfield_post_content_enabled").prop("checked",!1),jQuery("#field_post_content_template").val("")),TogglePostContentTemplate(!0),a.postTitleTemplateEnabled?(jQuery("#gfield_post_title_enabled").prop("checked",!0),jQuery("#field_post_title_template").val(a.postTitleTemplate)):(jQuery("#gfield_post_title_enabled").prop("checked",!1),jQuery("#field_post_title_template").val("")),TogglePostTitleTemplate(!0),jQuery("#gform_last_page_settings").bind("click",function(){FieldClick(this)}),jQuery("#gform_pagination").bind("click",function(){FieldClick(this)}),jQuery(".gfield").bind("click",function(){FieldClick(this)});var b=a.pagination&&a.pagination.type?a.pagination.type:"percentage",c="steps"==b,d="percentage"==b,e="none"==b;c?jQuery("#pagination_type_steps").prop("checked",!0):d?jQuery("#pagination_type_percentage").prop("checked",!0):e&&jQuery("#pagination_type_none").prop("checked",!0),jQuery("#first_page_css_class").val(a.firstPageCssClass),jQuery("#field_settings, #last_page_settings, #pagination_settings").tabs({selected:0}),TogglePageBreakSettings(),InitPaginationOptions(!0),InitializeFields()}function LoadFieldSettings(){field=GetSelectedField();var a=GetInputType(field);jQuery("#field_label").val(field.label),"html"==field.type?(jQuery(".tooltip_form_field_label_html").show(),jQuery(".tooltip_form_field_label").hide()):(jQuery(".tooltip_form_field_label_html").hide(),jQuery(".tooltip_form_field_label").show()),jQuery("#field_admin_label").val(field.adminLabel),jQuery("#field_content").val(void 0==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(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_default_value_textarea").val(void 0==field.defaultValue?"":field.defaultValue),jQuery("#field_description").val(void 0==field.description?"":field.description),jQuery("#field_css_class").val(void 0==field.cssClass?"":field.cssClass),jQuery("#field_range_min").val(void 0==field.rangeMin||!1===field.rangeMin?"":field.rangeMin),jQuery("#field_range_max").val(void 0==field.rangeMax||!1===field.rangeMax?"":field.rangeMax),jQuery("#field_name_format").val(field.nameFormat),jQuery("#field_force_ssl").prop("checked",!!field.forceSSL),jQuery("#credit_card_style").val(field.creditCardStyle?field.creditCardStyle:"style1"),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(void 0==field.allowedExtensions?"":field.allowedExtensions),jQuery("#field_multiple_files").prop("checked",!!field.multipleFiles),jQuery("#field_max_files").val(field.maxFiles?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_other_choice").prop("checked",!!field.enableOtherChoice),jQuery("#field_add_icon_url").val(field.addIconUrl?field.addIconUrl:""),jQuery("#field_delete_icon_url").val(field.deleteIconUrl?field.deleteIconUrl:""),jQuery("#gfield_enable_enhanced_ui").prop("checked",!!field.enableEnhancedUI),jQuery("#gfield_password_strength_enabled").prop("checked",1==field.passwordStrengthEnabled),jQuery("#gfield_min_strength").val(void 0==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(""+gf_vars.selectFormat+" "),jQuery("#field_number_format").val(field.numberFormat?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);var b=gformIsNumber(field.calculationRounding)?field.calculationRounding:"norounding";jQuery("#field_calculation_rounding").val(b),jQuery("#option_field_type").val(field.inputType);var c=jQuery("#product_field_type");if(c.val(field.inputType),has_entry(field.id)?c.prop("disabled",!0):c.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){var d=void 0==field.basePrice?"":field.basePrice;jQuery("#field_base_price").val(void 0==field.basePrice?"":field.basePrice),SetBasePrice(d)}jQuery("#shipping_field_type").val(field.inputType),jQuery("#field_disable_quantity").prop("checked",1==field.disableQuantity),SetDisableQuantity(1==field.disableQuantity);var e=!!field.enablePasswordInput;jQuery("#field_password").prop("checked",!!e),jQuery("#field_maxlen").val(void 0===field.maxLength?"":field.maxLength),jQuery("#field_maxrows").val(void 0===field.maxRows?"":field.maxRows);var f=void 0==field.addressType?"international":field.addressType;jQuery("#field_address_type").val(f),"address"==field.type&&(field=UpgradeAddressField(field)),"email"!=field.type&&"email"!=field.inputType||(field=UpgradeEmailField(field)),"password"!=field.type&&"password"!=field.inputType||(field=UpgradePasswordField(field));var g=void 0==field.defaultState?"":field.defaultState,h=void 0==field.defaultProvince?"":field.defaultProvince,i="canadian"==f&&""==g?h:g;jQuery("#field_address_default_state_"+f).val(i),jQuery("#field_address_default_country_"+f).val(void 0==field.defaultCountry?"":field.defaultCountry),SetAddressType(!0),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);var j=CustomFieldExists(field.postCustomFieldName);jQuery("#field_custom_field_name_select")[0].selectedIndex=0,jQuery("#field_custom_field_name_text").val(""),j?jQuery("#field_custom_field_name_select").val(field.postCustomFieldName):jQuery("#field_custom_field_name_text").val(field.postCustomFieldName),j?jQuery("#field_custom_existing").prop("checked",!0):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").prop("checked",!0):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);var k=!!field.postFeaturedImage;jQuery("#gfield_featured_image").prop("checked",k);var l=IsStandardMask(field.inputMaskValue);if(jQuery("#field_input_mask").prop("checked",!!field.inputMask),l?(jQuery("#field_mask_standard").prop("checked",!0),jQuery("#field_mask_select").val(field.inputMaskValue)):(jQuery("#field_mask_custom").prop("checked",!0),jQuery("#field_mask_text").val(field.inputMaskValue)),ToggleInputMask(!0),ToggleInputMaskOptions(!0),"creditcard"==a){field=UpgradeCreditCardField(field),(!field.creditCards||field.creditCards.length<=0)&&(field.creditCards=["amex","visa","discover","mastercard"]);for(p in field.creditCards)field.creditCards.hasOwnProperty(p)&&jQuery("#field_credit_card_"+field.creditCards[p]).prop("checked",!0)}"date"==a&&(field=UpgradeDateField(field)),"time"==a&&(field=UpgradeTimeField(field)),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateCustomizeInputsUI(field),CreateInputLabelsUI(field),field.dateType||"date"!=a||(field.dateType="datepicker"),jQuery("#field_date_input_type").val(field.dateType),jQuery("#gfield_calendar_icon_url").val(void 0==field.calendarIconUrl?"":field.calendarIconUrl),jQuery("#field_date_format").val("dmy"==field.dateFormat?"dmy":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);var m=GetFirstRuleField()>0;"page"==field.type?(LoadFieldConditionalLogic(m,"next_button"),LoadFieldConditionalLogic(m,"page")):LoadFieldConditionalLogic(m,"field"),jQuery("#field_enable_copy_values_option").prop("checked",1==field.enableCopyValuesOption),jQuery("#field_copy_values_option_default").prop("checked",1==field.copyValuesOptionDefault);var n=GetCopyValuesFieldsOptions(field.copyValuesFieldId,field);n.length>0?(jQuery("#field_enable_copy_values_option").prop("disabled",!1),jQuery("#field_copy_values_disabled").hide(),jQuery("#field_copy_values_option_field").html(n)):(jQuery("#field_enable_copy_values_option").prop("disabled",!0),jQuery("#field_copy_values_disabled").show()),ToggleCopyValuesOption(field.enableCopyValuesOption,!0),field.nextButton&&("image"==field.nextButton.type?jQuery("#next_button_image").prop("checked",!0):jQuery("#next_button_text").prop("checked",!0),jQuery("#next_button_text_input").val(field.nextButton.text),jQuery("#next_button_image_url").val(field.nextButton.imageUrl)),field.previousButton&&("image"==field.previousButton.type?jQuery("#previous_button_image").prop("checked",!0):jQuery("#previous_button_text").prop("checked",!0),jQuery("#previous_button_text_input").val(field.previousButton.text),jQuery("#previous_button_image_url").val(field.previousButton.imageUrl)),TogglePageButton("next",!0),TogglePageButton("previous",!0),jQuery(".gfield_category_checkbox").each(function(){if(field.choices)for(var a=0;areCAPTCHA')}("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()),"product"==field.type&&("singleproduct"==field.inputType?jQuery(".admin_label_setting").hide():jQuery(".admin_label_setting").show()),"date"==a&&ToggleDateSettings(field),"email"==a&&ToggleEmailSettings(field),jQuery(document).trigger("gform_load_field_settings",[field,form]),jQuery("#field_settings").appendTo(".field_selected"),jQuery("#field_settings").tabs("option","active",0),ShowSettings("field_settings"),gform.doAction("gform_post_load_field_settings",[field,form]),SetProductField(field);var w=[];0==jQuery("#gform_tab_3 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")}).length&&w.push(1),0==jQuery("#gform_tab_2 li.field_setting").filter(function(){return jQuery(this).is(":hidden")&&"none"!=jQuery(this).css("display")}).length&&w.push(2),w.length>0?jQuery("#field_settings").tabs({disabled:w}):jQuery("#field_settings").tabs({disabled:[]}),Placeholders.enable()}function ToggleDateSettings(a){var b="datefield"==a.dateType,c="datepicker"==a.dateType,d="datedropdown"==a.dateType;jQuery(".placeholder_setting").toggle(c),jQuery(".default_value_setting").toggle(c),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(d||b),jQuery(".input_placeholders_setting").toggle(d||b)}function SetUpAdvancedNameField(){field=GetSelectedField(),jQuery(".name_format_setting").hide(),jQuery(".name_setting").show(),jQuery(".name_prefix_choices_setting").show();var a=GetCustomizeInputsUI(field);jQuery("#field_name_fields_container").html(a).show();var b=GetInput(field,field.id+".2"),c=GetInputChoices(b);jQuery("#field_prefix_choices").html(c),ToggleNamePrefixUI(!b.isHidden),jQuery(".name_setting .custom_inputs_setting").on("click",".input_active_icon",function(){jQuery(this).data("input_id").toString().indexOf(".2")>=0&&ToggleNamePrefixUI(this.src.indexOf("active1.png")>=0)}),jQuery(".default_value_setting").hide(),jQuery(".default_input_values_setting").show(),jQuery(".input_placeholders_setting").show(),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputNames(field)}function GetCopyValuesFieldsOptions(a,b){for(var c,d,e,f,g=[],h=GetInputType(b),i=0;i"+c+"",g.push(e));return g.join("")}function ToggleNamePrefixUI(a){jQuery(".name_prefix_choices_setting").toggle(a)}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(a){SetFieldProperty("disableQuantity",a),a?jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").hide():jQuery(".field_selected .ginput_quantity_label, .field_selected .ginput_quantity").show()}function SetBasePrice(a){a||(a=0);var b=GetCurrentCurrency(),c=b.toMoney(a);0==c&&(c=0),jQuery("#field_base_price").val(c),SetFieldProperty("basePrice",c),jQuery(".field_selected .ginput_product_price, .field_selected .ginput_shipping_price").html(c),jQuery(".field_selected .ginput_amount").val(c)}function ChangeAddressType(){if(field=GetSelectedField(),"address"==field.type){var a=jQuery("#field_address_type").val(),b=GetInput(field,field.id+".6"),c=jQuery("#field_address_country_"+a).val();b.isHidden=""!=c,SetAddressType(!1)}}function SetAddressType(a){if(field=GetSelectedField(),"address"==field.type){SetAddressProperties(),jQuery(".gfield_address_type_container").hide();var b=a?"":"slow";jQuery("#address_type_container_"+jQuery("#field_address_type").val()).show(b),CreatePlaceholdersUI(field)}}function UpdateAddressFields(){var a=jQuery("#field_address_type").val();field=GetSelectedField();var b=GetCustomizeInputsUI(field);jQuery("#field_address_fields_container").html(b);var c=GetInput(field,field.id+".5"),d=jQuery("#field_address_zip_label_"+a).val();jQuery("#field_custom_input_default_label_"+field.id+"_5").text(d),jQuery("#field_custom_input_label_"+field.id+"\\.5").attr("placeholder",d),c.customLabel||jQuery(".field_selected #input_"+field.id+"_5_label").html(d);var e=GetInput(field,field.id+".4"),f=jQuery("#field_address_state_label_"+a).val();if(jQuery("#field_custom_input_default_label_"+field.id+"_4").text(f),jQuery("#field_custom_input_label_"+field.id+"\\.4").attr("placeholder",f),e.customLabel||jQuery(".field_selected #input_"+field.id+"_4_label").html(f),""!=jQuery("#field_address_country_"+a).val()?(jQuery(".field_selected #input_"+field.id+"_6_container").hide(),jQuery(".field_custom_input_row_input_"+field.id+"_6").hide()):(jQuery(".field_selected #input_"+field.id+"_6").val(jQuery("#field_address_default_country_"+a).val()),jQuery(".field_selected #input_"+field.id+"_6_container").show(),jQuery(".field_selected .field_custom_input_row_input_"+field.id+"_6").show()),""!=jQuery("#field_address_has_states_"+a).val()){jQuery(".field_selected .state_text").hide();var g=jQuery("#field_address_default_state_"+a).val(),h=jQuery(".field_selected .state_dropdown");h.append(jQuery(" ").val(g).html(g)),h.val(g).show()}else jQuery(".field_selected .state_dropdown").hide(),jQuery(".field_selected .state_text").show()}function SetAddressProperties(){field=GetSelectedField();var a=jQuery("#field_address_type").val();SetFieldProperty("addressType",a),SetFieldProperty("defaultState",jQuery("#field_address_default_state_"+a).val()),SetFieldProperty("defaultProvince","");var b=jQuery("#field_address_country_"+a).val();""==b&&(b=jQuery("#field_address_default_country_"+a).val()),SetFieldProperty("defaultCountry",b),UpdateAddressFields()}function MaybeUpgradeNameField(a){return(void 0===a.nameFormat||""==a.nameFormat||"normal"==a.nameFormat||"simple"==a.nameFormat&&!has_entry(a.id))&&(a=UpgradeNameField(a,!0,!0,!0)),a}function UpgradeNameField(a,b,c,d){return a.nameFormat="advanced",a.inputs=MergeInputArrays(GetAdvancedNameFieldInputs(a,b,c,d),a.inputs),RefreshSelectedFieldPreview(function(){SetUpAdvancedNameField()}),a}function UpgradeDateField(a){return"date"!=a.type&&"date"!=a.inputType?a:(void 0===a.dateType||"datepicker"==a.dateType||a.inputs||(a.inputs=GetDateFieldInputs(a)),a)}function UpgradeTimeField(a){return"time"!=a.type&&"time"!=a.inputType?a:(a.inputs||(a.inputs=GetTimeFieldInputs(a)),a)}function UpgradeEmailField(a){return"email"!=a.type&&"email"!=a.inputType?a:(a.emailConfirmEnabled&&!a.inputs&&(a.inputs=GetEmailFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradePasswordField(a){return"password"!=a.type&&"password"!=a.inputType?a:(a.inputs||(a.inputs=GetPasswordFieldInputs(a),a.inputs[0].placeholder=a.placeholder),a)}function UpgradeAddressField(a){if(a.hideCountry){GetInput(a,a.id+".6").isHidden=!0}if(delete a.hideCountry,a.hideAddress2){GetInput(a,a.id+".2").isHidden=!0}if(delete a.hideAddress2,a.hideState){GetInput(a,a.id+".4").isHidden=!0}return delete a.hideState,a}function TogglePasswordStrength(a){var b=a?"":"slow";jQuery("#gfield_password_strength_enabled").is(":checked")?jQuery("#gfield_min_strength_container").show(b):jQuery("#gfield_min_strength_container").hide(b)}function ToggleCategory(a){var b=a?"":"slow";jQuery("#gfield_category_all").is(":checked")?(jQuery("#gfield_settings_category_container").hide(b),SetFieldProperty("displayAllCategories",!0),SetFieldProperty("choices",new Array)):(jQuery("#gfield_settings_category_container").show(b),SetFieldProperty("displayAllCategories",!1))}function SetCopyValuesOptionLabel(a){SetFieldProperty("copyValuesOptionLabel",a),jQuery(".field_selected .copy_values_option_label").html(a)}function SetCustomFieldTemplate(){var a=jQuery("#gfield_customfield_content_enabled").is(":checked");SetFieldProperty("customFieldTemplate",a?jQuery("#field_customfield_content_template").val():null),SetFieldProperty("customFieldTemplateEnabled",a)}function SetCategoryInitialItem(){var a=jQuery("#gfield_post_category_initial_item_enabled").is(":checked")
+;SetFieldProperty("categoryInitialItem",a?jQuery("#field_post_category_initial_item").val():null),SetFieldProperty("categoryInitialItemEnabled",a)}function PopulateContentTemplate(a){if(0==jQuery("#"+a).val().length){var b=GetSelectedField();jQuery("#"+a).val("{"+b.label+":"+b.id+"}")}}function TogglePostContentTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_content_enabled").is(":checked")?(jQuery("#gfield_post_content_container").show(b),a||PopulateContentTemplate("field_post_content_template")):jQuery("#gfield_post_content_container").hide(b)}function TogglePostTitleTemplate(a){var b=a?"":"slow";jQuery("#gfield_post_title_enabled").is(":checked")?(jQuery("#gfield_post_title_container").show(b),a||PopulateContentTemplate("field_post_title_template")):jQuery("#gfield_post_title_container").hide(b)}function ToggleCustomFieldTemplate(a){var b=a?"":"slow";jQuery("#gfield_customfield_content_enabled").is(":checked")?(jQuery("#gfield_customfield_content_container").show(b),a||PopulateContentTemplate("field_customfield_content_template")):jQuery("#gfield_customfield_content_container").hide(b)}function ToggleInputName(a){var b=a?"":"slow";jQuery("#field_prepopulate").is(":checked")?jQuery("#field_input_name_container").show(b):(jQuery("#field_input_name_container").hide(b),jQuery("#field_input_name").val(""))}function SetFieldColumns(){SetFieldChoices()}function ToggleChoiceValue(a){var b=GetSelectedField(),c=b.enablePrice?"_and_price":"",d=jQuery("#gfield_settings_choices_container");d.removeClass("choice_with_price choice_with_value choice_with_value_and_price"),jQuery("#field_choice_values_enabled").is(":checked")?d.addClass("choice_with_value"+c):b.enablePrice&&d.addClass("choice_with_price")}function ToggleInputChoiceValue(a,b){void 0===b&&(b=!1);var c=GetSelectedField(),d=a.find("li").data("input_id");GetInput(c,d).enableChoiceValue=b,a.removeClass("choice_with_value"),b&&a.addClass("choice_with_value")}function ToggleCopyValuesActivated(a){jQuery(".field_selected .copy_values_activated").prop("checked",a);var b=GetSelectedField();jQuery("#input_"+b.id).toggle(!a)}function TogglePageButton(a,b){var c=jQuery("#"+a+"_button_text").is(":checked");show_element=c?"#"+a+"_button_text_container":"#"+a+"_button_image_container",hide_element=c?"#"+a+"_button_image_container":"#"+a+"_button_text_container",b?(jQuery(hide_element).hide(),jQuery(show_element).show()):(jQuery(hide_element).hide(),jQuery(show_element).fadeIn(800))}function SetPageButton(a){field=GetSelectedField();var b=jQuery("#"+a+"_button_image").is(":checked")?"image":"text";field[a+"Button"].type=b,"image"==b?(field[a+"Button"].text="",field[a+"Button"].imageUrl=jQuery("#"+a+"_button_image_url").val()):(field[a+"Button"].text=jQuery("#"+a+"_button_text_input").val(),field[a+"Button"].imageUrl="")}function ToggleCustomField(a){var b=jQuery("#field_custom_existing").is(":checked");show_element=b?"#field_custom_field_name_select":"#field_custom_field_name_text",hide_element=b?"#field_custom_field_name_text":"#field_custom_field_name_select";var c="";jQuery(hide_element).hide(c),jQuery(show_element).show(c)}function ToggleInputMask(a){var b=a?"":"slow";jQuery("#field_input_mask").is(":checked")?(jQuery("#gform_input_mask").show(b),jQuery(".maxlen_setting").hide(),SetFieldProperty("inputMask",!0),jQuery("#field_maxlen").val(""),SetFieldProperty("maxLength","")):(jQuery("#gform_input_mask").hide(b),jQuery(".maxlen_setting").show(),SetFieldProperty("inputMask",!1),SetFieldProperty("inputMaskValue",""))}function ToggleInputMaskOptions(a){var b=jQuery("#field_mask_standard").is(":checked");show_element=b?"#field_mask_select":"#field_mask_text, .mask_text_description",hide_element=b?"#field_mask_text, .mask_text_description":"#field_mask_select";var c="";jQuery(hide_element).val("").hide(c),jQuery(show_element).show(c),a||SetFieldProperty("inputMaskValue","")}function ToggleAutoresponder(){jQuery("#form_autoresponder_enabled").is(":checked")?jQuery("#form_autoresponder_container").show("slow"):jQuery("#form_autoresponder_container").hide("slow")}function ToggleMultiFile(a){var b=a?"":"slow";if(jQuery("#field_multiple_files").prop("checked")?(jQuery("#gform_multiple_files_options").show(b),SetFieldProperty("multipleFiles",!0)):(jQuery("#gform_multiple_files_options").hide(b),SetFieldProperty("multipleFiles",!1),jQuery("#field_max_files").val(""),SetFieldProperty("maxFiles","")),!a){var c=GetSelectedField();jQuery("#field_settings").slideUp(function(){StartChangeInputType("fileupload",c)})}}function HasPostContentField(){for(var a=0;a=0&&b.push(form.fields[c]);return b}function GetNextFieldId(){for(var a=0,b=0;ba&&(a=parseFloat(form.fields[b].id));if(form.deletedFields)for(var b=0;ba&&(a=parseFloat(form.deletedFields[b]));return parseFloat(a)+1}function EndAddField(a,b,c){gf_vars.currentlyAddingField=!1,jQuery("#gform_adding_field_spinner").remove(),void 0!==c?(form.fields.splice(c,0,a),0===c?jQuery("#gform_fields").prepend(b):jQuery("#gform_fields").children().eq(c-1).after(b)):(jQuery("#gform_fields").append(b),form.fields.push(a));var d=jQuery("#field_"+a.id);d.animate({backgroundColor:"#FFFBCC"},"fast",function(){jQuery(this).animate({backgroundColor:"#FFF"},"fast",function(){jQuery(this).css("background-color","")})}),d.bind("click",function(){FieldClick(this)}),0===jQuery("#no-fields-stash li").length&&jQuery("#no-fields").detach().appendTo("#no-fields-stash"),jQuery(".selectable").removeClass("field_selected"),HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),d.addClass("field_selected"),SetFieldSize(a.size),TogglePageBreakSettings(),InitializeFields(),d.removeClass("field_selected"),jQuery(document).trigger("gform_field_added",[form,a])}function StartChangeNameFormat(a){field=GetSelectedField(),UpgradeNameField(field,!1,!0,!1)}function StartChangeCaptchaType(a){field=GetSelectedField(),field.captchaType=a,SetFieldProperty("captchaType",a),jQuery("#field_settings").slideUp(function(){StartChangeInputType(field.type,field)}),ResetRecaptcha()}function ResetRecaptcha(){field=GetSelectedField(),field.captchaLanguage="en",field.captchaTheme="light"}function StartChangeProductType(a){return field=GetSelectedField(),"singleproduct"==a||"hiddenproduct"==a||"calculation"==field.inputType?field.enablePrice=null:field.enablePrice=!0,StartChangeInputType(a,field)}function StartChangeDonationType(a){return field=GetSelectedField(),field.enablePrice="donation"!=a||null,StartChangeInputType(a,field)}function StartChangeShippingType(a){return field=GetSelectedField(),"singleshipping"!=a&&(field.enablePrice=!0),StartChangeInputType(a,field)}function StartChangePostCategoryType(a){return"dropdown"==a?jQuery(".post_category_initial_item_setting").hide():jQuery(".post_category_initial_item_setting").show(),field=GetSelectedField(),StartChangeInputType(a,field)}function EndChangeInputType(a){var b=a.id,c=a.type,d=a.fieldString;jQuery("#field_"+b).html(d);var e=GetFieldById(b);e.inputType=e.type!=c?c:"",SetDefaultValues(e),SetFieldLabel(e.label),SetFieldSize(e.size),SetFieldDefaultValue(e.defaultValue),SetFieldDescription(e.description),SetFieldRequired(e.isRequired),InitializeFields(),LoadFieldSettings()}function InitializeFields(){jQuery(".selectable").hover(function(){jQuery(this).addClass("field_hover")},function(){jQuery(this).removeClass("field_hover")}),jQuery(".field_delete_icon, .field_duplicate_icon").bind("click",function(a){a.stopPropagation()}),jQuery("#field_settings, #form_settings, #last_page_settings, #pagination_settings, .captcha_message, .form_delete_icon, .all-merge-tags").bind("click",function(a){a.stopPropagation()})}function FieldClick(a){if(gforms_dragging==a.id)return void(gforms_dragging=0);if(jQuery(a).hasClass("field_selected")){var b="";switch(a.id){case"gform_heading":b="#form_settings",jQuery(".gf_form_toolbar_settings a").removeClass("gf_toolbar_active");break;case"gform_last_page_settings":b="#last_page_settings";break;case"gform_pagination":b="#pagination_settings";break;default:b="#field_settings"}return jQuery("input#gform_force_focus").focus(),void jQuery(b).slideUp(function(){jQuery(a).removeClass("field_selected").addClass("field_hover"),HideSettings("field_settings")})}jQuery(".selectable").removeClass("field_selected"),jQuery(a).removeClass("field_hover").addClass("field_selected"),"gform_heading"==a.id?(HideSettings("field_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),InitializeFormConditionalLogic(),ShowSettings("form_settings"),jQuery(".gf_form_toolbar_settings a").addClass("gf_toolbar_active")):"gform_last_page_settings"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("pagination_settings"),ShowSettings("last_page_settings")):"gform_pagination"==a.id?(HideSettings("field_settings"),HideSettings("form_settings"),HideSettings("last_page_settings"),InitPaginationOptions(),ShowSettings("pagination_settings")):(HideSettings("form_settings"),HideSettings("last_page_settings"),HideSettings("pagination_settings"),LoadFieldSettings())}function TogglePercentageStyle(a){var b=a?"":"slow";"custom"==jQuery("#percentage_style").val()?jQuery(".percentage_custom_container").show(b):jQuery(".percentage_custom_container").hide(b)}function TogglePercentageConfirmationText(a){var b=a?"":"slow";jQuery("#percentage_confirmation_display").is(":checked")?jQuery(".percentage_confirmation_page_name_setting").show(b):jQuery(".percentage_confirmation_page_name_setting").hide(b)}function CustomFieldExists(a){if(!a)return!0;for(var b=jQuery("#field_custom_field_name_select option"),c=0;c";for(key in gform_custom_choices)if(gform_custom_choices.hasOwnProperty(key)){var b='SelectCustomChoice( jQuery(this).data("key") );';a+=""+escapeHtml(key)+" "}a+="",jQuery("#bulk_items").prepend(a)}}function escapeAttr(a){return String(a).replace(/["']/g,function(a){return entityMap[a]})}function escapeHtml(a){return String(a).replace(/[&<>"'`=\/]/g,function(a){return entityMap[a]})}function SelectCustomChoice(a){jQuery("#gfield_bulk_add_input").val(gform_custom_choices[a].join("\n")),gform_selected_custom_choice=a,InitBulkCustomPanel()}function SelectPredefinedChoice(a){jQuery("#gfield_bulk_add_input").val(gform_predefined_choices[a].join("\n")),gform_selected_custom_choice="",InitBulkCustomPanel()}function InsertBulkChoices(a){field=GetSelectedField(),field.choices=new Array;for(var b=!1,c=0;c1){var d=GetCurrentCurrency();price=d.toMoney(text_price[1])}text_value=text_value.split("|"),field.choices.push(new Choice(jQuery.trim(text_value[0]),jQuery.trim(text_value[text_value.length-1]),jQuery.trim(price))),text_value.length>1&&(b=!0)}b&&(field.enableChoiceValue=!0,jQuery("#field_choice_values_enabled").prop("checked",!0),ToggleChoiceValue()),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InitBulkCustomPanel(){0==gform_selected_custom_choice.length?CloseCustomChoicesPanel():LoadCustomChoicesPanel()}function LoadCustomChoicesPanel(a,b){a?(jQuery("#custom_choice_name").val(""),jQuery("#bulk_save_button").html(gf_vars.save),jQuery("#bulk_cancel_link").show(),jQuery("#bulk_delete_link").hide()):(jQuery("#custom_choice_name").val(gform_selected_custom_choice),jQuery("#bulk_save_button").html(gf_vars.update),jQuery("#bulk_cancel_link").hide(),jQuery("#bulk_delete_link").show()),b||(b=""),jQuery("#bulk_save_as").hide(b),jQuery("#bulk_custom_edit").show(b)}function CloseCustomChoicesPanel(a){a||(a=""),jQuery("#bulk_save_as").show(a),jQuery("#bulk_custom_edit").hide(a)}function IsEmpty(a){var b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0}function SetFieldChoice(a,b){var c=jQuery("#"+a+"_choice_text_"+b).val(),d=jQuery("#"+a+"_choice_value_"+b).val(),e=jQuery("#"+a+"_choice_price_"+b).val();if(field=GetSelectedField(),field.choices[b].text=c,field.choices[b].value=field.enableChoiceValue?d:c,field.enablePrice){var f=GetCurrentCurrency(),e=f.toMoney(e);e||(e=""),field.choices[b].price=e}jQuery("#field_choices :radio, #field_choices :checkbox").each(function(a){field.choices[a].isSelected=this.checked}),LoadBulkChoices(field),UpdateFieldChoices(GetInputType(field))}function SetInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,a);a=a.toString().replace(".","_"),f.choices[b].text=d,f.choices[b].value=f.enableChoiceValue?c:d,jQuery(".field-input-choice-"+a+":radio, .field-input-choice-"+a+":checkbox").each(function(a){f.choices[a].isSelected=this.checked}),UpdateInputChoices(f)}function UpdateFieldChoices(a){var b="",c="";"checkbox"==a&&(field.inputs=new Array);var d=0;switch(GetInputType(field)){case"select":for(var e=0;e"+field.choices[e].text+""}break;case"checkbox":for(var e=0;e"+field.choices[e].text+" ")}field.choices.length>5&&(b+=""+gf_vars.editToViewAll.replace("%d",field.choices.length)+" ");break;case"radio":for(var e=0;e"+field.choices[e].text+" ")}b+=field.enableOtherChoice?" ":"",field.choices.length>5&&(b+=""+gf_vars.editToViewAll.replace("%d",field.choices.length)+" ");break;case"list":var h=null!=field.choices;columns=h?field.choices:[[]];var i="";if(h){b+="";for(var e=0;e"+columns[e].text+"";b+=" "}else i="class='gf_list_one_column'";b+="",b+="";for(var j=0;j ";b+=" ",b+=" "}c=".gfield_"+a,jQuery(".field_selected "+c).html(b)}function UpdateInputChoices(a){for(var b="",c=0;c"+a.choices[c].text+""}var e=a.id.toString().replace(".","_");jQuery(".field_selected #input_"+e).html(b)}function InsertFieldChoice(a){field=GetSelectedField();var b=field.enablePrice?"0.00":"",c=new Choice("","",b);window["gform_new_choice_"+field.type]&&(c=window["gform_new_choice_"+field.type](field,c)),field.choices.splice(a,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function InsertInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b),f=new Choice("","");e.choices.splice(c,0,f),LoadInputChoices(a,e),UpdateInputChoices(e)}function DeleteFieldChoice(a){field=GetSelectedField();var b=jQuery("#"+GetInputType(field)+"_choice_value_"+a).val();HasConditionalLogicDependency(field.id,b)&&!confirm(gf_vars.conditionalLogicDependencyChoice)||(field.choices.splice(a,1),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field)))}function DeleteInputChoice(a,b,c){var d=GetSelectedField(),e=GetInput(d,b);e.choices.splice(c,1),LoadInputChoices(a,e),UpdateInputChoices(e)}function MoveFieldChoice(a,b){field=GetSelectedField();var c=field.choices[a];field.choices.splice(a,1),field.choices.splice(b,0,c),LoadFieldChoices(field),UpdateFieldChoices(GetInputType(field))}function MoveInputChoice(a,b,c,d){var e=GetSelectedField(),f=GetInput(e,b),g=f.choices[c];f.choices.splice(c,1),f.choices.splice(d,0,g),LoadInputChoices(a,f),UpdateInputChoices(f)}function GetFieldType(a){return a.substr(0,a.lastIndexOf("_"))}function GetSelectedField(){var a=jQuery(".field_selected");if(a.length<=0)return!1;var b=a[0].id.substr(6);return GetFieldById(b)}function SetPasswordProperty(a){SetFieldProperty("enablePasswordInput",a)}function ToggleDateCalendar(a){var b=a?"":"slow",c=jQuery("#field_date_input_type").val();"datefield"==c||"datedropdown"==c?(jQuery("#date_picker_container").hide(b),SetCalendarIconType("none")):jQuery("#date_picker_container").show(b)}function ToggleCalendarIconUrl(a){var b=a?"":"slow";jQuery("#gsetting_icon_custom").is(":checked")?jQuery("#gfield_icon_url_container").show(b):(jQuery("#gfield_icon_url_container").hide(b),jQuery("#gfield_calendar_icon_url").val(""),SetFieldProperty("calendarIconUrl",""))}function SetTimeFormat(a){SetFieldProperty("timeFormat",a),LoadTimeInputs()}function LoadTimeInputs(){var a=GetSelectedField();if("time"==a.type||"time"==a.inputType){"24"==jQuery("#field_time_format").val()?(jQuery("#input_default_value_row_input_"+a.id+"_3").hide(),jQuery(".field_selected .gfield_time_ampm").hide()):(jQuery("#input_default_value_row_input_"+a.id+"_3").show(),jQuery(".field_selected .gfield_time_ampm").show()),jQuery("#input_placeholder_row_input_"+a.id+"_3").hide(),jQuery(".field_custom_input_row_"+a.id+"_3").hide()}}function SetDateFormat(a){SetFieldProperty("dateFormat",a),LoadDateInputs()}function LoadDateInputs(){var a=jQuery("#field_date_input_type").val(),b=jQuery("#field_date_format").val(),c=b?b.substr(0,3):"mdy";if("datefield"==a){switch(c){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 .ginput_date").show(),jQuery(".field_selected .ginput_date_dropdown").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else if("datedropdown"==a){switch(c){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 .ginput_date_dropdown").css("display","inline"),jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected #gfield_input_datepicker").hide(),jQuery(".field_selected #gfield_input_datepicker_icon").hide()}else jQuery(".field_selected .ginput_date").hide(),jQuery(".field_selected .ginput_date_dropdown").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(a,b){field=GetSelectedField(),"date"==GetInputType(field)&&(void 0==a&&(a="none"),"none"==a?jQuery("#gsetting_icon_none").prop("checked",!0):"calendar"==a?jQuery("#gsetting_icon_calendar").prop("checked",!0):"custom"==a&&jQuery("#gsetting_icon_custom").prop("checked",!0),SetFieldProperty("calendarIconType",a),ToggleCalendarIconUrl(b),LoadDateInputs())}function SetDateInputType(a){field=GetSelectedField(),"date"==GetInputType(field)&&(field.dateType=a,field.inputs=GetDateFieldInputs(field),CreateDefaultValuesUI(field),CreatePlaceholdersUI(field),CreateInputLabelsUI(field),ToggleDateSettings(field),ResetDefaultInputValues(field),ResetInputPlaceholders(field),ToggleDateCalendar(),LoadDateInputs())}function SetPostImageMeta(){var a=jQuery(".field_selected #gfield_display_title").is(":checked"),b=jQuery(".field_selected #gfield_display_caption").is(":checked"),c=jQuery(".field_selected #gfield_display_description").is(":checked"),d=a||b||c;SetFieldProperty("displayTitle",a),SetFieldProperty("displayCaption",b),SetFieldProperty("displayDescription",c),jQuery(".field_selected .ginput_post_image_title").css("display",a?"block":"none"),jQuery(".field_selected .ginput_post_image_caption").css("display",b?"block":"none"),jQuery(".field_selected .ginput_post_image_description").css("display",c?"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(a,b){void 0==b&&(b=""),GetSelectedField()[a]=b}function SetInputName(a,b){var c=GetSelectedField();if(a&&(a=a.trim()),b){for(var d=0;db.text.toLowerCase()})}function SetFieldLabel(a){var b=jQuery(".field_selected .gfield_required")[0];jQuery(".field_selected .gfield_label, .field_selected .gsection_title").text(a).append(b),SetFieldProperty("label",a)}function SetCaptchaTheme(a,b){jQuery(".field_selected .gfield_captcha").attr("src",b),SetFieldProperty("captchaTheme",a)}function SetCaptchaSize(a){var b=jQuery("#field_captcha_type").val();SetFieldProperty("simpleCaptchaSize",a),RedrawCaptcha(),jQuery(".field_selected .gfield_captcha_input_container").removeClass(b+"_small").removeClass(b+"_medium").removeClass(b+"_large").addClass(b+"_"+a)}function SetCaptchaFontColor(a){SetFieldProperty("simpleCaptchaFontColor",a),RedrawCaptcha()}function SetCaptchaBackgroundColor(a){SetFieldProperty("simpleCaptchaBackgroundColor",a),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 SetFieldSize(a){jQuery(".field_selected .small, .field_selected .medium, .field_selected .large").removeClass("small").removeClass("medium").removeClass("large").addClass(a),SetFieldProperty("size",a)}function SetFieldLabelPlacement(a){var b=a||form.labelPlacement;SetFieldProperty("labelPlacement",a),jQuery(".field_selected").removeClass("top_label").removeClass("right_label").removeClass("left_label").removeClass("hidden_label").addClass(b),"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"),SetFieldProperty("labelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldDescriptionPlacement(a){var b="above"==a||""==a&&"above)"==form.descriptionPlacement;SetFieldProperty("descriptionPlacement",a),RefreshSelectedFieldPreview(function(){b?jQuery(".field_selected").addClass("description_above"):jQuery(".field_selected").removeClass("description_above")})}function SetFieldSubLabelPlacement(a){SetFieldProperty("subLabelPlacement",a),RefreshSelectedFieldPreview()}function SetFieldVisibility(a,b,c){if(!c&&"administrative"==a&&HasConditionalLogicDependency(field.id)&&!confirm(gf_vars.conditionalLogicDependencyAdminOnly))return!1;for(var d=!1,e=0;e div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").val(a),SetFieldProperty("defaultValue",a)}function SetFieldPlaceholder(a){jQuery(".field_selected > div > input:visible, .field_selected > div > textarea:visible, .field_selected > div > select:visible").each(function(){var b=this.nodeName,c=jQuery(this);if("INPUT"==b||"TEXTAREA"==b)jQuery(this).prop("placeholder",a);else if("SELECT"==b){var d=c.find('option[value=""]');d.length>0?a.length>0?d.text(a):d.remove():(c.prepend(''+a+" "),c.val(""))}}),SetFieldProperty("placeholder",a)}function SetFieldDescription(a){void 0==a&&(a=""),SetFieldProperty("description",a)}function SetPasswordStrength(a){a?jQuery(".field_selected .gfield_password_strength").show():(jQuery(".field_selected .gfield_password_strength").hide(),jQuery("#gfield_min_strength").val(""),SetFieldProperty("minPasswordStrength","")),SetFieldProperty("passwordStrengthEnabled",a)}function ToggleEmailSettings(a){var b=void 0!==a.emailConfirmEnabled&&1==a.emailConfirmEnabled;jQuery(".placeholder_setting").toggle(!b),jQuery(".default_value_setting").toggle(!b),jQuery(".sub_label_placement_setting").toggle(b),jQuery(".sub_labels_setting").toggle(b),jQuery(".default_input_values_setting").toggle(b),jQuery(".input_placeholders_setting").toggle(b)}function SetEmailConfirmation(a){var b=GetSelectedField();a?(jQuery(".field_selected .ginput_single_email").hide(),jQuery(".field_selected .ginput_confirm_email").show()):(jQuery(".field_selected .ginput_confirm_email").hide(),jQuery(".field_selected .ginput_single_email").show()),b.emailConfirmEnabled=a,b.inputs=GetEmailFieldInputs(b),CreateDefaultValuesUI(b),CreatePlaceholdersUI(b),CreateCustomizeInputsUI(b),CreateInputLabelsUI(b),ToggleEmailSettings(b)}function SetCardType(a,b){var c=GetSelectedField().creditCards?GetSelectedField().creditCards:new Array;if(jQuery(a).is(":checked"))-1==jQuery.inArray(b,c)&&(jQuery(".gform_card_icon_"+b).fadeIn(),c[c.length]=b);else{var d=jQuery.inArray(b,c);-1!=d&&(jQuery(".gform_card_icon_"+b).fadeOut(),c.splice(d,1))}SetFieldProperty("creditCards",c)}function SetFieldRequired(a){var b=a?"*":"";jQuery(".field_selected .gfield_required").html(b),SetFieldProperty("isRequired",a)}function SetMaxLength(a){var b=GetMaxLengthPattern(),c="",d=a.value.split("");for(i in d)d.hasOwnProperty(i)&&(b.test(d[i])||(c+=d[i]));a.value=c,SetFieldProperty("maxLength",c)}function GetMaxLengthPattern(){return/[a-zA-Z\-!@#$%^&*();'":_+=<,>.~`?\/|\[\]\{\}\\]/}function ValidateKeyPress(a,b,c){var c=void 0===c||c,d=a.which?a.which:a.keyCode,e=b.test(String.fromCharCode(d));return!!a.ctrlKey||(c?e:!e)}function IndexOf(a,b){for(var c=0;c-1&&/StartAddField\([ ]?'(.*?)[ ]?'/.test(c)&&(b=c.match(/'(.*?)'/)[1],a.data("type",b)),window.console&&console.log("Deprecated button for the "+this.value+' field. Since v1.9 the field type must be specified in the "type" data attribute.')),void 0===b||void 0!==c&&""!=c||jQuery(this).click(function(){StartAddField(b)})}),jQuery("#gform_fields").sortable({cancel:"#field_settings",handle:".gfield_admin_icons",start:function(a,b){gforms_dragging=b.item[0].id},tolerance:"pointer",over:function(a,b){if(jQuery("#no-fields").hide(),b.helper.hasClass("ui-draggable-dragging"))b.helper.data("original_width",b.helper.width()),b.helper.data("original_height",b.helper.height()),b.helper.width(b.sender.width()-25),b.helper.height(b.placeholder.height());else{var c=b.helper.height();c>300&&(c=300),b.placeholder.height(c)}},out:function(a,b){1===jQuery("#gform_fields li").length&&jQuery("#no-fields").show(),b.helper&&b.helper.hasClass("ui-draggable-dragging")&&(b.helper.width(b.helper.data("original_width")),b.helper.height(b.helper.data("original_height")))},placeholder:"field-drop-zone",beforeStop:function(a,b){jQuery("#gform_fields").height("100%");var c=b.helper.data("type");if(void 0!==c){var d=b.item.index();b.item.replaceWith(" "),StartAddField(c,d)}}}),jQuery(".field_type input").draggable({connectToSortable:"#gform_fields",helper:function(){return jQuery(this).clone(!0)},revert:"invalid",cancel:!1,appendTo:"#wpbody",containment:"document",start:function(a,b){if(1==gf_vars.currentlyAddingField)return!1}}),jQuery("#field_choices, #field_columns").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){MoveFieldChoice(b.item.data("index"),b.item.index())}}),jQuery(".field_input_choices").sortable({axis:"y",handle:".field-choice-handle",update:function(a,b){var c=b.item.data("index"),d=b.item.index(),e=b.item.data("input_id");MoveInputChoice(b.item.parent(),e,c,d)}}),MakeNoFieldsDroppable(),void 0!==gf_global.view&&"settings"==gf_global.view||InitializeForm(form),jQuery(document).trigger("gform_load_form_settings",[form]),SetupUnsavedChangesWarning(),window.console){var a=jQuery(document)[0],b=jQuery.hasData(a)&&jQuery._data(a);if(b){var c=new Array("gform_load_form_settings");for(var d in b.events)-1!==jQuery.inArray(d,c)&&console.log('Gravity Forms API warning: The jQuery event "'+d+'" is deprecated on this page since version 1.7')}}jQuery(document).on("focus","#field_choices input.field-choice-text, #field_choices input.field-choice-value",function(){jQuery(this).data("previousValue",jQuery(this).val())}),InitializeFieldSettings()});var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};this.iColorPicker=function(){jQuery("input.iColorPicker").each(function(a){0==a&&(jQuery(document.createElement("div")).attr("id","iColorPicker").css("display","none").html('').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.fn.gfSlide=function(a){var b=jQuery("#field_settings").is(":visible");return"up"==a?b?this.slideUp():this.hide():b?this.slideDown():this.show(),this},gform.addFilter("gform_is_conditional_logic_field",function(a,b){return"administrative"==b.visibility?a=!1:b.id==GetSelectedField().id&&(a=!1),a});
\ No newline at end of file
diff --git a/js/forms.min.js b/js/forms.min.js
index 206ac94..4ef1c54 100644
--- a/js/forms.min.js
+++ b/js/forms.min.js
@@ -1 +1 @@
-function Form(){this.id=0,this.title=gf_vars.formTitle,this.description=gf_vars.formDescription,this.labelPlacement="top_label",this.subLabelPlacement="below",this.maxEntriesMessage="",this.confirmation=new Confirmation,this.button=new Button,this.fields=new Array}function Confirmation(){this.type="message",this.message=gf_vars.formConfirmationMessage,this.url="",this.pageId="",this.queryString=""}function Button(){this.type="text",this.text=gf_vars.buttonText,this.imageUrl=""}function Field(a,b){this.id=a,this.label="",this.adminLabel="",this.type=b,this.isRequired=!1,this.size="medium",this.errorMessage=""}function Choice(a,b,c){this.text=a,this.value=b?b:a,this.isSelected=!1,this.price=c?c:""}function Input(a,b){this.id=a,this.label=b,this.name=""}function ConditionalLogic(){this.actionType="show",this.logicType="all",this.rules=[new ConditionalRule]}function ConditionalRule(){this.fieldId=0,this.operator="is",this.value=""}
\ No newline at end of file
+function Form(){this.id=0,this.title=gf_vars.formTitle,this.description=gf_vars.formDescription,this.labelPlacement="top_label",this.subLabelPlacement="below",this.maxEntriesMessage="",this.confirmation=new Confirmation,this.button=new Button,this.fields=new Array}function Confirmation(){this.type="message",this.message=gf_vars.formConfirmationMessage,this.url="",this.pageId="",this.queryString=""}function Button(){this.type="text",this.text=gf_vars.buttonText,this.imageUrl=""}function Field(a,b){this.id=a,this.label="",this.adminLabel="",this.type=b,this.isRequired=!1,this.size="medium",this.errorMessage=""}function Choice(a,b,c){this.text=a,this.value=b||a,this.isSelected=!1,this.price=c||""}function Input(a,b){this.id=a,this.label=b,this.name=""}function ConditionalLogic(){this.actionType="show",this.logicType="all",this.rules=[new ConditionalRule]}function ConditionalRule(){this.fieldId=0,this.operator="is",this.value=""}
\ No newline at end of file
diff --git a/js/gf_field_filter.min.js b/js/gf_field_filter.min.js
index 5ce75aa..8a173e9 100644
--- a/js/gf_field_filter.min.js
+++ b/js/gf_field_filter.min.js
@@ -1 +1 @@
-!function(a,b){function c(a,c,e,f,g){v=b(a),v.css("position","relative").html('
'),D=g,B="undefined"!=typeof D&&D>0,w={is:"is",isnot:"isNot",">":"greaterThan","<":"lessThan",contains:"contains",starts_with:"startsWith",ends_with:"endsWith"},A=gf_vars.baseUrl+"/images",x=c,y=e&&e.filters?e.filters:[],z=e&&e.mode?e.mode:"all",C=!("undefined"!=typeof f&&!f),d(y)}function d(a){var c;if(v.on("change",".gform-filter-field",function(){h(this)}),v.on("click","#gform-no-filters",function(a){0==b(".gform-field-filter").length&&t(this),b(this).remove()}),v.on("click",".gform-add",function(){t(this)}),v.on("click",".gform-remove",function(){u(this)}),v.on("change",".gform-filter-operator",function(){g(this,this.value)}),"undefined"==typeof a||0==a.length)return void o();for("off"!=z&&b("#gform-field-filters").append(q(z)),c=0;c"}function f(){var a,b,c,d,e,f,g,h,j="",k=[];for(k.push(""),a=0;ab;b++)e=x[a].filters[b].text,d=x[a].filters[b].key,j=i(d)?'disabled="disabled"':"",g.push('{2} '.format(j,d,e));k.push('{1} '.format(f,g.join("")))}else j=x[a].preventMultiple&&i(c)?"disabled='disabled'":"",e=x[a].text,k.push('{2} '.format(j,c,e));return k.push(" "),k.push(" "),k.join("")}function g(a){var c=b(a),d=c.siblings(".gform-filter-field"),e=l(d.val());e&&c.siblings(".gform-filter-value").replaceWith(k(e,a.value)),p(),window.gformInitDatepicker&&gformInitDatepicker()}function h(a){var c=l(a.value);if(c){var d=b(a);d.siblings(".gform-filter-value").replaceWith(k(c)),d.siblings(".gform-filter-type").val(c.type),d.siblings(".gform-filter-operator").replaceWith(j(c)),d.siblings(".gform-filter-operator").change()}p()}function i(a){a=a.toString();var c=[];return b(".gform-filter-field :selected").each(function(a,d){c[a]=b(d).val()}),b.inArray(a,c)>-1}function j(a){var b,c,d="";if(a)for(b=0;b{1}'.format(c,gf_vars[w[c]]);return d+=" "}function k(a,c){var d,e,f,g,h,i,j="";if(i="gform-filter-value",a&&"undefined"!=typeof a.cssClass&&(i+=" "+a.cssClass),a&&a.values&&"contains"!=c){for("undefined"!=typeof a.placeholder&&(j+='{0} '.format(a.placeholder)),d=0;d{1}'.format(e,f));g="{1} ".format(i,j)}else h=a&&"undefined"!=typeof a.placeholder?"placeholder='{0}'".format(a.placeholder):"",g=" ".format(i,h);return g}function l(a){if(a)for(var b=0;b".format(A,gf_vars.addFieldFilter,gf_vars.addFieldFilter),a+=" "):a}function n(){if(B){var a=b("#gform-field-filters"),c=b(".gform-field-filter");if(c.length<=1)return void(b(v).hasClass("ui-resizable")&&v.resizable("destroy"));var d=a.get(0).scrollHeight>v.height()||v.height()>=D;d?(v.css({"min-height":D+"px","border-bottom":"5px double #DDD"}).resizable({handles:"s",minHeight:D}),a.css("min-height",D)):v.css({"min-height":"","border-bottom":""})}}function o(){var a="";a+="".format(A,gf_vars.addFieldFilter,gf_vars.addFieldFilter),b("#gform-field-filters").html(a),B&&(v.css({"min-height":"","border-bottom":""}),v.height(80),b("#gform-field-filters").css("min-height",""))}function p(){b("select.gform-filter-field option").removeAttr("disabled"),b("select.gform-filter-field").each(function(a){var c=l(this.value);"undefined"!=typeof c&&c.preventMultiple&&i(this.value)&&b("select.gform-filter-field option[value='"+this.value+"']:not(:selected)").attr("disabled","disabled")})}function q(a){var b;return b='{1} {3} '.format(r("all",a),gf_vars.all,r("any",a),gf_vars.any),b=gf_vars.filterAndAny.format(b)}function r(a,b){return a==b?'selected="selected"':""}function s(a){a.after(q())}function t(a){var c,d;c=b(a),d=c.is("img")?c.parent():c,d.after(e()),d.next("div").find(".gform-filter-field").change().find(".gform-filter-operator").change(),1==b(".gform-field-filter").length&&s(d),n()}function u(a){b(a).parent().remove(),0==b(".gform-field-filter").length&&o(),p(),n()}b.fn.gfFilterUI=function(a,b,d,e){return c(this,a,b,d,e),this};var v,w,x,y,z,A,B,C,D;String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})}}(window.gfFilterUI=window.gfFilterUI||{},jQuery);
\ No newline at end of file
+!function(a,b){function c(a,c,e,f,g){v=b(a),v.css("position","relative").html('
'),D=g,B=void 0!==D&&D>0,w={is:"is",isnot:"isNot",">":"greaterThan","<":"lessThan",contains:"contains",starts_with:"startsWith",ends_with:"endsWith"},A=gf_vars.baseUrl+"/images",x=c,y=e&&e.filters?e.filters:[],z=e&&e.mode?e.mode:"all",C=!(void 0!==f&&!f),d(y)}function d(a){var c;if(v.on("change",".gform-filter-field",function(){h(this)}),v.on("click","#gform-no-filters",function(a){0==b(".gform-field-filter").length&&t(this),b(this).remove()}),v.on("click",".gform-add",function(){t(this)}),v.on("click",".gform-remove",function(){u(this)}),v.on("change",".gform-filter-operator",function(){g(this,this.value)}),void 0===a||0==a.length)return void o();for("off"!=z&&b("#gform-field-filters").append(q(z)),c=0;c"}function f(){var a,b,c,d,e,f,g,h,j="",k=[];for(k.push(""),a=0;a{2}'.format(j,d,e));k.push('{1} '.format(f,g.join("")))}else j=x[a].preventMultiple&&i(c)?"disabled='disabled'":"",e=x[a].text,k.push('{2} '.format(j,c,e));return k.push(" "),k.push(" "),k.join("")}function g(a){var c=b(a),d=c.siblings(".gform-filter-field"),e=l(d.val());e&&c.siblings(".gform-filter-value").replaceWith(k(e,a.value)),p(),window.gformInitDatepicker&&gformInitDatepicker()}function h(a){var c=l(a.value);if(c){var d=b(a);d.siblings(".gform-filter-value").replaceWith(k(c)),d.siblings(".gform-filter-type").val(c.type),d.siblings(".gform-filter-operator").replaceWith(j(c)),d.siblings(".gform-filter-operator").change()}p()}function i(a){a=a.toString();var c=[];return b(".gform-filter-field :selected").each(function(a,d){c[a]=b(d).val()}),b.inArray(a,c)>-1}function j(a){var b,c,d="";if(a)for(b=0;b{1}'.format(c,gf_vars[w[c]]);return d+=" "}function k(a,c){var d,e,f,g,h,i,j="";if(i="gform-filter-value",a&&void 0!==a.cssClass&&(i+=" "+a.cssClass),a&&a.values&&"contains"!=c){for(void 0!==a.placeholder&&(j+='{0} '.format(a.placeholder)),d=0;d{1}'.format(e,f));g="{1} ".format(i,j)}else h=a&&void 0!==a.placeholder?"placeholder='{0}'".format(a.placeholder):"",g=" ".format(i,h);return g}function l(a){if(a)for(var b=0;b".format(A,gf_vars.addFieldFilter,gf_vars.addFieldFilter),a+=" "):a}function n(){if(B){var a=b("#gform-field-filters");if(b(".gform-field-filter").length<=1)return void(b(v).hasClass("ui-resizable")&&v.resizable("destroy"));a.get(0).scrollHeight>v.height()||v.height()>=D?(v.css({"min-height":D+"px","border-bottom":"5px double #DDD"}).resizable({handles:"s",minHeight:D}),a.css("min-height",D)):v.css({"min-height":"","border-bottom":""})}}function o(){var a="";a+="".format(A,gf_vars.addFieldFilter,gf_vars.addFieldFilter),b("#gform-field-filters").html(a),B&&(v.css({"min-height":"","border-bottom":""}),v.height(80),b("#gform-field-filters").css("min-height",""))}function p(){b("select.gform-filter-field option").removeAttr("disabled"),b("select.gform-filter-field").each(function(a){var c=l(this.value);void 0!==c&&c.preventMultiple&&i(this.value)&&b("select.gform-filter-field option[value='"+this.value+"']:not(:selected)").attr("disabled","disabled")})}function q(a){var b;return b='{1} {3} '.format(r("all",a),gf_vars.all,r("any",a),gf_vars.any),b=gf_vars.filterAndAny.format(b)}function r(a,b){return a==b?'selected="selected"':""}function s(a){a.after(q())}function t(a){var c,d;c=b(a),d=c.is("img")?c.parent():c,d.after(e()),d.next("div").find(".gform-filter-field").change().find(".gform-filter-operator").change(),1==b(".gform-field-filter").length&&s(d),n()}function u(a){b(a).parent().remove(),0==b(".gform-field-filter").length&&o(),p(),n()}b.fn.gfFilterUI=function(a,b,d,e){return c(this,a,b,d,e),this};var v,w,x,y,z,A,B,C,D;String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return void 0!==a[c]?a[c]:b})}}(window.gfFilterUI=window.gfFilterUI||{},jQuery);
\ No newline at end of file
diff --git a/js/gravityforms.js b/js/gravityforms.js
index 83ac94d..1df6f4b 100644
--- a/js/gravityforms.js
+++ b/js/gravityforms.js
@@ -269,7 +269,7 @@ function gformDeleteUploadedFile(formId, fieldId, deleteButton){
parent.find(".ginput_preview").eq(fileIndex).remove();
//displaying single file upload field
- parent.find('input[type="file"],#extensions_message,.validation_message').removeClass("gform_hidden");
+ parent.find('input[type="file"],.validation_message,#extensions_message_' + formId + '_' + fieldId).removeClass("gform_hidden");
//displaying post image label
parent.find(".ginput_post_image_file").show();
diff --git a/js/gravityforms.min.js b/js/gravityforms.min.js
index 15a6861..38c44d4 100644
--- a/js/gravityforms.min.js
+++ b/js/gravityforms.min.js
@@ -1 +1 @@
-function gformBindFormatPricingFields(){jQuery(".ginput_amount, .ginput_donation_amount").bind("change",function(){gformFormatPricingField(this)}),jQuery(".ginput_amount, .ginput_donation_amount").each(function(){gformFormatPricingField(this)})}function Currency(a){this.currency=a,this.toNumber=function(a){return this.isNumeric(a)?parseFloat(a):gformCleanNumber(a,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)},this.toMoney=function(a,b){if(b=b||!1,b||(a=gformCleanNumber(a,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)),a===!1)return"";a+="",negative="","-"==a[0]&&(a=parseFloat(a.substr(1)),negative="-"),money=this.numberFormat(a,this.currency.decimals,this.currency.decimal_separator,this.currency.thousand_separator),"0.00"==money&&(negative="");var c=this.currency.symbol_left?this.currency.symbol_left+this.currency.symbol_padding:"",d=this.currency.symbol_right?this.currency.symbol_padding+this.currency.symbol_right:"";return money=negative+this.htmlDecode(c)+money+this.htmlDecode(d),money},this.numberFormat=function(a,b,c,d,e){var e="undefined"==typeof e;a=(a+"").replace(",","").replace(" ","");var f=isFinite(+a)?+a:0,g=isFinite(+b)?Math.abs(b):0,h="undefined"==typeof d?",":d,i="undefined"==typeof c?".":c,j="",k=function(a,b){var c=Math.pow(10,b);return""+Math.round(a*c)/c};return"0"==b?(f+=1e-10,j=(""+Math.round(f)).split(".")):-1==b?j=(""+f).split("."):(f+=1e-10,j=k(f,g).split(".")),j[0].length>3&&(j[0]=j[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,h)),e&&(j[1]||"").length=-32768&&65535>=b?d.replace(c,String.fromCharCode(b)):d.replace(c,"");return d}}function gformCleanNumber(a,b,c,d){var e="",f="",g="",h=!1;a+=" ",a=a.replace(/&.*?;/g,""),a=a.replace(b,""),a=a.replace(c,"");for(var i=0;i=0&&parseInt(g)<=9||g==d?e+=g:"-"==g&&(h=!0);for(var i=0;i="0"&&"9">=g?f+=g:g==d&&(f+=".");return h&&(f="-"+f),gformIsNumber(f)?parseFloat(f):!1}function gformGetDecimalSeparator(a){var b;switch(a){case"currency":var c=new Currency(gf_global.gf_currency_config);b=c.currency.decimal_separator;break;case"decimal_comma":b=",";break;default:b="."}return b}function gformIsNumber(a){return!isNaN(parseFloat(a))&&isFinite(a)}function gformIsNumeric(a,b){switch(b){case"decimal_dot":var c=new RegExp("^(-?[0-9]{1,3}(?:,?[0-9]{3})*(?:.[0-9]+)?)$");return c.test(a);case"decimal_comma":var c=new RegExp("^(-?[0-9]{1,3}(?:.?[0-9]{3})*(?:,[0-9]+)?)$");return c.test(a)}return!1}function gformDeleteUploadedFile(a,b,c){var d=jQuery("#field_"+a+"_"+b),e=jQuery(c).parent().index();d.find(".ginput_preview").eq(e).remove(),d.find('input[type="file"],#extensions_message,.validation_message').removeClass("gform_hidden"),d.find(".ginput_post_image_file").show(),d.find('input[type="text"]').val("");var f=jQuery("#gform_uploaded_files_"+a).val();if(f){var g=jQuery.secureEvalJSON(f);if(g){var h="input_"+b,i=d.find("#gform_multifile_upload_"+a+"_"+b);if(i.length>0){g[h].splice(e,1);var j=i.data("settings"),k=j.gf_vars.max_files;jQuery("#"+j.gf_vars.message_id).html(""),g[h].length0){var f=e.next().val(),g=gformFormatMoney(b,!0);f!=b&&e.next().val(b).change(),g!=e.first().text()&&e.html(g)}}}function gformGetShippingPrice(a){var b=jQuery(".gfield_shipping_"+a+' input[type="hidden"], .gfield_shipping_'+a+" select, .gfield_shipping_"+a+" input:checked"),c=0;return 1!=b.length||gformIsHidden(b)||(c=b.attr("type")&&"hidden"==b.attr("type").toLowerCase()?b.val():gformGetPrice(b.val())),gformToNumber(c)}function gformGetFieldId(a){var b=jQuery(a).attr("id"),c=b.split("_");if(c.length<=0)return 0;var d=c[c.length-1];return d}function gformCalculateProductPrice(a,b){var c="_"+a+"_"+b;jQuery(".gfield_option"+c+", .gfield_shipping_"+a).find("select").each(function(){var b=jQuery(this),c=gformGetPrice(b.val()),d=b.attr("id").split("_")[2];b.children("option").each(function(){var b=jQuery(this),e=gformGetOptionLabel(b,b.val(),c,a,d);b.html(e)}),b.trigger("chosen:updated")}),jQuery(".gfield_option"+c).find(".gfield_checkbox").find("input:checkbox").each(function(){var b=jQuery(this),c=b.attr("id"),d=c.split("_")[2],e=c.replace("choice_","#label_"),f=jQuery(e),g=gformGetOptionLabel(f,b.val(),0,a,d);f.html(g)}),jQuery(".gfield_option"+c+", .gfield_shipping_"+a).find(".gfield_radio").each(function(){var b=0,c=jQuery(this),d=c.attr("id"),e=d.split("_")[2],f=c.find("input:radio:checked").val();f&&(b=gformGetPrice(f)),c.find("input:radio").each(function(){var c=jQuery(this),d=c.attr("id").replace("choice_","#label_"),f=jQuery(d);if(f){var g=gformGetOptionLabel(f,c.val(),b,a,e);f.html(g)}})});var d=gformGetBasePrice(a,b),e=gformGetProductQuantity(a,b);return e>0&&(jQuery(".gfield_option"+c).find("input:checked, select").each(function(){gformIsHidden(jQuery(this))||(d+=gformGetPrice(jQuery(this).val()))}),_anyProductSelected=!0),d*=e,d=Math.round(100*d)/100}function gformGetProductQuantity(a,b){if(!gformIsProductSelected(a,b))return 0;var c,d,e=jQuery("#ginput_quantity_"+a+"_"+b);if(e.length>0)c=e.val();else if(e=jQuery(".gfield_quantity_"+a+"_"+b+" :input"),c=1,e.length>0){c=e.val();var f=e.attr("id"),g=gf_get_input_id_by_html_id(f);d=gf_get_field_number_format(g,a,"value")}d||(d="currency");var h=gformGetDecimalSeparator(d);return c=gformCleanNumber(c,"","",h),c||(c=0),c}function gformIsProductSelected(a,b){var c="_"+a+"_"+b,d=jQuery("#ginput_base_price"+c+", .gfield_donation"+c+' input[type="text"], .gfield_product'+c+" .ginput_amount");return d.val()&&!gformIsHidden(d)?!0:(d=jQuery(".gfield_product"+c+" select, .gfield_product"+c+" input:checked, .gfield_donation"+c+" select, .gfield_donation"+c+" input:checked"),!(!d.val()||gformIsHidden(d)))}function gformGetBasePrice(a,b){var c="_"+a+"_"+b,d=0,e=jQuery("#ginput_base_price"+c+", .gfield_donation"+c+' input[type="text"], .gfield_product'+c+" .ginput_amount");if(e.length>0)d=e.val(),gformIsHidden(e)&&(d=0);else{e=jQuery(".gfield_product"+c+" select, .gfield_product"+c+" input:checked, .gfield_donation"+c+" select, .gfield_donation"+c+" input:checked");var f=e.val();f&&(f=f.split("|"),d=f.length>1?f[1]:0),gformIsHidden(e)&&(d=0)}var g=new Currency(gf_global.gf_currency_config);return d=g.toNumber(d),d===!1?0:d}function gformFormatMoney(a,b){if(!gf_global.gf_currency_config)return a;var c=new Currency(gf_global.gf_currency_config);return c.toMoney(a,b)}function gformFormatPricingField(a){if(gf_global.gf_currency_config){var b=new Currency(gf_global.gf_currency_config),c=b.toMoney(jQuery(a).val());jQuery(a).val(c)}}function gformToNumber(a){var b=new Currency(gf_global.gf_currency_config);return b.toNumber(a)}function gformGetPriceDifference(a,b){var c=parseFloat(b)-parseFloat(a);return price=gformFormatMoney(c,!0),c>0&&(price="+"+price),price}function gformGetOptionLabel(a,b,c,d,e){a=jQuery(a);var f=gformGetPrice(b),g=a.attr("price"),h=a.html().replace(//i,"").replace(g,""),i=gformGetPriceDifference(c,f);i=0==gformToNumber(i)?"":" "+i,a.attr("price",i);var j="option"==a[0].tagName.toLowerCase()?" "+i:""+i+" ",k=h+j;return window.gform_format_option_label&&(k=gform_format_option_label(k,h,j,c,f,d,e)),k}function gformGetProductIds(a,b){for(var c=jQuery(b).hasClass(a)?jQuery(b).attr("class").split(" "):jQuery(b).parents("."+a).attr("class").split(" "),d=0;d1&&c.toNumber(b[1])!==!1?c.toNumber(b[1]):0}function gformRegisterPriceField(a){_gformPriceFields[a.formId]||(_gformPriceFields[a.formId]=new Array);for(var b=0;b<_gformPriceFields[a.formId].length;b++)if(_gformPriceFields[a.formId][b]==a.productFieldId)return;_gformPriceFields[a.formId].push(a.productFieldId)}function gformInitPriceFields(){jQuery(".gfield_price").each(function(){var a=gformGetProductIds("gfield_price",this);gformRegisterPriceField(a),jQuery(this).on("change",'input[type="text"], input[type="number"], select',function(){var a=gformGetProductIds("gfield_price",this);0==a.formId&&(a=gformGetProductIds("gfield_shipping",this)),jQuery(document).trigger("gform_price_change",[a,this]),gformCalculateTotalPrice(a.formId)}),jQuery(this).on("click",'input[type="radio"], input[type="checkbox"]',function(){var a=gformGetProductIds("gfield_price",this);0==a.formId&&(a=gformGetProductIds("gfield_shipping",this)),jQuery(document).trigger("gform_price_change",[a,this]),gformCalculateTotalPrice(a.formId)})});for(formId in _gformPriceFields)_gformPriceFields.hasOwnProperty(formId)&&gformCalculateTotalPrice(formId)}function gformShowPasswordStrength(a){var b=jQuery("#"+a).val(),c=jQuery("#"+a+"_2").val(),d=gformPasswordStrength(b,c),e=window.gf_text["password_"+d];jQuery("#"+a+"_strength").val(d),jQuery("#"+a+"_strength_indicator").removeClass("blank mismatch short good bad strong").addClass(d).html(e)}function gformPasswordStrength(a,b){var c,d,e=0;return a.length<=0?"blank":a!=b&&b.length>0?"mismatch":a.length<4?"short":(a.match(/[0-9]/)&&(e+=10),a.match(/[a-z]/)&&(e+=26),a.match(/[A-Z]/)&&(e+=26),a.match(/[^a-zA-Z0-9]/)&&(e+=31),c=Math.log(Math.pow(e,a.length)),d=c/Math.LN2,40>d?"bad":56>d?"good":"strong")}function gformAddListItem(a,b){var c=jQuery(a);if(!c.hasClass("gfield_icon_disabled")){var d=c.parents(".gfield_list_group"),e=d.clone(),f=d.parents(".gfield_list_container"),g=e.find(":input:last").attr("tabindex");e.find("input, select, textarea").attr("tabindex",g).not(":checkbox, :radio").val(""),e.find(":checkbox, :radio").prop("checked",!1),e=gform.applyFilters("gform_list_item_pre_add",e,d),d.after(e),gformToggleIcons(f,b),gformAdjustClasses(f),gform.doAction("gform_list_post_item_add",e,f)}}function gformDeleteListItem(a,b){var c=jQuery(a),d=c.parents(".gfield_list_group"),e=d.parents(".gfield_list_container");d.remove(),gformToggleIcons(e,b),gformAdjustClasses(e),gform.doAction("gform_list_post_item_delete",e)}function gformAdjustClasses(a){var b=a.find(".gfield_list_group");b.each(function(a){var b=jQuery(this),c=(a+1)%2==0?"gfield_list_row_even":"gfield_list_row_odd";b.removeClass("gfield_list_row_odd gfield_list_row_even").addClass(c)})}function gformToggleIcons(a,b){var c=a.find(".gfield_list_group").length,d=a.find(".add_list_item");a.find(".delete_list_item").css("visibility",1==c?"hidden":"visible"),b>0&&c>=b?(d.data("title",a.find(".add_list_item").attr("title")),d.addClass("gfield_icon_disabled").attr("title","")):b>0&&(d.removeClass("gfield_icon_disabled"),d.data("title")&&d.attr("title",d.data("title")))}function gformMatchCard(a){var b=gformFindCardType(jQuery("#"+a).val()),c=jQuery("#"+a).parents(".gfield").find(".gform_card_icon_container");b?(jQuery(c).find(".gform_card_icon").removeClass("gform_card_icon_selected").addClass("gform_card_icon_inactive"),jQuery(c).find(".gform_card_icon_"+b).removeClass("gform_card_icon_inactive").addClass("gform_card_icon_selected")):jQuery(c).find(".gform_card_icon").removeClass("gform_card_icon_selected gform_card_icon_inactive")}function gformFindCardType(a){if(a.length<4)return!1;var b=window.gf_cc_rules,c=new Array;for(type in b)if(b.hasOwnProperty(type))for(i in b[type])if(b[type].hasOwnProperty(i)&&0===b[type][i].indexOf(a.substring(0,b[type][i].length))){c[c.length]=type;break}return 1==c.length?c[0].toLowerCase():!1}function gformToggleCreditCard(){jQuery("#gform_payment_method_creditcard").is(":checked")?jQuery(".gform_card_fields_container").slideDown():jQuery(".gform_card_fields_container").slideUp()}function gformInitChosenFields(a,b){return jQuery(a).each(function(){var a=jQuery(this);if("rtl"==jQuery("html").attr("dir")&&a.addClass("chosen-rtl chzn-rtl"),a.is(":visible")&&0==a.siblings(".chosen-container").length){var c=gform.applyFilters("gform_chosen_options",{no_results_text:b},a);a.chosen(c)}})}function gformInitCurrencyFormatFields(a){jQuery(a).each(function(){var a=jQuery(this);a.val(gformFormatMoney(jQuery(this).val()))}).change(function(a){jQuery(this).val(gformFormatMoney(jQuery(this).val()))})}function gformFormatNumber(a,b,c,d){if("undefined"==typeof c)if(window.gf_global){var e=new Currency(gf_global.gf_currency_config);c=e.currency.decimal_separator}else c=".";if("undefined"==typeof d)if(window.gf_global){var e=new Currency(gf_global.gf_currency_config);d=e.currency.thousand_separator}else d=",";var e=new Currency;return e.numberFormat(a,b,c,d,!1)}function gformToNumber(a){var b=new Currency(gf_global.gf_currency_config);return b.toNumber(a)}function getMatchGroups(a,b){for(var c=new Array;b.test(a);){var d=c.length;c[d]=b.exec(a),a=a.replace(""+c[d][0],"")}return c}function gf_get_field_number_format(a,b,c){var d=rgars(window,"gf_global/number_formats/{0}/{1}".format(b,a)),e=!1;return""===d?e:e="undefined"==typeof c?d.price!==!1?d.price:d.value:d[c]}function renderRecaptcha(){jQuery(".ginput_recaptcha").each(function(){var a=jQuery(this),b={sitekey:a.data("sitekey"),theme:a.data("theme")};a.is(":empty")&&(a.data("stoken")&&(b.stoken=a.data("stoken")),grecaptcha.render(this.id,b),gform.doAction("gform_post_recaptcha_render",a))})}function gformValidateFileSize(a,b){if(jQuery(a).closest("div").siblings(".validation_message").length>0)var c=jQuery(a).closest("div").siblings(".validation_message");else var c=jQuery(a).siblings(".validation_message");if(window.FileReader&&window.File&&window.FileList&&window.Blob){var d=a.files[0];if(d.size>b){c.html(d.name+" - "+gform_gravityforms.strings.file_exceeds_limit);var e=jQuery(a);e.replaceWith(e.val("").clone(!0))}else c.html("")}}function gformInitSpinner(a,b){jQuery("#gform_"+a).submit(function(){gformAddSpinner(a,b)})}function gformAddSpinner(a,b){if("undefined"!=typeof b&&b||(b=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,a)),0==jQuery("#gform_ajax_spinner_"+a).length){var c=gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+a+", #gform_wrapper_"+a+" .gform_next_button, #gform_send_resume_link_button_"+a),a);c.after(' ')}}function gf_raw_input_change(a,b){clearTimeout(__gf_keyup_timeout);var c=jQuery(b),d=c.attr("id"),e=gf_get_input_id_by_html_id(d),f=gf_get_form_id_by_html_id(d);if(e){var g=c.is(":checkbox")||c.is(":radio")||c.is("select"),h=!g||c.is("textarea");("keyup"!=a.type||h)&&("change"!=a.type||g||h)&&("keyup"==a.type?__gf_keyup_timeout=setTimeout(function(){gf_input_change(this,f,e)},300):gf_input_change(this,f,e))}}function gf_get_input_id_by_html_id(a){var b=gf_get_ids_by_html_id(a),c=b[2];return b[3]&&(c+="."+b[3]),c}function gf_get_form_id_by_html_id(a){var b=gf_get_ids_by_html_id(a),c=b[1];return c}function gf_get_ids_by_html_id(a){var b=a?a.split("_"):!1;return b}function gf_input_change(a,b,c){gform.doAction("gform_input_change",a,b,c)}function gformExtractFieldId(a){var b=parseInt(a.toString().split(".")[0]);return b?b:a}function gformExtractInputIndex(a){var b=parseInt(a.toString().split(".")[1]);return b?b:!1}function rgars(a,b){for(var c=b.split("/"),d=a,e=0;e1||"checkbox"==h.prop("type"))&&(h=h.filter(":checked"));var j=window.gf_check_field_rule?"show"==gf_check_field_rule(a,f,!0,""):!0;if(h.length>0&&j){var k=h.val();k=k.split("|"),g=k.length>1?k[1]:h.val()}var l=gf_get_field_number_format(f,a);l||(l=gf_get_field_number_format(c.field_id,a));var m=gformGetDecimalSeparator(l);g=gform.applyFilters("gform_merge_tag_value_pre_calculation",g,d[i],j,c,a),g=gformCleanNumber(g,"","",m),g||(g=0),b=b.replace(d[i][0],g)}return b},this.init(formId,formulaFields)},gform={hooks:{action:{},filter:{}},addAction:function(a,b,c,d){gform.addHook("action",a,b,c,d)},addFilter:function(a,b,c,d){gform.addHook("filter",a,b,c,d)},doAction:function(a){gform.doHook("action",a,arguments)},applyFilters:function(a){return gform.doHook("filter",a,arguments)},removeAction:function(a,b){gform.removeHook("action",a,b)},removeFilter:function(a,b,c){gform.removeHook("filter",a,b,c)},addHook:function(a,b,c,d,e){void 0==gform.hooks[a][b]&&(gform.hooks[a][b]=[]);var f=gform.hooks[a][b];void 0==e&&(e=b+"_"+f.length),void 0==d&&(d=10),gform.hooks[a][b].push({tag:e,callable:c,priority:d})},doHook:function(a,b,c){if(c=Array.prototype.slice.call(c,1),void 0!=gform.hooks[a][b]){var d,e=gform.hooks[a][b];e.sort(function(a,b){return a.priority-b.priority});for(var f=0;f=0;f--)void 0!=d&&d!=e[f].tag||void 0!=c&&c!=e[f].priority||e.splice(f,1)}};!function(a,b){function c(c){function g(a,c){b("#"+a).prepend(""+c+" ")}function h(){var a,c="#gform_uploaded_files_"+q,d=b(c);return a=d.val(),a="undefined"==typeof a||""===a?{}:b.parseJSON(a)}function i(a){var b=h(),c=m(a);return"undefined"==typeof b[c]&&(b[c]=[]),b[c]}function j(a){var b=i(a);return b.length}function k(a,b){var c=i(a);c.unshift(b),l(a,c)}function l(a,c){var d=h(),e=b("#gform_uploaded_files_"+q),f=m(a);d[f]=c,e.val(b.toJSON(d))}function m(a){return"input_"+a}function n(a){a.preventDefault()}var o=b(c).data("settings"),p=new plupload.Uploader(o);q=p.settings.multipart_params.form_id,a.uploaders[o.container]=p;var q,r;p.bind("Init",function(c,d){c.features.dragdrop||b(".gform_drop_instructions").hide();var e=c.settings.multipart_params.field_id,f=parseInt(c.settings.gf_vars.max_files),g=j(e);f>0&&g>=f&&a.toggleDisabled(c.settings,!0)}),a.toggleDisabled=function(a,c){var d=b("string"==typeof a.browse_button?"#"+a.browse_button:a.browse_button);d.prop("disabled",c)},p.init(),p.bind("FilesAdded",function(c,f){var h,i=parseInt(c.settings.gf_vars.max_files),k=c.settings.multipart_params.field_id,l=j(k),m=c.settings.gf_vars.disallowed_extensions;if(i>0&&l>=i)return void b.each(f,function(a,b){c.removeFile(b)});b.each(f,function(a,d){if(h=d.name.split(".").pop(),b.inArray(h,m)>-1)return g(c.settings.gf_vars.message_id,d.name+" - "+e.illegal_extension),void c.removeFile(d);if(d.status==plupload.FAILED||i>0&&l>=i)return void c.removeFile(d);var f="undefined"!=typeof d.size?plupload.formatSize(d.size):e.in_progress,j='";b("#"+c.settings.filelist).prepend(j),l++}),c.refresh();var n="form#gform_"+q,o="input:hidden[name='gform_unique_id']",p=n+" "+o,s=b(p);0==s.length&&(s=b(o)),r=s.val(),""===r&&(r=d(),s.val(r)),i>0&&l>=i&&(a.toggleDisabled(c.settings,!0),g(c.settings.gf_vars.message_id,e.max_reached)),c.settings.multipart_params.gform_unique_id=r,c.start()}),p.bind("UploadProgress",function(a,c){var d=c.percent+"%";b("#"+c.id+" b").html(d)}),p.bind("Error",function(a,c){if(c.code===plupload.FILE_EXTENSION_ERROR){var d="undefined"!=typeof a.settings.filters.mime_types?a.settings.filters.mime_types[0].extensions:a.settings.filters[0].extensions;g(a.settings.gf_vars.message_id,c.file.name+" - "+e.invalid_file_extension+" "+d)}else if(c.code===plupload.FILE_SIZE_ERROR)g(a.settings.gf_vars.message_id,c.file.name+" - "+e.file_exceeds_limit);else{var f="Error: "+c.code+", Message: "+c.message+(c.file?", File: "+c.file.name:"")+" ";g(a.settings.gf_vars.message_id,f)}b("#"+c.file.id).html(""),a.refresh()}),p.bind("FileUploaded",function(a,c,d){var h=b.secureEvalJSON(d.response);if("error"==h.status)return g(a.settings.gf_vars.message_id,c.name+" - "+h.error.message),void b("#"+c.id).html("");var i=""+c.name+" ",j=a.settings.multipart_params.form_id,l=a.settings.multipart_params.field_id;i=" "+i,i=gform.applyFilters("gform_file_upload_markup",i,c,a,e,f),b("#"+c.id).html(i);var m=a.settings.multipart_params.field_id;100==c.percent&&(h.status&&"ok"==h.status?k(m,h.data):g(a.settings.gf_vars.message_id,e.unknown_error+": "+c.name))}),b("#"+o.drop_element).on({dragenter:n,dragover:n})}function d(){return"xxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})}a.uploaders={};var e="undefined"!=typeof gform_gravityforms?gform_gravityforms.strings:{},f="undefined"!=typeof gform_gravityforms?gform_gravityforms.vars.images_url:"";b(document).bind("gform_post_render",function(d,f){b("form#gform_"+f+" .gform_fileupload_multifile").each(function(){c(this)});var g=b("form#gform_"+f);g.length>0&&g.submit(function(){var c=!1;return b.each(a.uploaders,function(a,b){return b.total.queued>0?(c=!0,!1):void 0}),c?(alert(e.currently_uploading),window["gf_submitting_"+f]=!1,b("#gform_ajax_spinner_"+f).remove(),!1):void 0})}),b(document).bind("gform_post_conditional_logic",function(c,d,e,f){f||b.each(a.uploaders,function(a,b){b.refresh()})}),b(document).ready(function(){"undefined"!=typeof adminpage&&"toplevel_page_gf_edit_forms"===adminpage||"undefined"==typeof plupload?b(".gform_button_select_files").prop("disabled",!0):"undefined"!=typeof adminpage&&adminpage.indexOf("_page_gf_entries")>-1&&b(".gform_fileupload_multifile").each(function(){c(this)})}),a.setup=function(a){c(a)}}(window.gfMultiFileUploader=window.gfMultiFileUploader||{},jQuery);var __gf_keyup_timeout;jQuery(document).on("change keyup",".gfield_trigger_change input, .gfield_trigger_change select, .gfield_trigger_change textarea",function(a){gf_raw_input_change(a,this)}),!window.rgars,!window.rgar,String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})};
\ No newline at end of file
+function gformBindFormatPricingFields(){jQuery(".ginput_amount, .ginput_donation_amount").bind("change",function(){gformFormatPricingField(this)}),jQuery(".ginput_amount, .ginput_donation_amount").each(function(){gformFormatPricingField(this)})}function Currency(a){this.currency=a,this.toNumber=function(a){return this.isNumeric(a)?parseFloat(a):gformCleanNumber(a,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)},this.toMoney=function(a,b){if(b=b||!1,b||(a=gformCleanNumber(a,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)),!1===a)return"";a+="",negative="","-"==a[0]&&(a=parseFloat(a.substr(1)),negative="-"),money=this.numberFormat(a,this.currency.decimals,this.currency.decimal_separator,this.currency.thousand_separator),"0.00"==money&&(negative="");var c=this.currency.symbol_left?this.currency.symbol_left+this.currency.symbol_padding:"",d=this.currency.symbol_right?this.currency.symbol_padding+this.currency.symbol_right:"";return money=negative+this.htmlDecode(c)+money+this.htmlDecode(d),money},this.numberFormat=function(a,b,c,d,e){var e=void 0===e;a=(a+"").replace(",","").replace(" ","");var f=isFinite(+a)?+a:0,g=isFinite(+b)?Math.abs(b):0,h=void 0===d?",":d,i=void 0===c?".":c,j="",k=function(a,b){var c=Math.pow(10,b);return""+Math.round(a*c)/c};return"0"==b?(f+=1e-10,j=(""+Math.round(f)).split(".")):-1==b?j=(""+f).split("."):(f+=1e-10,j=k(f,g).split(".")),j[0].length>3&&(j[0]=j[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,h)),e&&(j[1]||"").length=-32768&&b<=65535?d.replace(c,String.fromCharCode(b)):d.replace(c,"");return d}}function gformCleanNumber(a,b,c,d){var e="",f="",g="",h=!1;a+=" ",a=a.replace(/&.*?;/g,""),a=a.replace(b,""),a=a.replace(c,"");for(var i=0;i=0&&parseInt(g)<=9||g==d?e+=g:"-"==g&&(h=!0);for(var i=0;i="0"&&g<="9"?f+=g:g==d&&(f+=".");return h&&(f="-"+f),!!gformIsNumber(f)&&parseFloat(f)}function gformGetDecimalSeparator(a){var b;switch(a){case"currency":b=new Currency(gf_global.gf_currency_config).currency.decimal_separator;break;case"decimal_comma":b=",";break;default:b="."}return b}function gformIsNumber(a){return!isNaN(parseFloat(a))&&isFinite(a)}function gformIsNumeric(a,b){switch(b){case"decimal_dot":var c=new RegExp("^(-?[0-9]{1,3}(?:,?[0-9]{3})*(?:.[0-9]+)?)$");return c.test(a);case"decimal_comma":var c=new RegExp("^(-?[0-9]{1,3}(?:.?[0-9]{3})*(?:,[0-9]+)?)$");return c.test(a)}return!1}function gformDeleteUploadedFile(a,b,c){var d=jQuery("#field_"+a+"_"+b),e=jQuery(c).parent().index();d.find(".ginput_preview").eq(e).remove(),d.find('input[type="file"],.validation_message,#extensions_message_'+a+"_"+b).removeClass("gform_hidden"),d.find(".ginput_post_image_file").show(),d.find('input[type="text"]').val("");var f=jQuery("#gform_uploaded_files_"+a).val();if(f){var g=jQuery.secureEvalJSON(f);if(g){var h="input_"+b,i=d.find("#gform_multifile_upload_"+a+"_"+b);if(i.length>0){g[h].splice(e,1);var j=i.data("settings"),k=j.gf_vars.max_files;jQuery("#"+j.gf_vars.message_id).html(""),g[h].length0){var e=d.next().val(),f=gformFormatMoney(b,!0);e!=b&&d.next().val(b).change(),f!=d.first().text()&&d.html(f)}}}function gformGetShippingPrice(a){var b=jQuery(".gfield_shipping_"+a+' input[type="hidden"], .gfield_shipping_'+a+" select, .gfield_shipping_"+a+" input:checked"),c=0;return 1!=b.length||gformIsHidden(b)||(c=b.attr("type")&&"hidden"==b.attr("type").toLowerCase()?b.val():gformGetPrice(b.val())),gformToNumber(c)}function gformGetFieldId(a){var b=jQuery(a).attr("id"),c=b.split("_");return c.length<=0?0:c[c.length-1]}function gformCalculateProductPrice(a,b){var c="_"+a+"_"+b;jQuery(".gfield_option"+c+", .gfield_shipping_"+a).find("select").each(function(){var b=jQuery(this),c=gformGetPrice(b.val()),d=b.attr("id").split("_")[2];b.children("option").each(function(){var b=jQuery(this),e=gformGetOptionLabel(b,b.val(),c,a,d);b.html(e)}),b.trigger("chosen:updated")}),jQuery(".gfield_option"+c).find(".gfield_checkbox").find("input:checkbox").each(function(){var b=jQuery(this),c=b.attr("id"),d=c.split("_")[2],e=c.replace("choice_","#label_"),f=jQuery(e),g=gformGetOptionLabel(f,b.val(),0,a,d);f.html(g)}),jQuery(".gfield_option"+c+", .gfield_shipping_"+a).find(".gfield_radio").each(function(){var b=0,c=jQuery(this),d=c.attr("id"),e=d.split("_")[2],f=c.find("input:radio:checked").val();f&&(b=gformGetPrice(f)),c.find("input:radio").each(function(){var c=jQuery(this),d=c.attr("id").replace("choice_","#label_"),f=jQuery(d);if(f){var g=gformGetOptionLabel(f,c.val(),b,a,e);f.html(g)}})});var d=gformGetBasePrice(a,b),e=gformGetProductQuantity(a,b);return e>0&&(jQuery(".gfield_option"+c).find("input:checked, select").each(function(){gformIsHidden(jQuery(this))||(d+=gformGetPrice(jQuery(this).val()))}),_anyProductSelected=!0),d*=e,d=Math.round(100*d)/100}function gformGetProductQuantity(a,b){if(!gformIsProductSelected(a,b))return 0;var c,d,e=jQuery("#ginput_quantity_"+a+"_"+b);if(e.length>0)c=e.val();else if(e=jQuery(".gfield_quantity_"+a+"_"+b+" :input"),c=1,e.length>0){c=e.val();var f=e.attr("id"),g=gf_get_input_id_by_html_id(f);d=gf_get_field_number_format(g,a,"value")}return d||(d="currency"),c=gformCleanNumber(c,"","",gformGetDecimalSeparator(d)),c||(c=0),c}function gformIsProductSelected(a,b){var c="_"+a+"_"+b,d=jQuery("#ginput_base_price"+c+", .gfield_donation"+c+' input[type="text"], .gfield_product'+c+" .ginput_amount");return!(!d.val()||gformIsHidden(d))||(d=jQuery(".gfield_product"+c+" select, .gfield_product"+c+" input:checked, .gfield_donation"+c+" select, .gfield_donation"+c+" input:checked"),!(!d.val()||gformIsHidden(d)))}function gformGetBasePrice(a,b){var c="_"+a+"_"+b,d=0,e=jQuery("#ginput_base_price"+c+", .gfield_donation"+c+' input[type="text"], .gfield_product'+c+" .ginput_amount");if(e.length>0)d=e.val(),gformIsHidden(e)&&(d=0);else{e=jQuery(".gfield_product"+c+" select, .gfield_product"+c+" input:checked, .gfield_donation"+c+" select, .gfield_donation"+c+" input:checked");var f=e.val();f&&(f=f.split("|"),d=f.length>1?f[1]:0),gformIsHidden(e)&&(d=0)}return d=new Currency(gf_global.gf_currency_config).toNumber(d),!1===d?0:d}function gformFormatMoney(a,b){return gf_global.gf_currency_config?new Currency(gf_global.gf_currency_config).toMoney(a,b):a}function gformFormatPricingField(a){if(gf_global.gf_currency_config){var b=new Currency(gf_global.gf_currency_config),c=b.toMoney(jQuery(a).val());jQuery(a).val(c)}}function gformToNumber(a){return new Currency(gf_global.gf_currency_config).toNumber(a)}function gformGetPriceDifference(a,b){var c=parseFloat(b)-parseFloat(a);return price=gformFormatMoney(c,!0),c>0&&(price="+"+price),price}function gformGetOptionLabel(a,b,c,d,e){a=jQuery(a);var f=gformGetPrice(b),g=a.attr("price"),h=a.html().replace(//i,"").replace(g,""),i=gformGetPriceDifference(c,f);i=0==gformToNumber(i)?"":" "+i,a.attr("price",i);var j="option"==a[0].tagName.toLowerCase()?" "+i:""+i+" ",k=h+j;return window.gform_format_option_label&&(k=gform_format_option_label(k,h,j,c,f,d,e)),k}function gformGetProductIds(a,b){for(var c=jQuery(b).hasClass(a)?jQuery(b).attr("class").split(" "):jQuery(b).parents("."+a).attr("class").split(" "),d=0;d1&&!1!==c.toNumber(b[1])?c.toNumber(b[1]):0}function gformRegisterPriceField(a){_gformPriceFields[a.formId]||(_gformPriceFields[a.formId]=new Array);for(var b=0;b<_gformPriceFields[a.formId].length;b++)if(_gformPriceFields[a.formId][b]==a.productFieldId)return;_gformPriceFields[a.formId].push(a.productFieldId)}function gformInitPriceFields(){jQuery(".gfield_price").each(function(){gformRegisterPriceField(gformGetProductIds("gfield_price",this)),jQuery(this).on("change",'input[type="text"], input[type="number"], select',function(){var a=gformGetProductIds("gfield_price",this);0==a.formId&&(a=gformGetProductIds("gfield_shipping",this)),jQuery(document).trigger("gform_price_change",[a,this]),gformCalculateTotalPrice(a.formId)}),jQuery(this).on("click",'input[type="radio"], input[type="checkbox"]',function(){var a=gformGetProductIds("gfield_price",this);0==a.formId&&(a=gformGetProductIds("gfield_shipping",this)),jQuery(document).trigger("gform_price_change",[a,this]),gformCalculateTotalPrice(a.formId)})});for(formId in _gformPriceFields)_gformPriceFields.hasOwnProperty(formId)&&gformCalculateTotalPrice(formId)}function gformShowPasswordStrength(a){var b=jQuery("#"+a).val(),c=jQuery("#"+a+"_2").val(),d=gformPasswordStrength(b,c),e=window.gf_text["password_"+d];jQuery("#"+a+"_strength").val(d),jQuery("#"+a+"_strength_indicator").removeClass("blank mismatch short good bad strong").addClass(d).html(e)}function gformPasswordStrength(a,b){var c,d,e=0;return a.length<=0?"blank":a!=b&&b.length>0?"mismatch":a.length<4?"short":(a.match(/[0-9]/)&&(e+=10),a.match(/[a-z]/)&&(e+=26),a.match(/[A-Z]/)&&(e+=26),a.match(/[^a-zA-Z0-9]/)&&(e+=31),c=Math.log(Math.pow(e,a.length)),d=c/Math.LN2,d<40?"bad":d<56?"good":"strong")}function gformAddListItem(a,b){var c=jQuery(a);if(!c.hasClass("gfield_icon_disabled")){var d=c.parents(".gfield_list_group"),e=d.clone(),f=d.parents(".gfield_list_container"),g=e.find(":input:last").attr("tabindex");e.find("input, select, textarea").attr("tabindex",g).not(":checkbox, :radio").val(""),e.find(":checkbox, :radio").prop("checked",!1),e=gform.applyFilters("gform_list_item_pre_add",e,d),d.after(e),gformToggleIcons(f,b),gformAdjustClasses(f),gform.doAction("gform_list_post_item_add",e,f)}}function gformDeleteListItem(a,b){var c=jQuery(a),d=c.parents(".gfield_list_group"),e=d.parents(".gfield_list_container");d.remove(),gformToggleIcons(e,b),gformAdjustClasses(e),gform.doAction("gform_list_post_item_delete",e)}function gformAdjustClasses(a){a.find(".gfield_list_group").each(function(a){var b=jQuery(this),c=(a+1)%2==0?"gfield_list_row_even":"gfield_list_row_odd";b.removeClass("gfield_list_row_odd gfield_list_row_even").addClass(c)})}function gformToggleIcons(a,b){var c=a.find(".gfield_list_group").length,d=a.find(".add_list_item");a.find(".delete_list_item").css("visibility",1==c?"hidden":"visible"),b>0&&c>=b?(d.data("title",a.find(".add_list_item").attr("title")),d.addClass("gfield_icon_disabled").attr("title","")):b>0&&(d.removeClass("gfield_icon_disabled"),d.data("title")&&d.attr("title",d.data("title")))}function gformMatchCard(a){var b=gformFindCardType(jQuery("#"+a).val()),c=jQuery("#"+a).parents(".gfield").find(".gform_card_icon_container");b?(jQuery(c).find(".gform_card_icon").removeClass("gform_card_icon_selected").addClass("gform_card_icon_inactive"),jQuery(c).find(".gform_card_icon_"+b).removeClass("gform_card_icon_inactive").addClass("gform_card_icon_selected")):jQuery(c).find(".gform_card_icon").removeClass("gform_card_icon_selected gform_card_icon_inactive")}function gformFindCardType(a){if(a.length<4)return!1;var b=window.gf_cc_rules,c=new Array;for(type in b)if(b.hasOwnProperty(type))for(i in b[type])if(b[type].hasOwnProperty(i)&&0===b[type][i].indexOf(a.substring(0,b[type][i].length))){c[c.length]=type;break}return 1==c.length&&c[0].toLowerCase()}function gformToggleCreditCard(){jQuery("#gform_payment_method_creditcard").is(":checked")?jQuery(".gform_card_fields_container").slideDown():jQuery(".gform_card_fields_container").slideUp()}function gformInitChosenFields(a,b){return jQuery(a).each(function(){var a=jQuery(this);if("rtl"==jQuery("html").attr("dir")&&a.addClass("chosen-rtl chzn-rtl"),a.is(":visible")&&0==a.siblings(".chosen-container").length){var c=gform.applyFilters("gform_chosen_options",{no_results_text:b},a);a.chosen(c)}})}function gformInitCurrencyFormatFields(a){jQuery(a).each(function(){jQuery(this).val(gformFormatMoney(jQuery(this).val()))}).change(function(a){jQuery(this).val(gformFormatMoney(jQuery(this).val()))})}function gformFormatNumber(a,b,c,d){if(void 0===c)if(window.gf_global){var e=new Currency(gf_global.gf_currency_config);c=e.currency.decimal_separator}else c=".";if(void 0===d)if(window.gf_global){var e=new Currency(gf_global.gf_currency_config);d=e.currency.thousand_separator}else d=",";var e=new Currency;return e.numberFormat(a,b,c,d,!1)}function gformToNumber(a){return new Currency(gf_global.gf_currency_config).toNumber(a)}function getMatchGroups(a,b){for(var c=new Array;b.test(a);){var d=c.length;c[d]=b.exec(a),a=a.replace(""+c[d][0],"")}return c}function gf_get_field_number_format(a,b,c){var d=rgars(window,"gf_global/number_formats/{0}/{1}".format(b,a)),e=!1;return""===d?e:e=void 0===c?!1!==d.price?d.price:d.value:d[c]}function renderRecaptcha(){jQuery(".ginput_recaptcha").each(function(){var a=jQuery(this),b={sitekey:a.data("sitekey"),theme:a.data("theme")};a.is(":empty")&&(a.data("stoken")&&(b.stoken=a.data("stoken")),grecaptcha.render(this.id,b),gform.doAction("gform_post_recaptcha_render",a))})}function gformValidateFileSize(a,b){if(jQuery(a).closest("div").siblings(".validation_message").length>0)var c=jQuery(a).closest("div").siblings(".validation_message");else var c=jQuery(a).siblings(".validation_message");if(window.FileReader&&window.File&&window.FileList&&window.Blob){var d=a.files[0];if(d.size>b){c.html(d.name+" - "+gform_gravityforms.strings.file_exceeds_limit);var e=jQuery(a);e.replaceWith(e.val("").clone(!0))}else c.html("")}}function gformInitSpinner(a,b){jQuery("#gform_"+a).submit(function(){gformAddSpinner(a,b)})}function gformAddSpinner(a,b){if(void 0!==b&&b||(b=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,a)),0==jQuery("#gform_ajax_spinner_"+a).length){gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+a+", #gform_wrapper_"+a+" .gform_next_button, #gform_send_resume_link_button_"+a),a).after(' ')}}function gf_raw_input_change(a,b){clearTimeout(__gf_keyup_timeout);var c=jQuery(b),d=c.attr("id"),e=gf_get_input_id_by_html_id(d),f=gf_get_form_id_by_html_id(d);if(e){var g=c.is(":checkbox")||c.is(":radio")||c.is("select"),h=!g||c.is("textarea");("keyup"!=a.type||h)&&("change"!=a.type||g||h)&&("keyup"==a.type?__gf_keyup_timeout=setTimeout(function(){gf_input_change(this,f,e)},300):gf_input_change(this,f,e))}}function gf_get_input_id_by_html_id(a){var b=gf_get_ids_by_html_id(a),c=b[2];return b[3]&&(c+="."+b[3]),c}function gf_get_form_id_by_html_id(a){return gf_get_ids_by_html_id(a)[1]}function gf_get_ids_by_html_id(a){return!!a&&a.split("_")}function gf_input_change(a,b,c){gform.doAction("gform_input_change",a,b,c)}function gformExtractFieldId(a){var b=parseInt(a.toString().split(".")[0]);return b||a}function gformExtractInputIndex(a){var b=parseInt(a.toString().split(".")[1]);return b||!1}function rgars(a,b){for(var c=b.split("/"),d=a,e=0;e1||"checkbox"==h.prop("type"))&&(h=h.filter(":checked"));var j=!window.gf_check_field_rule||"show"==gf_check_field_rule(a,f,!0,"");if(h.length>0&&j){var k=h.val();k=k.split("|"),g=k.length>1?k[1]:h.val()}var l=gf_get_field_number_format(f,a);l||(l=gf_get_field_number_format(c.field_id,a));var m=gformGetDecimalSeparator(l);g=gform.applyFilters("gform_merge_tag_value_pre_calculation",g,d[i],j,c,a),g=gformCleanNumber(g,"","",m),g||(g=0),b=b.replace(d[i][0],g)}return b},this.init(formId,formulaFields)},gform={hooks:{action:{},filter:{}},addAction:function(a,b,c,d){gform.addHook("action",a,b,c,d)},addFilter:function(a,b,c,d){gform.addHook("filter",a,b,c,d)},doAction:function(a){gform.doHook("action",a,arguments)},applyFilters:function(a){return gform.doHook("filter",a,arguments)},removeAction:function(a,b){gform.removeHook("action",a,b)},removeFilter:function(a,b,c){gform.removeHook("filter",a,b,c)},addHook:function(a,b,c,d,e){void 0==gform.hooks[a][b]&&(gform.hooks[a][b]=[]);var f=gform.hooks[a][b];void 0==e&&(e=b+"_"+f.length),void 0==d&&(d=10),gform.hooks[a][b].push({tag:e,callable:c,priority:d})},doHook:function(a,b,c){if(c=Array.prototype.slice.call(c,1),void 0!=gform.hooks[a][b]){var d,e=gform.hooks[a][b];e.sort(function(a,b){return a.priority-b.priority});for(var f=0;f=0;f--)void 0!=d&&d!=e[f].tag||void 0!=c&&c!=e[f].priority||e.splice(f,1)}};!function(a,b){function c(c){function g(a,c){b("#"+a).prepend(""+c+" ")}function h(){var a,c="#gform_uploaded_files_"+q,d=b(c);return a=d.val(),a=void 0===a||""===a?{}:b.parseJSON(a)}function i(a){var b=h(),c=m(a);return void 0===b[c]&&(b[c]=[]),b[c]}function j(a){return i(a).length}function k(a,b){var c=i(a);c.unshift(b),l(a,c)}function l(a,c){var d=h(),e=b("#gform_uploaded_files_"+q);d[m(a)]=c,e.val(b.toJSON(d))}function m(a){return"input_"+a}function n(a){a.preventDefault()}var o=b(c).data("settings"),p=new plupload.Uploader(o);q=p.settings.multipart_params.form_id,a.uploaders[o.container]=p;var q,r;p.bind("Init",function(c,d){c.features.dragdrop||b(".gform_drop_instructions").hide();var e=c.settings.multipart_params.field_id,f=parseInt(c.settings.gf_vars.max_files),g=j(e);f>0&&g>=f&&a.toggleDisabled(c.settings,!0)}),a.toggleDisabled=function(a,c){b("string"==typeof a.browse_button?"#"+a.browse_button:a.browse_button).prop("disabled",c)},p.init(),p.bind("FilesAdded",function(c,f){var h,i=parseInt(c.settings.gf_vars.max_files),k=c.settings.multipart_params.field_id,l=j(k),m=c.settings.gf_vars.disallowed_extensions;if(i>0&&l>=i)return void b.each(f,function(a,b){c.removeFile(b)});b.each(f,function(a,d){if(h=d.name.split(".").pop(),b.inArray(h,m)>-1)return g(c.settings.gf_vars.message_id,d.name+" - "+e.illegal_extension),void c.removeFile(d);if(d.status==plupload.FAILED||i>0&&l>=i)return void c.removeFile(d);var f=void 0!==d.size?plupload.formatSize(d.size):e.in_progress,j='";b("#"+c.settings.filelist).prepend(j),l++}),c.refresh();var n="form#gform_"+q,o="input:hidden[name='gform_unique_id']",p=n+" "+o,s=b(p);0==s.length&&(s=b(o)),r=s.val(),""===r&&(r=d(),s.val(r)),i>0&&l>=i&&(a.toggleDisabled(c.settings,!0),g(c.settings.gf_vars.message_id,e.max_reached)),c.settings.multipart_params.gform_unique_id=r,c.start()}),p.bind("UploadProgress",function(a,c){var d=c.percent+"%";b("#"+c.id+" b").html(d)}),p.bind("Error",function(a,c){if(c.code===plupload.FILE_EXTENSION_ERROR){var d=void 0!==a.settings.filters.mime_types?a.settings.filters.mime_types[0].extensions:a.settings.filters[0].extensions;g(a.settings.gf_vars.message_id,c.file.name+" - "+e.invalid_file_extension+" "+d)}else if(c.code===plupload.FILE_SIZE_ERROR)g(a.settings.gf_vars.message_id,c.file.name+" - "+e.file_exceeds_limit);else{var f="Error: "+c.code+", Message: "+c.message+(c.file?", File: "+c.file.name:"")+" ";g(a.settings.gf_vars.message_id,f)}b("#"+c.file.id).html(""),a.refresh()}),p.bind("FileUploaded",function(a,c,d){var h=b.secureEvalJSON(d.response);if("error"==h.status)return g(a.settings.gf_vars.message_id,c.name+" - "+h.error.message),void b("#"+c.id).html("");var i=""+c.name+" ",j=a.settings.multipart_params.form_id,l=a.settings.multipart_params.field_id;i=" "+i,i=gform.applyFilters("gform_file_upload_markup",i,c,a,e,f),b("#"+c.id).html(i);var m=a.settings.multipart_params.field_id;100==c.percent&&(h.status&&"ok"==h.status?k(m,h.data):g(a.settings.gf_vars.message_id,e.unknown_error+": "+c.name))}),b("#"+o.drop_element).on({dragenter:n,dragover:n})}function d(){return"xxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:3&b|8).toString(16)})}a.uploaders={};var e="undefined"!=typeof gform_gravityforms?gform_gravityforms.strings:{},f="undefined"!=typeof gform_gravityforms?gform_gravityforms.vars.images_url:"";b(document).bind("gform_post_render",function(d,f){b("form#gform_"+f+" .gform_fileupload_multifile").each(function(){c(this)});var g=b("form#gform_"+f);g.length>0&&g.submit(function(){var c=!1;if(b.each(a.uploaders,function(a,b){if(b.total.queued>0)return c=!0,!1}),c)return alert(e.currently_uploading),window["gf_submitting_"+f]=!1,b("#gform_ajax_spinner_"+f).remove(),!1})}),b(document).bind("gform_post_conditional_logic",function(c,d,e,f){f||b.each(a.uploaders,function(a,b){b.refresh()})}),b(document).ready(function(){"undefined"!=typeof adminpage&&"toplevel_page_gf_edit_forms"===adminpage||"undefined"==typeof plupload?b(".gform_button_select_files").prop("disabled",!0):"undefined"!=typeof adminpage&&adminpage.indexOf("_page_gf_entries")>-1&&b(".gform_fileupload_multifile").each(function(){c(this)})}),a.setup=function(a){c(a)}}(window.gfMultiFileUploader=window.gfMultiFileUploader||{},jQuery);var __gf_keyup_timeout;jQuery(document).on("change keyup",".gfield_trigger_change input, .gfield_trigger_change select, .gfield_trigger_change textarea",function(a){gf_raw_input_change(a,this)}),window.rgars,window.rgar,String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return void 0!==a[c]?a[c]:b})};
\ No newline at end of file
diff --git a/js/jquery.json-1.3.min.js b/js/jquery.json-1.3.min.js
index 4704e34..165bee0 100644
--- a/js/jquery.json-1.3.min.js
+++ b/js/jquery.json-1.3.min.js
@@ -1 +1 @@
-!function($){function toIntegersAtLease(a){return 10>a?"0"+a:a}Date.prototype.toJSON=function(a){return this.getUTCFullYear()+"-"+toIntegersAtLease(this.getUTCMonth())+"-"+toIntegersAtLease(this.getUTCDate())};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};$.quoteString=function(a){return'"'+a.replace(escapeable,function(a){var b=meta[a];return"string"==typeof b?b:(b=a.charCodeAt(),"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16))})+'"'},$.toJSON=function(a,b){var c=typeof a;if("undefined"==c)return"undefined";if("number"==c||"boolean"==c)return a+"";if(null===a)return"null";if("string"==c){var d=$.quoteString(a);return d}if("object"==c&&"function"==typeof a.toJSON)return a.toJSON(b);if("function"!=c&&"number"==typeof a.length){for(var e=[],f=0;fg&&(g="0"+g),10>h&&(h="0"+h),10>j&&(j="0"+j),10>k&&(k="0"+k),10>l&&(l="0"+l),100>m&&(m="0"+m),10>m&&(m="0"+m),'"'+i+"-"+g+"-"+h+"T"+j+":"+k+":"+l+"."+m+'Z"'}if(b=[],$.isArray(a)){for(c=0;c0&&(a=a.replace("#max",q),a=a.replace("#left",r)),a}function f(){var a={input:p,max:q,left:r,words:s};return a}function g(a){return a.next(".charleft")}function h(){var a=navigator.appVersion;return-1!==a.toLowerCase().indexOf("win")}function i(a){var b=a+" ",c=/^[^A-Za-z0-9]+/gi,d=b.replace(c,""),e=/[^A-Za-z0-9]+/gi,f=d.replace(e," "),g=f.split(" ");return g}function j(a){var b=a.length-1;return b}function k(){var a,c,f,g=o.val(),k="function"==typeof b.charCounter?b.charCounter:t[b.charCounter],l=k(g);return b.maxCharacterSize>0?(b.truncate&&l>=b.maxCharacterSize&&(g=g.substring(0,b.maxCharacterSize)),a=d(g),c=b.maxCharacterSize,h()&&(c=b.maxCharacterSize-a),b.truncate&&l>c&&(f=this.scrollTop,o.val(g.substring(0,c)),this.scrollTop=f),m.removeClass(b.warningStyle+" "+b.errorStyle),c-l<=b.warningNumber&&m.addClass(b.warningStyle),0>c-l&&m.addClass(b.errorStyle),p=l,h()&&(p=l+a),s=j(i(o.val())),r=q-p):(a=d(g),p=l,h()&&(p=l+a),s=j(i(o.val()))),e()}function l(){return m.html(k()),"undefined"!=typeof c&&c.call(this,f()),!0}var m,n={maxCharacterSize:-1,truncate:!0,charCounter:"standard",originalStyle:"originalTextareaInfo",warningStyle:"warningTextareaInfo",errorStyle:"errorTextareaInfo",warningNumber:20,displayFormat:"#input characters | #words words"},o=a(this),p=0,q=b.maxCharacterSize,r=0,s=0,t={};t.standard=function(a){return a.length},t.twitter=function(a){var b=22,c=Array(b+1).join("*"),d="(https?://)?([a-z0-9+!*(),;?&=$_.-]+(:[a-z0-9+!*(),;?&=$_.-]+)?@)?([a-z0-9-.]*)\\.(travel|museum|[a-z]{2,4})(:[0-9]{2,5})?(/([a-z0-9+$_-]\\.?)+)*/?(\\?[a-z+&$_.-][a-z0-9;:@&%=+/$_.-]*)?(#[a-z_.-][a-z0-9+$_.-]*)?",e=new RegExp(d,"gi");return a.replace(e,c).length},b=a.extend(n,b),a("
").insertAfter(o),m=g(o),m.addClass(b.originalStyle),l(),o.bind("keyup",function(){l()}).bind("mouseover paste",function(){setTimeout(function(){l()},10)})}}(jQuery);
\ No newline at end of file
+!function(a){a.fn.textareaCount=function(b,c){function d(a){var b,c=0;for(b=0;b0&&(a=a.replace("#max",q),a=a.replace("#left",r)),a}function f(){return{input:p,max:q,left:r,words:s}}function g(a){return a.next(".charleft")}function h(){return-1!==navigator.appVersion.toLowerCase().indexOf("win")}function i(a){var b=a+" ",c=/^[^A-Za-z0-9]+/gi,d=b.replace(c,""),e=/[^A-Za-z0-9]+/gi;return d.replace(e," ").split(" ")}function j(a){return a.length-1}function k(){var a,c,f,g=o.val(),k="function"==typeof b.charCounter?b.charCounter:t[b.charCounter],l=k(g);return b.maxCharacterSize>0?(b.truncate&&l>=b.maxCharacterSize&&(g=g.substring(0,b.maxCharacterSize)),a=d(g),c=b.maxCharacterSize,h()&&(c=b.maxCharacterSize-a),b.truncate&&l>c&&(f=this.scrollTop,o.val(g.substring(0,c)),this.scrollTop=f),m.removeClass(b.warningStyle+" "+b.errorStyle),c-l<=b.warningNumber&&m.addClass(b.warningStyle),c-l<0&&m.addClass(b.errorStyle),p=l,h()&&(p=l+a),s=j(i(o.val())),r=q-p):(a=d(g),p=l,h()&&(p=l+a),s=j(i(o.val()))),e()}function l(){return m.html(k()),void 0!==c&&c.call(this,f()),!0}var m,n={maxCharacterSize:-1,truncate:!0,charCounter:"standard",originalStyle:"originalTextareaInfo",warningStyle:"warningTextareaInfo",errorStyle:"errorTextareaInfo",warningNumber:20,displayFormat:"#input characters | #words words"},o=a(this),p=0,q=b.maxCharacterSize,r=0,s=0,t={};t.standard=function(a){return a.length},t.twitter=function(a){var b=22,c=Array(b+1).join("*"),d="(https?://)?([a-z0-9+!*(),;?&=$_.-]+(:[a-z0-9+!*(),;?&=$_.-]+)?@)?([a-z0-9-.]*)\\.(travel|museum|[a-z]{2,4})(:[0-9]{2,5})?(/([a-z0-9+$_-]\\.?)+)*/?(\\?[a-z+&$_.-][a-z0-9;:@&%=+/$_.-]*)?(#[a-z_.-][a-z0-9+$_.-]*)?",e=new RegExp(d,"gi");return a.replace(e,c).length},b=a.extend(n,b),a("
").insertAfter(o),m=g(o),m.addClass(b.originalStyle),l(),o.bind("keyup",function(){l()}).bind("mouseover paste",function(){setTimeout(function(){l()},10)})}}(jQuery);
\ No newline at end of file
diff --git a/js/shortcode-ui.min.js b/js/shortcode-ui.min.js
index bf0f6d4..63e6017 100644
--- a/js/shortcode-ui.min.js
+++ b/js/shortcode-ui.min.js
@@ -1 +1 @@
-var GformShortcodeUI;!function(a,b){var c=window.GformShortcodeUI={models:{},collections:{},views:{},utils:{},strings:{}};c.models.ShortcodeAttribute=Backbone.Model.extend({defaults:{attr:"",label:"",type:"",section:"",description:"","default":"",value:""}}),c.models.ShortcodeAttributes=Backbone.Collection.extend({model:c.models.ShortcodeAttribute,clone:function(){return new this.constructor(_.map(this.models,function(a){return a.clone()}))}}),c.models.Shortcode=Backbone.Model.extend({defaults:{label:"",shortcode_tag:"",action_tag:"",attrs:c.models.ShortcodeAttributes},set:function(a,b){return void 0===a.attrs||a.attrs instanceof c.models.ShortcodeAttributes||(_.each(a.attrs,function(a){void 0!=a["default"]&&(a.value=a["default"])}),a.attrs=new c.models.ShortcodeAttributes(a.attrs)),Backbone.Model.prototype.set.call(this,a,b)},toJSON:function(a){return a=Backbone.Model.prototype.toJSON.call(this,a),void 0!==a.attrs&&a.attrs instanceof c.models.ShortcodeAttributes&&(a.attrs=a.attrs.toJSON()),a},clone:function(){var a=Backbone.Model.prototype.clone.call(this);return a.set("attrs",a.get("attrs").clone()),a},formatShortcode:function(){var a,b,c=[];return this.get("attrs").each(function(a){var d=a.get("value"),e=a.get("type"),f=a.get("default");(!d||d.length<1)&&"checkbox"!=e||"checkbox"==e&&"true"!=f&&!d||("content"===a.get("attr")?b=a.get("value"):c.push(a.get("attr")+'="'+d+'"'))}),a="[{{ shortcode }} {{ attributes }}]",b&&b.length>0&&(a+="{{ content }}[/{{ shortcode }}]"),a=a.replace(/{{ shortcode }}/g,this.get("shortcode_tag")),a=a.replace(/{{ attributes }}/g,c.join(" ")),a=a.replace(/{{ content }}/g,b)},validate:function(a){var b=[],d=a.attrs.findWhere({attr:"id"});return d.get("value")||b.push({id:c.strings.pleaseSelectAForm}),b.length?b:null}}),c.collections.Shortcodes=Backbone.Collection.extend({model:c.models.Shortcode}),c.views.editShortcodeForm=wp.Backbone.View.extend({el:"#gform-shortcode-ui-container",template:wp.template("gf-shortcode-default-edit-form"),hasAdvancedValue:!1,events:{"click #gform-update-shortcode":"insertShortcode","click #gform-insert-shortcode":"insertShortcode","click #gform-cancel-shortcode":"cancelShortcode"},initialize:function(){_.bindAll(this,"beforeRender","render","afterRender");var a=this;this.render=_.wrap(this.render,function(b){return a.beforeRender(),b(),a.afterRender(),a}),this.model.get("attrs").each(function(b){switch(b.get("section")){case"required":a.views.add(".gf-edit-shortcode-form-required-attrs",new c.views.editAttributeField({model:b,parent:a}));break;case"standard":a.views.add(".gf-edit-shortcode-form-standard-attrs",new c.views.editAttributeField({model:b,parent:a}));break;default:a.views.add(".gf-edit-shortcode-form-advanced-attrs",new c.views.editAttributeField({model:b,parent:a})),a.hasAdvancedVal||(a.hasAdvancedVal=""!==b.get("value"))}}),this.listenTo(this.model,"change",this.render)},beforeRender:function(){},afterRender:function(){gform_initialize_tooltips(),b("#gform-insert-shortcode").toggle("insert"==this.options.viewMode),b("#gform-update-shortcode").toggle("insert"!=this.options.viewMode),b("#gf-edit-shortcode-form-advanced-attrs").toggle(this.hasAdvancedVal)},insertShortcode:function(a){var b=this.model.isValid({validate:!0});b?(send_to_editor(this.model.formatShortcode()),tb_remove(),this.dispose()):_.each(this.model.validationError,function(a){_.each(a,function(a,b){alert(a)})})},cancelShortcode:function(a){tb_remove(),this.dispose()},dispose:function(){this.remove(),b("#gform-shortcode-ui-wrap").append('
')}}),c.views.editAttributeField=Backbone.View.extend({tagName:"div",initialize:function(a){this.parent=a.parent},events:{'keyup input[type="text"]':"updateValue","keyup textarea":"updateValue","change select":"updateValue","change #gf-shortcode-attr-action":"updateAction","change input[type=checkbox]":"updateCheckbox","change input[type=radio]":"updateValue","change input[type=email]":"updateValue","change input[type=number]":"updateValue","change input[type=date]":"updateValue","change input[type=url]":"updateValue"},render:function(){return this.template=wp.media.template("gf-shortcode-ui-field-"+this.model.get("type")),this.$el.html(this.template(this.model.toJSON()))},updateValue:function(a){var c=b(a.target);this.model.set("value",c.val())},updateCheckbox:function(a){var c=b(a.target),d=c.prop("checked");this.model.set("value",d)},updateAction:function(a){var d=b(a.target),e=d.val();this.model.set("value",e);var f=this.parent.model,g=c.shortcodes.findWhere({shortcode_tag:"gravityform",action_tag:e}),h=f.get("attrs");g.get("attrs").each(function(a){var b=a.get("attr"),c=h.findWhere({attr:b});if("undefined"!=typeof c){var d=c.get("attr");if(b==d){var e=c.get("value");a.set("value",String(e))}}}),b(this.parent.el).empty();var i=this.parent.options.viewMode;this.parent.dispose(),this.parent.model.set(g),GformShortcodeUI=new c.views.editShortcodeForm({model:g,viewMode:i}),GformShortcodeUI.render()}}),c.utils.shortcodeViewConstructor={initialize:function(a){this.shortcodeModel=this.getShortcodeModel(this.shortcode)},getShortcodeModel:function(a){var b="undefined"!=typeof a.attrs.named.action?a.attrs.named.action:"",d=c.shortcodes.findWhere({action_tag:b});if(d){var e=d.clone();return e.get("attrs").each(function(b){b.get("attr")in a.attrs.named&&b.set("value",a.attrs.named[b.get("attr")]),"content"===b.get("attr")&&"content"in a&&b.set("value",a.content)}),e}},getContent:function(){return this.content||this.fetch(),this.content},fetch:function(){var a=this;if(!this.fetching){this.fetching=!0;var c,d=this.shortcodeModel.get("attrs").findWhere({attr:"id"}),e=d.get("value");c={action:"gf_do_shortcode",post_id:b("#post_ID").val(),form_id:e,shortcode:this.shortcodeModel.formatShortcode(),nonce:gfShortcodeUIData.previewNonce},b.post(ajaxurl,c).done(function(b){a.content=b}).fail(function(){a.content=''+gfShortcodeUIData.strings.errorLoadingPreview+" "}).always(function(){delete a.fetching,a.render()})}},setLoader:function(){this.setContent('')},View:{overlay:!0,shortcodeHTML:!1,setContent:function(a,c){this.getNodes(function(d,e,f){var g="wrap"===c||"replace"===c?e:f,h=a;_.isString(h)&&(h=d.dom.createFragment(h)),"replace"===c?d.dom.replace(h,g):"remove"===c?(e.parentNode.insertBefore(h,e.nextSibling),b(e).remove()):(g.innerHTML="",g.appendChild(h))})},initialize:function(a){var b="undefined"!=typeof a.shortcode.attrs.named.action?a.shortcode.attrs.named.action:"",d=c.shortcodes.findWhere({action_tag:b});if(!d)return this.shortcodeHTML=decodeURIComponent(a.encodedText),void(this.shortcode=!1);var e=d.clone();e.get("attrs").each(function(b){b.get("attr")in a.shortcode.attrs.named&&b.set("value",a.shortcode.attrs.named[b.get("attr")]),"content"===b.get("attr")&&"content"in a.shortcode&&b.set("value",a.shortcode.content)}),this.shortcode=e},loadingPlaceholder:function(){return''},getEditors:function(a){var b=[];return _.each(tinymce.editors,function(c){c.plugins.wpview&&(a&&a(c),b.push(c))},this),b},getNodes:function(a){var c=[],d=this;return this.getEditors(function(e){b(e.getBody()).find('[data-wpview-text="'+d.encodedText+'"]').each(function(d,f){a&&a(e,f,b(f).find(".wpview-content").get(0)),c.push(f)})}),c},setIframes:function(a){var c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;return-1===a.indexOf("