Version Description
- Add frm_time_to_check duplicate entries filter
- Allow custom JavaScript validation
- Add frm_do_html_shortcodes fiter
- Fix the duplicate entry check
- Include get_columns function in list tables for 4.3
- Use relative URLs in the stylesheet
- Make frm_fifth classes responsive
- Allow 0 to be saved in a checkbox field
- Fix saving forms as drafts
- Pro Features:
- Reduce database calls for Views
- Allow format for default [time] and [date] shortcodes ie [time format='H:i A' round=5]
- Include Dynamic List fields in calculation options
- Make file upload fields more responsive
- Improve repeating section styling
- Improve calculation triggering when fields involved are conditionally hidden
- Don't clear readonly fields or default values when hidden conditionally
- Don't trigger dynamic field values if there is other logic telling the field to be hidden
- Include Indonesian option for datepicker
- Allow the post author to be changed by the user ID field on edit
- Trigger calculations at the time a conditional field is shown
- Keep the value submitted in a dynamic list field
- Fix graphs that show multiple fields and define the x-axis
- Allow graphs to be included in the success message after ajax submit
- Conditionally show the max character setting in number fields based on whether HTML5 is enabled
- Allow scale fields to work in calculations across multiple pages
- Turn off ajax submit if repeating section includes a file
- Fix entry creation date format on import
- Fix filtering by a checkbox field in the frm-stats shortcode
- Fix logic for third-level fields with conditional logic inside a repeating section
- Make sure conditional logic only affects the newly added row when triggered after a row is added
- Make sure orphaned data is deleted when switching divider to repeating/non-repeating
- Allow drafts=both with user_id filter in View shortcode
- Fix conditionally required fields when option includes quote
- Fix date field errors on multi-page form that submits with Ajax
- Prevent the JetPack conflict with the shortcodes module
- Fix sorting in dependent Dynamic fields
- Registration add-on login form styling
- Fix inline scale field labels
- Fix spacing issue with repeating section grid
- Fix truncation with special characters
- Fix importing repeating sections and embedded forms
- Fix readonly checkboxes in calculations
- Don't show empty custom field rows in the post settings
- A few fixes to the formresults shortcode including the file display
- Fix error when duplicating a section without any included fields
- Fix timezones for searching by entry creation and updated dates in a view
Download this release
Release Info
Developer | sswells |
Plugin | Formidable Forms – Form Builder for WordPress |
Version | 2.0.09 |
Comparing to | |
See all releases |
Code changes from version 2.0.09b to 2.0.09
- classes/helpers/FrmAppHelper.php +50 -35
- classes/helpers/FrmFieldsHelper.php +6 -1
- classes/helpers/FrmXMLHelper.php +3 -3
- classes/models/FrmDb.php +3 -0
- classes/models/FrmEntry.php +6 -1
- classes/models/FrmEntryMeta.php +19 -10
- css/_single_theme.css.php +1 -3
- css/custom_theme.css.php +44 -8
- css/frm_admin.css +12 -12
- formidable.php +1 -1
- js/formidable.min.js +57 -55
- js/formidable_admin.js +5 -12
- readme.txt +50 -1
classes/helpers/FrmAppHelper.php
CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
|
|
10 |
/**
|
11 |
* @since 2.0
|
12 |
*/
|
13 |
-
public static $plug_version = '2.0.
|
14 |
|
15 |
/**
|
16 |
* @since 1.07.02
|
@@ -707,7 +707,7 @@ class FrmAppHelper {
|
|
707 |
}
|
708 |
|
709 |
public static function check_selected($values, $current) {
|
710 |
-
self::
|
711 |
$current = trim($current);
|
712 |
|
713 |
return ( is_array($values) && in_array($current, $values) ) || ( ! is_array($values) && $values == $current );
|
@@ -758,15 +758,20 @@ class FrmAppHelper {
|
|
758 |
return FrmFieldsHelper::prepare_other_input( $args, $other_opt, $checked );
|
759 |
}
|
760 |
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
|
|
|
|
|
|
|
|
|
|
767 |
|
768 |
-
|
769 |
-
|
770 |
|
771 |
/**
|
772 |
* Flatten a multi-dimensional array
|
@@ -982,7 +987,7 @@ class FrmAppHelper {
|
|
982 |
}
|
983 |
$meta_value = FrmProEntryMetaHelper::get_post_value( $record->post_id, $field->field_options['post_field'], $field->field_options['custom_field'], array( 'truncate' => false, 'type' => $field->type, 'form_id' => $field->form_id, 'field' => $field ) );
|
984 |
} else {
|
985 |
-
|
986 |
}
|
987 |
}
|
988 |
|
@@ -1095,16 +1100,10 @@ class FrmAppHelper {
|
|
1095 |
}
|
1096 |
}
|
1097 |
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
if ( isset($entry->metas) ) {
|
1103 |
-
return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false;
|
1104 |
-
} else {
|
1105 |
-
return FrmEntryMeta::get_entry_meta_by_field($entry->id, $field_id);
|
1106 |
-
}
|
1107 |
-
}
|
1108 |
|
1109 |
public static function insert_opt_html($args) {
|
1110 |
$class = '';
|
@@ -1137,29 +1136,29 @@ class FrmAppHelper {
|
|
1137 |
|
1138 |
$length = (int) $length;
|
1139 |
$str = wp_strip_all_tags( $str );
|
1140 |
-
|
1141 |
|
1142 |
if ( $length == 0 ) {
|
1143 |
return '';
|
1144 |
} else if ( $length <= 10 ) {
|
1145 |
-
$sub =
|
1146 |
return $sub . (($length < $original_len) ? $continue : '');
|
1147 |
}
|
1148 |
|
1149 |
$sub = '';
|
1150 |
$len = 0;
|
1151 |
|
1152 |
-
|
1153 |
|
1154 |
foreach ( $words as $word ) {
|
1155 |
$part = (($sub != '') ? ' ' : '') . $word;
|
1156 |
-
|
1157 |
if ( $total_len > $length && str_word_count($sub) ) {
|
1158 |
break;
|
1159 |
}
|
1160 |
|
1161 |
$sub .= $part;
|
1162 |
-
|
1163 |
|
1164 |
if ( str_word_count($sub) > $minword && $total_len >= $length ) {
|
1165 |
break;
|
@@ -1171,6 +1170,15 @@ class FrmAppHelper {
|
|
1171 |
return $sub . (($len < $original_len) ? $continue : '');
|
1172 |
}
|
1173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1174 |
public static function get_formatted_time($date, $date_format = '', $time_format = '' ) {
|
1175 |
if ( empty($date) ) {
|
1176 |
return $date;
|
@@ -1189,19 +1197,26 @@ class FrmAppHelper {
|
|
1189 |
|
1190 |
$do_time = ( date( 'H:i:s', strtotime( $date ) ) != '00:00:00' );
|
1191 |
if ( $do_time ) {
|
1192 |
-
|
1193 |
-
$time_format = get_option('time_format');
|
1194 |
-
}
|
1195 |
-
|
1196 |
-
$trimmed_format = trim( $time_format );
|
1197 |
-
if ( $time_format && ! empty( $trimmed_format ) ) {
|
1198 |
-
$formatted .= ' ' . __( 'at', 'formidable' ) . ' ' . self::get_localized_date( $time_format, $date );
|
1199 |
-
}
|
1200 |
}
|
1201 |
|
1202 |
return $formatted;
|
1203 |
}
|
1204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
/**
|
1206 |
* @since 2.0.8
|
1207 |
*/
|
@@ -1798,7 +1813,7 @@ class FrmAppHelper {
|
|
1798 |
// remove the languages unavailable for the datepicker
|
1799 |
$unset = array(
|
1800 |
'en', 'fil', 'fr-CA', 'de-AT', 'de-AT',
|
1801 |
-
'de-CH', 'iw', 'hi', '
|
1802 |
'es-419', 'tr',
|
1803 |
);
|
1804 |
}
|
10 |
/**
|
11 |
* @since 2.0
|
12 |
*/
|
13 |
+
public static $plug_version = '2.0.09';
|
14 |
|
15 |
/**
|
16 |
* @since 1.07.02
|
707 |
}
|
708 |
|
709 |
public static function check_selected($values, $current) {
|
710 |
+
$values = self::recursive_function_map( $values, 'trim' );
|
711 |
$current = trim($current);
|
712 |
|
713 |
return ( is_array($values) && in_array($current, $values) ) || ( ! is_array($values) && $values == $current );
|
758 |
return FrmFieldsHelper::prepare_other_input( $args, $other_opt, $checked );
|
759 |
}
|
760 |
|
761 |
+
public static function recursive_function_map( $value, $function ) {
|
762 |
+
if ( is_array( $value ) ) {
|
763 |
+
if ( count( $value ) ) {
|
764 |
+
$function = explode( ', ', self::prepare_array_values( $value, $function ) );
|
765 |
+
} else {
|
766 |
+
$function = array( $function );
|
767 |
+
}
|
768 |
+
$value = array_map( array( 'FrmAppHelper', 'recursive_function_map' ), $value, $function );
|
769 |
+
} else {
|
770 |
+
$value = call_user_func( $function, $value );
|
771 |
+
}
|
772 |
|
773 |
+
return $value;
|
774 |
+
}
|
775 |
|
776 |
/**
|
777 |
* Flatten a multi-dimensional array
|
987 |
}
|
988 |
$meta_value = FrmProEntryMetaHelper::get_post_value( $record->post_id, $field->field_options['post_field'], $field->field_options['custom_field'], array( 'truncate' => false, 'type' => $field->type, 'form_id' => $field->form_id, 'field' => $field ) );
|
989 |
} else {
|
990 |
+
$meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
|
991 |
}
|
992 |
}
|
993 |
|
1100 |
}
|
1101 |
}
|
1102 |
|
1103 |
+
public static function get_meta_value( $field_id, $entry ) {
|
1104 |
+
_deprecated_function( __FUNCTION__, '2.0.9', 'FrmEntryMeta::get_meta_value' );
|
1105 |
+
return FrmEntryMeta::get_meta_value( $entry, $field_id );
|
1106 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1107 |
|
1108 |
public static function insert_opt_html($args) {
|
1109 |
$class = '';
|
1136 |
|
1137 |
$length = (int) $length;
|
1138 |
$str = wp_strip_all_tags( $str );
|
1139 |
+
$original_len = self::mb_function( array( 'mb_strlen', 'strlen' ), array( $str ) );
|
1140 |
|
1141 |
if ( $length == 0 ) {
|
1142 |
return '';
|
1143 |
} else if ( $length <= 10 ) {
|
1144 |
+
$sub = self::mb_function( array( 'mb_substr', 'substr' ), array( $str, 0, $length ) );
|
1145 |
return $sub . (($length < $original_len) ? $continue : '');
|
1146 |
}
|
1147 |
|
1148 |
$sub = '';
|
1149 |
$len = 0;
|
1150 |
|
1151 |
+
$words = self::mb_function( array( 'mb_split', 'explode' ), array( ' ', $str ) );
|
1152 |
|
1153 |
foreach ( $words as $word ) {
|
1154 |
$part = (($sub != '') ? ' ' : '') . $word;
|
1155 |
+
$total_len = self::mb_function( array( 'mb_strlen', 'strlen' ), array( $sub . $part ) );
|
1156 |
if ( $total_len > $length && str_word_count($sub) ) {
|
1157 |
break;
|
1158 |
}
|
1159 |
|
1160 |
$sub .= $part;
|
1161 |
+
$len += self::mb_function( array( 'mb_strlen', 'strlen' ), array( $part ) );
|
1162 |
|
1163 |
if ( str_word_count($sub) > $minword && $total_len >= $length ) {
|
1164 |
break;
|
1170 |
return $sub . (($len < $original_len) ? $continue : '');
|
1171 |
}
|
1172 |
|
1173 |
+
public static function mb_function( $function_names, $args ) {
|
1174 |
+
$mb_function_name = $function_names[0];
|
1175 |
+
$function_name = $function_names[1];
|
1176 |
+
if ( function_exists( $mb_function_name ) ) {
|
1177 |
+
$function_name = $mb_function_name;
|
1178 |
+
}
|
1179 |
+
return call_user_func_array( $function_name, $args );
|
1180 |
+
}
|
1181 |
+
|
1182 |
public static function get_formatted_time($date, $date_format = '', $time_format = '' ) {
|
1183 |
if ( empty($date) ) {
|
1184 |
return $date;
|
1197 |
|
1198 |
$do_time = ( date( 'H:i:s', strtotime( $date ) ) != '00:00:00' );
|
1199 |
if ( $do_time ) {
|
1200 |
+
$formatted .= self::add_time_to_date( $time_format, $date );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1201 |
}
|
1202 |
|
1203 |
return $formatted;
|
1204 |
}
|
1205 |
|
1206 |
+
private static function add_time_to_date( $time_format, $date ) {
|
1207 |
+
if ( empty( $time_format ) ) {
|
1208 |
+
$time_format = get_option('time_format');
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
$trimmed_format = trim( $time_format );
|
1212 |
+
$time = '';
|
1213 |
+
if ( $time_format && ! empty( $trimmed_format ) ) {
|
1214 |
+
$time = ' ' . __( 'at', 'formidable' ) . ' ' . self::get_localized_date( $time_format, $date );
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
return $time;
|
1218 |
+
}
|
1219 |
+
|
1220 |
/**
|
1221 |
* @since 2.0.8
|
1222 |
*/
|
1813 |
// remove the languages unavailable for the datepicker
|
1814 |
$unset = array(
|
1815 |
'en', 'fil', 'fr-CA', 'de-AT', 'de-AT',
|
1816 |
+
'de-CH', 'iw', 'hi', 'pt', 'pt-PT',
|
1817 |
'es-419', 'tr',
|
1818 |
);
|
1819 |
}
|
classes/helpers/FrmFieldsHelper.php
CHANGED
@@ -381,6 +381,11 @@ DEFAULT_HTML;
|
|
381 |
$error_class .= ' frm_dynamic_' . $field['data_type'] . '_container';
|
382 |
}
|
383 |
|
|
|
|
|
|
|
|
|
|
|
384 |
// If this is a Section
|
385 |
if ( $field['type'] == 'divider' ) {
|
386 |
|
@@ -767,7 +772,7 @@ DEFAULT_HTML;
|
|
767 |
|
768 |
$sep = isset($atts['sep']) ? $atts['sep'] : ', ';
|
769 |
|
770 |
-
$replace_with = FrmEntryMeta::
|
771 |
|
772 |
$atts['entry_id'] = $entry->id;
|
773 |
$atts['entry_key'] = $entry->item_key;
|
381 |
$error_class .= ' frm_dynamic_' . $field['data_type'] . '_container';
|
382 |
}
|
383 |
|
384 |
+
// Add class to inline Scale field
|
385 |
+
if ( $field['type'] == 'scale' && $field['label'] == 'inline' ) {
|
386 |
+
$error_class .= ' frm_scale_container';
|
387 |
+
}
|
388 |
+
|
389 |
// If this is a Section
|
390 |
if ( $field['type'] == 'divider' ) {
|
391 |
|
772 |
|
773 |
$sep = isset($atts['sep']) ? $atts['sep'] : ', ';
|
774 |
|
775 |
+
$replace_with = FrmEntryMeta::get_meta_value( $entry, $field->id );
|
776 |
|
777 |
$atts['entry_id'] = $entry->id;
|
778 |
$atts['entry_key'] = $entry->item_key;
|
classes/helpers/FrmXMLHelper.php
CHANGED
@@ -295,7 +295,7 @@ class FrmXMLHelper {
|
|
295 |
$repeat_field = FrmField::getOne( $repeat_field_id );
|
296 |
$field_opts = maybe_unserialize( $repeat_field->field_options );
|
297 |
|
298 |
-
if ( ! $imported_forms[ $old_form_id ] ) {
|
299 |
return;
|
300 |
}
|
301 |
$field_opts['form_select'] = $imported_forms[ $old_form_id ];
|
@@ -315,8 +315,8 @@ class FrmXMLHelper {
|
|
315 |
* @param array $repeat_fields - pass by reference
|
316 |
*/
|
317 |
private static function track_repeating_fields( $f, $repeat_field_id, &$repeat_fields ) {
|
318 |
-
if ( FrmField::
|
319 |
-
$old_form_id = $f['field_options']['form_select'];
|
320 |
if ( ! isset( $repeat_fields[ $old_form_id ] ) ) {
|
321 |
$repeat_fields[ $old_form_id ] = array();
|
322 |
}
|
295 |
$repeat_field = FrmField::getOne( $repeat_field_id );
|
296 |
$field_opts = maybe_unserialize( $repeat_field->field_options );
|
297 |
|
298 |
+
if ( ! isset( $imported_forms[ $old_form_id ] ) ) {
|
299 |
return;
|
300 |
}
|
301 |
$field_opts['form_select'] = $imported_forms[ $old_form_id ];
|
315 |
* @param array $repeat_fields - pass by reference
|
316 |
*/
|
317 |
private static function track_repeating_fields( $f, $repeat_field_id, &$repeat_fields ) {
|
318 |
+
if ( ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) || $f['type'] == 'form' ) {
|
319 |
+
$old_form_id = trim( $f['field_options']['form_select'] );
|
320 |
if ( ! isset( $repeat_fields[ $old_form_id ] ) ) {
|
321 |
$repeat_fields[ $old_form_id ] = array();
|
322 |
}
|
classes/models/FrmDb.php
CHANGED
@@ -28,6 +28,9 @@ class FrmDb {
|
|
28 |
}
|
29 |
|
30 |
if ( $frm_db_version != $old_db_version ) {
|
|
|
|
|
|
|
31 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
32 |
|
33 |
$this->create_tables();
|
28 |
}
|
29 |
|
30 |
if ( $frm_db_version != $old_db_version ) {
|
31 |
+
// update rewrite rules for views and other custom post types
|
32 |
+
flush_rewrite_rules();
|
33 |
+
|
34 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
35 |
|
36 |
$this->create_tables();
|
classes/models/FrmEntry.php
CHANGED
@@ -96,8 +96,13 @@ class FrmEntry {
|
|
96 |
return false;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
99 |
$check_val = $new_values;
|
100 |
-
$check_val['created_at >'] = date( 'Y-m-d H:i:s', ( strtotime( $new_values['created_at'] ) -
|
101 |
|
102 |
unset( $check_val['created_at'], $check_val['updated_at'] );
|
103 |
unset( $check_val['is_draft'], $check_val['id'], $check_val['item_key'] );
|
96 |
return false;
|
97 |
}
|
98 |
|
99 |
+
$duplicate_entry_time = apply_filters( 'frm_time_to_check_duplicates', 60, $new_values );
|
100 |
+
if ( empty( $duplicate_entry_time ) ) {
|
101 |
+
return false;
|
102 |
+
}
|
103 |
+
|
104 |
$check_val = $new_values;
|
105 |
+
$check_val['created_at >'] = date( 'Y-m-d H:i:s', ( strtotime( $new_values['created_at'] ) - absint( $duplicate_entry_time ) ) );
|
106 |
|
107 |
unset( $check_val['created_at'], $check_val['updated_at'] );
|
108 |
unset( $check_val['is_draft'], $check_val['id'], $check_val['item_key'] );
|
classes/models/FrmEntryMeta.php
CHANGED
@@ -129,12 +129,29 @@ class FrmEntryMeta {
|
|
129 |
FrmAppHelper::cache_delete_group( 'frm_item_meta' );
|
130 |
}
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
public static function get_entry_meta_by_field($entry_id, $field_id) {
|
133 |
global $wpdb;
|
134 |
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
$cached = FrmAppHelper::check_cache( $entry_id, 'frm_entry' );
|
138 |
if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
|
139 |
$result = $cached->metas[ $field_id ];
|
140 |
return stripslashes_deep($result);
|
@@ -151,14 +168,6 @@ class FrmEntryMeta {
|
|
151 |
|
152 |
$result = FrmDb::get_var( $get_table, $query, 'meta_value' );
|
153 |
$result = maybe_unserialize($result);
|
154 |
-
|
155 |
-
if ( $cached ) {
|
156 |
-
if ( ! isset( $cached->metas ) ) {
|
157 |
-
$cached->metas = array();
|
158 |
-
}
|
159 |
-
$cached->metas[ $field_id ] = $result;
|
160 |
-
wp_cache_set($entry_id, $cached, 'frm_entry');
|
161 |
-
}
|
162 |
$result = stripslashes_deep($result);
|
163 |
|
164 |
return $result;
|
129 |
FrmAppHelper::cache_delete_group( 'frm_item_meta' );
|
130 |
}
|
131 |
|
132 |
+
/**
|
133 |
+
* @since 2.0.9
|
134 |
+
*/
|
135 |
+
public static function get_meta_value( $entry, $field_id ) {
|
136 |
+
if ( isset( $entry->metas ) ) {
|
137 |
+
return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false;
|
138 |
+
} else {
|
139 |
+
return self::get_entry_meta_by_field( $entry->id, $field_id );
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
public static function get_entry_meta_by_field($entry_id, $field_id) {
|
144 |
global $wpdb;
|
145 |
|
146 |
+
if ( is_object( $entry_id ) ) {
|
147 |
+
$entry = $entry_id;
|
148 |
+
$entry_id = $entry->id;
|
149 |
+
$cached = $entry;
|
150 |
+
} else {
|
151 |
+
$entry_id = (int) $entry_id;
|
152 |
+
$cached = FrmAppHelper::check_cache( $entry_id, 'frm_entry' );
|
153 |
+
}
|
154 |
|
|
|
155 |
if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
|
156 |
$result = $cached->metas[ $field_id ];
|
157 |
return stripslashes_deep($result);
|
168 |
|
169 |
$result = FrmDb::get_var( $get_table, $query, 'meta_value' );
|
170 |
$result = maybe_unserialize($result);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
$result = stripslashes_deep($result);
|
172 |
|
173 |
return $result;
|
css/_single_theme.css.php
CHANGED
@@ -248,6 +248,7 @@ if ( ! isset($collapse_icon) ) {
|
|
248 |
.<?php echo $style_class ?> .frm_inline_container label.frm_primary_label,
|
249 |
.<?php echo $style_class ?> .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
|
250 |
display:inline<?php echo $important ?>;
|
|
|
251 |
}
|
252 |
|
253 |
.<?php echo $style_class ?> .frm_pos_right{
|
@@ -893,9 +894,6 @@ if ( ! $submit_style ) { ?>
|
|
893 |
width:100%<?php echo $important ?>;
|
894 |
}
|
895 |
|
896 |
-
.<?php echo $style_class ?> .frm_form_field.frm_last.frm_repeat_buttons label.frm_primary_label{
|
897 |
-
display:none;
|
898 |
-
}
|
899 |
|
900 |
.<?php echo $style_class ?> .frm_repeat_inline,
|
901 |
.<?php echo $style_class ?> .frm_repeat_grid{
|
248 |
.<?php echo $style_class ?> .frm_inline_container label.frm_primary_label,
|
249 |
.<?php echo $style_class ?> .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
|
250 |
display:inline<?php echo $important ?>;
|
251 |
+
margin-right:10px<?php echo $important ?>;
|
252 |
}
|
253 |
|
254 |
.<?php echo $style_class ?> .frm_pos_right{
|
894 |
width:100%<?php echo $important ?>;
|
895 |
}
|
896 |
|
|
|
|
|
|
|
897 |
|
898 |
.<?php echo $style_class ?> .frm_repeat_inline,
|
899 |
.<?php echo $style_class ?> .frm_repeat_grid{
|
css/custom_theme.css.php
CHANGED
@@ -63,12 +63,6 @@ legend.frm_hidden{
|
|
63 |
width:auto;
|
64 |
}
|
65 |
|
66 |
-
.with_frm_style .frm_inline_container label.frm_primary_label,
|
67 |
-
.with_frm_style .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
|
68 |
-
display:inline;
|
69 |
-
margin-right:10px;
|
70 |
-
}
|
71 |
-
|
72 |
.with_frm_style .frm_right_container label.frm_primary_label,
|
73 |
.with_frm_style .frm_pos_right{
|
74 |
display:inline;
|
@@ -130,6 +124,7 @@ legend.frm_hidden{
|
|
130 |
border:none;
|
131 |
}
|
132 |
|
|
|
133 |
.with_frm_style .auto_width input,
|
134 |
.with_frm_style input.auto_width,
|
135 |
.with_frm_style select.auto_width,
|
@@ -137,6 +132,10 @@ legend.frm_hidden{
|
|
137 |
width:auto;
|
138 |
}
|
139 |
|
|
|
|
|
|
|
|
|
140 |
.with_frm_style .frm_button{
|
141 |
text-decoration:none;
|
142 |
border:1px solid #eee;
|
@@ -1108,6 +1107,10 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
|
|
1108 |
margin-right:0;
|
1109 |
}
|
1110 |
|
|
|
|
|
|
|
|
|
1111 |
.with_frm_style .frm_other_input.frm_other_full{
|
1112 |
margin-top:10px;
|
1113 |
}
|
@@ -1789,15 +1792,28 @@ html[xmlns] .frm_clearfix{
|
|
1789 |
.frm_form_field.frm_fourth,
|
1790 |
.frm_form_field.frm_right_fourth,
|
1791 |
.frm_form_field.frm_first_fourth,
|
1792 |
-
|
|
|
1793 |
width:48%;
|
1794 |
}
|
1795 |
|
1796 |
.frm_form_field.frm_first_fourth + .frm_form_field.frm_fourth,
|
1797 |
-
.frm_form_field.frm_first.frm_fourth + .frm_form_field.frm_fourth
|
|
|
|
|
1798 |
margin-right:0;
|
1799 |
}
|
1800 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1801 |
.frm_form_field.frm_first_inline,
|
1802 |
.frm_form_field.frm_inline,
|
1803 |
.frm_form_field.frm_last_inline{
|
@@ -1816,6 +1832,9 @@ html[xmlns] .frm_clearfix{
|
|
1816 |
.frm_form_field.frm_four_col .frm_checkbox:nth-child(2n+2){
|
1817 |
margin-right:0;
|
1818 |
}
|
|
|
|
|
|
|
1819 |
}
|
1820 |
|
1821 |
@media only screen and (max-width: 500px) {
|
@@ -1828,6 +1847,23 @@ html[xmlns] .frm_clearfix{
|
|
1828 |
float: none;
|
1829 |
display:block;
|
1830 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1831 |
}
|
1832 |
<?php
|
1833 |
echo $defaults['custom_css'];
|
63 |
width:auto;
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
.with_frm_style .frm_right_container label.frm_primary_label,
|
67 |
.with_frm_style .frm_pos_right{
|
68 |
display:inline;
|
124 |
border:none;
|
125 |
}
|
126 |
|
127 |
+
.with_frm_style .auto_width #loginform input,
|
128 |
.with_frm_style .auto_width input,
|
129 |
.with_frm_style input.auto_width,
|
130 |
.with_frm_style select.auto_width,
|
132 |
width:auto;
|
133 |
}
|
134 |
|
135 |
+
.with_frm_style .frm_repeat_buttons{
|
136 |
+
white-space:nowrap;
|
137 |
+
}
|
138 |
+
|
139 |
.with_frm_style .frm_button{
|
140 |
text-decoration:none;
|
141 |
border:1px solid #eee;
|
1107 |
margin-right:0;
|
1108 |
}
|
1109 |
|
1110 |
+
.with_frm_style .frm_inline_container.frm_scale_container label.frm_primary_label{
|
1111 |
+
float:left;
|
1112 |
+
}
|
1113 |
+
|
1114 |
.with_frm_style .frm_other_input.frm_other_full{
|
1115 |
margin-top:10px;
|
1116 |
}
|
1792 |
.frm_form_field.frm_fourth,
|
1793 |
.frm_form_field.frm_right_fourth,
|
1794 |
.frm_form_field.frm_first_fourth,
|
1795 |
+
.frm_form_field.frm_last_fourth,
|
1796 |
+
.frm_form_field.frm_fifth{
|
1797 |
width:48%;
|
1798 |
}
|
1799 |
|
1800 |
.frm_form_field.frm_first_fourth + .frm_form_field.frm_fourth,
|
1801 |
+
.frm_form_field.frm_first.frm_fourth + .frm_form_field.frm_fourth,
|
1802 |
+
.frm_form_field.frm_first.frm_fifth + .frm_form_field.frm_fifth,
|
1803 |
+
.frm_form_field.frm_first.frm_fifth + .frm_form_field.frm_fifth + .frm_form_field.frm_fifth + .frm_form_field.frm_fifth{
|
1804 |
margin-right:0;
|
1805 |
}
|
1806 |
|
1807 |
+
.frm_form_field.frm_fifth.frm_first,
|
1808 |
+
.frm_form_field.frm_first.frm_fifth + .frm_form_field.frm_fifth + .frm_form_field.frm_fifth{
|
1809 |
+
margin-right:4%
|
1810 |
+
}
|
1811 |
+
|
1812 |
+
.frm_form_field.frm_fifth.frm_last{
|
1813 |
+
clear:both;
|
1814 |
+
float:none;
|
1815 |
+
}
|
1816 |
+
|
1817 |
.frm_form_field.frm_first_inline,
|
1818 |
.frm_form_field.frm_inline,
|
1819 |
.frm_form_field.frm_last_inline{
|
1832 |
.frm_form_field.frm_four_col .frm_checkbox:nth-child(2n+2){
|
1833 |
margin-right:0;
|
1834 |
}
|
1835 |
+
.frm_form_field .frm_repeat_grid.frm_first_repeat .frm_form_field.frm_repeat_buttons:not(.frm_fourth) label.frm_primary_label{
|
1836 |
+
display:none !important;
|
1837 |
+
}
|
1838 |
}
|
1839 |
|
1840 |
@media only screen and (max-width: 500px) {
|
1847 |
float: none;
|
1848 |
display:block;
|
1849 |
}
|
1850 |
+
|
1851 |
+
.frm_form_field input[type=file] {
|
1852 |
+
max-width:220px;
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
.with_frm_style.frm_login_form.frm_inline_login p{
|
1856 |
+
clear:both;
|
1857 |
+
float:none;
|
1858 |
+
}
|
1859 |
+
|
1860 |
+
.with_frm_style.frm_login_form.frm_inline_login form{
|
1861 |
+
position:static;
|
1862 |
+
}
|
1863 |
+
|
1864 |
+
.with_frm_style.frm_login_form.frm_inline_login .login-remember{
|
1865 |
+
position:static;
|
1866 |
+
}
|
1867 |
}
|
1868 |
<?php
|
1869 |
echo $defaults['custom_css'];
|
css/frm_admin.css
CHANGED
@@ -860,6 +860,10 @@ li.ui-state-default.selected .frm-show-click.frm_import_options {
|
|
860 |
border: solid 1px #ebebeb;
|
861 |
}
|
862 |
|
|
|
|
|
|
|
|
|
863 |
.frm_sorting span.ui-icon{width:16px;}
|
864 |
#form_settings_page .tabs-panel, .frm_settings_form .tabs-panel{max-height:none !important; min-height:260px !important;}
|
865 |
#form_settings_page #post-body-content{min-width:650px;}
|
@@ -2087,6 +2091,8 @@ Responsive Design
|
|
2087 |
#form_settings_page #post-body.columns-2{
|
2088 |
margin:0;
|
2089 |
}
|
|
|
|
|
2090 |
}
|
2091 |
@media only screen and (max-width: 850px) {
|
2092 |
#postbox-container-1 .frm_field_list{position:static; width:100%;}
|
@@ -2113,10 +2119,8 @@ Responsive Design
|
|
2113 |
.navbar-right .frm-dropdown-menu{right:0;left:auto;}
|
2114 |
}
|
2115 |
@media only screen and (max-width: 600px) {
|
2116 |
-
.frm_form_nav
|
2117 |
-
font-size: 12px;
|
2118 |
-
padding: 5px 15px;
|
2119 |
-
}
|
2120 |
}
|
2121 |
@media only screen and (max-width: 475px) {
|
2122 |
.frm_drag_inst{
|
@@ -2125,14 +2129,10 @@ Responsive Design
|
|
2125 |
}
|
2126 |
}
|
2127 |
@media only screen and (max-width: 450px) {
|
2128 |
-
ul.frm_form_nav
|
2129 |
-
ul.frm_form_nav {
|
2130 |
-
.frm_form_nav
|
2131 |
-
|
2132 |
-
border-top-right-radius: 4px;
|
2133 |
-
border-bottom-right-radius: 4px;
|
2134 |
-
font-size: 13px;
|
2135 |
-
}
|
2136 |
}
|
2137 |
|
2138 |
/* PRINT */
|
860 |
border: solid 1px #ebebeb;
|
861 |
}
|
862 |
|
863 |
+
li.ui-state-default.selected .frm-show-click.frm_import_options select {
|
864 |
+
max-width: 22%;
|
865 |
+
}
|
866 |
+
|
867 |
.frm_sorting span.ui-icon{width:16px;}
|
868 |
#form_settings_page .tabs-panel, .frm_settings_form .tabs-panel{max-height:none !important; min-height:260px !important;}
|
869 |
#form_settings_page #post-body-content{min-width:650px;}
|
2091 |
#form_settings_page #post-body.columns-2{
|
2092 |
margin:0;
|
2093 |
}
|
2094 |
+
ul.frm_form_nav { min-width:100px; width:100%; }
|
2095 |
+
ul.frm_form_nav li.last .caret { display:none; }
|
2096 |
}
|
2097 |
@media only screen and (max-width: 850px) {
|
2098 |
#postbox-container-1 .frm_field_list{position:static; width:100%;}
|
2119 |
.navbar-right .frm-dropdown-menu{right:0;left:auto;}
|
2120 |
}
|
2121 |
@media only screen and (max-width: 600px) {
|
2122 |
+
ul.frm_form_nav {min-width:100px; width:100%;}
|
2123 |
+
ul.frm_form_nav a { font-size: 12px; padding: 5px 10px; }
|
|
|
|
|
2124 |
}
|
2125 |
@media only screen and (max-width: 475px) {
|
2126 |
.frm_drag_inst{
|
2129 |
}
|
2130 |
}
|
2131 |
@media only screen and (max-width: 450px) {
|
2132 |
+
ul.frm_form_nav { min-width:100px; width:100%; }
|
2133 |
+
ul.frm_form_nav li { width:14%; }
|
2134 |
+
ul.frm_form_nav li.last { width: 28%; }
|
2135 |
+
ul.frm_form_nav a { padding:5px 0; }
|
|
|
|
|
|
|
|
|
2136 |
}
|
2137 |
|
2138 |
/* PRINT */
|
formidable.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
-
Version: 2.0.
|
6 |
Plugin URI: http://formidablepro.com/
|
7 |
Author URI: http://strategy11.com
|
8 |
Author: Strategy11
|
2 |
/*
|
3 |
Plugin Name: Formidable
|
4 |
Description: Quickly and easily create drag-and-drop forms
|
5 |
+
Version: 2.0.09
|
6 |
Plugin URI: http://formidablepro.com/
|
7 |
Author URI: http://strategy11.com
|
8 |
Author: Strategy11
|
js/formidable.min.js
CHANGED
@@ -1,59 +1,61 @@
|
|
1 |
function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
|
2 |
-
jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function
|
3 |
b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value="")):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):
|
4 |
-
"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function
|
5 |
-
b)return;c="persist"}
|
6 |
-
|
7 |
-
b.
|
8 |
-
b.
|
9 |
-
typeof d||"und"===d)if(("radio"===b.Type||"data-radio"===b.Type)&&"radio"===f.attr("type"))d=jQuery('input[name="'+b.inputName+'"]:checked').val(),"undefined"===typeof d&&(d="");else if("select"===b.Type||"time"===b.Type||"data-select"===b.Type||"checkbox"!==b.Type&&"data-checkbox"!==b.Type)d=f.val();"undefined"===typeof d
|
10 |
-
b,b.FieldName,d,e,jQuery(this))});return}d=""}c=[];if("checkbox"===b.Type||"data-checkbox"===b.Type)c=
|
11 |
-
|
12 |
-
(
|
13 |
-
function
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
jQuery.
|
28 |
-
b
|
29 |
-
|
30 |
-
var
|
31 |
-
|
32 |
-
|
33 |
-
b){
|
34 |
-
a.
|
35 |
-
a.options.
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
jQuery(
|
46 |
-
|
47 |
-
|
48 |
-
(
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
"
|
53 |
-
function
|
54 |
-
|
55 |
-
function
|
56 |
-
|
57 |
-
function
|
|
|
|
|
58 |
function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
|
59 |
function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
|
1 |
function frmFrontFormJS(){function l(a){var b=jQuery(this),c=b.attr("type");"submit"!==c&&a.preventDefault();a=b.parents("form:first");var d=b="",e=this.name;if("frm_prev_page"===e||-1!==this.className.indexOf("frm_prev_page"))b=jQuery(a).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"===e||-1!==this.className.indexOf("frm_save_draft"))d=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(d);"submit"!==c&&a.trigger("submit")}function n(){jQuery(this).parent().children(".frm_toggle_container").slideToggle("fast");
|
2 |
+
jQuery(this).toggleClass("active").children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").toggleClass("ui-icon-triangle-1-s ui-icon-triangle-1-e")}function p(){this.className=this.className.replace("frm_transparent","");this.parentNode.getElementsByTagName("a")[0].className.indexOf("frm_clear_file_link")}function v(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,
|
3 |
b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value="")):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):
|
4 |
+
"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function w(a){var b;b=this.name.replace("item_meta[","").split("]");var c=b[0],d=!1;jQuery('input[name="item_meta['+c+'][form]"]').length&&(c=b[2].replace("[",""),d=!0);"other"===c&&(c=d?b[3].replace("[",""):b[1].replace("[",""));if((b=c)&&"undefined"!==typeof b){c="reset";if(a.frmTriggered){if(a.frmTriggered==
|
5 |
+
b)return;c="persist"}q("und",b,null,jQuery(this),c);D(b)}}function q(a,b,c,d,e){var f;if("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[b])f=void 0;else{f=__FRMRULES[b];for(var g=[],h=0,k=f.length;h<k;h++){var l=f[h];if("undefined"!==typeof l)for(var E=0,n=l.Conditions.length;E<n;E++){var p=l.Conditions[E];p.HideField=l.Setting.FieldName;p.MatchType=l.MatchType;p.Show=l.Show;g.push(p)}}f=g}if("undefined"!==typeof f){if("undefined"===typeof c||null===c)c="go";"persist"!==e&&(m=[],
|
6 |
+
C=[]);e=d;g=!1;""===x&&"undefined"!==typeof e&&null!==e&&(1<e.length&&(e=e.eq(0)),g=e.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid"),"undefined"!==typeof g?(x=g.attr("id"),g=!0):g=!1);e=g;g=f.length;for(h=0;h<g;h++)f[h].FieldName===b?r(h,f[h],b,a,c,d):r(h,f[h],b,a,c),h===g-1&&(T(c),e&&(x=""))}}function r(a,b,c,d,e,f){b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+"]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID="frm_field_"+
|
7 |
+
b.HideField+"_container";b.hideBy="#";var g=!1;if("undefined"!==typeof f&&null!==f){1<f.length&&(f=f.eq(0));if("undefined"===typeof f.attr("name"))return;b.inputName=f.attr("name").replace("[other]","").replace("[]","");var h=f.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");h.length&&(h=h.find(".frm_field_"+b.FieldName+"_container"),b.containerID=h.attr("id"),b.hideContainerID=b.containerID.replace(b.FieldName,b.HideField),b.hiddenName=b.inputName.replace("["+b.FieldName+"]","["+
|
8 |
+
b.HideField+"]"))}else{u(b);g=!0;f=jQuery('input[name^="'+b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]');if(1>f.length&&(h="."+b.containerID,""!==x&&(h="#"+x+" "+h),h=jQuery(h),h.length)){f=h.find("input, textarea, select");if(f.length)if(""===x){var k="";f.each(function(){var c=jQuery(this).closest(".frm_form_field").attr("id");c!=k&&r(a,b,b.FieldName,d,e,jQuery(this));k=c})}else r(a,b,c,d,e,f);else m[b.hideContainerID][a]=!1,K(a,b,e);return}1<f.length&&(f=
|
9 |
+
f.eq(0))}u(b);null===document.getElementById(b.hideContainerID)&&(b.hideBy=".");if(b.FieldName!==c||"undefined"===typeof d||"und"===d)if(("radio"===b.Type||"data-radio"===b.Type)&&"radio"===f.attr("type"))d=jQuery('input[name="'+b.inputName+'"]:checked').val(),"undefined"===typeof d&&(d="");else if("select"===b.Type||"time"===b.Type||"data-select"===b.Type||"checkbox"!==b.Type&&"data-checkbox"!==b.Type)d=f.val();if("undefined"===typeof d){if(0===f.length)return;d=f.val()}if("undefined"===typeof d){if(!0===
|
10 |
+
g&&(c=jQuery("."+b.containerID+" input, ."+b.containerID+" select, ."+b.containerID+" textarea"),c.length)){c.each(function(){r(a,b,b.FieldName,d,e,jQuery(this))});return}d=""}c=[];if("checkbox"===b.Type||"data-checkbox"===b.Type)c=U(b.containerID,b.inputName),d=c.length?c:"";m[b.hideContainerID][a]=""===d||1>d.length?!1:{funcName:"getDataOpts",f:b,sel:d};if("checkbox"===b.Type||"data-checkbox"===b.Type&&"undefined"===typeof b.LinkedField)if(c=m[b.hideContainerID][a]=!1,""!==d)for("!="===b.Condition&&
|
11 |
+
(m[b.hideContainerID][a]=!0),f=0;f<d.length;f++)c=z(b.Condition,b.Value,d[f]),"!="===b.Condition?!0===m[b.hideContainerID][a]&&!1===c&&(m[b.hideContainerID][a]=!1):!1===m[b.hideContainerID][a]&&c&&(m[b.hideContainerID][a]=!0);else c=z(b.Condition,b.Value,""),!1===m[b.hideContainerID][a]&&c&&(m[b.hideContainerID][a]=!0);else if("undefined"!==typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"===typeof b.DataType||"data"===b.DataType)""===d?y(b.hideContainerID,b.hideBy,b.HideField,"hide"):
|
12 |
+
"data-radio"===b.Type?m[b.hideContainerID][a]="undefined"===typeof b.DataType?z(b.Condition,b.Value,d):{funcName:"getData",f:b,sel:d}:"data-checkbox"===b.Type||"data-select"===b.Type&&V(d)?(y(b.hideContainerID,b.hideBy,b.HideField,"show"),m[b.hideContainerID][a]=!0,L(b,d,1)):"data-select"===b.Type&&(m[b.hideContainerID][a]={funcName:"getData",f:b,sel:d})}else"undefined"===typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===d?"1":d,m[b.hideContainerID][a]=z(b.Condition,b.Value,d),b.Value=void 0):
|
13 |
+
m[b.hideContainerID][a]=z(b.Condition,b.Value,d);K(a,b,e)}function u(a){"undefined"===typeof m[a.hideContainerID]&&(m[a.hideContainerID]=[])}function y(a,b,c,d){-1===jQuery.inArray(a,C)&&(C[c]=a,a="."===b?jQuery("."+a):jQuery(document.getElementById(a)),"hide"===d&&a.hide(),a.find(".frm_data_field_container").empty())}function A(a,b){a.hide();if(-1===jQuery.inArray(a.attr("id"),C)){C[b.HideField]=a.attr("id");var c=M(a);if(c.length){c.prop("checked",!1).prop("selectedIndex",0);c.not(":checkbox, :radio, select").val("");
|
14 |
+
var d=!1;c.each(function(){"SELECT"==this.tagName&&null!==document.getElementById(this.id+"_chosen")&&jQuery(this).trigger("chosen:updated");!1===d&&jQuery(this).trigger({type:"change",frmTriggered:"dependent",selfTriggered:!0});d=!0})}}}function M(a){return a.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]:not([type=hidden])')}function F(a,b){var c=M(a);if(c.length){var d=c.data("frmval");"undefined"!==typeof d&&(c.is(":checkbox, :radio")?(c.val()==d||jQuery.isArray(d)&&
|
15 |
+
-1!==jQuery.inArray(c.val(),d))&&c.prop("checked",!0):c.val(d),c.trigger({type:"change",selfTriggered:!0}))}"undefined"!==typeof __FRMCALC&&(c=__FRMCALC,d=c.fieldsWithCalc[b.HideField],"undefined"!==typeof d&&N(c,d,[]));a.show()}function K(a,b,c){if("all"===b.MatchType||!1===m[b.hideContainerID][a])G.push({result:m[b.hideContainerID][a],show:b.Show,match:b.MatchType,FieldName:b.FieldName,HideField:b.HideField,hideContainerID:b.hideContainerID,hideBy:b.hideBy});else{var d="none";if("show"===b.Show){if(!0!==
|
16 |
+
m[b.hideContainerID][a]){O(m[b.hideContainerID][a],b.FieldName,c);return}d=""}"."===b.hideBy?(a=jQuery("."+b.hideContainerID),a.length&&("none"===d?A(a,b):F(a,b))):(a=document.getElementById(b.hideContainerID),null!==a&&("none"===d?A(jQuery(a),b):F(jQuery(a),b)))}}function T(a){jQuery.each(G,function(b,c){if("undefined"!==typeof c&&"undefined"!==typeof c.result){var d=jQuery(c.hideBy+c.hideContainerID),e=c.show;if(d.length){if("any"===c.match&&-1===jQuery.inArray(!0,m[c.hideContainerID])||"all"===
|
17 |
+
c.match&&-1<jQuery.inArray(!1,m[c.hideContainerID]))e="show"===c.show?"hide":"show";"show"===e?(F(d,c),!1!==typeof c.result&&!0!==typeof c.result&&O(c.result,c.FieldName,a)):A(d,c)}delete G[b]}})}function z(a,b,c){"undefined"===typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(b,c)&&(c=b);-1!==String(b).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(b=parseFloat(b),c=parseFloat(c));return"-1"!=String(b).indexOf(""")&&z(a,b.replace(""",'"'),c)?!0:{"==":function(a,b){return a==b},
|
18 |
+
"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){return b?-1!=b.indexOf(a):0},"not LIKE":function(a,b){return b?-1==b.indexOf(a):1}}[a](b,c)}function O(a,b,c){"getDataOpts"==a.funcName?W(a.f,a.sel,b,c):"getData"==a.funcName&&L(a.f,a.sel,0)}function L(a,b,c){var d=document.getElementById(a.hideContainerID),e=jQuery(d).find(".frm_data_field_container");if(0===e.length)return!0;c||e.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",
|
19 |
+
url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:b,field_id:a.LinkedField,current_field:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(a){c?e.append(a):e.html(a);var b=e.children("input"),h=b.val();d.style.display=""===a&&!c||""===h?"none":"";b.trigger({type:"change",selfTriggered:!0});return!0}})}function W(a,b,c,d){if(!("stop"==d&&-1<jQuery.inArray(a.HideField,H)&&a.parentField&&"hidden"==a.parentField.attr("type"))){var e=jQuery('input[name^="'+a.hiddenName+
|
20 |
+
'"], select[name^="'+a.hiddenName+'"]:not(":disabled"), textarea[name^="'+a.hiddenName+'"]'),f=[];e.each(function(){"radio"===this.type||"checkbox"===this.type?!0===this.checked&&f.push(jQuery(this).val()):f.push(jQuery(this).val())});if("select"!=a.DataType||"stop"!=d&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,H))){0===f.length&&(f="");H.push(a.HideField);var g=document.getElementById(a.hideContainerID),h=jQuery(g).find(".frm_data_field_container");
|
21 |
+
if(0===h.length&&e.length)return q(f,a.HideField,"stop",e),!1;if(""!==a.Value&&!z(a.Condition,a.Value,b))return g.style.display="none",h.html(""),q("",a.HideField,"stop",e),!1;h.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');var k=a.DataType;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",hide_field:c,entry_id:b,selected_field_id:a.LinkedField,field_id:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(b){h.html(b);
|
22 |
+
var c=h.find("select, input, textarea"),d=1;"hidden"==c.attr("type")&&(d=c.val());""===b||""===d?(g.style.display="none",f=""):"all"!=a.MatchType&&(g.style.display="");""!==b&&""!==f&&(jQuery.isArray(f)||(b=[],b.push(f),f=b),jQuery.each(f,function(a,b){if("undefined"!==typeof b&&""!==b)if("checkbox"==k||"radio"==k)1<c.length?c.filter('[value="'+b+'"]').attr("checked","checked"):c.val()==b&&c.attr("checked","checked");else if("select"==k){var d=c.children('option[value="'+b+'"]');d.length?d.prop("selected",
|
23 |
+
!0):f.splice(a,1)}else c.val(b)}));c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});c.trigger({type:"change",selfTriggered:!0})}})}}}function D(a){if("undefined"!==typeof __FRMCALC){var b=__FRMCALC;a=b.fields[a];if("undefined"!==typeof a){a=a.total;for(var c=[],d=0,e=a.length;d<e;d++){var f=document.getElementById("frm_field_"+b.calc[a[d]].field_id+"_container");null!==f&&0===f.offsetHeight||N(b,a[d],c)}}}}function N(a,b,c){var d=a.calc[b],e=d.calc,e=
|
24 |
+
X(d,e,a,c);a=d.calc_dec;e.indexOf(").toFixed(")&&(c=e.split(").toFixed("),P(c[1])&&(a=c[1],e=e.replace(").toFixed("+a,"")));e=parseFloat(eval(e));P(a)&&(e=e.toFixed(a));"undefined"===typeof e&&(e=0);a=jQuery(document.getElementById("field_"+b));a.val()!=e&&a.val(e).trigger({type:"change",frmTriggered:b,selfTriggered:!0})}function X(a,b,c,d){for(var e=0,f=a.fields.length;e<f;e++){var g=a.fields[e],h=c.fields[g],k="input"+c.fieldKeys[g];"checkbox"==h.type||"select"==h.type?k=k+":checked,select"+c.fieldKeys[g]+
|
25 |
+
" option:selected,"+k+"[type=hidden]":"radio"==h.type||"scale"==h.type?k=k+":checked,"+k+"[type=hidden]":"textarea"==h.type&&(k=k+",textarea"+c.fieldKeys[g]);d[g]=Y(k,g,h,c,d);if("undefined"===typeof d[g]||isNaN(d[g]))d[g]=0;h="["+g+"]";h=h.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(h,"g"),d[g])}return b}function Y(a,b,c,d,e){if("undefined"!==typeof e[b]&&0!==e[b])return e[b];jQuery(a).each(function(){"undefined"===typeof e[b]&&(e[b]=0);var a;a=!1;if("hidden"==this.type)""!==
|
26 |
+
I(this)&&(a=!0);else if("select"==c.type){var g=this.className;g&&-1<g.indexOf("frm_other_trigger")&&(a=!0)}else("checkbox"==c.type||"radio"==c.type)&&-1<this.id.indexOf("-other_")&&0>this.id.indexOf("-otext")&&(a=!0);a?(a=0,"select"==c.type?"hidden"==this.type?(g=!1,2<this.name.split("[").length&&(g=!0),g||(a=I(this))):a=jQuery(this).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=c.type&&"radio"!=c.type||"hidden"==this.type||(a=I(this))):a=jQuery(this).val();"date"==c.type&&
|
27 |
+
(g=jQuery.datepicker.parseDate(d.date,a),null!==g&&(e[b]=Math.ceil(g/864E5)));""!==a&&0!==a&&(a=a.trim(),a=parseFloat(a.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof a||isNaN(a)||""===a)a=0;e[b]+=a});return e[b]}function I(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function Q(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled","disabled");jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");
|
28 |
+
"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){b=b.replace(/^\s+|\s+$/g,"");0===b.indexOf("{")&&(b=jQuery.parseJSON(b));if(""===b||!b||"0"===b||"object"!=typeof b&&0===b.indexOf("<!DOCTYPE")){var d=document.getElementById("frm_loading");null!==d&&(b=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof b&&""!==b&&setTimeout(function(){jQuery(d).fadeIn("slow")},
|
29 |
+
2E3));b=jQuery(a).find(".g-recaptcha");b.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&b.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof b){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var e=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+e+"_container").replaceWith(b);frmFrontForm.scrollMsg(e);if("function"==
|
30 |
+
typeof frmThemeOverride_frmAfterSubmit){var e=jQuery('input[name="frm_page_order_'+e+'"]').val(),f=jQuery(b).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(f,e,b,a)}b=jQuery(a).find('input[name="id"]');b.length&&jQuery(document.getElementById("frm_edit_"+b.val())).find("a").addClass("frm_ajax_edited").click()}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");e=!0;jQuery(".form-field").removeClass("frm_blank_field");
|
31 |
+
jQuery(".form-field .frm_error").replaceWith("");var f="",g=!1,h=null,k;for(k in b)if(h=jQuery(a).find(jQuery(document.getElementById("frm_field_"+k+"_container"))),h.length){if(!h.is(":visible")){var l=h.closest(".frm_toggle_container");l.length&&l.prev(".frm_trigger").click()}h.is(":visible")&&(e=!1,""===f&&(frmFrontForm.scrollMsg(k,a,!0),f="#frm_field_"+k+"_container"),jQuery(a).find("#frm_field_"+k+"_container .g-recaptcha").length&&(g=!0,grecaptcha.reset()),h.addClass("frm_blank_field"),"function"==
|
32 |
+
typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(k,b):h.append('<div class="frm_error">'+b[k]+"</div>"))}else if("redirect"==k){window.location=b[k];return}!0!==g&&jQuery(a).find(".g-recaptcha").closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');e&&a.submit()}},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function Z(){R(jQuery(this),"clear")}function aa(){R(jQuery(this),
|
33 |
+
"replace")}function R(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function ba(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},
|
34 |
+
success:function(b){a.replaceWith(b)}});return!1}function ca(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){if("table"==b){var c=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,c.addColumn("number",frm_js.id));for(var e=a.fields.length,f="string",g=0,h=e;g<h;g++){var k=a.fields[g],f=S(k);c.addColumn(f,k.name)}g=!1;a.options.edit_link&&(g=!0,c.addColumn("string",a.options.edit_link));h=!1;a.options.delete_link&&(h=!0,c.addColumn("string",
|
35 |
+
a.options.delete_link));k=0;if(null!==a.entries){var l=a.entries.length;c.addRows(l);for(var m=0,n=0;n<l;n++){var k=0,p=a.entries[n];d&&(c.setCell(m,k,p.id),k++);for(var q=0,r=e;q<r;q++){var t=a.fields[q],f=S(t),t=p.metas[t.id];"number"!=f||null!==t&&""!==t?"boolean"==f&&(t=null===t||"false"==t||!1===t?!1:!0):t=0;c.setCell(m,k,t);k++}g&&("undefined"!==typeof p.editLink?c.setCell(m,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):c.setCell(m,k,""),k++);h&&("undefined"!==typeof p.deleteLink?
|
36 |
+
c.setCell(m,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" onclick="return confirm('+a.options.confirm+')">'+a.options.delete_link+"</a>"):c.setCell(m,k,""));m++}}else for(c.addRows(1),g=k=0,h=e;g<h;g++)0<k?c.setCell(0,k,""):c.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+a.options.form_id))).draw(c,a.graphOpts)}else da(a)}})}function S(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==
|
37 |
+
a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function da(a){var b=new google.visualization.DataTable,c=!1,d=!1,e=a.rows.length;if(0<e)if("table"==a.type){c=!0;b.addRows(a.rows[e-1][0]+1);for(var f=0;f<e;f++)b.setCell(a.rows[f])}else if("undefined"!=typeof a.rows[0].tooltip)for(var d=c=!0,g=0;g<e;g++){f=a.rows[g].tooltip;delete a.rows[g].tooltip;var h=Object.keys(a.rows[g]).map(function(b){return a.rows[g][b]});
|
38 |
+
a.rows[g]=h;a.rows[g].push(f)}e=a.cols.length;if(c){if(0<e)for(c=0;c<e;c++)f=a.cols[c],b.addColumn(f.type,f.name);d&&(b.addColumn({type:"string",role:"tooltip"}),b.addRows(a.rows))}else{b=[[]];for(d=0;d<e;d++)b[0].push(a.cols[d].name);b=b.concat(a.rows);b=google.visualization.arrayToDataTable(b)}d=a.type.charAt(0).toUpperCase()+a.type.slice(1)+"Chart";(new google.visualization[d](document.getElementById("chart_"+a.graph_id))).draw(b,a.options)}function ea(){var a=jQuery(this),b=a.data("fid");a.wrap('<div class="frm_file_names frm_uploaded_files">');
|
39 |
+
for(var c=a.get(0).files,d=0;d<c.length;d++)0===d?a.after(c[d].name+' <a href="#" class="frm_clear_file_link">'+frm_js.remove+"</a>"):a.after(c[d].name+"<br/>");a.hide();c=a.attr("name");c!="item_meta["+b+"][]"&&c.replace("item_meta[","").replace("[]","").split("][");a.closest(".frm_form_field").find(".frm_uploaded_files:last").after('<input name="'+c+'" data-fid="'+b+'"class="frm_transparent frm_multiple_file" multiple="multiple" type="file" />')}function fa(){ga(jQuery(this).parent(".frm_uploaded_files"))}
|
40 |
+
function ha(){jQuery(this).parent(".frm_file_names").replaceWith("");return!1}function ia(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key"),b=jQuery(document.getElementById(a)),c=b.find("input, select, textarea");b.fadeOut("slow",function(){b.remove();c.each(function(){if("file"!=this.type){var a=this.name.replace("item_meta[","").split("]")[2].replace("[","");D(a)}})});return!1}function ja(){var a=jQuery(this).data("parent"),b=0;0<jQuery(".frm_repeat_"+a).length&&(b=
|
41 |
+
1+parseInt(jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-","")),"undefined"==typeof b&&(b=1));jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(b){var d=b.html,e=jQuery(d).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(e);var f=["other"],g,h="reset";x=e.attr("id");jQuery(d).find("input, select, textarea").each(function(){"file"!=this.type&&(g=this.name.replace("item_meta[",
|
42 |
+
"").split("]")[2].replace("[",""),-1==jQuery.inArray(g,f)&&(f.push(g),q("und",g,null,jQuery(this),h),D(g),h="persist"))});x="";for(var e=0,k=b.logic.check.length;e<k;e++)-1==jQuery.inArray(b.logic.check[e],f)&&1>jQuery(d).find(".frm_field_"+b.logic.check[e]+"_container").length&&(q("und",b.logic.check[e],null,null,h),h="persist");0<jQuery(d).find(".star").length&&jQuery(".star").rating();0<jQuery(d).find(".frm_chzn").length&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});
|
43 |
+
"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,b)}});return!1}function ga(a){a.fadeOut("slow",function(){a.remove()})}function ka(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function V(a){return jQuery.isArray(a)&&(1<a.length||""!==a[0])}function P(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function U(a,b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+
|
44 |
+
b+'"]').each(function(){c.push(this.value)});else for(var d=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+b+'"]'),e=0;e<d.length;e++)("checkbox"==d[e].type&&d[e].checked||"hidden"==d[e].type)&&c.push(d[e].value);return c}var m=[],G=[],C=[],H=[],x="",J="",B=[];return{init:function(){jQuery(document).on("click",".frm_trigger",n);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?
|
45 |
+
jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",Z);jQuery(document).on("blur",".frm_toggle_default",aa);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ba);jQuery(document).on("change",".frm_multiple_file",ea);jQuery(document).on("click",".frm_clear_file_link",
|
46 |
+
ha);jQuery(document).on("click",".frm_remove_link",fa);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',w);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',l);jQuery(document).on("change",
|
47 |
+
'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',v);jQuery(document).on("change","input[type=file].frm_transparent",p);jQuery(document).on("click",".frm_remove_form_row",ia);jQuery(document).on("click",".frm_add_form_row",ja);jQuery("a[data-frmtoggle]").click(ka);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?
|
48 |
+
(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())})},submitForm:function(a){a.preventDefault();jQuery(this).find(".wp-editor-wrap").length&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();J=jQuery(this).find('input[name="frm_action"]').val();B=[];"function"==typeof frmThemeOverride_jsErrors&&(B=
|
49 |
+
frmThemeOverride_jsErrors(J,this));if(0===B.length)Q(this,J);else{jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");a=null;for(var b in B)a=jQuery(this).find(jQuery(document.getElementById("frm_field_"+b+"_container"))),a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,B):a.append('<div class="frm_error">'+B[b]+"</div>"))}},checkFormErrors:function(a,b){Q(a,
|
50 |
+
b)},scrollToID:function(a){a=jQuery(document.getElementById(a).offset());window.scrollTo(a.left,a.top)},scrollMsg:function(a,b,c){var d="";if(d="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find(document.getElementById("frm_field_"+a+"_container")).offset().top){d-=frm_js.offset;a=jQuery("html").css("margin-top");b=jQuery("body").css("margin-top");if(a||b)d=d-parseInt(a)-parseInt(b);if(d&&window.innerHeight&&(a=document.documentElement.scrollTop||
|
51 |
+
document.body.scrollTop,d>a+window.innerHeight||d<a))return"undefined"===typeof c?jQuery(window).scrollTop(d):jQuery("html,body").animate({scrollTop:d},500),!1}},hideCondFields:function(a){a=JSON.parse(a);for(var b=0,c=a.length;b<c;b++){var d=document.getElementById("frm_field_"+a[b]+"_container");null!==d?d.style.display="none":jQuery(".frm_field_"+a[b]+"_container").hide()}},checkDependent:function(a){a=JSON.parse(a);for(var b="reset",c=0,d=a.length;c<d;c++)q("und",a[c],null,null,b),b="persist"},
|
52 |
+
loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)for(var d=a[b[c]],e=b[c],f=0;f<d.length;f++)ca(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){var c=jQuery(a).parents("form:first").find('input[name="id"]');jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_fields_ajax_time_options",time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),
|
53 |
+
nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var f in a)c.find('option[value="'+f+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();
|
54 |
+
jQuery(document).ready(function(l){frmFrontForm.init()});
|
55 |
+
function frmEditEntry(l,n,p,v,w,q){var r=jQuery(document.getElementById("frm_edit_"+l)),u=r.html(),y=jQuery(document.getElementById(n+l)),A=y.html();y.html('<span class="frm-loading-img" id="'+n+l+'"></span><div class="frm_orig_content" style="display:none">'+A+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:p,entry_id:l,id:v,nonce:frm_js.nonce},success:function(A){y.children(".frm-loading-img").replaceWith(A);r.replaceWith('<span id="frm_edit_'+
|
56 |
+
l+'"><a onclick="frmCancelEdit('+l+",'"+n+"','"+frmFrontForm.escapeHtml(u)+"',"+p+","+v+",'"+q+'\')" class="'+q+'">'+w+"</a></span>")}})}
|
57 |
+
function frmCancelEdit(l,n,p,v,w,q){var r=jQuery(document.getElementById("frm_edit_"+l)),u=r.find("a"),y=u.html();u.hasClass("frm_ajax_edited")||(u=jQuery(document.getElementById(n+l)),u.children(".frm_forms").replaceWith(""),u.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));r.replaceWith('<a id="frm_edit_'+l+'" class="frm_edit_link '+q+'" href="javascript:frmEditEntry('+l+",'"+n+"',"+v+","+w+",'"+frmFrontForm.escapeHtml(y)+"','"+q+"')\">"+p+"</a>")}
|
58 |
+
function frmUpdateField(l,n,p,v,w){jQuery(document.getElementById("frm_update_field_"+l+"_"+n)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:n,value:p,nonce:frm_js.nonce},success:function(){""===v.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+w)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+n+"_"+w)).replaceWith(v)}})}
|
59 |
+
function frmDeleteEntry(l,n){jQuery(document.getElementById("frm_delete_"+l)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+l+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:l,nonce:frm_js.nonce},success:function(p){"success"==p.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+l)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+l)).replaceWith(p)}})}
|
60 |
function frmOnSubmit(l){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(l,this)}
|
61 |
function frm_resend_email(l,n){console.warn("DEPRECATED: function frm_resend_email in v2.0");$link=jQuery(document.getElementById("frm_resend_email"));$link.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:l,form_id:n,nonce:frm_js.nonce},success:function(l){$link.replaceWith(l)}})};
|
js/formidable_admin.js
CHANGED
@@ -757,25 +757,18 @@ function frmAdminBuildJS(){
|
|
757 |
function toggleRepeat(){
|
758 |
var field_id = jQuery(this).closest('li.frm_field_box').data('fid');
|
759 |
var main_form_id = jQuery('input[name="id"]').val();
|
|
|
760 |
|
761 |
if(this.checked){
|
762 |
jQuery('#frm_field_id_'+field_id+' .show_repeat_sec').fadeIn('slow');
|
763 |
jQuery(this).closest('li.frm_field_box').addClass('repeat_section').removeClass('no_repeat_section');
|
764 |
-
var form_id = jQuery('input[name="field_options[form_select_'+field_id+']"]').val();
|
765 |
-
var prev_form = jQuery('#frm_field_id_'+field_id).data('formid');
|
766 |
|
767 |
-
|
768 |
-
//create form
|
769 |
-
toggleFormid(field_id, '', main_form_id, 1);
|
770 |
-
}else{
|
771 |
-
toggleFormid(field_id, prev_form, main_form_id, 1);
|
772 |
-
}
|
773 |
}else{
|
774 |
if(confirm(frm_admin_js.conf_no_repeat)){
|
775 |
jQuery('#frm_field_id_'+field_id+' .show_repeat_sec').fadeOut('slow');
|
776 |
jQuery(this).closest('li.frm_field_box').removeClass('repeat_section').addClass('no_repeat_section');
|
777 |
-
|
778 |
-
toggleFormid(field_id, main_form_id, main_form_id, 0);
|
779 |
}else{
|
780 |
this.checked = true;
|
781 |
}
|
@@ -1724,8 +1717,8 @@ function frmAdminBuildJS(){
|
|
1724 |
|
1725 |
function checkCSVExtension(){
|
1726 |
var f = jQuery(this).val();
|
1727 |
-
var re =
|
1728 |
-
if
|
1729 |
jQuery('.show_csv').fadeIn();
|
1730 |
}else{
|
1731 |
jQuery('.show_csv').fadeOut();
|
757 |
function toggleRepeat(){
|
758 |
var field_id = jQuery(this).closest('li.frm_field_box').data('fid');
|
759 |
var main_form_id = jQuery('input[name="id"]').val();
|
760 |
+
var prev_form = jQuery('input[name="field_options[form_select_'+field_id+']"]').val();
|
761 |
|
762 |
if(this.checked){
|
763 |
jQuery('#frm_field_id_'+field_id+' .show_repeat_sec').fadeIn('slow');
|
764 |
jQuery(this).closest('li.frm_field_box').addClass('repeat_section').removeClass('no_repeat_section');
|
|
|
|
|
765 |
|
766 |
+
toggleFormid(field_id, prev_form, main_form_id, 1);
|
|
|
|
|
|
|
|
|
|
|
767 |
}else{
|
768 |
if(confirm(frm_admin_js.conf_no_repeat)){
|
769 |
jQuery('#frm_field_id_'+field_id+' .show_repeat_sec').fadeOut('slow');
|
770 |
jQuery(this).closest('li.frm_field_box').removeClass('repeat_section').addClass('no_repeat_section');
|
771 |
+
toggleFormid(field_id, prev_form, main_form_id, 0);
|
|
|
772 |
}else{
|
773 |
this.checked = true;
|
774 |
}
|
1717 |
|
1718 |
function checkCSVExtension(){
|
1719 |
var f = jQuery(this).val();
|
1720 |
+
var re = /\.csv$/i;
|
1721 |
+
if(f.match(re) !== null){
|
1722 |
jQuery('.show_csv').fadeIn();
|
1723 |
}else{
|
1724 |
jQuery('.show_csv').fadeOut();
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://formidablepro.com/donate
|
|
4 |
Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 2.0.
|
8 |
|
9 |
Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
|
10 |
|
@@ -89,6 +89,55 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
|
|
89 |
[See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
|
90 |
|
91 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.0.08 =
|
93 |
* Fix security vulnerability allowing shortcodes to be excuted inside a form https://research.g0blin.co.uk/?p=618&d=i4ziyggqao0oz0L0vpUTd8KZwrO2P9Mw
|
94 |
* Added frm_filter_final_form hook. This will need to be used to cover shortcodes that span multiple blocks of field HTML since we can't do a general shortcode replacement on the rendered form
|
4 |
Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 2.0.09
|
8 |
|
9 |
Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
|
10 |
|
89 |
[See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
|
90 |
|
91 |
== Changelog ==
|
92 |
+
= 2.0.09 =
|
93 |
+
* Add frm_time_to_check duplicate entries filter
|
94 |
+
* Allow custom JavaScript validation
|
95 |
+
* Add frm_do_html_shortcodes fiter
|
96 |
+
* Fix the duplicate entry check
|
97 |
+
* Include get_columns function in list tables for 4.3
|
98 |
+
* Use relative URLs in the stylesheet
|
99 |
+
* Make frm_fifth classes responsive
|
100 |
+
* Allow 0 to be saved in a checkbox field
|
101 |
+
* Fix saving forms as drafts
|
102 |
+
* **Pro Features:**
|
103 |
+
* Reduce database calls for Views
|
104 |
+
* Allow format for default [time] and [date] shortcodes ie [time format='H:i A' round=5]
|
105 |
+
* Include Dynamic List fields in calculation options
|
106 |
+
* Make file upload fields more responsive
|
107 |
+
* Improve repeating section styling
|
108 |
+
* Improve calculation triggering when fields involved are conditionally hidden
|
109 |
+
* Don't clear readonly fields or default values when hidden conditionally
|
110 |
+
* Don't trigger dynamic field values if there is other logic telling the field to be hidden
|
111 |
+
* Include Indonesian option for datepicker
|
112 |
+
* Allow the post author to be changed by the user ID field on edit
|
113 |
+
* Trigger calculations at the time a conditional field is shown
|
114 |
+
* Keep the value submitted in a dynamic list field
|
115 |
+
* Fix graphs that show multiple fields and define the x-axis
|
116 |
+
* Allow graphs to be included in the success message after ajax submit
|
117 |
+
* Conditionally show the max character setting in number fields based on whether HTML5 is enabled
|
118 |
+
* Allow scale fields to work in calculations across multiple pages
|
119 |
+
* Turn off ajax submit if repeating section includes a file
|
120 |
+
* Fix entry creation date format on import
|
121 |
+
* Fix filtering by a checkbox field in the frm-stats shortcode
|
122 |
+
* Fix logic for third-level fields with conditional logic inside a repeating section
|
123 |
+
* Make sure conditional logic only affects the newly added row when triggered after a row is added
|
124 |
+
* Make sure orphaned data is deleted when switching divider to repeating/non-repeating
|
125 |
+
* Allow drafts=both with user_id filter in View shortcode
|
126 |
+
* Fix conditionally required fields when option includes quote
|
127 |
+
* Fix date field errors on multi-page form that submits with Ajax
|
128 |
+
* Prevent the JetPack conflict with the shortcodes module
|
129 |
+
* Fix sorting in dependent Dynamic fields
|
130 |
+
* Registration add-on login form styling
|
131 |
+
* Fix inline scale field labels
|
132 |
+
* Fix spacing issue with repeating section grid
|
133 |
+
* Fix truncation with special characters
|
134 |
+
* Fix importing repeating sections and embedded forms
|
135 |
+
* Fix readonly checkboxes in calculations
|
136 |
+
* Don't show empty custom field rows in the post settings
|
137 |
+
* A few fixes to the formresults shortcode including the file display
|
138 |
+
* Fix error when duplicating a section without any included fields
|
139 |
+
* Fix timezones for searching by entry creation and updated dates in a view
|
140 |
+
|
141 |
= 2.0.08 =
|
142 |
* Fix security vulnerability allowing shortcodes to be excuted inside a form https://research.g0blin.co.uk/?p=618&d=i4ziyggqao0oz0L0vpUTd8KZwrO2P9Mw
|
143 |
* Added frm_filter_final_form hook. This will need to be used to cover shortcodes that span multiple blocks of field HTML since we can't do a general shortcode replacement on the rendered form
|