Calculated Fields Form - Version 1.1.71

Version Description

  • Fixes an issue with the CDATE operation.
  • Modifies the Gutenberg Block to update the forms list dynamically.
  • Modifies the reCAPTCHA add-on to fix a conflict when the web page loads an additional instance of the reCAPTCHA API.
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Calculated Fields Form
Version 1.1.71
Comparing to
See all releases

Code changes from version 1.1.70 to 1.1.71

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://cff.dwbooster.com
4
  Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
5
  Requires at least: 3.0.5
6
  Tested up to: 5.9
7
- Stable tag: 1.1.70
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -965,6 +965,12 @@ A: Please, follow the steps below:
965
 
966
  == Changelog ==
967
 
 
 
 
 
 
 
968
  = 1.1.70 =
969
 
970
  * Modifies the loading process to prevent the iframe tags affect the form generation.
4
  Tags: form,quote form,contact form,form builder,calculator,calculated,quote calculator,forms,form editor,advanced forms,payment calculator,payment,recurring payment,quote,fields,calculated field,price calculator,email,form design,paypal,equation editor,formula,equation,quote calculator,post,posts,plugin,widget,admin,sidebar,images,image,page,shortcode,products form,woocommerce,addons,layout,session,post,cookie,get,webhook,Dropbox,pdf,language
5
  Requires at least: 3.0.5
6
  Tested up to: 5.9
7
+ Stable tag: 1.1.71
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
965
 
966
  == Changelog ==
967
 
968
+ = 1.1.71 =
969
+
970
+ * Fixes an issue with the CDATE operation.
971
+ * Modifies the Gutenberg Block to update the forms list dynamically.
972
+ * Modifies the reCAPTCHA add-on to fix a conflict when the web page loads an additional instance of the reCAPTCHA API.
973
+
974
  = 1.1.70 =
975
 
976
  * Modifies the loading process to prevent the iframe tags affect the form generation.
changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
3
  = 1.1.70 =
4
 
5
  * Modifies the loading process to prevent the iframe tags affect the form generation.
1
  == Changelog ==
2
 
3
+ = 1.1.71 =
4
+
5
+ * Fixes an issue with the CDATE operation.
6
+ * Modifies the Gutenberg Block to update the forms list dynamically.
7
+ * Modifies the reCAPTCHA add-on to fix a conflict when the web page loads an additional instance of the reCAPTCHA API.
8
+
9
  = 1.1.70 =
10
 
11
  * Modifies the loading process to prevent the iframe tags affect the form generation.
cp_calculatedfieldsf_free.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Calculated Fields Form
4
  Plugin URI: https://cff.dwbooster.com
5
  Description: Create forms with field values calculated based in other form field values.
6
- Version: 1.1.70
7
  Text Domain: calculated-fields-form
8
  Author: CodePeople
9
  Author URI: https://cff.dwbooster.com
@@ -16,7 +16,7 @@ if(!defined('WP_DEBUG') || true != WP_DEBUG)
16
  }
17
 
18
  // Defining main constants
19
- define('CP_CALCULATEDFIELDSF_VERSION', '1.1.70' );
20
  define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
21
  define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
22
  define('CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
3
  Plugin Name: Calculated Fields Form
4
  Plugin URI: https://cff.dwbooster.com
5
  Description: Create forms with field values calculated based in other form field values.
6
+ Version: 1.1.71
7
  Text Domain: calculated-fields-form
8
  Author: CodePeople
9
  Author URI: https://cff.dwbooster.com
16
  }
17
 
18
  // Defining main constants
19
+ define('CP_CALCULATEDFIELDSF_VERSION', '1.1.71' );
20
  define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
21
  define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
22
  define('CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
css/stylepublic.css CHANGED
@@ -527,6 +527,9 @@
527
  #fbuilder .select2-dropdown ul{padding:0;margin:0;}
528
  #fbuilder .select2-dropdown li{padding:5px; margin:5px;}
529
 
 
 
 
530
  /* VIEWERS */
531
  #fbuilder .cff-image-viewer{max-width:100%;}
532
  #fbuilder .cff-pdf-viewer{width:100%;border:1px solid #CCC;min-height:500px;}
527
  #fbuilder .select2-dropdown ul{padding:0;margin:0;}
528
  #fbuilder .select2-dropdown li{padding:5px; margin:5px;}
529
 
530
+ #fbuilder .cff-dropdown-field .select2 span img,
531
+ #fbuilder .cff-dropdown-field .select2-dropdown span img{height:20px;margin-right:5px;}
532
+
533
  /* VIEWERS */
534
  #fbuilder .cff-image-viewer{max-width:100%;}
535
  #fbuilder .cff-pdf-viewer{width:100%;border:1px solid #CCC;min-height:500px;}
inc/cpcff_page_builders.inc.php CHANGED
@@ -31,6 +31,15 @@ if(!class_exists('CPCFF_PAGE_BUILDERS'))
31
  // Gutenberg editor
32
  add_action( 'enqueue_block_editor_assets', array($instance,'gutenberg_editor' ) );
33
  add_filter( 'render_block', array($instance, 'gutenberg_dissable_wptexturize'), 10, 2 );
 
 
 
 
 
 
 
 
 
34
 
35
  // Elementor
36
  add_action( 'elementor/widgets/widgets_registered', array($instance, 'elementor_editor') );
@@ -75,18 +84,11 @@ if(!class_exists('CPCFF_PAGE_BUILDERS'))
75
  } // End divi_editor
76
 
77
  /**************************** GUTENBERG ****************************/
78
-
79
- /**
80
- * Loads the javascript resources to integrate the plugin with the Gutenberg editor
81
- */
82
- public function gutenberg_editor()
83
- {
84
  global $wpdb;
85
 
86
- wp_enqueue_style('cp_calculatedfieldsf_gutenberg_editor_css', plugins_url('/pagebuilders/gutenberg/assets/css/gutenberg.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
87
- wp_enqueue_script('cp_calculatedfieldsf_gutenberg_editor', plugins_url('/pagebuilders/gutenberg/assets/js/gutenberg.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
88
-
89
- $url = CPCFF_AUXILIARY::site_url();
90
  $url .= ((strpos($url, '?') === false) ? '?' : '&').'cff-editor-preview=1&cff-amp-redirected=1&cff-amp-form=';
91
  $config = array(
92
  'url' => $url,
@@ -106,7 +108,19 @@ if(!class_exists('CPCFF_PAGE_BUILDERS'))
106
  foreach ($forms as $form)
107
  $config['forms'][$form->id] = esc_attr('('.$form->id.') '.$form->form_name);
108
 
109
- wp_localize_script('cp_calculatedfieldsf_gutenberg_editor', 'cpcff_gutenberg_editor_config', $config);
 
 
 
 
 
 
 
 
 
 
 
 
110
  } // End gutenberg_editor
111
 
112
  public function gutenberg_dissable_wptexturize($block_content, $block)
31
  // Gutenberg editor
32
  add_action( 'enqueue_block_editor_assets', array($instance,'gutenberg_editor' ) );
33
  add_filter( 'render_block', array($instance, 'gutenberg_dissable_wptexturize'), 10, 2 );
34
+ if(
35
+ isset($_REQUEST['cff-action']) &&
36
+ $_REQUEST['cff-action'] == 'cff-gutenberg-editor-config' &&
37
+ current_user_can( 'edit_posts' )
38
+ )
39
+ {
40
+ remove_all_actions('shutdown');
41
+ die(json_encode($this->gutenberg_editor_config()));
42
+ }
43
 
44
  // Elementor
45
  add_action( 'elementor/widgets/widgets_registered', array($instance, 'elementor_editor') );
84
  } // End divi_editor
85
 
86
  /**************************** GUTENBERG ****************************/
87
+ private function gutenberg_editor_config()
88
+ {
 
 
 
 
89
  global $wpdb;
90
 
91
+ $url = CPCFF_AUXILIARY::site_url();
 
 
 
92
  $url .= ((strpos($url, '?') === false) ? '?' : '&').'cff-editor-preview=1&cff-amp-redirected=1&cff-amp-form=';
93
  $config = array(
94
  'url' => $url,
108
  foreach ($forms as $form)
109
  $config['forms'][$form->id] = esc_attr('('.$form->id.') '.$form->form_name);
110
 
111
+ return $config;
112
+ } // End gutenberg_integration_config
113
+
114
+ /**
115
+ * Loads the javascript resources to integrate the plugin with the Gutenberg editor
116
+ */
117
+ public function gutenberg_editor()
118
+ {
119
+
120
+ wp_enqueue_style('cp_calculatedfieldsf_gutenberg_editor_css', plugins_url('/pagebuilders/gutenberg/assets/css/gutenberg.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
121
+ wp_enqueue_script('cp_calculatedfieldsf_gutenberg_editor', plugins_url('/pagebuilders/gutenberg/assets/js/gutenberg.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
122
+
123
+ wp_localize_script('cp_calculatedfieldsf_gutenberg_editor', 'cpcff_gutenberg_editor_config', $this->gutenberg_editor_config());
124
  } // End gutenberg_editor
125
 
126
  public function gutenberg_dissable_wptexturize($block_content, $block)
js/fbuilder-pro-public.jquery.js CHANGED
@@ -1,4 +1,4 @@
1
- $.fbuilder['version'] = '1.1.70';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
1
+ $.fbuilder['version'] = '1.1.71';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
js/fields-public/08_fbuilder.fdropdown.js CHANGED
@@ -62,10 +62,19 @@
62
  var me = this;
63
  if(me.select2)
64
  {
 
 
 
 
 
65
  $('#'+me.name).after('<span class="cff-select2-container"></span>');
66
  $('#'+me.name).on('change', function(){$(this).valid();});
67
  if('select2' in $.fn)
68
- $('#'+me.name).select2({'dropdownParent':$('#'+me.name).next('.cff-select2-container')});
 
 
 
 
69
  else
70
  $(document).ready(function(){if('select2' in $.fn) $('#'+me.name).select2({'dropdownParent':$('#'+me.name).next('.cff-select2-container')});});
71
  }
62
  var me = this;
63
  if(me.select2)
64
  {
65
+ function formatState(state)
66
+ {
67
+ return !state.id ? state.text : $('<span style="display:inline-flex;align-items:center">'+state.id+'</span>');
68
+ };
69
+
70
  $('#'+me.name).after('<span class="cff-select2-container"></span>');
71
  $('#'+me.name).on('change', function(){$(this).valid();});
72
  if('select2' in $.fn)
73
+ $('#'+me.name).select2({
74
+ 'templateResult': formatState,
75
+ 'templateSelection': formatState,
76
+ 'dropdownParent':$('#'+me.name).next('.cff-select2-container')
77
+ });
78
  else
79
  $(document).ready(function(){if('select2' in $.fn) $('#'+me.name).select2({'dropdownParent':$('#'+me.name).next('.cff-select2-container')});});
80
  }
js/modules/01_mathematical_logical/public/module_public.js CHANGED
@@ -91,7 +91,7 @@ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ] = {
91
 
92
  if(isFinite(num*1))
93
  {
94
- var time_only = (num<1);
95
  num = Math.round(num*86400000);
96
  if(time_only) num += (new Date(2021,01,01,0,0,0,0)).valueOf();
97
  var date = new Date(num),
91
 
92
  if(isFinite(num*1))
93
  {
94
+ var time_only = (Math.abs(num)<1);
95
  num = Math.round(num*86400000);
96
  if(time_only) num += (new Date(2021,01,01,0,0,0,0)).valueOf();
97
  var date = new Date(num),
pagebuilders/gutenberg/assets/js/gutenberg.js CHANGED
@@ -29,7 +29,6 @@ jQuery(function()
29
  default: '[CP_CALCULATED_FIELDS id=""]'
30
  }
31
  },
32
-
33
  edit: function( props ) {
34
 
35
  function generate_shortcode()
@@ -94,6 +93,22 @@ jQuery(function()
94
  additional = get_addtional_atts(),
95
  children = [];
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  // Creates the options for the forms list
99
  for( var form_id in cpcff_gutenberg_editor_config['forms'])
29
  default: '[CP_CALCULATED_FIELDS id=""]'
30
  }
31
  },
 
32
  edit: function( props ) {
33
 
34
  function generate_shortcode()
93
  additional = get_addtional_atts(),
94
  children = [];
95
 
96
+ if(
97
+ 'url' in cpcff_gutenberg_editor_config &&
98
+ typeof cff_gutenberg_editor_config_interval == 'undefined'
99
+ )
100
+ {
101
+ cff_gutenberg_editor_config_interval = setInterval(
102
+ function(){
103
+ $cff_backend_url = cpcff_gutenberg_editor_config['url'].split('?')[0];
104
+ jQuery.getJSON($cff_backend_url, {'cff-action': 'cff-gutenberg-editor-config'}, function(data){
105
+ if(typeof data == 'object' && 'url' in data)
106
+ cpcff_gutenberg_editor_config = data;
107
+ });
108
+ },
109
+ 40000
110
+ );
111
+ }
112
 
113
  // Creates the options for the forms list
114
  for( var form_id in cpcff_gutenberg_editor_config['forms'])