Calculated Fields Form - Version 1.1.90

Version Description

  • Improves the form creation making the controls draggable.
  • Modifies the fieldset control to allow emulating an accordion control.
  • Modifies the email control.
  • Improves the integration with the CFF Rich Text Editor and CP Blocks plugins.
Download this release

Release Info

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

Code changes from version 1.1.89 to 1.1.90

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: 6.0
7
- Stable tag: 1.1.89
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -965,6 +965,13 @@ A: Please, follow the steps below:
965
 
966
  == Changelog ==
967
 
 
 
 
 
 
 
 
968
  = 1.1.89 =
969
 
970
  * Modifies numeric fields. When Digits format is selected, the field does not accept other symbols to be typed by the user.
@@ -1021,12 +1028,4 @@ A: Please, follow the steps below:
1021
  * Modifies the DATETIMESUM operation to allow ignoring weekends.
1022
  * Modifies the getField operation.
1023
  * Fixes a conflict with WP Rocket.
1024
- * Modifies the Submissions data-source to allow loading paid submissions only (Developer and Platinum versions).
1025
-
1026
- = 1.1.80 =
1027
-
1028
- * Modifies the code that formats the equations' results.
1029
- * Implements the UNFORMAT operation.
1030
- * Modifies From and To attributes in the RecordSet DS fields for the Submissions data-source (Developer and Platinum versions).
1031
- * Modifies the User Registration add-on (Developer and Platinum versions).
1032
- * Fixes an issue in the MailChimp add-on (Platinum version).
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: 6.0
7
+ Stable tag: 1.1.90
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.90 =
969
+
970
+ * Improves the form creation making the controls draggable.
971
+ * Modifies the fieldset control to allow emulating an accordion control.
972
+ * Modifies the email control.
973
+ * Improves the integration with the CFF Rich Text Editor and CP Blocks plugins.
974
+
975
  = 1.1.89 =
976
 
977
  * Modifies numeric fields. When Digits format is selected, the field does not accept other symbols to be typed by the user.
1028
  * Modifies the DATETIMESUM operation to allow ignoring weekends.
1029
  * Modifies the getField operation.
1030
  * Fixes a conflict with WP Rocket.
1031
+ * Modifies the Submissions data-source to allow loading paid submissions only (Developer and Platinum versions).
 
 
 
 
 
 
 
 
changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
3
  = 1.1.89 =
4
 
5
  * Modifies numeric fields. When Digits format is selected, the field does not accept other symbols to be typed by the user.
1
  == Changelog ==
2
 
3
+ = 1.1.90 =
4
+
5
+ * Improves the form creation making the controls draggable.
6
+ * Modifies the fieldset control to allow emulating an accordion control.
7
+ * Modifies the email control.
8
+ * Improves the integration with the CFF Rich Text Editor and CP Blocks plugins.
9
+
10
  = 1.1.89 =
11
 
12
  * Modifies numeric fields. When Digits format is selected, the field does not accept other symbols to be typed by the user.
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.89
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.89' );
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.90
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.90' );
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/style.css CHANGED
@@ -5,47 +5,97 @@
5
  src: url(flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
6
  }
7
  /** BTTN ICONS **/
 
8
  .ctrlsColumn .itemForm::before{font-family:'Material Icons';font-weight: normal;float:left;margin-left:-5px;font-size:13px;}
9
 
 
 
10
  #ftextds.itemForm::before,
11
  #ftext.itemForm::before{content:"\e262";}
 
 
12
  #femailds.itemForm::before,
13
  #femail.itemForm::before{content:"\e159";}
 
 
14
  #ftextareads.itemForm::before,
15
  #ftextarea.itemForm::before{content:"\ef42";}
 
 
16
  #fdropdownds.itemForm::before,
17
  #fdropdown.itemForm::before{content:"\e0ee";}
 
 
18
  #fnumberds.itemForm::before,
19
  #fnumber.itemForm::before{content:"\eac7";}
 
 
20
  #fcurrencyds.itemForm::before,
21
  #fcurrency.itemForm::before{content:"\e227";}
 
 
22
  #fcheckds.itemForm::before,
23
  #fcheck.itemForm::before{content:"\e834";}
 
 
24
  #fradiods.itemForm::before,
25
  #fradio.itemForm::before{content:"\e837";}
 
 
26
  #fPhoneds.itemForm::before,
27
  #fPhone.itemForm::before{content:"\e0cd";}
 
 
28
  #fhiddends.itemForm::before,
29
  #fhidden.itemForm::before{content:"\f023";}
 
 
30
  #fdateds.itemForm::before,
31
  #fdate.itemForm::before{content:"\e935";}
32
-
33
  #frecordsetds.itemForm::before{content:"\ead3";}
 
34
  #fdatatableds.itemForm::before{content:"\e3ec";}
 
35
  #fSectionBreak.itemForm::before{content:"\e22c";}
 
36
  #fPageBreak.itemForm::before{content:"\eaca";}
 
37
  #fsummary.itemForm::before{content:"\e949";}
 
38
  #fButton.itemForm::before{content:"\f1c1";}
 
39
  #fslider.itemForm::before{content:"\e260";}
 
40
  #fcolor.itemForm::before{content:"\e3b8";}
 
41
  #ffieldset.itemForm::before{content:"\eb73";}
 
42
  #fdiv.itemForm::before{content:"\eb73";}
 
43
  #fhtml.itemForm::before{content:"\e86f";}
 
44
  #ffile.itemForm::before{content:"\e2c6";}
 
45
  #fMedia.itemForm::before{content:"\e410";}
 
46
  #fCommentArea.itemForm::before{content:"\e165";}
 
47
  #fpassword.itemForm::before{content:"\f042";}
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  .cff-custom-table input{margin-left:5px; margin-right:5px;}
50
  .form-builder{font-size:11px;width:100%;min-width:780px;}
51
  .clearer{clear:both;}
@@ -65,7 +115,7 @@
65
  .button, .form-builder .button{float:left;margin:5px 15px;text-align:center;}
66
  .button.n span{color:#AED0EA}
67
  .cff-active-column{border:1px solid #0073aa; padding:5px;display:inline-block;}
68
- #fbuilder{height:640px;overflow:auto;position:relative;}
69
  #fbuilder .fields{border:1px solid transparent;padding:3px 10px 14px 10px;margin:5px 0px;display:block;position:relative;}
70
  #fbuilder .fields:before {content: attr(title); background-color:#FFF1A0;text-shadow: 1px 1px 0px rgba(255, 255, 255, .4); padding:3px 5px; margin:0 5px 5px 0; display:table;border: 1px solid rgba(0,0,0,.2);}
71
  #fbuilder .ftext:before{background-color:rgba(212,187,221,0.7);}
5
  src: url(flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
6
  }
7
  /** BTTN ICONS **/
8
+ .cff-button-drag::before{font-family:'Material Icons';font-weight:normal;font-size:1em;background:transparent !important;margin-right:10px;}
9
  .ctrlsColumn .itemForm::before{font-family:'Material Icons';font-weight: normal;float:left;margin-left:-5px;font-size:13px;}
10
 
11
+ .cff-button-drag.ftext::before,
12
+ .cff-button-drag.ftextds::before,
13
  #ftextds.itemForm::before,
14
  #ftext.itemForm::before{content:"\e262";}
15
+ .cff-button-drag.femail::before,
16
+ .cff-button-drag.femailds::before,
17
  #femailds.itemForm::before,
18
  #femail.itemForm::before{content:"\e159";}
19
+ .cff-button-drag.ftextarea::before,
20
+ .cff-button-drag.ftextareads::before,
21
  #ftextareads.itemForm::before,
22
  #ftextarea.itemForm::before{content:"\ef42";}
23
+ .cff-button-drag.fdropdown::before,
24
+ .cff-button-drag.fdropdownds::before,
25
  #fdropdownds.itemForm::before,
26
  #fdropdown.itemForm::before{content:"\e0ee";}
27
+ .cff-button-drag.fnumber::before,
28
+ .cff-button-drag.fnumberds::before,
29
  #fnumberds.itemForm::before,
30
  #fnumber.itemForm::before{content:"\eac7";}
31
+ .cff-button-drag.fcurrency::before,
32
+ .cff-button-drag.fcurrencyds::before,
33
  #fcurrencyds.itemForm::before,
34
  #fcurrency.itemForm::before{content:"\e227";}
35
+ .cff-button-drag.fcheck::before,
36
+ .cff-button-drag.fcheckds::before,
37
  #fcheckds.itemForm::before,
38
  #fcheck.itemForm::before{content:"\e834";}
39
+ .cff-button-drag.fradio::before,
40
+ .cff-button-drag.fradiods::before,
41
  #fradiods.itemForm::before,
42
  #fradio.itemForm::before{content:"\e837";}
43
+ .cff-button-drag.fPhone::before,
44
+ .cff-button-drag.fPhoneds::before,
45
  #fPhoneds.itemForm::before,
46
  #fPhone.itemForm::before{content:"\e0cd";}
47
+ .cff-button-drag.fhidden::before,
48
+ .cff-button-drag.fhiddends::before,
49
  #fhiddends.itemForm::before,
50
  #fhidden.itemForm::before{content:"\f023";}
51
+ .cff-button-drag.fdate::before,
52
+ .cff-button-drag.fdateds::before,
53
  #fdateds.itemForm::before,
54
  #fdate.itemForm::before{content:"\e935";}
55
+ .cff-button-drag.frecordsetds::before,
56
  #frecordsetds.itemForm::before{content:"\ead3";}
57
+ .cff-button-drag.fdatatableds::before,
58
  #fdatatableds.itemForm::before{content:"\e3ec";}
59
+ .cff-button-drag.fSectionBreak::before,
60
  #fSectionBreak.itemForm::before{content:"\e22c";}
61
+ .cff-button-drag.fPageBreak::before,
62
  #fPageBreak.itemForm::before{content:"\eaca";}
63
+ .cff-button-drag.fsummary::before,
64
  #fsummary.itemForm::before{content:"\e949";}
65
+ .cff-button-drag.fButton::before,
66
  #fButton.itemForm::before{content:"\f1c1";}
67
+ .cff-button-drag.fslider::before,
68
  #fslider.itemForm::before{content:"\e260";}
69
+ .cff-button-drag.fcolor::before,
70
  #fcolor.itemForm::before{content:"\e3b8";}
71
+ .cff-button-drag.ffieldset::before,
72
  #ffieldset.itemForm::before{content:"\eb73";}
73
+ .cff-button-drag.fdiv::before,
74
  #fdiv.itemForm::before{content:"\eb73";}
75
+ .cff-button-drag.fhtml::before,
76
  #fhtml.itemForm::before{content:"\e86f";}
77
+ .cff-button-drag.ffile::before,
78
  #ffile.itemForm::before{content:"\e2c6";}
79
+ .cff-button-drag.fMedia::before,
80
  #fMedia.itemForm::before{content:"\e410";}
81
+ .cff-button-drag.fCommentArea::before,
82
  #fCommentArea.itemForm::before{content:"\e165";}
83
+ .cff-button-drag.fpassword::before,
84
  #fpassword.itemForm::before{content:"\f042";}
85
 
86
+ .cff-button-drag{
87
+ font-size:1em !important;
88
+ border: 1px solid #C2D7EF !important;
89
+ background-color: #dfeffd7a !important;
90
+ opacity:1 !important;
91
+ color: #3c434a !important;
92
+ padding: 10px 0 !important;
93
+ text-align:center !important;
94
+ box-sizing: border-box;
95
+ }
96
+ #fieldlist{flex: 1 1 auto;}
97
+ #fieldlist .cff-button-drag{width:90% !important;}
98
+
99
  .cff-custom-table input{margin-left:5px; margin-right:5px;}
100
  .form-builder{font-size:11px;width:100%;min-width:780px;}
101
  .clearer{clear:both;}
115
  .button, .form-builder .button{float:left;margin:5px 15px;text-align:center;}
116
  .button.n span{color:#AED0EA}
117
  .cff-active-column{border:1px solid #0073aa; padding:5px;display:inline-block;}
118
+ #fbuilder{height:640px;overflow:auto;position:relative;display:flex;flex-flow:column;}
119
  #fbuilder .fields{border:1px solid transparent;padding:3px 10px 14px 10px;margin:5px 0px;display:block;position:relative;}
120
  #fbuilder .fields:before {content: attr(title); background-color:#FFF1A0;text-shadow: 1px 1px 0px rgba(255, 255, 255, .4); padding:3px 5px; margin:0 5px 5px 0; display:table;border: 1px solid rgba(0,0,0,.2);}
121
  #fbuilder .ftext:before{background-color:rgba(212,187,221,0.7);}
css/stylepublic.css CHANGED
@@ -408,7 +408,8 @@
408
  #fbuilder legend{border:1px solid #ccc;padding:5px 10px;}
409
  #fbuilder .cff-collapsible.cff-collapsed>fieldset>div{display:none;}
410
  #fbuilder .cff-collapsible.cff-collapsed>fieldset::after{content:'...';}
411
- #fbuilder .cff-collapsible>fieldset>legend::after{content:"\2B0D";margin-left:10px;}
 
412
  #fbuilder .cff-collapsible>fieldset>legend{cursor:pointer;}
413
  #fbuilder .cpcaptchalayer,.cp_subbtn{display:none;}
414
  #fbuilder .captcha img{ cursor:pointer; }
408
  #fbuilder legend{border:1px solid #ccc;padding:5px 10px;}
409
  #fbuilder .cff-collapsible.cff-collapsed>fieldset>div{display:none;}
410
  #fbuilder .cff-collapsible.cff-collapsed>fieldset::after{content:'...';}
411
+ #fbuilder .cff-collapsible>fieldset>legend::after{content:"\276F";margin-left:10px;display:inline-block;transform: rotate(90deg);}
412
+ #fbuilder .cff-collapsible.cff-collapsed>fieldset>legend::after{transform:rotate(0deg);}
413
  #fbuilder .cff-collapsible>fieldset>legend{cursor:pointer;}
414
  #fbuilder .cpcaptchalayer,.cp_subbtn{display:none;}
415
  #fbuilder .captcha img{ cursor:pointer; }
inc/cpcff_admin_int.inc.php CHANGED
@@ -161,6 +161,26 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
161
 
162
  $calculatedfieldsfQuery(".itemForm").click(function() {
163
  f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  });
165
 
166
  jQuery(".metabox_disabled_section")
161
 
162
  $calculatedfieldsfQuery(".itemForm").click(function() {
163
  f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
164
+ })
165
+ .draggable({
166
+ connectToSortable: '#fbuilder #fieldlist',
167
+ delay: 100,
168
+ helper: function() {
169
+ var $ = $calculatedfieldsfQuery,
170
+ e = $(this),
171
+ width = e.outerWidth(),
172
+ text = e.text(),
173
+ type = e.attr('id'),
174
+ el = $('<div class="cff-button-drag '+type+'">');
175
+
176
+ return el.html( text ).css( 'width', width ).attr('data-control',type);
177
+ },
178
+ revert: 'invalid',
179
+ cancel: false,
180
+ scroll: false,
181
+ opacity: 1,
182
+ containment: 'document',
183
+ stop: function(){$calculatedfieldsfQuery('.ctrlsColumn .itemForm').removeClass('button-primary');}
184
  });
185
 
186
  jQuery(".metabox_disabled_section")
inc/cpcff_auxiliary.inc.php CHANGED
@@ -132,10 +132,17 @@ if(!class_exists('CPCFF_AUXILIARY'))
132
  * @params mixed $v.
133
  * @return sanitized value.
134
  */
135
- public static function sanitize( $v )
136
  {
137
  $allowed_tags = wp_kses_allowed_html( 'post' );
138
- $v = wp_kses($v, $allowed_tags);
 
 
 
 
 
 
 
139
  // the str_replace is a patch to solve an issue with the data: part in signature fields
140
  // that are removed by wp_kse.
141
  return str_replace(
132
  * @params mixed $v.
133
  * @return sanitized value.
134
  */
135
+ public static function sanitize( $v )
136
  {
137
  $allowed_tags = wp_kses_allowed_html( 'post' );
138
+
139
+ add_filter('safecss_filter_attr_allow_css', function($allow_css, $css_test_string){
140
+ if(preg_match('/rgb(a)?\(/i', $css_test_string)) return true;
141
+ return $allow_css;
142
+ }, 10, 2);
143
+
144
+ $v = wp_kses($v, $allowed_tags);
145
+
146
  // the str_replace is a patch to solve an issue with the data: part in signature fields
147
  // that are removed by wp_kse.
148
  return str_replace(
js/fbuilder-pro-admin.jquery.js CHANGED
@@ -143,8 +143,15 @@
143
 
144
  $("#tabs-1").append('<div class="clearer"></div>');
145
  $( ".button").button();
146
- $(document).on('mouseover', '.ctrlsColumn .itemForm:not(#facceptance):not(#fCalculated)', function(){$(this).addClass('button-primary');})
147
- .on('mouseout', '.ctrlsColumn .itemForm', function(){$(this).removeClass('button-primary');});
 
 
 
 
 
 
 
148
 
149
  // Create a items object
150
  var items = [],
@@ -153,7 +160,8 @@
153
 
154
  $.fbuilder[ 'editItem' ] = function( id )
155
  {
156
- selected = id;
 
157
  try
158
  {
159
  $('#tabs-2').html( items[id].showAllSettings() );
@@ -460,7 +468,6 @@
460
  };
461
 
462
  args = $.extend(true, {}, default_args, ( typeof args != 'undefined' ) ? args : {} );
463
-
464
  if( !$.isEmptyObject( args[ 'field' ] ) )
465
  {
466
  replaceFieldTags( args[ 'field' ] );
@@ -642,39 +649,47 @@
642
  'tolerance': 'pointer',
643
  'update': function( event, ui )
644
  {
645
- var i, h = items.length;
646
- for( i = 0; i < h; i++ )
647
- {
648
- if( ui.item.hasClass( items[ i ].name ) ) break;
649
- }
650
-
651
- if( ui.item.parent().attr( 'id' ) == 'fieldlist' )
652
- {
653
- // receive or change order in fieldlist
654
- var prev = ui.item.prev(),
655
- index = parseInt( ui.item.index() );
656
-
657
- if( prev.length )
658
- {
659
- for( var j = 0; j < h; j++ )
660
- {
661
- if( prev.hasClass(items[j].name) )
662
- {
663
- index = (i<=j) ? j : ++j;
664
- break;
665
- }
666
- }
667
- }
668
-
669
- items.splice( index, 0, items.splice( i, 1 )[ 0 ] );
670
- $.fbuilder.reloadItems();
671
- $( '.'+/((fieldname)|(separator))\d+/.exec( ui.item.attr( 'class' ) )[ 0 ] ).click();
672
- }
673
- else
674
- {
675
- // remove
676
- items = items.concat( items.splice( i, 1 ) );
677
- }
 
 
 
 
 
 
 
 
678
  }
679
  }
680
  );
@@ -714,13 +729,15 @@
714
  {
715
  return items;
716
  },
717
- addItem: function(id)
718
  {
719
  var obj = new $.fbuilder.controls[id](),
720
  fBuild = this,
721
  n = 0;
722
 
723
- obj.init();
 
 
724
  for ( var i in fieldsIndex ) if( /fieldname/.test( i ) ) n = Math.max( parseInt( i.replace( /fieldname/g,"" ) ), n );
725
  n++;
726
 
143
 
144
  $("#tabs-1").append('<div class="clearer"></div>');
145
  $( ".button").button();
146
+ $(document).on('mousedown', function(){$.fbuilder.mousedown = 1;})
147
+ .on('mouseup', function(){$.fbuilder.mousedown = 0;})
148
+ .on('mouseover', '.ctrlsColumn .itemForm:not(#facceptance):not(#fCalculated)', function(){
149
+ $(this).addClass('button-primary');
150
+ })
151
+ .on('mouseout', '.ctrlsColumn .itemForm', function(){
152
+ if(!('mousedown' in $.fbuilder) || !$.fbuilder.mousedown)
153
+ $(this).removeClass('button-primary');
154
+ });
155
 
156
  // Create a items object
157
  var items = [],
160
 
161
  $.fbuilder[ 'editItem' ] = function( id )
162
  {
163
+ selected = id;
164
+
165
  try
166
  {
167
  $('#tabs-2').html( items[id].showAllSettings() );
468
  };
469
 
470
  args = $.extend(true, {}, default_args, ( typeof args != 'undefined' ) ? args : {} );
 
471
  if( !$.isEmptyObject( args[ 'field' ] ) )
472
  {
473
  replaceFieldTags( args[ 'field' ] );
649
  'tolerance': 'pointer',
650
  'update': function( event, ui )
651
  {
652
+ var index = ui.item.index('#fieldlist>div');
653
+ if(0<=index)
654
+ {
655
+ if(ui.item.hasClass('cff-button-drag')) // It is an new control
656
+ {
657
+ ui.item = $('.'+window['cff_form'].fBuild.addItem(ui.item.data('control'), -3).name);
658
+ }
659
+ var i, h = items.length;
660
+ for( i = 0; i < h; i++ )
661
+ {
662
+ if( ui.item.hasClass(items[i].name)) break;
663
+ }
664
+
665
+ if( index )
666
+ {
667
+ var prev = $('#fieldlist>div:eq('+(index-1)+')');
668
+ for( var j = 0; j < h; j++ )
669
+ {
670
+ if( prev.hasClass(items[j].name) )
671
+ {
672
+ index = (i<=j) ? j : ++j;
673
+ break;
674
+ }
675
+ }
676
+ }
677
+
678
+ items.splice( index, 0, items.splice( i, 1 )[ 0 ] );
679
+ $.fbuilder.reloadItems();
680
+ $('.'+/((fieldname)|(separator))\d+/.exec(ui.item.attr('class'))[0]).click();
681
+ }
682
+ else
683
+ {
684
+ // remove
685
+ try
686
+ {
687
+ var i, h = items.length;
688
+ for( i = 0; i < h; i++ ) if( ui.item.hasClass(items[i].name)) break;
689
+ items = items.concat( items.splice( i, 1 ) );
690
+ }
691
+ catch(err){}
692
+ }
693
  }
694
  }
695
  );
729
  {
730
  return items;
731
  },
732
+ addItem: function(id, _selected)
733
  {
734
  var obj = new $.fbuilder.controls[id](),
735
  fBuild = this,
736
  n = 0;
737
 
738
+ selected = _selected || selected;
739
+
740
+ obj.init();
741
  for ( var i in fieldsIndex ) if( /fieldname/.test( i ) ) n = Math.max( parseInt( i.replace( /fieldname/g,"" ) ), n );
742
  n++;
743
 
js/fbuilder-pro-public.jquery.js CHANGED
@@ -1,4 +1,4 @@
1
- $.fbuilder['version'] = '1.1.89';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
1
+ $.fbuilder['version'] = '1.1.90';
2
  $.fbuilder['controls'] = $.fbuilder['controls'] || {};
3
  $.fbuilder['forms'] = $.fbuilder['forms'] || {};
4
 
js/fields-admin/03_fbuilder.femail.js CHANGED
@@ -54,11 +54,22 @@
54
  },
55
  showSpecialDataInstance: function()
56
  {
57
- var str = '<label style="padding-bottom:5px;">Validate against a regular expression <input type="button" onclick="window.open(\'https://cff-bundles.dwbooster.com/product/regexp\');" value="+" title="Resources" /></label><input type="text" name="sRegExp" id="sRegExp" value="'+cff_esc_attr(this.regExp)+'" class="large" /><label>Error message when the regular expression fails</label><input type="text" name="sRegExpMssg" id="sRegExpMssg" value="'+cff_esc_attr(this.regExpMssg)+'" class="large" /><div class="cff-email-validator"></div>';
 
 
58
 
59
- $.ajax('admin.php?page=cff-email-validator-submenu').fail(function(a,b,c){
60
- $('.cff-email-validator').html('<a class="button-primary large" href="https://cff-bundles.dwbooster.com/product/email-validator" target="_blank" style="text-align:center;margin-top:10px;">Advanced email validator [+]</a>')
61
- });
62
- return str;
 
 
 
 
 
 
 
 
 
63
  }
64
  });
54
  },
55
  showSpecialDataInstance: function()
56
  {
57
+ function email_validator_link(){
58
+ return '<a class="button-primary large" href="https://cff-bundles.dwbooster.com/product/email-validator" target="_blank" style="text-align:center;margin-top:10px;">Advanced email validator [+]</a>';
59
+ }
60
 
61
+ var str = '<label style="padding-bottom:5px;">Validate against a regular expression <input type="button" onclick="window.open(\'https://cff-bundles.dwbooster.com/product/regexp\');" value="+" title="Resources" /></label><input type="text" name="sRegExp" id="sRegExp" value="'+cff_esc_attr(this.regExp)+'" class="large" /><label>Error message when the regular expression fails</label><input type="text" name="sRegExpMssg" id="sRegExpMssg" value="'+cff_esc_attr(this.regExpMssg)+'" class="large" /><div class="cff-email-validator">'+(
62
+ ('cff-email-validator-checked' in $.fbuilder && !$.fbuilder['cff-email-validator-checked']) ? email_validator_link() : ''
63
+ )+'</div>';
64
+
65
+ if(!('cff-email-validator-checked' in $.fbuilder))
66
+ {
67
+ $.fbuilder['cff-email-validator-checked'] = true;
68
+ $.ajax('admin.php?page=cff-email-validator-submenu').fail(function(a,b,c){
69
+ $.fbuilder['cff-email-validator-checked'] = false;
70
+ $('.cff-email-validator').html(email_validator_link());
71
+ });
72
+ }
73
+ return str;
74
  }
75
  });
js/fields-admin/28_fbuilder.fcontainer.js CHANGED
@@ -94,18 +94,18 @@
94
  'tolerance': 'pointer',
95
  'update': function( event, ui )
96
  {
97
- var p = ui.item.parents('.fields');
98
  if( p.length && $(this ).parents( '.fields' ).attr( 'id' ) == p.attr( 'id' ) )
99
  {
100
- // receive or or changing the ordering in the fieldscontainer
101
- me.fields = [];
102
- $( event.target ).children( '.fields' )
103
- .each( function()
104
- {
105
- me.fields.push( /((fieldname)|(separator))\d+/.exec( $(this).attr( 'class' ) )[ 0 ] );
106
- } );
107
  $.fbuilder.reloadItems();
108
- $( '.'+/((fieldname)|(separator))\d+/.exec( ui.item.attr( 'class' ) )[ 0 ] ).click();
109
  }
110
  else
111
  {
94
  'tolerance': 'pointer',
95
  'update': function( event, ui )
96
  {
97
+ var p = ui.item.parents('.fields');
98
  if( p.length && $(this ).parents( '.fields' ).attr( 'id' ) == p.attr( 'id' ) )
99
  {
100
+ var index = ui.item.index();
101
+ if(ui.item.hasClass('cff-button-drag')) // It is an new control
102
+ {
103
+ ui.item = $('.'+window['cff_form'].fBuild.addItem(ui.item.data('control'), -3).name);
104
+ }
105
+ // receive or or changing the ordering in the fieldscontainer
106
+ me.fields.splice(index,0,/((fieldname)|(separator))\d+/.exec(ui.item.attr('class'))[0]);
107
  $.fbuilder.reloadItems();
108
+ $('.'+/((fieldname)|(separator))\d+/.exec(ui.item.attr('class'))[0]).click();
109
  }
110
  else
111
  {
js/fields-admin/29_fbuilder.ffieldset.fc.js CHANGED
@@ -18,6 +18,7 @@
18
  collapsible:false, // Public
19
  defaultCollapsed: true, // Public
20
  collapsed:false, // Admin
 
21
  display:function()
22
  {
23
  return '<div class="fields '+this.name+((this.collapsed) ? ' collapsed' : '')+' '+this.ftype+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Collapse" class="collapse ui-icon ui-icon-folder-collapsed "></div><div title="Uncollapse" class="uncollapse ui-icon ui-icon-folder-open "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><div class="dfield"><FIELDSET class="fcontainer">'+( ( !/^\s*$/.test( this.title ) ) ? '<LEGEND>'+cff_esc_attr(this.title)+'</LEGEND>' : '' )+$.fbuilder.controls['fcontainer'].prototype.columnsSticker.call(this)+'<label class="collapsed-label">Collapsed ['+this.name+']</label><div class="fieldscontainer"></div></FIELDSET></div><div class="clearer" /></div>';
@@ -25,7 +26,7 @@
25
  editItemEvents:function()
26
  {
27
  $.fbuilder.controls[ 'fcontainer' ].prototype.editItemEvents.call(this);
28
- $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, [{s:"#sCollapsible",e:"click", l:"collapsible", f:function(el){return el.is(':checked');}}, {s:"#sCollapsedByDefault",e:"click", l:"defaultCollapsed", f:function(el){return el.is(':checked');}}]);
29
  },
30
  remove : function()
31
  {
@@ -42,7 +43,8 @@
42
  showCollapsible:function()
43
  {
44
  return '<label><input type="checkbox" name="sCollapsible" id="sCollapsible" '+((this.collapsible)?"checked":"")+'> Make it collapsible</label>'+
45
- '<label><input type="checkbox" name="sCollapsedByDefault" id="sCollapsedByDefault" '+((this.defaultCollapsed)?"checked":"")+'> Collapsed by default</label>';
 
46
  },
47
  showSpecialDataInstance: function()
48
  {
18
  collapsible:false, // Public
19
  defaultCollapsed: true, // Public
20
  collapsed:false, // Admin
21
+ selfClosing:false,
22
  display:function()
23
  {
24
  return '<div class="fields '+this.name+((this.collapsed) ? ' collapsed' : '')+' '+this.ftype+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Collapse" class="collapse ui-icon ui-icon-folder-collapsed "></div><div title="Uncollapse" class="uncollapse ui-icon ui-icon-folder-open "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><div class="dfield"><FIELDSET class="fcontainer">'+( ( !/^\s*$/.test( this.title ) ) ? '<LEGEND>'+cff_esc_attr(this.title)+'</LEGEND>' : '' )+$.fbuilder.controls['fcontainer'].prototype.columnsSticker.call(this)+'<label class="collapsed-label">Collapsed ['+this.name+']</label><div class="fieldscontainer"></div></FIELDSET></div><div class="clearer" /></div>';
26
  editItemEvents:function()
27
  {
28
  $.fbuilder.controls[ 'fcontainer' ].prototype.editItemEvents.call(this);
29
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, [{s:"#sCollapsible",e:"click", l:"collapsible", f:function(el){return el.is(':checked');}}, {s:"#sCollapsedByDefault",e:"click", l:"defaultCollapsed", f:function(el){return el.is(':checked');}}, {s:"#sSelfClosing",e:"click", l:"selfClosing", f:function(el){return el.is(':checked');}}]);
30
  },
31
  remove : function()
32
  {
43
  showCollapsible:function()
44
  {
45
  return '<label><input type="checkbox" name="sCollapsible" id="sCollapsible" '+((this.collapsible)?"checked":"")+'> Make it collapsible</label>'+
46
+ '<label style="padding-left:30px"><input type="checkbox" name="sCollapsedByDefault" id="sCollapsedByDefault" '+((this.defaultCollapsed)?"checked":"")+'> Collapsed by default</label>'+
47
+ '<label style="padding-left:30px"><input type="checkbox" name="sSelfClosing" id="sSelfClosing" '+((this.selfClosing)?"checked":"")+'> Only one opened at a time <br><i>If there are several fieldsets configured as collapsible on the same level, this fieldset will auto-close when another fieldset is opened.</i></label>';
48
  },
49
  showSpecialDataInstance: function()
50
  {
js/fields-admin/34_fbuilder.fhtml.js CHANGED
@@ -25,6 +25,7 @@
25
  if('codeEditor' in wp)
26
  {
27
  setTimeout(function(){
 
28
  var htmlEditorSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}, editor;
29
  htmlEditorSettings.codemirror = _.extend(
30
  {},
@@ -43,7 +44,7 @@
43
 
44
  $('.cff-editor-extend-shrink').on('click', function(){$(this).closest('.cff-editor-container').toggleClass('fullscreen');});
45
 
46
- }, 50);
47
  }
48
  },
49
  showContent:function()
25
  if('codeEditor' in wp)
26
  {
27
  setTimeout(function(){
28
+ if($('#tabs-2 .CodeMirror').length) return;
29
  var htmlEditorSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}, editor;
30
  htmlEditorSettings.codemirror = _.extend(
31
  {},
44
 
45
  $('.cff-editor-extend-shrink').on('click', function(){$(this).closest('.cff-editor-container').toggleClass('fullscreen');});
46
 
47
+ }, 10);
48
  }
49
  },
50
  showContent:function()
js/fields-public/29_fbuilder.ffieldset.fc.js CHANGED
@@ -9,16 +9,29 @@
9
  columns:1,
10
  collapsible:false,
11
  defaultCollapsed:true,
 
12
  rearrange: 0,
13
  show:function()
14
  {
15
- return '<div class="fields '+cff_esc_attr(this.csslayout)+' '+this.name+' cff-container-field '+((this.collapsible) ? 'cff-collapsible'+((this.defaultCollapsed) ? ' cff-collapsed' : '') : '')+'" id="field'+this.form_identifier+'-'+this.index+'"><FIELDSET>'+((!/^\s*$/.test(this.title)) ? '<LEGEND>'+this.title+'</LEGEND>' : '')+'<div id="'+this.name+'"></div></FIELDSET><div class="clearer"></div></div>';
16
  },
17
  after_show: function()
18
  {
19
  var me = this;
20
  $.fbuilder.controls['fcontainer'].prototype.after_show.call(this);
21
- if(me.collapsible) $('.'+me.name+'>fieldset>legend').bind('click', function(){$(this).closest('.cff-collapsible').toggleClass('cff-collapsed');});
 
 
 
 
 
 
 
 
 
 
 
 
22
  },
23
  showHideDep:function(toShow, toHide, hiddenByContainer)
24
  {
9
  columns:1,
10
  collapsible:false,
11
  defaultCollapsed:true,
12
+ selfClosing:false,
13
  rearrange: 0,
14
  show:function()
15
  {
16
+ return '<div class="fields '+cff_esc_attr(this.csslayout)+' '+this.name+' cff-container-field '+((this.collapsible) ? 'cff-collapsible'+((this.selfClosing) ? ' cff-selfclosing' : '')+((this.defaultCollapsed) ? ' cff-collapsed' : '') : '')+'" id="field'+this.form_identifier+'-'+this.index+'"><FIELDSET>'+((!/^\s*$/.test(this.title)) ? '<LEGEND>'+this.title+'</LEGEND>' : '')+'<div id="'+this.name+'"></div></FIELDSET><div class="clearer"></div></div>';
17
  },
18
  after_show: function()
19
  {
20
  var me = this;
21
  $.fbuilder.controls['fcontainer'].prototype.after_show.call(this);
22
+ if(me.collapsible){
23
+ $('.'+me.name+'>fieldset>legend').bind('click', function(){
24
+ var p = $(this).closest('.cff-collapsible');
25
+ if(p.length)
26
+ {
27
+ p.toggleClass('cff-collapsed');
28
+ if(!p.hasClass('cff-collapsed'))
29
+ {
30
+ p.siblings('.cff-selfclosing').addClass('cff-collapsed');
31
+ }
32
+ }
33
+ });
34
+ }
35
  },
36
  showHideDep:function(toShow, toHide, hiddenByContainer)
37
  {