Calculated Fields Form - Version 1.0.263

Version Description

  • Fixes another conflict with the Speed Booster Pack plugin.
  • Includes a new operation to access easier to the fields, for example to assign a value to the slider field: fieldname1, enter as part of the equation getField(1).setVal(50);
Download this release

Release Info

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

Code changes from version 1.0.235 to 1.0.263

Files changed (49) hide show
  1. README.txt +49 -34
  2. changelog.txt +151 -0
  3. cp_calculatedfieldsf_free.php +2 -2
  4. css/style.css +5 -2
  5. css/stylepublic.css +6 -2
  6. inc/cpcff_admin_int.inc.php +11 -8
  7. inc/cpcff_amp.inc.php +23 -5
  8. inc/cpcff_banner.inc.php +9 -2
  9. inc/cpcff_install_uninstall.inc.php +16 -87
  10. inc/cpcff_main.inc.php +47 -5
  11. inc/cpcff_public_int.inc.php +1 -1
  12. js/cp_calculatedfieldsf_gutenberg.js +127 -124
  13. js/fbuilder-pro-admin.jquery.js +0 -1
  14. js/fbuilder-pro-public.jquery.js +210 -95
  15. js/fields-admin/02_fbuilder.fcurrency.js +20 -19
  16. js/fields-admin/04_fbuilder.fdate.js +22 -12
  17. js/fields-admin/06_fbuilder.fcheck.js +3 -3
  18. js/fields-admin/07_fbuilder.fradio.js +11 -5
  19. js/fields-admin/08_fbuilder.fdropdown.js +3 -3
  20. js/fields-admin/28_fbuilder.fcontainer.js +10 -11
  21. js/fields-admin/fbuilder.fcalculated.js +1 -1
  22. js/fields-public/01_fbuilder.ftext.js +4 -3
  23. js/fields-public/02_fbuilder.fcurrency.js +14 -8
  24. js/fields-public/02_fbuilder.fnumber.js +5 -3
  25. js/fields-public/02_fbuilder.fslider.js +1 -1
  26. js/fields-public/03_fbuilder.femail.js +4 -3
  27. js/fields-public/04_fbuilder.fdate.js +119 -106
  28. js/fields-public/05_fbuilder.ftextarea.js +4 -3
  29. js/fields-public/06_fbuilder.fcheck.js +16 -14
  30. js/fields-public/07_fbuilder.fradio.js +25 -19
  31. js/fields-public/08_fbuilder.fdropdown.js +7 -6
  32. js/fields-public/09_fbuilder.ffile.js +1 -1
  33. js/fields-public/10_fbuilder.fpassword.js +7 -6
  34. js/fields-public/11_fbuilder.fphone.js +4 -3
  35. js/fields-public/12_fbuilder.fcommentarea.js +4 -4
  36. js/fields-public/13_fbuilder.fhidden.js +2 -2
  37. js/fields-public/14_fbuilder.fsectionbreak.js +3 -3
  38. js/fields-public/15_fbuilder.fpagebreak.js +2 -2
  39. js/fields-public/16_fbuilder.fsummary.js +10 -8
  40. js/fields-public/28_fbuilder.fcontainer.js +3 -3
  41. js/fields-public/29_fbuilder.ffieldset.fc.js +2 -2
  42. js/fields-public/30_fbuilder.fdiv.fc.js +2 -2
  43. js/fields-public/31_fbuilder.fmedia.js +7 -7
  44. js/fields-public/32_fbuilder.fbutton.js +19 -19
  45. js/fields-public/34_fbuilder.fhtml.js +4 -4
  46. js/fields-public/36_fbuilder.acceptance.js +6 -5
  47. js/fields-public/fbuilder.fcalculated.js +16 -11
  48. templates/11/style.css +2 -0
  49. templates/12/style.css +2 -1
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: codepeople
3
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: 4.9
7
Stable tag: trunk
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -114,9 +114,11 @@ The plugin has two additional (commercial) versions: **Premium** and **Developer
114
* Includes the DropBox Integration add-on to copy or move the uploaded files to a DropBox account.
115
* Includes the ip2location add-on to identify the users data from the ip2location databases. Requires PHP 5.3 and over.
116
* Includes the "Google Places" add-on that allows integrate the input fields with the Google Places API to autocomplete the addresses entered by the users.
117
* Includes the "Signature" add-on to convert some form fields in "Signature" fields, allowing the users to sign with the mouse or directly in the touchscreens.
118
* Includes the "iCal" add-on for sending the users an iCal file as part of the confirmation email after the form submission to be imported into most popular calendars like Outlook and Google Calendar.
119
* Includes the "WebMerge" add-on to integrate the forms with the WebMerge Service, and generate PDF and Office documents at runtime with the information collected by the forms.
120
* Includes the "MailChimp" add-on to add new members to the MailChimp Service using the data collected by the form.
121
* Includes the "Emma" add-on to add new members to the Emma Service using the data collected by the form.
122
* Includes the "Twilio" add-on for sending notification messages (SMS) when the forms are submitted.
@@ -368,6 +370,12 @@ The "Google Places" add-on allows to integrate the input fields with the Google
368
369
[CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#google-places-addon "Google Places add-on")
370
371
= Signature add-on - Only available in the Platinum version of the plugin =
372
373
The "Signature" add-on converts the selected fields in "Signature" fields, allowing the users to sign with the mouse or directly in the touchscreens.
@@ -388,6 +396,12 @@ The "WebMerge" add-on integrates the forms with the WebMerge Service, and genera
388
389
The "WebMerge" add-on may be used to instegrate the form with the Silverpop service (today IBM Watson Campaign Automation) [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#silverpop-integration "Silverpop integration")
390
391
= MailChimp add-on - Only available in the Platinum version of the plugin =
392
393
Includes the "MailChimp" add-on to integrate the forms with the MailChimp Service to add new members to the lists.
@@ -878,60 +892,61 @@ A: Please, visit the following entry in our technical blog:
878
879
== Changelog ==
880
881
- = 1.0.235 =
882
883
- * Modifies the operations: ROUND, CEIL and FLOOR for accepting a second parameter (optional) and rounding the number in multiples of second parameter.
884
- * Modifies the appearance of the forms builder settings in the free version of the plugin.
885
- * The fields' tags to insert into the results shortcodes (paid versions of the plugin) accept a new set of attributes for taking more control about how and whe to include the fields (if_value_is_greater_than, if_value_is_greater_than_or_equal_to, if_value_is_less_than, if_value_is_less_than_or_equal_to, if_value_is, if_value_is_not, if_value_like and if_value_unlike)
886
887
- = 1.0.234 =
888
889
- * Modifies the code to be compatible with older versions of PHP.
890
891
- = 1.0.233 =
892
893
- * Fixes an issue generating the revisions table.
894
895
- = 1.0.232 =
896
897
- * Includes the revisions module to create different revisions of the forms when they are updated.
898
- * Modifies the code that generates the forms to prevent that uncaugth javascript errors in the webpage affect the forms.
899
900
- = 1.0.231 =
901
902
- * Fixes an issue in the fields validation.
903
904
- = 1.0.230 =
905
906
- * Validates the values in currency fields.
907
- * Improves the validations in the other controls.
908
- * Improves the code to load the forms in the AMP pages.
909
910
- = 1.0.229 =
911
912
- * Fixes an issue with dependencies.
913
914
- = 1.0.228 =
915
916
- * Modifies the way that the forms builder is loaded to prevent that uncaugth javascript errors can affect it.
917
- * Allows to define a new attribute in the forms shortcode to define the duration of the tooltips on mobiles devices. For example: [CP_CALCULATED_FIELDS id="1" tooltip_duration="10000"], in mobiles devices the tooltip will be displayed for 10 seconds, and then, it will be hidden. The number is defined in milliseconds 10000 is the equivalent to 10 seconds.
918
- * Displays a gif animated when the form is being submitted to allow the users know that it is being processed (Professional, Developer and Platinum versions)
919
920
- = 1.0.227 =
921
922
- * Fixes an issue with the dependencies.
923
- * Fixes an issue with the filtering conditions in RecordSet fields (Developer and Platinum versions of the plugin).
924
925
- = 1.0.226 =
926
927
- * Includes two new options in the Form Settings tab for controlling when the equations are evaluated, with the onchage events, or with the onchange and keyup events (the new options give more control over the form's performance).
928
- * Includes the form's id and name in the Forms Builder to facilitate identify the form.
929
- * Allows to configure the form to not capture the users' ip addresses (Professional, Developer and Platinum versions).
930
- * Fixes an issue accepting .rar files with the Uploads add-on(Platinum version).
931
- * Allows to select groups by default in the MailChimp add-on(Platinum version).
932
933
== Upgrade Notice ==
934
935
- = 1.0.235 =
936
937
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
3
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.0
7
Stable tag: trunk
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
114
* Includes the DropBox Integration add-on to copy or move the uploaded files to a DropBox account.
115
* Includes the ip2location add-on to identify the users data from the ip2location databases. Requires PHP 5.3 and over.
116
* Includes the "Google Places" add-on that allows integrate the input fields with the Google Places API to autocomplete the addresses entered by the users.
117
+ * Includes the "Autocomplete Places" add-on that allows integrate the input fields with the Photon API to autocomplete the addresses entered by the users.
118
* Includes the "Signature" add-on to convert some form fields in "Signature" fields, allowing the users to sign with the mouse or directly in the touchscreens.
119
* Includes the "iCal" add-on for sending the users an iCal file as part of the confirmation email after the form submission to be imported into most popular calendars like Outlook and Google Calendar.
120
* Includes the "WebMerge" add-on to integrate the forms with the WebMerge Service, and generate PDF and Office documents at runtime with the information collected by the forms.
121
+ * Includes the "PrintFriendly" add-on to integrate the forms with the PrintFriendly API for generating PDF files after forms submissions, and attach the resulting files to the notification emails.
122
* Includes the "MailChimp" add-on to add new members to the MailChimp Service using the data collected by the form.
123
* Includes the "Emma" add-on to add new members to the Emma Service using the data collected by the form.
124
* Includes the "Twilio" add-on for sending notification messages (SMS) when the forms are submitted.
370
371
[CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#google-places-addon "Google Places add-on")
372
373
+ = Autocomplete Places add-on - Only available in the Platinum version of the plugin =
374
+
375
+ The "Autocomplete Places" add-on allows to integrate the input fields with the Photon API to autocomplete the addresses entered by the users.
376
+
377
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#autocomplete-places-addon "Autocomplete Places add-on")
378
+
379
= Signature add-on - Only available in the Platinum version of the plugin =
380
381
The "Signature" add-on converts the selected fields in "Signature" fields, allowing the users to sign with the mouse or directly in the touchscreens.
396
397
The "WebMerge" add-on may be used to instegrate the form with the Silverpop service (today IBM Watson Campaign Automation) [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#silverpop-integration "Silverpop integration")
398
399
+ = PrintFriendly add-on - Only available in the Platinum version of the plugin =
400
+
401
+ The "PrintFriendly" add-on integrates the forms with the PrintFriendly API for generating PDF files after the forms submissions, and attach the resulting files to the notification emails.
402
+
403
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#printfriendly-addon "PrintFriendly add-on")
404
+
405
= MailChimp add-on - Only available in the Platinum version of the plugin =
406
407
Includes the "MailChimp" add-on to integrate the forms with the MailChimp Service to add new members to the lists.
892
893
== Changelog ==
894
895
+ = 1.0.263 =
896
897
+ * Fixes another conflict with the Speed Booster Pack plugin.
898
+ * Includes a new operation to access easier to the fields, for example to assign a value to the slider field: fieldname1, enter as part of the equation getField(1).setVal(50);
899
900
+ = 1.0.262 =
901
902
+ * Fixes a conflict with the new version of Gutenberg.
903
904
+ = 1.0.261 =
905
906
+ * Allows read the raw values of every field in the form.
907
+ * Fixes a conflict with some themes that apply a max-width css rule to the form's fields.
908
+ * Fixes a conflict with the Speed Booster Pack plugin.
909
910
+ = 1.0.260 =
911
912
+ * Fixes an issue in the controls: radio button, checkbox and dropdown.
913
914
+ = 1.0.259 =
915
916
+ * Fixes an issue in the date/time fields that allows select by default an invalid time.
917
+ * Suppports other plugins for managing the AMP versions of pages.
918
+ * Includes other minor changes.
919
+ * Modifies the iCal add-on (Platinum version of plugin)
920
+ * Includes the PrintFriendly add-on (Platinum version of plugin)
921
922
+ = 1.0.258 =
923
924
+ * Allows to use the Acceptance fields into the equations.
925
+ * Modifies the selector to the tag with the price of the product to replace in the CFF - WooCommerce add-on (Developer and Platinum versions of the plugin)
926
+ * Allows to use other special constants like: submissiondate_mmddyyyy, submissiondate_ddmmyyyy, and ipaddress, in the integration with WebHooks URLs (Developer and Platinum versions of the plugin) and the WebMerge add-on (the Platinum version of the plugin).
927
928
+ = 1.0.257 =
929
930
+ * Modifies the date/time field doing the time components more coherents, and fixes an issue in the field's validation. Applies the styles for errors to the time components.
931
+ * Applies different class names to the different components in the slider fields to take total control to their visual appearance.
932
+ * Categorizes the add-ons for grouping them in the settings page of the plugin (Developer and Platinum versions of the plugin).
933
934
+ = 1.0.256 =
935
936
+ * Fixes an issue with Date/Time fields in multi-pages forms. In multi-pages forms if the date/time field is the first one in the page, the datepicker dialog was displayed by default, now this behavior has been solved.
937
+ * Includes the Autocomplete Places add-on, alternative to the Google Places add-on but using the Photon API (Distributed with the Platinum version of the plugin)
938
939
+ = 1.0.255 =
940
941
+ * Fixes an issue with No Cents attribute in the currency fields.
942
943
+ = 1.0.254 =
944
945
+ * Fixes an issue with the values of the checkbox fields when its used the modifier |r in the equations.
946
+ * Fixes an issue in the tags replacements in the thank you pages and notifiation emails (Professional, Developer and Platinum versions)
947
948
== Upgrade Notice ==
949
950
+ = 1.0.263 =
951
952
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,156 @@
1
== Changelog ==
2
3
= 1.0.235 =
4
5
* Modifies the operations: ROUND, CEIL and FLOOR for accepting a second parameter (optional) and rounding the number in multiples of second parameter.
1
== Changelog ==
2
3
+ = 1.0.263 =
4
+
5
+ * Fixes another conflict with the Speed Booster Pack plugin.
6
+ * Includes a new operation to access easier to the fields, for example to assign a value to the slider field: fieldname1, enter as part of the equation getField(1).setVal(50);
7
+
8
+ = 1.0.262 =
9
+
10
+ * Fixes a conflict with the new version of Gutenberg.
11
+
12
+ = 1.0.261 =
13
+
14
+ * Allows read the raw values of every field in the form.
15
+ * Fixes a conflict with some themes that apply a max-width css rule to the form's fields.
16
+ * Fixes a conflict with the Speed Booster Pack plugin.
17
+
18
+ = 1.0.260 =
19
+
20
+ * Fixes an issue in the controls: radio button, checkbox and dropdown.
21
+
22
+ = 1.0.259 =
23
+
24
+ * Fixes an issue in the date/time fields that allows select by default an invalid time.
25
+ * Suppports other plugins for managing the AMP versions of pages.
26
+ * Includes other minor changes.
27
+ * Modifies the iCal add-on (Platinum version of plugin)
28
+ * Includes the PrintFriendly add-on (Platinum version of plugin)
29
+
30
+ = 1.0.258 =
31
+
32
+ * Allows to use the Acceptance fields into the equations.
33
+ * Modifies the selector to the tag with the price of the product to replace in the CFF - WooCommerce add-on (Developer and Platinum versions of the plugin)
34
+ * Allows to use other special constants like: submissiondate_mmddyyyy, submissiondate_ddmmyyyy, and ipaddress, in the integration with WebHooks URLs (Developer and Platinum versions of the plugin) and the WebMerge add-on (the Platinum version of the plugin).
35
+
36
+ = 1.0.257 =
37
+
38
+ * Modifies the date/time field doing the time components more coherents, and fixes an issue in the field's validation. Applies the styles for errors to the time components.
39
+ * Applies different class names to the different components in the slider fields to take total control to their visual appearance.
40
+ * Categorizes the add-ons for grouping them in the settings page of the plugin (Developer and Platinum versions of the plugin).
41
+
42
+ = 1.0.256 =
43
+
44
+ * Fixes an issue with Date/Time fields in multi-pages forms. In multi-pages forms if the date/time field is the first one in the page, the datepicker dialog was displayed by default, now this behavior has been solved.
45
+ * Includes the Autocomplete Places add-on, alternative to the Google Places add-on but using the Photon API (Distributed with the Platinum version of the plugin)
46
+
47
+ = 1.0.255 =
48
+
49
+ * Fixes an issue with No Cents attribute in the currency fields.
50
+
51
+ = 1.0.254 =
52
+
53
+ * Fixes an issue with the values of the checkbox fields when its used the modifier |r in the equations.
54
+ * Fixes an issue in the tags replacements in the thank you pages and notifiation emails (Professional, Developer and Platinum versions)
55
+
56
+ = 1.0.253 =
57
+
58
+ * Modifies the currency fields to allow configure them for accepting only the whole part of value and for disabling the cents.
59
+ * Modifies the template 11.
60
+ * Allows to include the Instruct. Text fields in the thank you pages and notification emails (Professional, Developer and Platinum versions of the plugin).
61
+
62
+ = 1.0.252 =
63
+
64
+ * Fixes an issue in the public forms when the general texts are entered with apostrophes, escaping them.
65
+ * Includes new actions and filters.
66
+ * Modifies the code of the plugin to prevent an issue caused with a bug in the isNumeric method of jQuery, present in previous versions of the framework that are still used in many distributions of WordPress.
67
+ * Fixes an issue with the block tags in the notification emails and thank you pages when are associated to DropDown fields configured as multi-select (Professional, Developer and Platinum versions of the plugin).
68
+
69
+ = 1.0.251 =
70
+
71
+ * Modifies the Date/Time control to allow the use of other date formats, as well as the symbol to use as separator between the dates' components.
72
+ * Fixes an issue with the paddings in the Template 11.
73
+ * Modifies the WooCommerce add-on in the Developer and Platinum versions of the plugin, to include a pair of javascript variables with global scope: woocommerce_cpcff_product and woocommerce_cpcff_product_price for the product's id and price, respectively.
74
+
75
+ = 1.0.250 =
76
+
77
+ * Hides the promotion banner for the majority of roles and fixes a conflict between the promotion banner and the Gutenberg editor.
78
+ * Modifies the PayPal Pro add-on (Platinum version of the plugin)
79
+
80
+ = 1.0.249 =
81
+
82
+ * Fixes an issue in the AMP pages when the AMP Takeover option is enabled in the AMPforWP plugin.
83
+ * Fixes an issue in the MailChimp add-on allowing to access to more than 10 lists in Mailchimp (Platinum version of the plugin).
84
+
85
+ = 1.0.248 =
86
+
87
+ * Modifies the integration with the Guetenberg editor, replacing the deprecated methods with the new ones.
88
+ * Includes a new attribute in the PayPal settings for prompting (or not) the buyer's shipping address.
89
+
90
+ = 1.0.247 =
91
+
92
+ * Manages the browser's history to allow moving between the different pages of the multi-pages forms with the next/back buttons on the browser.
93
+ * Modifies the WooCommerce add-on (in the Developer and Platinum versions of the plugin) to pre-fill the fields in the form for the weight, length, width and heigth of product.
94
+
95
+ = 1.0.246 =
96
+
97
+ * Improves the drag and drop of fields into the forms builder.
98
+ * Allows create dependencies with the Section Break controls.
99
+ * Removes obsolete texts from the interface of plugin.
100
+ * Improves the Users Permissions add-on distributed with the Developer and Platinum versions of the plugin.
101
+ * Modifies the data-source controls in the Developer and Platinum versions of the plugin, implementing the connection to databases using PDO, allowing to read the data from multiple database engines, like: MySQL, Postgresql, MSSQL Server, SQLite, and many others.
102
+
103
+ = 1.0.245 =
104
+
105
+ * Modifies the currency and number controls to not apply the format to the default values when corresponding the checkbox is unticked.
106
+ * Solves some issues with the dependencies.
107
+ * Solves some accessibility issues, like labels without 'for' attributes or multiple elements with the same id.
108
+
109
+ = 1.0.244 =
110
+
111
+ * Fixes an issue with themes that include Bootstrap.
112
+ * Fixes an issue with the forms' previews when the classic option is selected for loading the plugin's resources.
113
+
114
+ = 1.0.243 =
115
+
116
+ * Modifies the Summary control to solve an issue when are left the fields in blank.
117
+ * Modifies the AMP versions of forms, and forms' previews to solve an issue with other plugins and themes like DIVI.
118
+
119
+ = 1.0.242 =
120
+
121
+ * Fixes an issue with a column in the plugin's database.
122
+
123
+ = 1.0.241 =
124
+
125
+ * Fixes an issue in the equations, when the values of fields include backslash symbols.
126
+
127
+ = 1.0.240 =
128
+
129
+ * Includes a new attribute in Radio Buttons and Radio Buttons DS fields to allow tick/untick the choices (similar to the checkboxes), or preserve the radio buttons default behavior.
130
+ * The plugin tries to extract numbers from the fields values to be used in the equations. This update allows to use a modifier with the fields' names in the equations to use the fields' values without processing. Ex: fieldname1|r (|r for raw)
131
+
132
+ = 1.0.239 =
133
+
134
+ * Removes some notices generated in the use of dbDelta function.
135
+ * Fixes another issue cloning the forms.
136
+
137
+ = 1.0.238 =
138
+
139
+ * Removes a notice when a form is cloned.
140
+
141
+ = 1.0.237 =
142
+
143
+ * Modifies the create table queries in the plugin's core and add-ons to reduce and optimize the database's queries.
144
+ * Fixes a little issue with the currency and number fields that not allows clear the fields' values.
145
+ * Fixes an issue with the attribute: if_value_is_not in the fields' tags of notification emails and thank you pages.
146
+
147
+ = 1.0.236 =
148
+
149
+ * Prevents possible conflicts with other plugins in the forms preview.
150
+ * Allows edit the forms submissions from the Messages section (Professional, Developer and Platinum versions of the plugin).
151
+ * Supports nested shortcodes into the content of the shortcodes: [CP_CALCULATED_FIELDS_RESULT] and [CP_CALCULATED_FIELDS_RESULT_LIST] (Professional, Developer and Platinum versions of the plugin).
152
+ * Modifies the Signature add-on, allowing to load the signature fields in the forms preview, and fixes an issue displaying the signature images in the messages section (Platinum version).
153
+
154
= 1.0.235 =
155
156
* Modifies the operations: ROUND, CEIL and FLOOR for accepting a second parameter (optional) and rounding the number in multiples of second parameter.
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.235
7
Text Domain: calculated-fields-form
8
Author: CodePeople
9
Author URI: https://cff.dwbooster.com
@@ -20,7 +20,7 @@ require_once 'inc/cpcff_session.inc.php';
20
if( !defined('DOING_AJAX') ) CP_SESSION::session_start();
21
22
// Defining main constants
23
- define('CP_CALCULATEDFIELDSF_VERSION', '1.0.235' );
24
define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
25
define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
26
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.263
7
Text Domain: calculated-fields-form
8
Author: CodePeople
9
Author URI: https://cff.dwbooster.com
20
if( !defined('DOING_AJAX') ) CP_SESSION::session_start();
21
22
// Defining main constants
23
+ define('CP_CALCULATEDFIELDSF_VERSION', '1.0.263' );
24
define('CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
25
define('CP_CALCULATEDFIELDSF_BASE_PATH', dirname( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
26
define('CP_CALCULATEDFIELDSF_BASE_NAME', plugin_basename( CP_CALCULATEDFIELDSF_MAIN_FILE_PATH ) );
css/style.css CHANGED
@@ -7,6 +7,7 @@
7
.ctrlsColumn.expanded{min-width:380px;width:75%;position:absolute;}
8
.ctrlsColumn .expand-shrink{float:right;margin:8px 5px 0px 0px;cursor:pointer;}
9
.dashboardColumn{ width:calc(100% - 400px); }
10
.width50{width:48%}
11
.width20{width:24%}
12
.width40{width:40%}
@@ -45,7 +46,7 @@
45
.addComplexRule{cursor:pointer;}
46
.cf_dependence_rule{width:calc( 100% - 100px );width:-webkit-calc( 100% - 100px );width:-moz-calc( 100% - 100px );width:-o-calc( 100% - 100px );}
47
48
- .choice-ctrls{float:right;margin-top:5px;}
49
.choice-ctrls *{float:left;cursor:pointer;}
50
51
.calc_dependent{width:150px;}
@@ -188,4 +189,6 @@ a.helpfbuilder{font-size:80%;text-decoration:underline;color:#00f;cursor:pointer
188
#metabox_basic_settings1 * ,
189
#metabox_basic_settings2 * ,
190
#metabox_basic_settings3 * ,
191
- #metabox_basic_settings4 * {color:#bfbdbd91 !important;pointer-events: none !important;}
7
.ctrlsColumn.expanded{min-width:380px;width:75%;position:absolute;}
8
.ctrlsColumn .expand-shrink{float:right;margin:8px 5px 0px 0px;cursor:pointer;}
9
.dashboardColumn{ width:calc(100% - 400px); }
10
+ .width100{width:100%}
11
.width50{width:48%}
12
.width20{width:24%}
13
.width40{width:40%}
46
.addComplexRule{cursor:pointer;}
47
.cf_dependence_rule{width:calc( 100% - 100px );width:-webkit-calc( 100% - 100px );width:-moz-calc( 100% - 100px );width:-o-calc( 100% - 100px );}
48
49
+ .choice-ctrls{float:right;/* margin-top:5px; */}
50
.choice-ctrls *{float:left;cursor:pointer;}
51
52
.calc_dependent{width:150px;}
189
#metabox_basic_settings1 * ,
190
#metabox_basic_settings2 * ,
191
#metabox_basic_settings3 * ,
192
+ #metabox_basic_settings4 * {color:#bfbdbd91 !important;pointer-events: none !important;}
193
+ .cff-addons-category{display:inline-block;font-weight:bold;text-transform:capitalize;border-bottom:1px solid #eee;margin-bottom:10px;padding-bottom:5px;}
194
+ .cff-addons-category:not(:first-child){margin-top:20px;}
css/stylepublic.css CHANGED
@@ -9,12 +9,13 @@
9
#fbuilder input[type="date"],
10
#fbuilder input[type="datetime"],
11
#fbuilder input[type="email"],
12
#fbuilder input[type="number"],
13
#fbuilder input[type="search"],
14
#fbuilder input[type="time"],
15
#fbuilder input[type="url"],
16
#fbuilder textarea,
17
- #fbuilder select {width:auto;display:inline-block;}
18
19
#fbuilder .small{width:25% !important;}
20
#fbuilder .medium{width:50% !important;}
@@ -72,7 +73,10 @@
72
#fbuilder .right_aligned .comment_area.fields label,
73
#fbuilder .right_aligned .cff-html-field .dfield{width:100%;clear:both;}
74
75
- #fbuilder .cpefb_error{border:1px solid red;color:red !important;}
76
#fbuilder .top_aligned .fields label.cpefb_error,.left_aligned .fields label.cpefb_error,.right_aligned .fields label.cpefb_error{display:block;border:0px;color:#f00;float:none;}
77
78
#fbuilder div.cpefb_error{background:#FDF9E5;border:1px solid #f00;opacity:0.9;margin-top:7px;position:relative;padding:0px 5px;z-index:1000;}
9
#fbuilder input[type="date"],
10
#fbuilder input[type="datetime"],
11
#fbuilder input[type="email"],
12
+ #fbuilder input[type="password"],
13
#fbuilder input[type="number"],
14
#fbuilder input[type="search"],
15
#fbuilder input[type="time"],
16
#fbuilder input[type="url"],
17
#fbuilder textarea,
18
+ #fbuilder select {width:auto;display:inline-block;max-width:none;}
19
20
#fbuilder .small{width:25% !important;}
21
#fbuilder .medium{width:50% !important;}
73
#fbuilder .right_aligned .comment_area.fields label,
74
#fbuilder .right_aligned .cff-html-field .dfield{width:100%;clear:both;}
75
76
+ #fbuilder .cpefb_error,
77
+ #fbuilder .cpefb_error+select,
78
+ #fbuilder .cpefb_error+select+select,
79
+ #fbuilder .cpefb_error+select+select+select{border:1px solid red;color:red !important;}
80
#fbuilder .top_aligned .fields label.cpefb_error,.left_aligned .fields label.cpefb_error,.right_aligned .fields label.cpefb_error{display:block;border:0px;color:#f00;float:none;}
81
82
#fbuilder div.cpefb_error{background:#FDF9E5;border:1px solid #f00;opacity:0.9;margin-top:7px;position:relative;padding:0px 5px;z-index:1000;}
inc/cpcff_admin_int.inc.php CHANGED
@@ -126,13 +126,6 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
126
f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
127
});
128
129
- $calculatedfieldsfQuery( ".itemForm" ).draggable({revert1: "invalid",helper: "clone",cursor: "move"});
130
- $calculatedfieldsfQuery( "#fbuilder" ).droppable({
131
- accept: ".button",
132
- drop: function( event, ui ) {
133
- f.fBuild.addItem(ui.draggable.attr("id"));
134
- }
135
- });
136
jQuery("#metabox_basic_settings0,#metabox_basic_settings1,#metabox_basic_settings2,#metabox_basic_settings3,#metabox_basic_settings4")
137
.click( function(){
138
if(confirm("<?php _e( 'These features aren\'t available in this version. Do you want to open the plugin\'s page to check other versions?', 'calculated-fields-form' ); ?>"))
@@ -476,7 +469,17 @@ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
476
</select>
477
</td>
478
</tr>
479
-
480
</table>
481
482
</div>
126
f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
127
});
128
129
jQuery("#metabox_basic_settings0,#metabox_basic_settings1,#metabox_basic_settings2,#metabox_basic_settings3,#metabox_basic_settings4")
130
.click( function(){
131
if(confirm("<?php _e( 'These features aren\'t available in this version. Do you want to open the plugin\'s page to check other versions?', 'calculated-fields-form' ); ?>"))
469
</select>
470
</td>
471
</tr>
472
+ <tr valign="top">
473
+ <th scope="row"><?php _e( 'Paypal prompt buyers for shipping address', 'calculated-fields-form' ); ?></th>
474
+ <td>
475
+ <?php $paypal_address = $form_obj->get_option('paypal_address', 1); ?>
476
+ <select name="paypal_address">
477
+ <option value="1" <?php if($paypal_address == 1) print 'SELECTED'; ?>><?php _e('Do not prompt for an address', 'calculated-fields-form'); ?></option>
478
+ <option value="0" <?php if($paypal_address == 0) print 'SELECTED'; ?>><?php _e('Prompt for an address, but do not require one', 'calculated-fields-form'); ?></option>
479
+ <option value="2" <?php if($paypal_address == 2) print 'SELECTED'; ?>><?php _e('Prompt for an address and require one', 'calculated-fields-form'); ?></option>
480
+ </select>
481
+ </td>
482
+ </tr>
483
</table>
484
485
</div>
inc/cpcff_amp.inc.php CHANGED
@@ -86,7 +86,21 @@ if(!class_exists('CPCFF_AMP'))
86
$message = $this->_main_obj->public_form($atts);
87
$message = preg_replace('/<form\s+/i', '<form target="_parent" ', $message, 1);
88
ob_start();
89
- wp_footer();
90
$message .= ob_get_contents();
91
ob_end_clean();
92
}
@@ -112,10 +126,14 @@ if(!class_exists('CPCFF_AMP'))
112
*/
113
public function is_amp()
114
{
115
- if( function_exists('ampforwp_is_amp_endpoint') ) return ampforwp_is_amp_endpoint();
116
- elseif( function_exists('is_amp_endpoint') )
117
{
118
- if(defined('AMP_QUERY_VAR')) return is_amp_endpoint();
119
}
120
return false;
121
} // End is_amp
@@ -140,7 +158,7 @@ if(!class_exists('CPCFF_AMP'))
140
141
if(empty($height)) $height = 500;
142
143
- $url .= '&cff-form-height='.$height;
144
145
// Fixing the isseu with the origin policy in the amp-iframes
146
if(preg_match('/^https:\/\/www\./i', $url)) $url = preg_replace('/^https:\/\/www\./i', 'https://', $url);
86
$message = $this->_main_obj->public_form($atts);
87
$message = preg_replace('/<form\s+/i', '<form target="_parent" ', $message, 1);
88
ob_start();
89
+
90
+ if(
91
+ function_exists('wp_print_styles') &&
92
+ function_exists('wp_print_scripts')
93
+ )
94
+ {
95
+ wp_print_styles();
96
+ wp_print_scripts();
97
+ do_action('cpcff_footer');
98
+ }
99
+ else
100
+ {
101
+ wp_footer();
102
+ }
103
+
104
$message .= ob_get_contents();
105
ob_end_clean();
106
}
126
*/
127
public function is_amp()
128
{
129
+ if(!empty($_REQUEST['isamp'])) return true;
130
+ if(empty($_GET['non-amp']))
131
{
132
+ if( function_exists('ampforwp_is_amp_endpoint') ) return ampforwp_is_amp_endpoint();
133
+ elseif( function_exists('is_amp_endpoint') )
134
+ {
135
+ if(defined('AMP_QUERY_VAR')) return is_amp_endpoint();
136
+ }
137
}
138
return false;
139
} // End is_amp
158
159
if(empty($height)) $height = 500;
160
161
+ $url .= '&cff-form-height='.$height.'&non-amp=1';
162
163
// Fixing the isseu with the origin policy in the amp-iframes
164
if(preg_match('/^https:\/\/www\./i', $url)) $url = preg_replace('/^https:\/\/www\./i', 'https://', $url);
inc/cpcff_banner.inc.php CHANGED
@@ -11,8 +11,15 @@ if(!function_exists( 'codepeople_add_promote_banner' ))
11
function codepeople_add_promote_banner($wp_admin_bar)
12
{
13
global $codepeople_promote_banner_plugins;
14
-
15
- if( empty($codepeople_promote_banner_plugins) || !is_admin() ) return;
16
17
// Take action over the banner
18
if(
11
function codepeople_add_promote_banner($wp_admin_bar)
12
{
13
global $codepeople_promote_banner_plugins;
14
+ if(
15
+ empty($codepeople_promote_banner_plugins) ||
16
+ !is_admin() ||
17
+ !current_user_can( 'manage_options' ) ||
18
+ (
19
+ function_exists( 'is_gutenberg_page' ) &&
20
+ is_gutenberg_page()
21
+ )
22
+ ) return;
23
24
// Take action over the banner
25
if(
inc/cpcff_install_uninstall.inc.php CHANGED
@@ -89,13 +89,15 @@ if(!class_exists('CPCFF_INSTALLER'))
89
*/
90
private static function _db_structure()
91
{
92
global $wpdb;
93
$charset_collate = $wpdb->get_charset_collate();
94
- $charset_collate_column = preg_replace('/default/i', ' ', $charset_collate);
95
96
// Posts table
97
- $table_name = $wpdb->prefix.CP_CALCULATEDFIELDSF_POSTS_TABLE_NAME_NO_PREFIX;
98
- $sql = "CREATE TABLE IF NOT EXISTS ".$table_name." (
99
id mediumint(9) NOT NULL AUTO_INCREMENT,
100
formid INT NOT NULL,
101
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
@@ -106,26 +108,9 @@ if(!class_exists('CPCFF_INSTALLER'))
106
paid INT DEFAULT 0 NOT NULL,
107
UNIQUE KEY id (id)
108
) $charset_collate;";
109
- $result = $wpdb->query($sql);
110
-
111
- // Alters the posts table for compatibility with old versions of the plugin
112
- $alterate_columns = array(
113
- 'data' => "mediumtext $charset_collate_column",
114
- 'paypal_post' => "mediumtext $charset_collate_column",
115
- 'ipaddr' => "VARCHAR(41) $charset_collate_column DEFAULT \"\" NOT NULL"
116
- );
117
-
118
- $sql = "ALTER TABLE `".$table_name."`";
119
- $separator = "";
120
- foreach( $alterate_columns as $column_name => $column_structure )
121
- {
122
- $sql .= $separator." MODIFY `".$column_name."` ".$column_structure;
123
- $separator = ",";
124
- }
125
- $wpdb->query($sql);
126
127
// Discounts table
128
- $sql = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix.CP_CALCULATEDFIELDSF_DISCOUNT_CODES_TABLE_NAME_NO_PREFIX." (
129
id mediumint(9) NOT NULL AUTO_INCREMENT,
130
form_id mediumint(9) NOT NULL DEFAULT 1,
131
code VARCHAR(250) DEFAULT '' NOT NULL,
@@ -135,17 +120,12 @@ if(!class_exists('CPCFF_INSTALLER'))
135
used int(10) unsigned NOT NULL DEFAULT 0,
136
UNIQUE KEY id (id)
137
) $charset_collate;";
138
- $wpdb->query($sql);
139
140
// Forms structures table
141
- $table_name = $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE;
142
- $sql = "CREATE TABLE IF NOT EXISTS $table_name (
143
id mediumint(9) NOT NULL AUTO_INCREMENT,
144
-
145
form_name VARCHAR(250) DEFAULT '' NOT NULL,
146
-
147
form_structure mediumtext,
148
-
149
fp_from_email VARCHAR(250) DEFAULT '' NOT NULL,
150
fp_destination_emails TEXT,
151
fp_subject VARCHAR(250) DEFAULT '' NOT NULL,
@@ -153,17 +133,14 @@ if(!class_exists('CPCFF_INSTALLER'))
153
fp_return_page VARCHAR(250) DEFAULT '' NOT NULL,
154
fp_message mediumtext,
155
fp_emailformat VARCHAR(10) DEFAULT '' NOT NULL,
156
-
157
cu_enable_copy_to_user VARCHAR(10) DEFAULT '' NOT NULL,
158
cu_user_email_field TEXT DEFAULT '' NOT NULL,
159
cu_subject VARCHAR(250) DEFAULT '' NOT NULL,
160
cu_message mediumtext,
161
cu_emailformat VARCHAR(10) DEFAULT '' NOT NULL,
162
fp_emailfrommethod VARCHAR(10) DEFAULT '' NOT NULL,
163
-
164
enable_paypal_option_yes VARCHAR(250) DEFAULT '' NOT NULL,
165
enable_paypal_option_no VARCHAR(250) DEFAULT '' NOT NULL,
166
-
167
vs_use_validation VARCHAR(10) DEFAULT '' NOT NULL,
168
vs_text_is_required VARCHAR(250) DEFAULT '' NOT NULL,
169
vs_text_is_email VARCHAR(250) DEFAULT '' NOT NULL,
@@ -177,7 +154,6 @@ if(!class_exists('CPCFF_INSTALLER'))
177
vs_text_previousbtn VARCHAR(250) DEFAULT '' NOT NULL,
178
vs_text_nextbtn VARCHAR(250) DEFAULT '' NOT NULL,
179
vs_all_texts text DEFAULT '' NOT NULL,
180
-
181
enable_paypal varchar(10) DEFAULT '' NOT NULL,
182
enable_submit varchar(10) DEFAULT '' NOT NULL,
183
paypal_notiemails varchar(10) DEFAULT '' NOT NULL,
@@ -193,7 +169,7 @@ if(!class_exists('CPCFF_INSTALLER'))
193
paypal_identify_prices varchar(20) DEFAULT '' NOT NULL ,
194
paypal_zero_payment varchar(10) DEFAULT '' NOT NULL ,
195
paypal_base_amount VARCHAR(250),
196
-
197
cv_enable_captcha VARCHAR(20) DEFAULT '' NOT NULL,
198
cv_width VARCHAR(20) DEFAULT '' NOT NULL,
199
cv_height VARCHAR(20) DEFAULT '' NOT NULL,
@@ -206,71 +182,24 @@ if(!class_exists('CPCFF_INSTALLER'))
206
cv_background VARCHAR(20) DEFAULT '' NOT NULL,
207
cv_border VARCHAR(20) DEFAULT '' NOT NULL,
208
cv_text_enter_valid_captcha VARCHAR(200) DEFAULT '' NOT NULL,
209
-
210
UNIQUE KEY id (id)
211
) $charset_collate;";
212
- $wpdb->query($sql);
213
-
214
- // Alters the forms table for compatibility with old versions of the plugin
215
- $alterate_columns = array(
216
- 'form_structure' => "mediumtext $charset_collate_column",
217
- 'fp_message' => "mediumtext $charset_collate_column",
218
- 'cu_message' => "mediumtext $charset_collate_column"
219
- );
220
-
221
- $sql = "ALTER TABLE `".$table_name."`";
222
- $separator = "";
223
- foreach( $alterate_columns as $column_name => $column_structure )
224
- {
225
- $sql .= $separator." MODIFY `".$column_name."` ".$column_structure;
226
- $separator = ",";
227
- }
228
- $wpdb->query($sql);
229
-
230
- $columns = $wpdb->get_results("SHOW columns FROM `".$table_name."`");
231
- $columns_list = array();
232
- foreach( $columns as $column )
233
- $columns_list[] = $column->Field;
234
-
235
- $new_columns = array(
236
- 'fp_emailfrommethod' => "varchar(10) $charset_collate_column NOT NULL default ''",
237
- 'paypal_notiemails' => "varchar(20) $charset_collate_column NOT NULL default ''",
238
- 'enable_submit' => "varchar(10) $charset_collate_column NOT NULL default ''",
239
- 'vs_text_submitbtn' => "varchar(250) $charset_collate_column NOT NULL default ''",
240
- 'vs_text_previousbtn' => "varchar(250) $charset_collate_column NOT NULL default ''",
241
- 'vs_text_nextbtn' => "varchar(250) $charset_collate_column NOT NULL default ''",
242
- 'vs_all_texts' => "text $charset_collate_column NOT NULL default ''",
243
- 'cache' => "text $charset_collate_column DEFAULT '' NOT NULL",
244
- 'enable_paypal_option_yes' => "varchar(250) $charset_collate_column DEFAULT '' NOT NULL",
245
- 'enable_paypal_option_no' => "varchar(250) $charset_collate_column DEFAULT '' NOT NULL",
246
- 'paypal_base_amount' => "varchar(250) $charset_collate_column",
247
- 'paypal_recurrent_setup' => "varchar(25) $charset_collate_column",
248
- 'paypal_recurrent_setup_days' => "varchar(25) $charset_collate_column"
249
- );
250
- $sql = "";
251
- $separator = "ALTER TABLE `".$table_name."`";
252
- foreach( $new_columns as $column_name => $column_structure )
253
- {
254
- if( !in_array( $column_name, $columns_list ) )
255
- {
256
- $sql .= $separator." ADD `".$column_name."` ".$column_structure;
257
- $separator = ",";
258
- }
259
- }
260
- if(!empty($sql)) $wpdb->query($sql);
261
-
262
- // Insert the predefined forms into the forms table
263
- self::_predefined_forms();
264
265
// Revisions table
266
- $sql = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_REVISIONS_TABLE." (
267
id mediumint(9) NOT NULL AUTO_INCREMENT,
268
formid mediumint(9) NOT NULL,
269
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
270
revision longtext NOT NULL,
271
UNIQUE KEY id (id)
272
) $charset_collate;";
273
- $wpdb->query($sql);
274
} // End _db_structure
275
276
/**
89
*/
90
private static function _db_structure()
91
{
92
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
93
+
94
global $wpdb;
95
$charset_collate = $wpdb->get_charset_collate();
96
+
97
+ $db_queries = array();
98
99
// Posts table
100
+ $db_queries[] = "CREATE TABLE ".$wpdb->prefix.CP_CALCULATEDFIELDSF_POSTS_TABLE_NAME_NO_PREFIX." (
101
id mediumint(9) NOT NULL AUTO_INCREMENT,
102
formid INT NOT NULL,
103
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
108
paid INT DEFAULT 0 NOT NULL,
109
UNIQUE KEY id (id)
110
) $charset_collate;";
111
112
// Discounts table
113
+ $db_queries[] = "CREATE TABLE ".$wpdb->prefix.CP_CALCULATEDFIELDSF_DISCOUNT_CODES_TABLE_NAME_NO_PREFIX." (
114
id mediumint(9) NOT NULL AUTO_INCREMENT,
115
form_id mediumint(9) NOT NULL DEFAULT 1,
116
code VARCHAR(250) DEFAULT '' NOT NULL,
120
used int(10) unsigned NOT NULL DEFAULT 0,
121
UNIQUE KEY id (id)
122
) $charset_collate;";
123
124
// Forms structures table
125
+ $db_queries[] = "CREATE TABLE ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE." (
126
id mediumint(9) NOT NULL AUTO_INCREMENT,
127
form_name VARCHAR(250) DEFAULT '' NOT NULL,
128
form_structure mediumtext,
129
fp_from_email VARCHAR(250) DEFAULT '' NOT NULL,
130
fp_destination_emails TEXT,
131
fp_subject VARCHAR(250) DEFAULT '' NOT NULL,
133
fp_return_page VARCHAR(250) DEFAULT '' NOT NULL,
134
fp_message mediumtext,
135
fp_emailformat VARCHAR(10) DEFAULT '' NOT NULL,
136
cu_enable_copy_to_user VARCHAR(10) DEFAULT '' NOT NULL,
137
cu_user_email_field TEXT DEFAULT '' NOT NULL,
138
cu_subject VARCHAR(250) DEFAULT '' NOT NULL,
139
cu_message mediumtext,
140
cu_emailformat VARCHAR(10) DEFAULT '' NOT NULL,
141
fp_emailfrommethod VARCHAR(10) DEFAULT '' NOT NULL,
142
enable_paypal_option_yes VARCHAR(250) DEFAULT '' NOT NULL,
143
enable_paypal_option_no VARCHAR(250) DEFAULT '' NOT NULL,
144
vs_use_validation VARCHAR(10) DEFAULT '' NOT NULL,
145
vs_text_is_required VARCHAR(250) DEFAULT '' NOT NULL,
146
vs_text_is_email VARCHAR(250) DEFAULT '' NOT NULL,
154
vs_text_previousbtn VARCHAR(250) DEFAULT '' NOT NULL,
155
vs_text_nextbtn VARCHAR(250) DEFAULT '' NOT NULL,
156
vs_all_texts text DEFAULT '' NOT NULL,
157
enable_paypal varchar(10) DEFAULT '' NOT NULL,
158
enable_submit varchar(10) DEFAULT '' NOT NULL,
159
paypal_notiemails varchar(10) DEFAULT '' NOT NULL,
169
paypal_identify_prices varchar(20) DEFAULT '' NOT NULL ,
170
paypal_zero_payment varchar(10) DEFAULT '' NOT NULL ,
171
paypal_base_amount VARCHAR(250),
172
+ paypal_address TINYINT DEFAULT 1 NOT NULL,
173
cv_enable_captcha VARCHAR(20) DEFAULT '' NOT NULL,
174
cv_width VARCHAR(20) DEFAULT '' NOT NULL,
175
cv_height VARCHAR(20) DEFAULT '' NOT NULL,
182
cv_background VARCHAR(20) DEFAULT '' NOT NULL,
183
cv_border VARCHAR(20) DEFAULT '' NOT NULL,
184
cv_text_enter_valid_captcha VARCHAR(200) DEFAULT '' NOT NULL,
185
+ cache text DEFAULT '' NOT NULL,
186
UNIQUE KEY id (id)
187
) $charset_collate;";
188
189
// Revisions table
190
+ $db_queries[] = "CREATE TABLE ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_REVISIONS_TABLE." (
191
id mediumint(9) NOT NULL AUTO_INCREMENT,
192
formid mediumint(9) NOT NULL,
193
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
194
revision longtext NOT NULL,
195
UNIQUE KEY id (id)
196
) $charset_collate;";
197
+
198
+ dbDelta($db_queries); // Running the queries
199
+
200
+ // Insert the predefined forms into the forms table
201
+ self::_predefined_forms();
202
+
203
} // End _db_structure
204
205
/**
inc/cpcff_main.inc.php CHANGED
@@ -109,6 +109,9 @@ if(!class_exists('CPCFF_MAIN'))
109
// Run the initialization code of widgets
110
add_action( 'widgets_init', array($this, 'widgets_init'), 1 );
111
112
} // End __construct
113
114
/**
@@ -296,7 +299,7 @@ if(!class_exists('CPCFF_MAIN'))
296
*/
297
public function gutenberg_editor()
298
{
299
- wp_enqueue_script( 'cp_calculatedfieldsf_gutenberg_editor', plugins_url('/js/cp_calculatedfieldsf_gutenberg.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH), array('wp-blocks', 'wp-element'));
300
} // End gutenberg_editor
301
302
/**
@@ -380,9 +383,32 @@ if(!class_exists('CPCFF_MAIN'))
380
{
381
if(isset($atts['shortcode_atts']))
382
{
383
$message = $this->public_form($atts['shortcode_atts']);
384
ob_start();
385
- wp_footer();
386
$message .= ob_get_contents();
387
ob_end_clean();
388
$page_title = (!empty($atts['page_title'])) ? $atts['page_title'] : '';
@@ -593,14 +619,14 @@ if(!class_exists('CPCFF_MAIN'))
593
{
594
if(!isset($this->_forms[$id])) $this->_forms[$id] = new CPCFF_FORM($id);
595
$cloned_form = $this->_forms[$id]->clone_form();
596
- if($clone_form)
597
{
598
/**
599
* Passes as parameter the original form's id, and the new form's id
600
*/
601
- do_action( 'cpcff_clone_form', $id, $clone_form->get_id());
602
}
603
- return $clone_form;
604
} // End clone_form
605
606
/*********************************** PRIVATE METHODS ********************************************/
@@ -823,5 +849,21 @@ if(!class_exists('CPCFF_MAIN'))
823
<?php
824
}
825
} // End _public_resources
826
} // End CPCFF_MAIN
827
}
109
// Run the initialization code of widgets
110
add_action( 'widgets_init', array($this, 'widgets_init'), 1 );
111
112
+ // Fix different troubleshoots
113
+ $this->troubleshoots();
114
+
115
} // End __construct
116
117
/**
299
*/
300
public function gutenberg_editor()
301
{
302
+ wp_enqueue_script( 'cp_calculatedfieldsf_gutenberg_editor', plugins_url('/js/cp_calculatedfieldsf_gutenberg.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
303
} // End gutenberg_editor
304
305
/**
383
{
384
if(isset($atts['shortcode_atts']))
385
{
386
+ global $wp_scripts;
387
+ try
388
+ {
389
+ foreach($wp_scripts->registered as $registered)
390
+ {
391
+ wp_dequeue_script($registered->handle);
392
+ }
393
+
394
+ } catch(Exception $err){}
395
$message = $this->public_form($atts['shortcode_atts']);
396
ob_start();
397
+
398
+ if(
399
+ function_exists('wp_print_styles') &&
400
+ function_exists('wp_print_scripts')
401
+ )
402
+ {
403
+ wp_print_styles();
404
+ wp_print_scripts();
405
+ do_action('cpcff_footer');
406
+ }
407
+ else
408
+ {
409
+ wp_footer();
410
+ }
411
+
412
$message .= ob_get_contents();
413
ob_end_clean();
414
$page_title = (!empty($atts['page_title'])) ? $atts['page_title'] : '';
619
{
620
if(!isset($this->_forms[$id])) $this->_forms[$id] = new CPCFF_FORM($id);
621
$cloned_form = $this->_forms[$id]->clone_form();
622
+ if($cloned_form)
623
{
624
/**
625
* Passes as parameter the original form's id, and the new form's id
626
*/
627
+ do_action( 'cpcff_clone_form', $id, $cloned_form->get_id());
628
}
629
+ return $cloned_form;
630
} // End clone_form
631
632
/*********************************** PRIVATE METHODS ********************************************/
849
<?php
850
}
851
} // End _public_resources
852
+
853
+ /** TROUBLESHOOTS SECTION **/
854
+ private function troubleshoots()
855
+ {
856
+ if(!$this->_is_admin)
857
+ {
858
+ // Solves a conflict caused by the "Speed Booster Pack" plugin
859
+ add_filter('option_sbp_settings', 'CPCFF_MAIN::speed_booster_pack_troubleshoot');
860
+ }
861
+ } // End troubleshoots
862
+
863
+ public static function speed_booster_pack_troubleshoot($option)
864
+ {
865
+ if(is_array($option) && isset($option['jquery_to_footer'])) unset($option['jquery_to_footer']);
866
+ return $option;
867
+ } // End speed_booster_pack_troubleshoot
868
} // End CPCFF_MAIN
869
}
inc/cpcff_public_int.inc.php CHANGED
@@ -49,7 +49,7 @@ if( !empty( $form_data ) )
49
?>
50
<form name="<?php echo $form_data[ 1 ][ 'formid' ]; ?>" id="<?php echo $form_data[ 1 ][ 'formid' ]; ?>" action="?" method="post" enctype="multipart/form-data" class="<?php
51
if(!empty($form_data[1][0]) && !empty($form_data[1][0]->persistence)) echo ' persist-form';
52
- if(!empty($atts) && !empty($atts['class'])) echo ' '.$atts['class'];
53
?>"><input type="hidden" name="cp_calculatedfieldsf_id" value="<?php echo $id; ?>" /><pre style="display:none;"><!--noptimize--><script>form_structure_<?php echo CPCFF_MAIN::$form_counter; ?>=<?php print str_replace( array( "\n", "\r" ), " ", ((version_compare(CP_CFF_PHPVERSION,"5.3.0")>=0)?json_encode($form_data, JSON_HEX_QUOT|JSON_HEX_TAG):json_encode($form_data)) ); ?>;</script><!--/noptimize--></pre>
54
<div id="fbuilder">
55
<div id="fbuilder_<?php echo CPCFF_MAIN::$form_counter; ?>">
49
?>
50
<form name="<?php echo $form_data[ 1 ][ 'formid' ]; ?>" id="<?php echo $form_data[ 1 ][ 'formid' ]; ?>" action="?" method="post" enctype="multipart/form-data" class="<?php
51
if(!empty($form_data[1][0]) && !empty($form_data[1][0]->persistence)) echo ' persist-form';
52
+ if(!empty($atts) && !empty($atts['class'])) echo ' '.esc_attr($atts['class']);
53
?>"><input type="hidden" name="cp_calculatedfieldsf_id" value="<?php echo $id; ?>" /><pre style="display:none;"><!--noptimize--><script>form_structure_<?php echo CPCFF_MAIN::$form_counter; ?>=<?php print str_replace( array( "\n", "\r" ), " ", ((version_compare(CP_CFF_PHPVERSION,"5.3.0")>=0)?json_encode($form_data, JSON_HEX_QUOT|JSON_HEX_TAG):json_encode($form_data)) ); ?>;</script><!--/noptimize--></pre>
54
<div id="fbuilder">
55
<div id="fbuilder_<?php echo CPCFF_MAIN::$form_counter; ?>">
js/cp_calculatedfieldsf_gutenberg.js CHANGED
@@ -1,144 +1,147 @@
1
- ( function( blocks, element ) {
2
- var el = element.createElement,
3
- source = blocks.source,
4
- InspectorControls = blocks.InspectorControls,
5
- category = {slug:'cp-calculated-fields-form', title : 'Calculated Fields Form'};
6
7
- /* Plugin Category */
8
- blocks.getCategories().push({slug: 'cpcff', title: 'Calculated Fields Form'});
9
10
- /* ICONS */
11
- const iconCPCFF = el('img', { width: 20, height: 20, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAGdJREFUOI1jnHnk3X8GKgAmahhCVYNYGBgYGDq3PqLIkHJvOeq5iHHQBTYLjIEcTuXecgydWx8xMDISNqDMSw7VIHTAyMjAcKdVH68hKtUX4Wzqew0d/P+PaiMhQLVYGw1swmDwZREAIzIpNydZa8YAAAAASUVORK5CYII=" } );
12
13
- const iconCPCFFV = el('img', { width: 20, height: 20, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAIhJREFUOI1jnHnk3X8GKgAmahhCVYNYkDlp1oIkaZ519D2cjeEi5aqLDMpVF3FqxiWP1Wt32/RxGoRLDmcYYbMVn0txGnS3TR9Fo3LVRbwuZcEpg2YYPkPwuohUgNcgmHfQvUmSQehhQsgwvIFNjBhegwglSGwAI9YIxQ4ueRSDkPMOqWDwFSMAJOI0MlfsCoEAAAAASUVORK5CYII=" } );
14
15
- /* Form's shortcode */
16
- blocks.registerBlockType( 'cpcff/form-shortcode', {
17
- title: 'Insert CFF',
18
- icon: iconCPCFF,
19
- category: 'cpcff',
20
- supports: {
21
- customClassName: false,
22
- className: false
23
- },
24
- attributes: {
25
- shortcode : {
26
- type : 'string',
27
- source : 'text',
28
- default: '[CP_CALCULATED_FIELDS id=""]'
29
- }
30
- },
31
32
- edit: function( props ) {
33
- var focus = props.focus;
34
- return [
35
- !!focus && el(
36
- InspectorControls,
37
- {
38
- key: 'cpcff_inspector'
39
- },
40
- [
41
- el(
42
- 'span',
43
{
44
- key: 'cpcff_inspector_help',
45
- style:{fontStyle: 'italic'}
46
},
47
- 'If you need help: '
48
),
49
- el(
50
- 'a',
51
{
52
- key : 'cpcff_inspector_help_link',
53
- href : 'https://cff.dwbooster.com/documentation#insertion-page',
54
- target : '_blank'
55
- },
56
- 'CLICK HERE'
57
- ),
58
- ]
59
- ),
60
- el('textarea',
61
- {
62
- key: 'cpcff_form_shortcode',
63
- value: props.attributes.shortcode,
64
- onChange: function(evt){
65
- props.setAttributes({shortcode: evt.target.value});
66
- },
67
- style: {width:"100%", resize: "vertical"}
68
- }
69
- )
70
- ];
71
- },
72
73
- save: function( props ) {
74
- return props.attributes.shortcode;
75
- }
76
- });
77
78
- /* variable shortcode */
79
- blocks.registerBlockType( 'cpcff/variable-shortcode', {
80
- title: 'Create var from POST, GET, SESSION, or COOKIES',
81
- icon: iconCPCFFV,
82
- category: 'cpcff',
83
- supports: {
84
- customClassName: false,
85
- className: false
86
- },
87
- attributes: {
88
- shortcode : {
89
- type : 'string',
90
- source : 'text',
91
- default: '[CP_CALCULATED_FIELDS_VAR name=""]'
92
- }
93
- },
94
95
- edit: function( props ) {
96
- var focus = props.focus;
97
- return [
98
- !!focus && el(
99
- InspectorControls,
100
- {
101
- key: 'cpcff_inspector'
102
- },
103
- [
104
- el(
105
- 'span',
106
{
107
- key: 'cpcff_inspector_help',
108
- style:{fontStyle: 'italic'}
109
},
110
- 'If you need help: '
111
),
112
el(
113
- 'a',
114
{
115
- key : 'cpcff_inspector_help_link',
116
- href : 'https://cff.dwbooster.com/documentation#javascript-variables',
117
- target : '_blank'
118
- },
119
- 'CLICK HERE'
120
)
121
- ]
122
- ),
123
- el(
124
- 'textarea',
125
- {
126
- key: 'cpcff_variable_shortcode',
127
- value: props.attributes.shortcode,
128
- onChange: function(evt){
129
- props.setAttributes({shortcode: evt.target.value});
130
- },
131
- style: {width:"100%", resize: "vertical"}
132
- }
133
- )
134
- ];
135
- },
136
137
- save: function( props ) {
138
- return props.attributes.shortcode;
139
- }
140
- });
141
- } )(
142
- window.wp.blocks,
143
- window.wp.element
144
);
1
+ jQuery(function()
2
+ {
3
+ (function( blocks, element ) {
4
+ var el = element.createElement,
5
+ InspectorControls = wp.editor.InspectorControls,
6
+ category = {slug:'cp-calculated-fields-form', title : 'Calculated Fields Form'};
7
8
+ /* Plugin Category */
9
+ blocks.getCategories().push({slug: 'cpcff', title: 'Calculated Fields Form'});
10
11
+ /* ICONS */
12
+ const iconCPCFF = el('img', { width: 20, height: 20, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAGdJREFUOI1jnHnk3X8GKgAmahhCVYNYGBgYGDq3PqLIkHJvOeq5iHHQBTYLjIEcTuXecgydWx8xMDISNqDMSw7VIHTAyMjAcKdVH68hKtUX4Wzqew0d/P+PaiMhQLVYGw1swmDwZREAIzIpNydZa8YAAAAASUVORK5CYII=" } );
13
14
+ const iconCPCFFV = el('img', { width: 20, height: 20, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAIhJREFUOI1jnHnk3X8GKgAmahhCVYNYkDlp1oIkaZ519D2cjeEi5aqLDMpVF3FqxiWP1Wt32/RxGoRLDmcYYbMVn0txGnS3TR9Fo3LVRbwuZcEpg2YYPkPwuohUgNcgmHfQvUmSQehhQsgwvIFNjBhegwglSGwAI9YIxQ4ueRSDkPMOqWDwFSMAJOI0MlfsCoEAAAAASUVORK5CYII=" } );
15
16
+ /* Form's shortcode */
17
+ blocks.registerBlockType( 'cpcff/form-shortcode', {
18
+ title: 'Insert CFF',
19
+ icon: iconCPCFF,
20
+ category: 'cpcff',
21
+ supports: {
22
+ customClassName: false,
23
+ className: false
24
+ },
25
+ attributes: {
26
+ shortcode : {
27
+ type : 'string',
28
+ source : 'text',
29
+ default: '[CP_CALCULATED_FIELDS id=""]'
30
+ }
31
+ },
32
33
+ edit: function( props ) {
34
+ var focus = props.isSelected;
35
+ return [
36
+ !!focus && el(
37
+ InspectorControls,
38
{
39
+ key: 'cpcff_inspector'
40
},
41
+ [
42
+ el(
43
+ 'span',
44
+ {
45
+ key: 'cpcff_inspector_help',
46
+ style:{fontStyle: 'italic'}
47
+ },
48
+ 'If you need help: '
49
+ ),
50
+ el(
51
+ 'a',
52
+ {
53
+ key : 'cpcff_inspector_help_link',
54
+ href : 'https://cff.dwbooster.com/documentation#insertion-page',
55
+ target : '_blank'
56
+ },
57
+ 'CLICK HERE'
58
+ )
59
+ ]
60
),
61
+ el('textarea',
62
{
63
+ key: 'cpcff_form_shortcode',
64
+ value: props.attributes.shortcode,
65
+ onChange: function(evt){
66
+ props.setAttributes({shortcode: evt.target.value});
67
+ },
68
+ style: {width:"100%", resize: "vertical"}
69
+ }
70
+ )
71
+ ];
72
+ },
73
74
+ save: function( props ) {
75
+ return props.attributes.shortcode;
76
+ }
77
+ });
78
79
+ /* variable shortcode */
80
+ blocks.registerBlockType( 'cpcff/variable-shortcode', {
81
+ title: 'Create var from POST, GET, SESSION, or COOKIES',
82
+ icon: iconCPCFFV,
83
+ category: 'cpcff',
84
+ supports: {
85
+ customClassName: false,
86
+ className: false
87
+ },
88
+ attributes: {
89
+ shortcode : {
90
+ type : 'string',
91
+ source : 'text',
92
+ default: '[CP_CALCULATED_FIELDS_VAR name=""]'
93
+ }
94
+ },
95
96
+ edit: function( props ) {
97
+ var focus = props.isSelected;
98
+ return [
99
+ !!focus && el(
100
+ InspectorControls,
101
{
102
+ key: 'cpcff_inspector'
103
},
104
+ [
105
+ el(
106
+ 'span',
107
+ {
108
+ key: 'cpcff_inspector_help',
109
+ style:{fontStyle: 'italic'}
110
+ },
111
+ 'If you need help: '
112
+ ),
113
+ el(
114
+ 'a',
115
+ {
116
+ key : 'cpcff_inspector_help_link',
117
+ href : 'https://cff.dwbooster.com/documentation#javascript-variables',
118
+ target : '_blank'
119
+ },
120
+ 'CLICK HERE'
121
+ )
122
+ ]
123
),
124
el(
125
+ 'textarea',
126
{
127
+ key: 'cpcff_variable_shortcode',
128
+ value: props.attributes.shortcode,
129
+ onChange: function(evt){
130
+ props.setAttributes({shortcode: evt.target.value});
131
+ },
132
+ style: {width:"100%", resize: "vertical"}
133
+ }
134
)
135
+ ];
136
+ },
137
138
+ save: function( props ) {
139
+ return props.attributes.shortcode;
140
+ }
141
+ });
142
+ } )(
143
+ window.wp.blocks,
144
+ window.wp.element
145
+ );
146
+ }
147
);
js/fbuilder-pro-admin.jquery.js CHANGED
@@ -578,7 +578,6 @@
578
'items': '.fields',
579
'placeholder': 'ui-state-highlight',
580
'tolerance': 'pointer',
581
- 'cursorAt': { 'top': 5, 'left': 5 },
582
'update': function( event, ui )
583
{
584
var i, h = items.length;
578
'items': '.fields',
579
'placeholder': 'ui-state-highlight',
580
'tolerance': 'pointer',
581
'update': function( event, ui )
582
{
583
var i, h = items.length;
js/fbuilder-pro-public.jquery.js CHANGED
@@ -21,12 +21,13 @@
21
return value.replace(/([\^\$\-\.\,\[\]\(\)\/\\\*\?\+\!\{\}])/g, "\\$1");
22
};
23
24
- $.fbuilder[ 'parseValStr' ] = function( value )
25
{
26
if( typeof value == 'undefined' || value == null ) value = '';
27
/* value = $.trim( value.replace(/'/g, "\\'").replace( /\#x2F;g, '\\#x27;).replace(/"/g, '\\"') ); */
28
- value = $.trim( value.replace(/'/g, "\\'").replace(/"/g, '\\"') );
29
- return ($.isNumeric(value) ) ? value*1 : '"' + value + '"';
30
};
31
32
$.fbuilder[ 'parseVal' ] = function( value, thousandSeparator, decimalSymbol )
@@ -166,44 +167,19 @@
166
$( '#fieldlist'+opt.identifier).find(".pbPrevious,.pbNext").bind("keyup", function(evt){
167
if(evt.which == 13 || evt.which == 32) $(this).click();
168
}).bind("click", {'identifier' : opt.identifier}, function(evt){
169
- var identifier = evt.data.identifier;
170
- if ( ($(this).hasClass("pbPrevious")) || (($(this).hasClass("pbNext")) && $(this).closest("form").valid()) )
171
- {
172
- var page = parseInt($(this).parents(".pbreak").attr("page"));
173
-
174
- (($(this).hasClass("pbPrevious"))?page--:page++);
175
- $("#fieldlist"+identifier+" .pbreak").css("display","none");
176
- $("#fieldlist"+identifier+" .pbreak").find(".field").addClass("ignorepb");
177
178
- $("#fieldlist"+identifier+" .pb"+page).css("display","block");
179
- $("#fieldlist"+identifier+" .pb"+page).find(".field").removeClass("ignorepb");
180
- if ($("#fieldlist"+identifier+" .pb"+page).find(".fields").length>0)
181
{
182
- try
183
- {
184
- var ffocusable = $("#fieldlist"+identifier+" .pb"+page).find(":focusable"),
185
- _wScrollTop = $(window).scrollTop(),
186
- _viewportHeight = $(window).height(),
187
- _scrollTop = $("#fieldlist"+identifier+" .pb"+page).closest('form').offset().top;
188
-
189
- if( ffocusable.length )
190
- {
191
- ffocusable[0].focus();
192
- }
193
-
194
- if(_scrollTop < _wScrollTop || (_wScrollTop+_viewportHeight)<_scrollTop )
195
- {
196
- $( 'html, body' ).animate({scrollTop: _scrollTop}, 50);
197
- }
198
- }
199
- catch(e){}
200
}
201
- }
202
- else
203
- {
204
- $(this).closest("form").validate().focusInvalid();
205
- }
206
- return false;
207
});
208
}
209
else
@@ -271,7 +247,8 @@
271
});
272
try
273
{
274
- $( "#fbuilder"+opt.identifier ).tooltip({show: false,hide:false,tooltipClass:"uh-tooltip",position: { my: "left top", at: "left bottom+5", collision: "none" },items: "[uh]",content: function (){return $(this).attr("uh");}, open: function( evt, ui ){ try{ if(window.matchMedia("screen and (max-width: 640px)").matches){
275
var duration = ('undefined' != typeof tooltip_duration && /^\d+#x2F;.test(tooltip_duration)) ? tooltip_duration : 3000;
276
setTimeout( function(){$(ui.tooltip).hide('fade'); }, duration);
277
}}catch( err ){}} });
@@ -317,9 +294,10 @@
317
hiddenByContainer : {},
318
getItem: function( name )
319
{
320
for( var i in items )
321
{
322
- if( items[ i ].name == name )
323
{
324
return items[ i ];
325
}
@@ -390,11 +368,16 @@
390
return 'Not available yet';
391
},
392
after_show:function(){},
393
- val:function(){
394
var e = $( "[id='" + this.name + "']:not(.ignore)" );
395
if( e.length )
396
{
397
- return $.fbuilder.parseVal( $.trim( e.val() ) );
398
}
399
return 0;
400
},
@@ -404,77 +387,209 @@
404
}
405
});
406
407
- $.fbuilder[ 'showHideDep' ] = function( configObj )
408
{
409
- /**
410
- * If isNotFirstTime is defined, the equations associated to the fields should be inserted in the queue of equations
411
- */
412
- var process_items = function( items, isNotFirstTime )
413
{
414
- for( var i = 0, h = items.length; i < h; i++ )
415
- {
416
- if( typeof items[ i ] == 'string' ) items[i] = $.fbuilder[ 'forms' ][ identifier ].getItem( items[i] );
417
- if( isNotFirstTime && items[i] && items[i].usedInEquations ) $.fbuilder[ 'calculator' ].enqueueEquation( identifier, items[i].usedInEquations );
418
- if( typeof items[ i ][ 'showHideDep' ] != 'undefined' )
419
- {
420
- var list = items[ i ][ 'showHideDep' ]( toShow, toHide, hiddenByContainer );
421
- if( typeof list != 'undefined' && list.length )
422
- process_items( list, true );
423
- }
424
- }
425
};
426
427
- if( typeof configObj[ 'formIdentifier' ] !== 'undefined' )
428
{
429
- var identifier = configObj[ 'formIdentifier' ];
430
431
- if( typeof $.fbuilder[ 'forms' ][ identifier ] != 'undefined' )
432
{
433
- var toShow = $.fbuilder[ 'forms' ][ identifier ][ 'toShow' ],
434
- toHide = $.fbuilder[ 'forms' ][ identifier ][ 'toHide' ],
435
- hiddenByContainer = $.fbuilder[ 'forms' ][ identifier ][ 'hiddenByContainer' ],
436
- items = (typeof configObj[ 'fieldItentifier' ] != 'undefined' ) ? [ $.fbuilder[ 'forms' ][ identifier ].getItem(configObj[ 'fieldItentifier' ]) ] : $.fbuilder[ 'forms' ][ identifier ].getItems();
437
438
- process_items( items );
439
440
- if( typeof configObj[ 'throwEvent' ] == 'undefined' || configObj[ 'throwEvent' ] )
441
- {
442
- $( document ).trigger( 'showHideDepEvent', $.fbuilder[ 'forms' ][ identifier ][ 'formId' ] );
443
}
444
}
445
}
446
- }; // End showHideDep
447
448
- // Load default values
449
- $.fbuilder[ 'cpcff_load_defaults' ] = function( o )
450
{
451
- var $ = fbuilderjQuery,
452
- id,
453
- item,
454
- form_data,
455
- form_obj;
456
457
- if( typeof cpcff_default != 'undefined' )
458
{
459
- id = o.identifier.replace( /[^\d]/g, '' );
460
- if( typeof cpcff_default[ id ] != 'undefined' )
461
{
462
- form_data = cpcff_default[ id ];
463
- id = '_'+id;
464
- form_obj = $.fbuilder[ 'forms' ][ id ];
465
466
- for( var field_id in form_data )
467
- {
468
- item = form_obj.getItem( field_id+id );
469
- if( typeof item[ 'setVal' ] != 'undefined' ) item.setVal( form_data[ field_id ] );
470
- }
471
472
- $.fbuilder.showHideDep(
473
- {
474
- 'formIdentifier' : o.identifier,
475
- 'throwEvent' : true
476
- }
477
- );
478
}
479
}
480
- };
21
return value.replace(/([\^\$\-\.\,\[\]\(\)\/\\\*\?\+\!\{\}])/g, "\\$1");
22
};
23
24
+ $.fbuilder[ 'parseValStr' ] = function( value, raw )
25
{
26
+ raw = raw || false;
27
if( typeof value == 'undefined' || value == null ) value = '';
28
/* value = $.trim( value.replace(/'/g, "\\'").replace( /\#x2F;g, '\\#x27;).replace(/"/g, '\\"') ); */
29
+ value = $.trim( value.replace(/\\/g, "\\\\") ).replace(/'/g, "\\'").replace(/"/g, '\\"');
30
+ return ($.isNumeric(value)) ? ((raw) ? value : value*1) : '"' + value + '"';
31
};
32
33
$.fbuilder[ 'parseVal' ] = function( value, thousandSeparator, decimalSymbol )
167
$( '#fieldlist'+opt.identifier).find(".pbPrevious,.pbNext").bind("keyup", function(evt){
168
if(evt.which == 13 || evt.which == 32) $(this).click();
169
}).bind("click", {'identifier' : opt.identifier}, function(evt){
170
+ var _from = $(this).closest('.pbreak').attr('page')*1,
171
+ _to = _from+(($(this).hasClass("pbPrevious")) ? -1 : 1),
172
+ _p;
173
174
+ _p = $.fbuilder['goToPage'](
175
{
176
+ 'formIdentifier' : evt.data.identifier,
177
+ 'from' : _from,
178
+ 'to' : _to
179
}
180
+ );
181
+ if(_p == _to) $.fbuilder.setBrowserHistory();
182
+ return false;
183
});
184
}
185
else
247
});
248
try
249
{
250
+ $.widget.bridge('uitooltip', $.ui.tooltip);
251
+ $( "#fbuilder"+opt.identifier ).uitooltip({show: false,hide:false,tooltipClass:"uh-tooltip",position: { my: "left top", at: "left bottom+5", collision: "none" },items: "[uh]",content: function (){return $(this).attr("uh");}, open: function( evt, ui ){ try{ if(window.matchMedia("screen and (max-width: 640px)").matches){
252
var duration = ('undefined' != typeof tooltip_duration && /^\d+#x2F;.test(tooltip_duration)) ? tooltip_duration : 3000;
253
setTimeout( function(){$(ui.tooltip).hide('fade'); }, duration);
254
}}catch( err ){}} });
294
hiddenByContainer : {},
295
getItem: function( name )
296
{
297
+ var regExp = new RegExp('('+name+'_)|(fieldname'+name+'_)', i);
298
for( var i in items )
299
{
300
+ if( items[ i ].name == name || regExp.test(items[ i ].name))
301
{
302
return items[ i ];
303
}
368
return 'Not available yet';
369
},
370
after_show:function(){},
371
+ val:function(raw){
372
+ raw = raw || false;
373
var e = $( "[id='" + this.name + "']:not(.ignore)" );
374
if( e.length )
375
{
376
+ var v = e.val();
377
+ if(raw) return $.fbuilder.parseValStr(v, raw);
378
+
379
+ v = $.trim(v);
380
+ return ($.isNumeric(v)) ? $.fbuilder.parseVal(v) : $.fbuilder.parseValStr(v);
381
}
382
return 0;
383
},
387
}
388
});
389
390
+ $.fbuilder[ 'setBrowserHistory' ] = function(replace)
391
+ {
392
+ if('history' in window)
393
{
394
+ var bookmark = '#',
395
+ separator = '';
396
+ for(var formId in $.fbuilder.forms)
397
{
398
+ bookmark += separator+'f'+formId.replace(/[^\d]/g,'')+'p'+($.fbuilder.forms[formId]['currentPage'] || 0);
399
+ separator = '|';
400
+ }
401
+ history[(replace) ? 'replaceState' : 'pushState']({}, document.title, bookmark);
402
+ }
403
+ }; // End setBrowserHistory
404
+
405
+ $.fbuilder[ 'manageHistory' ] = function(state)
406
+ {
407
+ var bookmark = (document.URL.split('#').length > 1) ? document.URL.split('#')[1] : null,
408
+ _match, _form, _to, setHistoryEntry = false,
409
+ _goToPage = function(config){
410
+
411
};
412
413
+ if(bookmark)
414
+ {
415
+ while(_match = bookmark.match(/f(\d+)p(\d+)\|?/))
416
+ {
417
+ _form = '_'+_match[1];
418
+ _to = _match[2]*1;
419
+ if(
420
+ !(_form in $.fbuilder.forms) || // Form exists
421
+ !('currentPage' in $.fbuilder.forms[_form]) || // Next/Prev buttons has been pressed previously
422
+ _to != $.fbuilder['goToPage'](
423
+ {
424
+ 'formIdentifier' : _form,
425
+ 'from' : 0,
426
+ 'to' : _to
427
+ }
428
+ )
429
+ ) setHistoryEntry = true;
430
+ bookmark = bookmark.replace(_match[0],'');
431
+ }
432
+ }
433
+ else
434
+ {
435
+ for(_form in $.fbuilder.forms)
436
{
437
+ if('currentPage' in $.fbuilder.forms[_form])
438
+ $.fbuilder['goToPage'](
439
+ {
440
+ 'formIdentifier' : _form,'from' : 0, 'to' : 0
441
+ }
442
+ );
443
+ }
444
+ }
445
+ if(setHistoryEntry) $.fbuilder.setBrowserHistory(true);
446
+ }; // End manageHistory
447
448
+ $.fbuilder[ 'goToPage' ] = function( configObj )
449
+ {
450
+ if(
451
+ 'formIdentifier' in configObj &&
452
+ 'from' in configObj &&
453
+ 'to' in configObj
454
+ )
455
+ {
456
+ var identifier = configObj['formIdentifier'],
457
+ _from = configObj['from']*1,
458
+ _to = configObj['to']*1,
459
+ direction = (_from < _to) ? 1 : -1,
460
+ formObj = $('[id="'+$.fbuilder.forms[identifier].formId+'"]'),
461
+ pageObj, i = _from;
462
+
463
+ while(i != _to)
464
+ {
465
+ $(".pbreak:not(.pb"+i+")",formObj).find(".field").addClass("ignorepb");
466
+ $(".pb"+i,formObj).find(".field").removeClass("ignorepb");
467
+ if(direction == 1 && !formObj.valid()) break;
468
+ i += direction;
469
+ }
470
+ $.fbuilder.forms[identifier]['currentPage'] = i;
471
+ $(".pbreak:not(.pb"+i+")",formObj).hide().find(".field").addClass("ignorepb");
472
+ pageObj = $(".pbreak.pb"+i,formObj);
473
+ pageObj.show().find(".field").removeClass("ignorepb");
474
+
475
+ if(i == _to)
476
+ {
477
+ if ($(".fields",pageObj).length>0)
478
{
479
+ try
480
+ {
481
+ var ffocusable = pageObj.find(":focusable"),
482
+ _wScrollTop = $(window).scrollTop(),
483
+ _viewportHeight = $(window).height(),
484
+ _scrollTop = formObj.offset().top;
485
486
+ if( ffocusable.length && !ffocusable.first().hasClass('hasDatepicker'))
487
+ {
488
+ ffocusable[0].focus();
489
+ }
490
491
+ if(_scrollTop < _wScrollTop || (_wScrollTop+_viewportHeight)<_scrollTop )
492
+ {
493
+ $( 'html, body' ).animate({scrollTop: _scrollTop}, 50);
494
+ }
495
}
496
+ catch(e){}
497
}
498
}
499
+ else
500
+ {
501
+ formObj.validate().focusInvalid();
502
+ }
503
+ return i;
504
+ }
505
+ }; // End goToPage
506
507
+ $.fbuilder[ 'showHideDep' ] = function( configObj )
508
+ {
509
+ /**
510
+ * If isNotFirstTime is defined, the equations associated to the fields should be inserted in the queue of equations
511
+ */
512
+ var process_items = function( items, isNotFirstTime )
513
{
514
+ for( var i = 0, h = items.length; i < h; i++ )
515
+ {
516
+ if( typeof items[ i ] == 'string' ) items[i] = $.fbuilder[ 'forms' ][ identifier ].getItem( items[i] );
517
+ if( isNotFirstTime && items[i] && items[i].usedInEquations ) $.fbuilder[ 'calculator' ].enqueueEquation( identifier, items[i].usedInEquations );
518
+ if( typeof items[ i ][ 'showHideDep' ] != 'undefined' )
519
+ {
520
+ var list = items[ i ][ 'showHideDep' ]( toShow, toHide, hiddenByContainer );
521
+ if( typeof list != 'undefined' && list.length )
522
+ process_items( list, true );
523
+ }
524
+ }
525
+ };
526
+
527
+ if( typeof configObj[ 'formIdentifier' ] !== 'undefined' )
528
+ {
529
+ var identifier = configObj[ 'formIdentifier' ];
530
531
+ if( typeof $.fbuilder[ 'forms' ][ identifier ] != 'undefined' )
532
{
533
+ var toShow = $.fbuilder[ 'forms' ][ identifier ][ 'toShow' ],
534
+ toHide = $.fbuilder[ 'forms' ][ identifier ][ 'toHide' ],
535
+ hiddenByContainer = $.fbuilder[ 'forms' ][ identifier ][ 'hiddenByContainer' ],
536
+ items = (typeof configObj[ 'fieldItentifier' ] != 'undefined' ) ? [ $.fbuilder[ 'forms' ][ identifier ].getItem(configObj[ 'fieldItentifier' ].replace(/_[cr]b\d+#x2F;i, '')) ] : $.fbuilder[ 'forms' ][ identifier ].getItems();
537
+
538
+ process_items( items );
539
+
540
+ if( typeof configObj[ 'throwEvent' ] == 'undefined' || configObj[ 'throwEvent' ] )
541
{
542
+ $( document ).trigger( 'showHideDepEvent', $.fbuilder[ 'forms' ][ identifier ][ 'formId' ] );
543
+ }
544
+ }
545
+ }
546
+ }; // End showHideDep
547
548
+ // Load default values
549
+ $.fbuilder[ 'cpcff_load_defaults' ] = function( o )
550
+ {
551
+ var $ = fbuilderjQuery,
552
+ id,
553
+ item,
554
+ form_data,
555
+ form_obj;
556
557
+ if( typeof cpcff_default != 'undefined' )
558
+ {
559
+ id = o.identifier.replace( /[^\d]/g, '' );
560
+ if( typeof cpcff_default[ id ] != 'undefined' )
561
+ {
562
+ form_data = cpcff_default[ id ];
563
+ id = '_'+id;
564
+ form_obj = $.fbuilder[ 'forms' ][ id ];
565
+
566
+ for( var field_id in form_data )
567
+ {
568
+ item = form_obj.getItem( field_id+id );
569
+ if( typeof item[ 'setVal' ] != 'undefined' ) item.setVal( form_data[ field_id ] );
570
}
571
+
572
+ $.fbuilder.showHideDep(
573
+ {
574
+ 'formIdentifier' : o.identifier,
575
+ 'throwEvent' : true
576
+ }
577
+ );
578
}
579
+ }
580
+ };
581
+
582
+ // Read history
583
+ window.addEventListener('popstate', function(){
584
+ try
585
+ {
586
+ // Solves an issue with the datepicker if it is opened and back/next buttons in browser are pressed
587
+ $(".ui-datepicker").hide();
588
+ $.fbuilder.manageHistory();
589
+ }
590
+ catch(err){}
591
+ });
592
+
593
+ $(window).on('load', function(){
594
+ $.fbuilder.manageHistory();
595
+ });
js/fields-admin/02_fbuilder.fcurrency.js CHANGED
@@ -21,24 +21,25 @@
21
currencyText:"USD",
22
thousandSeparator:",",
23
centSeparator:".",
24
min:"",
25
max:"",
26
formatDynamically:false,
27
getPredefinedValue:function()
28
{
29
30
- this.centSeparator = $.trim(this.centSeparator);
31
- if( /^\s*#x2F;.test( this.centSeparator ) )
32
- {
33
- this.centSeparator = '.';
34
- }
35
36
- var v = $.trim( this.predefined );
37
38
- v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencySymbol), 'g' ), '' )
39
- .replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencyText), 'g' ), '' );
40
41
- v = $.fbuilder.parseVal( v, this.thousandSeparator, this.centSeparator );
42
43
if( !isNaN( v ) )
44
{
@@ -47,21 +48,18 @@
47
counter = 0,
48
str = '';
49
50
- if( !/^\s*#x2F;.test( this.thousandSeparator ) )
51
{
52
for( var i = parts[0].length-1; i >= 0; i--){
53
counter++;
54
str = parts[0][i] + str;
55
- if( counter%3 == 0 && i != 0 ) str = this.thousandSeparator + str;
56
57
}
58
parts[0] = str;
59
}
60
- if( typeof parts[ 1 ] != 'undefined' && parts[ 1 ].length == 1 )
61
- {
62
- parts[ 1 ] += '0';
63
- }
64
- return this.currencySymbol+parts.join( this.centSeparator )+this.currencyText;
65
}
66
else
67
{
@@ -74,13 +72,15 @@
74
},
75
editItemEvents:function()
76
{
77
- var evt = [
78
{s:"#sSize",e:"change", l:"size"},
79
{s:"#sCurrencySymbol",e:"change keyup", l:"currencySymbol"},
80
{s:"#sCurrencyText",e:"change keyup", l:"currencyText"},
81
{s:"#sThousandSeparator",e:"change keyup", l:"thousandSeparator"},
82
{s:"#sCentSeparator",e:"change keyup", l:"centSeparator"},
83
- {s:"#sFormatDynamically",e:"click", l:"formatDynamically",f:function(el){return el.is(':checked');}},
84
{s:"#sMin",e:"change keyup", l:"min"},
85
{s:"#sMax",e:"change keyup", l:"max"}
86
];
@@ -96,7 +96,8 @@
96
str += '<div><label>Currency</label><br /><input type="text" name="sCurrencyText" id="sCurrencyText" value="'+$.fbuilder.htmlEncode(this.currencyText)+'" class="large"></div>';
97
str += '<div><label>Thousands Separator</label><br /><input type="text" name="sThousandSeparator" id="sThousandSeparator" value="'+$.fbuilder.htmlEncode(this.thousandSeparator)+'" class="large"></div>';
98
str += '<div><label>Cents Separator</label><br /><input type="text" name="sCentSeparator" id="sCentSeparator" value="'+$.fbuilder.htmlEncode(this.centSeparator)+'" class="large"></div>';
99
- str += '<div><label>Format Dynamically</label><br /><input type="checkbox" name="sFormatDynamically" id="sFormatDynamically" '+( (this.formatDynamically) ? 'CHECKED' : '')+'></div>';
100
return str;
101
},
102
showRangeIntance: function()
21
currencyText:"USD",
22
thousandSeparator:",",
23
centSeparator:".",
24
+ noCents: false,
25
min:"",
26
max:"",
27
formatDynamically:false,
28
getPredefinedValue:function()
29
{
30
+ var me = this,
31
+ v = $.trim( me.predefined );
32
33
+ if(me.predefinedClick || !me.formatDynamically) return v;
34
+
35
+ me.centSeparator = $.trim(me.centSeparator);
36
+ if( /^\s*#x2F;.test( me.centSeparator ) ) me.centSeparator = '.';
37
38
39
+ v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](me.currencySymbol), 'g' ), '' )
40
+ .replace( new RegExp( $.fbuilder[ 'escape_symbol' ](me.currencyText), 'g' ), '' );
41
42
+ v = $.fbuilder.parseVal( v, me.thousandSeparator, me.centSeparator );
43
44
if( !isNaN( v ) )
45
{
48
counter = 0,
49
str = '';
50
51
+ if( !/^\s*#x2F;.test( me.thousandSeparator ) )
52
{
53
for( var i = parts[0].length-1; i >= 0; i--){
54
counter++;
55
str = parts[0][i] + str;
56
+ if( counter%3 == 0 && i != 0 ) str = me.thousandSeparator + str;
57
58
}
59
parts[0] = str;
60
}
61
+ if( typeof parts[ 1 ] != 'undefined' && parts[ 1 ].length == 1 ) parts[ 1 ] += '0';
62
+ return this.currencySymbol+((this.noCents) ? parts[0] : parts.join(this.centSeparator))+this.currencyText;
63
}
64
else
65
{
72
},
73
editItemEvents:function()
74
{
75
+ var f = function(el){return el.is(':checked');},
76
+ evt = [
77
{s:"#sSize",e:"change", l:"size"},
78
{s:"#sCurrencySymbol",e:"change keyup", l:"currencySymbol"},
79
{s:"#sCurrencyText",e:"change keyup", l:"currencyText"},
80
{s:"#sThousandSeparator",e:"change keyup", l:"thousandSeparator"},
81
{s:"#sCentSeparator",e:"change keyup", l:"centSeparator"},
82
+ {s:"#sFormatDynamically",e:"click", l:"formatDynamically",f:f},
83
+ {s:"#sNoCents",e:"click", l:"noCents",f:f},
84
{s:"#sMin",e:"change keyup", l:"min"},
85
{s:"#sMax",e:"change keyup", l:"max"}
86
];
96
str += '<div><label>Currency</label><br /><input type="text" name="sCurrencyText" id="sCurrencyText" value="'+$.fbuilder.htmlEncode(this.currencyText)+'" class="large"></div>';
97
str += '<div><label>Thousands Separator</label><br /><input type="text" name="sThousandSeparator" id="sThousandSeparator" value="'+$.fbuilder.htmlEncode(this.thousandSeparator)+'" class="large"></div>';
98
str += '<div><label>Cents Separator</label><br /><input type="text" name="sCentSeparator" id="sCentSeparator" value="'+$.fbuilder.htmlEncode(this.centSeparator)+'" class="large"></div>';
99
+ str += '<div><label><input type="checkbox" name="sNoCents" id="sNoCents" '+( (this.noCents) ? 'CHECKED' : '')+'> Do Not Allow Cents</label><br /></div>';
100
+ str += '<div><label><input type="checkbox" name="sFormatDynamically" id="sFormatDynamically" '+( (this.formatDynamically) ? 'CHECKED' : '')+'> Format Dynamically</label><br /></div>';
101
return str;
102
},
103
showRangeIntance: function()
js/fields-admin/04_fbuilder.fdate.js CHANGED
@@ -17,6 +17,7 @@
17
size:"medium",
18
required:false,
19
dformat:"mm/dd/yyyy",
20
tformat:"24",
21
showDropdown:false,
22
dropdownRange:"-10:+10",
@@ -39,11 +40,14 @@
39
defaultTime:"",
40
working_dates:[true,true,true,true,true,true,true],
41
42
- formats:new Array("mm/dd/yyyy","dd/mm/yyyy"),
43
44
display:function()
45
{
46
- return '<div class="fields '+this.name+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><label>'+this.title+''+((this.required)?"*":"")+' ('+this.dformat+')</label><div class="dfield"><input class="field disabled '+this.size+'" type="text" value="'+$.fbuilder.htmlEncode(this.predefined)+'"/><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
47
},
48
editItemEvents:function()
49
{
@@ -51,6 +55,7 @@
51
{s:"#sDropdownRange",e:"keyup", l:"dropdownRange"},
52
{s:"#sSize",e:"change", l:"size"},
53
{s:"#sFormat",e:"change", l:"dformat"},
54
{s:"[name='sTimeFormat']",e:"change", l:"tformat"},
55
{s:"#sMinDate",e:"change keyup", l:"minDate"},
56
{s:"#sMaxDate",e:"change keyup", l:"maxDate"},
@@ -85,12 +90,17 @@
85
},
86
showFormatIntance: function()
87
{
88
- var str = "";
89
- for (var i=0;i<this.formats.length;i++)
90
- {
91
- str += '<option value="'+this.formats[i]+'" '+((this.formats[i]==this.dformat)?"selected":"")+'>'+this.formats[i]+'</option>';
92
- }
93
- return '<hr></hr><div><input type="checkbox" name="sShowDatepicker" id="sShowDatepicker" '+( ( this.showDatepicker ) ? 'CHECKED' : '' )+' > <label>Show input field for the date</label></div><div><label>Date Format</label><br /><select name="sFormat" id="sFormat">'+str+'</select></div>';
94
},
95
showSpecialDataInstance: function()
96
{
@@ -108,10 +118,10 @@
108
str += '<div class="time-options" '+( ( !this.showTimepicker ) ? 'style="display:none;"': '' )+'>';
109
str += '<div><label>Time Format</label><br /><label><input type="radio" name="sTimeFormat" id="sTimeFormat" value="24" '+( ( this.tformat == 24 ) ? 'CHECKED' : '' )+' /> 24 hours</label> <label><input type="radio" name="sTimeFormat" id="sTimeFormat" value="12" '+( ( this.tformat == 12 ) ? 'CHECKED' : '' )+' /> 12 hours</label></div>';
110
str += '<div><label>Default Time HH:mm</label><br /><input class="large" name="sDefaultTime" id="sDefaultTime" value="'+$.fbuilder.htmlEncode(this.defaultTime)+'" /></div>';
111
- str += '<div><label>Min Hour</label><br /><input class="large" name="sMinHour" id="sMinHour" value="'+$.fbuilder.htmlEncode(this.minHour)+'" /></div>';
112
- str += '<div><label>Max Hour</label><br /><input class="large" name="sMaxHour" id="sMaxHour" value="'+$.fbuilder.htmlEncode(this.maxHour)+'" /></div>';
113
- str += '<div><label>Min Minutes</label><br /><input class="large" name="sMinMinute" id="sMinMinute" value="'+$.fbuilder.htmlEncode(this.minMinute)+'" /></div>';
114
- str += '<div><label>Max Minutes</label><br /><input class="large" name="sMaxMinute" id="sMaxMinute" value="'+$.fbuilder.htmlEncode(this.maxMinute)+'" /></div>';
115
116
str += '<div><label>Steps for hours</label><br /><input class="large" name="sStepHour" id="sStepHour" value="'+$.fbuilder.htmlEncode(this.stepHour)+'" /></div>';
117
str += '<div><label>Steps for minutes</label><br /><input class="large" name="sStepMinute" id="sStepMinute" value="'+$.fbuilder.htmlEncode(this.stepMinute)+'" /></div>';
17
size:"medium",
18
required:false,
19
dformat:"mm/dd/yyyy",
20
+ dseparator:"/",
21
tformat:"24",
22
showDropdown:false,
23
dropdownRange:"-10:+10",
40
defaultTime:"",
41
working_dates:[true,true,true,true,true,true,true],
42
43
+ formats:['mm/dd/yyyy','dd/mm/yyyy','yyyy/mm/dd','yyyy/dd/mm'],
44
+ separators: ['/','-','.'],
45
46
display:function()
47
{
48
+ var me = this,
49
+ dformat = me.dformat.replace(/\//g, me.dseparator);
50
+ return '<div class="fields '+me.name+'" id="field'+me.form_identifier+'-'+me.index+'" title="'+me.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><label>'+me.title+''+((me.required)?"*":"")+' ('+dformat+')</label><div class="dfield"><input class="field disabled '+me.size+'" type="text" value="'+$.fbuilder.htmlEncode(me.predefined)+'"/><span class="uh">'+me.userhelp+'</span></div><div class="clearer"></div></div>';
51
},
52
editItemEvents:function()
53
{
55
{s:"#sDropdownRange",e:"keyup", l:"dropdownRange"},
56
{s:"#sSize",e:"change", l:"size"},
57
{s:"#sFormat",e:"change", l:"dformat"},
58
+ {s:"#sSeparator",e:"change", l:"dseparator"},
59
{s:"[name='sTimeFormat']",e:"change", l:"tformat"},
60
{s:"#sMinDate",e:"change keyup", l:"minDate"},
61
{s:"#sMaxDate",e:"change keyup", l:"maxDate"},
90
},
91
showFormatIntance: function()
92
{
93
+ var me = this,
94
+ formatOpts = "",
95
+ separatorOpts = "";
96
+
97
+ for (var i in me.formats)
98
+ formatOpts += '<option value="'+me.formats[i]+'" '+((me.formats[i]==me.dformat)?"selected":"")+'>'+me.formats[i]+'</option>';
99
+
100
+ for (var i in me.separators)
101
+ separatorOpts += '<option value="'+me.separators[i]+'" '+((me.separators[i]==me.dseparator)?"selected":"")+'>'+me.separators[i]+'</option>';
102
+
103
+ return '<hr></hr><div><input type="checkbox" name="sShowDatepicker" id="sShowDatepicker" '+( ( me.showDatepicker ) ? 'CHECKED' : '' )+' > <label>Show input field for the date</label></div><div class="width50 column"><label>Date Format</label><br /><select name="sFormat" id="sFormat" class="width100">'+formatOpts+'</select></div><div class="width50 columnr"><label>Parts separator</label><br /><select name="sSeparator" id="sSeparator" class="width100">'+separatorOpts+'</select></div>';
104
},
105
showSpecialDataInstance: function()
106
{
118
str += '<div class="time-options" '+( ( !this.showTimepicker ) ? 'style="display:none;"': '' )+'>';
119
str += '<div><label>Time Format</label><br /><label><input type="radio" name="sTimeFormat" id="sTimeFormat" value="24" '+( ( this.tformat == 24 ) ? 'CHECKED' : '' )+' /> 24 hours</label> <label><input type="radio" name="sTimeFormat" id="sTimeFormat" value="12" '+( ( this.tformat == 12 ) ? 'CHECKED' : '' )+' /> 12 hours</label></div>';
120
str += '<div><label>Default Time HH:mm</label><br /><input class="large" name="sDefaultTime" id="sDefaultTime" value="'+$.fbuilder.htmlEncode(this.defaultTime)+'" /></div>';
121
+ str += '<div class="width50 column"><label>Min Hour</label><br /><input class="large" name="sMinHour" id="sMinHour" value="'+$.fbuilder.htmlEncode(this.minHour)+'" /></div>';
122
+ str += '<div class="width50 columnr"><label>Min Minutes</label><br /><input class="large" name="sMinMinute" id="sMinMinute" value="'+$.fbuilder.htmlEncode(this.minMinute)+'" /></div>';
123
+ str += '<div class="width50 column"><label>Max Hour</label><br /><input class="large" name="sMaxHour" id="sMaxHour" value="'+$.fbuilder.htmlEncode(this.maxHour)+'" /></div>';
124
+ str += '<div class="width50 columnr"><label>Max Minutes</label><br /><input class="large" name="sMaxMinute" id="sMaxMinute" value="'+$.fbuilder.htmlEncode(this.maxMinute)+'" /></div>';
125
126
str += '<div><label>Steps for hours</label><br /><input class="large" name="sStepHour" id="sStepHour" value="'+$.fbuilder.htmlEncode(this.stepHour)+'" /></div>';
127
str += '<div><label>Steps for minutes</label><br /><input class="large" name="sStepMinute" id="sStepMinute" value="'+$.fbuilder.htmlEncode(this.stepMinute)+'" /></div>';
js/fields-admin/06_fbuilder.fcheck.js CHANGED
@@ -28,7 +28,7 @@
28
},
29
display:function()
30
{
31
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
32
var str = "";
33
for (var i=0;i<this.choices.length;i++)
34
{
@@ -192,7 +192,7 @@
192
{
193
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
194
for (var i=0;i<items.length;i++)
195
- if (items[i].name != me.name && items[i].ftype != 'fSectionBreak' && items[i].ftype != 'fPageBreak')
196
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+( ( typeof items[ i ].title != 'undefined' ) ? ' (' + items[ i ].title + ')' : '' ) +'</option>';
197
$(this).html(str);
198
});
@@ -214,7 +214,7 @@
214
},
215
showChoiceIntance: function()
216
{
217
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
218
var l = this.choices;
219
var lv = this.choicesVal;
220
var v = this.choiceSelected;
28
},
29
display:function()
30
{
31
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
32
var str = "";
33
for (var i=0;i<this.choices.length;i++)
34
{
192
{
193
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
194
for (var i=0;i<items.length;i++)
195
+ if (items[i].name != me.name && items[i].ftype != 'fPageBreak')
196
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+( ( typeof items[ i ].title != 'undefined' ) ? ' (' + items[ i ].title + ')' : '' ) +'</option>';
197
$(this).html(str);
198
});
214
},
215
showChoiceIntance: function()
216
{
217
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
218
var l = this.choices;
219
var lv = this.choicesVal;
220
var v = this.choiceSelected;
js/fields-admin/07_fbuilder.fradio.js CHANGED
@@ -17,6 +17,7 @@
17
toSubmit:'text',
18
choiceSelected:"",
19
showDep:false,
20
init:function()
21
{
22
this.choices = new Array("First Choice","Second Choice","Third Choice");
@@ -25,7 +26,7 @@
25
},
26
display:function()
27
{
28
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
29
var str = "";
30
for (var i=0;i<this.choices.length;i++)
31
{
@@ -168,13 +169,14 @@
168
});
169
var me = this,
170
items = me.fBuild.getItems(),
171
- evt = [{s:'[name="sToSubmit"]', e:"click", l:"toSubmit"}];
172
$('.dependencies').each(function()
173
{
174
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
175
for (var i=0;i<items.length;i++)
176
{
177
- if (items[i].name != me.name && items[i].ftype != 'fSectionBreak' && items[i].ftype != 'fPageBreak')
178
{
179
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+ ( ( typeof items[i].title != 'undefined' ) ? ' (' + items[i].title + ')' : '' ) + ' </option>';
180
}
@@ -187,9 +189,13 @@
187
{
188
return '<div class="choicesSet"><label>Value to Submit</label><br /><div class="column width50"><label><input type="radio" name="sToSubmit" value="text" '+((this.toSubmit == 'text') ? ' CHECKED ' : '')+'/> Choice Text</label></div><div class="column width50"><label><input type="radio" name="sToSubmit" value="value" '+((this.toSubmit == 'value') ? ' CHECKED ' : '')+'/> Choice Value</label></div><div class="clearer"></div></div>';
189
},
190
showChoiceIntance: function()
191
{
192
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
193
var l = this.choices;
194
var lv = this.choicesVal;
195
if (!(typeof(this.choicesDep) != "undefined" && this.choicesDep !== null))
@@ -214,6 +220,6 @@
214
str += '<div class="choicesEditDep"><span>If selected show:</span> <select class="dependencies" i="'+i+'" j="'+d[i].length+'" dname="'+this.name+'" dvalue="" ></select><div class="choice-ctrls"><a class="choice_addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+d[i].length+'" title="Add another dependency."></a><a class="choice_removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+d[i].length+'" title="Delete this dependency."></a></div></div>';
215
}
216
}
217
- return '<div class="choicesSet '+((this.showDep)?"show":"hide")+'"><label>Choices</label> <a class="helpfbuilder dep" text="Dependencies are used to show/hide other fields depending of the option selected in this field.">help?</a> <a href="" class="showHideDependencies">'+((this.showDep)?"Hide":"Show")+' Dependencies</a><div><div class="t">Text</div><div class="t">Value</div><div class="clearer"></div></div>'+str+this.attributeToSubmit()+'</div>';
218
}
219
});
17
toSubmit:'text',
18
choiceSelected:"",
19
showDep:false,
20
+ untickAccepted:true,
21
init:function()
22
{
23
this.choices = new Array("First Choice","Second Choice","Third Choice");
26
},
27
display:function()
28
{
29
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
30
var str = "";
31
for (var i=0;i<this.choices.length;i++)
32
{
169
});
170
var me = this,
171
items = me.fBuild.getItems(),
172
+ evt = [{s:'[name="sToSubmit"]', e:"click", l:"toSubmit"},
173
+ {s:'[name="sUntickAccepted"]',e:"click", l:"untickAccepted",f:function(el){return el.is(':checked');}}];
174
$('.dependencies').each(function()
175
{
176
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
177
for (var i=0;i<items.length;i++)
178
{
179
+ if (items[i].name != me.name && items[i].ftype != 'fPageBreak')
180
{
181
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+ ( ( typeof items[i].title != 'undefined' ) ? ' (' + items[i].title + ')' : '' ) + ' </option>';
182
}
189
{
190
return '<div class="choicesSet"><label>Value to Submit</label><br /><div class="column width50"><label><input type="radio" name="sToSubmit" value="text" '+((this.toSubmit == 'text') ? ' CHECKED ' : '')+'/> Choice Text</label></div><div class="column width50"><label><input type="radio" name="sToSubmit" value="value" '+((this.toSubmit == 'value') ? ' CHECKED ' : '')+'/> Choice Value</label></div><div class="clearer"></div></div>';
191
},
192
+ allowUntick: function()
193
+ {
194
+ return '<div><label><input type="checkbox" name="sUntickAccepted" '+((this.untickAccepted) ? ' CHECKED ' : '')+'/> Allow Untick Choices</label></div>';
195
+ },
196
showChoiceIntance: function()
197
{
198
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
199
var l = this.choices;
200
var lv = this.choicesVal;
201
if (!(typeof(this.choicesDep) != "undefined" && this.choicesDep !== null))
220
str += '<div class="choicesEditDep"><span>If selected show:</span> <select class="dependencies" i="'+i+'" j="'+d[i].length+'" dname="'+this.name+'" dvalue="" ></select><div class="choice-ctrls"><a class="choice_addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+d[i].length+'" title="Add another dependency."></a><a class="choice_removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+d[i].length+'" title="Delete this dependency."></a></div></div>';
221
}
222
}
223
+ return '<div class="choicesSet '+((this.showDep)?"show":"hide")+'"><label>Choices</label> <a class="helpfbuilder dep" text="Dependencies are used to show/hide other fields depending of the option selected in this field.">help?</a> <a href="" class="showHideDependencies">'+((this.showDep)?"Hide":"Show")+' Dependencies</a><div><div class="t">Text</div><div class="t">Value</div><div class="clearer"></div></div>'+str+this.attributeToSubmit()+this.allowUntick()+'</div>';
224
}
225
});
js/fields-admin/08_fbuilder.fdropdown.js CHANGED
@@ -29,7 +29,7 @@
29
},
30
display:function()
31
{
32
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
33
return '<div class="fields '+this.name+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><label>'+this.title+''+((this.required)?"*":"")+'</label><div class="dfield"><select class="field disabled '+this.size+'" ><option>'+this.choiceSelected+'</option></select><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
34
},
35
editItemEvents:function()
@@ -192,7 +192,7 @@
192
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
193
for (var i=0;i<items.length;i++)
194
{
195
- if (items[i].name != me.name && items[i].ftype != 'fSectionBreak' && items[i].ftype != 'fPageBreak')
196
{
197
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+( ( typeof items[ i ].title != 'undefined' ) ? ' (' + items[ i ].title + ')' : '' )+'</option>';
198
}
@@ -216,7 +216,7 @@
216
},
217
showChoiceIntance: function()
218
{
219
- this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
220
if(typeof this.optgroup == 'undefined' ) this.optgroup = new Array();
221
222
var l = this.choices,
29
},
30
display:function()
31
{
32
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
33
return '<div class="fields '+this.name+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><label>'+this.title+''+((this.required)?"*":"")+'</label><div class="dfield"><select class="field disabled '+this.size+'" ><option>'+this.choiceSelected+'</option></select><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
34
},
35
editItemEvents:function()
192
var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
193
for (var i=0;i<items.length;i++)
194
{
195
+ if (items[i].name != me.name && items[i].ftype != 'fPageBreak')
196
{
197
str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].name)+( ( typeof items[ i ].title != 'undefined' ) ? ' (' + items[ i ].title + ')' : '' )+'</option>';
198
}
216
},
217
showChoiceIntance: function()
218
{
219
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices.slice(0));
220
if(typeof this.optgroup == 'undefined' ) this.optgroup = new Array();
221
222
var l = this.choices,
js/fields-admin/28_fbuilder.fcontainer.js CHANGED
@@ -12,14 +12,14 @@
12
},
13
showShortLabel:function(){ return ''; },
14
showUserhelp:function(){ return ''; },
15
- showSpecialDataInstance: function()
16
{
17
var columns = [1,2,3,4],
18
cStr = '';
19
for( var i = 0, h = columns.length; i < h; i++ )
20
- {
21
cStr += '<option value="'+columns[ i ]+'" '+( ( this.columns == columns[ i ] ) ? 'SELECTED' : '' )+'>'+columns[ i ]+' column'+( ( i ) ? 's' : '' )+'</option>';
22
- }
23
return '<div><label>Columns</label><br /><select name="sColumns" id="sColumns">' + cStr + '</select><div class="clearer"><span class="uh">Shown in columns the fields into the container.</span></div></div>';
24
},
25
remove : function()
@@ -28,9 +28,9 @@
28
for( var i = this.fields.length - 1, h = 0; i >= h; i-- )
29
{
30
this.fBuild.removeItem( fieldsIndex[this.fields[ i ]] );
31
- }
32
},
33
- duplicateItem: function( currentField, newField )
34
{
35
for( var i = 0, h = this.fields.length; i < h; i++ )
36
{
@@ -53,7 +53,7 @@
53
return;
54
}
55
}
56
- }
57
this.fields.push( newField );
58
},
59
after_show:function()
@@ -70,24 +70,23 @@
70
{
71
// Assign the parent
72
items[ fieldsIndex[ me.fields[ i ] ] ][ 'parent' ] = me.name;
73
-
74
var f = $( '.' + me.fields[ i ] );
75
if( f.length )
76
{
77
f.detach().appendTo( e );
78
tmp.push( me.fields[ i ] );
79
}
80
- }
81
}
82
me.fields = tmp;
83
-
84
- e.sortable(
85
{
86
'connectWith': '.ui-sortable',
87
'items': '.fields',
88
'placeholder': 'ui-state-highlight',
89
'tolerance': 'pointer',
90
- 'cursorAt': { 'top': 5, 'left': 5 },
91
'update': function( event, ui )
92
{
93
var p = ui.item.parents('.fields');
12
},
13
showShortLabel:function(){ return ''; },
14
showUserhelp:function(){ return ''; },
15
+ showSpecialDataInstance: function()
16
{
17
var columns = [1,2,3,4],
18
cStr = '';
19
for( var i = 0, h = columns.length; i < h; i++ )
20
+ {
21
cStr += '<option value="'+columns[ i ]+'" '+( ( this.columns == columns[ i ] ) ? 'SELECTED' : '' )+'>'+columns[ i ]+' column'+( ( i ) ? 's' : '' )+'</option>';
22
+ }
23
return '<div><label>Columns</label><br /><select name="sColumns" id="sColumns">' + cStr + '</select><div class="clearer"><span class="uh">Shown in columns the fields into the container.</span></div></div>';
24
},
25
remove : function()
28
for( var i = this.fields.length - 1, h = 0; i >= h; i-- )
29
{
30
this.fBuild.removeItem( fieldsIndex[this.fields[ i ]] );
31
+ }
32
},
33
+ duplicateItem: function( currentField, newField )
34
{
35
for( var i = 0, h = this.fields.length; i < h; i++ )
36
{
53
return;
54
}
55
}
56
+ }
57
this.fields.push( newField );
58
},
59
after_show:function()
70
{
71
// Assign the parent
72
items[ fieldsIndex[ me.fields[ i ] ] ][ 'parent' ] = me.name;
73
+
74
var f = $( '.' + me.fields[ i ] );
75
if( f.length )
76
{
77
f.detach().appendTo( e );
78
tmp.push( me.fields[ i ] );
79
}
80
+ }
81
}
82
me.fields = tmp;
83
+
84
+ e.sortable(
85
{
86
'connectWith': '.ui-sortable',
87
'items': '.fields',
88
'placeholder': 'ui-state-highlight',
89
'tolerance': 'pointer',
90
'update': function( event, ui )
91
{
92
var p = ui.item.parents('.fields');
js/fields-admin/fbuilder.fcalculated.js CHANGED
@@ -209,7 +209,7 @@
209
var opt = '<option value=""></option>';
210
for (var k=0;k<items.length;k++)
211
{
212
- if (items[k].name != me.name && items[k].ftype != 'fSectionBreak' && items[k].ftype != 'fPageBreak')
213
{
214
opt += '<option value="'+items[k].name+'" '+( ( items[k].name == v ) ? 'selected="SELECTED"' : '' )+'>'+items[k].name+( ( typeof items[ k ].title != 'undefined' ) ? ' (' + items[ k ].title + ')' : '' ) + '</option>';
215
}
209
var opt = '<option value=""></option>';
210
for (var k=0;k<items.length;k++)
211
{
212
+ if (items[k].name != me.name && items[k].ftype != 'fPageBreak')
213
{
214
opt += '<option value="'+items[k].name+'" '+( ( items[k].name == v ) ? 'selected="SELECTED"' : '' )+'>'+items[k].name+( ( typeof items[ k ].title != 'undefined' ) ? ' (' + items[ k ].title + ')' : '' ) + '</option>';
215
}
js/fields-public/01_fbuilder.ftext.js CHANGED
@@ -21,7 +21,7 @@
21
this.maxlength = $.fbuilder.htmlEncode($.trim(this.maxlength));
22
this.equalTo = $.fbuilder.htmlEncode($.trim(this.equalTo));
23
24
- return '<div class="fields '+this.csslayout+' cff-text-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield"><input id="'+this.name+'" name="'+this.name+'"'+((this.minlength.length) ? ' minlength="'+(this.minlength)+'"' : '')+((this.maxlength.length) ? ' maxlength="'+(this.maxlength)+'"' : '')+((this.equalTo.length) ? ' equalTo="#'+this.equalTo+this.form_identifier+'"':'' )+' class="field '+this.size+((this.required)?" required":"")+'" '+((this.readonly)?'readonly':'')+' type="text" value="'+$.fbuilder.htmlEncode(this.predefined)+'" /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
25
},
26
after_show:function()
27
{
@@ -42,10 +42,11 @@
42
$('#'+this.name).rules('add',{'pattern':this.regExp, messages:{'pattern':this.regExpMssg}});
43
}
44
},
45
- val:function()
46
{
47
var e = $( '[id="' + this.name + '"]:not(.ignore)' );
48
- if( e.length ) return $.fbuilder.parseValStr( e.val() );
49
return 0;
50
}
51
}
21
this.maxlength = $.fbuilder.htmlEncode($.trim(this.maxlength));
22
this.equalTo = $.fbuilder.htmlEncode($.trim(this.equalTo));
23
24
+ return '<div class="fields '+this.csslayout+' '+this.name+' cff-text-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield"><input id="'+this.name+'" name="'+this.name+'"'+((this.minlength.length) ? ' minlength="'+(this.minlength)+'"' : '')+((this.maxlength.length) ? ' maxlength="'+(this.maxlength)+'"' : '')+((this.equalTo.length) ? ' equalTo="#'+this.equalTo+this.form_identifier+'"':'' )+' class="field '+this.size+((this.required)?" required":"")+'" '+((this.readonly)?'readonly':'')+' type="text" value="'+$.fbuilder.htmlEncode(this.predefined)+'" /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
25
},
26
after_show:function()
27
{
42
$('#'+this.name).rules('add',{'pattern':this.regExp, messages:{'pattern':this.regExpMssg}});
43
}
44
},
45
+ val:function(raw)
46
{
47
+ raw = raw || false;
48
var e = $( '[id="' + this.name + '"]:not(.ignore)' );
49
+ if( e.length ) return $.fbuilder.parseValStr( e.val(), raw );
50
return 0;
51
}
52
}
js/fields-public/02_fbuilder.fcurrency.js CHANGED
@@ -14,14 +14,17 @@
14
currencyText:"USD",
15
thousandSeparator:",",
16
centSeparator:".",
17
min:"",
18
max:"",
19
formatDynamically:false,
20
21
getFormattedValue:function( value )
22
{
23
- var ts = this.thousandSeparator,
24
- cs = ((cs = $.trim(this.centSeparator)) !== '') ? cs : '.',
25
v = $.fbuilder.parseVal(value, ts, cs),
26
parts = [],
27
counter = 0,
@@ -48,7 +51,7 @@
48
}
49
else parts[ 1 ] = '00';
50
51
- return this.currencySymbol+sign+parts.join(cs)+this.currencyText;
52
}
53
else
54
{
@@ -57,7 +60,7 @@
57
},
58
show:function()
59
{
60
- return '<div class="fields '+this.csslayout+' cff-currency-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield"><input '+(( this.readonly )? 'readonly' : '' )+' id="'+this.name+'" name="'+this.name+'" class="field cffcurrency '+this.size+((this.required)?" required":"")+'" type="text" value="'+$.fbuilder.htmlEncode( this.getFormattedValue( this.predefined ) )+'" '+( ( !/^\s*#x2F;.test( this.min) ) ? 'min="'+$.fbuilder.parseVal( this.min, this.thousandSeparator, this.centSeparator )+'" ' : '' )+( ( !/^\s*#x2F;.test( this.max) ) ? ' max="'+$.fbuilder.parseVal( this.max, this.thousandSeparator, this.centSeparator )+'" ' : '' )+' /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
61
},
62
after_show:function()
63
{
@@ -82,9 +85,9 @@
82
r;
83
84
e = $.fbuilder['forms'][f[0]].getItem( el.name );
85
- r = new RegExp('^\\s*('+esc(e.currencySymbol)+')?\\s*\\-?\\d+('+esc(e.thousandSeparator)+'\\d{3})*('+e.centSeparator+'\\d+)?\\s*('+esc(e.currencyText)+')?\\s*#x27;,'i');
86
87
- return this.optional(el) || r.test(v) || $.isNumeric(v);
88
},
89
$.validator.messages['currency']
90
);
@@ -107,12 +110,15 @@
107
};
108
}
109
},
110
- val:function()
111
{
112
var e = $( '[id="' + this.name + '"]:not(.ignore)' );
113
if( e.length )
114
{
115
- var v = $.trim( e.val() );
116
117
v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencySymbol), 'g' ), '' )
118
.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencyText), 'g' ), '' );
14
currencyText:"USD",
15
thousandSeparator:",",
16
centSeparator:".",
17
+ noCents: false,
18
min:"",
19
max:"",
20
formatDynamically:false,
21
22
getFormattedValue:function( value )
23
{
24
+ if(value == '') return value;
25
+ var me = this,
26
+ ts = me.thousandSeparator,
27
+ cs = ((cs = $.trim(me.centSeparator)) !== '') ? cs : '.',
28
v = $.fbuilder.parseVal(value, ts, cs),
29
parts = [],
30
counter = 0,
51
}
52
else parts[ 1 ] = '00';
53
54
+ return me.currencySymbol+sign+((me.noCents)?parts[0]:parts.join(cs))+me.currencyText;
55
}
56
else
57
{
60
},
61
show:function()
62
{
63
+ return '<div class="fields '+this.csslayout+' '+this.name+' cff-currency-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield"><input '+(( this.readonly )? 'readonly' : '' )+' id="'+this.name+'" name="'+this.name+'" class="field cffcurrency '+this.size+((this.required)?" required":"")+'" type="text" value="'+$.fbuilder.htmlEncode( (this.formatDynamically) ? this.getFormattedValue( this.predefined ) : this.predefined )+'" '+( ( !/^\s*#x2F;.test( this.min) ) ? 'min="'+$.fbuilder.parseVal( this.min, this.thousandSeparator, this.centSeparator )+'" ' : '' )+( ( !/^\s*#x2F;.test( this.max) ) ? ' max="'+$.fbuilder.parseVal( this.max, this.thousandSeparator, this.centSeparator )+'" ' : '' )+' /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
64
},
65
after_show:function()
66
{
85
r;
86
87
e = $.fbuilder['forms'][f[0]].getItem( el.name );
88
+ r = new RegExp('^\\s*('+esc(e.currencySymbol)+')?\\s*\\-?\\d+('+esc(e.thousandSeparator)+'\\d{3})*'+((e.noCents) ? '': '('+e.centSeparator+'\\d+)?')+'\\s*('+esc(e.currencyText)+')?\\s*#x27;,'i');
89
90
+ return this.optional(el) || r.test(v) || ($.isNumeric(v) && (!e.noCents || v === FLOOR(v)));
91
},
92
$.validator.messages['currency']
93
);
110
};
111
}
112
},
113
+ val:function(raw)
114