Formidable Forms – Form Builder for WordPress - Version 2.0rc9

Version Description

Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.0rc9
Comparing to
See all releases

Code changes from version 2.0rc8 to 2.0rc9

classes/controllers/FrmAppController.php CHANGED
@@ -303,6 +303,7 @@ class FrmAppController {
303
  'confirm' => __( 'Are you sure?', 'formidable' ),
304
  'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
305
  'conf_delete_sec' => __( 'WARNING: This will delete all fields inside of the section as well.', 'formidable' ),
 
306
  'default_unique' => $frm_settings->unique_msg,
307
  'default_conf' => __( 'The entered values do not match', 'formidable' ),
308
  'enter_email' => __( 'Enter Email', 'formidable' ),
303
  'confirm' => __( 'Are you sure?', 'formidable' ),
304
  'conf_delete' => __( 'Are you sure you want to delete this field and all data associated with it?', 'formidable' ),
305
  'conf_delete_sec' => __( 'WARNING: This will delete all fields inside of the section as well.', 'formidable' ),
306
+ 'conf_no_repeat' => __( 'Warning: If you have entries with multiple rows, all but the first row will be lost.', 'formidable' ),
307
  'default_unique' => $frm_settings->unique_msg,
308
  'default_conf' => __( 'The entered values do not match', 'formidable' ),
309
  'enter_email' => __( 'Enter Email', 'formidable' ),
classes/controllers/FrmEntriesController.php CHANGED
@@ -86,7 +86,7 @@ class FrmEntriesController {
86
  }
87
 
88
  if ( $form_col->type == 'form' && isset( $form_col->field_options['form_select'] ) && ! empty( $form_col->field_options['form_select'] ) ) {
89
- $sub_form_cols = FrmField::get_all_for_form($form_col->field_options['form_select']);
90
 
91
  if ( $sub_form_cols ) {
92
  foreach ( $sub_form_cols as $k => $sub_form_col ) {
@@ -203,7 +203,7 @@ class FrmEntriesController {
203
  public static function sortable_columns() {
204
  $form_id = FrmEntriesHelper::get_current_form_id();
205
 
206
- $fields = FrmField::get_all_for_form($form_id);
207
 
208
  $columns = array(
209
  $form_id .'_id' => 'id',
86
  }
87
 
88
  if ( $form_col->type == 'form' && isset( $form_col->field_options['form_select'] ) && ! empty( $form_col->field_options['form_select'] ) ) {
89
+ $sub_form_cols = FrmField::get_all_for_form( $form_col->field_options['form_select'] );
90
 
91
  if ( $sub_form_cols ) {
92
  foreach ( $sub_form_cols as $k => $sub_form_col ) {
203
  public static function sortable_columns() {
204
  $form_id = FrmEntriesHelper::get_current_form_id();
205
 
206
+ $fields = FrmField::get_all_for_form( $form_id );
207
 
208
  $columns = array(
209
  $form_id .'_id' => 'id',
classes/controllers/FrmFormsController.php CHANGED
@@ -562,7 +562,7 @@ class FrmFormsController {
562
  FrmFormsHelper::auto_add_end_section_fields( $form, $fields, $reset_fields );
563
 
564
  if ( $reset_fields ) {
565
- $fields = FrmField::get_all_for_form($form->id);
566
  }
567
 
568
  unset($end_section_values, $last_order, $open, $reset_fields);
562
  FrmFormsHelper::auto_add_end_section_fields( $form, $fields, $reset_fields );
563
 
564
  if ( $reset_fields ) {
565
+ $fields = FrmField::get_all_for_form( $form->id, '', 'exclude' );
566
  }
567
 
568
  unset($end_section_values, $last_order, $open, $reset_fields);
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0rc8';
14
 
15
  /**
16
  * @since 1.07.02
@@ -84,6 +84,7 @@ class FrmAppHelper {
84
  * @since 2.0
85
  */
86
  public static function update_message($features, $class = '') {
 
87
  if ( ! self::pro_is_installed() ) {
88
  include(self::plugin_path() .'/classes/views/shared/update_message.php');
89
  }
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0rc9';
14
 
15
  /**
16
  * @since 1.07.02
84
  * @since 2.0
85
  */
86
  public static function update_message($features, $class = '') {
87
+ return; // hide the upgrade messages for now
88
  if ( ! self::pro_is_installed() ) {
89
  include(self::plugin_path() .'/classes/views/shared/update_message.php');
90
  }
classes/helpers/FrmEntriesListHelper.php CHANGED
@@ -29,14 +29,14 @@ class FrmEntriesListHelper extends FrmListHelper {
29
  $s_query = FrmProEntriesHelper::get_search_str( $s_query, $s, $form_id, $fid);
30
  }
31
 
32
- $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : $default_orderby;
33
  if ( strpos($orderby, 'meta') !== false ) {
34
  $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
35
  $orderby .= in_array( $order_field_type, array( 'number', 'scale') ) ? ' +0 ' : '';
36
  }
37
 
38
- $order = isset( $_REQUEST['order'] ) ? $_REQUEST['order'] : $default_order;
39
- $order = FrmAppHelper::esc_order( $orderby .' '. $order );
40
 
41
  $page = $this->get_pagenum();
42
  $start = (int) isset( $_REQUEST['start'] ) ? absint( $_REQUEST['start'] ) : ( ( $page - 1 ) * $per_page );
29
  $s_query = FrmProEntriesHelper::get_search_str( $s_query, $s, $form_id, $fid);
30
  }
31
 
32
+ $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_title( $_REQUEST['orderby'] ) : $default_orderby;
33
  if ( strpos($orderby, 'meta') !== false ) {
34
  $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
35
  $orderby .= in_array( $order_field_type, array( 'number', 'scale') ) ? ' +0 ' : '';
36
  }
37
 
38
+ $order = isset( $_REQUEST['order'] ) ? sanitize_title( $_REQUEST['order'] ) : $default_order;
39
+ $order = ' ORDER BY ' . $orderby . ' ' . $order;
40
 
41
  $page = $this->get_pagenum();
42
  $start = (int) isset( $_REQUEST['start'] ) ? absint( $_REQUEST['start'] ) : ( ( $page - 1 ) * $per_page );
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -23,17 +23,10 @@ class FrmFieldsHelper {
23
  public static function pro_field_selection() {
24
  return apply_filters('frm_pro_available_fields', array(
25
  'end_divider' => array(
26
- 'name' => __( 'End Section', 'formidable' ),
27
- 'switch_from' => 'divider',
28
- ),
29
- 'divider' => array(
30
- 'name' => __( 'Section', 'formidable' ),
31
- 'types' => array(
32
- '' => __( 'Heading', 'formidable' ),
33
- 'slide' => __( 'Collapsible', 'formidable' ),
34
- 'repeat' => __( 'Repeatable', 'formidable' ),
35
- ),
36
- ),
37
  'break' => __( 'Page Break', 'formidable' ),
38
  'file' => __( 'File Upload', 'formidable' ),
39
  'rte' => __( 'Rich Text', 'formidable' ),
@@ -43,15 +36,7 @@ class FrmFieldsHelper {
43
  'time' => __( 'Time', 'formidable' ),
44
  'image' => __( 'Image URL', 'formidable' ),
45
  'scale' => __( 'Scale', 'formidable' ),
46
- 'data' => array(
47
- 'name' => __( 'Dynamic Field', 'formidable' ),
48
- 'types' => array(
49
- 'select' => __( 'Dropdown', 'formidable' ),
50
- 'radio' => __( 'Radio Buttons', 'formidable' ),
51
- 'checkbox' => __( 'Checkboxes', 'formidable' ),
52
- 'data' => __( 'List', 'formidable' ),
53
- ),
54
- ),
55
  'form' => __( 'Embed Form', 'formidable' ),
56
  'hidden' => __( 'Hidden Field', 'formidable' ),
57
  'user_id' => __( 'User ID (hidden)', 'formidable' ),
23
  public static function pro_field_selection() {
24
  return apply_filters('frm_pro_available_fields', array(
25
  'end_divider' => array(
26
+ 'name' => __( 'End Section', 'formidable' ),
27
+ 'switch_from' => 'divider',
28
+ ),
29
+ 'divider' => __( 'Section', 'formidable' ),
 
 
 
 
 
 
 
30
  'break' => __( 'Page Break', 'formidable' ),
31
  'file' => __( 'File Upload', 'formidable' ),
32
  'rte' => __( 'Rich Text', 'formidable' ),
36
  'time' => __( 'Time', 'formidable' ),
37
  'image' => __( 'Image URL', 'formidable' ),
38
  'scale' => __( 'Scale', 'formidable' ),
39
+ 'data' => __( 'Dynamic Field', 'formidable' ),
 
 
 
 
 
 
 
 
40
  'form' => __( 'Embed Form', 'formidable' ),
41
  'hidden' => __( 'Hidden Field', 'formidable' ),
42
  'user_id' => __( 'User ID (hidden)', 'formidable' ),
classes/helpers/FrmFormActionsHelper.php CHANGED
@@ -28,11 +28,7 @@ class FrmFormActionsHelper {
28
  $args['menu_order'] = $form_id;
29
  }
30
 
31
- $actions = FrmAppHelper::check_cache(serialize($args), 'frm_actions');
32
- if ( false == $actions ) {
33
- $actions = get_posts( $args );
34
- wp_cache_set(serialize($args), $actions, 'frm_actions', 300);
35
- }
36
 
37
  if ( ! $actions ) {
38
  return array();
28
  $args['menu_order'] = $form_id;
29
  }
30
 
31
+ $actions = FrmAppHelper::check_cache( serialize( $args ), 'frm_actions', $args, 'get_posts' );
 
 
 
 
32
 
33
  if ( ! $actions ) {
34
  return array();
classes/helpers/FrmXMLHelper.php CHANGED
@@ -142,7 +142,7 @@ class FrmXMLHelper {
142
  // Keep track of whether this specific form was updated or not
143
  $imported['form_status'][$form_id] = 'updated';
144
 
145
- $form_fields = FrmField::get_all_for_form($form_id);
146
  $old_fields = array();
147
  foreach ( $form_fields as $f ) {
148
  $old_fields[$f->id] = $f;
@@ -762,6 +762,10 @@ class FrmXMLHelper {
762
  // Format the email data
763
  self::format_email_data( $atts, $notification );
764
 
 
 
 
 
765
  // Setup the new notification
766
  $new_notification = array();
767
  self::setup_new_notification( $new_notification, $notification, $atts );
@@ -851,10 +855,6 @@ class FrmXMLHelper {
851
  unset( $add_field );
852
  }
853
 
854
- if ( isset( $notification['twilio'] ) && $notification['twilio'] ) {
855
- $new_notification['post_content'] = $notification['twilio'];
856
- }
857
-
858
  // Set reply to
859
  $new_notification['post_content']['reply_to'] = $atts['reply_to'];
860
 
142
  // Keep track of whether this specific form was updated or not
143
  $imported['form_status'][$form_id] = 'updated';
144
 
145
+ $form_fields = FrmField::get_all_for_form( $form_id );
146
  $old_fields = array();
147
  foreach ( $form_fields as $f ) {
148
  $old_fields[$f->id] = $f;
762
  // Format the email data
763
  self::format_email_data( $atts, $notification );
764
 
765
+ if ( isset( $notification['twilio'] ) && $notification['twilio'] ) {
766
+ do_action( 'frm_create_twilio_action', $atts, $notification );
767
+ }
768
+
769
  // Setup the new notification
770
  $new_notification = array();
771
  self::setup_new_notification( $new_notification, $notification, $atts );
855
  unset( $add_field );
856
  }
857
 
 
 
 
 
858
  // Set reply to
859
  $new_notification['post_content']['reply_to'] = $atts['reply_to'];
860
 
classes/models/FrmDb.php CHANGED
@@ -72,7 +72,7 @@ class FrmDb {
72
  /* Create/Upgrade Fields Table */
73
  $sql[] = 'CREATE TABLE '. $this->fields .' (
74
  id int(11) NOT NULL auto_increment,
75
- field_key varchar(255) default NULL,
76
  name text default NULL,
77
  description text default NULL,
78
  type text default NULL,
@@ -91,7 +91,7 @@ class FrmDb {
91
  /* Create/Upgrade Forms Table */
92
  $sql[] = 'CREATE TABLE '. $this->forms .' (
93
  id int(11) NOT NULL auto_increment,
94
- form_key varchar(255) default NULL,
95
  name varchar(255) default NULL,
96
  description text default NULL,
97
  parent_form_id int(11) default 0,
@@ -109,7 +109,7 @@ class FrmDb {
109
  /* Create/Upgrade Items Table */
110
  $sql[] = 'CREATE TABLE '. $this->entries .' (
111
  id int(11) NOT NULL auto_increment,
112
- item_key varchar(255) default NULL,
113
  name varchar(255) default NULL,
114
  description text default NULL,
115
  ip text default NULL,
@@ -467,6 +467,14 @@ class FrmDb {
467
  }
468
  unset($roles, $frm_roles);
469
 
 
 
 
 
 
 
 
 
470
  do_action('frm_after_uninstall');
471
  return true;
472
  }
72
  /* Create/Upgrade Fields Table */
73
  $sql[] = 'CREATE TABLE '. $this->fields .' (
74
  id int(11) NOT NULL auto_increment,
75
+ field_key varchar(100) default NULL,
76
  name text default NULL,
77
  description text default NULL,
78
  type text default NULL,
91
  /* Create/Upgrade Forms Table */
92
  $sql[] = 'CREATE TABLE '. $this->forms .' (
93
  id int(11) NOT NULL auto_increment,
94
+ form_key varchar(100) default NULL,
95
  name varchar(255) default NULL,
96
  description text default NULL,
97
  parent_form_id int(11) default 0,
109
  /* Create/Upgrade Items Table */
110
  $sql[] = 'CREATE TABLE '. $this->entries .' (
111
  id int(11) NOT NULL auto_increment,
112
+ item_key varchar(100) default NULL,
113
  name varchar(255) default NULL,
114
  description text default NULL,
115
  ip text default NULL,
467
  }
468
  unset($roles, $frm_roles);
469
 
470
+ // delete actions, views, and styles
471
+ $post_ids = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->posts .' WHERE post_type in (%s, %s, %s)', FrmFormActionsController::$action_post_type, FrmStylesController::$post_type, 'frm_display' ) );
472
+ foreach( $post_ids as $post_id ) {
473
+ // Delete's each post.
474
+ wp_delete_post( $post_id, true );
475
+ }
476
+ unset( $post_ids );
477
+
478
  do_action('frm_after_uninstall');
479
  return true;
480
  }
classes/models/FrmEntry.php CHANGED
@@ -12,6 +12,10 @@ class FrmEntry {
12
 
13
  $values = apply_filters('frm_pre_create_entry', $values);
14
 
 
 
 
 
15
  $new_values = array(
16
  'item_key' => FrmAppHelper::get_unique_key($values['item_key'], $wpdb->prefix .'frm_items', 'item_key'),
17
  'name' => isset($values['name']) ? $values['name'] : $values['item_key'],
@@ -80,7 +84,7 @@ class FrmEntry {
80
  }
81
 
82
  /**
83
- * check for duplicate entries created in the last 5 minutes
84
  * @return boolean
85
  */
86
  public static function is_duplicate($new_values, $values) {
@@ -89,7 +93,7 @@ class FrmEntry {
89
  }
90
 
91
  $check_val = $new_values;
92
- $check_val['created_at >'] = date('Y-m-d H:i:s', (strtotime($new_values['created_at']) - (60*5)));
93
 
94
  unset($check_val['created_at'], $check_val['updated_at']);
95
  unset($check_val['is_draft'], $check_val['id'], $check_val['item_key']);
12
 
13
  $values = apply_filters('frm_pre_create_entry', $values);
14
 
15
+ if ( ! isset( $values['item_key'] ) ) {
16
+ $values['item_key'] = '';
17
+ }
18
+
19
  $new_values = array(
20
  'item_key' => FrmAppHelper::get_unique_key($values['item_key'], $wpdb->prefix .'frm_items', 'item_key'),
21
  'name' => isset($values['name']) ? $values['name'] : $values['item_key'],
84
  }
85
 
86
  /**
87
+ * check for duplicate entries created in the last minute
88
  * @return boolean
89
  */
90
  public static function is_duplicate($new_values, $values) {
93
  }
94
 
95
  $check_val = $new_values;
96
+ $check_val['created_at >'] = date( 'Y-m-d H:i:s', ( strtotime( $new_values['created_at'] ) - 60 ) );
97
 
98
  unset($check_val['created_at'], $check_val['updated_at']);
99
  unset($check_val['is_draft'], $check_val['id'], $check_val['item_key']);
classes/models/FrmField.php CHANGED
@@ -256,7 +256,7 @@ class FrmField{
256
  return $results;
257
  }
258
 
259
- public static function get_all_for_form($form_id, $limit = '', $inc_sub = 'exclude') {
260
  if ( ! (int) $form_id ) {
261
  return array();
262
  }
@@ -280,9 +280,12 @@ class FrmField{
280
  }
281
 
282
  self::$use_cache = false;
283
- $results = self::getAll( array( 'fi.form_id' => (int) $form_id), 'field_order', $limit);
 
 
284
  self::$use_cache = true;
285
- self::include_sub_fields($results, $inc_sub, 'all');
 
286
 
287
  if ( empty($limit) ) {
288
  set_transient('frm_all_form_fields_'. $form_id . $inc_sub, $results, 60*60*6);
@@ -303,7 +306,7 @@ class FrmField{
303
  }
304
 
305
  if ( $type == 'all' ) {
306
- $sub_fields = self::get_all_for_form($field->field_options['form_select']);
307
  } else {
308
  $sub_fields = self::get_all_types_in_form($field->form_id, $type);
309
  }
@@ -391,7 +394,7 @@ class FrmField{
391
  }
392
 
393
  unset($form_id);
394
- }else{
395
  wp_cache_set($results->id, $results, 'frm_field');
396
  wp_cache_set($results->field_key, $results, 'frm_field');
397
 
256
  return $results;
257
  }
258
 
259
+ public static function get_all_for_form( $form_id, $limit = '', $inc_sub = 'exclude' ) {
260
  if ( ! (int) $form_id ) {
261
  return array();
262
  }
280
  }
281
 
282
  self::$use_cache = false;
283
+
284
+ // get the fields, but make sure to not get the subfields if set to exclude
285
+ $results = self::getAll( array( 'fi.form_id' => absint( $form_id ) ), 'field_order', $limit );
286
  self::$use_cache = true;
287
+
288
+ self::include_sub_fields( $results, $inc_sub, 'all' );
289
 
290
  if ( empty($limit) ) {
291
  set_transient('frm_all_form_fields_'. $form_id . $inc_sub, $results, 60*60*6);
306
  }
307
 
308
  if ( $type == 'all' ) {
309
+ $sub_fields = self::get_all_for_form( $field->field_options['form_select'] );
310
  } else {
311
  $sub_fields = self::get_all_types_in_form($field->form_id, $type);
312
  }
394
  }
395
 
396
  unset($form_id);
397
+ } else if ( $results ) {
398
  wp_cache_set($results->id, $results, 'frm_field');
399
  wp_cache_set($results->field_key, $results, 'frm_field');
400
 
classes/models/FrmStyle.php CHANGED
@@ -203,13 +203,13 @@ class FrmStyle{
203
  return $style;
204
  }
205
 
206
- public function get_all() {
207
  $post_atts = array(
208
- 'post_type' => FrmStylesController::$post_type,
209
- 'post_status' => 'publish',
210
- 'numberposts' => 99,
211
- 'order_by' => 'title',
212
- 'order' => 'ASC',
213
  );
214
 
215
  $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts');
@@ -269,7 +269,7 @@ class FrmStyle{
269
 
270
  public function get_default_style($styles = null) {
271
  if ( ! isset($styles) ) {
272
- $styles = $this->get_all();
273
  }
274
 
275
  foreach ( $styles as $style ) {
203
  return $style;
204
  }
205
 
206
+ public function get_all( $orderby = 'title', $order = 'ASC', $limit = 99 ) {
207
  $post_atts = array(
208
+ 'post_type' => FrmStylesController::$post_type,
209
+ 'post_status' => 'publish',
210
+ 'numberposts' => $limit,
211
+ 'orderby' => $orderby,
212
+ 'order' => $order,
213
  );
214
 
215
  $temp_styles = FrmAppHelper::check_cache(serialize($post_atts), 'frm_styles', $post_atts, 'get_posts');
269
 
270
  public function get_default_style($styles = null) {
271
  if ( ! isset($styles) ) {
272
+ $styles = $this->get_all( 'menu_order', 'DESC', 1 );
273
  }
274
 
275
  foreach ( $styles as $style ) {
classes/views/frm-settings/license_box.php CHANGED
@@ -2,8 +2,8 @@
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
- <p class="alignright"><?php printf(__( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="http://formidablepro.com">', '</a>') ?> &#187;</p>
6
- <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you style forms, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
  <p>Already signed up? <a href="http://formidablepro.com/knowledgebase/manually-install-formidable-pro/" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
2
  <?php if ( ! is_multisite() || is_super_admin() ) { ?>
3
  <div class="postbox">
4
  <div class="inside">
5
+ <p class="alignright"><?php printf( __( '%1$sClick here%2$s to get it now', 'formidable' ), '<a href="http://formidablepro.com">', '</a>' ) ?> &#187;</p>
6
+ <p><?php _e( 'Ready to take your forms to the next level?<br/>Formidable Forms will help you create views, manage data, and get reports.', 'formidable' ) ?></p>
7
 
8
  <p>Already signed up? <a href="http://formidablepro.com/knowledgebase/manually-install-formidable-pro/" target="_blank"><?php _e( 'Click here', 'formidable' ) ?></a> to get installation instructions and download the pro version.</p>
9
  </div>
classes/views/styles/_field-labels.php CHANGED
@@ -17,7 +17,7 @@
17
  <div class="field-group clearfix clear">
18
  <label><?php _e( 'Position', 'formidable' ) ?></label>
19
  <select name="<?php echo esc_attr( $frm_style->get_field_name('position') ) ?>" id="frm_position">
20
- <?php foreach ( array( 'none' => __( 'top', 'formidable' ), 'left' => __( 'left', 'formidable' ), 'right' => __( 'right', 'formidable' ) ) as $pos => $pos_label ) { ?>
21
  <option value="<?php echo esc_attr( $pos ) ?>" <?php selected($style->post_content['position'], $pos) ?>><?php echo $pos_label ?></option>
22
  <?php } ?>
23
  </select>
17
  <div class="field-group clearfix clear">
18
  <label><?php _e( 'Position', 'formidable' ) ?></label>
19
  <select name="<?php echo esc_attr( $frm_style->get_field_name('position') ) ?>" id="frm_position">
20
+ <?php foreach ( array( 'none' => __( 'top', 'formidable' ), 'left' => __( 'left', 'formidable' ), 'right' => __( 'right', 'formidable' ), 'no_label' => __( 'none', 'formidable' ) ) as $pos => $pos_label ) { ?>
21
  <option value="<?php echo esc_attr( $pos ) ?>" <?php selected($style->post_content['position'], $pos) ?>><?php echo $pos_label ?></option>
22
  <?php } ?>
23
  </select>
classes/views/styles/show.php CHANGED
@@ -4,33 +4,7 @@
4
 
5
  <?php include(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
 
7
- <div class="manage-menus">
8
- <span class="add-edit-menu-action">
9
- <?php
10
- if ( count( $styles ) < 2 && ! empty( $style->ID ) ) {
11
- printf(__( 'Edit your style below, or %1$screate a new style%2$s.', 'formidable' ), '<a href="?page=formidable-styles&frm_action=new_style">', '</a>');
12
-
13
- } else { ?>
14
- <form method="get">
15
- <input type="hidden" name="page" value="<?php echo esc_attr( $_GET['page'] ) ?>"/>
16
- <input type="hidden" name="frm_action" value="edit" />
17
- <label class="selected-menu"><?php _e( 'Select a style to edit:', 'formidable' ); ?></label>
18
- <select name="id">
19
- <option value=""><?php _e( '&mdash; Select &mdash;') ?></option>
20
- <?php foreach ( $styles as $s ) { ?>
21
- <option value="<?php echo esc_attr( $s->ID ) ?>" <?php selected($s->ID, $style->ID) ?>><?php echo esc_html( $s->post_title . (empty($s->menu_order) ? '' : ' ('. __( 'default', 'formidable' ) .')') ) ?></option>
22
- <?php } ?>
23
- </select>
24
- <span class="submit-btn">
25
- <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Select', 'formidable' ) ?>" />
26
- </span>
27
- </form>
28
- <span class="add-new-menu-action"><?php printf(__( 'or %1$screate a new style%2$s.', 'formidable' ), '<a href="?page=formidable-styles&frm_action=new_style">', '</a>'); ?></span>
29
- <?php
30
- } ?>
31
-
32
- </span>
33
- </div><!-- /manage-menus -->
34
 
35
  <form id="frm_styling_form" action="" name="frm_styling_form" method="post">
36
  <input type="hidden" name="ID" value="<?php echo esc_attr( $style->ID ) ?>" />
4
 
5
  <?php include(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
 
7
+ <?php do_action( 'frm_style_switcher', $style, $styles ) ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  <form id="frm_styling_form" action="" name="frm_styling_form" method="post">
10
  <input type="hidden" name="ID" value="<?php echo esc_attr( $style->ID ) ?>" />
css/_single_theme.css.php CHANGED
@@ -22,7 +22,7 @@ if ( isset($_GET['frm_style_setting']) || isset($_GET['flat']) ) {
22
  }
23
 
24
  $important = empty($important_style) ? '' : ' !important';
25
- $label_margin = (int) $width + 15;
26
 
27
  $minus_icons = FrmStylesHelper::minus_icons();
28
  $arrow_icons = FrmStylesHelper::arrow_icons();
@@ -119,6 +119,11 @@ if ( ! isset($collapse_icon) ) {
119
  content:"\e<?php echo isset($minus_icons[$repeat_icon]) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ?>";
120
  }
121
 
 
 
 
 
 
122
  .<?php echo $style_class ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
123
  content:"\e<?php echo isset($arrow_icons[$collapse_icon]) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ?>";
124
  }
22
  }
23
 
24
  $important = empty($important_style) ? '' : ' !important';
25
+ $label_margin = (int) $width + 10;
26
 
27
  $minus_icons = FrmStylesHelper::minus_icons();
28
  $arrow_icons = FrmStylesHelper::arrow_icons();
119
  content:"\e<?php echo isset($minus_icons[$repeat_icon]) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ?>";
120
  }
121
 
122
+ .<?php echo $style_class ?> .frm_icon_font.frm_minus_icon:before,
123
+ .<?php echo $style_class ?> .frm_icon_font.frm_plus_icon:before{
124
+ color:#<?php echo $submit_text_color . $important ?>;
125
+ }
126
+
127
  .<?php echo $style_class ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
128
  content:"\e<?php echo isset($arrow_icons[$collapse_icon]) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ?>";
129
  }
css/custom_theme.css.php CHANGED
@@ -88,10 +88,6 @@ $defaults = $default_style->post_content;
88
  margin-top:0px !important;
89
  }
90
 
91
- .with_frm_style .frm_section_heading.frm_hide_section .frm_description.frm_section_spacing{
92
- display:none;
93
- }
94
-
95
  .with_frm_style .frm_hidden_container label.frm_primary_label,
96
  .with_frm_style .frm_pos_hidden,
97
  .frm_hidden_container label.frm_primary_label{
@@ -709,7 +705,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
709
  -webkit-box-sizing:border-box;
710
  -moz-box-sizing:border-box;
711
  box-sizing:border-box;
712
- max-width:25%;
713
  margin-right:0;
714
  margin-left:0;
715
  }
@@ -736,7 +732,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
736
  .frm_form_field.frm_right_container input,
737
  .frm_form_field.frm_right_container select,
738
  .frm_form_field.frm_right_container textarea{
739
- max-width:75%;
740
  }
741
 
742
  .frm_form_field.frm_left_third,
@@ -876,8 +872,8 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
876
  border-right:none;
877
  }
878
 
879
- .frm_grid,
880
- .frm_grid_odd{
881
  border-top:none;
882
  }
883
 
88
  margin-top:0px !important;
89
  }
90
 
 
 
 
 
91
  .with_frm_style .frm_hidden_container label.frm_primary_label,
92
  .with_frm_style .frm_pos_hidden,
93
  .frm_hidden_container label.frm_primary_label{
705
  -webkit-box-sizing:border-box;
706
  -moz-box-sizing:border-box;
707
  box-sizing:border-box;
708
+ max-width:29%;
709
  margin-right:0;
710
  margin-left:0;
711
  }
732
  .frm_form_field.frm_right_container input,
733
  .frm_form_field.frm_right_container select,
734
  .frm_form_field.frm_right_container textarea{
735
+ max-width:70%;
736
  }
737
 
738
  .frm_form_field.frm_left_third,
872
  border-right:none;
873
  }
874
 
875
+ .with_frm_style .frm_grid,
876
+ .with_frm_style .frm_grid_odd{
877
  border-top:none;
878
  }
879
 
css/frm_admin.css CHANGED
@@ -137,7 +137,8 @@ input.frm_insert_in_template{
137
  clear:both;
138
  }
139
 
140
- .frm_block{
 
141
  display:block;
142
  }
143
 
@@ -1407,7 +1408,8 @@ a.frm_button:hover{
1407
  }
1408
  ul.start_divider{
1409
  padding:6px 12px 0;
1410
- border-bottom:1px dashed #CCC;
 
1411
  min-height:100px;
1412
  }
1413
 
@@ -1432,7 +1434,7 @@ ul.start_divider{
1432
  color:#CCC;
1433
  }
1434
 
1435
- .frm_sorting li.ui-state-default.edit_field_type_break{border-bottom:1px solid #ccc; padding-bottom:5px;}
1436
  .frm_sorting .divider_section_only > .frm_ipe_field_label{font-size:116%;}
1437
  #frm_form_editor_container .edit_field_type_break .frm_primary_label.frm_ipe_field_label.button{
1438
  width:150px;
@@ -1988,19 +1990,19 @@ iframe#dyncontent_ifr{min-height:150px;}
1988
  height: 101px;
1989
  }
1990
  .farbtastic .wheel {
1991
- background: url(../pro/images/styler/wheel.png) no-repeat;
1992
  width: 195px;
1993
  height: 195px;
1994
  }
1995
  .farbtastic .overlay {
1996
- background: url(../pro/images/styler/mask.png) no-repeat;
1997
  }
1998
  .farbtastic .marker {
1999
  width: 17px;
2000
  height: 17px;
2001
  margin: -8px 0 0 -8px;
2002
  overflow: hidden;
2003
- background: url(../pro/images/styler/marker.png) no-repeat;
2004
  }
2005
 
2006
  /* ---------------------------------------------------------------
137
  clear:both;
138
  }
139
 
140
+ .frm_block,
141
+ .frm_no_section_fields.frm_block{
142
  display:block;
143
  }
144
 
1408
  }
1409
  ul.start_divider{
1410
  padding:6px 12px 0;
1411
+ border-left:1px solid #D7D7D7;
1412
+ border-bottom:1px solid #D7D7D7;
1413
  min-height:100px;
1414
  }
1415
 
1434
  color:#CCC;
1435
  }
1436
 
1437
+ .frm_sorting li.ui-state-default.edit_field_type_break{border-bottom:1px dashed #D7D7D7; padding-bottom:5px;}
1438
  .frm_sorting .divider_section_only > .frm_ipe_field_label{font-size:116%;}
1439
  #frm_form_editor_container .edit_field_type_break .frm_primary_label.frm_ipe_field_label.button{
1440
  width:150px;
1990
  height: 101px;
1991
  }
1992
  .farbtastic .wheel {
1993
+ background: url(../images/styler/wheel.png) no-repeat;
1994
  width: 195px;
1995
  height: 195px;
1996
  }
1997
  .farbtastic .overlay {
1998
+ background: url(../images/styler/mask.png) no-repeat;
1999
  }
2000
  .farbtastic .marker {
2001
  width: 17px;
2002
  height: 17px;
2003
  margin: -8px 0 0 -8px;
2004
  overflow: hidden;
2005
+ background: url(../images/styler/marker.png) no-repeat;
2006
  }
2007
 
2008
  /* ---------------------------------------------------------------
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.0rc8
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.0rc9
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
images/styler/marker.png ADDED
Binary file
images/styler/mask.png ADDED
Binary file
images/styler/wheel.png ADDED
Binary file
js/formidable.min.js CHANGED
@@ -1,50 +1,51 @@
1
- function frmFrontFormJS(){function k(a){var b=jQuery(this),c=b.attr("type");"submit"!=c&&a.preventDefault();a=b.parents("form:first");var e=b="",f=this.name;if("frm_prev_page"==f||-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"==f||-1!==this.className.indexOf("frm_save_draft"))e=1;jQuery(".frm_next_page").val(b);jQuery(".frm_saving_draft").val(e);"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 q(){this.className=this.className.replace("frm_transparent","");this.parentNode.getElementsByTagName("a")[0].className+=" frm_hidden"}function w(){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,e=this.options,b=!1,f=0;f<e.length;f++)if("frm_other_trigger"==
3
- e[f].className&&e[f].selected){b=!0;break}c?(a=this.parentNode.getElementsByClassName("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).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("")):"checkbox"==a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):
4
- jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function A(a){var b=this.name.replace("item_meta[","").split("]"),c=b[0];c&&(jQuery('input[name="item_meta['+c+'][form]"]').length&&(c=b[2].replace("[","")),t("und",c,null,jQuery(this)),M(a,c))}function t(a,b,c,e,f){if("undefined"!=typeof __FRMRULES){var g=__FRMRULES[b];if("undefined"!=typeof g){if("undefined"==typeof c||null===c)c="go";"persist"!=f&&(m=[]);f=[];for(var h=0,r=g.length;h<r;h++){var p=
5
- g[h];if("undefined"!=typeof p)for(var l=0,k=p.Conditions.length;l<k;l++){var C=p.Conditions[l];C.HideField=p.Setting.FieldName;C.MatchType=p.MatchType;C.Show=p.Show;f.push(C)}}g=f.length;h=0;for(r=g;h<r;h++)f[h].FieldName==b?y(h,f[h],b,a,c,e):y(h,f[h],b,a,c),h==g-1&&D(c)}}}function y(a,b,c,e,f,g){"undefined"==typeof m[b.HideField]&&(m[b.HideField]=[]);b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+"]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID=
6
- "frm_field_"+b.HideField+"_container";var h=!1;if("undefined"!==typeof g&&null!==g){1<g.length&&(g=g.eq(0));if("undefined"===typeof g.attr("name"))return;b.inputName=g.attr("name").replace("[other]","").replace("[]","");var r=g.closest(".frm_repeat_sec");r.length&&(r=r.children(".frm_field_"+b.FieldName+"_container"),b.containerID=r.attr("id"),b.hideContainerID=b.containerID.replace(b.FieldName,b.HideField),b.hiddenName=b.inputName.replace("["+b.FieldName+"]","["+b.HideField+"]"))}else h=!0,g=jQuery('input[name^="'+
7
- b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]'),1<g.length&&(g=g.eq(0));if(b.FieldName!=c||"undefined"==typeof e||"und"==e)if(("radio"==b.Type||"data-radio"==b.Type)&&"radio"==g.attr("type"))e=jQuery('input[name="'+b.inputName+'"]:checked').val(),"undefined"==typeof e&&(e="");else if("select"==b.Type||"time"==b.Type||"data-select"==b.Type||"checkbox"!=b.Type&&"data-checkbox"!=b.Type)e=g.val();"undefined"==typeof e&&(e=g.val());if("undefined"==typeof e){if(!0===
8
- h&&(c=jQuery("."+b.containerID+" input, ."+b.containerID+" select, ."+b.containerID+" textarea"),c.length)){c.each(function(){y(a,b,b.FieldName,e,f,jQuery(this))});return}e=""}c=[];if("checkbox"==b.Type||"data-checkbox"==b.Type)c=N(b.containerID,b.inputName),e=c.length?c:"";m[b.HideField][a]=""===e?!1:{funcName:"getDataOpts",f:b,sel:e};if("checkbox"==b.Type||"data-checkbox"==b.Type&&"undefined"==typeof b.LinkedField)if(c=m[b.HideField][a]=!1,""!==e)for("!="==b.Condition&&(m[b.HideField][a]=!0),g=
9
- 0;g<e.length;g++)c=z(b.Condition,b.Value,e[g]),"!="==b.Condition?!0===m[b.HideField][a]&&!1===c&&(m[b.HideField][a]=!1):!1===m[b.HideField][a]&&c&&(m[b.HideField][a]=!0);else c=z(b.Condition,b.Value,""),!1===m[b.HideField][a]&&c&&(m[b.HideField][a]=!0);else if("undefined"!=typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"==typeof b.DataType||"data"===b.DataType)""===e?v(b.hideContainerID):"data-radio"==b.Type?m[b.HideField][a]="undefined"==typeof b.DataType?z(b.Condition,b.Value,e):
10
- {funcName:"getData",f:b,sel:e}:"data-checkbox"==b.Type||"data-select"==b.Type&&jQuery.isArray(e)?(v(b.hideContainerID),m[b.HideField][a]=!0,G(b,e,1)):"data-select"==b.Type&&(m[b.HideField][a]={funcName:"getData",f:b,sel:e})}else"undefined"==typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===e?"1":e,m[b.HideField][a]=z(b.Condition,b.Value,e),b.Value=void 0):m[b.HideField][a]=z(b.Condition,b.Value,e);B(a,b,f)}function v(a){a=jQuery(document.getElementById(a));a.fadeOut("slow");a.find(".frm_data_field_container").empty()}
11
- function B(a,b,c){if("all"==b.MatchType||!1===m[b.HideField][a])E.push({result:m[b.HideField][a],show:b.Show,match:b.MatchType,fname:b.FieldName,fkey:b.HideField,hideContainerID:b.hideContainerID});else{var e="none";if("show"==b.Show){if(!0!==m[b.HideField][a]){H(m[b.HideField][a],b.FieldName,c);return}e=""}a=document.getElementById(b.hideContainerID);null!==a&&(a.style.display=e)}}function D(a){jQuery.each(E,function(b,c){if("undefined"!=typeof c&&"undefined"!=typeof c.result){var e=document.getElementById(c.hideContainerID),
12
- f=c.show;if(null!==e){if("any"==c.match&&-1==jQuery.inArray(!0,m[c.fkey])||"all"==c.match&&-1<jQuery.inArray(!1,m[c.fkey]))f="show"==c.show?"hide":"show";"show"==f?e.style.display="":(jQuery(e).filter(":hidden").hide(),e.style.display="none");!1!==typeof c.result&&!0!==typeof c.result&&H(c.result,c.fname,a)}delete E[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),
13
- c=parseFloat(c));return"-1"!=String(b).indexOf("&quot;")&&z(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":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 H(a,b,c){"getDataOpts"==a.funcName?O(a.f,a.sel,b,c):"getData"==a.funcName&&G(a.f,a.sel,0)}function G(a,b,c){var e=document.getElementById(a.hideContainerID),f=jQuery(e).find(".frm_data_field_container");
14
- if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",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(g){""!==g&&(e.style.display="");if(c)f.append(g);else{f.html(g);var h=f.children("input"),r=h.val();if(""===g||""===r)e.style.display="none";t(b,a.HideField,null,h)}return!0}})}function O(a,b,c,e){if(!("stop"==e&&-1<jQuery.inArray(a.HideField,
15
- F)&&"hidden"==a.parentField.attr("type"))){var f=jQuery('input[name^="'+a.hiddenName+'"], select[name^="'+a.hiddenName+'"], textarea[name^="'+a.hiddenName+'"]'),g=[];f.each(function(){"radio"==this.type||"checkbox"==this.type?!0===this.checked&&g.push(jQuery(this).val()):g.push(jQuery(this).val())});if("select"!=a.DataType||"stop"!=e&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,F))){0===g.length&&(g="");F.push(a.HideField);var h=document.getElementById(a.hideContainerID),
16
- r=jQuery(h).find(".frm_data_field_container");if(0===r.length&&f.length)return t(g,a.HideField,"stop",f),!1;if(""!==a.Value&&!z(a.Condition,a.Value,b))return h.style.display="none",r.html(""),t("",a.HideField,"stop",f),!1;r.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');var p=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,
17
- nonce:frm_js.nonce},success:function(b){""===b?(h.style.display="none",g=""):"all"!=a.MatchType&&(h.style.display="");r.html(b);var c=r.find("select, input, textarea");""!==b&&""!==g&&(jQuery.isArray(g)||(b=[],b.push(g),g=b),jQuery.each(g,function(b,a){if("undefined"!=typeof a&&""!==a)if("checkbox"==p||"radio"==p)1<c.length?c.filter('[value="'+a+'"]').attr("checked","checked"):c.val()==a&&c.attr("checked","checked");else if("select"==p){var e=c.children("option[value="+a+"]");e.length?e.prop("selected",
18
- !0):g.splice(b,1)}else c.val(a)}));c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});t(g,a.HideField,"stop",c)}})}}}function M(a,b){if("undefined"!=typeof __FRMCALC){var c=__FRMCALC,e=c.fields[b];if("undefined"!=typeof e){e=e.total;if(a.frmTriggered&&a.frmTriggered==b)return!1;for(var f=[],g=0,h=0,r=e.length;h<r;h++){for(var p=c.calc[e[h]],l=p.calc,g=p.fields.length,k=0;k<g;k++){var m=p.fields[k],n=c.fields[m],u="input"+c.fieldKeys[m];"checkbox"==n.type||
19
- "select"==n.type?u=u+":checked,select"+c.fieldKeys[m]+" option:selected,"+u+"[type=hidden]":"radio"==n.type||"scale"==n.type?u=u+":checked,"+u+"[type=hidden]":"textarea"==n.type&&(u=u+",textarea"+c.fieldKeys[m]);f[m]=P(u,m,n,c,f);"undefined"===typeof f[m]&&(f[m]=0);n="["+m+"]";n=n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");l=l.replace(new RegExp(n,"g"),f[m])}p=p.calc_dec;l.indexOf(").toFixed(")&&(k=l.split(").toFixed("),I(k[1])&&(p=k[1],l=l.replace(").toFixed("+p,"")));l=parseFloat(eval(l));I(p)&&
20
- (l=l.toFixed(p));"undefined"===typeof l&&(l=0);jQuery(document.getElementById("field_"+e[h])).val(l).trigger({type:"change",frmTriggered:e[h],selfTriggered:!0})}}}}function P(a,b,c,e,f){if("undefined"!==typeof f[b]&&0!==f[b])return f[b];jQuery(a).each(function(){"undefined"===typeof f[b]&&(f[b]=0);var a=jQuery(this).val();"date"==c.type&&(d=jQuery.datepicker.parseDate(e.date,a),null!==d&&(f[b]=Math.ceil(d/864E5)));""!==a&&(a=parseFloat(a.replace(/,/g,"").match(/-?[\d\.]+$/)));"undefined"===typeof a&&
21
- (a=0);f[b]+=a});return f[b]}function Q(a){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled","disabled");jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");var b="",c=0,e=0;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+jQuery(a).find('input[name="frm_action"]').val()+"&nonce="+frm_js.nonce,success:function(f){f=f.replace(/^\s+|\s+$/g,"");0===f.indexOf("{")&&(f=jQuery.parseJSON(f));if(""===f||!f||"0"===f||"object"!=
22
- typeof f&&0===f.indexOf("<!DOCTYPE")){var g=document.getElementById("frm_loading");null!==g&&(f=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof f&&""!==f&&setTimeout(function(){jQuery(g).fadeIn("slow")},2E3));f=jQuery(a).find(".g-recaptcha");f.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&f.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof f){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");
23
- b=jQuery(a).closest(document.getElementById("frm_form_"+jQuery(a).find('input[name="form_id"]').val()+"_container"));c=b.offset().top;b.replaceWith(f);e=document.documentElement.scrollTop||document.body.scrollTop;c&&c>frm_js.offset&&e>c&&jQuery(window).scrollTop(c-frm_js.offset);if("function"==typeof frmThemeOverride_frmAfterSubmit){var h=jQuery(f).find('input[name="form_id"]').val(),k="";h&&(k=jQuery('input[name="frm_page_order_'+h+'"]').val());frmThemeOverride_frmAfterSubmit(h,k,f,a)}jQuery(a).find('input[name="id"]').length&&
24
- (f=jQuery(a).find('input[name="id"]').val(),jQuery(document.getElementById("frm_edit_"+f)).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");h=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");b="";var k=!1,m=null,l;for(l in f)if(m=jQuery(a).find(jQuery(document.getElementById("frm_field_"+l+
25
- "_container"))),m.length&&m.is(":visible"))h=!1,""===b&&(frmFrontForm.scrollMsg(l,a),b="#frm_field_"+l+"_container"),jQuery(a).find("#frm_field_"+l+"_container .g-recaptcha").length&&(k=!0,grecaptcha.reset()),m.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(l,f):m.append('<div class="frm_error">'+f[l]+"</div>");else if("redirect"==l){window.location=f[l];return}!0!==k&&jQuery(a).find(".g-recaptcha").closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+
26
- frm_js.nonce+'">');h&&a.submit()}},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function R(){J(jQuery(this),"clear")}function S(){J(jQuery(this),"replace")}function J(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var e=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===e&&a.addClass("frm_default").val(c):e==c&&a.removeClass("frm_default").val("")}function T(){var a=jQuery(this),
27
- 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},success:function(b){a.replaceWith(b)}});return!1}function K(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==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}
28
- function U(){var a=jQuery(this),b=a.data("fid");a.wrap('<div class="frm_file_names frm_uploaded_files">');for(var c=a.get(0).files,e=0;e<c.length;e++)1==c.length?a.after(c[e].name+' <a href="#" class="frm_clear_file_link">'+frm_js.remove+"</a>"):a.after(c[e].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" />')}
29
- function V(){L(jQuery(this).parent(".frm_uploaded_files"))}function W(){jQuery(this).parent(".frm_file_names").replaceWith("");return!1}function X(){var a="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key");L(jQuery(document.getElementById(a)));return!1}function Y(){var a=jQuery(this).data("parent"),b=0;0<jQuery(".frm_repeat_"+a).length&&(b=1+parseInt(jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-","")),"undefined"==typeof b&&(b=1));jQuery.ajax({type:"POST",
30
- url:frm_js.ajax_url,data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(b){var e=jQuery(b).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(e);var f=["other"],g,h="reset";jQuery(b).find("input, select, textarea").each(function(){"file"!=this.type&&(g=this.name.replace("item_meta[","").split("]")[2].replace("[",""),-1==jQuery.inArray(g,f)&&(f.push(g),t("und",g,null,jQuery(this),h),h="persist"))});0<jQuery(b).find(".star").length&&jQuery(".star").rating();
31
- 0<jQuery(b).find(".frm_chzn").length&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0})}});return!1}function L(a){a.fadeOut("slow",function(){a.remove()})}function I(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function N(a,b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+b+'"]').each(function(){c.push(this.value)});else for(var e=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+
32
- b+'"]'),f=0;f<e.length;f++)("checkbox"==e[f].type&&e[f].checked||"hidden"==e[f].type)&&c.push(e[f].value);return c}var m=[],E=[],F=[];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)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===
33
- jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",R);jQuery(document).on("blur",".frm_toggle_default",S);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(T);jQuery(document).on("change",".frm_multiple_file",U);jQuery(document).on("click",".frm_clear_file_link",W);jQuery(document).on("click",".frm_remove_link",V);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"]',
34
- A);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',k);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',w);jQuery(document).on("change","input[type=file].frm_transparent",q);jQuery(document).on("click",".frm_remove_form_row",X);jQuery(document).on("click",".frm_add_form_row",Y);jQuery(".frm_month_heading, .frm_year_heading").toggle(function(){jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e");
35
- jQuery(this).next(".frm_toggle_container").fadeIn("slow")},function(){jQuery(this).children(".ui-icon-triangle-1-s, .ui-icon-triangle-1-e").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();Q(this)},scrollToID:function(a){a=jQuery(document.getElementBtId(a).offset());window.scrollTo(a.left,
36
- a.top)},scrollMsg:function(a,b){var c="";if(c="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find(document.getElementById("frm_field_"+a+"_container")).offset().top){var c=c-frm_js.offset,e=jQuery("html").css("margin-top"),f=jQuery("body").css("margin-top");if(e||f)c=c-parseInt(e)-parseInt(f);e=document.documentElement.scrollTop||document.body.scrollTop;c&&(!e||e>c)&&jQuery(window).scrollTop(c)}},hideCondFields:function(a){a=JSON.parse(a);
37
- for(var b=0,c=a.length;b<c;b++){var e=document.getElementById("frm_field_"+a[b]+"_container");null!==e?e.style.display="none":jQuery(".frm_field_"+a[b]+"_container").hide()}},checkDependent:function(a){a=JSON.parse(a);for(var b="reset",c=0,e=a.length;c<e;c++)t("und",a[c],null,null,b),b="persist"},generateGoogleTable:function(a,b){var c=__FRMTABLES;if("undefined"!=typeof c)if("table"==b){var c=c.table[a],e=new google.visualization.DataTable,f=!1;jQuery.inArray("id",c.options.fields)&&(f=!0,e.addColumn("number",
38
- frm_js.id));for(var g=c.fields.length,h="string",k=0,m=g;k<m;k++){var l=c.fields[k],h=K(l);e.addColumn(h,l.name)}k=!1;c.options.edit_link&&(k=!0,e.addColumn("string",c.options.edit_link));m=!1;c.options.delete_link&&(m=!0,e.addColumn("string",c.options.delete_link));l=0;if(null!==c.entries){var n=c.entries.length;e.addRows(n);for(var q=0,t=0;t<n;t++){var l=0,u=c.entries[t];f&&(e.setCell(q,l,u.id),l++);for(var v=0,w=g;v<w;v++){var x=c.fields[v],h=K(x),x=u.metas[x.id];"number"!=h||null!==x&&""!==x?
39
- "boolean"==h&&(x=null===x||"false"==x||!1===x?"false":"true"):x=0;e.setCell(q,l,x);l++}k&&("undefined"!==typeof u.editLink?e.setCell(q,l,'<a href="'+u.editLink+'">'+c.options.edit_link+"</a>"):e.setCell(q,l,""),l++);m&&("undefined"!==typeof u.deleteLink?e.setCell(q,l,'<a href="'+u.deleteLink+'" class="frm_delete_link" onclick="return confirm('+c.options.confirm+')">'+c.options.delete_link+"</a>"):e.setCell(q,l,""));q++}}else for(e.addRows(1),k=l=0,m=g;k<m;k++)0<l?e.setCell(0,l,""):e.setCell(0,l,c.options.no_entries),
40
- l++;(new google.visualization.Table(document.getElementById("frm_google_table_"+c.options.form_id))).draw(e,c.graphOpts)}else{c=c[b][a];e=new google.visualization.DataTable;f=!1;g=c.rows.length;if(0<g)if("table"==c.type)for(f=!0,e.addRows(c.rows[g-1][0]+1),h=0;h<g;h++)e.setCell(c.rows[h]);else if("undefined"!=typeof c.rows[0].tooltip){f=!0;e.addColumn({type:"string",role:"tooltip"});for(h=0;h<g;h++)l=c.rows[h].tooltip,c.rows[h].tooltip=null,c.rows[h].push(l);e.addRows(c.rows)}g=c.cols.length;if(f){if(0<
41
- g)for(f=0;f<g;f++)h=c.cols[f],e.addColumn(h.type,h.name)}else{e=[[]];for(f=0;f<g;f++)e[0].push(c.cols[f].name);e=e.concat(c.rows);e=google.visualization.arrayToDataTable(e)}f=c.type.charAt(0).toUpperCase()+c.type.slice(1)+"Chart";(new google.visualization[f](document.getElementById("chart_"+c.graph_id))).draw(e,c.options)}},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",
42
- time_field:b,date_field:a.id,entry_id:c?c.val():"",date:jQuery(a).val(),nonce:frm_js.nonce},success:function(a){var c=jQuery(document.getElementById(b));c.find("option").removeAttr("disabled");if(a&&""!==a)for(var g in a)c.find('option[value="'+g+'"]').attr("disabled","disabled")}})},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility",
43
- "visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(k){frmFrontForm.init()});
44
- function frmEditEntry(k,n,q,w,A,t){var y=jQuery(document.getElementById("frm_edit_"+k)),v=y.html(),B=jQuery(document.getElementById(n+k)),D=B.html();B.html('<span class="frm-loading-img" id="'+n+k+'"></span><div class="frm_orig_content" style="display:none">'+D+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:q,entry_id:k,id:w,nonce:frm_js.nonce},success:function(z){B.children(".frm-loading-img").replaceWith(z);y.replaceWith('<span id="frm_edit_'+
45
- k+'"><a onclick="frmCancelEdit('+k+",'"+n+"','"+frmFrontForm.escapeHtml(v)+"',"+q+","+w+",'"+t+'\')" class="'+t+'">'+A+"</a></span>")}})}
46
- function frmCancelEdit(k,n,q,w,A,t){var y=jQuery(document.getElementById("frm_edit_"+k)),v=y.find("a"),B=v.html();v.hasClass("frm_ajax_edited")||(v=jQuery(document.getElementById(n+k)),v.children(".frm_forms").replaceWith(""),v.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));y.replaceWith('<a id="frm_edit_'+k+'" class="frm_edit_link '+t+'" href="javascript:frmEditEntry('+k+",'"+n+"',"+w+","+A+",'"+frmFrontForm.escapeHtml(B)+"','"+t+"')\">"+q+"</a>")}
47
- function frmUpdateField(k,n,q,w,A){jQuery(document.getElementById("frm_update_field_"+k+"_"+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:k,field_id:n,value:q,nonce:frm_js.nonce},success:function(){""===w.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+k+"_"+n+"_"+A)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+k+"_"+n+"_"+A)).replaceWith(w)}})}
48
- function frmDeleteEntry(k,n){jQuery(document.getElementById("frm_delete_"+k)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+k+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:k,nonce:frm_js.nonce},success:function(q){"success"==q.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+k)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+k)).replaceWith(q)}})}
49
- function frmOnSubmit(k){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(k,this)}
50
- function frm_resend_email(k,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:k,form_id:n,nonce:frm_js.nonce},success:function(k){$link.replaceWith(k)}})};
 
1
+ function frmFrontFormJS(){function h(b){var a=jQuery(this),c=a.attr("type");"submit"!=c&&b.preventDefault();b=a.parents("form:first");var e=a="",f=this.name;if("frm_prev_page"==f||-1!==this.className.indexOf("frm_prev_page"))a=jQuery(b).find(".frm_next_page").attr("id").replace("frm_next_p_","");else if("frm_save_draft"==f||-1!==this.className.indexOf("frm_save_draft"))e=1;jQuery(".frm_next_page").val(a);jQuery(".frm_saving_draft").val(e);"submit"!=c&&b.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 u(){this.className=this.className.replace("frm_transparent","");this.parentNode.getElementsByTagName("a")[0].className+=" frm_hidden"}function y(){var b=this.type,a=!1,c=!1;if("select-one"==b)c=!0,"frm_other_trigger"==this.options[this.selectedIndex].className&&(a=!0);else if("select-multiple"==b)for(var c=!0,e=this.options,a=!1,f=0;f<e.length;f++)if("frm_other_trigger"==
3
+ e[f].className&&e[f].selected){a=!0;break}c?(b=this.parentNode.getElementsByClassName("frm_other_input"),a?b[0].className=b[0].className.replace("frm_pos_none",""):(1>b[0].className.indexOf("frm_pos_none")&&(b[0].className+=" frm_pos_none"),b[0].value="")):"radio"==b?(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("")):"checkbox"==b&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):
4
+ jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function A(b){var a=this.name.replace("item_meta[","").split("]"),c=a[0];c&&(jQuery('input[name="item_meta['+c+'][form]"]').length&&(c=a[2].replace("[","")),q("und",c,null,jQuery(this)),M(b,c))}function q(b,a,c,e,f){if("undefined"!=typeof __FRMRULES){var g=__FRMRULES[a];if("undefined"!=typeof g){if("undefined"==typeof c||null===c)c="go";"persist"!=f&&(m=[]);f=[];for(var k=0,p=g.length;k<p;k++){var r=
5
+ g[k];if("undefined"!=typeof r)for(var l=0,h=r.Conditions.length;l<h;l++){var C=r.Conditions[l];C.HideField=r.Setting.FieldName;C.MatchType=r.MatchType;C.Show=r.Show;f.push(C)}}g=f.length;k=0;for(p=g;k<p;k++)f[k].FieldName==a?v(k,f[k],a,b,c,e):v(k,f[k],a,b,c),k==g-1&&D(c)}}}function v(b,a,c,e,f,g){"undefined"==typeof m[a.HideField]&&(m[a.HideField]=[]);a.inputName="item_meta["+a.FieldName+"]";a.hiddenName="item_meta["+a.HideField+"]";a.containerID="frm_field_"+a.FieldName+"_container";a.hideContainerID=
6
+ "frm_field_"+a.HideField+"_container";a.hideBy="#";var k=!1;if("undefined"!==typeof g&&null!==g){1<g.length&&(g=g.eq(0));if("undefined"===typeof g.attr("name"))return;a.inputName=g.attr("name").replace("[other]","").replace("[]","");var p=g.closest(".frm_repeat_sec");p.length&&(p=p.children(".frm_field_"+a.FieldName+"_container"),a.containerID=p.attr("id"),a.hideContainerID=a.containerID.replace(a.FieldName,a.HideField),a.hiddenName=a.inputName.replace("["+a.FieldName+"]","["+a.HideField+"]"))}else{k=
7
+ !0;g=jQuery('input[name^="'+a.inputName+'"], textarea[name^="'+a.inputName+'"], select[name^="'+a.inputName+'"]');if(1>g.length&&(g=jQuery("."+a.containerID+" input, ."+a.containerID+" textarea, ."+a.containerID+" select"),g.length)){v(b,a,c,e,f,g);return}1<g.length&&(g=g.eq(0))}null===document.getElementById(a.hideContainerID)&&(a.hideBy=".");if(a.FieldName!=c||"undefined"==typeof e||"und"==e)if(("radio"==a.Type||"data-radio"==a.Type)&&"radio"==g.attr("type"))e=jQuery('input[name="'+a.inputName+
8
+ '"]:checked').val(),"undefined"==typeof e&&(e="");else if("select"==a.Type||"time"==a.Type||"data-select"==a.Type||"checkbox"!=a.Type&&"data-checkbox"!=a.Type)e=g.val();"undefined"==typeof e&&(e=g.val());if("undefined"==typeof e){if(!0===k&&(c=jQuery("."+a.containerID+" input, ."+a.containerID+" select, ."+a.containerID+" textarea"),c.length)){c.each(function(){v(b,a,a.FieldName,e,f,jQuery(this))});return}e=""}c=[];if("checkbox"==a.Type||"data-checkbox"==a.Type)c=N(a.containerID,a.inputName),e=c.length?
9
+ c:"";m[a.HideField][b]=""===e?!1:{funcName:"getDataOpts",f:a,sel:e};if("checkbox"==a.Type||"data-checkbox"==a.Type&&"undefined"==typeof a.LinkedField)if(c=m[a.HideField][b]=!1,""!==e)for("!="==a.Condition&&(m[a.HideField][b]=!0),g=0;g<e.length;g++)c=z(a.Condition,a.Value,e[g]),"!="==a.Condition?!0===m[a.HideField][b]&&!1===c&&(m[a.HideField][b]=!1):!1===m[a.HideField][b]&&c&&(m[a.HideField][b]=!0);else c=z(a.Condition,a.Value,""),!1===m[a.HideField][b]&&c&&(m[a.HideField][b]=!0);else if("undefined"!=
10
+ typeof a.LinkedField&&0===a.Type.indexOf("data-")){if("undefined"==typeof a.DataType||"data"===a.DataType)""===e?w(a.hideContainerID,a.hideBy):"data-radio"==a.Type?m[a.HideField][b]="undefined"==typeof a.DataType?z(a.Condition,a.Value,e):{funcName:"getData",f:a,sel:e}:"data-checkbox"==a.Type||"data-select"==a.Type&&jQuery.isArray(e)?(w(a.hideContainerID,a.hideBy),m[a.HideField][b]=!0,G(a,e,1)):"data-select"==a.Type&&(m[a.HideField][b]={funcName:"getData",f:a,sel:e})}else"undefined"==typeof a.Value&&
11
+ 0===a.Type.indexOf("data")?(a.Value=""===e?"1":e,m[a.HideField][b]=z(a.Condition,a.Value,e),a.Value=void 0):m[a.HideField][b]=z(a.Condition,a.Value,e);B(b,a,f)}function w(b,a){b="."===a?jQuery("."+b):jQuery(document.getElementById(b));b.fadeOut("slow");b.find(".frm_data_field_container").empty()}function B(b,a,c){if("all"==a.MatchType||!1===m[a.HideField][b])E.push({result:m[a.HideField][b],show:a.Show,match:a.MatchType,fname:a.FieldName,fkey:a.HideField,hideContainerID:a.hideContainerID,hideBy:a.hideBy});
12
+ else{var e="none";if("show"==a.Show){if(!0!==m[a.HideField][b]){H(m[a.HideField][b],a.FieldName,c);return}e=""}"."===a.hideBy?(b=jQuery("."+a.hideContainerID),b.length&&("none"===e?b.hide():b.show())):(b=document.getElementById(a.hideContainerID),null!==b&&(b.style.display=e))}}function D(b){jQuery.each(E,function(a,c){if("undefined"!=typeof c&&"undefined"!=typeof c.result){var e=jQuery(c.hideBy+c.hideContainerID),f=c.show;if(e.length){if("any"==c.match&&-1==jQuery.inArray(!0,m[c.fkey])||"all"==c.match&&
13
+ -1<jQuery.inArray(!1,m[c.fkey]))f="show"==c.show?"hide":"show";"show"==f?e.show():(e.filter(":hidden").hide(),e.hide());!1!==typeof c.result&&!0!==typeof c.result&&H(c.result,c.fname,b)}delete E[a]}})}function z(b,a,c){"undefined"==typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(a,c)&&(c=a);-1!=String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(a=parseFloat(a),c=parseFloat(c));return"-1"!=String(a).indexOf("&quot;")&&z(b,a.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==
14
+ b},"!=":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}}[b](a,c)}function H(b,a,c){"getDataOpts"==b.funcName?O(b.f,b.sel,a,c):"getData"==b.funcName&&G(b.f,b.sel,0)}function G(b,a,c){var e=document.getElementById(b.hideContainerID),f=jQuery(e).find(".frm_data_field_container");if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",
15
+ url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:a,field_id:b.LinkedField,current_field:b.HideField,hide_id:b.hideContainerID,nonce:frm_js.nonce},success:function(g){""!==g&&(e.style.display="");if(c)f.append(g);else{f.html(g);var k=f.children("input"),p=k.val();if(""===g||""===p)e.style.display="none";q(a,b.HideField,null,k)}return!0}})}function O(b,a,c,e){if(!("stop"==e&&-1<jQuery.inArray(b.HideField,F)&&"hidden"==b.parentField.attr("type"))){var f=jQuery('input[name^="'+b.hiddenName+
16
+ '"], select[name^="'+b.hiddenName+'"], textarea[name^="'+b.hiddenName+'"]'),g=[];f.each(function(){"radio"==this.type||"checkbox"==this.type?!0===this.checked&&g.push(jQuery(this).val()):g.push(jQuery(this).val())});if("select"!=b.DataType||"stop"!=e&&!jQuery("#"+b.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(b.HideField,F))){0===g.length&&(g="");F.push(b.HideField);var k=document.getElementById(b.hideContainerID),p=jQuery(k).find(".frm_data_field_container");if(0===p.length&&
17
+ f.length)return q(g,b.HideField,"stop",f),!1;if(""!==b.Value&&!z(b.Condition,b.Value,a))return k.style.display="none",p.html(""),q("",b.HideField,"stop",f),!1;p.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');var r=b.DataType;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",hide_field:c,entry_id:a,selected_field_id:b.LinkedField,field_id:b.HideField,hide_id:b.hideContainerID,nonce:frm_js.nonce},success:function(a){""===
18
+ a?(k.style.display="none",g=""):"all"!=b.MatchType&&(k.style.display="");p.html(a);var c=p.find("select, input, textarea");""!==a&&""!==g&&(jQuery.isArray(g)||(a=[],a.push(g),g=a),jQuery.each(g,function(a,b){if("undefined"!=typeof b&&""!==b)if("checkbox"==r||"radio"==r)1<c.length?c.filter('[value="'+b+'"]').attr("checked","checked"):c.val()==b&&c.attr("checked","checked");else if("select"==r){var e=c.children("option[value="+b+"]");e.length?e.prop("selected",!0):g.splice(a,1)}else c.val(b)}));c.hasClass("frm_chzn")&&
19
+ jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});q(g,b.HideField,"stop",c)}})}}}function M(b,a){if("undefined"!=typeof __FRMCALC){var c=__FRMCALC,e=c.fields[a];if("undefined"!=typeof e){e=e.total;if(b.frmTriggered&&b.frmTriggered==a)return!1;for(var f=[],g=0,k=0,p=e.length;k<p;k++){for(var r=c.calc[e[k]],l=r.calc,g=r.fields.length,h=0;h<g;h++){var m=r.fields[h],n=c.fields[m],t="input"+c.fieldKeys[m];"checkbox"==n.type||"select"==n.type?t=t+":checked,select"+c.fieldKeys[m]+" option:selected,"+
20
+ t+"[type=hidden]":"radio"==n.type||"scale"==n.type?t=t+":checked,"+t+"[type=hidden]":"textarea"==n.type&&(t=t+",textarea"+c.fieldKeys[m]);f[m]=P(t,m,n,c,f);"undefined"===typeof f[m]&&(f[m]=0);n="["+m+"]";n=n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");l=l.replace(new RegExp(n,"g"),f[m])}r=r.calc_dec;l.indexOf(").toFixed(")&&(h=l.split(").toFixed("),I(h[1])&&(r=h[1],l=l.replace(").toFixed("+r,"")));l=parseFloat(eval(l));I(r)&&(l=l.toFixed(r));"undefined"===typeof l&&(l=0);jQuery(document.getElementById("field_"+
21
+ e[k])).val(l).trigger({type:"change",frmTriggered:e[k],selfTriggered:!0})}}}}function P(b,a,c,e,f){if("undefined"!==typeof f[a]&&0!==f[a])return f[a];jQuery(b).each(function(){"undefined"===typeof f[a]&&(f[a]=0);var b=jQuery(this).val();"date"==c.type&&(d=jQuery.datepicker.parseDate(e.date,b),null!==d&&(f[a]=Math.ceil(d/864E5)));""!==b&&(b=parseFloat(b.replace(/,/g,"").match(/-?[\d\.]+$/)));"undefined"===typeof b&&(b=0);f[a]+=b});return f[a]}function Q(b){jQuery(b).find('input[type="submit"], input[type="button"]').attr("disabled",
22
+ "disabled");jQuery(b).find(".frm_ajax_loading").addClass("frm_loading_now");var a="",c=0,e=0;jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(b).serialize()+"&action=frm_entries_"+jQuery(b).find('input[name="frm_action"]').val()+"&nonce="+frm_js.nonce,success:function(f){f=f.replace(/^\s+|\s+$/g,"");0===f.indexOf("{")&&(f=jQuery.parseJSON(f));if(""===f||!f||"0"===f||"object"!=typeof f&&0===f.indexOf("<!DOCTYPE")){var g=document.getElementById("frm_loading");null!==g&&(f=jQuery(b).find("input[type=file]").val(),
23
+ "undefined"!=typeof f&&""!==f&&setTimeout(function(){jQuery(g).fadeIn("slow")},2E3));f=jQuery(b).find(".g-recaptcha");f.length&&(1>jQuery(b).find(".frm_next_page").length||1>jQuery(b).find(".frm_next_page").val())&&f.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');b.submit()}else if("object"!=typeof f){jQuery(b).find(".frm_ajax_loading").removeClass("frm_loading_now");a=jQuery(b).closest(document.getElementById("frm_form_"+jQuery(b).find('input[name="form_id"]').val()+
24
+ "_container"));c=a.offset().top;a.replaceWith(f);e=document.documentElement.scrollTop||document.body.scrollTop;c&&c>frm_js.offset&&e>c&&jQuery(window).scrollTop(c-frm_js.offset);if("function"==typeof frmThemeOverride_frmAfterSubmit){var k=jQuery(f).find('input[name="form_id"]').val(),p="";k&&(p=jQuery('input[name="frm_page_order_'+k+'"]').val());frmThemeOverride_frmAfterSubmit(k,p,f,b)}jQuery(b).find('input[name="id"]').length&&(f=jQuery(b).find('input[name="id"]').val(),jQuery(document.getElementById("frm_edit_"+
25
+ f)).find("a").addClass("frm_ajax_edited").click())}else{jQuery(b).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(b).find(".frm_ajax_loading").removeClass("frm_loading_now");k=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");a="";var p=!1,h=null,l;for(l in f)if(h=jQuery(b).find(jQuery(document.getElementById("frm_field_"+l+"_container"))),h.length&&h.is(":visible"))k=!1,""===a&&(frmFrontForm.scrollMsg(l,b),a=
26
+ "#frm_field_"+l+"_container"),jQuery(b).find("#frm_field_"+l+"_container .g-recaptcha").length&&(p=!0,grecaptcha.reset()),h.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(l,f):h.append('<div class="frm_error">'+f[l]+"</div>");else if("redirect"==l){window.location=f[l];return}!0!==p&&jQuery(b).find(".g-recaptcha").closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');k&&b.submit()}},
27
+ error:function(){jQuery(b).find('input[type="submit"], input[type="button"]').removeAttr("disabled");b.submit()}})}function R(){J(jQuery(this),"clear")}function S(){J(jQuery(this),"replace")}function J(b,a){var c=b.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var e=b.val().replace(/(\n|\r\n)/g,"\r");"replace"==a?""===e&&b.addClass("frm_default").val(c):e==c&&b.removeClass("frm_default").val("")}function T(){var b=jQuery(this),a=b.data("eid"),c=b.data("fid");
28
+ b.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:a,form_id:c,nonce:frm_js.nonce},success:function(a){b.replaceWith(a)}});return!1}function K(b){var a="string";if("number"==b.type)a="number";else if("checkbox"==b.type||"select"==b.type){var c=b.options.length;"select"==b.type&&""===b.options[0]&&(c="post_status"==b.field_options.post_field?3:c-1);1==c&&(a="boolean")}return a}function U(){var b=
29
+ jQuery(this),a=b.data("fid");b.wrap('<div class="frm_file_names frm_uploaded_files">');for(var c=b.get(0).files,e=0;e<c.length;e++)1==c.length?b.after(c[e].name+' <a href="#" class="frm_clear_file_link">'+frm_js.remove+"</a>"):b.after(c[e].name+"<br/>");b.hide();c=b.attr("name");c!="item_meta["+a+"][]"&&c.replace("item_meta[","").replace("[]","").split("][");b.closest(".frm_form_field").find(".frm_uploaded_files:last").after('<input name="'+c+'" data-fid="'+a+'"class="frm_transparent frm_multiple_file" multiple="multiple" type="file" />')}
30
+ function V(){L(jQuery(this).parent(".frm_uploaded_files"))}function W(){jQuery(this).parent(".frm_file_names").replaceWith("");return!1}function X(){var b="frm_section_"+jQuery(this).data("parent")+"-"+jQuery(this).data("key");L(jQuery(document.getElementById(b)));return!1}function Y(){var b=jQuery(this).data("parent"),a=0;0<jQuery(".frm_repeat_"+b).length&&(a=1+parseInt(jQuery(".frm_repeat_"+b+":last").attr("id").replace("frm_section_"+b+"-","")),"undefined"==typeof a&&(a=1));jQuery.ajax({type:"POST",
31
+ url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:b,i:a,nonce:frm_js.nonce},success:function(a){var e=a.html,f=jQuery(e).hide().fadeIn("slow");jQuery(".frm_repeat_"+b+":last").after(f);var g=["other"],k,h="reset";frmFrontForm.hideCondFields(JSON.stringify(a.logic.hide));jQuery(e).find("input, select, textarea").each(function(){"file"!=this.type&&(k=this.name.replace("item_meta[","").split("]")[2].replace("[",""),-1==jQuery.inArray(k,g)&&(g.push(k),q("und",k,null,jQuery(this),
32
+ h),h="persist"))});for(var f=0,m=a.logic.check.length;f<m;f++)-1==jQuery.inArray(a.logic.check[f],g)&&1>jQuery(e).find(".frm_field_"+a.logic.check[f]+"_container").length&&(q("und",a.logic.check[f],null,null,h),h="persist");0<jQuery(e).find(".star").length&&jQuery(".star").rating();0<jQuery(e).find(".frm_chzn").length&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0})}});return!1}function L(b){b.fadeOut("slow",function(){b.remove()})}function I(b){return!jQuery.isArray(b)&&0<=
33
+ b-parseFloat(b)+1}function N(b,a){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+b+' input[type=checkbox]:checked, input[type=hidden][name^="'+a+'"]').each(function(){c.push(this.value)});else for(var e=document.querySelectorAll("#"+b+' input[type=checkbox], input[type=hidden][name^="'+a+'"]'),f=0;f<e.length;f++)("checkbox"==e[f].type&&e[f].checked||"hidden"==e[f].type)&&c.push(e[f].value);return c}var m=[],E=[],F=[];return{init:function(){jQuery(document).on("click",".frm_trigger",
34
+ n);var b=jQuery(".frm_blank_field");b.length&&b.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?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",R);jQuery(document).on("blur",".frm_toggle_default",S);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(T);
35
+ jQuery(document).on("change",".frm_multiple_file",U);jQuery(document).on("click",".frm_clear_file_link",W);jQuery(document).on("click",".frm_remove_link",V);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"]',A);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',h);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',
36
+ y);jQuery(document).on("change","input[type=file].frm_transparent",u);jQuery(document).on("click",".frm_remove_form_row",X);jQuery(document).on("click",".frm_add_form_row",Y);jQuery(".frm_month_heading, .frm_year_heading").toggle(function(){jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e");jQuery(this).next(".frm_toggle_container").fadeIn("slow")},function(){jQuery(this).children(".ui-icon-triangle-1-s, .ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s");
37
+ jQuery(this).next(".frm_toggle_container").hide()})},submitForm:function(b){b.preventDefault();jQuery(this).find(".wp-editor-wrap").length&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();Q(this)},scrollToID:function(b){b=jQuery(document.getElementBtId(b).offset());window.scrollTo(b.left,b.top)},scrollMsg:function(b,a){var c="";if(c="undefined"==typeof a?jQuery(document.getElementById("frm_form_"+b+"_container")).offset().top:jQuery(a).find(document.getElementById("frm_field_"+b+"_container")).offset().top){var c=
38
+ c-frm_js.offset,e=jQuery("html").css("margin-top"),f=jQuery("body").css("margin-top");if(e||f)c=c-parseInt(e)-parseInt(f);e=document.documentElement.scrollTop||document.body.scrollTop;c&&(!e||e>c)&&jQuery(window).scrollTop(c)}},hideCondFields:function(b){b=JSON.parse(b);for(var a=0,c=b.length;a<c;a++){var e=document.getElementById("frm_field_"+b[a]+"_container");null!==e?e.style.display="none":jQuery(".frm_field_"+b[a]+"_container").hide()}},checkDependent:function(b){b=JSON.parse(b);for(var a="reset",
39
+ c=0,e=b.length;c<e;c++)q("und",b[c],null,null,a),a="persist"},generateGoogleTable:function(b,a){var c=__FRMTABLES;if("undefined"!=typeof c)if("table"==a){var c=c.table[b],e=new google.visualization.DataTable,f=!1;jQuery.inArray("id",c.options.fields)&&(f=!0,e.addColumn("number",frm_js.id));for(var g=c.fields.length,k="string",h=0,m=g;h<m;h++){var l=c.fields[h],k=K(l);e.addColumn(k,l.name)}h=!1;c.options.edit_link&&(h=!0,e.addColumn("string",c.options.edit_link));m=!1;c.options.delete_link&&(m=!0,
40
+ e.addColumn("string",c.options.delete_link));l=0;if(null!==c.entries){var n=c.entries.length;e.addRows(n);for(var q=0,u=0;u<n;u++){var l=0,t=c.entries[u];f&&(e.setCell(q,l,t.id),l++);for(var v=0,w=g;v<w;v++){var x=c.fields[v],k=K(x),x=t.metas[x.id];"number"!=k||null!==x&&""!==x?"boolean"==k&&(x=null===x||"false"==x||!1===x?"false":"true"):x=0;e.setCell(q,l,x);l++}h&&("undefined"!==typeof t.editLink?e.setCell(q,l,'<a href="'+t.editLink+'">'+c.options.edit_link+"</a>"):e.setCell(q,l,""),l++);m&&("undefined"!==
41
+ typeof t.deleteLink?e.setCell(q,l,'<a href="'+t.deleteLink+'" class="frm_delete_link" onclick="return confirm('+c.options.confirm+')">'+c.options.delete_link+"</a>"):e.setCell(q,l,""));q++}}else for(e.addRows(1),h=l=0,m=g;h<m;h++)0<l?e.setCell(0,l,""):e.setCell(0,l,c.options.no_entries),l++;(new google.visualization.Table(document.getElementById("frm_google_table_"+c.options.form_id))).draw(e,c.graphOpts)}else{c=c[a][b];e=new google.visualization.DataTable;f=!1;g=c.rows.length;if(0<g)if("table"==
42
+ c.type)for(f=!0,e.addRows(c.rows[g-1][0]+1),k=0;k<g;k++)e.setCell(c.rows[k]);else if("undefined"!=typeof c.rows[0].tooltip){f=!0;e.addColumn({type:"string",role:"tooltip"});for(k=0;k<g;k++)l=c.rows[k].tooltip,c.rows[k].tooltip=null,c.rows[k].push(l);e.addRows(c.rows)}g=c.cols.length;if(f){if(0<g)for(f=0;f<g;f++)k=c.cols[f],e.addColumn(k.type,k.name)}else{e=[[]];for(f=0;f<g;f++)e[0].push(c.cols[f].name);e=e.concat(c.rows);e=google.visualization.arrayToDataTable(e)}f=c.type.charAt(0).toUpperCase()+
43
+ c.type.slice(1)+"Chart";(new google.visualization[f](document.getElementById("chart_"+c.graph_id))).draw(e,c.options)}},removeUsedTimes:function(b,a){var c=jQuery(b).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:a,date_field:b.id,entry_id:c?c.val():"",date:jQuery(b).val(),nonce:frm_js.nonce},success:function(b){var c=jQuery(document.getElementById(a));c.find("option").removeAttr("disabled");
44
+ if(b&&""!==b)for(var g in b)c.find('option[value="'+g+'"]').attr("disabled","disabled")}})},escapeHtml:function(b){return b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(b){jQuery(b).css("visibility","hidden")},visible:function(b){jQuery(b).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(h){frmFrontForm.init()});
45
+ function frmEditEntry(h,n,u,y,A,q){var v=jQuery(document.getElementById("frm_edit_"+h)),w=v.html(),B=jQuery(document.getElementById(n+h)),D=B.html();B.html('<span class="frm-loading-img" id="'+n+h+'"></span><div class="frm_orig_content" style="display:none">'+D+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:u,entry_id:h,id:y,nonce:frm_js.nonce},success:function(z){B.children(".frm-loading-img").replaceWith(z);v.replaceWith('<span id="frm_edit_'+
46
+ h+'"><a onclick="frmCancelEdit('+h+",'"+n+"','"+frmFrontForm.escapeHtml(w)+"',"+u+","+y+",'"+q+'\')" class="'+q+'">'+A+"</a></span>")}})}
47
+ function frmCancelEdit(h,n,u,y,A,q){var v=jQuery(document.getElementById("frm_edit_"+h)),w=v.find("a"),B=w.html();w.hasClass("frm_ajax_edited")||(w=jQuery(document.getElementById(n+h)),w.children(".frm_forms").replaceWith(""),w.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));v.replaceWith('<a id="frm_edit_'+h+'" class="frm_edit_link '+q+'" href="javascript:frmEditEntry('+h+",'"+n+"',"+y+","+A+",'"+frmFrontForm.escapeHtml(B)+"','"+q+"')\">"+u+"</a>")}
48
+ function frmUpdateField(h,n,u,y,A){jQuery(document.getElementById("frm_update_field_"+h+"_"+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:h,field_id:n,value:u,nonce:frm_js.nonce},success:function(){""===y.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+h+"_"+n+"_"+A)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+h+"_"+n+"_"+A)).replaceWith(y)}})}
49
+ function frmDeleteEntry(h,n){jQuery(document.getElementById("frm_delete_"+h)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+h+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:h,nonce:frm_js.nonce},success:function(u){"success"==u.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById(n+h)).fadeOut("slow"):jQuery(document.getElementById("frm_delete_"+h)).replaceWith(u)}})}
50
+ function frmOnSubmit(h){console.warn("DEPRECATED: function frmOnSubmit in v2.0 use frmFrontForm.submitForm");frmFrontForm.submitForm(h,this)}
51
+ function frm_resend_email(h,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:h,form_id:n,nonce:frm_js.nonce},success:function(h){$link.replaceWith(h)}})};
js/formidable_admin.js CHANGED
@@ -766,15 +766,19 @@ function frmAdminBuildJS(){
766
 
767
  if(main_form_id == prev_form){
768
  //create form
769
- toggleFormid(field_id, '', main_form_id);
770
  }else{
771
- toggleFormid(field_id, prev_form, main_form_id);
772
  }
773
  }else{
774
- jQuery('#frm_field_id_'+field_id+' .show_repeat_sec').fadeOut('slow');
775
- jQuery(this).closest('li.frm_field_box').removeClass('repeat_section').addClass('no_repeat_section');
 
776
 
777
- toggleFormid(field_id, main_form_id, main_form_id);
 
 
 
778
  }
779
  }
780
 
@@ -795,11 +799,11 @@ function frmAdminBuildJS(){
795
  $thisField.find('.frm_'+ addRemove +'_form_row .frm_repeat_label').text(obj.value);
796
  }
797
 
798
- function toggleFormid(field_id, form_id, main_form_id){
799
  // change form ids of all fields in section
800
  var children = fieldsInSection(field_id);
801
  jQuery.ajax({type:'POST',url:ajaxurl,
802
- data:{action:'frm_toggle_repeat', form_id:form_id, parent_form_id:main_form_id, children:children, nonce:frmGlobal.nonce},
803
  success:function(id){
804
  //return form id to hidden field
805
  jQuery('input[name="field_options[form_select_'+field_id+']"]').val(id);
@@ -1642,8 +1646,10 @@ function frmAdminBuildJS(){
1642
  var value = this.value;
1643
  if(value == 'none'){
1644
  value='top';
 
 
1645
  }
1646
- jQuery('.frm_pos_container').removeClass('frm_top_container frm_left_container frm_right_container').addClass('frm_'+value+'_container');
1647
  }
1648
 
1649
  function collapseAllSections(){
@@ -1865,6 +1871,15 @@ function frmAdminBuildJS(){
1865
  }
1866
 
1867
  setupSortable('ul.frm_sorting');
 
 
 
 
 
 
 
 
 
1868
  jQuery('.field_type_list > li').draggable({
1869
  connectToSortable:'#new_fields',cursor:'move',
1870
  helper:'clone',revert:'invalid',delay:10,
766
 
767
  if(main_form_id == prev_form){
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
+ }
782
  }
783
  }
784
 
799
  $thisField.find('.frm_'+ addRemove +'_form_row .frm_repeat_label').text(obj.value);
800
  }
801
 
802
+ function toggleFormid(field_id, form_id, main_form_id, checked){
803
  // change form ids of all fields in section
804
  var children = fieldsInSection(field_id);
805
  jQuery.ajax({type:'POST',url:ajaxurl,
806
+ data:{action:'frm_toggle_repeat', form_id:form_id, parent_form_id:main_form_id, checked:checked, field_id:field_id, children:children, nonce:frmGlobal.nonce},
807
  success:function(id){
808
  //return form id to hidden field
809
  jQuery('input[name="field_options[form_select_'+field_id+']"]').val(id);
1646
  var value = this.value;
1647
  if(value == 'none'){
1648
  value='top';
1649
+ } else if ( value == 'no_label' ) {
1650
+ value = 'none';
1651
  }
1652
+ jQuery('.frm_pos_container').removeClass('frm_top_container frm_left_container frm_right_container frm_none_container').addClass('frm_'+value+'_container');
1653
  }
1654
 
1655
  function collapseAllSections(){
1871
  }
1872
 
1873
  setupSortable('ul.frm_sorting');
1874
+
1875
+ // Show message if section has no fields inside
1876
+ var frm_sorting = document.getElementsByClassName('start_divider frm_sorting');
1877
+ for ( i = 0; i < frm_sorting.length ; i++) {
1878
+ if ( frm_sorting[i].children.length < 2 ) {
1879
+ frm_sorting[i].parentNode.getElementsByClassName('frm_no_section_fields')[0].className = 'frm_no_section_fields frm_block';
1880
+ }
1881
+ }
1882
+
1883
  jQuery('.field_type_list > li').draggable({
1884
  connectToSortable:'#new_fields',cursor:'move',
1885
  helper:'clone',revert:'invalid',delay:10,
languages/formidable-da_DK.mo ADDED
Binary file
languages/formidable-da_DK.po ADDED
@@ -0,0 +1,5968 @@