Calculated Fields Form - Version 1.0.443

Version Description

  • Includes two new operations: ENABLEEQUATIONS and DISABLEEQUATIONS for enabling/disabling the dynamic evaluation of the equations, respectively.
Download this release

Release Info

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

Code changes from version 1.0.441 to 1.0.443

README.txt CHANGED
@@ -949,6 +949,15 @@ This way the special characters should show correctly.
949
 
950
  == Changelog ==
951
 
 
 
 
 
 
 
 
 
 
952
  = 1.0.441 =
953
 
954
  * Fixes an issue in the Slider controls using another slider field as the default value of the attributes.
@@ -989,21 +998,8 @@ This way the special characters should show correctly.
989
  * Modifies the WooCommerce add-on to allow editing the products added to the cart (Developer and Platinum versions).
990
  * Modifies the Users Permissions add-on (Developer and Platinum versions).
991
 
992
- = 1.0.433 =
993
-
994
- * Modifies the collapsible behavior in the fieldset fields.
995
- * Includes additional validations in the DS fields (Developer and Platinum versions).
996
- * Fixes a conflict with the reCAPTCHA styles (Developer and Platinum versions).
997
-
998
- = 1.0.432 =
999
-
1000
- * Modifies the previsualization for forms as the pages of the form.
1001
- * Fixes a conflict with the Jetpack Lazy Load images.
1002
- * Modifies the module to prevent the thank you page be cached (Professional, Developer, and Platinum versions).
1003
- * Modifies the popup for data edition in the Users Permissions add-on (Developer and Platinum versions).
1004
-
1005
  == Upgrade Notice ==
1006
 
1007
- = 1.0.441 =
1008
 
1009
  Important note: If you are using the Professional version don't update via the WP dashboard but using your personal update link. Contact us if you need further information: http://cff.dwbooster.com/contact-us
949
 
950
  == Changelog ==
951
 
952
+ = 1.0.443 =
953
+
954
+ * Includes two new operations: ENABLEEQUATIONS and DISABLEEQUATIONS for enabling/disabling the dynamic evaluation of the equations, respectively.
955
+
956
+ = 1.0.442 =
957
+
958
+ * Modifies the validations on Date/Time fields.
959
+ * Fixes an issue in the forms previews.
960
+
961
  = 1.0.441 =
962
 
963
  * Fixes an issue in the Slider controls using another slider field as the default value of the attributes.
998
  * Modifies the WooCommerce add-on to allow editing the products added to the cart (Developer and Platinum versions).
999
  * Modifies the Users Permissions add-on (Developer and Platinum versions).
1000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  == Upgrade Notice ==
1002
 
1003
+ = 1.0.443 =
1004
 
1005
  Important note: If you are using the Professional version don't update via the WP dashboard but using your personal update link. Contact us if you need further information: http://cff.dwbooster.com/contact-us
changelog.txt CHANGED
@@ -1,5 +1,14 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.441 =
4
 
5
  * Fixes an issue in the Slider controls using another slider field as the default value of the attributes.
@@ -515,12 +524,4 @@
515
 
516
  = 1.0.344 =
517
 
518
- * Improves the goToPage operation to allow jumping to a sepecific page in multi-pages forms, from button fields. Ex: for jumping to the third page in the form (the pages indexes start in 0), insert a button in the form and enter as its onclick event the piece of code: fbuilderjQuery.fbuilder.goToPage({form:this.form, to:2});
519
-
520
- = 1.0.343 =
521
-
522
- * Fixes an issue in the dependencies definition in the Radio Buttons, Checkbox, and DropDown fields.
523
-
524
- = 1.0.342 =
525
-
526
- * Modifies the CSS rules to improve the user experience in the forms builder when it is accessed from small screens like smartphones.
1
  == Changelog ==
2
 
3
+ = 1.0.443 =
4
+
5
+ * Includes two new operations: ENABLEEQUATIONS and DISABLEEQUATIONS for enabling/disabling the dynamic evaluation of the equations, respectively.
6
+
7
+ = 1.0.442 =
8
+
9
+ * Modifies the validations on Date/Time fields.
10
+ * Fixes an issue in the forms previews.
11
+
12
  = 1.0.441 =
13
 
14
  * Fixes an issue in the Slider controls using another slider field as the default value of the attributes.
524
 
525
  = 1.0.344 =
526
 
527
+ * Improves the goToPage operation to allow jumping to a sepecific page in multi-pages forms, from button fields. Ex: for jumping to the third page in the form (the pages indexes start in 0), insert a button in the form and enter as its onclick event the piece of code: fbuilderjQuery.fbuilder.goToPage({form:this.form, to:2});
 
 
 
 
 
 
 
 
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.0.441
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.0.441' );
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.0.443
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.0.443' );
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 ) );
inc/cpcff_main.inc.php CHANGED
@@ -403,7 +403,7 @@ if(!class_exists('CPCFF_MAIN'))
403
  {
404
  print '<!DOCTYPE html><html><head profile="http://gmpg.org/xfn/11"><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1"></head><body>';
405
  print $message;
406
- print '<style>body>*:not(form){visibility: hidden;}</style></body></html>';
407
  exit;
408
  }
409
  else
403
  {
404
  print '<!DOCTYPE html><html><head profile="http://gmpg.org/xfn/11"><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1"></head><body>';
405
  print $message;
406
+ print '<style>body>*:not(form){visibility: hidden;} .ui-datepicker,.ui-datepicker *{visibility: visible;}</style></body></html>';
407
  exit;
408
  }
409
  else
js/fields-public/04_fbuilder.fdate.js CHANGED
@@ -38,6 +38,17 @@
38
  ariaMinuteLabel: 'minutes',
39
  ariaAMPMLabel: 'am or pm',
40
 
 
 
 
 
 
 
 
 
 
 
 
41
  _set_Events : function()
42
  {
43
  var me = this,
@@ -62,6 +73,7 @@
62
  n = $('#'+e.name+'_date');
63
 
64
  d = d || n.datepicker('getDate');
 
65
  if( d === null || !w[ d.getDay()] ) return false;
66
  if( i !== null )
67
  {
@@ -325,9 +337,10 @@
325
  try
326
  {
327
  var p = e.name.replace('_date', '').split('_'),
328
- i = $.fbuilder.forms['_'+p[1]].getItem(p[0]);
 
329
 
330
- if(i != null) return this.optional(e) || (i._validateDate() && i._validateTime());
331
  return true;
332
  }
333
  catch( er )
@@ -348,17 +361,15 @@
348
  raw = raw || false;
349
  var me = this,
350
  e = $( '[id="' + me.name + '"]:not(.ignore)' ),
351
- dformat = me.dformat.replace(new RegExp('\\'+me.dseparator, 'g'), '/');
 
352
  if( e.length )
353
  {
354
- var v = e.val(), rt;
355
  if(raw) return $.fbuilder.parseValStr(v, raw);
356
 
357
- if(/^y/i.test(dformat)) rt = '(\\d{4})[^\\d](\\d{1,2})[^\\d](\\d{1,2})';
358
- else rt = '(\\d{1,2})[\\/\\-\\.](\\d{1,2})[\\/\\-\\.](\\d{4})';
359
-
360
  v = $.trim(e.val());
361
- var re = new RegExp( rt+'(\\s(\\d{1,2})[:\\.](\\d{1,2})\s*([amp]{2})?)?' ),
362
  d = re.exec( v ),
363
  h = 0,
364
  m = 0,
@@ -374,7 +385,7 @@
374
  if(am == 'pm' && h < 12 ) h += 12;
375
  if(am == 'am' && h == 12) h -= 12;
376
  }
377
- switch( dformat )
378
  {
379
  case 'yyyy/dd/mm':
380
  date = new Date( d[ 1 ], ( d[ 3 ] * 1 - 1 ), d[ 2 ], h, m, 0, 0 );
38
  ariaMinuteLabel: 'minutes',
39
  ariaAMPMLabel: 'am or pm',
40
 
41
+ _get_regexp : function()
42
+ {
43
+ var me = this,
44
+ df = me.dformat.replace(new RegExp('\\'+me.dseparator, 'g'), '/'),
45
+ rt;
46
+
47
+ if(/^y/i.test(df)) rt = '(\\d{4})[^\\d](\\d{1,2})[^\\d](\\d{1,2})';
48
+ else rt = '(\\d{1,2})[\\/\\-\\.](\\d{1,2})[\\/\\-\\.](\\d{4})';
49
+
50
+ return {d:df, r:rt};
51
+ },
52
  _set_Events : function()
53
  {
54
  var me = this,
73
  n = $('#'+e.name+'_date');
74
 
75
  d = d || n.datepicker('getDate');
76
+
77
  if( d === null || !w[ d.getDay()] ) return false;
78
  if( i !== null )
79
  {
337
  try
338
  {
339
  var p = e.name.replace('_date', '').split('_'),
340
+ i = $.fbuilder.forms['_'+p[1]].getItem(p[0]),
341
+ o = me._get_regexp();
342
 
343
+ if(i != null) return this.optional(e) || (i._validateDate() && (new RegExp(o.r)).test(v) && i._validateTime());
344
  return true;
345
  }
346
  catch( er )
361
  raw = raw || false;
362
  var me = this,
363
  e = $( '[id="' + me.name + '"]:not(.ignore)' ),
364
+ o = me._get_regexp();
365
+
366
  if( e.length )
367
  {
368
+ var v = e.val();
369
  if(raw) return $.fbuilder.parseValStr(v, raw);
370
 
 
 
 
371
  v = $.trim(e.val());
372
+ var re = new RegExp( o.r+'(\\s(\\d{1,2})[:\\.](\\d{1,2})\s*([amp]{2})?)?' ),
373
  d = re.exec( v ),
374
  h = 0,
375
  m = 0,
385
  if(am == 'pm' && h < 12 ) h += 12;
386
  if(am == 'am' && h == 12) h -= 12;
387
  }
388
+ switch( o.d )
389
  {
390
  case 'yyyy/dd/mm':
391
  date = new Date( d[ 1 ], ( d[ 3 ] * 1 - 1 ), d[ 2 ], h, m, 0, 0 );
js/modules/05_managing_fields/admin/module_admin.js CHANGED
@@ -22,6 +22,16 @@ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'processing' ] = {
22
  "value" : "ACTIVATEFIELD",
23
  "code" : "ACTIVATEFIELD(",
24
  "tip" : "<p>Activates a field explicitly, similar to dependencies. <strong>ACTIVATEFIELD( # or fieldname#, form or form selector )</strong></p><p>Activates the field for the equations and submission. The first parameter is required, it would be the numeric part of the field name or the field name. The second parameter would be a form object, or a selector with the form reference. If the second parameter is not passed, the plugin will apply the activates action to the field in the first form of the page. For example: ACTIVATEFIELD(1); or ACTIVATEFIELD(&quot;fieldname1&quot;);</p>"
 
 
 
 
 
 
 
 
 
 
25
  }
26
  ]
27
  }
22
  "value" : "ACTIVATEFIELD",
23
  "code" : "ACTIVATEFIELD(",
24
  "tip" : "<p>Activates a field explicitly, similar to dependencies. <strong>ACTIVATEFIELD( # or fieldname#, form or form selector )</strong></p><p>Activates the field for the equations and submission. The first parameter is required, it would be the numeric part of the field name or the field name. The second parameter would be a form object, or a selector with the form reference. If the second parameter is not passed, the plugin will apply the activates action to the field in the first form of the page. For example: ACTIVATEFIELD(1); or ACTIVATEFIELD(&quot;fieldname1&quot;);</p>"
25
+ },
26
+ {
27
+ "value" : "DISABLEEQUATIONS",
28
+ "code" : "DISABLEEQUATIONS(",
29
+ "tip" : "<p>Allows to disable dynamic evaluation of equations. Accepts an optional parameter: form object, jQuery object or selector. If the parameter is omitted, disables evaluation of equations on all forms on the page. Ex: DISABLEEQUATIONS();</p>"
30
+ },
31
+ {
32
+ "value" : "ENABLEEQUATIONS",
33
+ "code" : "ENABLEEQUATIONS(",
34
+ "tip" : "<p>Allows to enable dynamic evaluation of equations. Accepts an optional parameter: form object, jQuery object or selector. If the parameter is omitted, enables evaluation of equations on all forms on the page. Ex: ENABLEEQUATIONS();</p>"
35
  }
36
  ]
37
  }
js/modules/05_managing_fields/public/05_managing_fields.js CHANGED
@@ -59,6 +59,16 @@
59
  }
60
  };
61
 
 
 
 
 
 
 
 
 
 
 
62
  root.CF_FIELDS_MANAGEMENT = lib;
63
 
64
  })(this);
59
  }
60
  };
61
 
62
+ lib.disableequations = lib.DISABLEEQUATIONS = function(f)
63
+ {
64
+ jQuery(f || '[id*="cp_calculatedfieldsf_pform_"]').attr('data-evalequations',0);
65
+ };
66
+
67
+ lib.enableequations = lib.ENABLEEQUATIONS = function(f)
68
+ {
69
+ jQuery(f || '[id*="cp_calculatedfieldsf_pform_"]').attr('data-evalequations',1);
70
+ };
71
+
72
  root.CF_FIELDS_MANAGEMENT = lib;
73
 
74
  })(this);