Calculated Fields Form - Version 1.0.229

Version Description

  • Fixes an issue with dependencies.
Download this release

Release Info

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

Version 1.0.229

Files changed (164) hide show
  1. README.txt +944 -0
  2. captcha/captcha.php +175 -0
  3. captcha/font-1.ttf +0 -0
  4. captcha/font-2.ttf +0 -0
  5. captcha/font-3.ttf +0 -0
  6. captcha/font-4.ttf +0 -0
  7. changelog.txt +1026 -0
  8. config/cpcff_config.cfg.php +143 -0
  9. cp_calculatedfieldsf_free.php +113 -0
  10. css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png +0 -0
  11. css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png +0 -0
  12. css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
  13. css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png +0 -0
  14. css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
  15. css/cupertino/images/ui-bg_glass_80_eebd4d_1x400.png +0 -0
  16. css/cupertino/images/ui-bg_glass_80_eebd4dc_1x400.png +0 -0
  17. css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png +0 -0
  18. css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png +0 -0
  19. css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png +0 -0
  20. css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png +0 -0
  21. css/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
  22. css/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
  23. css/cupertino/images/ui-icons_3d80b3_256x240.png +0 -0
  24. css/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
  25. css/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
  26. css/cupertino/jquery-ui-1.8.20.custom.css +565 -0
  27. css/style.css +173 -0
  28. css/stylepublic.css +147 -0
  29. images/cp_form.gif +0 -0
  30. images/cp_var.gif +0 -0
  31. images/tooltop.gif +0 -0
  32. inc/cpcff_admin_int.inc.php +663 -0
  33. inc/cpcff_admin_int_list.inc.php +242 -0
  34. inc/cpcff_auxiliary.inc.php +391 -0
  35. inc/cpcff_banner.inc.php +101 -0
  36. inc/cpcff_form.inc.php +361 -0
  37. inc/cpcff_install_uninstall.inc.php +356 -0
  38. inc/cpcff_main.inc.php +896 -0
  39. inc/cpcff_public_int.inc.php +64 -0
  40. inc/cpcff_session.inc.php +176 -0
  41. inc/cpcff_templates.inc.php +151 -0
  42. js/JSMin.php +437 -0
  43. js/cp_calculatedfieldsf_gutenberg.js +144 -0
  44. js/cp_calculatedfieldsf_scripts.js +11 -0
  45. js/fbuilder-loader-admin.php +79 -0
  46. js/fbuilder-loader-public.php +119 -0
  47. js/fbuilder-pro-admin.jquery.js +1108 -0
  48. js/fbuilder-pro-public.jquery.js +479 -0
  49. js/fields-admin/000_category.form.js +5 -0
  50. js/fields-admin/001_category.ds.js +5 -0
  51. js/fields-admin/002_category.complementary.js +5 -0
  52. js/fields-admin/003_category.containers.js +5 -0
  53. js/fields-admin/00_jquery.parse.min.js +6 -0
  54. js/fields-admin/01_fbuilder.ftext.js +57 -0
  55. js/fields-admin/02_fbuilder.fcurrency.js +106 -0
  56. js/fields-admin/02_fbuilder.fnumber.js +63 -0
  57. js/fields-admin/02_fbuilder.fslider.js +66 -0
  58. js/fields-admin/03_fbuilder.femail.js +51 -0
  59. js/fields-admin/04_fbuilder.fdate.js +122 -0
  60. js/fields-admin/05_fbuilder.ftextarea.js +41 -0
  61. js/fields-admin/06_fbuilder.fcheck.js +245 -0
  62. js/fields-admin/07_fbuilder.fradio.js +219 -0
  63. js/fields-admin/08_fbuilder.fdropdown.js +253 -0
  64. js/fields-admin/09_fbuilder.ffile.js +38 -0
  65. js/fields-admin/10_fbuilder.fpassword.js +53 -0
  66. js/fields-admin/11_fbuilder.fphone.js +49 -0
  67. js/fields-admin/12_fbuilder.fcommentarea.js +24 -0
  68. js/fields-admin/13_fbuilder.fhidden.js +33 -0
  69. js/fields-admin/14_fbuilder.fsectionbreak.js +24 -0
  70. js/fields-admin/15_fbuilder.fpagebreak.js +28 -0
  71. js/fields-admin/16_fbuilder.fsummary.js +63 -0
  72. js/fields-admin/28_fbuilder.fcontainer.js +116 -0
  73. js/fields-admin/29_fbuilder.ffieldset.fc.js +38 -0
  74. js/fields-admin/30_fbuilder.fdiv.fc.js +39 -0
  75. js/fields-admin/31_fbuilder.fmedia.js +244 -0
  76. js/fields-admin/32_fbuilder.fbutton.js +57 -0
  77. js/fields-admin/34_fbuilder.fhtml.js +33 -0
  78. js/fields-admin/36_fbuilder.acceptance.js +61 -0
  79. js/fields-admin/fbuilder.fcalculated.js +336 -0
  80. js/fields-public/01_fbuilder.ftext.js +51 -0
  81. js/fields-public/02_fbuilder.fcurrency.js +137 -0
  82. js/fields-public/02_fbuilder.fnumber.js +149 -0
  83. js/fields-public/02_fbuilder.fslider.js +147 -0
  84. js/fields-public/03_fbuilder.femail.js +25 -0
  85. js/fields-public/04_fbuilder.fdate.js +392 -0
  86. js/fields-public/05_fbuilder.ftextarea.js +27 -0
  87. js/fields-public/06_fbuilder.fcheck.js +134 -0
  88. js/fields-public/07_fbuilder.fradio.js +121 -0
  89. js/fields-public/08_fbuilder.fdropdown.js +150 -0
  90. js/fields-public/09_fbuilder.ffile.js +71 -0
  91. js/fields-public/10_fbuilder.fpassword.js +26 -0
  92. js/fields-public/11_fbuilder.fphone.js +85 -0
  93. js/fields-public/12_fbuilder.fcommentarea.js +14 -0
  94. js/fields-public/13_fbuilder.fhidden.js +14 -0
  95. js/fields-public/14_fbuilder.fsectionbreak.js +14 -0
  96. js/fields-public/15_fbuilder.fpagebreak.js +13 -0
  97. js/fields-public/16_fbuilder.fsummary.js +117 -0
  98. js/fields-public/28_fbuilder.fcontainer.js +64 -0
  99. js/fields-public/29_fbuilder.ffieldset.fc.js +23 -0
  100. js/fields-public/30_fbuilder.fdiv.fc.js +22 -0
  101. js/fields-public/31_fbuilder.fmedia.js +101 -0
  102. js/fields-public/32_fbuilder.fbutton.js +81 -0
  103. js/fields-public/34_fbuilder.fhtml.js +13 -0
  104. js/fields-public/36_fbuilder.acceptance.js +61 -0
  105. js/fields-public/fbuilder.fcalculated.js +580 -0
  106. js/fields-public/jquery.ui.touch-punch.min.js +3 -0
  107. js/fields-public/localstorage.js +122 -0
  108. js/jQuery.stringify.js +50 -0
  109. js/jquery.caret.js +55 -0
  110. js/jquery.validate.js +9 -0
  111. js/modules/01_mathematical_logical/admin/module_admin.js +47 -0
  112. js/modules/01_mathematical_logical/public/01_logical.js +65 -0
  113. js/modules/01_mathematical_logical/public/module_public.js +100 -0
  114. js/modules/index.html +0 -0
  115. js/redirect_script.js +7 -0
  116. languages/calculated-fields-form-en_US.mo +0 -0
  117. languages/calculated-fields-form-en_US.po +624 -0
  118. templates/01/bg_top.png +0 -0
  119. templates/01/config.ini +5 -0
  120. templates/01/style.css +71 -0
  121. templates/01/thumbnail.jpg +0 -0
  122. templates/02/config.ini +5 -0
  123. templates/02/style.css +121 -0
  124. templates/02/thumbnail.png +0 -0
  125. templates/03/config.ini +5 -0
  126. templates/03/style.css +75 -0
  127. templates/03/thumbnail.jpg +0 -0
  128. templates/03/top_bg.png +0 -0
  129. templates/04/config.ini +5 -0
  130. templates/04/style.css +49 -0
  131. templates/04/thumbnail.jpg +0 -0
  132. templates/05/config.ini +5 -0
  133. templates/05/form_bg.jpg +0 -0
  134. templates/05/style.css +51 -0
  135. templates/05/thumbnail.png +0 -0
  136. templates/06/config.ini +5 -0
  137. templates/06/style.css +90 -0
  138. templates/06/thumbnail.jpg +0 -0
  139. templates/07/config.ini +6 -0
  140. templates/07/js.js +31 -0
  141. templates/07/style.css +111 -0
  142. templates/07/thumbnail.jpg +0 -0
  143. templates/08/checkbox.png +0 -0
  144. templates/08/checkbox_checked.png +0 -0
  145. templates/08/config.ini +5 -0
  146. templates/08/radio.png +0 -0
  147. templates/08/radio_checked.png +0 -0
  148. templates/08/style.css +199 -0
  149. templates/08/thumbnail.jpg +0 -0
  150. templates/09/config.ini +5 -0
  151. templates/09/style.css +123 -0
  152. templates/09/thumbnail.jpg +0 -0
  153. templates/10/config.ini +5 -0
  154. templates/10/style.css +105 -0
  155. templates/10/thumbnail.jpg +0 -0
  156. templates/11/config.ini +6 -0
  157. templates/11/js.js +20 -0
  158. templates/11/style.css +146 -0
  159. templates/11/thumbnail.jpg +0 -0
  160. templates/12/config.ini +6 -0
  161. templates/12/js.js +11 -0
  162. templates/12/style.css +143 -0
  163. templates/12/thumbnail.jpg +0 -0
  164. templates/12/unite.css +278 -0
README.txt ADDED
@@ -0,0 +1,944 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Calculated Fields Form ===
2
+ 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
10
+
11
+ Calculated Fields Form is a plugin for creating forms with dynamically calculated fields and display the result.
12
+
13
+ == Description ==
14
+
15
+ Calculated Fields Form is for visually:
16
+
17
+ ♦ Creating forms with automatically calculated fields
18
+ ♦ Finance calculators
19
+ ♦ Quote calculators
20
+ ♦ Booking cost calculators
21
+ ♦ Date calculators
22
+ ♦ Health / fitness calculators
23
+ ♦ Form builder for adding input fields on the form
24
+ ♦ Add one or more calculated fields
25
+ ♦ Predefined forms templates
26
+
27
+ With Calculated Fields Form you can create **forms with dynamically calculated fields** to **display the calculated values**.
28
+
29
+ It includes a **form builder** for adding/editing different field types, including one or more **automatically calculated fields** based in the data entered in other fields.
30
+
31
+ Calculated Fields Form can be used for creating both single and complex calculations, for example general calculators, ideal weight calculators, calorie calculators, calculate quotes for hotel booking and rent a car services, calculate quotes for appointments and services, loan & finance calculators, date calculators like pregnancy calculators, etc...
32
+
33
+ = Features: =
34
+
35
+ * Visual **form builder** with multiple fields and form formatting options
36
+ * Any number of **calculated fields** can be added
37
+ * Easy and visual calculator interface
38
+ * The calculator supports both easy and advanced operations, including ternary operators and common Math functions
39
+ * Supports **multiple field types**, like drop-down, checkboxes, radiobuttons, dates, numbers
40
+ * Accept operations with dates (ex: days between two dates)
41
+ * Smart automatic number and prices identification into the field values
42
+ * Supports form separators and comments sections to layout the form in a friendlier way
43
+ * Manage multiple calculated forms
44
+ * Practical "clone" button to duplicate a form
45
+ * Five pre-built practical samples included
46
+ * Multi pages forms supported
47
+ * Conditional rules supported. Useful for creating wizards
48
+ * Intuitive and interactive form builder interface
49
+ * Predefined forms templates
50
+
51
+ = Latest Features Added =
52
+
53
+ * Dependent fields: Fields can be shown/hidden based on other checkboxes, radiobuttons or drop-down selections
54
+ * Dependent fields from calculated values: Fields can be shown/hidden based on the value of a calculated field
55
+ * Throubleshoot area to automatically fix conflicts with other scripts on themes or third party plugins and also for special characters support
56
+ * Multi page calculated forms
57
+ * New validations, fields types and features in the form builder
58
+ * Calculated fields can be hidden fields.
59
+ * Includes new controls to create more versatile forms.
60
+ * Allows to create a cache of the javascript files to increase the website's performance.
61
+ * Allows to disable the forms when the website is visited by search engine spiders and crawlers, increasing the website's speed.
62
+
63
+ There are five samples already included with the installation:
64
+
65
+ 1. Simple Calculator Operations
66
+ 2. Calculation with Dates (bookings with check-in and check-out dates)
67
+ 3. Ideal Weight Calculator
68
+ 4. Pregnancy Calculator
69
+ 5. Lease Calculator
70
+
71
+ You can either "**clone**" those calculated forms to complete your own form or create a new calculated form from scratch for your application.
72
+
73
+ You can **mix text and numbers** into a field. If a field contains a number it will be automatically identified and used for the calculations. In addition to that, the checkboxes, radio buttons and drop-down fields can have separately a visual "text" and a hidden "value" linked to each test: the value will be the one used for the calculation.
74
+
75
+ The dates are also automatically identified and you can apply operations between them, for example, you can calculate the **number of days between two dates** with a simple operation like "date2-date1" or add some number of days or weeks to a date. To display the result as a date again you can use the CDate operator included in the calculator. The samples #2 and #4 are practical samples.
76
+
77
+ The form processing and payment processing aren't included in this version. There are other versions with form processing included and additional features. See the FAQ for more information.
78
+
79
+ The plugin has two additional (commercial) versions: **Premium** and **Developer**, each of them with its own features:
80
+
81
+ = Features in Premium version: =
82
+
83
+ * All features of free version of plugin
84
+ * Submits the form data, and stores the data on database, for future review
85
+ * Allows send notification emails with the data submitted, to the form editor and users
86
+ * Allows charge the calculated field directly through PayPal
87
+ * Allows export and import your forms between different WordPress
88
+ * Allows to display the submitted data in the thanks page
89
+ * Includes a dashboard widget to display the submissions of the last week
90
+ * Allows to store the forms in cache to increase the rendering speed
91
+
92
+ = Features in Developer version: =
93
+
94
+ * All features of free and premium version of plugin
95
+ * Includes new controls that get its information from different datasources (database, CSV file, Post, Taxonomies, and users data)
96
+ * Includes financial operations
97
+ * Includes operations for date times management
98
+ * Includes the "distance" operation, that integrates the plugin with "Google Maps" to get the distance between two addresses
99
+ * Includes a script for saving the submitted data in an external database
100
+ * Includes an add-on to define Server Side Equations.
101
+ * Includes an add-on to integrate the forms with the WooCommerce products.
102
+ * Includes an add-on to integrate the forms with the SalesForce service.
103
+ * Includes an add-on to post the submitted information by the forms to WebHooks URLs, allowing integrate the forms with services like Zapier, or Microsoft Flow. Both services: Zapier and Microsoft Flow, connect services as important and popular as Zoho CRM, Dropbox, Mailchimp, Evernote, Google Drive, Facebook, Twitter, and more than 300 services.
104
+ * Includes an add-on to associate the information submitted with the users on website.
105
+ * Includes the User Registration Form add-on to register new users in the website with the data collected by the form.
106
+ * Includes an add-on to integrate the forms with Google reCAPTCHA, instead the captcha distributed with the plugin.
107
+
108
+ = Features in Platinum version: =
109
+
110
+ * All features of free, premium, and developer versions of the plugin.
111
+ * Includes the Google Analytics add-on to generate reports about the usage of forms, to identify the users actions and behaviors.
112
+ * Includes the PayPal Pro add-on to ask for the credit card details of payers and charge it directly into your website without any redirection through the PayPal website.
113
+ * Includes the Upload Files add-on to integrate the uploaded files in the website library, and add new mime types to WordPress.
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 "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.
119
+ * Includes the "MailChimp" add-on to add new members to the MailChimp Service using the data collected by the form.
120
+ * Includes the "Emma" add-on to add new members to the Emma Service using the data collected by the form.
121
+ * Includes the "Twilio" add-on for sending notification messages (SMS) when the forms are submitted.
122
+ * Includes the "MailPoet" add-on to add new subscribers to the MailPoet's Mailing Lists.
123
+ * Includes the "AffiliateWP" add-on to integrate the forms with the AffiliateWP plugin.
124
+ * Authorize.Net add-on integrate the forms with the Authorize.Net payment gateway.
125
+ * Stripe add-on integrate the forms with the Stripe payment gateway.
126
+ * Skrill Payments Integration provides integration with Skrill Moneybookers payment gateway.
127
+ * TargetPay (iDeal) add-on provides integration with iDeal, the most popular Dutch payment method.
128
+ * Mollie (iDeal) add-on provides integration with iDeal.
129
+ * RedSys / Servired / Sermepa add-on provides a secure interface for accepting credit card payments through most banks in Spain.
130
+ * PayTM add-on provides a secure interface for accepting payments through credit card, debir cards, net banking, wallet and EMI.
131
+ * SagePay add-on provides a secure interface for accepting payments through SagePay.
132
+ * Sage Payment add-on provides a secure interface for accepting payments through a secure SSL checkout system for both bankcard and virtual check transactions.
133
+
134
+ To know the last updates, and tips about the use of the plugin, please visit our blog, press like in our Facebook page, or follow our Twitter:
135
+
136
+ Blog: [http://blog.net-factor.com](http://blog.net-factor.com "Technical blog")
137
+
138
+ Facebook: [https://www.facebook.com/netfactorsl](https://www.facebook.com/netfactorsl "Facebook page")
139
+
140
+ Twitter: [https://twitter.com/netfactorsl](https://twitter.com/netfactorsl "Twitter account")
141
+
142
+ == Other Notes ==
143
+
144
+ This section contains mainly notes about the form builder features that are too long to explain in the main description page.
145
+
146
+ = Conditional Rules =
147
+
148
+ The form fields can be shown or hidden depending of the selection made on checkboxes, radio-buttons, select/drop-down, and calcualted fields.
149
+
150
+ [Description about the use of dependencies](http://cff.dwbooster.com/features/dependant-fields "Description about the use of dependencies")
151
+
152
+ = Predefined value =
153
+
154
+ The fields can have "predefined" or "prefilled" values. There are two possible uses for this:
155
+
156
+ 1- Can be used for pre-filling the form with common values and save time to the end user.
157
+
158
+ 2- Can be used for showing a sample of the data that should be entered in the field. In this case you may want to mark also the checkbox "Hide predefined value on click", this way the value will disappear once the user starts using the field without having to manually delete the placeholder value.
159
+
160
+
161
+ = The "Instructions for User" option =
162
+
163
+ Each field has a settings value labeled "Instructions for User". Use that settings value to put instructions to the end user about filling that field. The instructions will appear in a smaller text immediately below the field in the public website.
164
+
165
+ = Add Css Layout Keywords =
166
+
167
+ This is also explained in the FAQ. The "Add Css Layout Keywords" is a way to apply CSS styles separately for each field. This settings field is available for each form builder field in the admin area. Into that field you can put the name of a CSS class that will be applied to the field.
168
+
169
+ Important: Put only the name of the CSS class into the "Add Css Layout Keywords"; don't put the css styles rules directly there.
170
+
171
+ There are some pre-defined CSS classes to use align two, three or four fields into the same line. The CSS classes are named:
172
+
173
+ column2
174
+ column3
175
+ column4
176
+
177
+ For example if you want to put two fields into the same line then specify for both fields the class name "column2". The above is valid for both the classic fields and the calculated fields.
178
+
179
+ The CSS classes/rules can be placed into the file "wp-content\plugins\calculated-fields-form\css\stylepublic.css" or into your theme CSS files.
180
+
181
+
182
+ = Multi Page Forms =
183
+
184
+ For adding a new page to create multi-page forms just insert the field named "Page Break". Each form's page will be validated separately before going to the next form, however note that the calculations are applied to the whole form every time a field is modified, so a calculated field in other page may be modified even if that page isn't visible.
185
+
186
+
187
+ = Calculated "hidden" Fields =
188
+
189
+ The calculated fields can be "hidden" fields. This way the calculated values of those "hidden" fields won't be displayed in the form. This is useful for using intermediate calculated values or for showing the calculated values only into the email (pro version).
190
+
191
+
192
+ = Equations / formulas Format for Calculated Fields =
193
+
194
+ Here are some sample formulas that can be used as base:
195
+
196
+ * With simple mathematical operations:
197
+
198
+
199
+ `fieldname1 + fieldname2`
200
+
201
+ `fieldname1 * fieldname2`
202
+
203
+ `fieldname1 / fieldname2`
204
+
205
+ `fieldname1 - fieldname2`
206
+
207
+
208
+
209
+ * With multiple fields and fields grouping included:
210
+
211
+
212
+ `fieldname1 * ( fieldname2 + fieldname3 )`
213
+
214
+
215
+
216
+ * Rounded to two decimal digits:
217
+
218
+
219
+ `prec( fieldname2 / fieldname3 , 2)`
220
+
221
+
222
+
223
+ * There is a huge number of equations that can't be recreated with simple mathematical operators, or the operations listed above, requiring "IF" conditions, here is a sample of the formula that can be used in that case:
224
+
225
+ ```
226
+ (function(){
227
+ if(fieldname3 > 100) return fieldname1+fieldname2;
228
+ if(fieldname3 <= 100) return fieldname1*fieldname2;
229
+ })();
230
+ ```
231
+
232
+
233
+ * For complex equations where is required to define blocks of JavaScript code, you should use the following format:
234
+
235
+ `
236
+ (function(){`
237
+ ` var calculatedValue = 0;`
238
+ ` //Your code here`
239
+ ` return calculatedValue;`
240
+ `})();`
241
+
242
+
243
+ .... and note that the **return** value of that function will be the value assigned to the calculated field.
244
+
245
+
246
+ = Functions that can be used for the formulas =
247
+
248
+ In addition to the JavaScript functions, the following functions can be used directly into the formulas:
249
+
250
+ [Description of basic operations](http://cff.dwbooster.com/documentation#mathematical-module "Description of basic operations")
251
+
252
+ In addition to the above, the following operations that are available in the **Developer** and **Platinum** versions of plugin:
253
+
254
+ **Date Time module**
255
+
256
+ [Description of operations in the module Date Time](http://cff.dwbooster.com/documentation#datetime-module "Description of operations in the module Date Time")
257
+
258
+ **Financial Module**
259
+
260
+ [Description of operations in the financial module](http://cff.dwbooster.com/documentation#financial-module "Description of operations in the financial module")
261
+
262
+ **Distance Module**
263
+
264
+ [Description of operations in the distance module](http://cff.dwbooster.com/documentation#distance-module "Description of operations in the distance module")
265
+
266
+ = Fields available in the Calculated Fields Form's form builder =
267
+
268
+ To get the complete list of available fields, please visit the following link: [CLICK HERE](http://cff.dwbooster.com/documentation#common-fields "Available fields")
269
+
270
+ = Create JavaScript variables to be used in the equations, from GET, or POST parameters, SESSION variables, or COOKIES =
271
+
272
+ The icon with the "X" symbol, that appears when editing the contents of pages or posts, inserts a shortcode in the content with the structure:
273
+
274
+ [CP_CALCULATED_FIELDS_VAR name="..."]
275
+
276
+ The ... symbol should be replaced by the parameter or variable name, and will be the same name of the javascript variable. For example: [CP_CALCULATED_FIELDS_VAR name="varname"]
277
+
278
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#javascript-variables "Create JavaScript Variables")
279
+
280
+ = Tips for calculating prices =
281
+
282
+ One of the most frequent uses is for calculating prices. When displaying prices a good you may want to divide the form in two pages, the first one for asking the information needed to calculate the price and in a second page display the calculated field with the price and using the "Instruct. Text" fields for adding the terms, conditions and valid time for the price.
283
+
284
+ Note that you can make the "Instruct. Text" fields dependent from the calculated value, that way you can change the text shown to the user depending of the number shown in the calculated price, since frequently the terms, conditions or offers vary according to the price amount.
285
+
286
+ = Add-Ons - Only available in the Developer and Platinum versions of the plugin =
287
+
288
+ The list of add-ons available in the plugin, appear in the "Add-ons area" of settings page of the plugin. For enabling the add-ons, simply should tick the corresponding checkboxes, and press the "Activate/Deactivate Addons" button.
289
+
290
+ = Server Side Equations add-on - Only available in the Developer and Platinum versions of the plugin =
291
+
292
+ The developer and platinum versions of the plugin include the Server Side Equations add-on, to define the equations with PHP in the server side. The equations are called with AJAX.
293
+
294
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#server-side-equations-addon "Server Side Equations add-on")
295
+
296
+ = WooCommerce add-on - Only available in the Developer and Platinum versions of the plugin =
297
+
298
+ The developer and platinum versions of the plugin include the WooCommerce add-on, to integrate the forms created by the "Calculated Fields Form" with the WooCommerce products.
299
+
300
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#woocommerce-addon "WooCommerce add-on")
301
+
302
+ = SalesForce add-on - Only available in the Developer and Platinum versions of the plugin =
303
+
304
+ The add-on allows create new leads in the SalesForce account with the data submitted by the forms.
305
+
306
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#salesforce-addon "SalesForce add-on")
307
+
308
+ = WebHook add-on - Only available in the Developer and Platinum versions of the plugin =
309
+
310
+ The add-on allows posting the submitted information by the forms to WebHooks URLs. With the WebHook add-on it is possible integrate the forms created by the plugin with services like Zapier, Microsoft Flow, or IFTTT (between others). Services like: Zapier, Microsoft Flow and IFTTT, connect services as important and popular as Zoho CRM, Dropbox, Mailchimp, Evernote, Google Drive, Facebook, Twitter, and more than 300 services [https://zapier.com/zapbook/apps/](https://zapier.com/zapbook/apps/ "Zapier"), [https://flow.microsoft.com/](https://flow.microsoft.com/ "Microsoft Flow"), [https://ifttt.com/discover](https://ifttt.com/discover "IFTTT")
311
+
312
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#webhook-addon "WebHook add-on")
313
+
314
+ = Users Permissions add-on - Only available in the Developer and Platinum versions of the plugin =
315
+
316
+ The add-on allows associate the submitted information with the users on website. Furthermore, the plugin allows define rules to restrict the access to the forms to: only registered users, specific roles, or specific users. The add-on adds a new shortcode to the plugin for listing the information submitted by user (it is possible inserting the new shortcode in the user profile), and assign to the users, permissions for editing the submitted information, or delete an entry. With the add-on it is possible limit the number of submissions to only one by form and user.
317
+
318
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#users-addon "Users add-on")
319
+
320
+ = User Registration Form add-on - Only available in the Developer and Platinum versions of the plugin =
321
+
322
+ The add-on allows to register new website's users with the information collected by the form, even populate metadata required by other plugins.
323
+
324
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#user-registration-form-addon "User Registration Form add-on")
325
+
326
+ = reCAPTCHA add-on - Only available in the Developer and Platinum versions of the plugin =
327
+
328
+ The add-on allows to protect the forms using the Google reCAPTCHA instead of the captcha distributed with the plugin. reCAPTCHA is more visual and intuitive than the traditional captcha.
329
+
330
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#recaptcha-addon "reCAPTCHA add-on")
331
+
332
+ = Google Analytics add-on - Only available in the Platinum version of the plugin =
333
+
334
+ The "Google Analytics" add-on allows to generate usage reports in "Google Analytics" about the interactions of users with the form.
335
+
336
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#google-analytics-addon "Google Analytics add-on")
337
+
338
+ = PayPal Pro add-on - Only available in the Platinum version of the plugin =
339
+
340
+ With PayPal Pro the form can ask for the credit card details and charge it directly into your website without any redirection through the PayPal website. Once the user has filled the form fields and clicks the submit button the payment is processed and the posted data (excluding the credit card related information) is saved into the WordPress database.
341
+
342
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#paypal-pro-addon "PayPal Pro add-on")
343
+
344
+ = Upload Files add-on - Only available in the Platinum version of the plugin =
345
+
346
+ The "Upload Files" add-on allows to add the uploaded files through the forms to the Media Library, and access to them from the pages and posts of website.
347
+
348
+ Furthermore, it allows to include the support of new mime types, than files format supported by default by WordPress.
349
+
350
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#upload-addon "Upload Files add-on")
351
+
352
+ = DropBox Integration add-on - Only available in the Platinum version of the plugin =
353
+
354
+ The "DropBox Integration" add-on allows to copy or move the files uploaded through the forms to a DropBox account.
355
+
356
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#dropbox-addon "DropBox Integration add-on")
357
+
358
+ = ip2location add-on - Only available in the Platinum version of the plugin =
359
+
360
+ The add on integrates the Calculated Fields Form with the ip2location databases to identify additional information of users based on their IP, as: Country, City Name, Coordinates, Weather Station, Time Zone, ZIP Code, etc...
361
+
362
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#ip2location-addon "ip2location add-on")
363
+
364
+ = Google Places add-on - Only available in the Platinum version of the plugin =
365
+
366
+ The "Google Places" add-on allows to integrate the input fields with the Google Places API to autocomplete the addresses entered by the users.
367
+
368
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#google-places-addon "Google Places add-on")
369
+
370
+ = Signature add-on - Only available in the Platinum version of the plugin =
371
+
372
+ The "Signature" add-on converts the selected fields in "Signature" fields, allowing the users to sign with the mouse or directly in the touchscreens.
373
+
374
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#signature-addon "Signature add-on")
375
+
376
+ = WebMerge add-on - Only available in the Platinum version of the plugin =
377
+
378
+ The "WebMerge" add-on integrates the forms with the WebMerge Service, and generate PDF and Office documents at runtime with the information collected by the forms.
379
+
380
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#webmerge-addon "WebMerge add-on")
381
+
382
+ 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")
383
+
384
+ = MailChimp add-on - Only available in the Platinum version of the plugin =
385
+
386
+ Includes the "MailChimp" add-on to integrate the forms with the MailChimp Service to add new members to the lists.
387
+
388
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#mailchimp-addon "MailChimp add-on")
389
+
390
+ = Emma add-on - Only available in the Platinum version of the plugin =
391
+
392
+ Includes the "Emma" add-on to integrate the forms with the Emma Service to add new members to the Emma groups.
393
+
394
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#emma-addon "Emma add-on")
395
+
396
+ = Twilio add-on - Only available in the Platinum version of the plugin =
397
+
398
+ Includes the "Twilio" add-on to integrate the forms with the Twilio Service for sending notification messages (SMS) when the forms are submitted.
399
+
400
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#twilio-addon "Twilio add-on")
401
+
402
+ = MailPoet add-on - Only available in the Platinum version of the plugin =
403
+
404
+ Includes the "MailPoet" add-on to add new subscribers to the MailPoet's Mailing Lists.
405
+
406
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#mailpoet-addon "MailPoet add-on")
407
+
408
+ = AffiliateWP add-on - Only available in the Platinum version of the plugin =
409
+
410
+ Includes the "AffiliateWP" add-on to integrate the forms with the "AffiliateWP" plugin.
411
+
412
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#affiliatewp-addon "AffiliateWP add-on")
413
+
414
+ = Authorize.Net add-on - Only available in the Platinum version of the plugin =
415
+
416
+ The Authorize.net Server Server Integration Method (Authorize.net SIM) is a hosted payment processing solution that handles all of the steps in processing a transaction.
417
+
418
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#authorize-addon "Authorize.Net add-on")
419
+
420
+ = Stripe add-on - Only available in the Platinum version of the plugin =
421
+
422
+ The Stripe Payments addon (www.stripe.com) provides a way to accept all major cards from customers around the world on web.
423
+
424
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#stripe-addon "Stripe add-on")
425
+
426
+ = Skrill Payments Integration add-on - Only available in the Platinum version of the plugin =
427
+
428
+ The Skrill Payments addon provides a secure interface for accepting payments through a secure page. You can accept cards, more than 20 local payment methods and over 80 direct bank transfer connections with a single integration.
429
+
430
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#skrill-addon "Skrill add-on")
431
+
432
+ = TargetPay (iDeal) add-on - Only available in the Platinum version of the plugin =
433
+
434
+ The TargetPay addon provides integration with iDeal, the most popular Dutch payment method. The integration is made via TargetPay: https://www.targetpay.com/info/ideal?setlang=en
435
+
436
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#targetpay-addon "TargetPay iDeal add-on")
437
+
438
+ = Mollie (iDeal) add-on - Only available in the Platinum version of the plugin =
439
+
440
+ The Mollie addon provides integration with iDeal, the most popular Dutch payment method.
441
+
442
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#mollie-addon "Mollie add-on")
443
+
444
+ = RedSys / Servired / Sermepa add-on - Only available in the Platinum version of the plugin =
445
+
446
+ The RedSys / Servired / Sermepa addon provides a secure interface for accepting credit card payments through most banks in Spain (Sabadell, Banco Popular, BBVA, Santander, Bankia, Caixa, Bankinter, etc...)
447
+
448
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#redsys-addon "RedSys / Servired / Sermepa TPV add-on")
449
+
450
+ = PayTM add-on - Only available in the Platinum version of the plugin =
451
+
452
+ The PayTM addon provides a secure interface for accepting payments through credit card, debir cards, net banking, wallet and EMI. With over 100mn Paytm users in India, your customers will love the option to pay with their trusted Paytm Wallet.
453
+
454
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#paytm-addon "PayTM add-on")
455
+
456
+ = SagePay add-on - Only available in the Platinum version of the plugin =
457
+
458
+ The SagePay addon provides a secure interface for accepting payments through SagePay.
459
+
460
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#sagepay-addon "SagePay add-on")
461
+
462
+ = Sage Payment add-on - Only available in the Platinum version of the plugin =
463
+
464
+ The SagePayments addon provides a secure interface for accepting payments through a secure SSL checkout system for both bankcard and virtual check transactions. All authorized and approved transactions will be delivered into your current bankcard and/or virtual check batches viewable within the Virtual Terminal for order processing and settlement.
465
+
466
+ [CLICK HERE for additional information ](http://cff.dwbooster.com/documentation#sagepayment-addon "Sage Payment add-on")
467
+
468
+ == Installation ==
469
+
470
+ To install Calculated Fields Form, follow these steps:
471
+
472
+ 1. Download and unzip the Calculated Fields Form plugin
473
+ 2. Upload the entire calculated-fields-form/ directory to the /wp-content/plugins/ directory
474
+ 3. Activate the Calculated Fields Form plugin through the Plugins menu in WordPress
475
+ 4. Configure the settings at the administration menu >> Settings >> Calculated Fields Form
476
+ 5. To insert the calculated / contact form into some content or post use the icon that will appear when editing contents
477
+
478
+ == Frequently Asked Questions ==
479
+
480
+ = Q: Is the "Calculated Fields Form" plugin compatible with "Autoptimize"? =
481
+
482
+ A: [Yes, both plugins are compatible...](http://cff.dwbooster.com/faq#q214 "Yes, both plugins are compatible...")
483
+
484
+ = Q: Is the "Calculated Fields Form" plugin compatible with "Plugin Organizer"? =
485
+
486
+ A: [Yes, both plugins are compatible...](http://cff.dwbooster.com/faq#q319 "Yes, both plugins are compatible...")
487
+
488
+ = Q: What means each field in the Calculated Fields Form settings area? =
489
+
490
+ A: The Calculated Fields Form's page contains detailed information about each field and customization:
491
+
492
+ http://cff.dwbooster.com/
493
+
494
+ = Q: Where can I publish a calculated fields form? =
495
+
496
+ A: You can publish the forms into pages and posts. The shortcode can be also placed into the template. Other versions of the plugin also allow publishing it as a widget.
497
+
498
+ = Q: Is the form processing an option, for example, to email the form data and calculated results? =
499
+
500
+ A: The form processing isn't available in the version listed on this directory. There are other versions with form processing, email notifications and payment processing. You can check other versions at http://cff.dwbooster.com/
501
+
502
+ = Q: Which calculation operations are included? =
503
+
504
+ A: [Mathematical operations, logical operands and more](http://cff.dwbooster.com/documentation#mathematical-module "Documentation")
505
+
506
+ = Q: How can I round the calculated result to 2 decimal digits? =
507
+
508
+ A: [Uses the "PREC" operation, described here](http://cff.dwbooster.com/documentation#prec "Documentation")
509
+
510
+ = Q: Which are the operations with date values that the plugin allows? =
511
+
512
+ A: [List and description of date/time operations](http://cff.dwbooster.com/documentation#datetime-module "Documentation")
513
+
514
+ = Q: Are there financial operations included in the plugin? =
515
+
516
+ A: [List and description of financial operations](http://cff.dwbooster.com/documentation#financial-module "Documentation")
517
+
518
+ = Q: How to calculate an amortization? =
519
+
520
+ A: The CALCULATEAMORTIZATION is the operation with most complexity in the "Calculated Fields Form" and requires its own section. Please, visit the following link to read a detailed description about the use of CALCULATEAMORTIZATION operation:
521
+
522
+ [How calculate an amortization?](http://cff.dwbooster.com/faq#q219 "FAQ Entry")
523
+
524
+ = Q: Can I create global variables to be used in the equations? =
525
+
526
+ A: [Yes, it is possible create global javascript variables through the shortcode of the form, or with the shortcode: CP_CALCULATED_FIELDS_VAR](http://cff.dwbooster.com/faq#q199 "FAQ Entry")
527
+
528
+ = Q: How to populate the form fields with URL parameters? =
529
+
530
+ A: [Visit the following link for instructions](http://cff.dwbooster.com/faq#q251 "FAQ Entry")
531
+
532
+ = Q: How to use a session variable in the equations? =
533
+
534
+ A: Please, read the answer in the FAQ entry:
535
+ [Click Here](http://cff.dwbooster.com/faq#q268 "FAQ Entry")
536
+
537
+ = Q: How to use cookie variables in the equations? =
538
+
539
+ A: Please, read the answer in the FAQ entry:
540
+ [Click Here](http://cff.dwbooster.com/faq#q269 "FAQ Entry")
541
+
542
+ = Q: How to use a parameter passed by post in the equations? =
543
+
544
+ A: Please, read the answer in the FAQ entry:
545
+ [Click Here](http://cff.dwbooster.com/faq#q270 "FAQ Entry")
546
+
547
+ = Q: How to use a parameter passed by get in the equations? =
548
+
549
+ A: Please, read the answer in the FAQ entry:
550
+ [Click Here](http://cff.dwbooster.com/faq#q271 "FAQ Entry")
551
+
552
+ = Q: If I've inserted multiple shortcodes for a same form in a webpage, each of them defines an additional variable with the same name. How to access, from the equations in the form, to the value of the variable defined in its shortcode? =
553
+
554
+ A: Please, visit the following link to the plugin documentation, and pay attention to the definition of the new variables as a hash of the values:
555
+ [Click Here](http://cff.dwbooster.com/documentation#direct-javascript-vars "Create direct variables")
556
+
557
+ = Q: How to define an initial date in a date field? =
558
+
559
+ A: [Initializing date/time fields](http://cff.dwbooster.com/faq#q220 "FAQ Entry")
560
+
561
+ = Q: How to change the language on datepicker? =
562
+
563
+ A: To use a different language on datepickers will be needed create an additional file and touch some code. Please, visit the following link to read the instructions:
564
+
565
+ [How to change the language on datepicker?](http://cff.dwbooster.com/faq#q221 "FAQ Entry")
566
+
567
+ = Q: How to create relationships between date fields? =
568
+
569
+ A: It is possible define the min date, max date, or select a date dynamically in a date field, depending on the date selected in another date field.
570
+
571
+ [create relationships between date fields](http://cff.dwbooster.com/documentation#relationship-between-date-fields "Documentation")
572
+
573
+ = Q: Is there a way to format the form in a table structure (various fields in the same line) ? =
574
+
575
+ A: [Formatting a form with table structure](http://cff.dwbooster.com/faq#q66 "FAQ Entry")
576
+
577
+ = Q: How to convert a common button in a submit button? =
578
+
579
+ A: To convert a common button in a submit button, simply assigns, as part of the onclick event, the snippet of code:
580
+
581
+ jQuery(this).closest('form').submit();
582
+
583
+ Note: this option is only compatible with the pro and developer versions of the plugin
584
+
585
+ = Q: How to display an image in a checkbox or radio button? =
586
+
587
+ A: [Displaying images in checkboxes and radio buttons](http://cff.dwbooster.com/faq#q222 "FAQ Entry")
588
+
589
+ Additionally, to hide the checkboxes and radio buttons, and use only the images for choices selection, open the "/wp-content/plugins/calculated-fields-form/css/stylepublic.css" file in the text editor your choice, and paste the following styles definition at the end of file's content:
590
+
591
+ #fbuilder input[type="radio"],
592
+ #fbuilder input[type="checkbox"]{display:none !important;}
593
+
594
+ = Q: How to replace the image displayed in a Media Field, in function of choice selected in a radio buttons field? =
595
+
596
+ A: [How to replace the image displayed in a Media Field](http://cff.dwbooster.com/faq#q266 "FAQ Entry")
597
+
598
+ = Q: In which order are "calculated" the fields? =
599
+
600
+ A: [Evaluating the equations](http://cff.dwbooster.com/faq#q79 "FAQ Entry")
601
+
602
+ = Q: Can I link the calculated amount to a PayPal payment form? =
603
+
604
+ A: That feature is available in the pro version that can be acquired at this page http://cff.dwbooster.com/
605
+
606
+ Visit the following link to our technical blog with a detailed description about the integration of PayPal and the forms created with CFF:
607
+ [Calculated Fields Form and PayPal](http://blog.net-factor.com/calculated-fields-form-and-paypal/ "Blog Post")
608
+
609
+ = Q: Non-latin characters aren't being displayed in the calculator form. There is a workaround? =
610
+
611
+ A: [Solution Here](http://cff.dwbooster.com/faq#q225 "utf-8")
612
+
613
+ = Q: The calculated form doesn't appear in the public website. Solution? =
614
+
615
+ A: In the "throubleshoot area" (located below the list of forms in the settings area) change the "Script load method" from "Classic" to "Direct".
616
+
617
+ = Q: How to create multi-page forms? =
618
+
619
+ A: Use the "Page Break" field on the form builder to indicate the new pages on the form.
620
+
621
+ = Q: How to display the selected values in the slider control? =
622
+
623
+ A: [Displaying selected values in slider control](http://cff.dwbooster.com/faq#q228 "FAQ Entry")
624
+
625
+ = Q: How to create new validation rules? =
626
+
627
+ A: [Create new validation rules](http://cff.dwbooster.com/documentation#new-validation-rules "New Validation Rules")
628
+
629
+ = Q: How to display a summary of entered data in the form? =
630
+
631
+ A: Insert a summary control and select the fields to be displayed on summary.
632
+
633
+ = Q: How to highlight the fields in the summary control? =
634
+
635
+ A: [Highlighting fields](http://cff.dwbooster.com/faq#q229 "FAQ Entry")
636
+
637
+ = Q: Can a summary of submitted fields be displayed in the thank you page? =
638
+
639
+ A: [Displaying a summary in the Thank you page](http://cff.dwbooster.com/faq#q230 "FAQ Entry")
640
+
641
+ = Q: How can I apply CSS styles to the form fields? =
642
+
643
+ A: [Applying CSS styles to the form fields](http://cff.dwbooster.com/faq#q82 "FAQ Entry")
644
+
645
+ [Tips and Tricks: Using auxiliary fields](http://blog.net-factor.com/tips-and-tricks-using-instruct-text-as-auxiliary-fields-to-modify-the-forms-appearance/ "Blog Post")
646
+
647
+ = Q: Is possible modify any of predefined templates included with the plugin? =
648
+
649
+ A: [Modifying the predefined templates](http://cff.dwbooster.com/faq#q231 "FAQ Entry")
650
+
651
+ = Q: How to create a new template to use with my forms? =
652
+
653
+ A: [Creating new templates](http://cff.dwbooster.com/documentation#create-template "Documentation")
654
+
655
+ = Q: How to hide the fields on forms? =
656
+
657
+ A: [Hiding the fields in form](http://cff.dwbooster.com/faq#q232 "FAQ Entry")
658
+
659
+ = Q: Why after assign some of class names: column2, column3, or column4, to a group of fields, the field that follow the group is displayed displaced at right? =
660
+
661
+ A: [Inserting a separator field between rows](http://cff.dwbooster.com/faq#q320 "FAQ Entry")
662
+
663
+ = Q: How to create a form with a table structure, when the fields are displayed dynamically using dependencies? =
664
+
665
+ A: [Table structure with dependent fields](http://blog.net-factor.com/tips-for-displaying-the-forms-created-with-the-calculated-fields-form-plugin-with-table-structure-in-dependent-fields/ "Blog Post")
666
+
667
+ = Q: How assign multiple class names to a field? =
668
+
669
+ A: The class names are assigned to the fields through the attribute: "Add Css Layout Keywords". If you need assign multiple class names to a field, you only should enter the class names separated by space characters. For example: myclass1 myclass2
670
+
671
+ = Q: What files can be uploaded through the form? =
672
+
673
+ A: [What files can be uploaded through the form?](http://cff.dwbooster.com/faq#q235 "FAQ Entry")
674
+
675
+ = Q: How can I include the link to the uploaded file into the email message? =
676
+
677
+ A: [Inserting the links to the uploaded files](http://cff.dwbooster.com/faq#q160 "FAQ Entry")
678
+
679
+ = Q: Why the form builder is displaying the error message: "The entered data includes invalid characters..."? =
680
+
681
+ A: Sometimes the users copy the text for the fields labels, and descriptions, from a different platform, for example Excel or MS Word, but the text copied can include invalid characters. The plugin validates the form's structure to avoid this type of errors.
682
+
683
+ = Q: How to use conditional statements in the equations? =
684
+
685
+ A: There are three ways to use conditional statements in the equations:
686
+
687
+ [Visit the following link](http://cff.dwbooster.com/faq#q239 "FAQ Entry")
688
+
689
+ = Q: How could be printed the form only and not the complete page? =
690
+
691
+ A: To print only the form, but not the rest of page, please, follows the instructions in the following link:
692
+
693
+ [Visit the following link to the documentation page](http://cff.dwbooster.com/documentation#print-form "Documentation")
694
+
695
+ = Q: How to disable the dynamic evaluation of the equations, when vary the fields values? =
696
+
697
+ A: To disable the dynamic evaluation of the equations in the form, you only should uncheck the option: "Eval dynamically the equations associated to the calculated fields", from the "Form Settings" tab, of form builder. But, should be inserted a button with "calculate" type, to evaluate the equations with an direct action of users.
698
+
699
+ = Q: I've implemented complex equations, but are not working. What can I do? =
700
+
701
+ A: The plugin tries to optimize the equations to improves forms performance, and reduce the sequence of equations, but if the equations are not working, I suggest to select any of the calculated field in the form, and untick the option: "Optimize Form Equations". If the previous step is not sufficient be sure the equation has been implemented correctly: [Click Here](http://cff.dwbooster.com/documentation#equation-tips "Documentation")
702
+
703
+ = Q: My company has different departments( the sales department, and the support group). Could you send a notification email to a representative of each departments when the form be submitted? =
704
+
705
+ A: Yes, that is possible, you only should enter all emails addresses separated by the comma symbol, through the attribute: "Destination emails", in the form's settings.
706
+
707
+ = Q: Why the users are not receiving the notification emails if was selected the option for send a copy to the user, and selected the email field, from the form's settings? =
708
+
709
+ A: If the users are not receiving the notification emails with submission data, there are different reasons:
710
+
711
+ [Visit the following link](http://cff.dwbooster.com/faq#q241 "FAQ Entry")
712
+
713
+ = Q: How to insert changes of lines in the notification emails, when the HTML format is selected? =
714
+
715
+ A: If you are using the HTML format in the notification emails, you should insert the BR tags for the changes of lines in the emails content:
716
+
717
+ **&lt;BR /&gt;**
718
+
719
+ = Q: How to insert an image in the notification emails? =
720
+
721
+ A: [Inserting images in the notification emails](http://cff.dwbooster.com/faq#q223 "FAQ Entry")
722
+
723
+ = Q: How to send specific fields in the notification emails, and not all form fields? =
724
+
725
+ A: The notification emails can include all fields submitted by the form (&lt;%INFO%&gt;) or specific files (&lt;%fieldname#%&gt;), furthermore, some other special tags. Please, visit the following link to get the complete list of tags to include in the email:
726
+
727
+ [Visit the following link with all available options](http://cff.dwbooster.com/faq#q81 "FAQ Entry")
728
+
729
+ = Q: How to create dependencies between fields in the notification emails, and the thank you pages? =
730
+
731
+ A: [Visit the following link](http://cff.dwbooster.com/faq#q318 "FAQ Entry")
732
+
733
+ = Q: How to include my own javascript files to implement my own operations? =
734
+
735
+ A: [Visit the following link](http://cff.dwbooster.com/faq#q245 "FAQ Entry")
736
+
737
+ = Q: How to calculate the number of words in a text? =
738
+
739
+ A: [Calculating the number of words in a text](http://cff.dwbooster.com/faq#q246 "FAQ Entry")
740
+
741
+ = Q: How to calculate the number of characters in a text, excluding the blank characters? =
742
+
743
+ A: [Calculating the number of characters in a text](http://cff.dwbooster.com/faq#q247 "FAQ Entry")
744
+
745
+ = Q: How to assign a value to a field that is not a calculated field from an equation? =
746
+
747
+ A: To enter a value programmatically to a field, that is not a calculated field, will require to assign custom class names to the fields, and edit any of the equations in your form. Please, visit the following link:
748
+
749
+ [Assigning values to fields from equations](http://cff.dwbooster.com/faq#q248 "FAQ Entry")
750
+
751
+ = Q: How to insert a link in the form? =
752
+
753
+ A: The latest version of plugin includes the "HTML Content" field to insert HTML tags directly on it. Simply insert an "HTML Content" field in the form, and then, enter the tag of the link in the content's attributes. For example, to insert a link to our website, you should enter the following tag:
754
+
755
+ **&lt;a href="http://cff.dwbooster.com"&gt;Visit the website&lt;/a&gt;**
756
+
757
+ = Q: How to define dependencies between fields in the form? =
758
+
759
+ A: Visit the following link with a tutorial about the use of dependencies between fields in the form,
760
+
761
+ [Click Here](http://blog.net-factor.com/how-to-use-dependencies-between-fields-in-the-form/ "Blog Post")
762
+
763
+ = Q: How can be created dependencies with multiple fields? =
764
+
765
+ A: To create dependencies that depend of values of multiple fields, will be needed validate the dependencies rules, and display or hide the fields through an equation. Please, visit the following link:
766
+
767
+ [Defining dependencies](http://cff.dwbooster.com/faq#q250 "FAQ Entry")
768
+
769
+ = Q: How to prevent users vary the values of fields, for paying less than the calculated price? =
770
+
771
+ A: The form settings include the attribute "Base amount" to define the minimum price allowed. So, if an user manipulates the calculated field for paying less, will be applied the number entered in the "Base amount" attribute.
772
+
773
+ = Q: How to use the value of a field in the form, as the name of product submitted to PayPal? =
774
+
775
+ A: Through the attribute: "Paypal product name" in the form's settings, is defined the name of the product to be submitted to PayPal. It is possible to use a fixed text, or the value of a field in the form (for example, suppose that you have a DropDown field, or radio buttons field, to select the product's name), each field has associated a name with the format: fieldname#. For example to use the value of the fieldname1 field, as the product's name, should be entered the text &lt;%fiedname1%&gt; in the "Paypal product name" attribute.
776
+
777
+ = Q: How to allow to the users decide the frequency of payments for recurring payments? =
778
+
779
+ A: Please, read the instructions in the our technical blog.
780
+ [Click Here](http://blog.net-factor.com/published-the-calculated-fields-form-pro-v5-0-21-dev-v5-0-22/ "Blog Post")
781
+
782
+ = Q: How to select a choice in a DropDown field, or Radio Button, based on calculated value? =
783
+
784
+ A: Please, read the answer in the our technical blog:
785
+ [Click Here](http://blog.net-factor.com/how-to-select-a-choice-in-a-dropdown-field-or-radio-button-based-on-calculated-value/ "Blog Post")
786
+
787
+ = Q: How to set the value of a slider control programmatically? =
788
+
789
+ A: Please, read the answer in the plugin's documentation:
790
+ [Click Here](http://cff.dwbooster.com/documentation#assign-slider-value-programmatically "Slider Value")
791
+
792
+ = Q: How to use the URL parameters for filtering the data on "DS" controls? =
793
+
794
+ A: Please, visit the following article in our technical blog:
795
+ [Click Here](http://blog.net-factor.com/filtering-the-information-in-the-ds-controls-with-urls-parameters/ "Blog Post")
796
+
797
+ = Q: In a form with multiple "DS" fields. How to reduce the number of queries to database? =
798
+
799
+ A: In this case the recommendation is to use "RecordSet DS" fields as datasource: [Click Here for instructions](http://cff.dwbooster.com/faq#q321 "Recordset")
800
+
801
+ = Q: How to use the data submitted by a form in another one? =
802
+
803
+ A: Please, read the instructions in the our technical blog.
804
+ [Click Here](http://blog.net-factor.com/how-to-use-the-data-submitted-by-a-form-in-another-one/ "Blog Post")
805
+
806
+ = Q: How to store the data sent on a different database? =
807
+
808
+ A: Please, read the instructions in the our technical blog.
809
+ [Click Here](http://blog.net-factor.com/how-store-data-sent-different-database/ "Blog Post")
810
+
811
+ = Q: How do I integrate forms with WooCommerce products? =
812
+
813
+ [Integrating the forms with WooCommerce products](http://cff.dwbooster.com/faq#q252 "FAQ Entry")
814
+
815
+ = Q: How to customize the fields displayed in the cart page of WooCommerce? =
816
+
817
+ [Customizing the fields in the shopping cart of WooCommerce](http://cff.dwbooster.com/faq#q315 "FAQ Entry")
818
+
819
+ = Q: Why the WooCommerce product is not displaying the "Add to Cart" button? =
820
+
821
+ A: If you have created the form correctly, and associated it to the product, even if you have configured the product to calculate the price with the form, you will need to assign a price to the product, through the attribute: "Regular Price", or WooCommerce won't display the "Add to Cart" button.
822
+
823
+ = Q: What is SalesForce, and how to create new leads from my forms? =
824
+
825
+ A: To get a complete guide about the integration of forms created with the plugin and the SalesForce service, please visit the following link:
826
+ [Click Here](http://blog.net-factor.com/what-is-salesforce-and-how-to-create-new-leads-from-my-forms/ "Blog Post")
827
+
828
+ = Q: How to export the submitted files to DropBox? =
829
+
830
+ A: Please, visits the following link to get a tutorial to integrate the form with the Dropbox service:
831
+ [Click Here](http://cff.dwbooster.com/faq#q272 "FAQ Entry")
832
+
833
+ = Q: How to generate a PDF file with the submitted information, and send it as attachment to the user? =
834
+
835
+ A: Please, visits the following link to get a tutorial:
836
+ [Click Here](http://cff.dwbooster.com/faq#q273 "FAQ Entry")
837
+
838
+ = Q: How to use a file field with multiple selection from Zapier? =
839
+
840
+ A: Please, visits the following link to get the answer to your question:
841
+ [Click Here](http://cff.dwbooster.com/faq#q274 "FAQ Entry")
842
+
843
+ = Q: How turn off the up/down arrows in the number fields? =
844
+
845
+ A: Please, visits the following link to get the answer to your question:
846
+ [Click Here](http://cff.dwbooster.com/faq#q312 "FAQ Entry")
847
+
848
+ = Q: How to protect the form against the attacks of the spam bots? =
849
+
850
+ A: Please, visit the following entry in the FAQ page of the plugin with the instructions to protect the form:
851
+ [Click Here](http://cff.dwbooster.com/faq#q313 "FAQ Entry")
852
+
853
+ = Q: I've an issue with the character encoding in the exported CSV/Excel files? =
854
+
855
+ A: Please, visit the following entry in our technical blog:
856
+ [Click Here](http://blog.net-factor.com/character-encoding-in-exported-csvexcel-files/ "Character encoding in exported CSV/Excel files")
857
+
858
+ == Screenshots ==
859
+
860
+ 1. Calculated forms list
861
+ 2. Inserting a calculated form into a page
862
+ 3. Sample calculated form
863
+ 4. Calculated field settings
864
+ 5. Calculator Form builder
865
+ 6. Editing general fields
866
+ 7. Available designs
867
+ 8. Add-ons section
868
+ 9. WooCommerce add-on
869
+ 10. SalesForce add-on
870
+ 11. WebHook add-on, and its integration with Zapier
871
+
872
+ == Changelog ==
873
+
874
+ = 1.0.229 =
875
+
876
+ * Fixes an issue with dependencies.
877
+
878
+ = 1.0.228 =
879
+
880
+ * Modifies the way that the forms builder is loaded to prevent that uncaugth javascript errors can affect it.
881
+ * 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.
882
+ * 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)
883
+
884
+ = 1.0.227 =
885
+
886
+ * Fixes an issue with the dependencies.
887
+ * Fixes an issue with the filtering conditions in RecordSet fields (Developer and Platinum versions of the plugin).
888
+
889
+ = 1.0.226 =
890
+
891
+ * 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).
892
+ * Includes the form's id and name in the Forms Builder to facilitate identify the form.
893
+ * Allows to configure the form to not capture the users' ip addresses (Professional, Developer and Platinum versions).
894
+ * Fixes an issue accepting .rar files with the Uploads add-on(Platinum version).
895
+ * Allows to select groups by default in the MailChimp add-on(Platinum version).
896
+
897
+ = 1.0.225 =
898
+
899
+ * Fixes an issue in the definition of dependencies in the calculated fields.
900
+
901
+ = 1.0.224 =
902
+
903
+ * Modifies the size of the container fields to improve dragging fields into the containers.
904
+ * Fixes an issue with the validation rules in the non-visible fields (fields into hidden containers).
905
+ * Includes a new special attribute in the form's shortcode (class), to assign class names to the forms.
906
+ * Dissables the submit button when it is pressed to prevent the form be submitted multiple times (Professional, Developer and Platinum versions).
907
+ * Fixes an issue with the Widgets (Professional, Developer and Platinum versions).
908
+ * Fixes an issue checking if the nonce that protects the public form is active or not (Professional, Developer and Platinum versions).
909
+ * Modifies the way that the cp_calculatedfieldsf_insert_in_database.php file is included, to allow include in the $params array the itemnumber, that represents the submission's id (Developer and Platinum versions).
910
+
911
+ = 1.0.223 =
912
+
913
+ * Modifies the default title in the Acceptance control.
914
+
915
+ = 1.0.222 =
916
+
917
+ * Includes the Acceptance (GDPR) control for inserting a required checkbox field in the form for asking the users their consent to store and use the information provided.
918
+
919
+ = 1.0.221 =
920
+
921
+ * Modifies the Next Page and Previous Page buttons to respond to the keys: space and enter, and to be selected with the tab key.
922
+ * Modifies the Checkbox fields to return the original values of the choices selected (without parsing the numbers) when is unticked the attribute for merging the values.
923
+ * Modifies the parseValStr function in the fbuilder-pro-public.jquery.js file.
924
+ * Modifies the Submit button to respond to the keys: space and enter, and to be selected with the tab key (Professional, Developer and Platinum versions of the plugin).
925
+ * Modifies special tag <%fieldname#_urls%> used in the notification emails, and thank you pages, to display each URL in its own line (Professional, Developer and Platinum versions)
926
+ * Displays an error message in the form when the coupon is checkes and it is invalid (Professional, Developer and Platinum versions)
927
+ * Fixes an issue in the link to the forms' events from the dashboard page (Professional, Developer and Platinum versions)
928
+ * Implements the special tags: <%fieldname#_nonblock%><%fieldname#_endnonblock%> to include a block of content if the fieldname# field has not being submitted or it was submitted in blank (Professional, Developer and Platinum versions)
929
+
930
+ = 1.0.220 =
931
+
932
+ * Modifies the dependencies in radio buttons, checkboxes, drop-down fields, containers and calculated fields.
933
+ * Modifies the htmlEncode function in the fbuilder-pro-admin.jquery.js file.
934
+ * Fixes an issue with the changes of lines in the exported CSV files with the submissions (Professional, Developer and Platinum versions)
935
+ * Allow to exlude the attachments from the notification emails (Professional, Developer and Platinum versions)
936
+ * Fixes an issue in the special tag <%fieldname#_urls%> used in the notification emails, and thank you pages (Professional, Developer and Platinum versions)
937
+ * In the WooCommerce add-on includes a new hidden tag named woocommerce_cpcff_product_price with the base price of the WooCommerce product (Developer and Platinum versions)
938
+ * In the MailChimp add-on allows to select the status of new users, between pending and subscribed (Platinum version)
939
+
940
+ == Upgrade Notice ==
941
+
942
+ = 1.0.229 =
943
+
944
+ 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
captcha/captcha.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ PHP Captcha by Codepeople.net
4
+ http://www.codepeople.net
5
+ */
6
+
7
+ if(!defined('WP_DEBUG') || true != WP_DEBUG)
8
+ {
9
+ error_reporting(E_ERROR|E_PARSE);
10
+ }
11
+
12
+ ob_clean();
13
+
14
+ if( class_exists( 'CP_SESSION' ) ) CP_SESSION::session_start();
15
+ elseif( session_id() == '' ) session_start();
16
+
17
+ if (!isset($_GET["ps"])) $_GET["ps"] = '';
18
+
19
+ if( $_GET["hdwtest"] == "sessiontest" )
20
+ {
21
+ if( !isset( $_GET["autocall"] ) || $_GET["autocall"] != 1 )
22
+ {
23
+ if( class_exists( 'CP_SESSION' ) ) CP_SESSION::set_var("tmpvar", "ok");
24
+ else $_SESSION[ "tmpvar" ] = "ok";
25
+ }
26
+ else
27
+ {
28
+ if(
29
+ ( class_exists( 'CP_SESSION' ) && CP_SESSION::get_var("tmpvar") != "ok") ||
30
+ (!class_exists( 'CP_SESSION' ) && empty( $_SESSION[ "tmpvar" ] ) )
31
+ )
32
+ {
33
+ die("Session Error");
34
+ }
35
+ else
36
+ {
37
+ die("Sessions works on your server!");
38
+ }
39
+ }
40
+
41
+ $current_url = ( !empty( $_SERVER[ 'REQUEST_URI' ] ) ) ? $_SERVER[ 'REQUEST_URI' ] : $_SERVER['PATH_INFO'];
42
+ $current_url .= ( ( strpos( $current_url, "?" ) === false ) ? "?" : "&" )."hdwtest=sessiontest&autocall=1";
43
+ header("Location: ".$current_url );
44
+ exit;
45
+ }
46
+
47
+ if ($_GET["width"] == '' || !is_numeric($_GET["width"])) $_GET["width"] = "180";
48
+ if ($_GET["height"] == '' || !is_numeric($_GET["height"])) $_GET["height"] = "60";
49
+ if ($_GET["letter_count"] == ''|| !is_numeric($_GET["letter_count"])) $_GET["letter_count"] = "5";
50
+ if ($_GET["min_size"] == ''|| !is_numeric($_GET["min_size"])) $_GET["min_size"] = "35";
51
+ if ($_GET["max_size"] == ''|| !is_numeric($_GET["max_size"])) $_GET["max_size"] = "45";
52
+ if ($_GET["noise"] == ''|| !is_numeric($_GET["noise"])) $_GET["noise"] = "200";
53
+ if ($_GET["noiselength"] == ''|| !is_numeric($_GET["noiselength"])) $_GET["noiselength"] = "5";
54
+ if ($_GET["bcolor"] == '') $_GET["bcolor"] = "FFFFFF";
55
+ if ($_GET["border"] == '') $_GET["border"] = "000000";
56
+
57
+ //configuration
58
+ $imgX = $_GET["width"];
59
+ $imgY = $_GET["height"];
60
+
61
+ $letter_count = $_GET["letter_count"];
62
+ $min_size = $_GET["min_size"];
63
+ $max_size = $_GET["max_size"];
64
+ $noise = $_GET["noise"];
65
+ $noiselength = $_GET["noiselength"];
66
+ $bcolor = cpcff_decodeColor($_GET["bcolor"]);
67
+ $border = cpcff_decodeColor($_GET["border"]);
68
+
69
+ $noisecolor = 0xcdcdcd;
70
+ $random_noise_color= true;
71
+ $tcolor = cpcff_decodeColor("666666");
72
+ $random_text_color= true;
73
+
74
+
75
+ header("Cache-Control: no-store, no-cache, must-revalidate");
76
+ header("Pragma: no-cache");
77
+
78
+ function cpcff_decodeColor($hexcolor)
79
+ {
80
+ $color = hexdec($hexcolor);
81
+ $c["b"] = $color % 256;
82
+ $color = $color / 256;
83
+ $c["g"] = $color % 256;
84
+ $color = $color / 256;
85
+ $c["r"] = $color % 256;
86
+ return $c;
87
+ }
88
+
89
+ function cpcff_similarColors($c1, $c2)
90
+ {
91
+ return sqrt( pow($c1["r"]-$c2["r"],2) + pow($c1["g"]-$c2["g"],2) + pow($c1["b"]-$c2["b"],2)) < 125;
92
+ }
93
+
94
+ function cpcff_make_seed() {
95
+ list($usec, $sec) = explode(' ', microtime());
96
+ return (float) $sec + ((float) $usec * 100000);
97
+ }
98
+ mt_srand(cpcff_make_seed());
99
+ $randval = mt_rand();
100
+
101
+ $str = "";
102
+ $length = 0;
103
+ for ($i = 0; $i < $letter_count; $i++) {
104
+ $str .= chr(mt_rand(97, 122))." ";
105
+ }
106
+
107
+ if( class_exists( 'CP_SESSION' ) ) CP_SESSION::set_var('rand_code'.$_GET["ps"], str_replace(" ", "", $str));
108
+ else $_SESSION['rand_code'.$_GET["ps"] ] = str_replace(" ", "", $str);
109
+
110
+ $image = imagecreatetruecolor($imgX, $imgY);
111
+ $backgr_col = imagecolorallocate($image, $bcolor["r"],$bcolor["g"],$bcolor["b"]);
112
+ $border_col = imagecolorallocate($image, $border["r"],$border["g"],$border["b"]);
113
+
114
+ if ($random_text_color)
115
+ {
116
+ do
117
+ {
118
+ $selcolor = mt_rand(0,256*256*256);
119
+ } while ( cpcff_similarColors(cpcff_decodeColor($selcolor), $bcolor) );
120
+ $tcolor = cpcff_decodeColor($selcolor);
121
+ }
122
+
123
+ $text_col = imagecolorallocate($image, $tcolor["r"],$tcolor["g"],$tcolor["b"]);
124
+
125
+ imagefilledrectangle($image, 0, 0, $imgX, $imgY, $backgr_col);
126
+ imagerectangle($image, 0, 0, $imgX-1, $imgY-1, $border_col);
127
+ for ($i=0;$i<$noise;$i++)
128
+ {
129
+ if ($random_noise_color)
130
+ $color = mt_rand(0, 256*256*256);
131
+ else
132
+ $color = $noisecolor;
133
+ $x1 = mt_rand(2,$imgX-2);
134
+ $y1 = mt_rand(2,$imgY-2);
135
+ imageline ( $image, $x1, $y1, mt_rand($x1-$noiselength,$x1+$noiselength), mt_rand($y1-$noiselength,$y1+$noiselength), $color);
136
+ }
137
+
138
+ $font = dirname( __FILE__ ) . "/font-1.ttf"; // font
139
+ if ($_GET["font"]) $font = dirname( __FILE__ ) . "/".$_GET["font"];
140
+ $font = str_replace( "\\", "/", $font );
141
+
142
+ $font_size = rand($min_size, $max_size);
143
+
144
+ $angle = rand(-15, 15);
145
+
146
+ if (function_exists("imagettfbbox") && function_exists("imagettftext"))
147
+ {
148
+ $box = imagettfbbox($font_size, $angle, $font, $str);
149
+ $x = (int)($imgX - $box[4]) / 2;
150
+ $y = (int)($imgY - $box[5]) / 2;
151
+ imagettftext($image, $font_size, $angle, $x, $y, $text_col, $font, $str);
152
+ }
153
+ else if (function_exists("imageFtBBox") && function_exists("imageFTText"))
154
+ {
155
+ $box = imageFtBBox($font_size, $angle, $font, $str);
156
+ $x = (int)($imgX - $box[4]) / 2;
157
+ $y = (int)($imgY - $box[5]) / 2;
158
+ imageFTText ($image, $font_size, $angle, $x, $y, $text_col, $font, $str);
159
+ }
160
+ else
161
+ {
162
+ $angle = 0;
163
+ $font = 6;
164
+ $wf = ImageFontWidth(6) * strlen($str);
165
+ $hf = ImageFontHeight(6);
166
+ $x = (int)($imgX - $wf) / 2;
167
+ $y = (int)($imgY - $hf) / 2;
168
+ imagestring ( $image, $font, $x, $y, $str, $text_col);
169
+ }
170
+
171
+ header("Content-type: image/png");
172
+ imagepng($image);
173
+ imagedestroy ($image);
174
+ exit;
175
+ ?>
captcha/font-1.ttf ADDED
Binary file
captcha/font-2.ttf ADDED
Binary file
captcha/font-3.ttf ADDED
Binary file
captcha/font-4.ttf ADDED
Binary file
changelog.txt ADDED
@@ -0,0 +1,1026 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ == Changelog ==
2
+
3
+ = 1.0.229 =
4
+
5
+ * Fixes an issue with dependencies.
6
+
7
+ = 1.0.228 =
8
+
9
+ * Modifies the way that the forms builder is loaded to prevent that uncaugth javascript errors can affect it.
10
+ * 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.
11
+ * 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)
12
+
13
+ = 1.0.227 =
14
+
15
+ * Fixes an issue with the dependencies.
16
+ * Fixes an issue with the filtering conditions in RecordSet fields (Developer and Platinum versions of the plugin).
17
+
18
+ = 1.0.226 =
19
+
20
+ * 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).
21
+ * Includes the form's id and name in the Forms Builder to facilitate identify the form.
22
+ * Allows to configure the form to not capture the users' ip addresses (Professional, Developer and Platinum versions).
23
+ * Fixes an issue accepting .rar files with the Uploads add-on(Platinum version).
24
+ * Allows to select groups by default in the MailChimp add-on(Platinum version).
25
+
26
+ = 1.0.225 =
27
+
28
+ * Fixes an issue in the definition of dependencies in the calculated fields.
29
+
30
+ = 1.0.224 =
31
+
32
+ * Modifies the size of the container fields to improve dragging fields into the containers.
33
+ * Fixes an issue with the validation rules in the non-visible fields (fields into hidden containers).
34
+ * Includes a new special attribute in the form's shortcode (class), to assign class names to the forms.
35
+ * Dissables the submit button when it is pressed to prevent the form be submitted multiple times (Professional, Developer and Platinum versions).
36
+ * Fixes an issue with the Widgets (Professional, Developer and Platinum versions).
37
+ * Fixes an issue checking if the nonce that protects the public form is active or not (Professional, Developer and Platinum versions).
38
+ * Modifies the way that the cp_calculatedfieldsf_insert_in_database.php file is included, to allow include in the $params array the itemnumber, that represents the submission's id (Developer and Platinum versions).
39
+
40
+ = 1.0.223 =
41
+
42
+ * Modifies the default title in the Acceptance control.
43
+
44
+ = 1.0.222 =
45
+
46
+ * Includes the Acceptance (GDPR) control for inserting a required checkbox field in the form for asking the users their consent to store and use the information provided.
47
+
48
+ = 1.0.221 =
49
+
50
+ * Modifies the Next Page and Previous Page buttons to respond to the keys: space and enter, and to be selected with the tab key.
51
+ * Modifies the Checkbox fields to return the original values of the choices selected (without parsing the numbers) when is unticked the attribute for merging the values.
52
+ * Modifies the parseValStr function in the fbuilder-pro-public.jquery.js file.
53
+ * Modifies the Submit button to respond to the keys: space and enter, and to be selected with the tab key (Professional, Developer and Platinum versions of the plugin).
54
+ * Modifies special tag <%fieldname#_urls%> used in the notification emails, and thank you pages, to display each URL in its own line (Professional, Developer and Platinum versions)
55
+ * Displays an error message in the form when the coupon is checkes and it is invalid (Professional, Developer and Platinum versions)
56
+ * Fixes an issue in the link to the forms' events from the dashboard page (Professional, Developer and Platinum versions)
57
+ * Implements the special tags: <%fieldname#_nonblock%><%fieldname#_endnonblock%> to include a block of content if the fieldname# field has not being submitted or it was submitted in blank (Professional, Developer and Platinum versions)
58
+
59
+ = 1.0.220 =
60
+
61
+ * Modifies the dependencies in radio buttons, checkboxes, drop-down fields, containers and calculated fields.
62
+ * Modifies the htmlEncode function in the fbuilder-pro-admin.jquery.js file.
63
+ * Fixes an issue with the changes of lines in the exported CSV files with the submissions (Professional, Developer and Platinum versions)
64
+ * Allow to exlude the attachments from the notification emails (Professional, Developer and Platinum versions)
65
+ * Fixes an issue in the special tags <%fieldname#_urls%> and <%fieldname#_links%> used in the notification emails, and thank you pages (Professional, Developer and Platinum versions)
66
+ * In the WooCommerce add-on includes a new hidden tag named woocommerce_cpcff_product_price with the base price of the WooCommerce product (Developer and Platinum versions)
67
+ * In the MailChimp add-on allows to select the status of new users, between pending and subscribed (Platinum version)
68
+
69
+ = 1.0.219 =
70
+
71
+ * Fixes a conflict with the latest update of the 'Accelerated Mobile Pages' plugin.
72
+
73
+ = 1.0.218 =
74
+
75
+ * Fixes an issue with the loopback requests when are being edited the code of plugins or themes in the WordPress editor.
76
+
77
+ = 1.0.217 =
78
+
79
+ * Includes a new attribute in some fields to convert them in read only.
80
+
81
+ = 1.0.216 =
82
+
83
+ * Fixes an issue with plugin installation in multisite WordPress.
84
+ * Fixes an issue with Radio Button DS and Checkbox DS fields in the Developer and Platinum versions of the plugin.
85
+ * Includes the Server Side Equations Add-On in the Developer and Platinum versions of the plugin.
86
+
87
+ = 1.0.215 =
88
+
89
+ * Modifies the radio button control.
90
+ * In the Developer and Platinum versions of the plugin modifies the access to the CSV files when they are hosted in secure websites.
91
+
92
+ = 1.0.214 =
93
+
94
+ * Fixes an issue in the module that removes the eq_factored attributes fields.
95
+
96
+ = 1.0.213 =
97
+
98
+ * Fixes an issue with the dependencies in the radio buttons fields.
99
+ * Fixes a conflict with the styles of the template 12 and some WordPress themes.
100
+ * Removes the eq_factored attributes (used in previous versions of the plugin) from the calculated fields.
101
+
102
+ = 1.0.212 =
103
+
104
+ * Fixes an issue determining the values of DropDown and DropDown DS fields.
105
+
106
+ = 1.0.211 =
107
+
108
+ * Generates the cached javascript file from the settings page of the plugin.
109
+ * Modifies the DropDown and Checkbox controls to allow return their values as an array (the values of choices selected or ticked) or the sum or concatenation of them.
110
+ * In the Developer and Platinum versions of the plugin were modified the DropDown DS and Checkbox DS controls.
111
+ * In the Developer and Platinum versions of the plugin were modified the operations in the Financial module to return the values without rounding.
112
+ * In the Professional, Developer and Platinum versions of the plugin was included the [CP_CALCULATED_FIELDS_RESULT_LIST] shortcode to display the list of summaries corresponding to a form.
113
+
114
+ = 1.0.210 =
115
+
116
+ * Fixes an issue in the DropDown controls when the multiple choices selection is enabled.
117
+
118
+ = 1.0.209 =
119
+
120
+ * Modifies DropDown control to allow multiple selection and to define the control size (the same behavior was implemented in the DropDown DS control in the Developer and Platinum versions of the plugin).
121
+ * Modifies the Radio Button control to allow tick/untick a choice (the same behavior was implemented in the Radio Button DS control).
122
+ * Modifies the Checkbox control to allow define a maximum number of checkable choices, and the error message if are exceeded the number of ticked choices (the same behavior was implemented in the Checkbox DS control in the Developer and Platinum versions of the plugin).
123
+ * Modifies the promotion banner.
124
+
125
+ = 1.0.208 =
126
+
127
+ * Modifies the copy of the jquery.validate for fixing some conflicts with third party plugins.
128
+
129
+ = 1.0.207 =
130
+
131
+ * Updates the latest version of jquery.validate in the plugin.
132
+ * Improves the validation rules in the "Single Line Text" and "Upload Files" controls.
133
+ * Converts the "type" attribute of email controls into email.
134
+
135
+ = 1.0.206 =
136
+
137
+ * Fixes a minor error, the "cff-radiobutton-field' class had been assigned at level of choices containers, and not at level of field's container as the other controls.
138
+
139
+ = 1.0.205 =
140
+
141
+ * Fixes some warnings when the forms' shortcodes are inserted without the id attributes.
142
+ * The Platinum version includes the Twilio add-on to integrate the forms with the Twilio service and sending notification SMS when the forms are submitted.
143
+
144
+ = 1.0.204 =
145
+
146
+ * Shows the fields' names (fieldname#) as tooltips of the fields inserted in the form (into the forms builder) to identify the fields easily in the equations' development.
147
+ * Includes some modifications in the Template 6.
148
+ * In the Professional, Developer and Platinum versions the plugin shown a message if the email used for registering the copy of the plugin is valid or not.
149
+ * Modifies the Stripe add-on in the Platinum version of the plugin.
150
+
151
+ = 1.0.203 =
152
+
153
+ * Fixes a conflict with Varnish in the free version of the plugin.
154
+ * Fixes an issue scrolling the webpage in the forms with multiple pages, when the pages don't have focusable elements.
155
+ * Modifies the DISTANCE operation in the Developer and Platinum versions.
156
+ * Modifies the following fields: DropDown DS, Checkbox DS, and RadioButton DS, in the Developer and Platinum versions of the plugin, to avoid duplicated choices.
157
+
158
+ = 1.0.202 =
159
+
160
+ * Fixes an issue with the session variables.
161
+ * Modifies the parameters of the cpcff_payment_processed action.
162
+
163
+ = 1.0.201 =
164
+
165
+ * Modifies the DropDown fields to include optgroup tags.
166
+ * Modifies the Date/Time fields.
167
+
168
+ = 1.0.200 =
169
+
170
+ * Improves the integration with the Gutenberg Editor.
171
+
172
+ = 1.0.199 =
173
+
174
+ * Allows the integration with the Gutenberg Editor, the next editor for WordPress (Includes new blocks for inserting the corresponding shortcodes).
175
+ * Replaces the icon for waiting in the AMP pages by a transparent icon.
176
+
177
+ = 1.0.198 =
178
+
179
+ * Removes the !important; declaration from the CSS rule into the pair of tags <style amp-custom></style> to satisfy the AMP rules.
180
+
181
+ = 1.0.197 =
182
+
183
+ * Modifies the redirection of the amp-iframes tags, to increase the speed loading the forms in the AMP pages.
184
+ * For the Developer and Platinum versions of the plugin, modifies the reCAPTCHA add-on.
185
+
186
+ = 1.0.196 =
187
+
188
+ * Fixes an issue editing the URLs of the AMP pages.
189
+ * For the Professional, Developer and Platinum versions of the plugin, the submit button is disabled when pressed, to prevent the form be submitted multiple times.
190
+
191
+ = 1.0.195 =
192
+
193
+ * Modifies the summary control to remove all elements are not part of the fields' labels (as the * symbol for required fields and the date/time format). Furthermore, if the fields' labels were defined with colon symbols at the end, they are removed to prevent the colon symbols be displayed twice in the summary.
194
+ * In the paid versions of the plugin applies the same modifications to the summary displayed in the thank you page and the notification emails.
195
+
196
+ = 1.0.194 =
197
+
198
+ * Draws an AMP restriction with the iframe tags when the URL belongs to the same website.
199
+ * Solves a minor issue determining the public URL of the website.
200
+
201
+ = 1.0.193 =
202
+
203
+ * Fixes a minor issue with the forms in the AMP pages.
204
+
205
+ = 1.0.192 =
206
+
207
+ * Allows scrolling the forms in the AMP pages when are visited from iPhones and iPads.
208
+
209
+ = 1.0.191 =
210
+
211
+ * Fixes an issue with the AMP version of forms.
212
+
213
+ = 1.0.190 =
214
+
215
+ * Allows to display the forms in AMP pages. If the AMP plugin is installed in the website and the form is inserted into an AMP page, it is loaded into a iframe tag to satisfy the AMP requirements.
216
+
217
+ = 1.0.189 =
218
+
219
+ * Allows to start the phone fields with the plus symbol (+) for international numbers.
220
+ * Fixes some notices.
221
+ * Reduces the number of database queries.
222
+ * Optimizes the plugin's code.
223
+
224
+ = 1.0.188 =
225
+
226
+ * Fixes an issue with the forms' preview in some WordPress configurations.
227
+ * The free version of the plugin solves a conflict with Varnish.
228
+ * The Developer and Platinum versions fixes some issues with external datasources.
229
+
230
+ = 1.0.187 =
231
+
232
+ * Fixes an issue formatting dynamically the values on number and currency fields.
233
+ * Modifies the server side scripts that generate the client side scripts to prevent issues with notices and warnings not related with our plugin.
234
+ * Modifies the WebHook add-on (for the Developer and Platinum versions of the plugin) to allow decide if sending the data to the webhook before or after receive the payments confirmations.
235
+ * Modifies the WooCommerce add-on (for the Developer and Platinum versions of the plugin) to allow define the selector of the price's tag in the products pages to update the visual price at runtime.
236
+
237
+ = 1.0.186 =
238
+
239
+ * Fixes an issue with the message after cloning a form.
240
+
241
+ = 1.0.185 =
242
+
243
+ * Fixes an issue with the access to the external links in the submenu of the plugin.
244
+
245
+ = 1.0.184 =
246
+
247
+ * Reduces the number of queries to database.
248
+ * For the Professional version of the plugin, modifies the module to export the forms.
249
+ * For the Developer version of the plugin, modifies the "DS" set of fields, and improves the security of database accesses.
250
+ * For the Platinum version of the plugin, fixes a notice in the MailChimp add-on.
251
+
252
+ = 1.0.183 =
253
+
254
+ * Modifies the database's structure to prevent issues with a wrong character set in the columns.
255
+
256
+ = 1.0.182 =
257
+
258
+ * Improves the access to the plugin's options.
259
+ * Fixes an issue in the CPCFF_FORM class.
260
+ * In the Professional version modifies the module that generates the content of the notification emails and thank you pages, including the special tags: <%subscription_id%> to display the id of subscription for recurrent payments, and the <%couponcode%> to include only the coupon's code without the discount message.
261
+ * In the Developer version fixes an issue in the WooCommerce add-on for displaying the summary of collected data in the shopping cart page and the orders.
262
+ * In the Platinum version fixes some issues in the payment gateway add-ons.
263
+
264
+ = 1.0.181 =
265
+
266
+ * Fixes the URLs to the demo, help, and upgrade pages.
267
+ * Modifies the module for the forms preview.
268
+
269
+ = 1.0.180 =
270
+
271
+ * Reduces the number of database queries.
272
+ * Adds new validation rules in the data received, increasing the security.
273
+ * Improves the performance and the plugin's code.
274
+
275
+ = 1.0.179 =
276
+
277
+ * Includes some changes in the forms' settings.
278
+
279
+ = 1.0.178 =
280
+
281
+ * Allows to insert the forms' shortcodes directly into the Text Widgets on sidebars.
282
+ * Improves the plugin's code and the forms' perfomance.
283
+ * In the Professional, Developer, and Platinum versions of the plugin improves the validation of the uploaded files, and the management of coupons.
284
+
285
+ = 1.0.177 =
286
+
287
+ * Includes the integration with the CP Blocks plugin.
288
+ * Fixes an issue in the Emma add-on distributed with the Platinum version of the plugin.
289
+
290
+ = 1.0.176 =
291
+
292
+ * Modifies the currency fields formatting the entered values always with the decimal places.
293
+ * Optimizes the code to strips the slashes from the submitted values.
294
+ * Fixes some warnings in the script for external data-sources integration in the Developer and Platinum versions of the plugin.
295
+
296
+ = 1.0.175 =
297
+
298
+ * Modifies the module to load the forms' templates, and the module that creates the javascript variables, improving the plugin's perfomance and reducing the number of instructions.
299
+ * Fixes other minor errors.
300
+
301
+ = 1.0.174 =
302
+
303
+ * Improves the Template 8.
304
+ * Improves the appearance of the forms builder in mobiles devices.
305
+ * Fixes other minor errors.
306
+
307
+ = 1.0.173 =
308
+
309
+ * Modifies the radio buttons and checkbox controls.
310
+ * Improves the forms in websites with right-to-left direction.
311
+ * Improves the accessibility of the forms builder in mobiles devices.
312
+ * Solves a conflict between the AdBlocker extension in the browsers, and the Google Analytics add-on.
313
+ * Fixes other minor errors.
314
+
315
+ = 1.0.172 =
316
+
317
+ * Includes the "Enable the browser's persistence" option in the form's settings. This feature persists the data entered by the users locally in their browsers, so, if an user closes the browser's tab, when visit the form again the data would be there. The data persisted are deleted when the form is submitted.
318
+
319
+ = 1.0.171 =
320
+
321
+ * Improves the plugin performance, its code, and the code documentation.
322
+ * Solves some issues in the Signature and Google Place add-ons for the Platinum version.
323
+
324
+ = 1.0.170 =
325
+
326
+ * Includes the CPCFF_MAIN class for controlling and organize the plugin's code (actions and filters).
327
+ * Sends the specific Content-Type header with the scripts of controls.
328
+
329
+ = 1.0.169 =
330
+
331
+ * Modifies the code that parses the JSON strings.
332
+ * Includes the write_logs method for writing the execution errors in the PHP error logs file.
333
+
334
+ = 1.0.168 =
335
+
336
+ * Reduces the number of database queries in the installation and update process.
337
+ * Removes unnecessary constant.
338
+ * Moves the installation code to its own file.
339
+
340
+ = 1.0.167 =
341
+
342
+ * New modifications in the optimization process that reduces the number of database queries, and improves the code.
343
+
344
+ = 1.0.166 =
345
+
346
+ * Increases the size of the "ipaddr" column in the database.
347
+
348
+ = 1.0.165 =
349
+
350
+ * Checks the dependencies associated to the calculated fields, even if the dynamic evaluation of the equations is disabled.
351
+ * Increases the sizes of textarea fields for entering the equations in the calculated fields, and the HTML code in the HTML Content fields.
352
+ * The Professional, Developer, and Platinum versions of the plugin accept the formid attribute in the [cp_calculatedfieldsf_form_result] shortcodes to allow the coexistence of multiple shortcodes for different forms in a same thank you page.
353
+
354
+ = 1.0.164 =
355
+
356
+ * Includes a new option in the "Form Settings" tab to customize the forms' designs.
357
+ * Makes all textareas controls, in the fields properties, vertically resizable to facilitate to enter the data.
358
+ * Allows to expand the controls and properties bars.
359
+ * Modifies the fields' attributes to adjust them to the new dimensions of the properties bar when it is expanded.
360
+
361
+ = 1.0.163 =
362
+
363
+ * Regroup the plugin's code as the first step in the optimization process.
364
+
365
+ = 1.0.162 =
366
+
367
+ * Modifies the javascript code to allow the integration with the CP Blocks plugin.
368
+
369
+ = 1.0.161 =
370
+
371
+ * Removes all unnecessary eval instructions to improves the forms' performance, and increase the security.
372
+
373
+ = 1.0.160 =
374
+
375
+ * Modifies the controls: checkbox, radio buttons, and dropdown to remove a code for compatibility with very outdated versions of the plugin.
376
+ * Removes the JSON class, included only for supporting PHP versions lesser than 5.2.x
377
+
378
+ = 1.0.159 =
379
+
380
+ * Loads the "HTML Content" fields at 100% of the form's width even if the labels are aligned at left or right.
381
+ * Allows to apply automatically the format defined in the numbers fields to the values entered by the users (Similar to the currency fields).
382
+
383
+ = 1.0.158 =
384
+
385
+ * Checks the PHP version before applying some functions that were included in PHP versions higher than v5.2.+
386
+
387
+ = 1.0.157 =
388
+
389
+ * Fixes an issue in the promote banner.
390
+
391
+ = 1.0.156 =
392
+
393
+ * Modifies some styles in the predefined templates.
394
+
395
+ = 1.0.155 =
396
+
397
+ * Modifies the module for accessing the WordPress reviews section.
398
+
399
+ = 1.0.154 =
400
+
401
+ * Fixes an issue in the validation of the number fields for accepting numbers in scientific (exponential) notation.
402
+
403
+ = 1.0.153 =
404
+
405
+ * Modifies the URLs of the admin section.
406
+ * Modifies the parameters of the json_encode function.
407
+
408
+ = 1.0.152 =
409
+
410
+ * Allows collapse/uncollapse the container fields in the administration section.
411
+
412
+ = 1.0.151 =
413
+
414
+ * Modifies the dependencies in the calculated fields.
415
+ * Modifies the module that parses the values.
416
+ * Fixes an issue with the error messages when the fields labels are aligned at left or right.
417
+
418
+ = 1.0.150 =
419
+
420
+ * Modifies the module that parses the values used by the equations.
421
+ * Professional Version: validates the required input fields in the server side.
422
+ * Developer Version: modifies the WooCommerce add-on, making it compatible with WooCommerce 3.x
423
+ * Platinum Version: improves the texts management in the payment gateways add-ons.
424
+
425
+ = 1.0.149 =
426
+
427
+ * Adds a new predefined template.
428
+ * Adds specific class names to the fields, to allow modify their appearance easier.
429
+ * Modifies the submenu options to facilitate the access to the documentation.
430
+
431
+ = 1.0.148 =
432
+
433
+ * Fixes an issue in the CDATE operation for dates before 1/1/1970.
434
+ * Fixes an issue with the placeholder attribute of textarea fields in multi-pages forms.
435
+ * Fixes an issue with the Radio Button DS, and Checkbox DS fields and the validation rule for required fields in multi-pages forms.
436
+
437
+ = 1.0.147 =
438
+
439
+ * Modifies the calculated fields for checking the dependencies the first time the equations are evaluated the first time, even if was not triggered an onchange event.
440
+
441
+ = 1.0.146 =
442
+
443
+ * Modifies the predefined templates and change their titles to make them more coherent.
444
+ * Adds a new template.
445
+ * Modifies the phone and container controls.
446
+
447
+ = 1.0.145 =
448
+
449
+ * Modifies the interface of the forms settings.
450
+
451
+ = 1.0.144 =
452
+
453
+ * Prevents to load some of the plugin's resources by duplicated.
454
+
455
+ = 1.0.142 =
456
+
457
+ * Includes a new hook, an action when a form is deleted: cpcff_delete_form, passing as parameter the form's id
458
+ * Fixes an issue when the user includes a the form's shortcode with the id of an inexistent form, or without any id.
459
+ * Fixes an issue with the sliders on mobiles when the script load method is configured as direct.
460
+
461
+ = 1.0.141 =
462
+
463
+ * Solves a notice message in the process of saving the form's structure in the database (when the form has a specific structure).
464
+ * Includes some little changes in the forms builder.
465
+
466
+ = 1.0.140 =
467
+
468
+ * Modifies the setVal method in the controls: checkboxes, radio buttons, and dropdown.
469
+ * Modifies the module that evaluates the equations to prevent some infinite loops generatedby the users.
470
+ * Homogenizes the events of controls in the administration section.
471
+
472
+ = 1.0.139 =
473
+
474
+ * Modifies the pagination module for scrolling to the beginning of page only if needed.
475
+ * Includes the __ME__ constant for referring in the equations to the value of the calculated field that is being calculated.
476
+
477
+ = 1.0.138 =
478
+
479
+ * Modifies the controls: Checkbox, Radio Buttons, and DropDown to allow the users decide the information to submit (the value or the text of choices selected).
480
+ * Fixes an issue with the ampersand symbols in the default values of fields.
481
+ * Increases the size of database's columns for email addresses(Affects the Professional, Developer, and Platinum versions of the plugin).
482
+ * Modifies the "Users Permissions" add-on to allow filtering by the form's id (Affects the Developer and Platinum versions of the plugin).
483
+
484
+ = 1.0.137 =
485
+
486
+ * Modifies the module that loads the templates.
487
+ * Fixes a warning message, related with the PHP Headers when there are used plugins for managing website's cache.
488
+
489
+ = 1.0.136 =
490
+
491
+ * Fixes an issue with the dependencies and the phones fields.
492
+ * Fixes an issue loading the default values of fields, defined with javascript.
493
+
494
+ = 1.0.135 =
495
+
496
+ * Allows to define validation rules in the Single Line Text fields using regular expressions.
497
+ * Allows to disable the choice selected by default in Radio Buttons and DropDown fields.
498
+ * Modifies the module that loads the forms templates to include the resources only one time in the webpage.
499
+ * Increases the value of the css rule: z-index applied to the datepicker to fixes the overlapping with the error messages.
500
+ * Creates the database tables with UTF-8 as the character encoding, to support Cyrillic characters by default (in the previous versions of the plugin, if the character encoding of website's database is not UTF-8, for supporting Cyrillic characters, would be required modify the character encoding from the troubleshoot section in the settings page of the plugin)
501
+
502
+ = 1.0.134 =
503
+
504
+ * Fixes an issue with the escaped quotes and double quotes.
505
+ * Improves the code for ticking and selecting the choices in radio buttons, checkboxes, and DropDown.
506
+
507
+ = 1.0.133 =
508
+
509
+ * Allows to define and display left and rigth captions for the slider fields.
510
+ * Improves the sessions management.
511
+ * The DropDown DS, Checkbox DS, and Radio Buttons DS fields allow to define the options to select by default.
512
+
513
+ = 1.0.132 =
514
+
515
+ * Includes an alternative method to load the resources required by the forms builder.
516
+
517
+ = 1.0.131 =
518
+
519
+ * Includes a new character encoding option for supporting utf8mb4 characters.
520
+ * Includes new menu options to facilitate the access to the plugin documentation.
521
+
522
+ = 1.0.130 =
523
+
524
+ * Fixes an issue in the styles related with the container controls in the forms builder.
525
+
526
+ = 1.0.129 =
527
+
528
+ * Improves the performance of the forms builder module (More palpable in forms with large number of fields).
529
+
530
+ = 1.0.128 =
531
+
532
+ * Convert single line comments in the javascript code, into multiple lines comments to prevent conflicts with plugins that minify the pages code.
533
+
534
+ = 1.0.127 =
535
+
536
+ * Fixes a vulnerability in the module that modifies the database character encoding. Thank you to the National Cyber Security Centre (NCSC-NL) for detecting and help in correct this vulnerability.
537
+
538
+ = 1.0.126 =
539
+
540
+ * Allows to define the error messages for the invalid files extensions, and files sizes, associated to the File Upload controls, from the form's settings.
541
+
542
+ = 1.0.125 =
543
+
544
+ * Fixes some characters that break the JSON structure of forms.
545
+ * Optimizes the code of controls.
546
+
547
+ = 1.0.124 =
548
+
549
+ * Removes the "BOM" characters from the form's structure.
550
+ * Fixes an issue with the "Upload Files" field when the option of multiple files is selected.
551
+ * Increases the size of some columns in the database for forms with many many fields.
552
+
553
+ = 1.0.123 =
554
+
555
+ * Modifies the management of checkbox values.
556
+
557
+ = 1.0.122 =
558
+
559
+ * Replaces the H1 tags in the forms headers with H2 tags by recommendation of Goolge. The modification includes changes in the predefined templates and the scripts.
560
+ * Has been removed the deprecated parameter "signed_in" from the distance module (integrated with Google Maps) in the versions Developer and Platinum of the plugin.
561
+
562
+ = 1.0.121 =
563
+
564
+ * New changes in the module that manages the sessions and cookies to prevent conflict with other plugins of sessions management.
565
+
566
+ = 1.0.120 =
567
+
568
+ * Modifies the module to get the values of textual controls (single line text, textarea, phone, email, password) solving a coherence issue between numeric and textual fields.
569
+
570
+ = 1.0.119 =
571
+
572
+ * Improves the management of cookies and sessions.
573
+ * Fixes an issue dragging sections separators into containers.
574
+
575
+ = 1.0.118 =
576
+
577
+ * Fixes an issue loading public resources.
578
+
579
+ = 1.0.117 =
580
+
581
+ * Fixes an issue loading admin resources.
582
+
583
+ = 1.0.116 =
584
+
585
+ * Fixes an issue in the module to prevent the use of sessions.
586
+
587
+ = 1.0.115 =
588
+
589
+ * Fixes an issue in the code to remove fields from the form.
590
+ * Prevents the use of session variables.
591
+
592
+ = 1.0.114 =
593
+
594
+ * Fixes an issue in the module to duplicate fields.
595
+
596
+ = 1.0.113 =
597
+
598
+ * Allows hide the date part of the date/time fields.
599
+
600
+ = 1.0.112 =
601
+
602
+ * Modifies the module that encodes the attributes of the fields.
603
+
604
+ = 1.0.111 =
605
+
606
+ * Solves the conflict with Autoptimize
607
+
608
+ = 1.0.110 =
609
+
610
+ * New changes in the validation of the Date/Time controls.
611
+
612
+ = 1.0.109 =
613
+
614
+ * Modifies the Date/Time control to validate the field when the hours or minutes are modified.
615
+ * Uses session variables to identify the resources to load and prevent conflicts with other plugins.
616
+ * Modifies the action of the form to submit the form to the same page.
617
+
618
+ = 1.0.108 =
619
+
620
+ * Replaces the class constructors in the third party code used by the plugin, to the new standard: __construct
621
+
622
+ = 1.0.107 =
623
+
624
+ * Modifies the interface of the forms settings.
625
+ * In forms with multiple pages after pressing the next and previous buttons, the page is scrolled to the top of the form page.
626
+
627
+ = 1.0.106 =
628
+
629
+ * Modifies the date time control.
630
+ * Validates the form's structure before be stored into database to prevent saving corrupted data.
631
+ * Escapes the values of the fields' attributes.
632
+
633
+ = 1.0.105 =
634
+
635
+ * Closes dynamically the tooltips in mobiles devices after a timeout.
636
+ * Scroll the browser to the first focusable field, after pressing the buttons: "next page" and "previous page", to solve an issue with iPhones mobiles.
637
+ * Allows modify the messages for the errors: "Equal To", "Min length/characters", and "Max length/characters"
638
+
639
+ = 1.0.104 =
640
+
641
+ * Modifies some of the predefined templates.
642
+ * Fixes a possible conflict between the tooltips styles, and the themes.
643
+
644
+ = 1.0.103 =
645
+
646
+ * The feature: optimize equations, is not needed after the last improvements, the current version removes this option.
647
+
648
+ = 1.0.102 =
649
+
650
+ * New change in the Date/Time fields.
651
+
652
+ = 1.0.101 =
653
+
654
+ * Corrects an issue with the Date/Time Fields.
655
+
656
+ = 1.0.100 =
657
+
658
+ * Corrects an issue in the Containers and Phone fields.
659
+
660
+ = 1.0.99 =
661
+
662
+ * Optimizes the dependencies with containers fields.
663
+
664
+ = 1.0.98 =
665
+
666
+ * Optimizes the equations and dependencies. Corrects some issues in the templates: "Clean Design" and "Minimalist Form".
667
+
668
+ = 1.0.97 =
669
+
670
+ * New changes in the equations.
671
+
672
+ = 1.0.96 =
673
+
674
+ * Optimizes the equations, and their evaluations.
675
+
676
+ = 1.0.95 =
677
+
678
+ * Allows duplicate container fields (DIV and Fieldset).
679
+
680
+ = 1.0.94 =
681
+
682
+ * Includes some changes in the "Date/Time" fields, and with the type of data in the Equations to allow the use of records.
683
+
684
+ = 1.0.93 =
685
+
686
+ * Sets the focus in the first focusable element of a multi pages form.
687
+
688
+ = 1.0.92 =
689
+
690
+ * Remove all unnecessary fields from the operands list in the equations editor of the Calculated Fields.
691
+
692
+ = 1.0.91 =
693
+
694
+ * Set the attribute: "Script load method" to "Direct" by default, because many of themes in the market are not prepared for jQuery 1.12.3, and are generating syntax errors in the websites.
695
+
696
+ = 1.0.90 =
697
+
698
+ * Corrects an issue with the dragging and dropping of fields into the form.
699
+ * Corrects an issue with different levels of dependencies between fields.
700
+
701
+ = 1.0.89 =
702
+
703
+ * Partial update to correct some issues, until implementing the definitive solution.
704
+
705
+ = 1.0.88 =
706
+
707
+ * New modifications and optimizations.
708
+
709
+ = 1.0.87 =
710
+
711
+ * New modification in the dependency between fields.
712
+
713
+ = 1.0.86 =
714
+
715
+ * Corrects an issue in the fields dependencies.
716
+
717
+ = 1.0.85 =
718
+
719
+ * Modifies the code in the CAPTCHA script, used for checking the sessions variables.
720
+
721
+ = 1.0.84 =
722
+
723
+ * Modifies the behavior of the slider control.
724
+
725
+ = 1.0.83 =
726
+
727
+ * Prevents the insertion of javascript code through the shortcode (thanks to i0-sec).
728
+
729
+ = 1.0.82 =
730
+
731
+ * Prevents to access to the Cookies classified as "httponly", through the shortcode: [CP_CALCULATED_FIELDS_VAR] (thanks to i0-sec).
732
+
733
+ = 1.0.81 =
734
+
735
+ * Modifies part of generated HTML to satisfy the standard.
736
+
737
+ = 1.0.80 =
738
+
739
+ * Prevents a possible conflict with other plugins that use jQuery Stringify.
740
+
741
+ = 1.0.79 =
742
+
743
+ * Modifies the Radio Button and Checkbox controls.
744
+
745
+ = 1.0.78 =
746
+
747
+ * Creates a new variable based on the additional attributes defined through the form shortcode, and allows to use a new constant in the equations, the form_identifier, with the value of the "cp_calculatedfieldsf_pform_psequence" tag, to identify each instance of the form in the same webpage.
748
+
749
+ = 1.0.77 =
750
+
751
+ * Allows to assign custom class names to the hidden fields.
752
+ * Modifies the CAPTCHA module, to fix a conflict with the backslash symbols in the files paths on Windows Servers, and some PHP functions as the imagettftext.
753
+
754
+ = 1.0.76 =
755
+ * Includes two new operations: The greatest common divisor between two numbers, and the logarithm of "number A" base "number B".
756
+ * The Distance module, in the Developer version of the plugin, includes the TRAVELTIME operation to get the time of traveling between two places.
757
+ * The Financial module, in the developer version of the plugin, includes the operations: IPMT, PPMT, PVIF, FVIFA, XNPV, and XIRR
758
+
759
+ = 1.0.75 =
760
+ * Fixes an issue with the position of error messages.
761
+
762
+ = 1.0.74 =
763
+ * Now it is possible to define ranges of invalid dates for date fields.
764
+ * The Upload Files control, displays the list of selected files, whether the multiple selection is enabled.
765
+ * Improves the validation rules in Upload Files control.
766
+ * Fixes the position of validation messages, to prevent overlapping with the controls.
767
+
768
+ = 1.0.73 =
769
+ * Simple update to increase the spaces between radio buttons and checkboxes distributed side by side.
770
+
771
+ = 1.0.72 =
772
+ * Modifies the loading of CSS files to fix an issue with multiple forms in a same page but with different templates.
773
+
774
+ = 1.0.71 =
775
+ * Removes the duplicate LINK tags in the public forms.
776
+ * The developer version includes improves the performance of DS fields, and includes a "Currency DS" control.
777
+
778
+ = 1.0.70 =
779
+ * Modifies the labels on Radio and Checkboxes fields.
780
+
781
+ = 1.0.69 =
782
+ * Modifies the labels on Radio and Checkboxes fields.
783
+
784
+ = 1.0.68 =
785
+ * Modifies the code of some controls to make the execution more consistent.
786
+ * Defines some filters and actions to allow the integration with third party plugins.
787
+ * Adds a new add-on in the developer version of the plugin.
788
+
789
+ = 1.0.67 =
790
+ * Validates the range of years on Date fields to prevent javascript errors.
791
+
792
+ = 1.0.66 =
793
+ * Allows the use of language files.
794
+
795
+ = 1.0.65 =
796
+ * Corrects an issue in the form settings.
797
+
798
+ = 1.0.64 =
799
+ * Modifies the shortcode: [CP_CALCULATED_FIELDS_VAR]
800
+ * Modifies the mode for loading the CSS files in the public website.
801
+
802
+ = 1.0.63 =
803
+ * Prevents an issue caused by the Minify options of "W3 Total Cache".
804
+ * Validates the fields in the "onblur" event.
805
+
806
+ = 1.0.62 =
807
+ * Modifies the summary control to display the caption of Slider controls.
808
+ * Corrects an issue in the reset action of forms with the slider and DateTime controls.
809
+
810
+ = 1.0.61 =
811
+ * Modifies the behavior of the Reset Button field. After reset the form, the dependencies are validated, and the user is redirected to the first page, if the button is inserted in a multi-page form.
812
+ * Validates the database structure, and displays a warning message if the database has not been updated.
813
+
814
+ = 1.0.60 =
815
+ * Corrects an issue in the radio buttons values.
816
+
817
+ = 1.0.59 =
818
+ * Corrects a conflict with the "Back-Forward Cache" in the Firefox browser.
819
+ * Modifies the values returned by the controls: "Single Line Text", "Radio", and "DropDown", to get more consistent results. In previous versions the plugin extracts the numbers included in the values of fields. In the current version, the values returned are the defined values on fields, or zero if the fields are empties.
820
+ * The add_shortcode functions were moved to the 'init' action.
821
+ * The developer version include the "Distance" module, that integrates the plugin with Google Maps, to get the distance between two addresses.
822
+
823
+ = 1.0.58 =
824
+ * Prevents that the script tags in the forms are modified by the wpautop function of WordPress.
825
+
826
+ = 1.0.57 =
827
+ * Improves the behavior of dependencies. Excluding fields like: section breaks and page breaks from dependencies.
828
+ * Modifies the styles in the predefined layouts.
829
+ * Allows to disable the forms when the website is visited by search engine spiders and crawlers, increasing the website's speed.
830
+ * Corrects an issue parsing the text values on fields.
831
+ * The pro and developer versions allows to store the forms in cache to increase the rendering speed. This feature will be included in the free version after be tested completely in the other versions of the plugin.
832
+ * Moves the checking of database's structure to the plugin activation process.
833
+
834
+ = 1.0.56 =
835
+ * Adds new parameters to the cached files to prevent issues with the browsers cache, after upgrade the plugin.
836
+
837
+ = 1.0.55 =
838
+ * Correct some issues in the optimizing process.
839
+ * Allows to use the HTML fields in dependencies.
840
+ * Modifies some of predefined layouts.
841
+
842
+ = 1.0.54 =
843
+ * Optimizes the plugin's code, reduces the accesses to database, and submits less information.
844
+
845
+ = 1.0.53 =
846
+ * New update for all predefined layouts.
847
+
848
+ = 1.0.52 =
849
+ * Optimize the predefined layouts.
850
+
851
+ = 1.0.51 =
852
+ * Corrects an issue determining the website's URL
853
+
854
+ = 1.0.50 =
855
+ * Corrects the type of input fields used by the "Number" controls. If the format of control is "digits", or if the thousands separator is empty and the decimal symbol is the dot symbol, the input field will use the attribute: type="number", and type="text" in other cases. In input fields with type="number", the mobiles devices activate their numeric keyboards.
856
+ * Modifies the "HTML Content" control, to removes the tags: <style> and <script> from the tags editor of the form's builder, to prevent these tags modify the appearance of the editor page. The tags are included in the public website.
857
+ * Modifies the "Button" control to allow the implementation of complex functions in the onclick event, and inserts the button disabled in the controls editor.
858
+ * Inserts the "File" control disabled in the controls editor.
859
+
860
+ = 1.0.49 =
861
+ * Adds the new control: HTML Content, to add html tags, and javascript code, directly on form.
862
+
863
+ = 1.0.48 =
864
+ * Prevents the insertion of "Page Break" fields into containers fields.
865
+ * Defines the text colors in the errors messages.
866
+
867
+ = 1.0.47 =
868
+ * Optimizes the loading of public resources, javascript and CSS files.
869
+
870
+ = 1.0.46 =
871
+ * Improves the Drag and Drop feature to reordering the fields on form.
872
+ * Replaces the <h2> tags by <h1>, following the WordPress developers suggestions.
873
+ * Uses the class constructors of PHP5
874
+
875
+ = 1.0.45 =
876
+ * Corrects the URLs schemes to guarantee the use of SSL.
877
+
878
+ = 1.0.44 =
879
+ * Fixes an issue parsing numbers.
880
+
881
+ = 1.0.43 =
882
+ * Improves the parsing of numbers to get correct values, even for numbers with invalid formats.
883
+
884
+ = 1.0.42 =
885
+ * Improves the checking of dependencies in the calculated fields.
886
+ * Improves the parsing of configuration files of the predefined templates.
887
+
888
+ = 1.0.41 =
889
+ * Prevents a possible issue generating the javascript files.
890
+
891
+ = 1.0.40 =
892
+ * Modifies the validation rules on Number, Currency, and Date/Time controls.
893
+
894
+ = 1.0.39 =
895
+ * Creates a minified version of the controls code, to increase the loading pages speed.
896
+
897
+ = 1.0.38 =
898
+ * Corrects an issue loading multiple forms in a same page.
899
+
900
+ = 1.0.37 =
901
+ * Corrects an issue with float numbers in the equations.
902
+
903
+ = 1.0.36 =
904
+ * Corrects an issue with float numbers in the equations.
905
+
906
+ = 1.0.35 =
907
+ * Improves the process for optimizing the equations.
908
+
909
+ = 1.0.34 =
910
+ * Adds a new predefined layout to the plugin, and modifies the existent.
911
+
912
+ = 1.0.33 =
913
+ * Corrects the location of the tooltips.
914
+
915
+ = 1.0.32 =
916
+ * Modifies all templates to adjust the slider control.
917
+
918
+ = 1.0.31 =
919
+ * Includes a new predefined Layout.
920
+
921
+ = 1.0.30 =
922
+ * Includes a new predefined Layout.
923
+
924
+ = 1.0.29 =
925
+ * The current update modifies the module for parsing numeric values, using the "." symbol as decimals separator in numbers, if the user leaves empty this attribute.
926
+
927
+ = 1.0.28 =
928
+ * Improves the design of the forms for printing.
929
+
930
+ = 1.0.27 =
931
+ * Corrects an issue with the hidden fields, that are displaying their labels when are inserted into a container field.
932
+
933
+ = 1.0.26 =
934
+ * Includes a new template.
935
+
936
+ = 1.0.25 =
937
+ * Modifies the insertion queries.
938
+
939
+ = 1.0.24 =
940
+ * Includes a validation text, for files bigger than size limit defined.
941
+
942
+ = 1.0.23 =
943
+ * Modifies the fields: summary, hidden, and calculated.
944
+
945
+ = 1.0.22 =
946
+ * Modifies the File fields for accepting multiple files in a same file tag.
947
+ * Includes new features in the Pro and Dev versions of plugin (http://blog.net-factor.com/xK6dJ)
948
+
949
+ = 1.0.21 =
950
+ * Corrects an issue loading the templates.
951
+
952
+ = 1.0.20 =
953
+ * Corrects an issue with the dependencies in the calculated fields, and where calculated fields are the dependent fields too.
954
+ * Sets the focus in the first invalid field, when the validation rules fail.
955
+
956
+ = 1.0.19 =
957
+ * Implements a new icon to insert a shortcode in the contents of pages and posts, to create JavaScript variables from GET, or POST parameters, SESSION variables, or COOKIES.
958
+
959
+ = 1.0.18 =
960
+ * Corrects a PHP notice, for a non initialized variable.
961
+
962
+ = 1.0.17 =
963
+ * Includes the "column" attribute in the container fields (DIV and FIELDSET) to display in columns the fields into the container.
964
+ * Improves the detection of the homepage's URL, for loading the resources.
965
+ * In the paid versions of the plugin, if WordPress uses SMTP for sending emails, then prevents to use the "phpmailer_init" actions.
966
+
967
+ = 1.0.16 =
968
+ * Modifies the validation rules for limiting infinite or NaN values, in numeric results.
969
+
970
+ = 1.0.15 =
971
+ * Modifies the validation rules for accepting textual values in the calculated fields.
972
+
973
+ = 1.0.14 =
974
+ * Hides the labels and the help for users, in the calculated fields configured as hidden from the public page, to prevent these fields are displayed if the calculated fields are dependent of a radio button, checkbox, or dropdown field, and the choice is selected.
975
+
976
+ = 1.0.13 =
977
+ * Modifies the styles associated to the forms.
978
+
979
+ = 1.0.12 =
980
+ * Increases the plugin's security, using the WordPress Nonces mechanism.
981
+ * Allows the installation of the plugin in a WordPress Multisite.
982
+
983
+ = 1.0.11 =
984
+ * Modifies the replacement of numbers in the equations to avoid invalid operations.
985
+ * Modifies the database queries to avoid some potential vulnerabilities.
986
+
987
+ = 1.0.10 =
988
+ * Modifies the slider control for accepting decimal numbers.
989
+
990
+ = 1.0.9 =
991
+ * Corrects some issues with the slider control, and enables the drag and drop feature of the slider in the mobile devices.
992
+
993
+ = 1.0.8 =
994
+ * Improves the behavior, and correct and issue with the following controls: date, checkbox, radio button group, and drop-down
995
+
996
+ = 1.0.7 =
997
+ * The current update add the slider control.
998
+
999
+ = 1.0.6 =
1000
+ * The current update allows to define the time control as 12 or 24 hours.
1001
+
1002
+ = 1.0.5 =
1003
+ * The fields defined as small or medium, are displayed large in small screens.
1004
+ * Corrects a conflict with others of our plugins that use the form builder, when both plugins are inserted in the same page.
1005
+
1006
+ = 1.0.4 =
1007
+ * Modifies the media control to insert multiple images in the same form.
1008
+
1009
+ = 1.0.3 =
1010
+ * Modifies the loading process of the javascript files.
1011
+ * Modifies some styles applied to the forms to improve the appearance of the forms in small screens, like mobiles and tablets.
1012
+
1013
+ = 1.0.2 =
1014
+ * Corrects an issue with the placeholder attribute in the date/time fields
1015
+ * The reset button clears the fields values in the summary fields
1016
+ * Improves the performance of the calculated fields
1017
+
1018
+ = 1.0.1 =
1019
+ * Compatibility issues fixed, faster loading
1020
+ * New configuration settings
1021
+ * Compatible with all the latest WP versions
1022
+ * Fixed tags in WP directory
1023
+
1024
+ = 1.0 =
1025
+ * First version released.
1026
+ * Improved jQuery form builder published
config/cpcff_config.cfg.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Defines the plugin's constants and global variables
4
+ */
5
+
6
+ // Calculated Fields Form constants
7
+ define('CP_CFF_PHPVERSION', phpversion());
8
+ define('CP_SCHEME', ( is_ssl() ) ? 'https://' : 'http://' );
9
+ define('CP_CALCULATEDFIELDSF_DEFAULT_DEFER_SCRIPTS_LOADING', (get_option('CP_CFF_LOAD_SCRIPTS',"1") == "1" ? true : false) );
10
+ define('CP_CALCULATEDFIELDSF_USE_CACHE', 1 );
11
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_use_validation', 'true');
12
+
13
+ // Admin pages
14
+ define('CP_CALCULATED_FIELDS_SETTINGS_PAGE', 'cp_calculated_fields_form');
15
+ define('CP_CALCULATED_FIELDS_SETTINGS_PAGE2', 'cp_calculated_fields_form_sub2');
16
+ define('CP_CALCULATED_FIELDS_SETTINGS_PAGE3', 'cp_calculated_fields_form_sub3');
17
+
18
+ // Default forms
19
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure', '[[{"name":"fieldname2","index":0,"title":"Number","predefined":"5","ftype":"fnumber","userhelp":"","csslayout":"","required":false,"size":"small","min":"","max":"","dformat":"digits","formats":["digits","number"]},{"name":"separator1","index":1,"title":"The field below will show the double of the number above.","userhelp":"","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname1","index":2,"title":"Calculated Value","eq":"fieldname2*2","ftype":"fCalculated","userhelp":"","csslayout":"","predefined":"","required":false,"size":"medium","readonly":true}],[{"title":"Calculated Form","description":"Starting form. Basic calculated fields sample. ","formlayout":"top_aligned"}]]');
20
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure1', '[[{"name":"fieldname5","index":0,"title":"Simple Sum of two numbers","userhelp":"","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname2","index":1,"title":"First Number","userhelp":"","dformat":"number","min":"","max":"","predefined":"3","ftype":"fnumber","csslayout":"","required":false,"size":"small","formats":["digits","number"]},{"name":"fieldname6","index":2,"title":"Second Number","predefined":"2","ftype":"fnumber","userhelp":"","csslayout":"","required":false,"size":"small","min":"","max":"","dformat":"digits","formats":["digits","number"]},{"name":"fieldname4","index":3,"readonly":true,"title":"Sum","predefined":"","userhelp":"Note: Sum of First Number + Second Number","eq":"fieldname2+fieldname6","ftype":"fCalculated","csslayout":"","required":false,"size":"medium"},{"name":"fieldname7","index":4,"title":"Sum of selected fields","userhelp":"","ftype":"fSectionBreak","csslayout":""},{"choices":["Item A: $10","Item B: $20","Item C: $40"],"choiceSelected":[true,true,false],"name":"fieldname8","index":5,"title":"Select/un-select some items","ftype":"fcheck","userhelp":"","csslayout":"","layout":"one_column","required":false},{"name":"fieldname9","index":6,"title":"Sum of selected items","eq":"fieldname8","ftype":"fCalculated","userhelp":"","csslayout":"","predefined":"","required":false,"size":"medium","readonly":false}],[{"title":"Simple Operations","description":"Below you can test two simple and frequent operations.","formlayout":"top_aligned"}]]');
21
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure2', '[[{"name":"fieldname1","index":0,"title":"Check-in","ftype":"fdate","userhelp":"","csslayout":"","predefined":"","size":"medium","required":false,"dformat":"mm/dd/yyyy","showDropdown":false,"dropdownRange":"-10:+10","formats":["mm/dd/yyyy","dd/mm/yyyy"]},{"name":"fieldname2","index":1,"title":"Check-out","ftype":"fdate","userhelp":"","csslayout":"","predefined":"","size":"medium","required":false,"dformat":"mm/dd/yyyy","showDropdown":false,"dropdownRange":"-10:+10","formats":["mm/dd/yyyy","dd/mm/yyyy"]},{"choices":["Parking - $10","Breakfast - $20","Premium Internet Access - $3"],"choiceSelected":[false,false,false],"name":"fieldname3","index":2,"title":"Optional Services","ftype":"fcheck","userhelp":"","csslayout":"","layout":"one_column","required":false,"choicesVal":["10","20","3"]},{"name":"fieldname4","index":3,"title":"","userhelp":"Note: The cost of the optional services are per each night.","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname5","index":4,"title":"Total Cost","eq":"abs(fieldname2-fieldname1) * (fieldname3+50)","userhelp":"The formula is: (checkout - checkin) * (optionals + base rate)<br />Without the optional services the formula would be: (checkout-checkin) * base rate","ftype":"fCalculated","csslayout":"","predefined":"","required":false,"size":"medium","readonly":false}],[{"title":"Calculation with Dates","description":"The form below gives a quote for a stay in a hotel based in the check-in date, check-out date and some optional services. The base rate used is $50 per night.","formlayout":"top_aligned"}]]');
22
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure3', '[[{"name":"fieldname2","index":0,"title":"Height","userhelp":"In centimeters","dformat":"number","min":"30","max":"250","predefined":"180","ftype":"fnumber","csslayout":"","required":false,"size":"small","formats":["digits","number"]},{"choices":["Male","Female"],"name":"fieldname3","index":1,"choiceSelected":"Male","title":"Sex","ftype":"fdropdown","userhelp":"","csslayout":"","size":"medium","required":false},{"name":"fieldname5","index":2,"title":"Ideal Weight","userhelp":"Formula used:<br />Men: (height - 100)*0.90<br />Woman: (height - 100)*0.85","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname4","index":3,"readonly":true,"title":"Ideal Weight","predefined":"","userhelp":"Note: Based in the above data and formula","eq":"(fieldname2-100)*(fieldname3==\'Male\'?0.90:0.85)","ftype":"fCalculated","csslayout":"","required":false,"size":"medium"}],[{"title":"Ideal Weight Calculator","description":"This sample uses a simple formula but with a conditional rule (if male or female). The conditional expression is built using the JavaScript ternary operator. It\'s basically as follows: <em>condition ? value_if_true : value_if_false</em>.","formlayout":"top_aligned"}]]');
23
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure4', '[[{"name":"fieldname1","index":0,"title":"Enter the first day of last menstrual period","ftype":"fdate","userhelp":"","csslayout":"","predefined":"01/01/2013","size":"medium","required":false,"dformat":"mm/dd/yyyy","showDropdown":false,"dropdownRange":"-10:+10","formats":["mm/dd/yyyy","dd/mm/yyyy"]},{"name":"fieldname4","index":1,"title":"","userhelp":"Note: The dates below are approximate calculations. The real date may be slightly different.","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname5","index":2,"title":"Conception Date","eq":"cdate(fieldname1+14)","userhelp":"","ftype":"fCalculated","csslayout":"","predefined":"","required":false,"size":"medium","readonly":false},{"name":"fieldname6","index":3,"title":"Due Date","eq":"cdate(fieldname1+40*7)","ftype":"fCalculated","userhelp":"","csslayout":"","predefined":"","required":false,"size":"medium","readonly":false}],[{"title":"Pregnancy Calculator","description":"The form below calculates the conception date and due date based in the first day of last menstrual period. The calculated values are converted to date again after the calculation.","formlayout":"top_aligned"}]]');
24
+ define('CP_CALCULATEDFIELDSF_DEFAULT_form_structure5', '[[{"name":"fieldname2","index":0,"title":"Loan Amount","userhelp":"","dformat":"number","min":"","max":"","predefined":"20000","ftype":"fnumber","csslayout":"","required":false,"size":"small","formats":["digits","number"]},{"name":"fieldname6","index":1,"title":"Residual Value","userhelp":"","predefined":"10000","ftype":"fnumber","csslayout":"","required":false,"size":"small","min":"","max":"","dformat":"number","formats":["digits","number"]},{"name":"fieldname7","index":2,"predefined":"7.5","title":"Interest Rate %","ftype":"fnumber","userhelp":"","csslayout":"","required":false,"size":"small","min":"","max":"","dformat":"number","formats":["digits","number"]},{"name":"fieldname8","index":3,"title":"Number of Months","dformat":"number","predefined":"36","ftype":"fnumber","userhelp":"","csslayout":"","required":false,"size":"small","min":"","max":"","formats":["digits","number"]},{"name":"fieldname5","index":4,"title":"","userhelp":"Results based in the data entered above:","ftype":"fSectionBreak","csslayout":""},{"name":"fieldname4","index":5,"readonly":true,"title":"Monthly Payment","predefined":"","userhelp":"","eq":"prec((fieldname2*fieldname7/1200*pow(1+fieldname7/1200,fieldname8)-fieldname6*fieldname7/1200)/(pow(1+fieldname7/1200,fieldname8)-1),2)","ftype":"fCalculated","csslayout":"","required":false,"size":"medium","dformat":"number"},{"name":"fieldname9","index":6,"title":"Total Payment","readonly":true,"eq":"prec(fieldname4*fieldname8,2)","ftype":"fCalculated","userhelp":"","csslayout":"","predefined":"","required":false,"size":"medium"},{"name":"fieldname10","index":7,"title":"Interest Amount","eq":"prec(fieldname6+fieldname9-fieldname2,2)","ftype":"fCalculated","userhelp":"","csslayout":"","predefined":"","required":false,"size":"medium","readonly":false}],[{"title":"Lease Calculator","description":"This sample uses a more complex formula for a lease calculator. It includes the \"power\" (pow) and \"precision\" (prec) functions.","formlayout":"top_aligned"}]]');
25
+
26
+ // Email constants
27
+ define('CP_CALCULATEDFIELDSF_DEFAULT_fp_subject', 'Contact from the blog...');
28
+ define('CP_CALCULATEDFIELDSF_DEFAULT_fp_inc_additional_info', 'true');
29
+ define('CP_CALCULATEDFIELDSF_DEFAULT_fp_return_page', CPCFF_AUXILIARY::site_url().'/' );
30
+ define('CP_CALCULATEDFIELDSF_DEFAULT_fp_message', "The following contact message has been sent:\n\n<%INFO%>\n\n");
31
+
32
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cu_enable_copy_to_user', 'true');
33
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cu_user_email_field', '');
34
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cu_subject', 'Confirmation: Message received...');
35
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cu_message', "Thank you for your message. We will reply you as soon as possible.\n\nThis is a copy of the data sent:\n\n<%INFO%>\n\nBest Regards.");
36
+ define('CP_CALCULATEDFIELDSF_DEFAULT_email_format','text');
37
+
38
+ // Captcha constants
39
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_enable_captcha', 'true');
40
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_width', '180');
41
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_height', '60');
42
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_chars', '5');
43
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_font', 'font-1.ttf');
44
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_min_font_size', '25');
45
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_max_font_size', '35');
46
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_noise', '200');
47
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_noise_length', '4');
48
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_background', 'ffffff');
49
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_border', '000000');
50
+ define('CP_CALCULATEDFIELDSF_DEFAULT_cv_text_enter_valid_captcha', 'Please enter a valid captcha code.');
51
+
52
+ // Payments contstants
53
+ define('CP_CALCULATEDFIELDSF_DEFAULT_CURRENCY_SYMBOL','$');
54
+ define('CP_CALCULATEDFIELDSF_GBP_CURRENCY_SYMBOL',chr(163));
55
+ define('CP_CALCULATEDFIELDSF_EUR_CURRENCY_SYMBOL_A','EUR ');
56
+ define('CP_CALCULATEDFIELDSF_EUR_CURRENCY_SYMBOL_B',chr(128));
57
+
58
+ // PayPal constants
59
+ define('CP_CALCULATEDFIELDSF_DEFAULT_ENABLE_PAYPAL', 1);
60
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_MODE', 'production');
61
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT', '0');
62
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_IDENTIFY_PRICES', '0');
63
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_ZERO_PAYMENT', '0');
64
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_EMAIL','put_your@email_here.com');
65
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PRODUCT_NAME','Reservation');
66
+ define('CP_CALCULATEDFIELDSF_DEFAULT_COST','25');
67
+ define('CP_CALCULATEDFIELDSF_DEFAULT_CURRENCY','USD');
68
+ define('CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_LANGUAGE','EN');
69
+
70
+ // Database table names
71
+ global $wpdb;
72
+ define('CP_CALCULATEDFIELDSF_FORMS_TABLE', 'cp_calculated_fields_form_settings');
73
+ define('CP_CALCULATEDFIELDSF_DISCOUNT_CODES_TABLE_NAME_NO_PREFIX', "cp_calculated_fields_form_discount_codes");
74
+ define('CP_CALCULATEDFIELDSF_DISCOUNT_CODES_TABLE_NAME', @$wpdb->prefix ."cp_calculated_fields_form_discount_codes");
75
+ define('CP_CALCULATEDFIELDSF_POSTS_TABLE_NAME_NO_PREFIX', "cp_calculated_fields_form_posts");
76
+ define('CP_CALCULATEDFIELDSF_POSTS_TABLE_NAME', @$wpdb->prefix ."cp_calculated_fields_form_posts");
77
+
78
+ // Default texts constants and global variables
79
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required', 'This field is required.');
80
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email', 'Please enter a valid email address.');
81
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy', 'Please enter a valid date with this format(mm/dd/yyyy)');
82
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy', 'Please enter a valid date with this format(dd/mm/yyyy)');
83
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number', 'Please enter a valid number.');
84
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits', 'Please enter only digits.');
85
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max', 'Please enter a value less than or equal to {0}.');
86
+ define('CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min', 'Please enter a value greater than or equal to {0}.');
87
+
88
+ global $cpcff_default_texts_array;
89
+ $cpcff_default_texts_array = array(
90
+ 'page_of_text' => array(
91
+ 'label' => 'Page X of Y (text)',
92
+ 'text' => 'Page {0} of {0}'
93
+ ),
94
+ 'errors' => array(
95
+ 'maxlength' => array(
96
+ 'label' => '"Max length/characters" text',
97
+ 'text' => 'Please enter no more than {0} characters.'
98
+ ),
99
+ 'minlength' => array(
100
+ 'label' => '"Min length/characters" text',
101
+ 'text' => 'Please enter at least {0} characters.'
102
+ ),
103
+ 'equalTo' => array(
104
+ 'label' => '"Equal to" text',
105
+ 'text' => 'Please enter the same value again.'
106
+ ),
107
+ 'accept' => array(
108
+ 'label' => '"Accept these file extensions" text',
109
+ 'text' => 'Please enter a value with a valid extension.'
110
+ ),
111
+ 'upload_size' => array(
112
+ 'label' => '"Maximun upload size in kB" text',
113
+ 'text' => 'The file you\'ve chosen is too big, maximum is {0} kB.'
114
+ ),
115
+ 'phone' => array(
116
+ 'label' => '"Phone number" text',
117
+ 'text' => 'Invalid phone number.'
118
+ )
119
+ )
120
+ );
121
+
122
+ add_action('init', 'cpcff_init_constants', 1);
123
+ if(!function_exists('cpcff_init_constants'))
124
+ {
125
+ function cpcff_init_constants()
126
+ {
127
+ // User emails
128
+ if(!defined('CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email'))
129
+ {
130
+ $user_id = get_current_user_id();
131
+ define(
132
+ 'CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email',
133
+ ($user_id)?get_the_author_meta('user_email', get_current_user_id()):''
134
+ );
135
+ }
136
+
137
+ if(!defined('CP_CALCULATEDFIELDSF_DEFAULT_fp_destination_emails'))
138
+ {
139
+ define('CP_CALCULATEDFIELDSF_DEFAULT_fp_destination_emails', CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email);
140
+ }
141
+ } // End cpcff_init_constants
142
+ }
143
+ ?>
cp_calculatedfieldsf_free.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
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.229
7
+ Text Domain: calculated-fields-form
8
+ Author: CodePeople
9
+ Author URI: https://cff.dwbooster.com
10
+ License: GPL
11
+ */
12
+
13
+ if(!defined('WP_DEBUG') || true != WP_DEBUG)
14
+ {
15
+ error_reporting(E_ERROR|E_PARSE);
16
+ }
17
+
18
+ require_once 'inc/cpcff_session.inc.php';
19
+ // Start Session
20
+ if( !defined('DOING_AJAX') ) CP_SESSION::session_start();
21
+
22
+ // Defining main constants
23
+ define('CP_CALCULATEDFIELDSF_VERSION', '1.0.229' );
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 ) );
27
+
28
+ require_once 'inc/cpcff_auxiliary.inc.php';
29
+ require_once 'config/cpcff_config.cfg.php';
30
+
31
+ require_once 'inc/cpcff_banner.inc.php';
32
+ require_once 'inc/cpcff_main.inc.php';
33
+
34
+ // Global variables
35
+ CPCFF_MAIN::instance(); // Main plugin's object
36
+
37
+ add_action( 'init', 'cp_calculated_fields_form_check_posted_data', 11 );
38
+
39
+ // functions
40
+ //------------------------------------------
41
+
42
+ function cp_calculated_fields_form_check_posted_data() {
43
+
44
+ global $wpdb;
45
+
46
+ $cpcff_main = CPCFF_MAIN::instance();
47
+
48
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['cp_calculatedfieldsf_post_options'] ) && is_admin() )
49
+ {
50
+ cp_calculatedfieldsf_save_options();
51
+ if(
52
+ isset($_POST['preview']) &&
53
+ isset($_POST['cp_calculatedfieldsf_id'])
54
+ )
55
+ {
56
+ $cpcff_main->form_preview(
57
+ array(
58
+ 'shortcode_atts' => array('id' => @intval($_POST['cp_calculatedfieldsf_id'])),
59
+ 'page_title' => __('Form Preview', 'calculated-fields-form'),
60
+ 'popup' => 1
61
+ )
62
+ );
63
+ }
64
+ return;
65
+ }
66
+ }
67
+
68
+ function cp_calculatedfieldsf_save_options()
69
+ {
70
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
71
+ global $wpdb;
72
+ if (!defined('CP_CALCULATEDFIELDSF_ID'))
73
+ define ('CP_CALCULATEDFIELDSF_ID',$_POST["cp_calculatedfieldsf_id"]);
74
+
75
+ $error_occur = false;
76
+ if( isset( $_POST[ 'form_structure' ] ) )
77
+ {
78
+ // Remove bom characters
79
+ $_POST[ 'form_structure' ] = CPCFF_AUXILIARY::clean_bom($_POST[ 'form_structure' ]);
80
+
81
+ $form_structure_obj = CPCFF_AUXILIARY::json_decode( $_POST[ 'form_structure' ] );
82
+ if( !empty( $form_structure_obj ) )
83
+ {
84
+ global $cpcff_default_texts_array;
85
+ $cpcff_text_array = '';
86
+
87
+ $_POST = CPCFF_AUXILIARY::stripcslashes_recursive($_POST);
88
+ if( isset( $_POST[ 'cpcff_text_array' ] ) ) $_POST['vs_all_texts'] = $_POST[ 'cpcff_text_array' ];
89
+
90
+ $cpcff_main = CPCFF_MAIN::instance();
91
+ if( $cpcff_main->get_form($_POST["cp_calculatedfieldsf_id"])->save_settings($_POST) === false )
92
+ {
93
+ global $cff_structure_error;
94
+ $cff_structure_error = __('<div class="error-text">The data cannot be stored in database because has occurred an error with the database structure. Please, go to the plugins section and Deactivate/Activate the plugin to be sure the structure of database has been checked, and corrected if needed. If the issue persist, please <a href="https://cff.dwbooster.com/contact-us">contact us</a></div>', 'calculated-fields-form' );
95
+ }
96
+ }
97
+ else
98
+ {
99
+ $error_occur = true;
100
+ }
101
+ }
102
+ else
103
+ {
104
+ $error_occur = true;
105
+ }
106
+
107
+ if( $error_occur )
108
+ {
109
+ global $cff_structure_error;
110
+ $cff_structure_error = __('<div class="error-text">The data cannot be stored in database because has occurred an error with the form structure. Please, try to save the data again. If have been copied and pasted data from external text editors, the data can contain invalid characters. If the issue persist, please <a href="https://cff.dwbooster.com/contact-us">contact us</a></div>', 'calculated-fields-form' );
111
+ }
112
+ }
113
+ ?>
css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png ADDED
Binary file
css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png ADDED
Binary file
css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png ADDED
Binary file
css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png ADDED
Binary file
css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png ADDED
Binary file
css/cupertino/images/ui-bg_glass_80_eebd4d_1x400.png ADDED
Binary file
css/cupertino/images/ui-bg_glass_80_eebd4dc_1x400.png ADDED
Binary file
css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png ADDED
Binary file
css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png ADDED
Binary file
css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png ADDED
Binary file
css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png ADDED
Binary file
css/cupertino/images/ui-icons_2694e8_256x240.png ADDED
Binary file
css/cupertino/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
css/cupertino/images/ui-icons_3d80b3_256x240.png ADDED
Binary file
css/cupertino/images/ui-icons_72a7cf_256x240.png ADDED
Binary file
css/cupertino/images/ui-icons_ffffff_256x240.png ADDED
Binary file
css/cupertino/jquery-ui-1.8.20.custom.css ADDED
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI CSS Framework 1.8.20
3
+ *
4
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+
11
+ /* Layout helpers
12
+ ----------------------------------*/
13
+ .ui-helper-hidden { display: none; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17
+ .ui-helper-clearfix:after { clear: both; }
18
+ .ui-helper-clearfix { zoom: 1; }
19
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20
+
21
+
22
+ /* Interaction Cues
23
+ ----------------------------------*/
24
+ .ui-state-disabled { cursor: default !important; }
25
+
26
+
27
+ /* Icons
28
+ ----------------------------------*/
29
+
30
+ /* states and images */
31
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32
+
33
+
34
+ /* Misc visuals
35
+ ----------------------------------*/
36
+
37
+ /* Overlays */
38
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
39
+
40
+
41
+ /*!
42
+ * jQuery UI CSS Framework 1.8.20
43
+ *
44
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
45
+ * Dual licensed under the MIT or GPL Version 2 licenses.
46
+ * http://jquery.org/license
47
+ *
48
+ * http://docs.jquery.com/UI/Theming/API
49
+ *
50
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=deedf7&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=aed0ea&fcHeader=222222&iconColorHeader=72a7cf&bgColorContent=f2f5f7&bgTextureContent=04_highlight_hard.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=362b36&iconColorContent=72a7cf&bgColorDefault=d7ebf9&bgTextureDefault=02_glass.png&bgImgOpacityDefault=80&borderColorDefault=aed0ea&fcDefault=2779aa&iconColorDefault=3d80b3&bgColorHover=e4f1fb&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=74b2e2&fcHover=0070a3&iconColorHover=2694e8&bgColorActive=3baae3&bgTextureActive=02_glass.png&bgImgOpacityActive=50&borderColorActive=2694e8&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=ffef8f&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=25&borderColorHighlight=f9dd34&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=cd0a0a&bgTextureError=01_flat.png&bgImgOpacityError=15&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=eeeeee&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=90&opacityOverlay=80&bgColorShadow=000000&bgTextureShadow=04_highlight_hard.png&bgImgOpacityShadow=70&opacityShadow=30&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px
51
+ */
52
+
53
+
54
+ /* Component containers
55
+ ----------------------------------*/
56
+ .ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
57
+ .ui-widget .ui-widget { font-size: 1em; }
58
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
59
+ .ui-widget-content { border: 1px solid #dddddd; background: #f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; color: #362b36; }
60
+ .ui-widget-content a { color: #362b36; }
61
+ .ui-widget-header { border: 1px solid #aed0ea; background: #deedf7 url(images/ui-bg_highlight-soft_100_deedf7_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
62
+ .ui-widget-header a { color: #222222; }
63
+
64
+ /* Interaction states
65
+ ----------------------------------*/
66
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #aed0ea; background: #d7ebf9 url(images/ui-bg_glass_80_d7ebf9_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2779aa; }
67
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2779aa; text-decoration: none; }
68
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #74b2e2; background: #e4f1fb url(images/ui-bg_glass_100_e4f1fb_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #0070a3; }
69
+ .ui-state-hover a, .ui-state-hover a:hover { color: #0070a3; text-decoration: none; }
70
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #2694e8; background: #3baae3 url(images/ui-bg_glass_50_3baae3_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; }
71
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; }
72
+ .ui-widget :active { outline: none; }
73
+
74
+ /* Interaction Cues
75
+ ----------------------------------*/
76
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #f9dd34; background: #ffef8f url(images/ui-bg_highlight-soft_25_ffef8f_1x100.png) 50% top repeat-x; color: #363636; }
77
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
78
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #cd0a0a url(images/ui-bg_flat_15_cd0a0a_40x100.png) 50% 50% repeat-x; color: #ffffff; }
79
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
80
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
81
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
82
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
83
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
84
+
85
+ /* Icons
86
+ ----------------------------------*/
87
+
88
+ /* states and images */
89
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_72a7cf_256x240.png); }
90
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); }
91
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_72a7cf_256x240.png); }
92
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_3d80b3_256x240.png); }
93
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_2694e8_256x240.png); }
94
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
95
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
96
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
97
+
98
+ /* positioning */
99
+ .ui-icon-carat-1-n { background-position: 0 0; }
100
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
101
+ .ui-icon-carat-1-e { background-position: -32px 0; }
102
+ .ui-icon-carat-1-se { background-position: -48px 0; }
103
+ .ui-icon-carat-1-s { background-position: -64px 0; }
104
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
105
+ .ui-icon-carat-1-w { background-position: -96px 0; }
106
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
107
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
108
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
109
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
110
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
111
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
112
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
113
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
114
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
115
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
116
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
117
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
118
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
119
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
120
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
121
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
122
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
123
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
124
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
125
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
126
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
127
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
128
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
129
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
130
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
131
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
132
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
133
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
134
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
135
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
136
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
137
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
138
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
139
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
140
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
141
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
142
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
143
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
144
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
145
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
146
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
147
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
148
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
149
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
150
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
151
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
152
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
153
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
154
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
155
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
156
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
157
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
158
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
159
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
160
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
161
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
162
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
163
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
164
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
165
+ .ui-icon-extlink { background-position: -32px -80px; }
166
+ .ui-icon-newwin { background-position: -48px -80px; }
167
+ .ui-icon-refresh { background-position: -64px -80px; }
168
+ .ui-icon-shuffle { background-position: -80px -80px; }
169
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
170
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
171
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
172
+ .ui-icon-folder-open { background-position: -16px -96px; }
173
+ .ui-icon-document { background-position: -32px -96px; }
174
+ .ui-icon-document-b { background-position: -48px -96px; }
175
+ .ui-icon-note { background-position: -64px -96px; }
176
+ .ui-icon-mail-closed { background-position: -80px -96px; }
177
+ .ui-icon-mail-open { background-position: -96px -96px; }
178
+ .ui-icon-suitcase { background-position: -112px -96px; }
179
+ .ui-icon-comment { background-position: -128px -96px; }
180
+ .ui-icon-person { background-position: -144px -96px; }
181
+ .ui-icon-print { background-position: -160px -96px; }
182
+ .ui-icon-trash { background-position: -176px -96px; }
183
+ .ui-icon-locked { background-position: -192px -96px; }
184
+ .ui-icon-unlocked { background-position: -208px -96px; }
185
+ .ui-icon-bookmark { background-position: -224px -96px; }
186
+ .ui-icon-tag { background-position: -240px -96px; }
187
+ .ui-icon-home { background-position: 0 -112px; }
188
+ .ui-icon-flag { background-position: -16px -112px; }
189
+ .ui-icon-calendar { background-position: -32px -112px; }
190
+ .ui-icon-cart { background-position: -48px -112px; }
191
+ .ui-icon-pencil { background-position: -64px -112px; }
192
+ .ui-icon-clock { background-position: -80px -112px; }
193
+ .ui-icon-disk { background-position: -96px -112px; }
194
+ .ui-icon-calculator { background-position: -112px -112px; }
195
+ .ui-icon-zoomin { background-position: -128px -112px; }
196
+ .ui-icon-zoomout { background-position: -144px -112px; }
197
+ .ui-icon-search { background-position: -160px -112px; }
198
+ .ui-icon-wrench { background-position: -176px -112px; }
199
+ .ui-icon-gear { background-position: -192px -112px; }
200
+ .ui-icon-heart { background-position: -208px -112px; }
201
+ .ui-icon-star { background-position: -224px -112px; }
202
+ .ui-icon-link { background-position: -240px -112px; }
203
+ .ui-icon-cancel { background-position: 0 -128px; }
204
+ .ui-icon-plus { background-position: -16px -128px; }
205
+ .ui-icon-plusthick { background-position: -32px -128px; }
206
+ .ui-icon-minus { background-position: -48px -128px; }
207
+ .ui-icon-minusthick { background-position: -64px -128px; }
208
+ .ui-icon-close { background-position: -80px -128px; }
209
+ .ui-icon-closethick { background-position: -96px -128px; }
210
+ .ui-icon-key { background-position: -112px -128px; }
211
+ .ui-icon-lightbulb { background-position: -128px -128px; }
212
+ .ui-icon-scissors { background-position: -144px -128px; }
213
+ .ui-icon-clipboard { background-position: -160px -128px; }
214
+ .ui-icon-copy { background-position: -176px -128px; }
215
+ .ui-icon-contact { background-position: -192px -128px; }
216
+ .ui-icon-image { background-position: -208px -128px; }
217
+ .ui-icon-video { background-position: -224px -128px; }
218
+ .ui-icon-script { background-position: -240px -128px; }
219
+ .ui-icon-alert { background-position: 0 -144px; }
220
+ .ui-icon-info { background-position: -16px -144px; }
221
+ .ui-icon-notice { background-position: -32px -144px; }
222
+ .ui-icon-help { background-position: -48px -144px; }
223
+ .ui-icon-check { background-position: -64px -144px; }
224
+ .ui-icon-bullet { background-position: -80px -144px; }
225
+ .ui-icon-radio-off { background-position: -96px -144px; }
226
+ .ui-icon-radio-on { background-position: -112px -144px; }
227
+ .ui-icon-pin-w { background-position: -128px -144px; }
228
+ .ui-icon-pin-s { background-position: -144px -144px; }
229
+ .ui-icon-play { background-position: 0 -160px; }
230
+ .ui-icon-pause { background-position: -16px -160px; }
231
+ .ui-icon-seek-next { background-position: -32px -160px; }
232
+ .ui-icon-seek-prev { background-position: -48px -160px; }
233
+ .ui-icon-seek-end { background-position: -64px -160px; }
234
+ .ui-icon-seek-start { background-position: -80px -160px; }
235
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
236
+ .ui-icon-seek-first { background-position: -80px -160px; }
237
+ .ui-icon-stop { background-position: -96px -160px; }
238
+ .ui-icon-eject { background-position: -112px -160px; }
239
+ .ui-icon-volume-off { background-position: -128px -160px; }
240
+ .ui-icon-volume-on { background-position: -144px -160px; }
241
+ .ui-icon-power { background-position: 0 -176px; }
242
+ .ui-icon-signal-diag { background-position: -16px -176px; }
243
+ .ui-icon-signal { background-position: -32px -176px; }
244
+ .ui-icon-battery-0 { background-position: -48px -176px; }
245
+ .ui-icon-battery-1 { background-position: -64px -176px; }
246
+ .ui-icon-battery-2 { background-position: -80px -176px; }
247
+ .ui-icon-battery-3 { background-position: -96px -176px; }
248
+ .ui-icon-circle-plus { background-position: 0 -192px; }
249
+ .ui-icon-circle-minus { background-position: -16px -192px; }
250
+ .ui-icon-circle-close { background-position: -32px -192px; }
251
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
252
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
253
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
254
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
255
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
256
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
257
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
258
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
259
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
260
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
261
+ .ui-icon-circle-check { background-position: -208px -192px; }
262
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
263
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
264
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
265
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
266
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
267
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
268
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
269
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
270
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
271
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
272
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
273
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
274
+
275
+
276
+ /* Misc visuals
277
+ ----------------------------------*/
278
+
279
+ /* Corner radius */
280
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; }
281
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; }
282
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; }
283
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; }
284
+
285
+ /* Overlays */
286
+ .ui-widget-overlay { background: #eeeeee url(images/ui-bg_diagonals-thick_90_eeeeee_40x40.png) 50% 50% repeat; opacity: .80;filter:Alpha(Opacity=80); }
287
+ .ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; background: #000000 url(images/ui-bg_highlight-hard_70_000000_1x100.png) 50% top repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
288
+ * jQuery UI Resizable 1.8.20
289
+ *
290
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
291
+ * Dual licensed under the MIT or GPL Version 2 licenses.
292
+ * http://jquery.org/license
293
+ *
294
+ * http://docs.jquery.com/UI/Resizable#theming
295
+ */
296
+ .ui-resizable { position: relative;}
297
+ .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
298
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
299
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
300
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
301
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
302
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
303
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
304
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
305
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
306
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
307
+ * jQuery UI Selectable 1.8.20
308
+ *
309
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
310
+ * Dual licensed under the MIT or GPL Version 2 licenses.
311
+ * http://jquery.org/license
312
+ *
313
+ * http://docs.jquery.com/UI/Selectable#theming
314
+ */
315
+ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
316
+ /*!
317
+ * jQuery UI Accordion 1.8.20
318
+ *
319
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
320
+ * Dual licensed under the MIT or GPL Version 2 licenses.
321
+ * http://jquery.org/license
322
+ *
323
+ * http://docs.jquery.com/UI/Accordion#theming
324
+ */
325
+ /* IE/Win - Fix animation bug - #4615 */
326
+ .ui-accordion { width: 100%; }
327
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
328
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
329
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
330
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
331
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
332
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
333
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
334
+ .ui-accordion .ui-accordion-content-active { display: block; }
335
+ /*!
336
+ * jQuery UI Autocomplete 1.8.20
337
+ *
338
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
339
+ * Dual licensed under the MIT or GPL Version 2 licenses.
340
+ * http://jquery.org/license
341
+ *
342
+ * http://docs.jquery.com/UI/Autocomplete#theming
343
+ */
344
+ .ui-autocomplete { position: absolute; cursor: default; }
345
+
346
+ /* workarounds */
347
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
348
+
349
+ /*
350
+ * jQuery UI Menu 1.8.20
351
+ *
352
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
353
+ * Dual licensed under the MIT or GPL Version 2 licenses.
354
+ * http://jquery.org/license
355
+ *
356
+ * http://docs.jquery.com/UI/Menu#theming
357
+ */
358
+ .ui-menu {
359
+ list-style:none;
360
+ padding: 2px;
361
+ margin: 0;
362
+ display:block;
363
+ float: left;
364
+ }
365
+ .ui-menu .ui-menu {
366
+ margin-top: -3px;
367
+ }
368
+ .ui-menu .ui-menu-item {
369
+ margin:0;
370
+ padding: 0;
371
+ zoom: 1;
372
+ float: left;
373
+ clear: left;
374
+ width: 100%;
375
+ }
376
+ .ui-menu .ui-menu-item a {
377
+ text-decoration:none;
378
+ display:block;
379
+ padding:.2em .4em;
380
+ line-height:1.5;
381
+ zoom:1;
382
+ }
383
+ .ui-menu .ui-menu-item a.ui-state-hover,
384
+ .ui-menu .ui-menu-item a.ui-state-active {
385
+ font-weight: normal;
386
+ margin: -1px;
387
+ }
388
+ /*!
389
+ * jQuery UI Button 1.8.20
390
+ *
391
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
392
+ * Dual licensed under the MIT or GPL Version 2 licenses.
393
+ * http://jquery.org/license
394
+ *
395
+ * http://docs.jquery.com/UI/Button#theming
396
+ */
397
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
398
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
399
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
400
+ .ui-button-icons-only { width: 3.4em; }
401
+ button.ui-button-icons-only { width: 3.7em; }
402
+
403
+ /*button text element */
404
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
405
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
406
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
407
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
408
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
409
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
410
+ /* no icon support for input elements, provide padding by default */
411
+ input.ui-button { padding: .4em 1em; }
412
+
413
+ /*button icon element(s) */
414
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
415
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
416
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
417
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
418
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
419
+
420
+ /*button sets*/
421
+ .ui-buttonset { margin-right: 7px; }
422
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
423
+
424
+ /* workarounds */
425
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
426
+ /*!
427
+ * jQuery UI Dialog 1.8.20
428
+ *
429
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
430
+ * Dual licensed under the MIT or GPL Version 2 licenses.
431
+ * http://jquery.org/license
432
+ *
433
+ * http://docs.jquery.com/UI/Dialog#theming
434
+ */
435
+ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
436
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
437
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
438
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
439
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
440
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
441
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
442
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
443
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
444
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
445
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
446
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
447
+ /*!
448
+ * jQuery UI Slider 1.8.20
449
+ *
450
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
451
+ * Dual licensed under the MIT or GPL Version 2 licenses.
452
+ * http://jquery.org/license
453
+ *
454
+ * http://docs.jquery.com/UI/Slider#theming
455
+ */
456
+ .ui-slider { position: relative; text-align: left; }
457
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
458
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
459
+
460
+ .ui-slider-horizontal { height: .8em; }
461
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
462
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
463
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
464
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
465
+
466
+ .ui-slider-vertical { width: .8em; height: 100px; }
467
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
468
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
469
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
470
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
471
+ * jQuery UI Tabs 1.8.20
472
+ *
473
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
474
+ * Dual licensed under the MIT or GPL Version 2 licenses.
475
+ * http://jquery.org/license
476
+ *
477
+ * http://docs.jquery.com/UI/Tabs#theming
478
+ */
479
+ #tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
480
+ #tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; width:auto}
481
+ #tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
482
+ #tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none;width:auto }
483
+ #tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; width:auto}
484
+ #tabs .ui-tabs-nav li.ui-tabs-selected a, #tabs .ui-tabs-nav li.ui-state-disabled a, #tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; width:auto}
485
+ #tabs .ui-tabs-nav li a, #tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
486
+ #tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none;width:auto;float:none }
487
+ #tabs .ui-tabs-hide { display: none !important; }
488
+ /*!
489
+ * jQuery UI Datepicker 1.8.20
490
+ *
491
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
492
+ * Dual licensed under the MIT or GPL Version 2 licenses.
493
+ * http://jquery.org/license
494
+ *
495
+ * http://docs.jquery.com/UI/Datepicker#theming
496
+ */
497
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
498
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
499
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
500
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
501
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
502
+ .ui-datepicker .ui-datepicker-next { right:2px; }
503
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
504
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
505
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
506
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
507
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
508
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
509
+ .ui-datepicker select.ui-datepicker-month,
510
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
511
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
512
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
513
+ .ui-datepicker td { border: 0; padding: 1px; }
514
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
515
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
516
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
517
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
518
+
519
+ /* with multiple calendars */
520
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
521
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
522
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
523
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
524
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
525
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
526
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
527
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
528
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
529
+ .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
530
+
531
+ /* RTL support */
532
+ .ui-datepicker-rtl { direction: rtl; }
533
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
534
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
535
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
536
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
537
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
538
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
539
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
540
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
541
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
542
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
543
+
544
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
545
+ .ui-datepicker-cover {
546
+ display: none; /*sorry for IE5*/
547
+ display/**/: block; /*sorry for IE5*/
548
+ position: absolute; /*must have*/
549
+ z-index: -1; /*must have*/
550
+ filter: mask(); /*must have*/
551
+ top: -4px; /*must have*/
552
+ left: -4px; /*must have*/
553
+ width: 200px; /*must have*/
554
+ height: 200px; /*must have*/
555
+ }/*!
556
+ * jQuery UI Progressbar 1.8.20
557
+ *
558
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
559
+ * Dual licensed under the MIT or GPL Version 2 licenses.
560
+ * http://jquery.org/license
561
+ *
562
+ * http://docs.jquery.com/UI/Progressbar#theming
563
+ */
564
+ .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
565
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
css/style.css ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cff-custom-table input{margin-left:5px; margin-right:5px;}
2
+ .form-builder{font-size:11px;width:100%;min-width:780px;}
3
+ .clearer{clear:both;}
4
+ .column{float:left;}
5
+ .columnr{float:right;}
6
+ .ctrlsColumn{width:380px;z-index:9999;}
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%}
13
+ .width30{width:30%}
14
+ .padding10{padding:10px;}
15
+ .button, .form-builder .button{float:left;margin:5px 15px;}
16
+ .button.n span{color:#AED0EA}
17
+ #tabs{height:650px;width:100%;overflow-y:auto;}
18
+ #fbuilder{height:640px;overflow:auto;position:relative;}
19
+ #fbuilder .fields{border:1px solid transparent;padding:3px 10px 14px 10px;margin:5px 0px;display:block;position:relative;}
20
+ #fbuilder .fields .arrow{position:absolute;left:-15px;top:20px;display:none;}
21
+
22
+ #fbuilder .fields .collapse,
23
+ #fbuilder .fields .uncollapse,
24
+ #fbuilder .fields .remove,
25
+ #fbuilder .fields .copy{position:absolute;bottom:0;display:none;background-color:#fff;cursor:pointer;right:0;}
26
+
27
+ #fbuilder .fields .collapse{right:40px;}
28
+ #fbuilder .fields .uncollapse{right:40px;}
29
+ #fbuilder .fields .copy{right:20px;}
30
+
31
+ #fbuilder legend{ border:1px solid rgba(222,222,222,.75); background:#FFF; margin-left:5px; padding: 0 5px; }
32
+ #fbuilder .fcontainer{ border:1px solid rgba(222,222,222,.75);min-height:67px;padding:10px 5px;}
33
+ #fbuilder .fieldscontainer{min-height:67px;}
34
+ #fbuilder .fhtml {border:1px dashed rgba(222,222,222,.75);min-height:16px;}
35
+
36
+ .groupBox,
37
+ .dependenciesBox,
38
+ .choicesSet{border:1px dashed #888;margin:10px 0px;padding:5px;font-size:12px;}
39
+ .choicesSet .t,
40
+ .choicesEdit input[type=text]{width:calc( 50% - 55px );-webkit-width:calc( 50% - 55px );-moz-width:calc( 50% - 55px );width:-o-calc( 50% - 55px );}
41
+ .choicesEdit,.choicesEditDep{position:relative;}
42
+ .choicesEditDep span{display:inline-block;}
43
+ .choicesSet .t{float:left;}
44
+ .choicesSet .t:first-child{margin-left:18px;}
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;}
52
+ .choicesEditDep select{width:calc( 100% - 164px );-webkit-width:calc( 100% - 164px );width:-moz-calc( 100% - 164px );width:-o-calc( 100% - 164px );}
53
+ .addDep,
54
+ .ui-widget-content .choice_addDep.ui-icon {background-image: url(cupertino/images/ui-icons_2e83ff_256x240.png); }
55
+ .removeDep,
56
+ .ui-widget-content .choice_removeDep.ui-icon {background-image: url(cupertino/images/ui-icons_2e83ff_256x240.png); }
57
+ .cf_dependence_field{width:calc( 100% - 150px );-moz-calc( 100% - 150px );-webkit-calc( 100% - 150px );-o-calc( 100% - 150px );}
58
+ .showHideDependencies,.dep{float:right}
59
+ .cf_dependence_operator,.cf_dependence_value{width:calc( 50% - 50px );width:-webkit-calc( 50% - 50px );width:-moz-calc( 50% - 50px );width:-o-calc( 50% - 50px );}
60
+ .showHideDependencies,.dep{float:right}
61
+
62
+ .choicesSet.hide {display:block !important;visibility: visible !important;}
63
+ .choicesSet.hide .choicesEditDep{display:none}
64
+ .choicesSet.show .choicesEditDep{display:block}
65
+ a.helpfbuilder.dep{font-size:100%;padding-left:10px}
66
+ input [disabled] {background-color: #f00;}
67
+ input [readonly] {background-color: #f00;}
68
+ #fbuilder .fields.ui-selected{background-color:#DFEFFF;border:1px solid #C2D7EF}
69
+ #fbuilder .fields.ui-selected .arrow,#fbuilder .fields.ui-selected>.remove,#fbuilder .fields.ui-selected>.copy,#fbuilder .fields.ui-selected>.collapse,#fbuilder .fields.ui-selected.collapsed>.uncollapse{display:inline}
70
+ #fbuilder .fields.collapsed>.dfield>.fcontainer{border-color: rgba(255,201,38,.75);}
71
+ #fbuilder .collapsed-label{padding:10px;}
72
+ #fbuilder .fields:not(.collapsed)>.dfield>.fcontainer>.collapsed-label{display:none;}
73
+ #fbuilder .fields.collapsed>.dfield>.fcontainer>.collapsed-label{display:block;}
74
+ #fbuilder .fields.collapsed>.dfield>.fcontainer>.fieldscontainer{display:none;}
75
+ #fbuilder .fields.fmark,
76
+ #fbuilder .fields.ui-over{border:1px dashed #888;}
77
+
78
+ #fbuilder .fform{border:1px solid transparent;padding:10px;margin:5px 0px;display:block;position:relative}
79
+ #fbuilder .fform .arrow{position:absolute;left:-15px;top:20px;display:none}
80
+ #fbuilder .fform.ui-selected{background-color:#E7FFCF;border:1px solid #C2EF95}
81
+ #fbuilder .fform.ui-selected .arrow{display:inline}
82
+ #fbuilder .fform.ui-over{border:1px dashed #888;}
83
+ #fbuilder .fform h1,
84
+ #fbuilder .fform h2{margin:5px 0px;padding:0px;}
85
+ input.disabled {background: #fff;color: #888;cursor: default;}
86
+ label1{display:inline}
87
+ input.small, select.small, textarea.small, .small{width:25%}
88
+ input.medium, select.medium, textarea.medium, .medium{width:50%}
89
+ input.large, select.large, textarea.large, .large{width:100%;box-sizing: border-box;-webkit-box-sizing:border-box;-moz-box-sizing: border-box;}
90
+ textarea {resize: none}
91
+ .form-builder .ctrlsColumn textarea{resize:vertical;}
92
+ .one_column{}
93
+ .two_column{float:left;width:48%}
94
+ .three_column{float:left;width:30%}
95
+ .side_by_side{float:left;}
96
+ .top_aligned .fields label{}
97
+ .top_aligned .fields .dfield{}
98
+ .left_aligned .fields label{float:left;width:31%}
99
+ .left_aligned .fields .dfield{float:left;width:65%;}
100
+ .right_aligned .fields label{float:left;width:31%;text-align:right;padding:3px 3px 0px 0px}
101
+ .right_aligned .fields .dfield{float:left;width:65%}
102
+ #tabs span.uh,
103
+ #fbuilder span.uh{display:block;font-size:80%;clear:both}
104
+ #fbuilder .section_break{border-top:1px dotted #555;clear:both}
105
+
106
+ #fbuilder .uh_phone{float:left;margin:0px 5px;font-size:80%;text-align:center;position: relative;}
107
+ #fbuilder .uh_phone input{text-align:center;font-size:100%;}
108
+ #fbuilder .uh_phone div.cpefb_error{display:block;white-space:nowrap;width:400px}
109
+
110
+ .eq_btn{min-width:45px;}
111
+ .form-builder #sFieldList,
112
+ .form-builder #sToolbarList{width: calc( 100% - 50px );width: -webkit-calc( 100% - 50px );width: -moz-calc( 100% - 50px );width: -o-calc( 100% - 50x );}
113
+ #fCalculated{
114
+ background: url("cupertino/images/ui-bg_glass_80_eebd4d_1x400.png") repeat-x scroll 50% 50% #EEBD4D;
115
+ border: 1px solid #D0771D;
116
+ color: #643F0D;
117
+ }
118
+ #facceptance{
119
+ background: url("cupertino/images/ui-bg_glass_80_eebd4dc_1x400.png") repeat-x scroll 50% 50% #619218;
120
+ border: 1px solid #619218;
121
+ color: #25530F;
122
+ }
123
+ #facceptance span{padding-left: 0; padding-right:0;}
124
+
125
+ a.helpfbuilder{font-size:80%;text-decoration:underline;color:#00f;cursor:pointer;}
126
+ .working_dates input[type='checkbox']{width:8%}
127
+ .form-builder .ui-button-text {
128
+ display: block !important;
129
+ }
130
+
131
+ .form-builder-error-messages .error-text{ color: #FF0000; border: 1px solid #FF0000; margin-bottom: 10px; padding:5px; }
132
+ .form-builder-success-messages .success-text{ color: #46b450; border: 1px solid #46b450; margin-bottom: 10px; padding:5px; }
133
+
134
+ .form-builder #tabs label{ font-size:12px !important; }
135
+
136
+ .ui-state-highlight { height: 65px; line-height: 65px; }
137
+
138
+ @media only screen and (max-width: 640px){
139
+ .cff-custom-table,
140
+ .cff-custom-table thead,
141
+ .cff-custom-table tbody,
142
+ .cff-custom-table th,
143
+ .cff-custom-table td,
144
+ .cff-custom-table tr{display: block !important;text-align:center !important;}
145
+ .cff-custom-table thead tr {position: absolute !important;top: -9999px !important;left: -9999px !important;}
146
+ .cff-custom-table tr {border-bottom: 1px solid #ccc !important;}
147
+ .cff-custom-table tr:last-child {border-bottom: 0px !important;}
148
+ .cff-custom-table td {border-bottom: none !important;position: relative !important;}
149
+ .cff-custom-table input[type="text"]{margin:0 !important; width:100% !important;display:block !important;}
150
+ .cff-forms-list td:nth-of-type(1):before { content: "Id: " !important;}
151
+ .cff-events-list td:nth-of-type(2):before { content: "Id: " !important;}
152
+
153
+ .cff_form_builder .postbox select,
154
+ .cff_form_builder .postbox textarea,
155
+ .cff_form_builder .postbox input[type=text],
156
+ .cff_form_builder .postbox input[type=number],
157
+ .cff_form_builder .postbox input[type=password]{display:block;width:100% !important;margin-bottom:5px;}
158
+ .cff_form_builder .postbox table,
159
+ .cff_form_builder .postbox table tr,
160
+ .cff_form_builder .postbox table th,
161
+ .cff_form_builder .postbox table td{display:block;width:100% !important;}
162
+ .cff_form_builder nobr{white-space:normal !important;}
163
+ .form-builder{min-width: auto;background:#FFF !important;}
164
+ .form-builder #tabs{width:auto;}
165
+ .form-builder .expand-shrink{display:none;}
166
+ .dashboardColumn,
167
+ .ctrlsColumn{width:100% !important;position:relative !important;}
168
+ .form-builder .button{margin:0; padding:0;width:50%;}
169
+ #fbuilder{margin-top:10px;padding:0;}
170
+ }
171
+ @media only screen and (max-width: 480px){
172
+ .cff-custom-table input[type="button"]{margin:0 !important; width:100% !important;display:block !important;}
173
+ }
css/stylepublic.css ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearer{clear:both;}
2
+
3
+ #fbuilder{}
4
+ #fbuilder .fields,#fbuilder .fform{padding:5px 0px;}
5
+ #fbuilder .fform h1,
6
+ #fbuilder .fform h2{margin:5px 0px;padding:0px;}
7
+
8
+ #fbuilder input[type="text"],
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;}
21
+ #fbuilder .large{width:100% !important;}
22
+
23
+ @media screen and (min-width: 740px),print{
24
+ #fbuilder .fields.column2{float:left;width:49.9%;}
25
+ #fbuilder .fields.column3{float:left;width:33.3%;}
26
+ #fbuilder .fields.column4{float:left;width:24.9%;}
27
+
28
+ *[dir="rtl"] #fbuilder .fields.column2{float:right;}
29
+ *[dir="rtl"] #fbuilder .fields.column3{float:right;}
30
+ *[dir="rtl"] #fbuilder .fields.column4{float:right;}
31
+ }
32
+
33
+ @media screen and (max-width: 640px){
34
+ #fbuilder .small,
35
+ #fbuilder .medium{width:100% !important;}
36
+ }
37
+
38
+ #fbuilder .one_column{}
39
+ #fbuilder .two_column{float:left;width:48%;}
40
+ #fbuilder .three_column{float:left;width:30%;}
41
+ #fbuilder .side_by_side{float:left; margin-right:10px;}
42
+
43
+ *[dir="rtl"] #fbuilder .two_column{float:right;}
44
+ *[dir="rtl"] #fbuilder .three_column{float:right;}
45
+ *[dir="rtl"] #fbuilder .side_by_side{float:right; margin-left:10px;}
46
+
47
+
48
+ #fbuilder .dfield{position:relative;}
49
+ #fbuilder .top_aligned .fields label{}
50
+ #fbuilder .top_aligned .fields .dfield{}
51
+ #fbuilder .left_aligned .fields label{float:left;width:31%;}
52
+ #fbuilder .left_aligned .fields .dfield{float:left;width:65%;}
53
+ #fbuilder .right_aligned .fields label{float:left;width:31%;text-align:right;padding:3px 3px 0px 0px;}
54
+ #fbuilder .right_aligned .fields .dfield{float:left;width:65%;}
55
+ #fbuilder .right_aligned .fields .dfield label{text-align:left;}
56
+
57
+ *[dir="rtl"] #fbuilder .left_aligned .fields label{float:right;}
58
+ *[dir="rtl"] #fbuilder .left_aligned .fields .dfield{float:right;}
59
+ *[dir="rtl"] #fbuilder .right_aligned .fields label{float:right;text-align:left;}
60
+ *[dir="rtl"] #fbuilder .right_aligned .fields .dfield{float:right;}
61
+ *[dir="rtl"] #fbuilder .right_aligned .fields .dfield label{text-align:right;}
62
+
63
+ #fbuilder .one_column label,
64
+ #fbuilder .two_column label,
65
+ #fbuilder .three_column label,
66
+ #fbuilder .side_by_side label{ width:100% !important; }
67
+
68
+ #fbuilder .left_aligned .section_breaks.fields label,
69
+ #fbuilder .left_aligned .comment_area.fields label,
70
+ #fbuilder .left_aligned .cff-html-field .dfield,
71
+ #fbuilder .right_aligned .section_breaks.fields label,
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;}
79
+ #fbuilder div.cpefb_error:after{content:"";position:absolute;background:transparent url("../images/tooltop.gif") no-repeat scroll 10px center;color:red;font-weight:bold;height:8px;width:100%;top:-8px;left:0px;z-index:1000;}
80
+
81
+ .ui-datepicker{ z-index:9999 !important;}
82
+
83
+ #fbuilder span.files-list,
84
+ #fbuilder span.uh{display:block;font-size:80%;clear:both;}
85
+ #fbuilder span.files-list{padding: 5px auto;}
86
+
87
+ #fbuilder .section_break{border-top:1px dotted #555;clear:both;}
88
+
89
+ #fbuilder .uh_phone{float:left;margin:0px 5px;font-size:80%;text-align:center;position:relative;}
90
+ *[dir="rtl"] #fbuilder .uh_phone{float:right;}
91
+ #fbuilder .uh_phone input{text-align:center;font-size:100%;}
92
+ #fbuilder .uh_phone div.cpefb_error{white-space:nowrap;}
93
+ #fbuilder .cpp_form { text-align:left;}
94
+ *[dir="rtl"] #fbuilder .cpp_form { text-align:right;}
95
+ #fbuilder .pbreak{display:none;}
96
+ #fbuilder .pbreak.pb0{display:block;}
97
+ #fbuilder .pbreak .pbPrevious,.pbreak .pbNext,.pbSubmit{background:#ccc;color:#000;display:block;float:left;cursor:pointer;margin:10px 10px 0px 0px;padding:5px 20px;}
98
+ #fbuilder .submitbtn-disabled{cursor:not-allowed;opacity:0.5;pointer-events:none;}
99
+ *[dir="rtl"] #fbuilder .pbreak .pbPrevious,
100
+ *[dir="rtl"] #fbuilder .pbreak .pbNext,
101
+ *[dir="rtl"] #fbuilder .pbSubmit{float:right;margin:10px 0 0 10px;}
102
+
103
+ #fbuilder .pbreak.pb0 .pbPrevious{display:none;}
104
+ #fbuilder .pbreak.pbEnd .pbNext{display:none;}
105
+ #fbuilder .ignore{border:5px solid black;}
106
+ #fbuilder fieldset{border:1px solid #ccc;padding:10px;}
107
+ #fbuilder legend{border:1px solid #ccc;padding:5px 10px;}
108
+ #fbuilder .cpcaptchalayer,.cp_subbtn{display:none;}
109
+ #fbuilder .captcha img{ cursor:pointer; }
110
+
111
+ #fbuilder input[type='radio'],#fbuilder input[type='checkbox']{width:auto;}
112
+ .ui-tooltip.uh-tooltip{width:250px;font-size:10px;font-weight:normal;padding:5px;z-index:9999 !important;}
113
+ #fbuilder input[type="checkbox"]{-webkit-appearance:checkbox!important;}
114
+ #fbuilder input[type="radio"]{-webkit-appearance:radio!important;}
115
+
116
+ #fbuilder .dfield.slider-container{ padding-left: 10px !important; padding-right: 10px !important;}
117
+ #fbuilder .dfield .slider{ margin-bottom:5px; }
118
+
119
+ #fbuilder .cff-summary-title:after{ content: ': '; }
120
+
121
+ #fbuilder .hide{ display:none; }
122
+ #fbuilder .clear{ clear:both; }
123
+
124
+ #fbuilder .apply-coupon{display:inline-block;width:24px;height:24px;background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xMSAwLTIgLjktMiAydjE0YzAgMS4xLjg5IDIgMiAyaDE0YzEuMTEgMCAyLS45IDItMlY1YzAtMS4xLS44OS0yLTItMnptLTkgMTRsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=');cursor:pointer; vertical-align:middle;}
125
+
126
+ #fbuilder .discount-container:empty{display:none;}
127
+
128
+ @media print{
129
+ #fbuilder input[type="button"],
130
+ #fbuilder input[type="reset"],
131
+ #fbuilder .pbNext,
132
+ #fbuilder .pbPrevious,
133
+ #fbuilder .pbSubmit,
134
+ #fbuilder .captcha{
135
+ display: none !important;
136
+ }
137
+ #fbuilder .pbreak{display: block;}
138
+ }
139
+
140
+ #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
141
+
142
+ #fbuilder .cff-close-dlg{display:inline-block;width:16px;height:16px;position:absolute;top:10px;right:10px;cursor:pointer;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAowAAAKMB8MeazgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAB5SURBVDiNrZPRCcAwCEQfnUiySAZuF8kSWeH6Yz8KrQZMQAicJ+epAB0YwAmYJKIADLic0/GPPCbQAnLznCd/4NWUFfkgy1VjH8CryA95ApYltAiTRCZxpuoW+gz9WXE6NPeg+ra1UDIxGlWEObe4SGxY5fIxlc75Bkt9V4JS7KWJAAAAAElFTkSuQmCC59ef34356faa7edebc7ed5432ddb673d');
143
+ }
144
+
145
+ #fbuilder .cff-dialog{position:fixed;z-index:999999;padding:30px;width:600px;height:300px;background:#fff;top:50%;left:50%;box-shadow:rgba(0, 0, 0, 0.5) 0px 0px 10px 0px;}
146
+
147
+ #fbuilder .cff-dialog-content{width:100%;height:100%;overflow:auto;}
images/cp_form.gif ADDED
Binary file
images/cp_var.gif ADDED
Binary file
images/tooltop.gif ADDED
Binary file
inc/cpcff_admin_int.inc.php ADDED
@@ -0,0 +1,663 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( !is_admin() )
4
+ {
5
+ print 'Direct access not allowed.';
6
+ exit;
7
+ }
8
+
9
+ // Required scripts
10
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/inc/cpcff_templates.inc.php';
11
+
12
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
13
+ wp_enqueue_media();
14
+
15
+ if (!defined('CP_CALCULATEDFIELDSF_ID'))
16
+ define ('CP_CALCULATEDFIELDSF_ID',intval($_GET["cal"]));
17
+
18
+ $cpcff_main = CPCFF_MAIN::instance();
19
+ $form_obj = $cpcff_main->get_form(intval($_GET["cal"]));
20
+
21
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['cp_calculatedfieldsf_post_options'] ) )
22
+ echo "<div id='setting-error-settings_updated' class='updated settings-error'> <p><strong>".__( 'Settings saved', 'calculated-fields-form' )."</strong></p></div>";
23
+
24
+ global $cpcff_default_texts_array;
25
+ $cpcff_texts_array = $form_obj->get_option( 'vs_all_texts', $cpcff_default_texts_array );
26
+ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
27
+ $cpcff_default_texts_array,
28
+ ( is_string( $cpcff_texts_array ) && is_array( unserialize( $cpcff_texts_array ) ) )
29
+ ? unserialize( $cpcff_texts_array )
30
+ : ( ( is_array( $cpcff_texts_array ) ) ? $cpcff_texts_array : array() )
31
+ );
32
+
33
+ ?>
34
+ <div class="wrap">
35
+ <h1><?php
36
+ print __( 'Calculated Fields Form', 'calculated-fields-form' ).' [<b>'.__('Form', 'calculated-fields-form').' '.CP_CALCULATEDFIELDSF_ID.' - '.$form_obj->get_option( 'form_name', '').'</b>]';
37
+ ?></h1>
38
+
39
+ <input type="button" name="backbtn" value="<?php esc_attr_e( 'Back to items list...', 'calculated-fields-form' ); ?>" onclick="document.location='admin.php?page=cp_calculated_fields_form';">
40
+ <br /><br />
41
+
42
+ <form method="post" action="" name="cpformconf" class="cff_form_builder">
43
+ <input type="hidden" name="_cpcff_nonce" value="<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>" />
44
+ <input name="cp_calculatedfieldsf_post_options" type="hidden" value="1" />
45
+ <input name="cp_calculatedfieldsf_id" type="hidden" value="<?php echo CP_CALCULATEDFIELDSF_ID; ?>" />
46
+
47
+ <div id="normal-sortables" class="meta-box-sortables">
48
+
49
+ <h2><?php _e( 'Form Settings', 'calculated-fields-form' ); ?>:</h2>
50
+ <hr />
51
+ <div><?php _e( '* Different form styles available on the tab Form Settings &gt;&gt; Form Template', 'calculated-fields-form' ); ?></div>
52
+ <div id="metabox_basic_settings" class="postbox" >
53
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Form Builder', 'calculated-fields-form' ); ?></span></h3>
54
+ <div class="inside">
55
+ <div class="form-builder-error-messages"><?php
56
+ global $cff_structure_error;
57
+ if( !empty( $cff_structure_error ) )
58
+ {
59
+ echo $cff_structure_error;
60
+ }
61
+ ?></div>
62
+ <p style="border:1px solid #F0AD4E;background:#FBE6CA;padding:10px;"><span style="font-weight:bold;"><?php _e('If the form is not loading in the public website, go to the settings page of the plugin through the menu option: "Settings/Calculated Fields Form", select the "Classic" option for the attribute: "Script load method", and press the "Update" button.','calculated-fields-form'); ?></span><br /><?php _e( 'If you need also the form to be sent to the server side for processing (for example to deliver emails) then the <a href="https://cff.dwbooster.com/" target="_blank">Professional or Developer versions</a> of the plugin will be required.', 'calculated-fields-form' ); ?></p>
63
+ <input type="hidden" name="form_structure" id="form_structure" value="<?php print esc_attr(preg_replace('/&quot;/i', '&amp;quot;', json_encode($form_obj->get_option( 'form_structure', CP_CALCULATEDFIELDSF_DEFAULT_form_structure )))); ?>" />
64
+ <input type="hidden" name="templates" id="templates" value="<?php print esc_attr( json_encode( CPCFF_TEMPLATES::load_templates() ) ); ?>" />
65
+ <link href="<?php echo plugins_url('/css/cupertino/jquery-ui-1.8.20.custom.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>" type="text/css" rel="stylesheet" property="stylesheet" />
66
+ <script type="text/javascript">
67
+ try
68
+ {
69
+ /* Flags */
70
+ var calculatedFieldsForm_first = false,
71
+ calculatedFieldsForm_counter = 10;
72
+
73
+ function calculatedFieldsFormReady()
74
+ {
75
+ if(typeof $calculatedfieldsfQuery.fn['fbuilder'] == 'undefined')
76
+ {
77
+ calculatedFieldsFormImport(); return;
78
+ }
79
+
80
+ var f = $calculatedfieldsfQuery("#fbuilder").fbuilder();
81
+ window['cff_form'] = f;
82
+ f.fBuild.loadData( "form_structure", "templates" );
83
+
84
+ $calculatedfieldsfQuery(".itemForm").click(function() {
85
+ f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
86
+ });
87
+
88
+ $calculatedfieldsfQuery( ".itemForm" ).draggable({revert1: "invalid",helper: "clone",cursor: "move"});
89
+ $calculatedfieldsfQuery( "#fbuilder" ).droppable({
90
+ accept: ".button",
91
+ drop: function( event, ui ) {
92
+ f.fBuild.addItem(ui.draggable.attr("id"));
93
+ }
94
+ });
95
+ jQuery("#metabox_basic_settings0").append('<div id="c0" style="position:absolute;top:0px;left:0px;background:#aaa;z-index:1;"></div>');
96
+ jQuery("#c0").css({ opacity: 0.5 });
97
+ jQuery("#c0").click( function(){
98
+ 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' ); ?>"))
99
+ document.location = 'https://cff.dwbooster.com/';
100
+ } );
101
+ jQuery("#metabox_basic_settings1").append('<div id="c1" style="position:absolute;top:0px;left:0px;background:#aaa;z-index:1;"></div>');
102
+ jQuery("#c1").css({ opacity: 0.5 });
103
+ jQuery("#c1").click( function(){
104
+ 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' ); ?>"))
105
+ document.location = 'https://cff.dwbooster.com/';
106
+ } );
107
+ jQuery("#metabox_basic_settings2").append('<div id="c2" style="position:absolute;top:0px;left:0px;background:#aaa;z-index:1;"></div>');
108
+ jQuery("#c2").css({ opacity: 0.5 });
109
+ jQuery("#c2").click( function(){
110
+ 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' ); ?>"))
111
+ document.location = 'https://cff.dwbooster.com/';
112
+ } );
113
+ jQuery("#metabox_basic_settings3").append('<div id="c3" style="position:absolute;top:0px;left:0px;background:#aaa;z-index:1;"></div>');
114
+ jQuery("#c3").css({ opacity: 0.5 });
115
+ jQuery("#c3").click( function(){
116
+ 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' ); ?>"))
117
+ document.location = 'https://cff.dwbooster.com/';
118
+ } );
119
+ jQuery("#metabox_basic_settings4").append('<div id="c4" style="position:absolute;top:0px;left:0px;background:#aaa;z-index:1;"></div>');
120
+ jQuery("#c4").css({ opacity: 0.5 });
121
+ jQuery("#c4").click( function(){
122
+ 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' ); ?>"))
123
+ document.location = 'https://cff.dwbooster.com/';
124
+ } );
125
+ var rLayer = function(){
126
+ jQuery("#c0").css("width",jQuery("#metabox_basic_settings0").width()+"px").css("height",jQuery("#metabox_basic_settings0").height()+"px");
127
+ jQuery("#c1").css("width",jQuery("#metabox_basic_settings1").width()+"px").css("height",jQuery("#metabox_basic_settings1").height()+"px");
128
+ jQuery("#c2").css("width",jQuery("#metabox_basic_settings2").width()+"px").css("height",jQuery("#metabox_basic_settings2").height()+"px");
129
+ jQuery("#c3").css("width",jQuery("#metabox_basic_settings3").width()+"px").css("height",jQuery("#metabox_basic_settings3").height()+"px");
130
+ jQuery("#c4").css("width",jQuery("#metabox_basic_settings4").width()+"px").css("height",jQuery("#metabox_basic_settings4").height()+"px");
131
+ }
132
+ rLayer();
133
+ jQuery(window).resize(function() {rLayer();});
134
+ };
135
+
136
+ function calculatedFieldsFormImport()
137
+ {
138
+ if( typeof jQuery == 'undefined' )
139
+ {
140
+ if( !calculatedFieldsForm_first )
141
+ {
142
+ document.write ("<"+"script type='text/javascript' src='<?php print CP_SCHEME; ?>ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></"+"script>");
143
+ document.write ("<"+"script type='text/javascript' src='<?php print CP_SCHEME; ?>ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/jquery-ui.min.js'></"+"script>");
144
+ }
145
+ if( calculatedFieldsForm_counter )
146
+ {
147
+ calculatedFieldsForm_counter--;
148
+ setTimeout( calculatedFieldsFormImport, 500 );
149
+ }
150
+ }
151
+ else
152
+ {
153
+ $calculatedfieldsfQuery = jQuery.noConflict();
154
+ window.jQuery = window.$ = jQuery;
155
+ var getScript = $calculatedfieldsfQuery.getScript;
156
+ $calculatedfieldsfQuery.getScript = function( resources, callback ) {
157
+
158
+ var /* reference declaration & localization */
159
+ length = resources.length,
160
+ handler = function() { counter++; },
161
+ deferreds = [],
162
+ counter = 0,
163
+ idx = 0;
164
+
165
+ for ( ; idx < length; idx++ ) {
166
+ deferreds.push(
167
+ getScript( resources[ idx ], handler )
168
+ );
169
+ }
170
+
171
+ $calculatedfieldsfQuery.when.apply( null, deferreds ).then(function() {
172
+ callback && callback();
173
+ });
174
+ };
175
+
176
+ $calculatedfieldsfQuery.getScript(
177
+ [
178
+ '<?php echo plugins_url('/js/jQuery.stringify.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>',
179
+ '<?php echo plugins_url('/js/jquery.validate.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>',
180
+ '<?php echo plugins_url('/js/jquery.caret.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>',
181
+ '<?php echo CPCFF_AUXILIARY::wp_url().'/?cp_cff_resources=admin'; ?>'
182
+ ],
183
+ function()
184
+ {
185
+ $calculatedfieldsfQuery(document).ready( calculatedFieldsFormReady ).ready();
186
+ }
187
+ );
188
+ }
189
+ };
190
+ }
191
+ catch( err ){}
192
+ try{$calculatedfieldsfQuery = jQuery.noConflict();} catch ( err ) {}
193
+ if (typeof $calculatedfieldsfQuery == 'undefined')
194
+ {
195
+ calculatedFieldsFormImport();
196
+ }
197
+ else
198
+ {
199
+ $calculatedfieldsfQuery(document).ready( calculatedFieldsFormReady );
200
+ }
201
+ </script>
202
+ <div style="background:#fafafa;" class="form-builder">
203
+
204
+ <div class="column ctrlsColumn">
205
+ <div id="tabs">
206
+ <span class="ui-icon ui-icon-triangle-1-e expand-shrink"></span>
207
+ <ul>
208
+ <li><a href="#tabs-1"><?php _e( 'Add a Field', 'calculated-fields-form' ); ?></a></li>
209
+ <li><a href="#tabs-2"><?php _e( 'Field Settings', 'calculated-fields-form' ); ?></a></li>
210
+ <li><a href="#tabs-3"><?php _e( 'Form Settings', 'calculated-fields-form' ); ?></a></li>
211
+ </ul>
212
+ <div id="tabs-1"></div>
213
+ <div id="tabs-2"></div>
214
+ <div id="tabs-3"></div>
215
+ </div>
216
+ </div>
217
+ <div class="columnr dashboardColumn padding10" id="fbuilder">
218
+ <div id="formheader"></div>
219
+ <div id="fieldlist"></div>
220
+ </div>
221
+ <div class="clearer"></div>
222
+
223
+ </div>
224
+
225
+ </div>
226
+ </div>
227
+
228
+ <p class="submit">
229
+ <input type="submit" name="save" id="save" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'calculated-fields-form' ); ?>" title="Saves the form's structure and settings" />
230
+ <input type="button" name="previewbtn" id="previewbtn" class="button-primary" value="<?php esc_attr_e( 'Preview', 'calculated-fields-form' ); ?>" onclick="jQuery.fbuilder.preview( this );" title="Saves the form's structure only, and opens a preview windows" />
231
+ </p>
232
+
233
+ <div id="metabox_basic_settings" class="postbox" >
234
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Define Texts', 'calculated-fields-form' ); ?></span></h3>
235
+ <div class="inside">
236
+ <table class="form-table">
237
+ <tr valign="top">
238
+ <th scope="row"><?php _e( 'Previous button label (text)', 'calculated-fields-form' ); ?>:</th>
239
+ <td><input type="text" name="vs_text_previousbtn" size="40" value="<?php $label = esc_attr($form_obj->get_option('vs_text_previousbtn', 'Previous')); echo ($label==''?'Previous':$label); ?>" /></td>
240
+ </tr>
241
+ <tr valign="top">
242
+ <th scope="row"><?php _e( 'Next button label (text)', 'calculated-fields-form' ); ?>:</th>
243
+ <td><input type="text" name="vs_text_nextbtn" size="40" value="<?php $label = esc_attr($form_obj->get_option('vs_text_nextbtn', 'Next')); echo ($label==''?'Next':$label); ?>" /></td>
244
+ </tr>
245
+ <tr valign="top">
246
+ <td colspan="2">
247
+ <?php _e( '- The styles can be applied into any of the CSS files of your theme or into the CSS file <em>"calculated-fields-form\css\stylepublic.css"</em>.', 'calculated-fields-form' ); ?><br />
248
+ <?php _e( '- For general CSS styles modifications to the form and samples <a href="https://cff.dwbooster.com/faq#q82" target="_blank">check this FAQ</a>.', 'calculated-fields-form' ); ?>
249
+ </tr>
250
+ <?php
251
+ // Display all other text fields
252
+ foreach( $cpcff_texts_array as $cpcff_text_index => $cpcff_text_attr )
253
+ {
254
+ if( $cpcff_text_index !== 'errors' )
255
+ {
256
+ print '
257
+ <tr valign="top">
258
+ <th scope="row">'.$cpcff_text_attr[ 'label' ].':</th>
259
+ <td><input type="text" name="cpcff_text_array['.$cpcff_text_index.'][text]" size="40" value="'. esc_attr( $cpcff_text_attr[ 'text' ] ).'" /></td>
260
+ </tr>
261
+ ';
262
+ }
263
+ }
264
+ ?>
265
+ </table>
266
+ </div>
267
+ </div>
268
+
269
+ <div id="metabox_basic_settings" class="postbox" >
270
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Validation Settings', 'calculated-fields-form' ); ?></span></h3>
271
+ <div class="inside">
272
+ <table class="form-table">
273
+ <tr valign="top">
274
+ <th scope="row"><?php _e( 'Use Validation?', 'calculated-fields-form' ); ?></th>
275
+ <td>
276
+ <?php $option = $form_obj->get_option('vs_use_validation', CP_CALCULATEDFIELDSF_DEFAULT_vs_use_validation); ?>
277
+ <select name="vs_use_validation">
278
+ <option value="true"<?php if ($option == 'true') echo ' selected'; ?>><?php _e( 'Yes', 'calculated-fields-form' ); ?></option>
279
+ <!--<option value="false"<?php if ($option == 'false') echo ' selected'; ?>>No</option>-->
280
+ </select>
281
+ </td>
282
+ </tr>
283
+ <tr valign="top">
284
+ <th scope="row"><?php _e( '"is required" text', 'calculated-fields-form' ); ?>:</th>
285
+ <td><input type="text" name="vs_text_is_required" size="40" value="<?php echo esc_attr($form_obj->get_option('vs_text_is_required', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required)); ?>" /></td>
286
+ </tr>
287
+ <tr valign="top">
288
+ <th scope="row"><?php _e( '"is email" text', 'calculated-fields-form' ); ?>:</th>
289
+ <td><input type="text" name="vs_text_is_email" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_is_email', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email)); ?>" /></td>
290
+ </tr>
291
+ <tr valign="top">
292
+ <th scope="row"><?php _e( '"is valid captcha" text', 'calculated-fields-form' ); ?>:</th>
293
+ <td><input type="text" name="cv_text_enter_valid_captcha" size="70" value="<?php echo esc_attr($form_obj->get_option('cv_text_enter_valid_captcha', CP_CALCULATEDFIELDSF_DEFAULT_cv_text_enter_valid_captcha)); ?>" /></td>
294
+ </tr>
295
+
296
+ <tr valign="top">
297
+ <th scope="row"><?php _e( '"is valid date (mm/dd/yyyy)" text', 'calculated-fields-form' ); ?>:</th>
298
+ <td><input type="text" name="vs_text_datemmddyyyy" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_datemmddyyyy', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy)); ?>" /></td>
299
+ </tr>
300
+ <tr valign="top">
301
+ <th scope="row"><?php _e( '"is valid date (dd/mm/yyyy)" text', 'calculated-fields-form' ); ?>:</th>
302
+ <td><input type="text" name="vs_text_dateddmmyyyy" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_dateddmmyyyy', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy)); ?>" /></td>
303
+ </tr>
304
+ <tr valign="top">
305
+ <th scope="row"><?php _e( '"is number" text', 'calculated-fields-form' ); ?>:</th>
306
+ <td><input type="text" name="vs_text_number" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_number', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number)); ?>" /></td>
307
+ </tr>
308
+ <tr valign="top">
309
+ <th scope="row"><?php _e( '"only digits" text', 'calculated-fields-form' ); ?>:</th>
310
+ <td><input type="text" name="vs_text_digits" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_digits', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits)); ?>" /></td>
311
+ </tr>
312
+ <tr valign="top">
313
+ <th scope="row"><?php _e( '"under maximum" text', 'calculated-fields-form' ); ?>:</th>
314
+ <td><input type="text" name="vs_text_max" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_max', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max)); ?>" /></td>
315
+ </tr>
316
+ <tr valign="top">
317
+ <th scope="row"><?php _e( '"over minimum" text', 'calculated-fields-form' ); ?>:</th>
318
+ <td><input type="text" name="vs_text_min" size="70" value="<?php echo esc_attr($form_obj->get_option('vs_text_min', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min)); ?>" /></td>
319
+ </tr>
320
+ <?php
321
+ // Display all other text fields
322
+ if( !empty( $cpcff_texts_array[ 'errors' ] ) )
323
+ {
324
+ foreach( $cpcff_texts_array[ 'errors' ] as $cpcff_text_index => $cpcff_text_attr )
325
+ {
326
+ print '
327
+ <tr valign="top">
328
+ <th scope="row">'.$cpcff_text_attr[ 'label' ].':</th>
329
+ <td><input type="text" name="cpcff_text_array[errors]['.$cpcff_text_index.'][text]" size="40" value="'. esc_attr( $cpcff_text_attr[ 'text' ] ).'" /></td>
330
+ </tr>
331
+ ';
332
+ }
333
+ }
334
+ ?>
335
+ </table>
336
+ </div>
337
+ </div>
338
+
339
+ <div id="metabox_basic_settings" class="postbox" >
340
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Note', 'calculated-fields-form' ); ?></span></h3>
341
+ <div class="inside">
342
+ <?php _e( 'To insert this form in a post/page, use the dedicated icon', 'calculated-fields-form' ); ?>
343
+ <?php print '<a href="javascript:cp_calculatedfieldsf_insertForm();" title="'.esc_attr_e( 'Insert Calculated Fields Form', 'calculated-fields-form' ).'"><img hspace="5" src="'.plugins_url('/images/cp_form.gif', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH).'" alt="'.esc_attr_e( 'Insert Calculated Fields Form', 'calculated-fields-form' ).'" /></a>'; ?>
344
+ <?php _e( 'which has been added to your Upload/Insert Menu, just below the title of your Post/Page.', 'calculated-fields-form' ); ?>
345
+ <br /><br />
346
+ </div>
347
+ </div>
348
+
349
+ <p class="submit">
350
+ <input type="submit" name="save" id="save" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'calculated-fields-form' ); ?>" title="Saves the form's structure and settings" />
351
+ </p>
352
+
353
+ [<a href="https://cff.dwbooster.com/customization" target="_blank"><?php _e( 'Request Custom Modifications', 'calculated-fields-form' ); ?></a>] | [<a href="https://wordpress.org/support/plugin/calculated-fields-form#new-post" target="_blank"><?php _e( 'Help', 'calculated-fields-form' ); ?></a>]
354
+
355
+ <br /><br /><br />
356
+
357
+ <h3><?php _e( 'The following settings are available only in the <a href="https://cff.dwbooster.com/">pro version</a>', 'calculated-fields-form' ); ?>:</h3>
358
+
359
+ <h2><?php _e( 'Form Processing and Payment Settings', 'calculated-fields-form' ); ?>:</h2>
360
+ <hr />
361
+
362
+ <div id="metabox_basic_settings0" class="postbox" style="position:relative;">
363
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Payment Settings', 'calculated-fields-form' ); ?></span></h3>
364
+ <div class="inside">
365
+
366
+ <table class="form-table">
367
+ <tr valign="top">
368
+ <th scope="row"><?php _e( 'Request cost', 'calculated-fields-form' ); ?></th>
369
+ <td><select name="request_cost" id="request_cost" ></select></td>
370
+ </tr>
371
+
372
+ <tr valign="top">
373
+ <th scope="row"><?php _e( 'Currency', 'calculated-fields-form' ); ?></th>
374
+ <td><input type="text" name="currency" value="<?php echo esc_attr($form_obj->get_option('currency',CP_CALCULATEDFIELDSF_DEFAULT_CURRENCY)); ?>" /></td>
375
+ </tr>
376
+
377
+ <tr valign="top">
378
+ <th scope="row"><?php _e( 'Base amount', 'calculated-fields-form' ); ?>:</th>
379
+ <td><input type="text" name="paypal_base_amount" value="<?php echo esc_attr($form_obj->get_option( 'paypal_base_amount', '0.01' ) ); ?>" /> <?php _e( 'Minimum amount to charge. If the final price is lesser than this number, the base amount will be applied.', 'calculated-fields-form' ); ?>
380
+ </td>
381
+ </tr>
382
+
383
+ <tr valign="top">
384
+ <th scope="row"><?php _e( 'Paypal product name', 'calculated-fields-form' ); ?></th>
385
+ <td><input type="text" name="paypal_product_name" size="50" value="<?php echo esc_attr($form_obj->get_option('paypal_product_name',CP_CALCULATEDFIELDSF_DEFAULT_PRODUCT_NAME)); ?>" /></td>
386
+ </tr>
387
+
388
+ <tr valign="top">
389
+ <th scope="row"><?php _e( 'Discount Codes', 'calculated-fields-form' ); ?></th>
390
+ <td>
391
+ <div id="dex_nocodes_availmsg"><?php _e( 'This feature isn\'t available in this version.', 'calculated-fields-form' ); ?></div>
392
+
393
+ <br />
394
+ <strong><?php _e( 'Add new discount code', 'calculated-fields-form' ); ?>:</strong>
395
+ <br />
396
+ <nobr><?php _e( 'Code', 'calculated-fields-form' ); ?>: <input type="text" name="dex_dc_code" id="dex_dc_code" value="" /></nobr> &nbsp; &nbsp; &nbsp;
397
+ <nobr><?php _e( 'Discount', 'calculated-fields-form' ); ?>: <input type="text" size="3" name="dex_dc_discount" id="dex_dc_discount" value="25" /><select name="dex_dc_discounttype" id="dex_dc_discounttype">
398
+ <option value="0"><?php _e( 'Percent', 'calculated-fields-form' ); ?></option>
399
+ <option value="1"><?php _e( 'Fixed Value', 'calculated-fields-form' ); ?></option>
400
+ </select></nobr>
401
+ &nbsp; &nbsp;
402
+ <nobr><?php _e( 'Valid until', 'calculated-fields-form' ); ?>: <input type="text" size="10" name="dex_dc_expires" id="dex_dc_expires" value="" /></nobr>&nbsp; &nbsp; &nbsp;
403
+ <input type="button" name="dex_dc_subccode" id="dex_dc_subccode" value="<?php esc_attr_e( 'Add', 'calculated-fields-form' ); ?>" onclick="alert('This feature ins\'t available in this version');" />
404
+ <br />
405
+ <em><?php _e( 'Note: Expiration date based in server time. Server time now is', 'calculated-fields-form' ); ?> <?php echo date("Y-m-d H:i"); ?></em>
406
+ </td>
407
+ </tr>
408
+ </table>
409
+ </div>
410
+ </div>
411
+
412
+ <div id="metabox_basic_settings1" class="postbox" style="position:relative;">
413
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Paypal Payment Configuration', 'calculated-fields-form' ); ?></span></h3>
414
+ <div class="inside">
415
+
416
+ <table class="form-table">
417
+ <tr valign="top">
418
+ <th scope="row"><?php _e( 'Enable Paypal Payments?', 'calculated-fields-form' ); ?></th>
419
+ <td><select name="enable_paypal">
420
+ <option value="0"><?php _e( 'No', 'calculated-fields-form' ); ?></option>
421
+ </select>
422
+ <br /><em style="font-size:11px;"><?php _e( 'Note: If "Optional" is selected, a radiobutton will appear in the form to select if the payment will be made with PayPal or not.', 'calculated-fields-form' ); ?></em>
423
+ <div id="cff_paypal_options_label" style="margin-top:10px;background:#EEF5FB;border: 1px dotted #888888;padding:10px;width:260px;">
424
+ <?php _e( 'Label for the "<strong>Pay with PayPal</strong>" option', 'calculated-fields-form' ); ?>:<br />
425
+ <input type="text" size="40" style="width:250px;" />
426
+ </div></td>
427
+ </tr>
428
+
429
+ <tr valign="top">
430
+ <th scope="row"><?php _e( 'Paypal Mode', 'calculated-fields-form' ); ?></th>
431
+ <td><select name="paypal_mode">
432
+ <option value="production" <?php if ($form_obj->get_option('paypal_mode',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_MODE) != 'sandbox') echo 'selected'; ?>><?php _e( 'Production - real payments processed', 'calculated-fields-form' ); ?></option>
433
+ <option value="sandbox" <?php if ($form_obj->get_option('paypal_mode',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_MODE) == 'sandbox') echo 'selected'; ?>><?php _e( 'SandBox - PayPal testing sandbox area', 'calculated-fields-form' ); ?></option>
434
+ </select>
435
+ </td>
436
+ </tr>
437
+
438
+ <tr valign="top">
439
+ <th scope="row"><?php _e( 'Paypal email', 'calculated-fields-form' ); ?></th>
440
+ <td><input type="text" name="paypal_email" size="40" value="<?php echo esc_attr($form_obj->get_option('paypal_email',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_EMAIL)); ?>" /></td>
441
+ </tr>
442
+
443
+ <tr valign="top">
444
+ <th scope="row"><?php _e( 'A $0 amount to pay means', 'calculated-fields-form' ); ?>:</th>
445
+ <td><select name="paypal_zero_payment">
446
+ <option value="0" <?php if ($form_obj->get_option('paypal_zero_payment',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_ZERO_PAYMENT) != '1') echo 'selected'; ?>><?php _e( 'Let the user enter any amount at PayPal (ex: for a donation)', 'calculated-fields-form' ); ?></option>
447
+ <option value="1" <?php if ($form_obj->get_option('paypal_zero_payment',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_ZERO_PAYMENT) == '1') echo 'selected'; ?>><?php _e( 'Don\'t require any payment. Form is submitted skiping the PayPal page.', 'calculated-fields-form' ); ?></option>
448
+ </select>
449
+ </td>
450
+ </tr>
451
+
452
+ <tr valign="top">
453
+ <th scope="row"><?php _e( 'Paypal language', 'calculated-fields-form' ); ?></th>
454
+ <td><input type="text" name="paypal_language" value="<?php echo esc_attr($form_obj->get_option('paypal_language',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_LANGUAGE)); ?>" /></td>
455
+ </tr>
456
+
457
+ <tr valign="top">
458
+ <th scope="row"><?php _e( 'Payment frequency', 'calculated-fields-form' ); ?></th>
459
+ <td><select name="paypal_recurrent">
460
+ <option value="0" <?php if ($form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == '0' ||
461
+ $form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == ''
462
+ ) echo 'selected'; ?>><?php _e( 'One time payment (default option, user is billed only once)', 'calculated-fields-form' ); ?></option>
463
+ <option value="1" <?php if ($form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == '1') echo 'selected'; ?>><?php _e( 'Bill the user every 1 month', 'calculated-fields-form' ); ?></option>
464
+ <option value="3" <?php if ($form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == '3') echo 'selected'; ?>><?php _e( 'Bill the user every 3 months', 'calculated-fields-form' ); ?></option>
465
+ <option value="6" <?php if ($form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == '6') echo 'selected'; ?>><?php _e( 'Bill the user every 6 months', 'calculated-fields-form' ); ?></option>
466
+ <option value="12" <?php if ($form_obj->get_option('paypal_recurrent',CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT) == '12') echo 'selected'; ?>><?php _e( 'Bill the user every 12 months', 'calculated-fields-form' ); ?></option>
467
+ </select>
468
+ </td>
469
+ </tr>
470
+
471
+ </table>
472
+
473
+ </div>
474
+ </div>
475
+
476
+ <div id="metabox_basic_settings2" class="postbox" >
477
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Form Processing / Email Settings', 'calculated-fields-form' ); ?></span></h3>
478
+ <div class="inside">
479
+ <table class="form-table">
480
+ <tr valign="top">
481
+ <th scope="row"><?php _e( '"From" email', 'calculated-fields-form' ); ?></th>
482
+ <td><input type="text" name="fp_from_email" size="40" value="<?php echo esc_attr($form_obj->get_option('fp_from_email', CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email)); ?>" /></td>
483
+ </tr>
484
+ <tr valign="top">
485
+ <th scope="row"><?php _e( 'Destination emails (comma separated)', 'calculated-fields-form' ); ?></th>
486
+ <td><input type="text" name="fp_destination_emails" size="40" value="<?php echo esc_attr($form_obj->get_option('fp_destination_emails', CP_CALCULATEDFIELDSF_DEFAULT_fp_destination_emails)); ?>" /></td>
487
+ </tr>
488
+ <tr valign="top">
489
+ <th scope="row"><?php _e( 'Email subject', 'calculated-fields-form' ); ?></th>
490
+ <td><input type="text" name="fp_subject" size="70" value="<?php echo esc_attr($form_obj->get_option('fp_subject', CP_CALCULATEDFIELDSF_DEFAULT_fp_subject)); ?>" /></td>
491
+ </tr>
492
+ <tr valign="top">
493
+ <th scope="row"><?php _e( 'Include additional information?', 'calculated-fields-form' ); ?></th>
494
+ <td>
495
+ <?php $option = $form_obj->get_option('fp_inc_additional_info', CP_CALCULATEDFIELDSF_DEFAULT_fp_inc_additional_info); ?>
496
+ <select name="fp_inc_additional_info">
497
+ <option value="true"<?php if ($option == 'true') echo ' selected'; ?>><?php _e( 'Yes', 'calculated-fields-form' ); ?></option>
498
+ <option value="false"<?php if ($option == 'false') echo ' selected'; ?>><?php _e( 'No', 'calculated-fields-form' ); ?></option>
499
+ </select>&nbsp;<span><?php _e('If the "No" option is selected the plugin won\'t capture the IP address of users.','calculated-fields-form'); ?></span>
500
+ </td>
501
+ </tr>
502
+ <tr valign="top">
503
+ <th scope="row"><?php _e( 'Thank you page (after sending the message)', 'calculated-fields-form' ); ?></th>
504
+ <td><input type="text" name="fp_return_page" size="70" value="<?php echo esc_attr($form_obj->get_option('fp_return_page', CP_CALCULATEDFIELDSF_DEFAULT_fp_return_page)); ?>" /></td>
505
+ </tr>
506
+ <tr valign="top">
507
+ <th scope="row"><?php _e( 'Email format?', 'calculated-fields-form' ); ?></th>
508
+ <td>
509
+ <?php $option = $form_obj->get_option('fp_emailformat', CP_CALCULATEDFIELDSF_DEFAULT_email_format); ?>
510
+ <select name="fp_emailformat">
511
+ <option value="text"<?php if ($option != 'html') echo ' selected'; ?>><?php _e( 'Plain Text (default)', 'calculated-fields-form' ); ?></option>
512
+ <option value="html"<?php if ($option == 'html') echo ' selected'; ?>><?php _e( 'HTML (use html in the textarea below)', 'calculated-fields-form' ); ?></option>
513
+ </select>
514
+ </td>
515
+ </tr>
516
+ <tr valign="top">
517
+ <th scope="row"><?php _e( 'Message', 'calculated-fields-form' ); ?></th>
518
+ <td><textarea type="text" name="fp_message" rows="6" cols="80"><?php echo $form_obj->get_option('fp_message', CP_CALCULATEDFIELDSF_DEFAULT_fp_message); ?></textarea></td>
519
+ </tr>
520
+ </table>
521
+ </div>
522
+ </div>
523
+
524
+
525
+ <div id="metabox_basic_settings3" class="postbox" >
526
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Email Copy to User', 'calculated-fields-form' ); ?></span></h3>
527
+ <div class="inside">
528
+ <table class="form-table">
529
+ <tr valign="top">
530
+ <th scope="row"><?php _e( 'Send confirmation/thank you message to user?', 'calculated-fields-form' ); ?></th>
531
+ <td>
532
+ <?php $option = $form_obj->get_option('cu_enable_copy_to_user', CP_CALCULATEDFIELDSF_DEFAULT_cu_enable_copy_to_user); ?>
533
+ <select name="cu_enable_copy_to_user">
534
+ <option value="true"<?php if ($option == 'true') echo ' selected'; ?>><?php _e( 'Yes', 'calculated-fields-form' ); ?></option>
535
+ <option value="false"<?php if ($option == 'false') echo ' selected'; ?>><?php _e( 'No', 'calculated-fields-form' ); ?></option>
536
+ </select>
537
+ </td>
538
+ </tr>
539
+ <tr valign="top">
540
+ <th scope="row"><?php _e( 'Email field on the form', 'calculated-fields-form' ); ?></th>
541
+ <td><select id="cu_user_email_field" name="cu_user_email_field" def="<?php echo esc_attr($form_obj->get_option('cu_user_email_field', CP_CALCULATEDFIELDSF_DEFAULT_cu_user_email_field)); ?>"></select></td>
542
+ </tr>
543
+ <tr valign="top">
544
+ <th scope="row"><?php _e( 'Email subject', 'calculated-fields-form' ); ?></th>
545
+ <td><input type="text" name="cu_subject" size="70" value="<?php echo esc_attr($form_obj->get_option('cu_subject', CP_CALCULATEDFIELDSF_DEFAULT_cu_subject)); ?>" /></td>
546
+ </tr>
547
+ <tr valign="top">
548
+ <th scope="row"><?php _e( 'Email format?', 'calculated-fields-form' ); ?></th>
549
+ <td>
550
+ <?php $option = $form_obj->get_option('cu_emailformat', CP_CALCULATEDFIELDSF_DEFAULT_email_format); ?>
551
+ <select name="cu_emailformat">
552
+ <option value="text"<?php if ($option != 'html') echo ' selected'; ?>><?php _e( 'Plain Text (default)', 'calculated-fields-form' ); ?></option>
553
+ <option value="html"<?php if ($option == 'html') echo ' selected'; ?>><?php _e( 'HTML (use html in the textarea below)', 'calculated-fields-form' ); ?></option>
554
+ </select>
555
+ </td>
556
+ </tr>
557
+ <tr valign="top">
558
+ <th scope="row"><?php _e( 'Message', 'calculated-fields-form' ); ?></th>
559
+ <td><textarea type="text" name="cu_message" rows="6" cols="80"><?php echo $form_obj->get_option('cu_message', CP_CALCULATEDFIELDSF_DEFAULT_cu_message); ?></textarea></td>
560
+ </tr>
561
+ </table>
562
+ </div>
563
+ </div>
564
+
565
+
566
+ <div id="metabox_basic_settings4" class="postbox" >
567
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Captcha Verification', 'calculated-fields-form' ); ?></span></h3>
568
+ <div class="inside">
569
+ <table class="form-table">
570
+ <tr valign="top">
571
+ <th scope="row"><?php _e( 'Use Captcha Verification?', 'calculated-fields-form' ); ?></th>
572
+ <td colspan="5">
573
+ <?php $option = $form_obj->get_option('cv_enable_captcha', CP_CALCULATEDFIELDSF_DEFAULT_cv_enable_captcha); ?>
574
+ <select name="cv_enable_captcha">
575
+ <option value="true"<?php if ($option == 'true') echo ' selected'; ?>><?php _e( 'Yes', 'calculated-fields-form' ); ?></option>
576
+ <option value="false"<?php if ($option == 'false') echo ' selected'; ?>><?php _e( 'No', 'calculated-fields-form' ); ?></option>
577
+ </select>
578
+ </td>
579
+ </tr>
580
+
581
+ <tr valign="top">
582
+ <th scope="row"><?php _e( 'Width', 'calculated-fields-form' ); ?>:</th>
583
+ <td><input type="text" readonly=readonly name="cv_width" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_width', CP_CALCULATEDFIELDSF_DEFAULT_cv_width)); ?>" onblur="generateCaptcha();" /></td>
584
+ <th scope="row"><?php _e( 'Height', 'calculated-fields-form' ); ?>:</th>
585
+ <td><input type="text" readonly=readonly name="cv_height" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_height', CP_CALCULATEDFIELDSF_DEFAULT_cv_height)); ?>" onblur="generateCaptcha();" /></td>
586
+ <th scope="row"><?php _e( 'Chars', 'calculated-fields-form' ); ?>:</th>
587
+ <td><input type="text" readonly=readonly name="cv_chars" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_chars', CP_CALCULATEDFIELDSF_DEFAULT_cv_chars)); ?>" onblur="generateCaptcha();" /></td>
588
+ </tr>
589
+
590
+ <tr valign="top">
591
+ <th scope="row"><?php _e( 'Min font size', 'calculated-fields-form' ); ?>:</th>
592
+ <td><input type="text" readonly=readonly name="cv_min_font_size" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_min_font_size', CP_CALCULATEDFIELDSF_DEFAULT_cv_min_font_size)); ?>" onblur="generateCaptcha();" /></td>
593
+ <th scope="row"><?php _e( 'Max font size', 'calculated-fields-form' ); ?>:</th>
594
+ <td><input type="text" readonly=readonly name="cv_max_font_size" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_max_font_size', CP_CALCULATEDFIELDSF_DEFAULT_cv_max_font_size)); ?>" onblur="generateCaptcha();" /></td>
595
+ <td colspan="2" rowspan="">
596
+ <?php _e( 'Preview', 'calculated-fields-form' ); ?>:<br />
597
+ <br />
598
+ <img src="<?php echo plugins_url('/captcha/captcha.php', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>" id="captchaimg" alt="<?php esc_attr_e( 'security code', 'calculated-fields-form' ); ?>" border="0" />
599
+ </td>
600
+ </tr>
601
+
602
+
603
+ <tr valign="top">
604
+ <th scope="row"><?php _e( 'Noise', 'calculated-fields-form' ); ?>:</th>
605
+ <td><input type="text" readonly=readonly name="cv_noise" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_noise', CP_CALCULATEDFIELDSF_DEFAULT_cv_noise)); ?>" onblur="generateCaptcha();" /></td>
606
+ <th scope="row"><?php _e( 'Noise Length', 'calculated-fields-form' ); ?>:</th>
607
+ <td><input type="text" readonly=readonly name="cv_noise_length" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_noise_length', CP_CALCULATEDFIELDSF_DEFAULT_cv_noise_length)); ?>" onblur="generateCaptcha();" /></td>
608
+ </tr>
609
+
610
+ <tr valign="top">
611
+ <th scope="row"><?php _e( 'Background', 'calculated-fields-form' ); ?>:</th>
612
+ <td><input type="text" readonly=readonly name="cv_background" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_background', CP_CALCULATEDFIELDSF_DEFAULT_cv_background)); ?>" onblur="generateCaptcha();" /></td>
613
+ <th scope="row">Border:</th>
614
+ <td><input type="text" readonly=readonly name="cv_border" size="10" value="<?php echo esc_attr($form_obj->get_option('cv_border', CP_CALCULATEDFIELDSF_DEFAULT_cv_border)); ?>" onblur="generateCaptcha();" /></td>
615
+ </tr>
616
+
617
+ <tr valign="top">
618
+ <th scope="row"><?php _e( 'Font', 'calculated-fields-form' ); ?>:</th>
619
+ <td>
620
+ <select name="cv_font" onchange="generateCaptcha();" >
621
+ <option value="font-1.ttf"<?php if ("font-1.ttf" == $form_obj->get_option('cv_font', CP_CALCULATEDFIELDSF_DEFAULT_cv_font)) echo " selected"; ?>>Font 1</option>
622
+ <option value="font-2.ttf"<?php if ("font-2.ttf" == $form_obj->get_option('cv_font', CP_CALCULATEDFIELDSF_DEFAULT_cv_font)) echo " selected"; ?>>Font 2</option>
623
+ <option value="font-3.ttf"<?php if ("font-3.ttf" == $form_obj->get_option('cv_font', CP_CALCULATEDFIELDSF_DEFAULT_cv_font)) echo " selected"; ?>>Font 3</option>
624
+ <option value="font-4.ttf"<?php if ("font-4.ttf" == $form_obj->get_option('cv_font', CP_CALCULATEDFIELDSF_DEFAULT_cv_font)) echo " selected"; ?>>Font 4</option>
625
+ </select>
626
+ </td>
627
+ </tr>
628
+ </table>
629
+ </div>
630
+ </div>
631
+
632
+ </div>
633
+
634
+
635
+ <p class="submit">
636
+ <input type="submit" name="save" id="save" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'calculated-fields-form' ); ?>" title="Saves the form's structure and settings" />
637
+ </p>
638
+
639
+ [<a href="https://cff.dwbooster.com/customization" target="_blank"><?php _e( 'Request Custom Modifications', 'calculated-fields-form' ); ?></a>] | [<a href="https://wordpress.org/support/plugin/calculated-fields-form#new-post" target="_blank"><?php _e( 'Help', 'calculated-fields-form' ); ?></a>]
640
+ </form>
641
+ </div>
642
+ <script type="text/javascript">
643
+ function generateCaptcha()
644
+ {
645
+ var d=new Date(),
646
+ f = document.cpformconf,
647
+ qs = "?width="+f.cv_width.value;
648
+
649
+ qs += "&height="+f.cv_height.value;
650
+ qs += "&letter_count="+f.cv_chars.value;
651
+ qs += "&min_size="+f.cv_min_font_size.value;
652
+ qs += "&max_size="+f.cv_max_font_size.value;
653
+ qs += "&noise="+f.cv_noise.value;
654
+ qs += "&noiselength="+f.cv_noise_length.value;
655
+ qs += "&bcolor="+f.cv_background.value;
656
+ qs += "&border="+f.cv_border.value;
657
+ qs += "&font="+f.cv_font.options[f.cv_font.selectedIndex].value;
658
+ qs += "&rand="+d;
659
+
660
+ document.getElementById("captchaimg").src= "<?php echo plugins_url('/captcha/captcha.php', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>"+qs;
661
+ }
662
+ generateCaptcha();
663
+ </script>
inc/cpcff_admin_int_list.inc.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !is_admin() )
3
+ {
4
+ print 'Direct access not allowed.';
5
+ exit;
6
+ }
7
+
8
+ $_GET['u'] = (isset($_GET['u'])) ? intval(@$_GET['u']) : 0;
9
+ $_GET['c'] = (isset($_GET['c'])) ? intval(@$_GET['c']) : 0;
10
+ $_GET['d'] = (isset($_GET['d'])) ? intval(@$_GET['d']) : 0;
11
+
12
+ global $wpdb;
13
+ $cpcff_main = CPCFF_MAIN::instance();
14
+
15
+ $message = "";
16
+
17
+ if (isset($_GET['a']) && $_GET['a'] == '1')
18
+ {
19
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
20
+ $cpcff_main->create_form((isset($_GET["name"])) ? stripcslashes($_GET["name"]) : '');
21
+ $message = __( "Item added", 'calculated-fields-form' );
22
+ }
23
+ else if (isset($_GET['u']) && $_GET['u'] != '')
24
+ {
25
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
26
+ $cpcff_main->get_form($_GET['u'])->update_name((isset($_GET["name"])) ? stripcslashes($_GET["name"]) : '');
27
+ $message = __( "Item updated", 'calculated-fields-form' );
28
+ }
29
+ else if (isset($_GET['d']) && $_GET['d'] != '')
30
+ {
31
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
32
+ $cpcff_main->delete_form($_GET['d']);
33
+ $message = __( "Item deleted", 'calculated-fields-form' );
34
+ } else if (isset($_GET['c']) && $_GET['c'] != '')
35
+ {
36
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
37
+ if($cpcff_main->clone_form(@intval($_GET['c'])) !== false) $message = __( "Item duplicated/cloned", 'calculated-fields-form' );
38
+ else $message = __( "Duplicate/Clone Error, the form cannot be cloned", 'calculated-fields-form' );
39
+ } else if (isset($_GET['ac']) && $_GET['ac'] == 'st')
40
+ {
41
+ check_admin_referer( 'session_id_'.CP_SESSION::session_id(), '_cpcff_nonce' );
42
+ update_option( 'CP_CFF_LOAD_SCRIPTS', (isset($_GET["scr"]) && $_GET["scr"]=="1"? "0":"1") );
43
+ update_option( 'CP_CALCULATEDFIELDSF_USE_CACHE', (isset($_GET["jsc"]) && $_GET["jsc"]=="1" ? 1 : 0) );
44
+ update_option( 'CP_CALCULATEDFIELDSF_EXCLUDE_CRAWLERS', (isset($_GET["ecr"]) && $_GET["ecr"]=="1" ? 1 : 0) );
45
+
46
+ $public_js_path = CP_CALCULATEDFIELDSF_BASE_PATH.'/js/cache/all.js';
47
+ try{
48
+ if( get_option( 'CP_CALCULATEDFIELDSF_USE_CACHE', CP_CALCULATEDFIELDSF_USE_CACHE ) == false )
49
+ {
50
+ if( file_exists( $public_js_path ) )
51
+ {
52
+ unlink( $public_js_path );
53
+ }
54
+ }
55
+ else
56
+ {
57
+ if(!file_exists($public_js_path))
58
+ {
59
+ wp_remote_get(CPCFF_AUXILIARY::wp_url().((strpos(CPCFF_AUXILIARY::wp_url(),'?') === false) ? '/?' : '&').'cp_cff_resources=public&min=1', array('sslverify' => false));
60
+ }
61
+ }
62
+ }catch( Exception $err ){}
63
+
64
+ if ($_GET["chs"] != '')
65
+ {
66
+ $target_charset = $_GET["chs"];
67
+ if( !in_array($target_charset, array('utf8_general_ci', 'utf8mb4_general_ci', 'latin1_swedish_ci')) ) $target_charset = 'utf8_general_ci';
68
+
69
+ $tables = array( $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE, $wpdb->prefix.CP_CALCULATEDFIELDSF_POSTS_TABLE_NAME_NO_PREFIX );
70
+ foreach ($tables as $tab)
71
+ {
72
+ $myrows = $wpdb->get_results( "DESCRIBE {$tab}" );
73
+ foreach ($myrows as $item)
74
+ {
75
+ $name = $item->Field;
76
+ $type = $item->Type;
77
+ if (preg_match("/^varchar\((\d+)\)$/i", $type, $mat) || !strcasecmp($type, "CHAR") || !strcasecmp($type, "TEXT") || !strcasecmp($type, "MEDIUMTEXT"))
78
+ {
79
+ $wpdb->query("ALTER TABLE {$tab} CHANGE {$name} {$name} {$type} COLLATE {$target_charset}");
80
+ }
81
+ }
82
+ }
83
+ }
84
+ $message = __( "Troubleshoot settings updated", 'calculated-fields-form' );
85
+ }
86
+
87
+
88
+ if ($message) echo "<div id='setting-error-settings_updated' class='updated settings-error'><p><strong>".$message."</strong></p></div>";
89
+
90
+ ?>
91
+ <div class="wrap">
92
+ <h1><?php _e( 'Calculated Fields Form', 'calculated-fields-form' ); ?></h1>
93
+
94
+ <script type="text/javascript">
95
+ function cp_addItem()
96
+ {
97
+ var calname = document.getElementById("cp_itemname").value;
98
+ document.location = 'admin.php?page=cp_calculated_fields_form&a=1&r='+Math.random()+'&name='+encodeURIComponent(calname)+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
99
+ }
100
+
101
+ function cp_addItem_keyup( e )
102
+ {
103
+ e.which = e.which || e.keyCode;
104
+ if(e.which == 13) {
105
+ var calname = document.getElementById("cp_itemname").value;
106
+ document.location = 'admin.php?page=cp_calculated_fields_form&a=1&r='+Math.random()+'&name='+encodeURIComponent(calname)+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
107
+ }
108
+ }
109
+
110
+ function cp_updateItem(id)
111
+ {
112
+ var calname = document.getElementById("calname_"+id).value;
113
+ document.location = 'admin.php?page=cp_calculated_fields_form&u='+id+'&r='+Math.random()+'&name='+encodeURIComponent(calname)+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
114
+ }
115
+
116
+ function cp_cloneItem(id)
117
+ {
118
+ document.location = 'admin.php?page=cp_calculated_fields_form&c='+id+'&r='+Math.random()+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
119
+ }
120
+
121
+ function cp_manageSettings(id)
122
+ {
123
+ document.location = 'admin.php?page=cp_calculated_fields_form&cal='+id+'&r='+Math.random()+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
124
+ }
125
+
126
+ function cp_viewMessages(id)
127
+ {
128
+ alert('Not available in this version. Check other versions at: '+"\n\n"+'https://cff.dwbooster.com/download');
129
+ }
130
+
131
+ function cp_BookingsList(id)
132
+ {
133
+ document.location = 'admin.php?page=cp_calculated_fields_form&cal='+id+'&list=1&r='+Math.random();
134
+ }
135
+
136
+ function cp_deleteItem(id)
137
+ {
138
+ if (confirm('<?php _e( 'Are you sure that you want to delete this item?', 'calculated-fields-form' ); ?>'))
139
+ {
140
+ document.location = 'admin.php?page=cp_calculated_fields_form&d='+id+'&r='+Math.random()+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
141
+ }
142
+ }
143
+
144
+ function cp_updateConfig()
145
+ {
146
+ if (confirm('<?php _e( 'Are you sure that you want to update these settings?', 'calculated-fields-form' ); ?>'))
147
+ {
148
+ var scr = document.getElementById("ccscriptload").value,
149
+ chs = document.getElementById("cccharsets").value,
150
+ jsc = (document.getElementById("ccjscache").checked) ? 1 : 0,
151
+ ecr = (document.getElementById("ccexcludecrawler").checked) ? 1 : 0;
152
+
153
+ document.location = 'admin.php?page=cp_calculated_fields_form&ecr='+ecr+'&ac=st&scr='+scr+'&chs='+chs+'&jsc='+jsc+'&r='+Math.random()+'&_cpcff_nonce=<?php echo wp_create_nonce( 'session_id_'.CP_SESSION::session_id() ); ?>';
154
+ }
155
+ }
156
+ </script>
157
+ <div id="normal-sortables" class="meta-box-sortables">
158
+ <div id="metabox_basic_settings" class="postbox" >
159
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Form List / Items List', 'calculated-fields-form' ); ?></span></h3>
160
+ <div class="inside">
161
+ <table cellspacing="10" class="cff-custom-table cff-forms-list">
162
+ <thead>
163
+ <tr>
164
+ <th align="left"><?php _e( 'ID', 'calculated-fields-form' ); ?></th><th align="left"><?php _e( 'Form Name', 'calculated-fields-form' ); ?></th><th align="center"><?php _e( 'Options', 'calculated-fields-form' ); ?></th><th align="left"><?php _e( 'Shortcode', 'calculated-fields-form' ); ?></th>
165
+ </tr>
166
+ </thead>
167
+ <tbody>
168
+ <?php
169
+ $myrows = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE );
170
+ foreach ($myrows as $item)
171
+ {
172
+ ?>
173
+ <tr>
174
+ <td nowrap><?php echo $item->id; ?></td>
175
+ <td nowrap><input type="text" name="calname_<?php echo $item->id; ?>" id="calname_<?php echo $item->id; ?>" value="<?php echo esc_attr($item->form_name); ?>" /></td>
176
+
177
+ <td nowrap>
178
+ <input type="button" name="calupdate_<?php echo $item->id; ?>" value="<?php esc_attr_e( 'Update', 'calculated-fields-form' ); ?>" onclick="cp_updateItem(<?php echo $item->id; ?>);" />
179
+ <input type="button" name="calmanage_<?php echo $item->id; ?>" value="<?php esc_attr_e( 'Settings', 'calculated-fields-form' ); ?>" onclick="cp_manageSettings(<?php echo $item->id; ?>);" />
180
+ <input type="button" name="calmanage_<?php echo $item->id; ?>" value="<?php esc_attr_e( 'Messages', 'calculated-fields-form' ); ?>" onclick="cp_viewMessages(<?php echo $item->id; ?>);" />
181
+ <input type="button" name="calclone_<?php echo $item->id; ?>" value="<?php esc_attr_e( 'Clone', 'calculated-fields-form' ); ?>" onclick="cp_cloneItem(<?php echo $item->id; ?>);" />
182
+ <input type="button" name="caldelete_<?php echo $item->id; ?>" value="<?php esc_attr_e( 'Delete', 'calculated-fields-form' ); ?>" onclick="cp_deleteItem(<?php echo $item->id; ?>);" />
183
+ </td>
184
+ <td nowrap>[CP_CALCULATED_FIELDS id="<?php echo $item->id; ?>"]</td>
185
+ </tr>
186
+ <?php
187
+ }
188
+ ?>
189
+ </tbody>
190
+ </table>
191
+ </div>
192
+ </div>
193
+
194
+ <div id="metabox_basic_settings" class="postbox" >
195
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'New Form', 'calculated-fields-form' ); ?></span></h3>
196
+ <div class="inside">
197
+
198
+ <form name="additem">
199
+ <?php _e( 'Item Name', 'calculated-fields-form' ); ?>:<br />
200
+ <input type="text" name="cp_itemname" id="cp_itemname" value="" onkeyup="cp_addItem_keyup( event );" /> <input type="button" onclick="cp_addItem();" name="gobtn" value="<?php esc_attr_e( 'Add', 'calculated-fields-form' ); ?>" />
201
+ <br /><br />
202
+ </form>
203
+ </div>
204
+ </div>
205
+
206
+ <div id="metabox_basic_settings" class="postbox" >
207
+ <h3 class='hndle' style="padding:5px;"><span><?php _e( 'Troubleshoot Area & General Settings', 'calculated-fields-form' ); ?></span></h3>
208
+ <div class="inside">
209
+ <form name="updatesettings">
210
+ <div style="border:1px solid #DADADA; padding:10px;">
211
+ <p><?php _e( '<strong>Important!</strong>: Use this area <strong>only</strong> if you are experiencing conflicts with third party plugins, with the theme scripts or with the character encoding.', 'calculated-fields-form' ); ?></p>
212
+ <?php _e( 'Script load method', 'calculated-fields-form' ); ?>:<br />
213
+ <select id="ccscriptload" name="ccscriptload">
214
+ <option value="0" <?php if (get_option('CP_CFF_LOAD_SCRIPTS',"0") == "1") echo 'selected'; ?>><?php _e( 'Classic (Recommended)', 'calculated-fields-form' ); ?></option>
215
+ <option value="1" <?php if (get_option('CP_CFF_LOAD_SCRIPTS',"0") != "1") echo 'selected'; ?>><?php _e( 'Direct', 'calculated-fields-form' ); ?></option>
216
+ </select><br />
217
+ <em><?php _e( '* Change the script load method if the form doesn\'t appear in the public website.', 'calculated-fields-form' ); ?></em>
218
+ <br /><br />
219
+ <?php _e( 'Character encoding', 'calculated-fields-form' ); ?>:<br />
220
+ <select id="cccharsets" name="cccharsets">
221
+ <option value=""><?php _e( 'Keep current charset (Recommended)', 'calculated-fields-form' ); ?></option>
222
+ <option value="utf8_general_ci">UTF-8 (<?php _e( 'try this first', 'calculated-fields-form' ); ?>)</option>
223
+ <option value="utf8mb4_general_ci">UTF-8mb4 (<?php _e( 'Only from MySQL 5.5', 'calculated-fields-form' ); ?>)</option>
224
+ <option value="latin1_swedish_ci">latin1_swedish_ci</option>
225
+ </select><br />
226
+ <em><?php _e( '* Update the charset if you are getting problems displaying special/non-latin characters. After updated you need to edit the special characters again.', 'calculated-fields-form' ); ?></em>
227
+ </div>
228
+ <br />
229
+ <?php _e( 'Activate Javascript Cache', 'calculated-fields-form' ); ?>: <input type="checkbox" name="ccjscache" id="ccjscache" <?php echo ( get_option( 'CP_CALCULATEDFIELDSF_USE_CACHE', CP_CALCULATEDFIELDSF_USE_CACHE ) ) ? 'CHECKED' : ''; ?> />
230
+ <br /><br />
231
+ <?php _e( 'Do not load the forms with crawlers', 'calculated-fields-form' ); ?>: <input type="checkbox" name="ccexcludecrawler" id="ccexcludecrawler" <?php echo ( get_option( 'CP_CALCULATEDFIELDSF_EXCLUDE_CRAWLERS', false ) ) ? 'CHECKED' : ''; ?> /><br /><i><?php _e( '* The forms are not loaded when website is being indexed by searchers.', 'calculated-fields-form' ); ?></i>
232
+ <br /><br />
233
+ <input type="button" onclick="cp_updateConfig();" name="gobtn" value="<?php esc_attr_e( 'UPDATE', 'calculated-fields-form' ); ?>" />
234
+ <br />
235
+ </form>
236
+
237
+ </div>
238
+ </div>
239
+ </div>
240
+ [<a href="https://cff.dwbooster.com/customization" target="_blank"><?php _e( 'Request Custom Modifications', 'calculated-fields-form' ); ?></a>] | [<a href="https://cff.dwbooster.com/download" target="_blank"><?php _e( 'Upgrade', 'calculated-fields-form' ); ?></a>] | [<a href="https://wordpress.org/support/plugin/calculated-fields-form#new-post" target="_blank"><?php _e( 'Help', 'calculated-fields-form' ); ?></a>]
241
+ </form>
242
+ </div>
inc/cpcff_auxiliary.inc.php ADDED
@@ -0,0 +1,391 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Miscellaneous operations: CPCFF_AUXILIARY class
4
+ *
5
+ * Metaclass with miscellanous operations used through all plugin.
6
+ *
7
+ * @package CFF.
8
+ * @since 1.0.167
9
+ */
10
+
11
+ if(!class_exists('CPCFF_AUXILIARY'))
12
+ {
13
+ /**
14
+ * Metaclass with miscellaneous operations.
15
+ *
16
+ * Publishes miscellanous operations to be used through all plugin's sections.
17
+ *
18
+ * @since 1.0.167
19
+ */
20
+ class CPCFF_AUXILIARY
21
+ {
22
+ /**
23
+ * Public URL of the current blog.
24
+ *
25
+ * @since 1.0.167
26
+ * @var string $_site_url
27
+ */
28
+ private static $_site_url;
29
+
30
+ /**
31
+ * URL to the WordPress of the current blog.
32
+ *
33
+ * @since 1.0.167
34
+ * @var string $_wp_url
35
+ */
36
+ private static $_wp_url;
37
+
38
+ /**
39
+ * ID of the current blog.
40
+ *
41
+ * @var string $_wp_id
42
+ */
43
+ private static $_wp_id;
44
+
45
+ /**
46
+ * Returns the id of current blog.
47
+ *
48
+ * If the ID was read previously, uses the value stored in class property.
49
+ *
50
+ * @return int.
51
+ */
52
+ public static function blog_id()
53
+ {
54
+ if(empty(self::$_wp_id)) self::$_wp_id = get_current_blog_id();
55
+ return self::$_wp_id;
56
+ } // End blog_id
57
+
58
+ /**
59
+ * Returns the public URL of the current blog.
60
+ *
61
+ * If the URL was read previously, uses the value stored in class property.
62
+ *
63
+ * @since 1.0.167
64
+ * @return string.
65
+ */
66
+ public static function site_url()
67
+ {
68
+ if(empty(self::$_site_url))
69
+ {
70
+ $blog = self::blog_id();
71
+ self::$_site_url = get_home_url( $blog, '', is_ssl() ? 'https' : 'http');
72
+ }
73
+ return rtrim(self::$_site_url, '/');
74
+ } // End site_url
75
+
76
+ /**
77
+ * Returns the URL to the WordPress of the current blog.
78
+ *
79
+ * If the URL was read previously, uses the value stored in class property.
80
+ *
81
+ * @since 1.0.167
82
+ * @return string.
83
+ */
84
+ public static function wp_url()
85
+ {
86
+ if(empty(self::$_wp_url))
87
+ {
88
+ $blog = self::blog_id();
89
+ self::$_wp_url = get_admin_url( $blog );
90
+ }
91
+ return rtrim(self::$_wp_url, '/');
92
+ } // End wp_url
93
+
94
+ /**
95
+ * Removes Bom characters.
96
+ *
97
+ * @since 1.0.179
98
+ *
99
+ * @param string $str.
100
+ * @return string.
101
+ */
102
+ public static function clean_bom($str)
103
+ {
104
+ $bom = pack('H*','EFBBBF');
105
+ return preg_replace("/$bom/", '', $str);
106
+ } // End clean_bom
107
+
108
+ /**
109
+ * Converts some characters in a JSON string.
110
+ *
111
+ * @since 1.0.169
112
+ *
113
+ * @param string $str JSON string.
114
+ * @return string.
115
+ */
116
+ public static function clean_json($str)
117
+ {
118
+ return str_replace(
119
+ array(" ", "\n", "\r"),
120
+ array(" ", '\n', ''),
121
+ $str
122
+ );
123
+ } // End clean_json
124
+
125
+ /**
126
+ * Decodes a JSON string.
127
+ *
128
+ * Decode a JSON string, and receive a parameter to apply strip slashes first or not.
129
+ *
130
+ * @since 1.0.169
131
+ *
132
+ * @param string $str JSON string.
133
+ * @param string $stripcslashes Optional. To apply a stripcslashes to the text before json_decode. Default 'unescape'.
134
+ * @return mixed PHP Oject or False.
135
+ */
136
+ public static function json_decode($str, $stripcslashes = 'unescape')
137
+ {
138
+ try
139
+ {
140
+ $str = CPCFF_AUXILIARY::clean_json( $str );
141
+ if( $stripcslashes == 'unescape')$str = stripcslashes( $str );
142
+ $obj = json_decode( $str );
143
+ }
144
+ catch( Exception $err ){ self::write_log($err); }
145
+ return ( !empty( $obj ) ) ? $obj : false;
146
+ } // End unserialize
147
+
148
+ /**
149
+ * Replaces recursively the elements in an array by the elements in another one.
150
+ *
151
+ * The method will use the PHP function: array_replace_recursive if exists.
152
+ *
153
+ * @since 1.0.169
154
+ *
155
+ * @param array $array1
156
+ * @param array $array2
157
+ * @return array
158
+ */
159
+ public static function array_replace_recursive($array1, $array2)
160
+ {
161
+ // If the array_replace_recursive function exists, use it
162
+ if(function_exists('array_replace_recursive')) return array_replace_recursive($array1, $array2);
163
+ foreach( $array2 as $key1 => $val1 )
164
+ {
165
+ if( isset( $array1[ $key1 ] ) )
166
+ {
167
+ if( is_array( $val1 ) )
168
+ {
169
+ foreach( $val1 as $key2 => $val2)
170
+ {
171
+ $array1[ $key1 ][ $key2 ] = $val2;
172
+ }
173
+ }
174
+ else
175
+ {
176
+ $array1[ $key1 ] = $val1;
177
+ }
178
+ }
179
+ else
180
+ {
181
+ $array1[ $key1 ] = $val1;
182
+ }
183
+ }
184
+ return $array1;
185
+ } // End array_replace_recursive
186
+
187
+ /**
188
+ * Applies stripcslashes to the array elements recursively.
189
+ *
190
+ * The method checks if parameter is an array a text. If it is an array the method is called recursively.
191
+ *
192
+ * @since 1.0.176
193
+ *
194
+ * @param mixed $v array or single value.
195
+ * @return mixed the array or value with the slashes stripped
196
+ */
197
+ public static function stripcslashes_recursive( $v )
198
+ {
199
+ if(is_array($v))
200
+ {
201
+ foreach($v as $k => $s)
202
+ {
203
+ $v[$k] = self::stripcslashes_recursive($s);
204
+ }
205
+ return $v;
206
+ }
207
+ else
208
+ {
209
+ return stripcslashes($v);
210
+ }
211
+ } // End stripcslashes_recursive
212
+
213
+ /**
214
+ * Checks if the website is being visited by a crawler.
215
+ *
216
+ * Returns true if the website is being visited by a search engine spider,
217
+ * and the plugin was configure for hidding the forms front them, else false.
218
+ *
219
+ * @since 1.0.169
220
+ *
221
+ * @return bool.
222
+ */
223
+ public static function is_crawler()
224
+ {
225
+ return (isset( $_SERVER['HTTP_USER_AGENT'] ) &&
226
+ preg_match( '/bot|crawl|slurp|spider/i', $_SERVER[ 'HTTP_USER_AGENT' ] ) &&
227
+ get_option( 'CP_CALCULATEDFIELDSF_EXCLUDE_CRAWLERS', false )
228
+ );
229
+ } // End is_crawler
230
+
231
+ /**
232
+ * Checks if the page is AMP or not
233
+ *
234
+ * Checks first for the existence of functions: "is_amp_endpoint" or "ampforwp_is_amp_endpoint",
235
+ * and if they don't exists, checks the URL.
236
+ *
237
+ * @since 1.0.190
238
+ *
239
+ * @return bool.
240
+ */
241
+ public static function is_amp()
242
+ {
243
+ if( function_exists('ampforwp_is_amp_endpoint') ) return ampforwp_is_amp_endpoint();
244
+ elseif( function_exists('is_amp_endpoint') )
245
+ {
246
+ if(defined('AMP_QUERY_VAR')) return is_amp_endpoint();
247
+ }
248
+ return false;
249
+ } // End is_amp
250
+
251
+ /**
252
+ * Returns an iframe tag for loading the a webpage with the form only, specially useful for AMP pages.
253
+ *
254
+ * @since 1.0.190
255
+ * @return string, the iframe tag's structure for loading a page with the form.
256
+ */
257
+ public static function get_iframe( $atts )
258
+ {
259
+ $url = self::site_url();
260
+ $url = preg_replace('/^http\:/i', 'https:', $url);
261
+ $url .= (strpos($url, '?') === false) ? '?' : ':';
262
+ $url .= 'cff-form='.((!empty($atts['id']))?$atts['id'] : '');
263
+ $height = '';
264
+ foreach($atts as $attr_name => $attr_value)
265
+ {
266
+ if('amp_iframe_height' == $attr_name) $height = $attr_value;
267
+ elseif('id' != $attr_name) $url .= '&cff-form-attr-'.$attr_name.'='.$attr_value;
268
+ }
269
+
270
+ if(empty($height)) $height = 500;
271
+
272
+ $url .= '&cff-form-height='.$height;
273
+
274
+ // Fixing the isseu with the origin policy in the amp-iframes
275
+ if(preg_match('/^https:\/\/www\./i', $url)) $url = preg_replace('/^https:\/\/www\./i', 'https://', $url);
276
+ else $url = preg_replace('/^https:\/\//i', 'https://www.', $url);
277
+
278
+ add_action('amp_post_template_css', array('CPCFF_AUXILIARY', 'amp_css') );
279
+ add_filter( 'amp_post_template_data', array('CPCFF_AUXILIARY', 'amp_iframe') );
280
+
281
+ return '<amp-iframe id="cff-form-iframe" src="'.esc_attr( esc_url($url)).'" layout="fixed-height" sandbox="allow-popups allow-forms allow-top-navigation allow-modals allow-scripts allow-same-origin" height="'.esc_attr($height).'"><amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBpZD0ic3ZnOCIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMTMuMjI5MTY3IDEzLjIyOTE2NyIgaGVpZ2h0PSI1MCIgd2lkdGg9IjUwIj48ZGVmcyBpZD0iZGVmczIiIC8+PG1ldGFkYXRhIGlkPSJtZXRhZGF0YTUiPjxyZGY6UkRGPjxjYzpXb3JrIHJkZjphYm91dD0iIj48ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD48ZGM6dHlwZSByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPjxkYzp0aXRsZT48L2RjOnRpdGxlPjwvY2M6V29yaz48L3JkZjpSREY+PC9tZXRhZGF0YT48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLC0yODMuNzcwODMpIiBpZD0ibGF5ZXIxIiAvPjwvc3ZnPg==" placeholder layout="responsive" width="50" height="50" /></amp-iframe>';
282
+ }
283
+
284
+ /**
285
+ * Includes the CSS rules for the amp version of form
286
+ *
287
+ * @sinze 1.0.190
288
+ *
289
+ * @param object, template.
290
+ */
291
+ public static function amp_css($template)
292
+ {
293
+ print '#cff-form-iframe{margin:0;}';
294
+ } // End amp_css
295
+
296
+ /**
297
+ * Checks if the amp-iframe.js was included, and includes it if not.
298
+ *
299
+ * @since 1.0.193
300
+ * @param $data, associative array.
301
+ * @return $data, associative array.
302
+ */
303
+ public static function amp_iframe($data)
304
+ {
305
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) )
306
+ {
307
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
308
+ }
309
+ return $data;
310
+ } // End amp_iframe
311
+
312
+ /**
313
+ * Converts the corresponding parameters in an associative array.
314
+ *
315
+ * The parameters with the name cff-form is converted in the id attribute,
316
+ * and the parameteres with the name: cff-form-attr-<param>, are converted in the attributes <param>
317
+ *
318
+ * @since 1.0.190
319
+ * @return array $attrs.
320
+ */
321
+ public static function params_to_attrs()
322
+ {
323
+ $attrs = array();
324
+ if(!empty($_GET))
325
+ {
326
+ foreach($_GET as $param => $value)
327
+ {
328
+ if( $param == 'cff-form')
329
+ $attrs['id'] = @intval($value);
330
+ elseif(preg_match('/^cff\-form\-attr\-/i', $param))
331
+ $attrs[preg_replace('/^cff\-form\-attr\-/i', '', $param)] = $value;
332
+ }
333
+ }
334
+ return $attrs;
335
+ } // End params_to_attrs
336
+
337
+ /**
338
+ * Adds the attribute: property="stylesheet" to the link tag to validate the link tags into the pages' bodies.
339
+ *
340
+ * Checks if it is an stylesheet and adds the property if has not been included previously.
341
+ *
342
+ * @since 1.0.178
343
+ *
344
+ * @param string $tag the link tag.
345
+ * @return string.
346
+ */
347
+ public static function complete_link_tag( $tag )
348
+ {
349
+ if(
350
+ preg_match('/stylesheet/i', $tag) &&
351
+ !preg_match('/property\s*=/i', $tag)
352
+ )
353
+ {
354
+ return str_replace( '/>', ' property="stylesheet" />', $tag );
355
+ }
356
+ return $tag;
357
+ } // End complete_link_tag
358
+
359
+ /**
360
+ * Creates a new entry in the PHP Error Logs.
361
+ *
362
+ * @since 1.0.167
363
+ *
364
+ * @param mixed $log Log message, as text, array or plain object.
365
+ * @return void.
366
+ */
367
+ public static function write_log($log)
368
+ {
369
+ try{
370
+ if(
371
+ defined('WP_DEBUG') &&
372
+ true == WP_DEBUG
373
+ )
374
+ {
375
+ if(
376
+ is_array( $log ) ||
377
+ is_object( $log )
378
+ )
379
+ {
380
+ error_log( print_r( $log, true ) );
381
+ }
382
+ else
383
+ {
384
+ error_log( $log );
385
+ }
386
+ }
387
+ }catch(Exception $err){}
388
+ } // End write_log
389
+
390
+ } // End CPCFF_AUXILIARY
391
+ }
inc/cpcff_banner.inc.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $codepeople_promote_banner_plugins; // Global variable shared by multiple plugins.
3
+ if(empty($codepeople_promote_banner_plugins)) $codepeople_promote_banner_plugins = array();
4
+ $codepeople_promote_banner_plugins[ 'codepeople-calculated-fields-form' ] = array(
5
+ 'plugin_name' => 'Calculated Fields Form',
6
+ 'plugin_url' => 'https://wordpress.org/support/plugin/calculated-fields-form/reviews/#new-post'
7
+ );
8
+
9
+ if(!function_exists( 'codepeople_add_promote_banner' ))
10
+ {
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(
19
+ !empty($_POST['codepeople_promote_banner_plugin']) &&
20
+ !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']])
21
+ )
22
+ {
23
+ set_transient( 'codepeople_promote_banner_'.$_POST['codepeople_promote_banner_plugin'], -1, 0);
24
+ if(
25
+ !empty($_POST['codepeople_promote_banner_action']) &&
26
+ $_POST['codepeople_promote_banner_action'] == 'set-review' &&
27
+ !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])
28
+ )
29
+ {
30
+ print '<script>document.location.href="'.esc_js($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url']).'";</script>';
31
+ }
32
+ }
33
+
34
+ $minimum_days = 86400*7;
35
+ $now = time();
36
+
37
+ foreach($codepeople_promote_banner_plugins as $plugin_slug => $plugin_data )
38
+ {
39
+ $value = get_transient( 'codepeople_promote_banner_'.$plugin_slug );
40
+ if( $value === false )
41
+ {
42
+ $value = $now;
43
+ set_transient( 'codepeople_promote_banner_'.$plugin_slug, $value, 0 );
44
+ }
45
+
46
+ if($minimum_days <= abs($now-$value) && 0<$value)
47
+ {
48
+ ?>
49
+ <style>
50
+ #codepeople-review-banner{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );border:10px solid #1582AB;background:#FFF;display:table;}
51
+ #codepeople-review-banner form{float:left; padding:0 5px;}
52
+ #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
53
+ #codepeople-review-banner .codepeople-review-banner-content{float: left;padding:10px;width: calc( 100% - 160px );width: -webkit-calc( 100% - 160px );width: -moz-calc( 100% - 160px );width: -o-calc( 100% - 160px );}
54
+ #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
55
+ #codepeople-review-banner .no-thank-button,
56
+ #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
57
+ #codepeople-review-banner .main-button{background: #0085ba;border-color: #0073aa #006799 #006799;-webkit-box-shadow: 0 1px 0 #006799;box-shadow: 0 1px 0 #006799;color: #fff;text-decoration: none;text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;}
58
+ #codepeople-review-banner .no-thank-button {color: #555;border-color: #cccccc;background: #f7f7f7;-webkit-box-shadow: 0 1px 0 #cccccc;box-shadow: 0 1px 0 #cccccc;vertical-align: top;}
59
+ #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
60
+ #codepeople-review-banner .no-thank-button:hover,
61
+ #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
62
+ @media screen AND (max-width:760px)
63
+ {
64
+ #codepeople-review-banner{position:relative;top:50px;}
65
+ #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
66
+ #codepeople-review-banner .codepeople-review-banner-content{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );}
67
+ }
68
+ </style>
69
+ <div id="codepeople-review-banner">
70
+ <div class="codepeople-review-banner-picture">
71
+ <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
72
+ </div>
73
+ <div class="codepeople-review-banner-content">
74
+ <div class="codepeople-review-banner-text">
75
+ <p><strong>Want to help to the development of the "<?php print $plugin_data[ 'plugin_name' ]; ?>" plugin?</strong> The main features of this plugin are provided free of charge. We need your help to continue developing it and adding new features. If you want to help with the development please <span style="color:#1582AB;font-weight:bold;">add a review to support it</span>. Thank you!</p>
76
+ </div>
77
+ <div class="codepeople-review-banner-buttons">
78
+ <form method="post" target="_blank">
79
+ <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
80
+ <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
81
+ <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
82
+ </form>
83
+ <form method="post">
84
+ <button class="no-thank-button">No Thanks</button>
85
+ <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
86
+ <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
87
+ </form>
88
+ <div style="clear:both;display:block;"></div>
89
+ </div>
90
+ <div style="clear:both;"></div>
91
+ </div>
92
+ <div style="clear:both;"></div>
93
+ </div>
94
+ <?php
95
+ return;
96
+ }
97
+ }
98
+ }
99
+ add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
100
+ } // End codepeople_promote_banner block
101
+ ?>
inc/cpcff_form.inc.php ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Form class with database interaction, data, and methods.
4
+ *
5
+ * @package CFF.
6
+ * @since 1.0.179
7
+ */
8
+
9
+ if(!class_exists('CPCFF_FORM'))
10
+ {
11
+ /**
12
+ * Class to create create, save, and read the forms data.
13
+ *
14
+ * @since 1.0.179
15
+ */
16
+ class CPCFF_FORM
17
+ {
18
+ /**
19
+ * Form's id
20
+ * Instance property.
21
+ *
22
+ * @var integer $_id
23
+ */
24
+ private $_id;
25
+
26
+ /**
27
+ * Form's settings
28
+ * Instance property.
29
+ *
30
+ * @var array $_settings. Associative array with the form's settings.
31
+ */
32
+ private $_settings;
33
+
34
+ /**
35
+ * Form's fields
36
+ * Instance property.
37
+ *
38
+ * @var array $_fields. Associative array with the form's fields.
39
+ */
40
+ private $_fields;
41
+
42
+ /*********************************** PUBLIC METHODS ********************************************/
43
+
44
+ /**
45
+ * Constructs a CPCFF_FORM object.
46
+ *
47
+ * @param integer $id the form's id.
48
+ */
49
+ public function __construct( $id )
50
+ {
51
+ $this->_id = $id;
52
+ $this->_settings = array();
53
+ $this->_fields = array();
54
+ } // End __construct
55
+
56
+ /**
57
+ * Creates a new form with the default data, and the name passed as parameter,
58
+ * and returns an instance of the CPCFF_FORM class.
59
+ *
60
+ * @param string $form_name. The form's name displayed in the settings page of the plugin.
61
+ *
62
+ * @return object.
63
+ */
64
+ static public function create_default( $form_name )
65
+ {
66
+ global $wpdb, $cpcff_default_texts_array;
67
+
68
+ if(
69
+ $wpdb->insert(
70
+ $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE,
71
+ array(
72
+ // Form name
73
+ 'form_name' => stripcslashes($form_name),
74
+
75
+ // Form structure
76
+ 'form_structure' => CP_CALCULATEDFIELDSF_DEFAULT_form_structure,
77
+
78
+ // Notification email
79
+ 'fp_from_email' => CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email,
80
+ 'fp_destination_emails' => CP_CALCULATEDFIELDSF_DEFAULT_fp_destination_emails,
81
+ 'fp_subject' => CP_CALCULATEDFIELDSF_DEFAULT_fp_subject,
82
+ 'fp_inc_additional_info' => CP_CALCULATEDFIELDSF_DEFAULT_fp_inc_additional_info,
83
+ 'fp_return_page' => CP_CALCULATEDFIELDSF_DEFAULT_fp_return_page,
84
+ 'fp_message' => CP_CALCULATEDFIELDSF_DEFAULT_fp_message,
85
+
86
+ // Notification email copy to the user
87
+ 'cu_enable_copy_to_user' => CP_CALCULATEDFIELDSF_DEFAULT_cu_enable_copy_to_user,
88
+ 'cu_user_email_field' => CP_CALCULATEDFIELDSF_DEFAULT_cu_user_email_field,
89
+ 'cu_subject' => CP_CALCULATEDFIELDSF_DEFAULT_cu_subject,
90
+ 'cu_message' => CP_CALCULATEDFIELDSF_DEFAULT_cu_message,
91
+
92
+ // Activate validation and validation's texts
93
+ 'vs_use_validation' => CP_CALCULATEDFIELDSF_DEFAULT_vs_use_validation,
94
+ 'vs_text_is_required' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required,
95
+ 'vs_text_is_email' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email,
96
+ 'vs_text_datemmddyyyy' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy,
97
+ 'vs_text_dateddmmyyyy' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy,
98
+ 'vs_text_number' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number,
99
+ 'vs_text_digits' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits,
100
+ 'vs_text_max' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max,
101
+ 'vs_text_min' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min,
102
+ 'vs_all_texts' => serialize($cpcff_default_texts_array),
103
+
104
+ // Paypal settings
105
+ 'enable_paypal' => CP_CALCULATEDFIELDSF_DEFAULT_ENABLE_PAYPAL,
106
+ 'paypal_email' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_EMAIL,
107
+ 'request_cost' => CP_CALCULATEDFIELDSF_DEFAULT_COST,
108
+ 'paypal_product_name' => CP_CALCULATEDFIELDSF_DEFAULT_PRODUCT_NAME,
109
+ 'currency' => CP_CALCULATEDFIELDSF_DEFAULT_CURRENCY,
110
+ 'paypal_language' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_LANGUAGE,
111
+
112
+ // Captcha settings
113
+ 'cv_enable_captcha' => CP_CALCULATEDFIELDSF_DEFAULT_cv_enable_captcha,
114
+ 'cv_width' => CP_CALCULATEDFIELDSF_DEFAULT_cv_width,
115
+ 'cv_height' => CP_CALCULATEDFIELDSF_DEFAULT_cv_height,
116
+ 'cv_chars' => CP_CALCULATEDFIELDSF_DEFAULT_cv_chars,
117
+ 'cv_font' => CP_CALCULATEDFIELDSF_DEFAULT_cv_font,
118
+ 'cv_min_font_size' => CP_CALCULATEDFIELDSF_DEFAULT_cv_min_font_size,
119
+ 'cv_max_font_size' => CP_CALCULATEDFIELDSF_DEFAULT_cv_max_font_size,
120
+ 'cv_noise' => CP_CALCULATEDFIELDSF_DEFAULT_cv_noise,
121
+ 'cv_noise_length' => CP_CALCULATEDFIELDSF_DEFAULT_cv_noise_length,
122
+ 'cv_background' => CP_CALCULATEDFIELDSF_DEFAULT_cv_background,
123
+ 'cv_border' => CP_CALCULATEDFIELDSF_DEFAULT_cv_border,
124
+ 'cv_text_enter_valid_captcha' => CP_CALCULATEDFIELDSF_DEFAULT_cv_text_enter_valid_captcha
125
+ ),
126
+ array(
127
+ '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'
128
+ )
129
+ )
130
+ )
131
+ {
132
+ return new Self($wpdb->insert_id);
133
+ }
134
+ return false;
135
+ } // End create_default
136
+
137
+ /**
138
+ * Clones the current form.
139
+ *
140
+ * @return mixed, a new instance of the CPCFF_FORM or false.
141
+ */
142
+ public function clone_form()
143
+ {
144
+ global $wpdb;
145
+
146
+ $row = $this->_get_settings();
147
+ if(!empty($row))
148
+ {
149
+ unset($row["id"]);
150
+ $row["form_name"] = 'Cloned: '.$row["form_name"];
151
+ if($wpdb->insert( $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE, $row)) return new self($wpdb->insert_id);
152
+ }
153
+ return false;
154
+ } // End clone_form
155
+
156
+ /**
157
+ * Returns the id of current form.
158
+ *
159
+ * @return integer
160
+ */
161
+ public function get_id()
162
+ {
163
+ return $this->_id;
164
+ } // end get_id
165
+
166
+ /**
167
+ * Reads the corresponding attribute in the form's settings.
168
+ *
169
+ * Reads the attribute in the form's settings, and if it does not exists returns the default value.
170
+ * Applies the filter cpcff_get_option
171
+ *
172
+ * @param string, name of the attribute to read.
173
+ * @param mixes, default value of the attribute.
174
+ * @return mixed, it depends of the option to read.
175
+ */
176
+ public function get_option( $option, $default )
177
+ {
178
+ // Initialize the value with the default values
179
+ $value = $default;
180
+ $this->_get_settings();
181
+
182
+ if(isset($this->_settings[$option])) $value = @$this->_settings[$option];
183
+
184
+ // If the form's structure is a JSON text decodes it.
185
+ if(
186
+ $option == 'form_structure' &&
187
+ !is_array( $value )
188
+ )
189
+ {
190
+ $form_data = CPCFF_AUXILIARY::json_decode( $value, 'normal' );
191
+ if(!is_null($form_data))
192
+ {
193
+ $value = $this->_settings['form_structure'] = $form_data;
194
+ }
195
+ }
196
+
197
+ // If the texts where not defined previously populate them with the default values
198
+ if (
199
+ $option == 'vs_all_texts' &&
200
+ empty( $value )
201
+ )
202
+ {
203
+ $value = $default;
204
+ }
205
+
206
+ /**
207
+ * Filters applied before returning a form option,
208
+ * use three parameters: The value of option, the name of option and the form's id
209
+ * returns the new option's value
210
+ */
211
+ $value = apply_filters( 'cpcff_get_option', $value, $option, $this->_id );
212
+
213
+ return $value;
214
+ } // End get_option
215
+
216
+ /**
217
+ * Returns the list of fields in the forms.
218
+ *
219
+ * @return array, associative array of objects where the fields' names are the indices and fields' structures the values.
220
+ */
221
+ public function get_fields()
222
+ {
223
+ if(!empty($this->_fields)) return $this->_fields;
224
+
225
+ $form_structure = $this->get_option('form_structure', array());
226
+ if(!empty($form_structure[0]))
227
+ {
228
+ foreach($form_structure[0] as $field)
229
+ $this->_fields[$field->name] = $field;
230
+ }
231
+ return $this->_fields;
232
+ } // End get_fields
233
+
234
+ public function save_settings( $params )
235
+ {
236
+ global $wpdb, $cpcff_default_texts_array;
237
+ $data = array(
238
+ 'form_structure' => (isset($params['form_structure'])) ? $params['form_structure'] : CP_CALCULATEDFIELDSF_DEFAULT_form_structure,
239
+
240
+ // Notification email
241
+ 'fp_from_email' => (isset($params['fp_from_email']))? trim($params['fp_from_email']) : '',
242
+ 'fp_destination_emails' => (isset($params['fp_destination_emails'])) ? trim($params['fp_destination_emails']) : '',
243
+ 'fp_subject' => (isset($params['fp_subject'])) ? $params['fp_subject'] : '',
244
+ 'fp_inc_additional_info' => (isset($params['fp_inc_additional_info']) && $params['fp_inc_additional_info'] == 'true') ? 'true' : 'false',
245
+ 'fp_return_page' => (isset($params['fp_return_page'])) ? trim($params['fp_return_page']) : '',
246
+ 'fp_message' => (isset($params['fp_message'])) ? $params['fp_message'] : '',
247
+ 'fp_emailformat' => (isset($params['fp_emailformat']) && $params['fp_emailformat'] == 'text') ? 'text' : 'html',
248
+
249
+ // Notification email copy to the user
250
+ 'cu_enable_copy_to_user' => (isset($params['cu_enable_copy_to_user']) && $params['cu_enable_copy_to_user'] == 'true') ? 'true' : 'false',
251
+ 'cu_user_email_field' => (!empty($params['cu_user_email_field']))? $params[ 'cu_user_email_field' ] : '',
252
+ 'cu_subject' => (isset($params['cu_subject'])) ? $params['cu_subject'] : '',
253
+ 'cu_message' => (isset($params['cu_message'])) ? $params['cu_message'] : '',
254
+ 'cu_emailformat' => (isset($params['cu_emailformat']) && $params['cu_emailformat'] == 'text') ? 'text' : 'html',
255
+
256
+ // PayPal settings
257
+ 'enable_paypal' => (isset($params["enable_paypal"])) ? $params["enable_paypal"] : 0,
258
+ 'paypal_email' => (isset($params["paypal_email"])) ? trim($params["paypal_email"]) : '',
259
+ 'request_cost' => (isset($params["request_cost"])) ? trim($params["request_cost"]) : '',
260
+ 'paypal_product_name' => (isset($params["paypal_product_name"])) ? $params["paypal_product_name"] : '',
261
+ 'currency' => (isset($params["currency"])) ? trim($params["currency"]) : 'USD',
262
+ 'paypal_language' => (isset($params["paypal_language"])) ? trim($params["paypal_language"]) : 'EN',
263
+ 'paypal_mode' => (isset($params["paypal_mode"])) ? $params["paypal_mode"] : 'production',
264
+ 'paypal_recurrent' => (isset($params["paypal_recurrent"])) ? $params["paypal_recurrent"] : 0,
265
+ 'paypal_identify_prices' => (isset($params['paypal_identify_prices'])) ? $params['paypal_identify_prices'] : '0',
266
+ 'paypal_zero_payment' => (isset($params["paypal_zero_payment"])) ? $params["paypal_zero_payment"] : 0,
267
+
268
+ // Texts
269
+ 'vs_use_validation' => (isset($params['vs_use_validation'])) ? $params['vs_use_validation'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_use_validation,
270
+ 'vs_text_is_required' => (isset($params['vs_text_is_required'])) ? $params['vs_text_is_required'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required,
271
+ 'vs_text_is_email' => (isset($params['vs_text_is_email'])) ? $params['vs_text_is_email'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email,
272
+ 'vs_text_datemmddyyyy' => (isset($params['vs_text_datemmddyyyy'])) ? $params['vs_text_datemmddyyyy'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy,
273
+ 'vs_text_dateddmmyyyy' => (isset($params['vs_text_dateddmmyyyy'])) ? $params['vs_text_dateddmmyyyy'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy,
274
+ 'vs_text_number' => (isset($params['vs_text_number'])) ? $params['vs_text_number'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number,
275
+ 'vs_text_digits' => (isset($params['vs_text_digits'])) ? $params['vs_text_digits'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits,
276
+ 'vs_text_max' => (isset($params['vs_text_max'])) ? $params['vs_text_max'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max,
277
+ 'vs_text_min' => (isset($params['vs_text_min'])) ? $params['vs_text_min'] : CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min,
278
+ 'vs_text_previousbtn' => (isset($params['vs_text_previousbtn'])) ? $params['vs_text_previousbtn'] : 'Previous',
279
+ 'vs_text_nextbtn' => (isset($params['vs_text_nextbtn'])) ? $params['vs_text_nextbtn'] : 'Next',
280
+ 'vs_all_texts' => (isset($params['vs_all_texts'])) ? serialize($params['vs_all_texts']) : serialize($cpcff_default_texts_array),
281
+
282
+ // Captcha settings
283
+ 'cv_enable_captcha' => (isset($params['cv_enable_captcha'])) ? $params['cv_enable_captcha'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_enable_captcha,
284
+ 'cv_width' => (isset($params['cv_width'])) ? $params['cv_width'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_width,
285
+ 'cv_height' => (isset($params['cv_height'])) ? $params['cv_height'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_height,
286
+ 'cv_chars' => (isset($params['cv_chars'])) ? $params['cv_chars'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_chars,
287
+ 'cv_font' => (isset($params['cv_font'])) ? $params['cv_font'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_font,
288
+ 'cv_min_font_size' => (isset($params['cv_min_font_size'])) ? $params['cv_min_font_size'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_min_font_size,
289
+ 'cv_max_font_size' => (isset($params['cv_max_font_size'])) ? $params['cv_max_font_size'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_max_font_size,
290
+ 'cv_noise' => (isset($params['cv_noise'])) ? $params['cv_noise'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_noise,
291
+ 'cv_noise_length' => (isset($params['cv_noise_length'])) ? $params['cv_noise_length'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_noise_length,
292
+ 'cv_background' => (isset($params['cv_background'])) ? $params['cv_background'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_background,
293
+ 'cv_border' => (isset($params['cv_border'])) ? $params['cv_border'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_border,
294
+ 'cv_text_enter_valid_captcha' => (isset($params['cv_text_enter_valid_captcha'])) ? $params['cv_text_enter_valid_captcha'] : CP_CALCULATEDFIELDSF_DEFAULT_cv_text_enter_valid_captcha
295
+ );
296
+
297
+ return $wpdb->update (
298
+ $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE,
299
+ $data,
300
+ array( 'id' => $this->_id ),
301
+ array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ),
302
+ array( '%d' )
303
+ );
304
+ } // End save_settings
305
+
306
+ /**
307
+ * Updates the form's name
308
+ *
309
+ * @param string $form_name
310
+ *
311
+ * @return bool
312
+ */
313
+ public function update_name($form_name)
314
+ {
315
+ global $wpdb;
316
+ return $wpdb->update(
317
+ $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE,
318
+ array('form_name'=>$form_name),
319
+ array('id' => $this->_id),
320
+ array('%s'),
321
+ array('%d')
322
+ );
323
+ } // End update_name
324
+
325
+ /**
326
+ * Deletes the current form.
327
+ *
328
+ * @return mixed the number of deleted columns or false.
329
+ */
330
+ public function delete_form()
331
+ {
332
+ global $wpdb;
333
+ return $wpdb->delete(
334
+ $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE,
335
+ array('id' => $this->_id),
336
+ array('%d')
337
+ );
338
+ }
339
+ /*********************************** PRIVATE METHODS ********************************************/
340
+
341
+ /**
342
+ * Returns the form's settings.
343
+ * Checks if the settings were read previously, before reading the data from database.
344
+ *
345
+ * @since 1.0.184
346
+ *
347
+ * @return array, associative array with the database row.
348
+ */
349
+ private function _get_settings()
350
+ {
351
+ global $wpdb;
352
+ if(empty($this->_settings))
353
+ {
354
+ $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE." WHERE id=%d", $this->_id), ARRAY_A);
355
+
356
+ if(!empty($row)) $this->_settings = $row;
357
+ }
358
+ return $this->_settings;
359
+ } // End _get_settings
360
+ } // End CPCFF_FORM
361
+ }
inc/cpcff_install_uninstall.inc.php ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Install/Uninstall plugin: CPCFF_INSTALLER class
4
+ *
5
+ * Contains the CPCFF_INSTALLER metaclass for install and uninstall the plugin.
6
+ *
7
+ * @package CFF
8
+ * @since 1.0.168
9
+ */
10
+
11
+ if(!class_exists('CPCFF_INSTALLER'))
12
+ {
13
+ /**
14
+ * Installs/Uninstalls the plugin.
15
+ *
16
+ * Metaclass to creates the database's tables, with the predefined forms, and create the resource files.
17
+ *
18
+ * @since 1.0.168
19
+ */
20
+ class CPCFF_INSTALLER
21
+ {
22
+ /**
23
+ * Creates the database structure and resource files in every new blog.
24
+ * The method is called by the 'wpmu_new_blog' hook.
25
+ *
26
+ * @param int $blog_id Blog ID.
27
+ * @param int $user_id User ID.
28
+ * @param string $domain Site domain.
29
+ * @param string $path Site path.
30
+ * @param int $site_id Site ID. Only relevant on multi-network installs.
31
+ * @param array $meta Meta data. Used to set initial site options.
32
+ */
33
+ public static function new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta)
34
+ {
35
+ if (is_plugin_active_for_network('calculated-fields-form/cp_calculatedfieldsf_free.php'))
36
+ {
37
+ global $wpdb;
38
+ $old_blog = $wpdb->blogid;
39
+ switch_to_blog($blog_id);
40
+ self::_db_structure();
41
+ switch_to_blog($old_blog);
42
+ }
43
+ } // End new_blog
44
+
45
+ /**
46
+ * Creates the database tables and resources in every existent blog on website.
47
+ *
48
+ * @param bool $networkwide Multisite installation.
49
+ */
50
+ public static function install($networkwide)
51
+ {
52
+ // check if it is a network activation - if so, run the activation function for each blog id
53
+ if(
54
+ function_exists('is_multisite') &&
55
+ is_multisite() &&
56
+ $networkwide
57
+ )
58
+ {
59
+ global $wpdb;
60
+ $old_blog = $wpdb->blogid;
61
+
62
+ // Get all blog ids
63
+ $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
64
+ foreach ($blogids as $blog_id)
65
+ {
66
+ switch_to_blog($blog_id);
67
+ self::_db_structure();
68
+ }
69
+ switch_to_blog($old_blog);
70
+ return;
71
+ }
72
+ self::_db_structure();
73
+ } //End install
74
+
75
+ /**
76
+ * Creates a backup of the insert_in_database file.
77
+ */
78
+ public static function uninstall()
79
+ {
80
+ } // End uninstall
81
+
82
+ /**
83
+ * Creates the database tables used by the plugin's core.
84
+ *
85
+ * Creates the database tables, alters the tables created by the free version of the plugin.
86
+ *
87
+ * @access private.
88
+ * @return void.
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,
102
+ ipaddr VARCHAR(41) DEFAULT '' NOT NULL,
103
+ notifyto VARCHAR(250) DEFAULT '' NOT NULL,
104
+ data mediumtext,
105
+ paypal_post mediumtext,
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,
132
+ discount VARCHAR(250) DEFAULT '' NOT NULL,
133
+ expires datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
134
+ availability int(10) unsigned NOT NULL DEFAULT 0,
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,
152
+ fp_inc_additional_info VARCHAR(10) DEFAULT '' NOT NULL,
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,
170
+ vs_text_datemmddyyyy VARCHAR(250) DEFAULT '' NOT NULL,
171
+ vs_text_dateddmmyyyy VARCHAR(250) DEFAULT '' NOT NULL,
172
+ vs_text_number VARCHAR(250) DEFAULT '' NOT NULL,
173
+ vs_text_digits VARCHAR(250) DEFAULT '' NOT NULL,
174
+ vs_text_max VARCHAR(250) DEFAULT '' NOT NULL,
175
+ vs_text_min VARCHAR(250) DEFAULT '' NOT NULL,
176
+ vs_text_submitbtn VARCHAR(250) DEFAULT '' NOT NULL,
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,
184
+ paypal_email varchar(255) DEFAULT '' NOT NULL ,
185
+ request_cost varchar(255) DEFAULT '' NOT NULL ,
186
+ paypal_product_name varchar(255) DEFAULT '' NOT NULL,
187
+ currency varchar(10) DEFAULT '' NOT NULL,
188
+ paypal_language varchar(10) DEFAULT '' NOT NULL,
189
+ paypal_mode varchar(20) DEFAULT '' NOT NULL ,
190
+ paypal_recurrent varchar(20) DEFAULT '' NOT NULL ,
191
+ paypal_recurrent_setup varchar(20) DEFAULT '' NOT NULL ,
192
+ paypal_recurrent_setup_days varchar(20) DEFAULT '' NOT NULL ,
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,
200
+ cv_chars VARCHAR(20) DEFAULT '' NOT NULL,
201
+ cv_font VARCHAR(20) DEFAULT '' NOT NULL,
202
+ cv_min_font_size VARCHAR(20) DEFAULT '' NOT NULL,
203
+ cv_max_font_size VARCHAR(20) DEFAULT '' NOT NULL,
204
+ cv_noise VARCHAR(20) DEFAULT '' NOT NULL,
205
+ cv_noise_length VARCHAR(20) DEFAULT '' NOT NULL,
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
+ } // End _db_structure
265
+
266
+ /**
267
+ * Inserts the predefined forms into the Forms table
268
+ */
269
+ private static function _predefined_forms()
270
+ {
271
+ global $wpdb;
272
+ $table_name = $wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE;
273
+ $count = $wpdb->get_var("SELECT COUNT(id) FROM ".$table_name);
274
+ if(!$count)
275
+ {
276
+ cpcff_init_constants();
277
+ $values = array( 'fp_from_email' => CP_CALCULATEDFIELDSF_DEFAULT_fp_from_email,
278
+ 'fp_destination_emails' => CP_CALCULATEDFIELDSF_DEFAULT_fp_destination_emails,
279
+ 'fp_subject' => CP_CALCULATEDFIELDSF_DEFAULT_fp_subject,
280
+ 'fp_inc_additional_info' => CP_CALCULATEDFIELDSF_DEFAULT_fp_inc_additional_info,
281
+ 'fp_return_page' => CP_CALCULATEDFIELDSF_DEFAULT_fp_return_page,
282
+ 'fp_message' => CP_CALCULATEDFIELDSF_DEFAULT_fp_message,
283
+ 'fp_emailformat' => CP_CALCULATEDFIELDSF_DEFAULT_email_format,
284
+
285
+ 'cu_enable_copy_to_user' => CP_CALCULATEDFIELDSF_DEFAULT_cu_enable_copy_to_user,
286
+ 'cu_user_email_field' => CP_CALCULATEDFIELDSF_DEFAULT_cu_user_email_field,
287
+ 'cu_subject' => CP_CALCULATEDFIELDSF_DEFAULT_cu_subject,
288
+ 'cu_message' => CP_CALCULATEDFIELDSF_DEFAULT_cu_message,
289
+ 'cu_emailformat' => CP_CALCULATEDFIELDSF_DEFAULT_email_format,
290
+
291
+ 'vs_use_validation' => CP_CALCULATEDFIELDSF_DEFAULT_vs_use_validation,
292
+ 'vs_text_is_required' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required,
293
+ 'vs_text_is_email' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email,
294
+ 'vs_text_datemmddyyyy' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy,
295
+ 'vs_text_dateddmmyyyy' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy,
296
+ 'vs_text_number' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number,
297
+ 'vs_text_digits' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits,
298
+ 'vs_text_max' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max,
299
+ 'vs_text_min' => CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min,
300
+ 'vs_text_submitbtn' => 'Submit',
301
+ 'vs_text_previousbtn' => 'Previous',
302
+ 'vs_text_nextbtn' => 'Next',
303
+
304
+ 'enable_paypal' => CP_CALCULATEDFIELDSF_DEFAULT_ENABLE_PAYPAL,
305
+ 'enable_submit' => '',
306
+ 'paypal_notiemails' => '0',
307
+ 'paypal_email' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_EMAIL,
308
+ 'request_cost' => CP_CALCULATEDFIELDSF_DEFAULT_COST,
309
+ 'paypal_product_name' => CP_CALCULATEDFIELDSF_DEFAULT_PRODUCT_NAME,
310
+ 'currency' => CP_CALCULATEDFIELDSF_DEFAULT_CURRENCY,
311
+ 'paypal_language' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_LANGUAGE,
312
+ 'paypal_mode' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_MODE,
313
+ 'paypal_recurrent' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_RECURRENT,
314
+ 'paypal_recurrent_setup' => '',
315
+ 'paypal_recurrent_setup_days' => '15',
316
+ 'paypal_identify_prices' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_IDENTIFY_PRICES,
317
+ 'paypal_zero_payment' => CP_CALCULATEDFIELDSF_DEFAULT_PAYPAL_ZERO_PAYMENT,
318
+
319
+ 'cv_enable_captcha' => CP_CALCULATEDFIELDSF_DEFAULT_cv_enable_captcha,
320
+ 'cv_width' => CP_CALCULATEDFIELDSF_DEFAULT_cv_width,
321
+ 'cv_height' => CP_CALCULATEDFIELDSF_DEFAULT_cv_height,
322
+ 'cv_chars' => CP_CALCULATEDFIELDSF_DEFAULT_cv_chars,
323
+ 'cv_font' => CP_CALCULATEDFIELDSF_DEFAULT_cv_font,
324
+ 'cv_min_font_size' => CP_CALCULATEDFIELDSF_DEFAULT_cv_min_font_size,
325
+ 'cv_max_font_size' => CP_CALCULATEDFIELDSF_DEFAULT_cv_max_font_size,
326
+ 'cv_noise' => CP_CALCULATEDFIELDSF_DEFAULT_cv_noise,
327
+ 'cv_noise_length' => CP_CALCULATEDFIELDSF_DEFAULT_cv_noise_length,
328
+ 'cv_background' => CP_CALCULATEDFIELDSF_DEFAULT_cv_background,
329
+ 'cv_border' => CP_CALCULATEDFIELDSF_DEFAULT_cv_border,
330
+ 'cv_text_enter_valid_captcha' => CP_CALCULATEDFIELDSF_DEFAULT_cv_text_enter_valid_captcha
331
+ );
332
+ $values['id'] = 1;
333
+ $values['form_name'] = 'Simple Operations';
334
+ $values['form_structure'] = CP_CALCULATEDFIELDSF_DEFAULT_form_structure1;
335
+ $wpdb->insert( $table_name, $values );
336
+ $values['id'] = 2;
337
+ $values['form_name'] = 'Calculation with Dates';
338
+ $values['form_structure'] = CP_CALCULATEDFIELDSF_DEFAULT_form_structure2;
339
+ $wpdb->insert( $table_name, $values );
340
+ $values['id'] = 3;
341
+ $values['form_name'] = 'Ideal Weight Calculator';
342
+ $values['form_structure'] = CP_CALCULATEDFIELDSF_DEFAULT_form_structure3;
343
+ $wpdb->insert( $table_name, $values );
344
+ $values['id'] = 4;
345
+ $values['form_name'] = 'Pregnancy Calculator';
346
+ $values['form_structure'] = CP_CALCULATEDFIELDSF_DEFAULT_form_structure4;
347
+ $wpdb->insert( $table_name, $values );
348
+ $values['id'] = 5;
349
+ $values['form_name'] = 'Lease Calculator';
350
+ $values['form_structure'] = CP_CALCULATEDFIELDSF_DEFAULT_form_structure5;
351
+ $wpdb->insert( $table_name, $values );
352
+ }
353
+ } // End _predefined_forms
354
+
355
+ } // End class CPCFF_INSTALLER
356
+ }
inc/cpcff_main.inc.php ADDED
@@ -0,0 +1,896 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Main class with main actions and filters: CPCFF_MAIN class
4
+ *
5
+ * @package CFF.
6
+ * @since 1.0.170
7
+ */
8
+
9
+ if(!class_exists('CPCFF_MAIN'))
10
+ {
11
+ /**
12
+ * Class that defines the main actions and filters, and plugin's functionalities.
13
+ *
14
+ * @since 1.0.170
15
+ */
16
+ class CPCFF_MAIN
17
+ {
18
+ /**
19
+ * Counter of forms in a same page
20
+ * Metaclass property.
21
+ *
22
+ * @since 1.0.170
23
+ * @var int $form_counter
24
+ */
25
+ public static $form_counter = 0;
26
+
27
+ /**
28
+ * Instance of the CPCFF_MAIN class
29
+ * Metaclass property to implement a singleton.
30
+ *
31
+ * @since 1.0.179
32
+ * @var object $_instance
33
+ */
34
+ private static $_instance;
35
+
36
+ /**
37
+ * Identifies if the class was instanciated from the public website or WordPress
38
+ * Instance property.
39
+ *
40
+ * @sinze 1.0.170
41
+ * @var bool $_is_admin
42
+ */
43
+ private $_is_admin = false;
44
+
45
+ /**
46
+ * Plugin URL
47
+ * Instance property.
48
+ *
49
+ * @sinze 1.0.170
50
+ * @var string $_plugin_url
51
+ */
52
+ private $_plugin_url;
53
+
54
+ /**
55
+ * Flag to know if the public resources were included
56
+ * Instance property.
57
+ *
58
+ * @sinze 1.0.170
59
+ * @var bool $_are_resources_loaded default false
60
+ */
61
+ private $_are_resources_loaded = false;
62
+
63
+ /**
64
+ * Forms list.
65
+ * List of instances of the CPCFF_FORM class.
66
+ * Instance property.
67
+ *
68
+ * @sinze 1.0.179
69
+ * @var object $_active_form
70
+ */
71
+ private $_forms = array();
72
+
73
+ /**
74
+ * Constructs a CPCFF_MAIN object, and define the hooks to the filters and actions.
75
+ * The constructor is private because this class is a singleton
76
+ */
77
+ private function __construct()
78
+ {
79
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/inc/cpcff_form.inc.php';
80
+
81
+ // Initializes the $_is_admin property
82
+ $this->_is_admin = is_admin();
83
+
84
+ // Initializes the $_plugin_url property
85
+ $this->_plugin_url = plugin_dir_url(CP_CALCULATEDFIELDSF_MAIN_FILE_PATH);
86
+
87
+ // Plugin activation/deactivation
88
+ $this->_activate_deactivate();
89
+
90
+ // Load the language file
91
+ add_action( 'plugins_loaded', array($this, 'plugins_loaded') );
92
+
93
+ // Run the initialization code
94
+ add_action( 'init', array($this, 'init'), 1 );
95
+ add_action( 'init', array($this, 'amp_init') ); // for amp pages.
96
+
97
+ // Run the initialization code of widgets
98
+ add_action( 'widgets_init', array($this, 'widgets_init'), 1 );
99
+
100
+ } // End __construct
101
+
102
+ /**
103
+ * Returns the instance of the singleton.
104
+ *
105
+ * @since 1.0.179
106
+ * @return object self::$_instance
107
+ */
108
+ public static function instance()
109
+ {
110
+ if(!isset(self::$_instance))
111
+ {
112
+ self::$_instance = new self();
113
+ }
114
+ return self::$_instance;
115
+ } // End init
116
+
117
+ /**
118
+ * Loads the primary resources, previous to the plugin's initialization
119
+ *
120
+ * Loads resources like the laguages files, etc.
121
+ *
122
+ * @return void.
123
+ */
124
+ public function plugins_loaded()
125
+ {
126
+ // Load the language file
127
+ $this->_textdomain();
128
+
129
+ // Load controls scripts
130
+ $this->_load_controls_scrips();
131
+ } // End plugins_loaded
132
+
133
+ /**
134
+ * Initializes the plugin, runs as soon as possible.
135
+ *
136
+ * Initilize the plugin's sections, intercepts the submissions, generates the resources etc.
137
+ *
138
+ * @return void.
139
+ */
140
+ public function init()
141
+ {
142
+ if ( $this->_is_admin ) // Initializes the WordPress modules.
143
+ {
144
+ // Adds the plugin links in the plugins sections
145
+ add_filter( 'plugin_action_links_'.CP_CALCULATEDFIELDSF_BASE_NAME, array($this, 'links' ) );
146
+
147
+ // Creates the menu entries in the WordPress menu.
148
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
149
+
150
+ // Displays the shortcode insertion buttons.
151
+ add_action( 'media_buttons', array( $this, 'media_buttons' ) );
152
+
153
+ // Loads the admin resources
154
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_resources' ), 1 );
155
+ add_action('enqueue_block_editor_assets', array($this,'gutenberg_editor'));
156
+ }
157
+ else // Initializes the public modules.
158
+ {
159
+ $this->_define_shortcodes();
160
+ }
161
+ } // End init
162
+
163
+ /**
164
+ * Loads the form's preview in AMP pages.
165
+ *
166
+ * @return void.
167
+ */
168
+ public function amp_init()
169
+ {
170
+ if(!empty($_GET['cff-form']))
171
+ {
172
+ $this->form_preview(
173
+ array(
174
+ 'shortcode_atts' => CPCFF_AUXILIARY::params_to_attrs(),
175
+ 'amp' => 1,
176
+ 'page_title' => __('CFF Form', 'calculated-fields-form'),
177
+ 'height' => (!empty($_REQUEST['cff-form-height'])) ? @intval($_REQUEST['cff-form-height']) : 500
178
+ )
179
+ );
180
+ }
181
+ } // End amp_init
182
+
183
+ /**
184
+ * Registers the widgets.
185
+ *
186
+ * Registers the widget to include the forms on sidebars, and for loading the data collected by the forms in the dashboard.
187
+ *
188
+ * @since 1.0.178
189
+ *
190
+ * @return void.
191
+ */
192
+ public function widgets_init()
193
+ {
194
+ // Replace the shortcodes into the text widgets.
195
+ if(!$this->_is_admin) add_filter('widget_text', 'do_shortcode');
196
+ } // End widgets_init
197
+
198
+ /**
199
+ * Adds the plugin's links in the plugins section.
200
+ *
201
+ * Links for accessing to the help, settings, developers website, etc.
202
+ *
203
+ * @param array $links.
204
+ *
205
+ * @return array.
206
+ */
207
+ public function links( $links )
208
+ {
209
+ array_unshift(
210
+ $links,
211
+ '<a href="https://cff.dwbooster.com/customization" target="_blank">'.__('Request custom changes').'</a>',
212
+ '<a href="admin.php?page=cp_calculated_fields_form">'.__('Settings').'</a>',
213
+ '<a href="https://cff.dwbooster.com/download" target="_blank">'.__('Upgrade').'</a>',
214
+ '<a href="https://wordpress.org/support/plugin/calculated-fields-form#new-post" target="_blank">'.__('Help').'</a>'
215
+ );
216
+ return $links;
217
+ } // End links
218
+
219
+ /**
220
+ * Prints the buttons for inserting the different shortcodes into the pages/posts contents.
221
+ *
222
+ * Prints the HTML code that appears beside the media button with the icons and code to insert the shortcodes:
223
+ *
224
+ * - CP_CALCULATED_FIELDS
225
+ * - CP_CALCULATED_FIELDS_VAR
226
+ *
227
+ * @return void.
228
+ */
229
+ public function media_buttons()
230
+ {
231
+ print '<a href="javascript:cp_calculatedfieldsf_insertForm();" title="'.esc_attr__('Insert Calculated Fields Form', 'calculated-fields-form' ).'"><img src="'.$this->_plugin_url.'images/cp_form.gif" alt="'.esc_attr__('Insert Calculated Fields Form', 'calculated-fields-form' ).'" /></a><a href="javascript:cp_calculatedfieldsf_insertVar();" title="'.esc_attr__('Create a JavaScript var from POST, GET, SESSION, or COOKIE var', 'calculated-fields-form' ).'"><img src="'.$this->_plugin_url.'images/cp_var.gif" alt="'.esc_attr__('Create a JavaScript var from POST, GET, SESSION, or COOKIE var', 'calculated-fields-form' ).'" /></a>';
232
+ } // End media_buttons
233
+
234
+ /**
235
+ * Generates the entries in the WordPress menu.
236
+ *
237
+ * @return void.
238
+ */
239
+ public function admin_menu()
240
+ {
241
+ // Settings page
242
+ add_options_page('Calculated Fields Form Options', 'Calculated Fields Form', 'manage_options', 'cp_calculated_fields_form', array($this, 'admin_pages') );
243
+
244
+ // Menu option
245
+ add_menu_page( 'Calculated Fields Form Options', 'Calculated Fields Form', 'manage_options', 'cp_calculated_fields_form', array($this, 'admin_pages') );
246
+
247
+ // Submenu options
248
+ add_submenu_page( 'cp_calculated_fields_form', 'Documentation', 'Documentation', 'manage_options', "cp_calculated_fields_form_sub2", array($this, 'admin_pages') );
249
+
250
+ add_submenu_page( 'cp_calculated_fields_form', 'Online Help', 'Online Help', 'manage_options', "cp_calculated_fields_form_sub4", array($this, 'admin_pages') );
251
+
252
+ add_submenu_page( 'cp_calculated_fields_form', 'Upgrade', 'Upgrade', 'manage_options', "cp_calculated_fields_form_sub3", array($this, 'admin_pages') );
253
+
254
+ } // End admin_menu
255
+
256
+ /**
257
+ * Loads the corresponding pages in the WordPress or redirects the user to the external URLs.
258
+ *
259
+ * Loads the webpage with the list of forms, addons activation, general settings, etc.
260
+ * or redirects to external webpages like plugin's documentation
261
+ *
262
+ * @since 1.0.181
263
+ */
264
+ public function admin_pages()
265
+ {
266
+ // Settings page of the plugin
267
+ if (isset($_GET["cal"]) && $_GET["cal"] != '')
268
+ {
269
+ @include_once CP_CALCULATEDFIELDSF_BASE_PATH . '/inc/cpcff_admin_int.inc.php';
270
+ }
271
+ else
272
+ {
273
+ // Redirecting outer website
274
+ if (isset($_GET["page"]) && $_GET["page"] == 'cp_calculated_fields_form_sub3')
275
+ {
276
+ if(@wp_redirect('https://cff.dwbooster.com/download')) exit;
277
+ }
278
+ else if (isset($_GET["page"]) && $_GET["page"] == 'cp_calculated_fields_form_sub2')
279
+ {
280
+ if(@wp_redirect('https://cff.dwbooster.com/documentation')) exit;
281
+ }
282
+ else if (isset($_GET["page"]) && $_GET["page"] == 'cp_calculated_fields_form_sub4')
283
+ {
284
+ if(@wp_redirect('https://wordpress.org/support/plugin/calculated-fields-form#new-post')) exit;
285
+ }
286
+ else
287
+ @include_once CP_CALCULATEDFIELDSF_BASE_PATH . '/inc/cpcff_admin_int_list.inc.php';
288
+ }
289
+ } // End admin_pages
290
+
291
+ /**
292
+ * Loads the javascript resources to integrate the plugin with the Gutenberg editor
293
+ *
294
+ * @since 1.0.200
295
+ */
296
+ public function gutenberg_editor()
297
+ {
298
+ wp_enqueue_script( 'cp_calculatedfieldsf_gutenberg_editor', plugins_url('/js/cp_calculatedfieldsf_gutenberg.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH), array('wp-blocks', 'wp-element'));
299
+ } // End gutenberg_editor
300
+
301
+ /**
302
+ * Loads the javascript and style files.
303
+ *
304
+ * Checks if there is the settings page of the plugin for loading the corresponding JS and CSS files,
305
+ * or if it is a post or page the script for inserting the shortcodes in the content's editor.
306
+ *
307
+ * @since 1.0.171
308
+ *
309
+ * @param string $hook.
310
+ * @return void.
311
+ */
312
+ public function admin_resources( $hook )
313
+ {
314
+ // Checks if it is the plugin's page
315
+ if(isset($_GET['page']))
316
+ {
317
+ if('cp_calculated_fields_form' == $_GET['page'])
318
+ {
319
+ wp_enqueue_script( "jquery" );
320
+ wp_enqueue_script( "jquery-ui-core" );
321
+ wp_enqueue_script( "jquery-ui-sortable" );
322
+ wp_enqueue_script( "jquery-ui-tabs" );
323
+ wp_enqueue_script( "jquery-ui-droppable" );
324
+ wp_enqueue_script( "jquery-ui-button" );
325
+ wp_enqueue_script( "jquery-ui-datepicker" );
326
+ wp_deregister_script('query-stringify');
327
+ wp_register_script('query-stringify', plugins_url('/js/jQuery.stringify.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
328
+ wp_enqueue_script( "query-stringify" );
329
+
330
+ //ULR to the admin resources
331
+ $admin_resources = admin_url( "admin.php?page=cp_calculated_fields_form&cp_cff_resources=admin" );
332
+ wp_enqueue_script( 'cp_calculatedfieldsf_builder_script', $admin_resources, array("jquery","jquery-ui-core","jquery-ui-sortable","jquery-ui-tabs","jquery-ui-droppable","jquery-ui-button", "jquery-ui-accordion","jquery-ui-datepicker","query-stringify") );
333
+ wp_enqueue_script( 'cp_calculatedfieldsf_builder_script_caret', plugins_url('/js/jquery.caret.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH),array("jquery"));
334
+ wp_enqueue_style('cp_calculatedfieldsf_builder_style', plugins_url('/css/style.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
335
+ wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
336
+ }
337
+ // Checks if it is to an external page
338
+ elseif(
339
+ in_array(
340
+ $_GET["page"],
341
+ array(
342
+ 'cp_calculated_fields_form_sub2',
343
+ 'cp_calculated_fields_form_sub3',
344
+ 'cp_calculated_fields_form_sub4'
345
+ )
346
+ )
347
+ )
348
+ {
349
+ $cpcff_redirect = array();
350
+ switch($_GET["page"])
351
+ {
352
+ case 'cp_calculated_fields_form_sub2':
353
+ $cpcff_redirect['url'] = 'https://cff.dwbooster.com/documentation';
354
+ break;
355
+ case 'cp_calculated_fields_form_sub3':
356
+ $cpcff_redirect['url'] = 'https://cff.dwbooster.com/download';
357
+ break;
358
+ case 'cp_calculated_fields_form_sub4':
359
+ $cpcff_redirect['url'] = 'https://wordpress.org/support/plugin/calculated-fields-form#new-post';
360
+ break;
361
+ }
362
+ wp_enqueue_script('cp_calculatedfieldsf_redirect_script', plugins_url('/js/redirect_script.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
363
+ wp_localize_script(
364
+ 'cp_calculatedfieldsf_redirect_script',
365
+ 'cpcff_redirect',
366
+ $cpcff_redirect
367
+ );
368
+ }
369
+ }
370
+
371
+ // Checks if it is a page or post
372
+ if( 'post.php' == $hook || 'post-new.php' == $hook )
373
+ {
374
+ wp_enqueue_script( 'cp_calculatedfieldsf_script', plugins_url('/js/cp_calculatedfieldsf_scripts.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH) );
375
+ }
376
+ } // End admin_resources
377
+
378
+ public function form_preview( $atts )
379
+ {
380
+ if(isset($atts['shortcode_atts']))
381
+ {
382
+ $message = '';
383
+ // It is a common form's preview or it is an AMP page after be redirected
384
+ if(
385
+ !empty($atts['popup']) ||
386
+ !empty($_GET['cff-amp-redirected'])
387
+ )
388
+ {
389
+ $message = $this->public_form($atts['shortcode_atts']);
390
+ if(!empty($atts['amp'])) $message = preg_replace('/<form\s+/i', '<form target="_parent" ', $message, 1);
391
+
392
+ ob_start();
393
+ wp_footer();
394
+ $message .= ob_get_contents();
395
+ ob_end_clean();
396
+
397
+ $page_title = '';
398
+ if(!empty($atts['page_title'])) $page_title = $atts['page_title'];
399
+ }
400
+
401
+ if(!empty($atts['popup']))
402
+ {
403
+ wp_die($message, $page_title, 200);
404
+ }
405
+ else
406
+ {
407
+ // The AMP page has not been redirected
408
+ // and redirects it from server side
409
+ if(
410
+ !headers_sent() &&
411
+ empty($_GET['cff-amp-redirected'])
412
+ )
413
+ {
414
+ $host = $_SERVER['HTTP_HOST'];
415
+ if(preg_match('/^www\./i',$host)) $host = preg_replace('/^www\./i','',$host);
416
+ else $host = "www.$host";
417
+
418
+ $request_uri = $_SERVER['REQUEST_URI'];
419
+ $request_uri .= (strpos($request_uri,'?') === false) ? '?' : '&';
420
+ $request_uri .= 'cff-amp-redirected=1';
421
+ wp_redirect( "https://$host$request_uri" );
422
+ }
423
+ else
424
+ {
425
+ print '<!DOCTYPE html><html '.
426
+ ((function_exists( 'is_rtl' ) && is_rtl()) ? 'dir="rtl"' : '').
427
+ '>'.
428
+ '<head>'.
429
+ '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'.
430
+ '<meta name="viewport" content="width=device-width">'.
431
+ '<title>'.esc_html($page_title).'</title>'.
432
+ '<style>'.
433
+ 'body{background:#FFF;overflow:hidden;margin:0;}'.
434
+ 'html, body {height:100%;position:relative;min-height:100%;display:block;}'.
435
+ '#fbuilder{overflow-x:hidden;overflow-y:auto;height:'.intval(@$atts['height']).'px;padding:5px 32px 5px 5px;box-sizing:border-box!important;}'.
436
+ '</style>';
437
+
438
+ // The AMP page has not been redirected
439
+ // and redirects it with javascript
440
+ if(empty($_GET['cff-amp-redirected']))
441
+ {
442
+ print '<script>'.
443
+ 'var current_url = document.location.href;'.
444
+ 'if(/^https:\/\/www\./i.test(current_url)) current_url = current_url.replace(/^https:\/\/www\./i, "https://");'.
445
+ 'else current_url = current_url.replace(/^https:\/\//i, "https://www.");'.
446
+ 'current_url += (current_url.indexOf("?") == -1) ? "?" : "&"'.
447
+ 'document.location.href=current_url+"cff-amp-redirected=1";'.
448
+ '</script>';
449
+ }
450
+
451
+ print '</head>'.
452
+ '<body>'.
453
+ $message.
454
+ '</body>'.
455
+ '</html>';
456
+ }
457
+
458
+ exit;
459
+ }
460
+ }
461
+ } // End form_preview
462
+
463
+ /**
464
+ * Returns the public version of the form wih its resources.
465
+ *
466
+ * The method calls the filters: cpcff_pre_form, and cpcff_the_form
467
+ * @since 1.0.171
468
+ * @param array $atts includes the attributes required to identify the form, and create the variables.
469
+ * @return string $content a text with the public version of the form and resources.
470
+ */
471
+ public function public_form( $atts )
472
+ {
473
+ // If the website is being visited by crawler, display empty text.
474
+ if( CPCFF_AUXILIARY::is_crawler() ) return '';
475
+ if( empty($atts) ) $atts = array();
476
+ if(!$this->_is_admin && CPCFF_AUXILIARY::is_amp())
477
+ {
478
+ $content = CPCFF_AUXILIARY::get_iframe($atts);
479
+ }
480
+ else
481
+ {
482
+ global $wpdb, $cpcff_default_texts_array;
483
+
484
+ if( empty( $atts[ 'id' ] ) ) // if was not passed the form's id get all.
485
+ {
486
+ $myrows = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE );
487
+ }
488
+ else
489
+ {
490
+ $myrows = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ".$wpdb->prefix.CP_CALCULATEDFIELDSF_FORMS_TABLE." WHERE id=%d",$atts[ 'id' ] ) );
491
+ }
492
+
493
+ if( empty( $myrows ) ) return ''; // The form does not exists, or there are no forms.
494
+ $atts[ 'id' ] = $myrows[0]->id; // If was not passed the form's id, uses the if of first form.
495
+ $id = $atts[ 'id' ]; // Alias for the $atts[ 'id' ] variable.
496
+
497
+ self::$form_counter++; // Current form
498
+
499
+ /**
500
+ * Filters applied before generate the form,
501
+ * is passed as parameter an array with the forms attributes, and return the list of attributes
502
+ */
503
+ $atts = apply_filters( 'cpcff_pre_form', $atts );
504
+
505
+ ob_start();
506
+
507
+ // Constant defined to protect the "inc/cpcff_public_int.inc.php" file against direct accesses.
508
+ if ( !defined('CP_AUTH_INCLUDE') ) define('CP_AUTH_INCLUDE', true);
509
+
510
+ $this->_public_resources($id); // Load form scripts and other resources
511
+
512
+ /* TO-DO: This method should be analyzed after moving other functions to the main class . */
513
+ @include CP_CALCULATEDFIELDSF_BASE_PATH . '/inc/cpcff_public_int.inc.php';
514
+
515
+ $content = ob_get_contents();
516
+
517
+ // The attributes excepting "id" are converted in javascript variables with a global scope
518
+ if( count( $atts ) > 1 )
519
+ {
520
+ $content .= '<script>';
521
+ foreach( $atts as $i => $v )
522
+ {
523
+ if( $i != 'id' && $i != 'class' && !is_numeric( $i ) )
524
+ {
525
+ $nV = ( is_numeric( $v ) ) ? $v : json_encode( $v ); // Sanitizing the attribute's value
526
+ $content .= $i.'='.$nV.';';
527
+ $content .= 'if(typeof '.$i.'_arr == "undefined") '.$i.'_arr={}; '.$i.'_arr["_'.self::$form_counter.'"]='.$nV.';';
528
+ }
529
+ }
530
+ $content .= '</script>';
531
+ }
532
+ ob_end_clean();
533
+
534
+ /**
535
+ * Filters applied after generate the form,
536
+ * is passed as parameter the HTML code of the form with the corresponding <LINK> and <SCRIPT> tags,
537
+ * and returns the HTML code to includes in the webpage
538
+ */
539
+ $content = apply_filters( 'cpcff_the_form', $content, $atts[ 'id' ] );
540
+ }
541
+
542
+ return $content;
543
+ } // End public_form
544
+
545
+ /**
546
+ * Creates a javascript variable, from: Post, Get, Session or Cookie or directly.
547
+ *
548
+ * If the webpage is visited from a crawler or search engine spider, the shortcode is replaced by an empty text.
549
+ *
550
+ * @since 1.0.175
551
+ * @param array $atts includes the records:
552
+ * - name, the variable's name.
553
+ * - value, to create a variable splicitly with the value passed as attribute.
554
+ * - from, identifies the variable source (POST, GET, SESSION or COOKIE), it is optional.
555
+ * - default_value, used in combination with the from attribute to populate the variable
556
+ * with the default value of the source does not exist.
557
+ *
558
+ * @return string <script> tag with the variable's definition.
559
+ */
560
+ public function create_variable_shortcode( $atts )
561
+ {
562
+ if(
563
+ !CPCFF_AUXILIARY::is_crawler() && // Checks for crawlers or search engine spiders
564
+ !empty($atts[ 'name' ]) &&
565
+ ($var = trim($atts[ 'name' ])) != ''
566
+ )
567
+ {
568
+ if( isset( $atts[ 'value' ] ) )
569
+ {
570
+ $value = json_encode( $atts[ 'value' ] );
571
+ }
572
+ else
573
+ {
574
+ $from = '_';
575
+ if( isset($atts['from'])) $from .= strtoupper(trim($atts['from']));
576
+ if( in_array( $from, array( '_POST', '_GET', '_SESSION', '_COOKIE' ) ) )
577
+ {
578
+ if( isset( $GLOBALS[ $from ][ $var ] ) ) $value = json_encode($GLOBALS[ $from ][ $var ]);
579
+ elseif( isset( $atts[ 'default_value' ] ) ) $value = json_encode($atts[ 'default_value' ]);
580
+ }
581
+ else
582
+ {
583
+ if( isset( $_POST[ $var ] ) ) $value = json_encode($_POST[ $var ]);
584
+ elseif( isset( $_GET[ $var ] ) ) $value = json_encode($_GET[ $var ]);
585
+ elseif( isset( $_SESSION[ $var ] ) ) $value = json_encode($_SESSION[ $var ]);
586
+ elseif( isset( $_COOKIE[ $var ] ) ) $value = json_encode($_COOKIE[ $var ]);
587
+ elseif( isset( $atts[ 'default_value' ] ) ) $value = json_encode($atts[ 'default_value' ]);
588
+ }
589
+ }
590
+ if(isset( $value ))
591
+ {
592
+ return '
593
+ <script>
594
+ try{
595
+ window["'.esc_js($var).'"]='.$value.';
596
+ }catch( err ){}
597
+ </script>
598
+ ';
599
+ }
600
+ }
601
+ return '';
602
+ } // End create_variable_shortcode
603
+
604
+ /**
605
+ * Returns an instance of the active form
606
+ *
607
+ * If there is not an active form generates the instance.
608
+ *
609
+ * @since 1.0.179
610
+ * @return object
611
+ */
612
+ public function get_form( $id )
613
+ {
614
+ if(!isset($this->_forms[$id]))
615
+ {
616
+ $this->_forms[$id] = new CPCFF_FORM($id);
617
+ }
618
+ return $this->_forms[$id];
619
+ } // End get_active_form
620
+
621
+ /**
622
+ * Creates a new form calling the static method CPCFF_FORM::create_default
623
+ *
624
+ * @since 1.0.179
625
+ *
626
+ * @param string $form_name, the name of form.
627
+ * @return mixed, an instance of the created form or false.
628
+ */
629
+ public function create_form($form_name)
630
+ {
631
+ $form = CPCFF_FORM::create_default($form_name);
632
+ if($form) $this->_forms[$form->get_id()] = $form;
633
+ return $form;
634
+ } // End create_form
635
+
636
+ /**
637
+ * Deletes the form.
638
+ * The methods throw the cpcff_delete_form hook after delete the form.
639
+ *
640
+ * @since 1.0.179
641
+ * @param integer $id, the form's id.
642
+ * @return mixed, the number of delete rows or false.
643
+ */
644
+ public function delete_form( $id )
645
+ {
646
+ $deleted = $this->get_form($id)->delete_form();
647
+ if($deleted)
648
+ {
649
+ do_action( 'cpcff_delete_form', $id);
650
+ unset( $this->_forms[$id]);
651
+ }
652
+ return $deleted;
653
+ } // End delete_form
654
+
655
+ /**
656
+ * Clones a form.
657
+ *
658
+ * @since 1.0.179
659
+ * @param integer $id, the form's id.
660
+ * @return mixed, an instance of cloned form or false.
661
+ */
662
+ public function clone_form($id)
663
+ {
664
+ if(!isset($this->_forms[$id])) $this->_forms[$id] = new CPCFF_FORM($id);
665
+ $cloned_form = $this->_forms[$id]->clone_form();
666
+ if($clone_form)
667
+ {
668
+ /**
669
+ * Passes as parameter the original form's id, and the new form's id
670
+ */
671
+ do_action( 'cpcff_clone_form', $id, $clone_form->get_id());
672
+ }
673
+ return $clone_form;
674
+ } // End clone_form
675
+
676
+ /*********************************** PRIVATE METHODS ********************************************/
677
+
678
+ /**
679
+ * Defines the activativation/deactivation hooks, and new blog hook.
680
+ *
681
+ * Requires the cpcff_install_uninstall.inc.php file with the activate/deactivate code, and the code to run with new blogs.
682
+ *
683
+ * @sinze 1.0.171
684
+ * @return void.
685
+ */
686
+ private function _activate_deactivate()
687
+ {
688
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/inc/cpcff_install_uninstall.inc.php';
689
+ register_activation_hook(CP_CALCULATEDFIELDSF_MAIN_FILE_PATH,array('CPCFF_INSTALLER','install'));
690
+ register_deactivation_hook(CP_CALCULATEDFIELDSF_MAIN_FILE_PATH,array('CPCFF_INSTALLER','uninstall'));
691
+ add_action('wpmu_new_blog', array('CPCFF_INSTALLER', 'new_blog'), 10, 6);
692
+ } // End _activate_deactivate
693
+
694
+ /**
695
+ * Loads the language file.
696
+ *
697
+ * Loads the language file associated to the plugin, and creates the textdomain.
698
+ *
699
+ * @return void.
700
+ */
701
+ private function _textdomain()
702
+ {
703
+ load_plugin_textdomain( 'calculated-fields-form', FALSE, dirname( CP_CALCULATEDFIELDSF_BASE_NAME ) . '/languages/' );
704
+ } // End _textdomain
705
+
706
+ /**
707
+ * Loads the controls scripts.
708
+ *
709
+ * Checks if there is defined the "cp_cff_resources" parameter, and loads the public or admin scripsts for the controls.
710
+ * If the scripsts are loaded the plugin exits the PHP execution.
711
+ *
712
+ * @return void.
713
+ */
714
+ private function _load_controls_scrips()
715
+ {
716
+ if( isset( $_REQUEST[ 'cp_cff_resources' ] ) )
717
+ {
718
+ if(!defined('WP_DEBUG') || true != WP_DEBUG)
719
+ {
720
+ error_reporting(E_ERROR|E_PARSE);
721
+ }
722
+ // Set the corresponding header
723
+ if(!headers_sent())
724
+ {
725
+ header("Content-type: application/javascript");
726
+ }
727
+
728
+ if(!$this->_is_admin || $_REQUEST[ 'cp_cff_resources' ] == 'public')
729
+ {
730
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/js/fbuilder-loader-public.php';
731
+ }
732
+ else
733
+ {
734
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/js/fbuilder-loader-admin.php';
735
+ }
736
+ exit;
737
+ }
738
+ } // End _load_controls_scrips
739
+
740
+ /**
741
+ * Defines the shortcodes used by the plugin's code:
742
+ *
743
+ * - CP_CALCULATED_FIELDS
744
+ * - CP_CALCULATED_FIELDS_VAR
745
+ *
746
+ * @return void.
747
+ */
748
+ private function _define_shortcodes()
749
+ {
750
+ add_shortcode( 'CP_CALCULATED_FIELDS', array($this,'public_form') );
751
+ add_shortcode( 'CP_CALCULATED_FIELDS_VAR', array($this,'create_variable_shortcode') );
752
+ } // End _define_shortcodes
753
+ /**
754
+ * Returns a JSON object with the configuration object.
755
+ *
756
+ * Uses the global variable $cpcff_default_texts_array, defined in the "config/cpcff_config.cfg.php"
757
+ *
758
+ * @sinze 1.0.171
759
+ * @param int $formid the form's id.
760
+ * @return string $json
761
+ */
762
+ private function _get_form_configuration( $formid )
763
+ {
764
+ global $cpcff_default_texts_array;
765
+ $form_obj = $this->get_form($formid);
766
+ $previous_label = $form_obj->get_option('vs_text_previousbtn', 'Previous');
767
+ $previous_label = ( $previous_label=='' ? 'Previous' : $previous_label );
768
+ $next_label = $form_obj->get_option('vs_text_nextbtn', 'Next');
769
+ $next_label = ( $next_label == '' ? 'Next' : $next_label );
770
+
771
+ $cpcff_texts_array = $form_obj->get_option('vs_all_texts', $cpcff_default_texts_array);
772
+ $cpcff_texts_array = CPCFF_AUXILIARY::array_replace_recursive(
773
+ $cpcff_default_texts_array,
774
+ ( is_string( $cpcff_texts_array ) && is_array( unserialize( $cpcff_texts_array ) ) )
775
+ ? unserialize( $cpcff_texts_array )
776
+ : ( ( is_array( $cpcff_texts_array ) ) ? $cpcff_texts_array : array() )
777
+ );
778
+
779
+ $obj = array(
780
+ "pub"=>true,
781
+ "identifier"=>'_'.self::$form_counter,
782
+ "messages"=> array(
783
+ "required" => $form_obj->get_option('vs_text_is_required', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_required),
784
+ "email" => $form_obj->get_option('vs_text_is_email', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_is_email),
785
+ "datemmddyyyy" => $form_obj->get_option('vs_text_datemmddyyyy', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_datemmddyyyy),
786
+ "dateddmmyyyy" => $form_obj->get_option('vs_text_dateddmmyyyy', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_dateddmmyyyy),
787
+ "number" => $form_obj->get_option('vs_text_number', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_number),
788
+ "digits" => $form_obj->get_option('vs_text_digits', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_digits),
789
+ "max" => $form_obj->get_option('vs_text_max', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_max),
790
+ "min" => $form_obj->get_option('vs_text_min', CP_CALCULATEDFIELDSF_DEFAULT_vs_text_min),
791
+ "previous" => $previous_label,
792
+ "next" => $next_label,
793
+ "pageof" => $cpcff_texts_array[ 'page_of_text' ][ 'text' ],
794
+ "minlength" => $cpcff_texts_array[ 'errors' ][ 'minlength' ][ 'text' ],
795
+ "maxlength" => $cpcff_texts_array[ 'errors' ][ 'maxlength' ][ 'text' ],
796
+ "equalTo" => $cpcff_texts_array[ 'errors' ][ 'equalTo' ][ 'text' ],
797
+ "accept" => $cpcff_texts_array[ 'errors' ][ 'accept' ][ 'text' ],
798
+ "upload_size" => $cpcff_texts_array[ 'errors' ][ 'upload_size' ][ 'text' ],
799
+ "phone" => $cpcff_texts_array[ 'errors' ][ 'phone' ][ 'text' ]
800
+ )
801
+ );
802
+ return json_encode( $obj );
803
+ } // End _get_form_configuration
804
+
805
+ /**
806
+ * Loads the javascript and style files used by the public forms.
807
+ *
808
+ * Checks if the plugin was configured for loading HTML tags directly, or to use the WordPress functions.
809
+ *
810
+ * @since 1.0.171
811
+ * @param int $formid the form's id.
812
+ * @return void.
813
+ */
814
+ private function _public_resources( $formid )
815
+ {
816
+ /* TO-DO: This method should be analyzed after moving other functions to the main class . */
817
+
818
+ $public_js_path = (
819
+ get_option( 'CP_CALCULATEDFIELDSF_USE_CACHE', CP_CALCULATEDFIELDSF_USE_CACHE ) &&
820
+ file_exists( CP_CALCULATEDFIELDSF_BASE_PATH.'/js/cache/all.js' )
821
+ ) ? plugins_url('/js/cache/all.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH)
822
+ : CPCFF_AUXILIARY::site_url().( ( strpos( CPCFF_AUXILIARY::site_url(),'?' ) === false ) ? '/?' : '&' ).'cp_cff_resources=public&min='.get_option( 'CP_CALCULATEDFIELDSF_USE_CACHE', CP_CALCULATEDFIELDSF_USE_CACHE );
823
+
824
+ $config_json = $this->_get_form_configuration($formid);
825
+
826
+ if (CP_CALCULATEDFIELDSF_DEFAULT_DEFER_SCRIPTS_LOADING)
827
+ {
828
+ wp_enqueue_script( "jquery" );
829
+ wp_enqueue_script( "jquery-ui-core" );
830
+ wp_enqueue_script( "jquery-ui-button" );
831
+ wp_enqueue_script( "jquery-ui-widget" );
832
+ wp_enqueue_script( "jquery-ui-position" );
833
+ wp_enqueue_script( "jquery-ui-tooltip" );
834
+ wp_enqueue_script( "jquery-ui-datepicker" );
835
+ wp_enqueue_script( "jquery-ui-slider" );
836
+
837
+ wp_deregister_script('query-stringify');
838
+ wp_register_script('query-stringify', plugins_url('/js/jQuery.stringify.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH), array(), 'pro');
839
+
840
+ wp_deregister_script('cp_calculatedfieldsf_validate_script');
841
+ wp_register_script('cp_calculatedfieldsf_validate_script', plugins_url('/js/jquery.validate.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
842
+ wp_enqueue_script( 'cp_calculatedfieldsf_builder_script', $public_js_path, array("jquery","jquery-ui-core","jquery-ui-button","jquery-ui-widget","jquery-ui-position","jquery-ui-tooltip","query-stringify","cp_calculatedfieldsf_validate_script", "jquery-ui-datepicker", "jquery-ui-slider"), CP_CALCULATEDFIELDSF_VERSION, true );
843
+
844
+ wp_localize_script('cp_calculatedfieldsf_builder_script', 'cp_calculatedfieldsf_fbuilder_config_'.self::$form_counter, array('obj' => $config_json));
845
+ }
846
+ else
847
+ {
848
+ // This code won't be used in most cases. This code is for preventing problems in wrong WP themes and conflicts with third party plugins.
849
+ if( !$this->_are_resources_loaded ) // Load the resources only one time
850
+ {
851
+ $this->_are_resources_loaded = true; // Resources loaded
852
+
853
+ $plugin_url = plugins_url('', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH);
854
+
855
+ $prefix_ui = ''; // Used for compatibility with old versions of WordPress
856
+ if ( @file_exists( CP_CALCULATEDFIELDSF_BASE_PATH.'/../../../wp-includes/js/jquery/ui/jquery.ui.core.min.js' ) )
857
+ {
858
+ $prefix_ui = 'jquery.ui.';
859
+ }
860
+
861
+ if(!wp_script_is('jquery', 'done'))
862
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/jquery.js"></script>';
863
+ if(!wp_script_is('jquery-ui-core', 'done'))
864
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'core.min.js"></script>';
865
+ if(!wp_script_is('jquery-ui-datepicker', 'done'))
866
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'datepicker.min.js"></script>';
867
+ if(!wp_script_is('jquery-ui-widget', 'done'))
868
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'widget.min.js"></script>';
869
+ if(!wp_script_is('jquery-ui-position', 'done'))
870
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'position.min.js"></script>';
871
+ if(!wp_script_is('jquery-ui-tooltip', 'done'))
872
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'tooltip.min.js"></script>';
873
+ if(!wp_script_is('jquery-ui-mouse', 'done'))
874
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'mouse.min.js"></script>';
875
+ if(!wp_script_is('jquery-ui-slider', 'done'))
876
+ print '<script type="text/javascript" src="'.$plugin_url.'/../../../wp-includes/js/jquery/ui/'.$prefix_ui.'slider.min.js"></script>';
877
+ ?>
878
+ <script>if( typeof fbuilderjQuery == 'undefined') var fbuilderjQuery = jQuery.noConflict( );</script>
879
+ <script type='text/javascript' src='<?php echo plugins_url('js/jquery.validate.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>'></script>
880
+ <script type='text/javascript' src='<?php echo plugins_url('js/jQuery.stringify.js', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH); ?>'></script>
881
+ <script type='text/javascript' src='<?php echo $public_js_path.(( strpos( $public_js_path, '?' ) == false ) ? '?' : '&' ).'ver='.CP_CALCULATEDFIELDSF_VERSION; ?>'></script>
882
+ <?php
883
+ }
884
+ ?>
885
+ <script type='text/javascript'>
886
+ /* <![CDATA[ */
887
+ <?php
888
+ print 'var cp_calculatedfieldsf_fbuilder_config_'.self::$form_counter.'={"obj":'.$config_json.'};';
889
+ ?>
890
+ /* ]]> */
891
+ </script>
892
+ <?php
893
+ }
894
+ } // End _public_resources
895
+ } // End CPCFF_MAIN
896
+ }
inc/cpcff_public_int.inc.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined('CP_AUTH_INCLUDE') )
3
+ {
4
+ print 'Direct access not allowed.';
5
+ exit;
6
+ }
7
+
8
+ // Required scripts
9
+ require_once CP_CALCULATEDFIELDSF_BASE_PATH.'/inc/cpcff_templates.inc.php';
10
+
11
+ // Corrects a conflict with W3 Total Cache
12
+ if( function_exists( 'w3_instance' ) )
13
+ {
14
+ try
15
+ {
16
+ $w3_config = w3_instance( 'W3_Config' );
17
+ $w3_config->set( 'minify.html.enable', false );
18
+ }
19
+ catch( Exception $err )
20
+ {
21
+
22
+ }
23
+ }
24
+
25
+ add_filter( 'style_loader_tag', array('CPCFF_AUXILIARY', 'complete_link_tag') );
26
+
27
+ wp_enqueue_style( 'cpcff_stylepublic', plugins_url('/css/stylepublic.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
28
+ wp_enqueue_style( 'cpcff_jquery_ui' , plugins_url('/css/cupertino/jquery-ui-1.8.20.custom.css', CP_CALCULATEDFIELDSF_MAIN_FILE_PATH));
29
+
30
+ $cpcff_main = CPCFF_MAIN::instance();
31
+ $form_obj = $cpcff_main->get_form($id);
32
+
33
+ $form_data = $form_obj->get_option('form_structure', CP_CALCULATEDFIELDSF_DEFAULT_form_structure);
34
+ if( !empty( $form_data ) )
35
+ {
36
+ if( isset( $form_data[ 1 ] ) && isset( $form_data[ 1 ][ 0 ] ) )
37
+ {
38
+ if(!empty( $form_data[ 1 ][ 0 ]->formtemplate ))
39
+ {
40
+ CPCFF_TEMPLATES::enqueue_template_resources($form_data[ 1 ][ 0 ]->formtemplate);
41
+ }
42
+
43
+ if(!empty($form_data[ 1 ][ 0 ]->customstyles))
44
+ {
45
+ print '<style>'.$form_data[ 1 ][ 0 ]->customstyles.'</style>';
46
+ }
47
+ }
48
+ $form_data[ 1 ][ 'formid' ]="cp_calculatedfieldsf_pform_".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 ' '.$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; ?>">
56
+ <div id="formheader_<?php echo CPCFF_MAIN::$form_counter; ?>"></div>
57
+ <div id="fieldlist_<?php echo CPCFF_MAIN::$form_counter; ?>"></div>
58
+ </div>
59
+ </div>
60
+ <div class="clearer"></div>
61
+ </form>
62
+ <?php
63
+ }
64
+ ?>
inc/cpcff_session.inc.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CodePeople Session.
4
+ *
5
+ * Standardizes WordPress session data using database-backed options for storage.
6
+ * for storing user session information.
7
+ */
8
+
9
+ if( !defined( 'CP_COOKIE_NAME' ) )
10
+ {
11
+ define( 'CP_COOKIE_NAME', 'CP5XKN6QLDFWUC' );
12
+ }
13
+
14
+ if( !class_exists( 'CP_SESSION' ) )
15
+ {
16
+ class CP_SESSION
17
+ {
18
+
19
+ /************** STATIC PROPERTIES **************/
20
+ private static $instance = false;
21
+
22
+ /************** INSTANCE PROPERTIES **************/
23
+ private $session_id;
24
+ private $expiration;
25
+ private $expiration_interval = 86400; // 24 Hours
26
+
27
+ /************** CONSTRUCT **************/
28
+
29
+ private function __construct()
30
+ {
31
+ if(!is_admin()) return;
32
+ if(session_id() == "") @session_start();
33
+
34
+ if( isset( $_SESSION[CP_COOKIE_NAME] ) || isset( $_COOKIE[CP_COOKIE_NAME] ) )
35
+ {
36
+ $cookie = stripslashes( ( isset( $_SESSION[CP_COOKIE_NAME] ) ) ? $_SESSION[CP_COOKIE_NAME] : $_COOKIE[CP_COOKIE_NAME] );
37
+
38
+ $cookie_crumbs = explode( '||', $cookie );
39
+
40
+ $this->session_id = $cookie_crumbs[0];
41
+ $this->expiration = $cookie_crumbs[1];
42
+ }
43
+ else
44
+ {
45
+ $this->session_id = $this->_generate_session_id();
46
+ $this->expiration = time()+$this->expiration_interval;
47
+ $this->_set_cookie();
48
+ }
49
+
50
+ }
51
+
52
+ /************** PRIVATE INSTANCE METHODS **************/
53
+ private function _generate_session_id()
54
+ {
55
+ require_once( ABSPATH . 'wp-includes/class-phpass.php' );
56
+ $hash = new PasswordHash( 8, false );
57
+
58
+ return md5( $hash->get_random_bytes( 32 ) );
59
+ }
60
+
61
+ private function _set_cookie()
62
+ {
63
+ try
64
+ {
65
+ $_SESSION[CP_COOKIE_NAME] = $this->session_id . '||' . $this->expiration;
66
+ if(!headers_sent())
67
+ @setcookie( CP_COOKIE_NAME, $this->session_id . '||' . $this->expiration, 0, '/' );
68
+ }
69
+ catch( Exception $err ){}
70
+ }
71
+
72
+ private function _get_var_name( $name )
73
+ {
74
+ return CP_COOKIE_NAME.'_'.$this->session_id.'_'.$name;
75
+ }
76
+
77
+ private function _set_var( $name, $value )
78
+ {
79
+ $_SESSION[ $name ] = $value;
80
+ $transient = $this->_get_var_name( $name );
81
+ set_transient( $transient, $value, $this->expiration );
82
+ }
83
+
84
+ private function _get_var( $name )
85
+ {
86
+ if( isset( $_SESSION[ $name ] ) ) return $_SESSION[ $name ];
87
+ $transient = $this->_get_var_name( $name );
88
+ return get_transient( $transient );
89
+ }
90
+
91
+ private function _unset_var( $name )
92
+ {
93
+ unset( $_SESSION[ $name ] );
94
+ $transient = $this->_get_var_name( $name );
95
+ delete_transient( $transient );
96
+ }
97
+
98
+ private function _clean_expired_vars()
99
+ {
100
+ global $wpdb;
101
+
102
+ $expiration = time()-$this->expiration_interval;
103
+ try
104
+ {
105
+ $transients = $wpdb->get_col(
106
+ $wpdb->prepare( "SELECT REPLACE(option_name, '_transient_timeout_', '') AS transient_name FROM {$wpdb->options} WHERE option_name LIKE %s AND option_value < %s", "_transient_timeout_".$wpdb->esc_like(CP_COOKIE_NAME)."%", $expiration)
107
+ );
108
+
109
+ $options_names = array();
110
+ foreach($transients as $transient)
111
+ {
112
+ if( strpos( $transient, $this->session_id ) === false )
113
+ {
114
+ $options_names[] = '_transient_' . $transient;
115
+ $options_names[] = '_transient_timeout_' . $transient;
116
+ }
117
+ }
118
+
119
+ if ( !empty($options_names) )
120
+ {
121
+ $options_names = array_map('esc_sql', $options_names);
122
+ $options_names = "'". implode("','", $options_names) ."'";
123
+ $result = $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name IN ({$options_names})" );
124
+
125
+ }
126
+ }
127
+ catch( Exception $err ) {}
128
+ }
129
+ /************** PUBLIC INSTANCE METHODS **************/
130
+
131
+ /************** PRIVATE STATIC METHODS **************/
132
+
133
+ private static function _get_instance() {
134
+ if ( ! self::$instance ) {
135
+ self::$instance = new self();
136
+ }
137
+
138
+ return self::$instance;
139
+ }
140
+
141
+
142
+ /************** PUBLIC STATIC METHODS **************/
143
+
144
+ public static function session_start()
145
+ {
146
+ $instance = self::_get_instance();
147
+ $instance->_clean_expired_vars();
148
+ }
149
+
150
+ public static function session_id()
151
+ {
152
+ $instance = self::_get_instance();
153
+ return $instance->session_id;
154
+ }
155
+
156
+ public static function set_var( $name, $value )
157
+ {
158
+ $instance = self::_get_instance();
159
+ $instance->_set_var( $name, $value );
160
+ }
161
+
162
+ public static function get_var( $name )
163
+ {
164
+ $instance = self::_get_instance();
165
+ return $instance->_get_var( $name );
166
+ }
167
+
168
+ public static function unset_var( $name )
169
+ {
170
+ $instance = self::_get_instance();
171
+ $instance->_unset_var( $name );
172
+ }
173
+
174
+ } // End clss
175
+ }
176
+ ?>
inc/cpcff_templates.inc.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Templates operations: CPCFF_TEMPLATES class
4
+ *
5
+ * Implements the access to forms templates.
6
+ *
7
+ * @package CFF.
8
+ * @since 1.0.175
9
+ */
10
+
11
+ if(!class_exists('CPCFF_TEMPLATES'))
12
+ {
13
+ class CPCFF_TEMPLATES
14
+ {
15
+ /**
16
+ * Flag to know if the templates directory was checked and the templates loaded
17
+ * Metaclass property.
18
+ *
19
+ * @var bool $_are_templates_loaded default false
20
+ */
21
+ private static $_are_templates_loaded = false;
22
+
23
+ /**
24
+ * Templates list
25
+ * Metaclass property.
26
+ *
27
+ * @var array $_templates_list default empty array
28
+ */
29
+ private static $_templates_list = array();
30
+
31
+ /**
32
+ * List of templates whose resources were enqueued or sent to the browser
33
+ * Metaclass property.
34
+ *
35
+ * @var array $_enqueued_list default empty array
36
+ */
37
+ private static $_enqueued_list = array();
38
+
39
+ /**
40
+ * Loads the templates list
41
+ *
42
+ * Walks through the "templates" directory for reading and parsing the corresponding config.ini files to identify the
43
+ * the styles files, the javascript files, the templates' thumbnails, and the prefixes to identify the templates
44
+ * and grouping the CSS rules to apply for the templates.
45
+ *
46
+ * @return array of associative arrays with the templates attributess.
47
+ */
48
+ public static function load_templates()
49
+ {
50
+ if( !self::$_are_templates_loaded )
51
+ {
52
+ self::$_are_templates_loaded = true;
53
+ $tpls_dir = dir( CP_CALCULATEDFIELDSF_BASE_PATH.'/templates' );
54
+ while( false !== ( $entry = $tpls_dir->read() ) )
55
+ {
56
+ if (
57
+ $entry != '.' &&
58
+ $entry != '..' &&
59
+ is_dir( $tpls_dir->path.'/'.$entry ) &&
60
+ file_exists( $tpls_dir->path.'/'.$entry.'/config.ini' )
61
+ )
62
+ {
63
+ if(
64
+ ( $ini_array = parse_ini_file( $tpls_dir->path.'/'.$entry.'/config.ini' ) ) != false ||
65
+ ( $ini_array = parse_ini_string( file_get_contents( $tpls_dir->path.'/'.$entry.'/config.ini' ) ) ) != false
66
+ )
67
+ {
68
+ if(
69
+ isset($ini_array[ 'prefix' ]) &&
70
+ ($prefix = trim($ini_array[ 'prefix' ])) != ''
71
+ )
72
+ {
73
+ // Url to the CSS file
74
+ if( !empty( $ini_array[ 'file' ] ) ) $ini_array[ 'file' ] = plugins_url( 'templates/'.$entry.'/'.$ini_array[ 'file' ], CP_CALCULATEDFIELDSF_MAIN_FILE_PATH );
75
+
76
+ // Url to the JS file
77
+ if( !empty( $ini_array[ 'js' ] ) ) $ini_array[ 'js' ] = plugins_url( 'templates/'.$entry.'/'.$ini_array[ 'js' ], CP_CALCULATEDFIELDSF_MAIN_FILE_PATH );
78
+
79
+ // Url to the thumbnail file
80
+ if( !empty( $ini_array[ 'thumbnail' ] ) ) $ini_array[ 'thumbnail' ] = plugins_url( 'templates/'.$entry.'/'.$ini_array[ 'thumbnail' ], CP_CALCULATEDFIELDSF_MAIN_FILE_PATH );
81
+
82
+ // Required attribute to identify the template
83
+ // and it is used as super-class-name for grouping styles to apply for the template
84
+ self::$_templates_list[ $prefix ] = $ini_array;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ return self::$_templates_list;
92
+ } // End load_templates
93
+
94
+ /**
95
+ * Enqueues or sends to the browser the template's resources (CSS and JS files)
96
+ *
97
+ * Loads the templates if they have not been loaded previously.
98
+ * Checks if the resources of current template were enqueued previously to prevent to load the resources by duplicated.
99
+ * Checks if the resources should be enqueued, or sent to the browser directly.
100
+ *
101
+ * @return void.
102
+ */
103
+ public static function enqueue_template_resources( $template )
104
+ {
105
+ $template = trim($template);
106
+ $templates = self::load_templates();
107
+
108
+ if(in_array($template, self::$_enqueued_list)) return;
109
+ self::$_enqueued_list[] = $template; // The template's resources were enqueued
110
+
111
+ if(!empty($templates[$template]))
112
+ {
113
+ $template_info = $templates[$template];
114
+
115
+ if(
116
+ !empty($template_info['file']) &&
117
+ ($css = trim($template_info['file'])) != ''
118
+ )
119
+ {
120
+ if(CP_CALCULATEDFIELDSF_DEFAULT_DEFER_SCRIPTS_LOADING)
121
+ {
122
+ wp_enqueue_style( 'cpcff_template_css'.$template, $css, array(), CP_CALCULATEDFIELDSF_VERSION );
123
+ }
124
+ else
125
+ {
126
+ $css .= (strpos($css,'?') === false) ? '?' : '&';
127
+ print '<link href="'.esc_attr(esc_url($css)).'ver='.CP_CALCULATEDFIELDSF_VERSION.'" type="text/css" rel="stylesheet" property="stylesheet" />';
128
+ }
129
+ }
130
+
131
+ if(
132
+ !empty($template_info['js']) &&
133
+ ($js = trim($template_info['js'])) != ''
134
+ )
135
+ {
136
+ if(CP_CALCULATEDFIELDSF_DEFAULT_DEFER_SCRIPTS_LOADING)
137
+ {
138
+ wp_enqueue_script( 'cpcff_template_js'.$template, $js, array(), CP_CALCULATEDFIELDSF_VERSION );
139
+ }
140
+ else
141
+ {
142
+ $js .= (strpos($js,'?') === false) ? '?' : '&';
143
+ print '<script src="'.esc_attr(esc_url($js)).'ver='.CP_CALCULATEDFIELDSF_VERSION.'"></script>';
144
+ }
145
+ }
146
+ }
147
+ } // End enqueue_template_resources
148
+
149
+ } // End CPCFF_TEMPLATES
150
+ }
151
+ ?>
js/JSMin.php ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
4
+ *
5
+ * <code>
6
+ * $minifiedJs = JSMin::minify($js);
7
+ * </code>
8
+ *
9
+ * This is a modified port of jsmin.c. Improvements:
10
+ *
11
+ * Does not choke on some regexp literals containing quote characters. E.g. /'/
12
+ *
13
+ * Spaces are preserved after some add/sub operators, so they are not mistakenly
14
+ * converted to post-inc/dec. E.g. a + ++b -> a+ ++b
15
+ *
16
+ * Preserves multi-line comments that begin with /*!
17
+ *
18
+ * PHP 5 or higher is required.
19
+ *
20
+ * Permission is hereby granted to use this version of the library under the
21
+ * same terms as jsmin.c, which has the following license:
22
+ *
23
+ * --
24
+ * Copyright (c) 2002 Douglas Crockford (www.crockford.com)
25
+ *
26
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
27
+ * this software and associated documentation files (the "Software"), to deal in
28
+ * the Software without restriction, including without limitation the rights to
29
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
30
+ * of the Software, and to permit persons to whom the Software is furnished to do
31
+ * so, subject to the following conditions:
32
+ *
33
+ * The above copyright notice and this permission notice shall be included in all
34
+ * copies or substantial portions of the Software.
35
+ *
36
+ * The Software shall be used for Good, not Evil.
37
+ *
38
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44
+ * SOFTWARE.
45
+ * --
46
+ *
47
+ * @package JSMin
48
+ * @author Ryan Grove <ryan@wonko.com> (PHP port)
49
+ * @author Steve Clay <steve@mrclay.org> (modifications + cleanup)
50
+ * @author Andrea Giammarchi <http://www.3site.eu> (spaceBeforeRegExp)
51
+ * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
52
+ * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
53
+ * @license http://opensource.org/licenses/mit-license.php MIT License
54
+ * @link http://code.google.com/p/jsmin-php/
55
+ */
56
+
57
+ class JSMin {
58
+ const ORD_LF = 10;
59
+ const ORD_SPACE = 32;
60
+ const ACTION_KEEP_A = 1;
61
+ const ACTION_DELETE_A = 2;
62
+ const ACTION_DELETE_A_B = 3;
63
+
64
+ protected $a = "\n";
65
+ protected $b = '';
66
+ protected $input = '';
67
+ protected $inputIndex = 0;
68
+ protected $inputLength = 0;
69
+ protected $lookAhead = null;
70
+ protected $output = '';
71
+ protected $lastByteOut = '';
72
+ protected $keptComment = '';
73
+
74
+ /**
75
+ * Minify Javascript.
76
+ *
77
+ * @param string $js Javascript to be minified
78
+ *
79
+ * @return string
80
+ */
81
+ public static function minify($js)
82
+ {
83
+ $jsmin = new JSMin($js);
84
+ return $jsmin->min();
85
+ }
86
+
87
+ /**
88
+ * @param string $input
89
+ */
90
+ public function __construct($input)
91
+ {
92
+ $this->input = $input;
93
+ }
94
+
95
+ /**
96
+ * Perform minification, return result
97
+ *
98
+ * @return string
99
+ */
100
+ public function min()
101
+ {
102
+ if ($this->output !== '') { // min already run
103
+ return $this->output;
104
+ }
105
+
106
+ $mbIntEnc = null;
107
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
108
+ $mbIntEnc = mb_internal_encoding();
109
+ mb_internal_encoding('8bit');
110
+ }
111
+ $this->input = str_replace("\r\n", "\n", $this->input);
112
+ $this->inputLength = strlen($this->input);
113
+
114
+ $this->action(self::ACTION_DELETE_A_B);
115
+
116
+ while ($this->a !== null) {
117
+ // determine next command
118
+ $command = self::ACTION_KEEP_A; // default
119
+ if ($this->a === ' ') {
120
+ if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
121
+ && ($this->b === $this->lastByteOut)) {
122
+ // Don't delete this space. If we do, the addition/subtraction
123
+ // could be parsed as a post-increment
124
+ } elseif (! $this->isAlphaNum($this->b)) {
125
+ $command = self::ACTION_DELETE_A;
126
+ }
127
+ } elseif ($this->a === "\n") {
128
+ if ($this->b === ' ') {
129
+ $command = self::ACTION_DELETE_A_B;
130
+
131
+ // in case of mbstring.func_overload & 2, must check for null b,
132
+ // otherwise mb_strpos will give WARNING
133
+ } elseif ($this->b === null
134
+ || (false === strpos('{[(+-!~', $this->b)
135
+ && ! $this->isAlphaNum($this->b))) {
136
+ $command = self::ACTION_DELETE_A;
137
+ }
138
+ } elseif (! $this->isAlphaNum($this->a)) {
139
+ if ($this->b === ' '
140
+ || ($this->b === "\n"
141
+ && (false === strpos('}])+-"\'', $this->a)))) {
142
+ $command = self::ACTION_DELETE_A_B;
143
+ }
144
+ }
145
+ $this->action($command);
146
+ }
147
+ $this->output = trim($this->output);
148
+
149
+ if ($mbIntEnc !== null) {
150
+ mb_internal_encoding($mbIntEnc);
151
+ }
152
+ return $this->output;
153
+ }
154
+
155
+ /**
156
+ * ACTION_KEEP_A = Output A. Copy B to A. Get the next B.
157
+ * ACTION_DELETE_A = Copy B to A. Get the next B.
158
+ * ACTION_DELETE_A_B = Get the next B.
159
+ *
160
+ * @param int $command
161
+ * @throws JSMin_UnterminatedRegExpException|JSMin_UnterminatedStringException
162
+ */
163
+ protected function action($command)
164
+ {
165
+ // make sure we don't compress "a + ++b" to "a+++b", etc.
166
+ if ($command === self::ACTION_DELETE_A_B
167
+ && $this->b === ' '
168
+ && ($this->a === '+' || $this->a === '-')) {
169
+ // Note: we're at an addition/substraction operator; the inputIndex
170
+ // will certainly be a valid index
171
+ if ($this->input[$this->inputIndex] === $this->a) {
172
+ // This is "+ +" or "- -". Don't delete the space.
173
+ $command = self::ACTION_KEEP_A;
174
+ }
175
+ }
176
+
177
+ switch ($command) {
178
+ case self::ACTION_KEEP_A: // 1
179
+ $this->output .= $this->a;
180
+
181
+ if ($this->keptComment) {
182
+ $this->output = rtrim($this->output, "\n");
183
+ $this->output .= $this->keptComment;
184
+ $this->keptComment = '';
185
+ }
186
+
187
+ $this->lastByteOut = $this->a;
188
+
189
+ // fallthrough intentional
190
+ case self::ACTION_DELETE_A: // 2
191
+ $this->a = $this->b;
192
+ if ($this->a === "'" || $this->a === '"') { // string literal
193
+ $str = $this->a; // in case needed for exception
194
+ for(;;) {
195
+ $this->output .= $this->a;
196
+ $this->lastByteOut = $this->a;
197
+
198
+ $this->a = $this->get();
199
+ if ($this->a === $this->b) { // end quote
200
+ break;
201
+ }
202
+ if ($this->isEOF($this->a)) {
203
+ throw new JSMin_UnterminatedStringException(
204
+ "JSMin: Unterminated String at byte {$this->inputIndex}: {$str}");
205
+ }
206
+ $str .= $this->a;
207
+ if ($this->a === '\\') {
208
+ $this->output .= $this->a;
209
+ $this->lastByteOut = $this->a;
210
+
211
+ $this->a = $this->get();
212
+ $str .= $this->a;
213
+ }
214
+ }
215
+ }
216
+
217
+ // fallthrough intentional
218
+ case self::ACTION_DELETE_A_B: // 3
219
+ $this->b = $this->next();
220
+ if ($this->b === '/' && $this->isRegexpLiteral()) {
221
+ $this->output .= $this->a . $this->b;
222
+ $pattern = '/'; // keep entire pattern in case we need to report it in the exception
223
+ for(;;) {
224
+ $this->a = $this->get();
225
+ $pattern .= $this->a;
226
+ if ($this->a === '[') {
227
+ for(;;) {
228
+ $this->output .= $this->a;
229
+ $this->a = $this->get();
230
+ $pattern .= $this->a;
231
+ if ($this->a === ']') {
232
+ break;
233
+ }
234
+ if ($this->a === '\\') {
235
+ $this->output .= $this->a;
236
+ $this->a = $this->get();
237
+ $pattern .= $this->a;
238
+ }
239
+ if ($this->isEOF($this->a)) {
240
+ throw new JSMin_UnterminatedRegExpException(
241
+ "JSMin: Unterminated set in RegExp at byte "
242
+ . $this->inputIndex .": {$pattern}");
243
+ }
244
+ }
245
+ }
246
+
247
+ if ($this->a === '/') { // end pattern
248
+ break; // while (true)
249
+ } elseif ($this->a === '\\') {
250
+ $this->output .= $this->a;
251
+ $this->a = $this->get();
252
+ $pattern .= $this->a;
253
+ } elseif ($this->isEOF($this->a)) {
254
+ throw new JSMin_UnterminatedRegExpException(
255
+ "JSMin: Unterminated RegExp at byte {$this->inputIndex}: {$pattern}");
256
+ }
257
+ $this->output .= $this->a;
258
+ $this->lastByteOut = $this->a;
259
+ }
260
+ $this->b = $this->next();
261
+ }
262
+ // end case ACTION_DELETE_A_B
263
+ }
264
+ }
265
+
266
+ /**
267
+ * @return bool
268
+ */
269
+ protected function isRegexpLiteral()
270
+ {
271
+ if (false !== strpos("(,=:[!&|?+-~*{;", $this->a)) {
272
+ // we obviously aren't dividing
273
+ return true;
274
+ }
275
+ if ($this->a === ' ' || $this->a === "\n") {
276
+ $length = strlen($this->output);
277
+ if ($length < 2) { // weird edge case
278
+ return true;
279
+ }
280
+ // you can't divide a keyword
281
+ if (preg_match('/(?:case|else|in|return|typeof)$/', $this->output, $m)) {
282
+ if ($this->output === $m[0]) { // odd but could happen
283
+ return true;
284
+ }
285
+ // make sure it's a keyword, not end of an identifier
286
+ $charBeforeKeyword = substr($this->output, $length - strlen($m[0]) - 1, 1);
287
+ if (! $this->isAlphaNum($charBeforeKeyword)) {
288
+ return true;
289
+ }
290
+ }
291
+ }
292
+ return false;
293
+ }
294
+
295
+ /**
296
+ * Return the next character from stdin. Watch out for lookahead. If the character is a control character,
297
+ * translate it to a space or linefeed.
298
+ *
299
+ * @return string
300
+ */
301
+ protected function get()
302
+ {
303
+ $c = $this->lookAhead;
304
+ $this->lookAhead = null;
305
+ if ($c === null) {
306
+ // getc(stdin)
307
+ if ($this->inputIndex < $this->inputLength) {
308
+ $c = $this->input[$this->inputIndex];
309
+ $this->inputIndex += 1;
310
+ } else {
311
+ $c = null;
312
+ }
313
+ }
314
+ if (ord($c) >= self::ORD_SPACE || $c === "\n" || $c === null) {
315
+ return $c;
316
+ }
317
+ if ($c === "\r") {
318
+ return "\n";
319
+ }
320
+ return ' ';
321
+ }
322
+
323
+ /**
324
+ * Does $a indicate end of input?
325
+ *
326
+ * @param string $a
327
+ * @return bool
328
+ */
329
+ protected function isEOF($a)
330
+ {
331
+ return ord($a) <= self::ORD_LF;
332
+ }
333
+
334
+ /**
335
+ * Get next char (without getting it). If is ctrl character, translate to a space or newline.
336
+ *
337
+ * @return string
338
+ */
339
+ protected function peek()
340
+ {
341
+ $this->lookAhead = $this->get();
342
+ return $this->lookAhead;
343
+ }
344
+
345
+ /**
346
+ * Return true if the character is a letter, digit, underscore, dollar sign, or non-ASCII character.
347
+ *
348
+ * @param string $c
349
+ *
350
+ * @return bool
351
+ */
352
+ protected function isAlphaNum($c)
353
+ {
354
+ return (preg_match('/^[a-z0-9A-Z_\\$\\\\]$/', $c) || ord($c) > 126);
355
+ }
356
+
357
+ /**
358
+ * Consume a single line comment from input (possibly retaining it)
359
+ */
360
+ protected function consumeSingleLineComment()
361
+ {
362
+ $comment = '';
363
+ while (true) {
364
+ $get = $this->get();
365
+ $comment .= $get;
366
+ if (ord($get) <= self::ORD_LF) { // end of line reached
367
+ // if IE conditional comment
368
+ if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
369
+ $this->keptComment .= "/{$comment}";
370
+ }
371
+ return;
372
+ }
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Consume a multiple line comment from input (possibly retaining it)
378
+ *
379
+ * @throws JSMin_UnterminatedCommentException
380
+ */
381
+ protected function consumeMultipleLineComment()
382
+ {
383
+ $this->get();
384
+ $comment = '';
385
+ for(;;) {
386
+ $get = $this->get();
387
+ if ($get === '*') {
388
+ if ($this->peek() === '/') { // end of comment reached
389
+ $this->get();
390
+ if (0 === strpos($comment, '!')) {
391
+ // preserved by YUI Compressor
392
+ if (!$this->keptComment) {
393
+ // don't prepend a newline if two comments right after one another
394
+ $this->keptComment = "\n";
395
+ }
396
+ $this->keptComment .= "/*!" . substr($comment, 1) . "*/\n";
397
+ } else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
398
+ // IE conditional
399
+ $this->keptComment .= "/*{$comment}*/";
400
+ }
401
+ return;
402
+ }
403
+ } elseif ($get === null) {
404
+ throw new JSMin_UnterminatedCommentException(
405
+ "JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}");
406
+ }
407
+ $comment .= $get;
408
+ }
409
+ }
410
+
411
+ /**
412
+ * Get the next character, skipping over comments. Some comments may be preserved.
413
+ *
414
+ * @return string
415
+ */
416
+ protected function next()
417
+ {
418
+ $get = $this->get();
419
+ if ($get === '/') {
420
+ switch ($this->peek()) {
421
+ case '/':
422
+ $this->consumeSingleLineComment();
423
+ $get = "\n";
424
+ break;
425
+ case '*':
426
+ $this->consumeMultipleLineComment();
427
+ $get = ' ';
428
+ break;
429
+ }
430
+ }
431
+ return $get;
432
+ }
433
+ }
434
+
435
+ class JSMin_UnterminatedStringException extends Exception {}
436
+ class JSMin_UnterminatedCommentException extends Exception {}
437
+ class JSMin_UnterminatedRegExpException extends Exception {}
js/cp_calculatedfieldsf_gutenberg.js ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ );
js/cp_calculatedfieldsf_scripts.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(
2
+ function(){
3
+ window['cp_calculatedfieldsf_insertForm'] = function () {
4
+ send_to_editor('[CP_CALCULATED_FIELDS]');
5
+ };
6
+
7
+ window['cp_calculatedfieldsf_insertVar'] = function() {
8
+ send_to_editor('[CP_CALCULATED_FIELDS_VAR name=""]');
9
+ };
10
+ }
11
+ );
js/fbuilder-loader-admin.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ error_reporting(E_ERROR|E_PARSE);
3
+ header('Content-Type: application/x-javascript; charset=UTF-8');
4
+ ?>
5
+ fbuilderjQuery = (typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
6
+ fbuilderjQueryGenerator = function(){
7
+ if('fbuilderGeneratorFlag' in fbuilderjQuery) return;
8
+ (function($) {
9
+ // Namespace of fbuilder
10
+ $.fbuilder = $.fbuilder || {};
11
+ $.fbuilder[ 'objName' ] = 'fbuilderjQuery';
12
+ <?php
13
+ // Load Module files
14
+ try
15
+ {
16
+ $md = dir( dirname( __FILE__ )."/modules");
17
+ $modules_files = array();
18
+ while( false !== ( $entry = $md->read() ) )
19
+ {
20
+ if ( strlen( $entry ) > 3 && is_dir( $md->path.'/'.$entry ) )
21
+ {
22
+ if ( file_exists( $md->path.'/'.$entry.'/admin' ) )
23
+ {
24
+ $m = dir( $md->path.'/'.$entry.'/admin' );
25
+ while( false !== ( $mentry = $m->read() ) )
26
+ {
27
+ if( strlen( $mentry ) > 3 && strtolower( substr( $mentry, strlen( $mentry ) - 3 ) ) == '.js' )
28
+ {
29
+ $modules_files[] = $m->path.'/'.$mentry;
30
+ }
31
+ }
32
+ }
33
+
34
+ }
35
+ }
36
+ sort( $modules_files );
37
+ foreach( $modules_files as $file )
38
+ {
39
+ require $file;
40
+ }
41
+ }
42
+ catch (Exception $e)
43
+ {
44
+ // ignore the error
45
+ }
46
+
47
+ // Load Control files
48
+ require 'fbuilder-pro-admin.jquery.js';
49
+ try
50
+ {
51
+ $d = dir( dirname( __FILE__ )."/fields-admin" );
52
+ $controls_files = array();
53
+ while (false !== ($entry = $d->read()))
54
+ {
55
+ if (strlen($entry) > 3 && strtolower(substr($entry,strlen($entry)-3)) == '.js')
56
+ {
57
+ if (file_exists( $d->path.'/'.$entry ) )
58
+ {
59
+ $controls_files[] = $d->path.'/'.$entry;
60
+ }
61
+ }
62
+ }
63
+ sort( $controls_files );
64
+ foreach( $controls_files as $file )
65
+ {
66
+ require $file;
67
+ }
68
+ }
69
+ catch (Exception $e)
70
+ {
71
+ // ignore the error
72
+ }
73
+
74
+ ?>
75
+ })(fbuilderjQuery);
76
+ fbuilderjQuery.fbuilderGeneratorFlag = 1;
77
+ };
78
+ fbuilderjQuery(fbuilderjQueryGenerator);
79
+ fbuilderjQuery(window).on('load',fbuilderjQueryGenerator);
js/fbuilder-loader-public.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ error_reporting(E_ERROR|E_PARSE);
3
+ header('Content-Type: application/x-javascript; charset=UTF-8');
4
+ ob_start(); // Turn on output buffering
5
+ ?>
6
+ fbuilderjQuery = (typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
7
+ fbuilderjQuery(window).bind( 'pageshow', function( event ){ if( typeof event.originalEvent[ 'persisted' ] != 'undefined' && event.originalEvent[ 'persisted' ] ) location.reload(); } );
8
+ fbuilderjQuery(function(){
9
+ (function($) {
10
+ // Namespace of fbuilder
11
+ $.fbuilder = $.fbuilder || {};
12
+ $.fbuilder[ 'objName' ] = 'fbuilderjQuery';
13
+
14
+ <?php
15
+ // Load Module files
16
+ try
17
+ {
18
+ $md = dir( dirname( __FILE__ )."/modules" );
19
+ $modules_files = array();
20
+ while( false !== ( $entry = $md->read() ) )
21
+ {
22
+ if ( strlen( $entry ) > 3 && is_dir( $md->path.'/'.$entry ) )
23
+ {
24
+ if ( file_exists( $md->path.'/'.$entry.'/public' ) )
25
+ {
26
+ $m = dir( $md->path.'/'.$entry.'/public' );
27
+ while( false !== ( $mentry = $m->read() ) )
28
+ {
29
+ if( strlen( $mentry ) > 3 && strtolower( substr( $mentry, strlen( $mentry ) - 3 ) ) == '.js' )
30
+ {
31
+ $modules_files[] = $m->path.'/'.$mentry;
32
+ }
33
+ }
34
+ }
35
+
36
+ }
37
+ }
38
+ sort( $modules_files );
39
+ foreach( $modules_files as $file )
40
+ {
41
+ require $file;
42
+ }
43
+ }
44
+ catch (Exception $e)
45
+ {
46
+ // ignore the error
47
+ }
48
+
49
+ // Load Control files
50
+ require 'fbuilder-pro-public.jquery.js';
51
+ try {
52
+ $d = dir( dirname( __FILE__ )."/fields-public" );
53
+ $controls_files = array();
54
+ while (false !== ($entry = $d->read())) {
55
+ if (strlen($entry) > 3 && strtolower(substr($entry,strlen($entry)-3)) == '.js')
56
+ if ( file_exists( $d->path.'/'.$entry ) )
57
+ $controls_files[] = $d->path.'/'.$entry;
58
+ }
59
+ sort( $controls_files );
60
+ foreach( $controls_files as $file )
61
+ {
62
+ require $file;
63
+ }
64
+ } catch (Exception $e) {
65
+ // ignore the error
66
+ }
67
+ ?>
68
+ var fcount = 1;
69
+ var fnum = "_"+fcount;
70
+
71
+ while(typeof window["cp_calculatedfieldsf_fbuilder_config"+fnum] != 'undefined' || fcount < 10 )
72
+ {
73
+ try {
74
+ var cp_calculatedfieldsf_fbuilder_config = window["cp_calculatedfieldsf_fbuilder_config"+fnum];
75
+ var f = $("#fbuilder"+fnum).fbuilder(( typeof cp_calculatedfieldsf_fbuilder_config.obj == 'string' ) ? $.parseJSON(cp_calculatedfieldsf_fbuilder_config.obj) : cp_calculatedfieldsf_fbuilder_config.obj );
76
+ $("#cp_calculatedfieldsf_pform"+fnum).validate({
77
+ ignore:".ignore,.ignorepb",
78
+ errorElement: "div",
79
+ errorPlacement: function(e, element)
80
+ {
81
+ var _parent = element.closest( '.dfield' ),
82
+ _uh = _parent.find( 'span.uh:visible' );
83
+
84
+ if( _uh.length )
85
+ e.appendTo( _uh );
86
+ else
87
+ e.insertAfter( _parent );
88
+
89
+ e.addClass( 'message' )
90
+ .css( 'position', 'absolute' );
91
+ }
92
+ });
93
+ f.fBuild.loadData("form_structure"+fnum);
94
+ } catch (e) {}
95
+ fcount++;
96
+ fnum = "_"+fcount;
97
+ }
98
+ })(fbuilderjQuery);
99
+ });
100
+ <?php
101
+
102
+ $buffered_contents = ob_get_contents();
103
+ ob_end_clean(); // Clean the output buffer and turn off output buffering
104
+ if( !empty( $_REQUEST[ 'min' ] ) )
105
+ {
106
+ if( !class_exists( 'JSMin' ) )
107
+ {
108
+ require_once rtrim( dirname( __FILE__ ), '/' ).'/JSMin.php';
109
+ }
110
+
111
+ try{
112
+ $buffered_contents = JSMin::minify( $buffered_contents );
113
+ $all_js_path = rtrim( dirname( __FILE__ ), '/' ).'/cache/all.js';
114
+ @file_put_contents( $all_js_path, $buffered_contents );
115
+ }catch( Exception $err){}
116
+ }
117
+ print $buffered_contents;
118
+
119
+ ?>
js/fbuilder-pro-admin.jquery.js ADDED
@@ -0,0 +1,1108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder[ 'typeList' ] = [];
2
+ $.fbuilder[ 'categoryList' ] = [];
3
+ $.fbuilder[ 'controls' ] = {};
4
+ $.fbuilder[ 'displayedDuplicateContainerMessage' ] = false;
5
+ $.fbuilder[ 'duplicateContainerMessage' ] = 'Note: If the container field being duplicated includes calculated fields or fields with dependency rules, the equations and dependencies rules in the new fields are exactly the same equations and dependency rules than in the original fields.';
6
+
7
+ $.fbuilder[ 'preview' ] = function( e )
8
+ {
9
+ var f = $( e.form );
10
+ f.attr( 'target', 'formpopup' ).attr(
11
+ 'onsubmit',
12
+ function( f )
13
+ {
14
+ var w = screen.width*0.8,
15
+ h = screen.height*0.7,
16
+ l = screen.width/2 - w/2,
17
+ t = screen.height/2 - h/2,
18
+ new_window = window.open('', 'formpopup', 'resizeable,scrollbars,width='+w+',height='+h+',left='+l+',top='+t);
19
+
20
+ $( f ).removeAttr( 'onsubmit' );
21
+ new_window.focus();
22
+ }
23
+ );
24
+ $( '<input type="hidden" name="preview" value="1" />' ).appendTo( f );
25
+
26
+ f[ 0 ].submit();
27
+ f.attr( 'target', '_self' ).find( 'input[name="preview"]').remove();
28
+ };
29
+
30
+ $.fbuilder[ 'htmlEncode' ] = function(value)
31
+ {
32
+ value = $('<div/>').text(value).html();
33
+ value = value.replace(/&/g, '&amp;')
34
+ .replace(/"/g, "&quot;")
35
+ .replace(/&amp;lt;/g, '&lt;')
36
+ .replace(/&amp;gt;/g, '&gt;');
37
+ value = value.replace(/&amp;/g, '&');
38
+ return value;
39
+ };
40
+
41
+ $.fbuilder[ 'htmlDecode' ] = function(value)
42
+ {
43
+ if( /&(?:#x[a-f0-9]+|#[0-9]+|[a-z0-9]+);?/ig.test( value ) ) value = $( '<div/>' ).html( value ).text();
44
+ return value;
45
+ };
46
+
47
+ $.fbuilder[ 'escape_symbol' ] = function( value ) // Escape the symbols used in regulars expressions
48
+ {
49
+ return value.replace(/([\^\$\-\.\,\[\]\(\)\/\\\*\?\+\!\{\}])/g, "\\$1");
50
+ };
51
+
52
+ $.fbuilder[ 'parseVal' ] = function( value, thousandSeparator, decimalSymbol )
53
+ {
54
+ if( value == '' ) return 0;
55
+ value += '';
56
+
57
+ thousandSeparator = new RegExp( $.fbuilder.escape_symbol( ( typeof thousandSeparator == 'undefined' ) ? ',' : thousandSeparator ), 'g' );
58
+ decimalSymbol = new RegExp( $.fbuilder.escape_symbol( ( typeof decimalSymbol == 'undefined' || /^\s*$/.test( decimalSymbol ) ) ? '.' : decimalSymbol ), 'g' );
59
+
60
+ var t = value.replace( thousandSeparator, '' ).replace( decimalSymbol, '.' ).replace( /\s/g, '' ),
61
+ p = /[+\-]?((\d+(\.\d+)?)|(\.\d+))(?:[eE][+\-]?\d+)?/.exec( t );
62
+
63
+ return ( p ) ? p[0]*1 : '"' + value.replace(/'/g, "\\'").replace( /\$/g, '') + '"';
64
+ };
65
+
66
+ $.fbuilder[ 'showErrorMssg' ] = function( str ) // Display an error message
67
+ {
68
+ $( '.form-builder-error-messages' ).html( '<div class="error-text">' + str + '</div>' );
69
+ };
70
+
71
+ // fbuilder plugin
72
+ $.fn.fbuilder = function(){
73
+ var typeList = $.fbuilder.typeList,
74
+ categoryList = $.fbuilder.categoryList;
75
+
76
+ $.fbuilder[ 'getNameByIdFromType' ] = function( id )
77
+ {
78
+ for ( var i = 0, h = typeList.length; i < h; i++ )
79
+ {
80
+ if ( typeList[i].id == id )
81
+ {
82
+ return typeList[i].name;
83
+ }
84
+ }
85
+ return "";
86
+ };
87
+
88
+ for ( var i=0, h = typeList.length; i < h; i++ )
89
+ {
90
+ var category_id = typeList[ i ].control_category;
91
+
92
+ if( typeof categoryList[ category_id ] == 'undefined' )
93
+ {
94
+ categoryList[ category_id ] = { title : '', description : '', typeList : [] };
95
+ }
96
+ else if( typeof categoryList[ category_id ][ 'typeList' ] == 'undefined' )
97
+ {
98
+ categoryList[ category_id ][ 'typeList' ] = [];
99
+ }
100
+
101
+ categoryList[ category_id ].typeList.push( i );
102
+ }
103
+
104
+ for ( var i in categoryList )
105
+ {
106
+ $("#tabs-1").append('<div style="clear:both;"></div><div>'+categoryList[ i ].title+'</div><hr />');
107
+ if( typeof categoryList[ i ][ 'description' ] != 'undefined' && !/^\s*$/.test( categoryList[ i ][ 'description' ] ) )
108
+ {
109
+ $("#tabs-1").append('<div style="clear:both;"></div><div class="category-description">'+categoryList[ i ].description+'</div>');
110
+ }
111
+
112
+ if( typeof categoryList[ i ][ 'typeList' ] != 'undefined' )
113
+ {
114
+ for( var j = 0, k = categoryList[ i ].typeList.length; j < k; j++ )
115
+ {
116
+ var index = categoryList[ i ].typeList[ j ];
117
+ $("#tabs-1").append('<div class="button itemForm width40" id="'+typeList[ index ].id+'">'+typeList[ index ].name+'</div>');
118
+ }
119
+ }
120
+ }
121
+
122
+ $("#tabs-1").append('<div class="clearer"></div>');
123
+ $( ".button").button();
124
+
125
+ // Create a items object
126
+ var items = [],
127
+ fieldsIndex = {},
128
+ selected = -3;
129
+
130
+ $.fbuilder[ 'editItem' ] = function( id )
131
+ {
132
+ selected = id;
133
+ try
134
+ {
135
+ $('#tabs-2').html( items[id].showAllSettings() );
136
+ } catch (e) {}
137
+ items[id].editItemEvents();
138
+ };
139
+
140
+ $.fbuilder[ 'removeItem' ] = function( index )
141
+ {
142
+ if( typeof items[ index ][ 'remove' ] != 'undefined' ) items[ index ][ 'remove' ]();
143
+ items[ index ] = 0;
144
+ selected = -2;
145
+ $('#tabs').tabs("option", "active", 0);
146
+ };
147
+
148
+ $.fbuilder[ 'duplicateItem' ] = function( index, parentItem )
149
+ {
150
+ var n = 0, i, h, item, nIndex, duplicate = items[index];
151
+ for ( i in fieldsIndex ) if( /fieldname/.test( i ) ) n = Math.max( parseInt( i.replace( /fieldname/g,"" ) ), n );
152
+
153
+ item = $.extend( true, {}, duplicate, { name:"fieldname"+(n+1) } );
154
+ if( typeof item[ 'fields' ] != 'undefined' ) item[ 'fields' ] = [];
155
+ if( typeof parentItem != 'undefined' ) item[ 'parent' ] = parentItem;
156
+ else
157
+ {
158
+ /* Check if the parent is a container, and insert the new item as child of parent */
159
+ if(
160
+ duplicate[ 'parent' ] != '' &&
161
+ typeof items[ fieldsIndex[ duplicate[ 'parent' ] ] ][ 'duplicateItem' ] != 'undefined'
162
+ )
163
+ items[ fieldsIndex[ duplicate[ 'parent' ] ] ][ 'duplicateItem' ]( duplicate.name, item['name'] );
164
+ }
165
+
166
+ // Insert the duplicated item just below the original
167
+ nIndex = index*1+1;
168
+ items.splice( nIndex, 0, item);
169
+ fieldsIndex[ item[ 'name' ] ] = nIndex;
170
+ i = nIndex; h = items.length;
171
+ for ( i; i<h; i++ ) // Correct the rest of indices
172
+ {
173
+ items[i].index = i;
174
+ fieldsIndex[ items[i].name ] = i;
175
+ }
176
+
177
+ // The duplicated item is a container
178
+ if( typeof item[ 'duplicateItem' ] != 'undefined' )
179
+ {
180
+ // Alert Message
181
+ if( !$.fbuilder[ 'displayedDuplicateContainerMessage' ] )
182
+ {
183
+ alert( $.fbuilder[ 'duplicateContainerMessage' ] );
184
+ $.fbuilder[ 'displayedDuplicateContainerMessage' ] = true;
185
+ }
186
+
187
+ i = 0; h = duplicate[ 'fields' ].length;
188
+ for( i; i < h; i++ )
189
+ {
190
+ item[ 'fields' ][ i ] = $.fbuilder[ 'duplicateItem' ]( fieldsIndex[duplicate[ 'fields' ][ i ]], item[ 'name' ] );
191
+ }
192
+ }
193
+ return item[ 'name' ];
194
+ };
195
+
196
+ $.fbuilder[ 'editForm' ] = function()
197
+ {
198
+ $('#tabs-3').html(theForm.showAllSettings());
199
+ selected = -1;
200
+
201
+ $("#fTitle").keyup(function()
202
+ {
203
+ theForm.title = $(this).val();
204
+ $.fbuilder.reloadItems({'form':1});
205
+ });
206
+
207
+ $("#fEvalEquations").click(function()
208
+ {
209
+ theForm.evalequations = ($(this).is( ':checked' )) ? 1 : 0;
210
+ $.fbuilder.reloadItems({'form':1});
211
+ });
212
+
213
+ $("[name='fEvalEquationsEvent']").change(function()
214
+ {
215
+ theForm.evalequationsevent = $("[name='fEvalEquationsEvent']:checked").val();
216
+ $.fbuilder.reloadItems({'form':1});
217
+ });
218
+
219
+ $("#fAutocomplete").click(function()
220
+ {
221
+ theForm.autocomplete = ($(this).is( ':checked' )) ? 1 : 0;
222
+ $.fbuilder.reloadItems({'form':1});
223
+ });
224
+
225
+ $("#fPersistence").click(function()
226
+ {
227
+ theForm.persistence = ($(this).is( ':checked' )) ? 1 : 0;
228
+ $.fbuilder.reloadItems({'form':1});
229
+ });
230
+
231
+ $("#fDescription").keyup(function()
232
+ {
233
+ theForm.description = $(this).val();
234
+ $.fbuilder.reloadItems({'form':1});
235
+ });
236
+
237
+ $("#fLayout").change(function()
238
+ {
239
+ theForm.formlayout = $(this).val();
240
+ $.fbuilder.reloadItems();
241
+ });
242
+
243
+ $("#fTemplate").change(function()
244
+ {
245
+ theForm.formtemplate = $(this).val();
246
+ var template = $.fbuilder.showSettings.formTemplateDic[ theForm.formtemplate ],
247
+ thumbnail = '',
248
+ description = '';
249
+
250
+ if( typeof template != 'undefined' )
251
+ {
252
+ if( typeof template[ 'thumbnail' ] != 'undefined' )
253
+ {
254
+ thumbnail = '<img src="' + template[ 'thumbnail' ] + '">';
255
+ }
256
+ if( typeof template[ 'description' ] != 'undefined' )
257
+ {
258
+ description = template[ 'description' ];
259
+ }
260
+ }
261
+ $( '#fTemplateThumbnail' ).html( thumbnail );
262
+ $( '#fTemplateDescription' ).html( description );
263
+ $.fbuilder.reloadItems({'form':1});
264
+ });
265
+
266
+ $("#fCustomStyles").change(function()
267
+ {
268
+ theForm.customstyles = $(this).val();
269
+ $.fbuilder.reloadItems({'form':1});
270
+ });
271
+ };
272
+
273
+ $.fbuilder[ 'defineGeneralEvents' ] = function()
274
+ {
275
+ // Fields events
276
+ $(document).on(
277
+ {
278
+ 'click' : function(evt){
279
+ $.fbuilder[ 'editItem' ]($(this).attr("id").replace("field-",""));
280
+ $( '#fieldlist .ui-selected' ).removeClass("ui-selected");
281
+ $(this).addClass("ui-selected");
282
+ $('#tabs').tabs("option", "active", 1);
283
+ evt.stopPropagation();
284
+ },
285
+ 'mouseover' : function(evt){
286
+ $(this).addClass("ui-over");
287
+ evt.stopPropagation();
288
+ },
289
+ 'mouseout' : function(evt){
290
+ $(this).removeClass("ui-over");
291
+ evt.stopPropagation();
292
+ }
293
+ },
294
+ '.fields'
295
+ );
296
+
297
+ $(document).on('focus', '.field', function(){$(this).blur();});
298
+
299
+ // Handle events
300
+ $(document).on('click', '.fields .remove', function(evt){
301
+ evt.stopPropagation();
302
+ $.fbuilder[ 'removeItem' ]($(this).parent().attr("id").replace("field-",""));
303
+ items = $.grep( items, function( e ){ return (e != 0 ); } );
304
+ $.fbuilder.reloadItems();
305
+ });
306
+
307
+ $(document).on('click', '.fields .copy', function(evt){
308
+ evt.stopPropagation();
309
+ $.fbuilder[ 'duplicateItem' ]($(this).parent().attr("id").replace("field-",""));
310
+ $('#tabs').tabs("option", "active", 0);
311
+ $.fbuilder.reloadItems();
312
+ });
313
+
314
+ $(document).on('click', '.fields .collapse', function(evt){
315
+ evt.stopPropagation();
316
+ var f = $(this).closest('.fields'),
317
+ i = f.attr("id").replace("field-",""),
318
+ item = ffunct.getItems()[i];
319
+
320
+ item['collapsed'] = true;
321
+ f.addClass('collapsed');
322
+ $.fbuilder.reloadItems({'field': item});
323
+ });
324
+
325
+ $(document).on('click', '.fields .uncollapse', function(evt){
326
+ evt.stopPropagation();
327
+ var f = $(this).closest('.fields'),
328
+ i = f.attr("id").replace("field-",""),
329
+ item = ffunct.getItems()[i];
330
+
331
+ item['collapsed'] = false;
332
+ f.removeClass('collapsed');
333
+ $.fbuilder.reloadItems({'field': item});
334
+ });
335
+
336
+ // Title and subtitle section events
337
+ $(document).on(
338
+ {
339
+ 'mouseover' : function(){
340
+ $(this).addClass("ui-over");
341
+ },
342
+ 'mouseout' : function(){
343
+ $(this).removeClass("ui-over");
344
+ },
345
+ 'click' : function(evt){
346
+ evt.stopPropagation();
347
+ $('#tabs').tabs("option", "active", 2);
348
+ $.fbuilder.editForm();
349
+ $(this).siblings().removeClass("ui-selected");
350
+ $(this).addClass("ui-selected");
351
+ }
352
+ },
353
+ '.fform'
354
+ );
355
+
356
+ // Dashboard event
357
+ $(document).on('click', '.expand-shrink', function(){
358
+ $(this).toggleClass( 'ui-icon-triangle-1-e ui-icon-triangle-1-w' );
359
+ $('.form-builder .ctrlsColumn').toggleClass( 'expanded' );
360
+ });
361
+
362
+ $(document).on('click', '#fbuilder', function(evt)
363
+ {
364
+ evt.stopPropagation();
365
+ selected = -2;
366
+ $(".fform").removeClass("ui-selected")
367
+ $( '#fieldlist .ui-selected' ).removeClass("ui-selected");
368
+ $('#tabs').tabs("option", "active", 0);
369
+ }
370
+ );
371
+ };
372
+
373
+ $.fbuilder[ 'reloadItems' ] = function( args )
374
+ {
375
+ function replaceFieldTags( field )
376
+ {
377
+ if( typeof field[ 'display' ] != 'undefined' )
378
+ {
379
+ var e = $( '.'+field[ 'name' ] ),
380
+ n = $( field.display() ),
381
+ as = true; // Call after_show
382
+
383
+ if( n.find( '.dfield:eq(0)>.fcontainer>.fieldscontainer').length )
384
+ {
385
+ n.find( '.dfield:eq(0)>.fcontainer>.fieldscontainer')
386
+ .replaceWith( e.find( '.dfield:eq(0)>.fcontainer>.fieldscontainer' ) );
387
+ as = false;
388
+ }
389
+ e.replaceWith(n);
390
+ if( as && typeof field[ 'after_show' ] != 'undefined') field.after_show();
391
+ $("#field-"+field.index).addClass("ui-selected");
392
+ }
393
+ } // End replaceFieldTags
394
+
395
+ function replaceTitleDescTags()
396
+ {
397
+ $("#formheader").html(theForm.display());
398
+ } // End replaceTitleDescTags
399
+
400
+ var default_args = {
401
+ 'field' : {},
402
+ 'form' : false
403
+ };
404
+
405
+ args = $.extend(true, {}, default_args, ( typeof args != 'undefined' ) ? args : {} );
406
+
407
+ if( !$.isEmptyObject( args[ 'field' ] ) )
408
+ {
409
+ replaceFieldTags( args[ 'field' ] );
410
+ }
411
+ else if( args['form'] )
412
+ {
413
+ replaceTitleDescTags();
414
+ }
415
+ else
416
+ {
417
+ var email_str = '', // email fields list
418
+ cu_user_email_field = ($('#cu_user_email_field').attr("def") || '').split( ',' ),
419
+
420
+ cost_str = '', // fields list for paypal request
421
+ request_cost = $('#request_cost').attr("def"),
422
+
423
+ recurrent_str = '', // fields list for recurrent payments
424
+ paypal_recurrent_field = $('[name="paypal_recurrent_field"]').attr("def"),
425
+
426
+ paypal_price_field = $('#paypal_price_field').attr("def"), // fields for times intervals in recurrent payments
427
+ interval_fields_str = '<option value="" '+( ('' == paypal_price_field ) ? "selected" : "" )+'> ---- No ---- </option>';
428
+
429
+ // Set the correct fields alignment class
430
+ for ( var i=0, h = $.fbuilder.showSettings.formlayoutList.length; i < h; i++ )
431
+ {
432
+ $("#fieldlist").removeClass( $.fbuilder.showSettings.formlayoutList[i].id );
433
+ }
434
+ $("#fieldlist").addClass(theForm.formlayout);
435
+
436
+ replaceTitleDescTags();
437
+ $("#fieldlist").html("");
438
+ fieldsIndex = {};
439
+ for ( var i=0, h = items.length; i < h; i++ )
440
+ {
441
+ var item = items[i];
442
+
443
+ item.index = i;
444
+ item.parent = '';
445
+ fieldsIndex[ item.name ] = i;
446
+
447
+ $("#fieldlist").append(item.display());
448
+ if ( i == selected )
449
+ {
450
+ $("#field-"+i).addClass("ui-selected");
451
+ if( $('#tabs').tabs("option", "active") != 1 )
452
+ {
453
+ $.fbuilder[ 'editItem' ]( i );
454
+ }
455
+ }
456
+ else
457
+ {
458
+ $("#field-"+i).removeClass("ui-selected");
459
+ }
460
+
461
+ // Email fields
462
+ if (item.ftype=="femail" || item.ftype=="femailds")
463
+ {
464
+ email_str += '<option value="'+item.name+'" '+( ( $.inArray( item.name, cu_user_email_field ) != -1 ) ? "selected" : "" )+'>'+item.name+' ('+item.title+')'+'</option>';
465
+ }
466
+ else
467
+ {
468
+ // Request cost fields
469
+ if(!/(femail)|(fdate)|(ffile)|(fpassword)|(fphone)|(fsectionbreak)|(fpagebreak)|(fsummary)|(fcontainer)|(ffieldset)|(fdiv)|(fmedia)|(fbutton)|(fhtml)/i.test(item.ftype))
470
+ {
471
+ cost_str += '<option value="'+item.name+'" '+( ( item.name == request_cost ) ? "selected" : "" )+'>'+item.name+'('+(item.title)+')</option>'
472
+ }
473
+
474
+ // Recurrent Payments
475
+ if (item.ftype=="fradio" || item.ftype=="fdropdown")
476
+ {
477
+ recurrent_str += '<option value="'+item.name+'" '+( ( item.name == paypal_recurrent_field ) ? "selected" : "" )+'>'+item.name+' ('+item.title+')'+'</option>';
478
+ }
479
+
480
+ // Times Intervals
481
+ interval_fields_str += '<option value="'+item.name+'" '+( ( item.name == paypal_price_field ) ? "selected" : "" )+'>'+(item.title)+'</option>';
482
+ }
483
+ }
484
+
485
+ // Assign the email fields to the "cu_user_email_field" list
486
+ $('#cu_user_email_field').html(email_str);
487
+
488
+ // Assign the fields to the "request_cost" list
489
+ $('#request_cost').html(cost_str);
490
+
491
+ // Assign the fields to the "paypal_recurrent_field" list
492
+ $('[name="paypal_recurrent_field"]').html(recurrent_str);
493
+
494
+ // Assign the fields to the "paypal_price_field" list
495
+ $('#paypal_price_field').html(interval_fields_str);
496
+
497
+ for ( var i=0, h = items.length; i < h; i++ )
498
+ {
499
+ if( typeof items[ i ].after_show != 'undefined' ) items[ i ].after_show();
500
+ }
501
+ }
502
+
503
+ ffunct.saveData("form_structure");
504
+ };
505
+
506
+ var fform=function(){};
507
+ $.extend(fform.prototype,
508
+ {
509
+ title:"Untitled Form",
510
+ description:"This is my form. Please fill it out. It's awesome!",
511
+ formlayout:"top_aligned",
512
+ formtemplate:"",
513
+ evalequations:1,
514
+ evalequationsevent:2,
515
+ autocomplete:1,
516
+ persistence:0,
517
+ customstyles:"",
518
+ display:function()
519
+ {
520
+ return '<div class="fform" id="field"><div class="arrow ui-icon ui-icon-play "></div><h2>'+this.title+'</h2><span>'+this.description+'</span></div>';
521
+ },
522
+
523
+ showAllSettings:function()
524
+ {
525
+ var layout = '',
526
+ template = '<option value="">Use default template</option>',
527
+ thumbnail = '',
528
+ description = '',
529
+ selected = '',
530
+ str = '';
531
+
532
+ for ( var i = 0; i< $.fbuilder.showSettings.formlayoutList.length; i++ )
533
+ {
534
+ layout += '<option value="'+$.fbuilder.showSettings.formlayoutList[i].id+'" '+(($.fbuilder.showSettings.formlayoutList[i].id==this.formlayout)?"selected":"")+'>'+$.fbuilder.showSettings.formlayoutList[i].name+'</option>';
535
+ }
536
+
537
+ for ( var i in $.fbuilder.showSettings.formTemplateDic )
538
+ {
539
+ if( /^\s*$/.test( i ) ) break;
540
+ selected = '';
541
+ if( $.fbuilder.showSettings.formTemplateDic[i].prefix==this.formtemplate )
542
+ {
543
+ selected = 'SELECTED';
544
+ if( typeof $.fbuilder.showSettings.formTemplateDic[i].thumbnail != 'undefined' )
545
+ {
546
+ thumbnail = '<img src="'+$.fbuilder.showSettings.formTemplateDic[i].thumbnail+'">';
547
+ }
548
+
549
+ if( typeof $.fbuilder.showSettings.formTemplateDic[i].description != 'undefined' )
550
+ {
551
+ description = $.fbuilder.showSettings.formTemplateDic[i].description;
552
+ }
553
+ }
554
+
555
+ template += '<option value="'+$.fbuilder.showSettings.formTemplateDic[i].prefix+'" ' + selected + '>'+$.fbuilder.showSettings.formTemplateDic[i].title+'</option>';
556
+ }
557
+
558
+ str += '<div><label>Form Name</label><input class="large" name="fTitle" id="fTitle" value="'+$.fbuilder.htmlEncode(this.title)+'" /></div><div><label>Description</label><textarea class="large" name="fDescription" id="fDescription">'+this.description+'</textarea></div><div><label>Label Placement</label><br /><select name="fLayout" id="fLayout" class="large">'+layout+'</select></div><div><label><input type="checkbox" name="fAutocomplete" id="fAutocomplete" '+( ( this.autocomplete ) ? 'CHECKED' : '' )+' /> Enable autocompletion</label></div><div><label><input type="checkbox" name="fPersistence" id="fPersistence" '+( ( this.persistence ) ? 'CHECKED' : '' )+' /> Enable the browser\'s persistence (the data are stored locally on browser)</label></div>';
559
+
560
+ if(typeof $.fbuilder.controls[ 'fCalculated' ] != 'undefined')
561
+ {
562
+ str += '<div><label><input type="checkbox" name="fEvalEquations" id="fEvalEquations" '+( ( this.evalequations ) ? 'CHECKED' : '' )+' /> Eval dynamically the equations associated to the calculated fields</label></div>';
563
+
564
+ str += '<div class="groupBox"><label><input type="radio" name="fEvalEquationsEvent" name="fEvalEquationsEvent" value="1" '+( ( this.evalequationsevent == 1 ) ? 'CHECKED' : '' )+' /> Eval the equations in the onchange events</label><br /><label><input type="radio" name="fEvalEquationsEvent" name="fEvalEquationsEvent" value="2" '+( ( 'undefined' == typeof this.evalequationsevent || this.evalequationsevent == 2 ) ? 'CHECKED' : '' )+' /> Eval the equations in the onchange and keyup events</label></div>';
565
+ }
566
+
567
+ str += '<div><label>Form Template</label><br /><select name="fTemplate" id="fTemplate" class="large">'+template+'</select></div><br /><div style="text-align:center"><span id="fTemplateThumbnail">'+thumbnail+'</span><div></div><span id="fTemplateDescription">'+description+'</span></div><div><label>Customize Form Design <i>(Enter the CSS rules. <a href="http://cff.dwbooster.com/faq#q82" target="_blank">More information</a>)</i></label><br /><textarea id="fCustomStyles" style="width:100%;height:150px;">'+this.customstyles+'</textarea></div>' ;
568
+
569
+ return str;
570
+ }
571
+ }
572
+ );
573
+
574
+ var theForm = new fform();
575
+ $("#fieldlist").sortable(
576
+ {
577
+ 'connectWith': '.ui-sortable',
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;
585
+ for( i = 0; i < h; i++ )
586
+ {
587
+ if( ui.item.hasClass( items[ i ].name ) ) break;
588
+ }
589
+
590
+ if( ui.item.parent().attr( 'id' ) == 'fieldlist' )
591
+ {
592
+ // receive or change order in fieldlist
593
+ var prev = ui.item.prev(),
594
+ index = parseInt( ui.item.index() );
595
+
596
+ if( prev.length )
597
+ {
598
+ for( var j = 0; j < h; j++ )
599
+ {
600
+ if( prev.hasClass(items[j].name) )
601
+ {
602
+ index = (i<=j) ? j : ++j;
603
+ break;
604
+ }
605
+ }
606
+ }
607
+
608
+ items.splice( index, 0, items.splice( i, 1 )[ 0 ] );
609
+ $.fbuilder.reloadItems();
610
+ $( '.'+/((fieldname)|(separator))\d+/.exec( ui.item.attr( 'class' ) )[ 0 ] ).click();
611
+ }
612
+ else
613
+ {
614
+ // remove
615
+ items = items.concat( items.splice( i, 1 ) );
616
+ }
617
+ }
618
+ }
619
+ );
620
+
621
+ $('#tabs').tabs(
622
+ {
623
+ activate: function(event, ui)
624
+ {
625
+ switch( $(this).tabs( "option", "active" ) )
626
+ {
627
+ case 0:
628
+ $(".fform").removeClass("ui-selected");
629
+ break;
630
+ case 1:
631
+ $(".fform").removeClass("ui-selected");
632
+ if (selected < 0)
633
+ {
634
+ $('#tabs-2').html('<b>No Field Selected</b><br />Please click on a field in the form preview on the right to change its properties.');
635
+ }
636
+ break;
637
+ case 2:
638
+ $(".fields").removeClass("ui-selected");
639
+ $(".fform").addClass("ui-selected");
640
+ $.fbuilder.editForm();
641
+ break;
642
+ }
643
+ }
644
+ }
645
+ );
646
+
647
+ var ffunct = {
648
+ getFieldsIndex: function()
649
+ {
650
+ return fieldsIndex;
651
+ },
652
+ getItems: function()
653
+ {
654
+ return items;
655
+ },
656
+ addItem: function(id)
657
+ {
658
+ var obj = new $.fbuilder.controls[id](),
659
+ fBuild = this,
660
+ n = 0;
661
+
662
+ obj.init();
663
+ for ( var i in fieldsIndex ) if( /fieldname/.test( i ) ) n = Math.max( parseInt( i.replace( /fieldname/g,"" ) ), n );
664
+ n++;
665
+
666
+ obj.fBuild = fBuild;
667
+ $.extend(obj,{name:"fieldname"+n});
668
+
669
+ if( selected >= 0 )
670
+ {
671
+ n = (selected)*1+1;
672
+ items.splice( n, 0, obj );
673
+ fieldsIndex[obj.name] = n;
674
+ for(var i = n, h = items.length; i<h; i++) fieldsIndex[items[i].name] = i;
675
+
676
+ if( id != 'fPageBreak' )
677
+ {
678
+ if( typeof items[ selected ][ 'addItem' ] != 'undefined' )
679
+ {
680
+ obj.name[ 'parent' ] = items[ selected ][ 'name' ];
681
+ items[ selected ][ 'addItem' ]( obj.name );
682
+ }
683
+ else
684
+ {
685
+ // get the parent
686
+ if( items[ selected ][ 'parent' ] !== '' )
687
+ {
688
+ items[ fieldsIndex[ items[ selected ][ 'parent' ] ] ][ 'addItem' ]( obj.name, items[ selected ][ 'name' ]);
689
+ }
690
+
691
+ selected++;
692
+ }
693
+ }
694
+ else
695
+ {
696
+ selected++;
697
+ }
698
+ }
699
+ else
700
+ {
701
+ selected = items.length;
702
+ items[selected] = obj;
703
+ }
704
+ $.fbuilder.reloadItems();
705
+ return obj;
706
+ },
707
+ saveData:function(f)
708
+ {
709
+ try{
710
+ var itemsStringified = $.stringifyXX( items ),
711
+ theFormStringified = $.stringifyXX( theForm ),
712
+ errorTxt = 'The entered data includes invalid characters. Please, if you are copying and pasting from another platform, be sure the data not include invalid characters.',
713
+ str;
714
+
715
+ if( typeof global_varible_save_data != 'undefined' )
716
+ {
717
+ // If the global_varible_save_data exists clear the form-builder-error-messages
718
+ $( '.form-builder-error-messages' ).html( '' );
719
+ }
720
+
721
+ try{
722
+ if( $.parseJSON( itemsStringified ) != null && $.parseJSON( theFormStringified ) != null )
723
+ {
724
+ str = "["+ itemsStringified +",["+ theFormStringified +"]]";
725
+ $( "#"+f ).val( str );
726
+ }
727
+ else
728
+ {
729
+ $.fbuilder[ 'showErrorMssg' ]( errorTxt );
730
+ }
731
+ }
732
+ catch( err )
733
+ {
734
+ $.fbuilder[ 'showErrorMssg' ]( errorTxt );
735
+ }
736
+
737
+ global_varible_save_data = true;
738
+ }catch( err ){}
739
+ },
740
+ loadData:function(form_structure, available_templates)
741
+ {
742
+ var structure,
743
+ templates = null,
744
+ fBuild = this;
745
+
746
+ try{
747
+ structure = $.parseJSON( $("#"+form_structure).val() );
748
+ }
749
+ catch(err)
750
+ {
751
+ structure = [];
752
+ if(typeof console != 'undefined') console.log(err);
753
+ }
754
+
755
+ try{
756
+ if( typeof available_templates != 'undefined' ) templates = $.parseJSON( $("#"+available_templates).val() );
757
+ }
758
+ catch(err)
759
+ {
760
+ templates = null;
761
+ if(typeof console != 'undefined') console.log(err);
762
+ }
763
+
764
+ if ( structure )
765
+ {
766
+ $.fbuilder.defineGeneralEvents();
767
+ if (structure.length==2)
768
+ {
769
+ items = [];
770
+ for (var i=0;i<structure[0].length;i++)
771
+ {
772
+ var obj = new $.fbuilder.controls[structure[0][i].ftype]();
773
+ obj = $.extend( true, {}, obj, structure[0][i] );
774
+ obj.fBuild = fBuild;
775
+ items[items.length] = obj;
776
+ }
777
+ theForm = new fform();
778
+ theForm = $.extend(theForm,structure[1][0]);
779
+ $.fbuilder.reloadItems();
780
+ }
781
+ }
782
+
783
+ if( templates )
784
+ {
785
+ $.fbuilder.showSettings.formTemplateDic = templates;
786
+ }
787
+ },
788
+ removeItem: $.fbuilder[ 'removeItem' ],
789
+ editItem: $.fbuilder[ 'editItem' ]
790
+ }
791
+
792
+ this.fBuild = ffunct;
793
+ return this;
794
+ };
795
+
796
+ $.fbuilder[ 'showSettings' ] = {
797
+ sizeList:new Array({id:"small",name:"Small"},{id:"medium",name:"Medium"},{id:"large",name:"Large"}),
798
+ layoutList:new Array({id:"one_column",name:"One Column"},{id:"two_column",name:"Two Column"},{id:"three_column",name:"Three Column"},{id:"side_by_side",name:"Side by Side"}),
799
+ formlayoutList:new Array({id:"top_aligned",name:"Top Aligned"},{id:"left_aligned",name:"Left Aligned"},{id:"right_aligned",name:"Right Aligned"}),
800
+ formTemplateDic: {}, // Form Template dictionary
801
+ showFieldType: function( v )
802
+ {
803
+ return '<label>Field Type: '+$.fbuilder[ 'getNameByIdFromType' ]( v )+'</label><br /><br />';
804
+ },
805
+ showTitle: function(v)
806
+ {
807
+ return '<label>Field Label</label><textarea class="large" name="sTitle" id="sTitle">'+v+'</textarea>';
808
+ },
809
+ showShortLabel: function( v )
810
+ {
811
+ return '<div><label>Short label (optional) [<a class="helpfbuilder" text="The short label is used at title for the column when exporting the form data to CSV files.\n\nIf the short label is empty then, the field label will be used for the CSV file.">help?</a>] :</label><input class="large" name="sShortlabel" id="sShortlabel" value="'+v+'" /></div>';
812
+ },
813
+ showName: function( v )
814
+ {
815
+ return '<div><label>Field name, tag for the message:</label><input readonly="readonly" class="large" name="sNametag" id="sNametag" value="&lt;%'+v+'%&gt;" />'+
816
+ '<input style="display:none" readonly="readonly" class="large" name="sName" id="sName" value="'+v+'" /></div>';
817
+ },
818
+ showPredefined: function(v,c)
819
+ {
820
+ return '<div><label>Predefined Value</label><textarea class="large" name="sPredefined" id="sPredefined">'+v+'</textarea><br /><input type="checkbox" name="sPredefinedClick" id="sPredefinedClick" '+((c)?"checked":"")+' value="1" > Use predefined value as placeholder.</div>';
821
+ },
822
+ showEqualTo: function(v,name)
823
+ {
824
+ return '<div><label>Equal to [<a class="helpfbuilder" text="Use this field to create password confirmation field or email confirmation fields.\n\nSpecify this setting ONLY into the confirmation field, not in the original field.">help?</a>]</label><br /><select class="equalTo" name="sEqualTo" id="sEqualTo" dvalue="'+v+'" dname="'+name+'"></select></div>';
825
+ },
826
+ showRequired: function(v)
827
+ {
828
+ return '<div><input type="checkbox" name="sRequired" id="sRequired" '+((v)?"checked":"")+'><label>Required</label></div>';
829
+ },
830
+ showReadonly: function(v)
831
+ {
832
+ return '<div><input type="checkbox" name="sReadonly" id="sReadonly" '+((v)?"checked":"")+'><label>Read Only</label></div>';
833
+ },
834
+ showSize: function(v)
835
+ {
836
+ var str = "";
837
+ for (var i=0;i<this.sizeList.length;i++)
838
+ {
839
+ str += '<option value="'+this.sizeList[i].id+'" '+((this.sizeList[i].id==v)?"selected":"")+'>'+this.sizeList[i].name+'</option>';
840
+ }
841
+ return '<label>Field Size</label><br /><select name="sSize" id="sSize">'+str+'</select>';
842
+ },
843
+ showLayout: function(v)
844
+ {
845
+ var str = "";
846
+ for (var i=0;i<this.layoutList.length;i++)
847
+ {
848
+ str += '<option value="'+this.layoutList[i].id+'" '+((this.layoutList[i].id==v)?"selected":"")+'>'+this.layoutList[i].name+'</option>';
849
+ }
850
+ return '<label>Field Layout</label><br /><select name="sLayout" id="sLayout">'+str+'</select>';
851
+ },
852
+ showUserhelp: function(v,c)
853
+ {
854
+ return '<div><label>Instructions for User</label><textarea class="large" name="sUserhelp" id="sUserhelp">'+v+'</textarea><br /><input type="checkbox" name="sUserhelpTooltip" id="sUserhelpTooltip" '+((c)?"checked":"")+' value="1" > Show as floating tooltip.</div>';
855
+ },
856
+ showCsslayout: function(v)
857
+ {
858
+ return '<label>Add Css Layout Keywords</label><input class="large" name="sCsslayout" id="sCsslayout" value="'+v+'" />';
859
+ }
860
+ };
861
+
862
+ $.fbuilder.controls[ 'ffields' ] = function(){};
863
+ $.extend( $.fbuilder.controls[ 'ffields' ].prototype,
864
+ {
865
+ form_identifier:"",
866
+ name:"",
867
+ shortlabel:"",
868
+ index:-1,
869
+ ftype:"",
870
+ userhelp:"",
871
+ userhelpTooltip:false,
872
+ csslayout:"",
873
+ init:function(){},
874
+ editItemEvents:function( e )
875
+ {
876
+ if( typeof e != 'undefined' && typeof e.length != 'undefined' )
877
+ {
878
+ for( var i = 0, h = e.length; i<h; i++ )
879
+ {
880
+ /**
881
+ * s -> selector
882
+ * e -> event name
883
+ * l -> element
884
+ * f -> function to apply the value
885
+ */
886
+ $(e[i].s).bind(e[i].e, {obj:this, i:e[i]}, function(e){
887
+ var v = $(this).val();
888
+ if(typeof e.data.i['f'] != 'undefined') v = e.data.i.f($(this));
889
+ e.data.obj[e.data.i.l] = v;
890
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
891
+ });
892
+ }
893
+ }
894
+
895
+ $("#sTitle").bind("keyup", {obj: this}, function(e)
896
+ {
897
+ var str = $(this).val();
898
+ e.data.obj.title = str.replace(/\n/g,"<br />");
899
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
900
+ });
901
+
902
+ $("#sShortlabel").bind("keyup", {obj: this}, function(e)
903
+ {
904
+ e.data.obj.shortlabel = $(this).val();
905
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
906
+ });
907
+
908
+ $("#sReadonly").bind("click", {obj: this}, function(e)
909
+ {
910
+ e.data.obj.readonly = $(this).is(':checked');
911
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
912
+ });
913
+
914
+ $("#sPredefined").bind("keyup", {obj: this}, function(e)
915
+ {
916
+ e.data.obj.predefined = $(this).val();
917
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
918
+ });
919
+
920
+ $("#sPredefinedClick").bind("click", {obj: this}, function(e)
921
+ {
922
+ e.data.obj.predefinedClick = $(this).is(':checked');
923
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
924
+ });
925
+
926
+ $("#sRequired").bind("click", {obj: this}, function(e)
927
+ {
928
+ e.data.obj.required = $(this).is(':checked');
929
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
930
+ });
931
+
932
+ $("#sUserhelp").bind("keyup", {obj: this}, function(e)
933
+ {
934
+ e.data.obj.userhelp = $(this).val();
935
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
936
+ });
937
+
938
+ $("#sUserhelpTooltip").bind("click", {obj: this}, function(e)
939
+ {
940
+ e.data.obj.userhelpTooltip = $(this).is(':checked');
941
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
942
+ });
943
+
944
+ $("#sCsslayout").bind("keyup", {obj: this}, function(e)
945
+ {
946
+ e.data.obj.csslayout = $(this).val();
947
+ $.fbuilder.reloadItems( {'field': e.data.obj} );
948
+ });
949
+
950
+ $(".helpfbuilder").click(function()
951
+ {
952
+ alert($(this).attr("text"));
953
+ });
954
+ },
955
+
956
+ showSpecialData:function()
957
+ {
958
+ if(typeof this.showSpecialDataInstance != 'undefined')
959
+ {
960
+ return this.showSpecialDataInstance();
961
+ }
962
+ else
963
+ {
964
+ return "";
965
+ }
966
+ },
967
+
968
+ showEqualTo:function()
969
+ {
970
+ if(typeof this.equalTo != 'undefined')
971
+ {
972
+ return $.fbuilder.showSettings.showEqualTo(this.equalTo,this.name);
973
+ }
974
+ else
975
+ {
976
+ return "";
977
+ }
978
+ },
979
+
980
+ showPredefined:function()
981
+ {
982
+ if(typeof this.predefined != 'undefined')
983
+ {
984
+ return $.fbuilder.showSettings.showPredefined(this.predefined,this.predefinedClick);
985
+ }
986
+ else
987
+ {
988
+ return "";
989
+ }
990
+ },
991
+ /** Modified for showing required and readonly attributes **/
992
+ showRequired:function()
993
+ {
994
+ var result = '';
995
+ if(typeof this.required != 'undefined') result += $.fbuilder.showSettings.showRequired(this.required);
996
+ if(typeof this.readonly != 'undefined') result += $.fbuilder.showSettings.showReadonly(this.readonly);
997
+ return result;
998
+ },
999
+
1000
+ showSize:function()
1001
+ {
1002
+ if(typeof this.size != 'undefined')
1003
+ {
1004
+ return $.fbuilder.showSettings.showSize(this.size);
1005
+ }
1006
+ else
1007
+ {
1008
+ return "";
1009
+ }
1010
+ },
1011
+
1012
+ showLayout:function()
1013
+ {
1014
+ if(typeof this.layout != 'undefined')
1015
+ {
1016
+ return $.fbuilder.showSettings.showLayout(this.layout);
1017
+ }
1018
+ else
1019
+ {
1020
+ return "";
1021
+ }
1022
+ },
1023
+
1024
+ showRange:function()
1025
+ {
1026
+ if(typeof this.min != 'undefined')
1027
+ {
1028
+ return this.showRangeIntance();
1029
+ }
1030
+ else
1031
+ {
1032
+ return "";
1033
+ }
1034
+ },
1035
+
1036
+ showFormat:function()
1037
+ {
1038
+ if(typeof this.dformat != 'undefined')
1039
+ {
1040
+ try
1041
+ {
1042
+ return this.showFormatIntance();
1043
+ } catch(e) {return "";}
1044
+ }
1045
+ else
1046
+ {
1047
+ return "";
1048
+ }
1049
+ },
1050
+
1051
+ showChoice:function()
1052
+ {
1053
+ if(typeof this.choices != 'undefined')
1054
+ {
1055
+ return this.showChoiceIntance();
1056
+ }
1057
+ else
1058
+ {
1059
+ return "";
1060
+ }
1061
+ },
1062
+
1063
+ showUserhelp:function()
1064
+ {
1065
+ return $.fbuilder.showSettings.showUserhelp(this.userhelp,this.userhelpTooltip);
1066
+ },
1067
+
1068
+ showCsslayout:function()
1069
+ {
1070
+ return $.fbuilder.showSettings.showCsslayout(this.csslayout);
1071
+ },
1072
+
1073
+ showAllSettings:function()
1074
+ {
1075
+ return this.showFieldType()+this.showTitle()+this.showShortLabel()+this.showName()+this.showSize()+this.showLayout()+this.showFormat()+this.showRange()+this.showRequired()+this.showSpecialData()+this.showEqualTo()+this.showPredefined()+this.showChoice()+this.showUserhelp()+this.showCsslayout();
1076
+ },
1077
+
1078
+ showFieldType:function()
1079
+ {
1080
+ return $.fbuilder.showSettings.showFieldType(this.ftype);
1081
+ },
1082
+
1083
+ showTitle:function()
1084
+ {
1085
+ return $.fbuilder.showSettings.showTitle(this.title);
1086
+ },
1087
+
1088
+ showName:function()
1089
+ {
1090
+ return $.fbuilder.showSettings.showName(this.name);
1091
+ },
1092
+
1093
+ showShortLabel:function()
1094
+ {
1095
+ return $.fbuilder.showSettings.showShortLabel(this.shortlabel);
1096
+ },
1097
+
1098
+ display:function()
1099
+ {
1100
+ return 'Not available yet';
1101
+ },
1102
+
1103
+ show:function()
1104
+ {
1105
+ return 'Not available yet';
1106
+ }
1107
+ }
1108
+ );
js/fbuilder-pro-public.jquery.js ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder[ 'controls' ] = ( typeof $.fbuilder[ 'controls' ] != 'undefined' ) ? $.fbuilder[ 'controls' ]: {};
2
+ $.fbuilder[ 'forms' ] = ( typeof $.fbuilder[ 'forms' ] != 'undefined' ) ? $.fbuilder[ 'forms' ]: {};
3
+
4
+ $.fbuilder[ 'htmlEncode' ] = function(value)
5
+ {
6
+ value = $('<div/>').text(value).html()
7
+ value = value.replace(/"/g, "&quot;")
8
+ .replace(/&amp;lt;/g, '&lt;')
9
+ .replace(/&amp;gt;/g, '&gt;');
10
+ return value;
11
+ };
12
+
13
+ $.fbuilder[ 'htmlDecode' ] = function(value)
14
+ {
15
+ if( /&(?:#x[a-f0-9]+|#[0-9]+|[a-z0-9]+);?/ig.test( value ) ) value = $( '<div/>' ).html( value ).text();
16
+ return value;
17
+ };
18
+
19
+ $.fbuilder[ 'escape_symbol' ] = function( value ) // Escape the symbols used in regulars expressions
20
+ {
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( /\$/g, '\\$').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 )
33
+ {
34
+ if( typeof value == 'undefined' || value == null || value == '' ) return 0;
35
+ value = $.trim(value);
36
+
37
+ /* Check if date */
38
+ if(/(\d{1,2}[\/\.\-]\d{1,2}[\/\.\-]\d{4})|(\d{4}[\/\.\-]\d{1,2}[\/\.\-]\d{1,2})/.test(value))
39
+ return $.fbuilder[ 'parseValStr' ]( value );
40
+
41
+ /* Managing the value basically as number */
42
+ thousandSeparator = $.fbuilder.escape_symbol( ( typeof thousandSeparator == 'undefined' ) ? ',' : thousandSeparator );
43
+ decimalSymbol = ( typeof decimalSymbol == 'undefined' || /^\s*$/.test( decimalSymbol ) ) ? '.' : decimalSymbol;
44
+ var correction = new RegExp( ( ( /^\s*$/.test( thousandSeparator ) ) ? ',' : thousandSeparator )+('\(\\d{1,2}\)$') ),
45
+ correctionReplacement = decimalSymbol+'$1';
46
+
47
+ thousandSeparator = new RegExp( thousandSeparator, 'g' );
48
+ decimalSymbol = new RegExp( $.fbuilder.escape_symbol( decimalSymbol ), 'g' );
49
+
50
+ var t = value.replace( correction, correctionReplacement )
51
+ .replace( thousandSeparator, '' )
52
+ .replace( decimalSymbol, '.' )
53
+ .replace( /\s/g, '' ),
54
+ p = /[+\-]?((\d+(\.\d+)?)|(\.\d+))(?:[eE][+\-]?\d+)?/.exec( t );
55
+ return ( p ) ? p[0]*1 : $.fbuilder[ 'parseValStr' ]( value );
56
+ };
57
+
58
+
59
+ $.fn.fbuilder = function(options){
60
+ var opt = $.extend({},
61
+ {
62
+ pub:false,
63
+ identifier:"",
64
+ title:""
65
+ },options, true);
66
+
67
+ opt.messages = $.extend({
68
+ previous: "Previous",
69
+ next: "Next",
70
+ pageof: "Page {0} of {0}",
71
+ required: "This field is required.",
72
+ email: "Please enter a valid email address.",
73
+ datemmddyyyy: "Please enter a valid date with this format(mm/dd/yyyy)",
74
+ dateddmmyyyy: "Please enter a valid date with this format(dd/mm/yyyy)",
75
+ number: "Please enter a valid number.",
76
+ digits: "Please enter only digits.",
77
+ maxlength: $.validator.format("Please enter no more than {0} characters."),
78
+ minlength: $.validator.format("Please enter at least {0} characters."),
79
+ equalTo: "Please enter the same value again.",
80
+ max: $.validator.format("Please enter a value less than or equal to {0}."),
81
+ min: $.validator.format("Please enter a value greater than or equal to {0}.")
82
+ },opt.messages);
83
+
84
+ opt.messages.max = $.validator.format(opt.messages.max);
85
+ opt.messages.min = $.validator.format(opt.messages.min);
86
+
87
+ $.extend($.validator.messages, opt.messages);
88
+
89
+ var items = [],
90
+ reloadItemsPublic = function()
91
+ {
92
+ var form_tag = $("#fieldlist"+opt.identifier).closest( 'form' );
93
+ form_tag.addClass( theForm.formtemplate );
94
+ if( !opt.cached )
95
+ {
96
+ $("#fieldlist"+opt.identifier).html("").addClass(theForm.formlayout);
97
+ $("#formheader"+opt.identifier).html(theForm.show());
98
+
99
+ var page = 0;
100
+ $("#fieldlist"+opt.identifier).append('<div class="pb'+page+' pbreak" page="'+page+'"></div>');
101
+ for (var i=0;i<items.length;i++)
102
+ {
103
+ items[i].index = i;
104
+ if (items[i].ftype=="fPageBreak")
105
+ {
106
+ page++;
107
+ $("#fieldlist"+opt.identifier).append('<div class="pb'+page+' pbreak" page="'+page+'"></div>');
108
+ }
109
+ else
110
+ {
111
+ $("#fieldlist"+opt.identifier+" .pb"+page).append(items[i].show());
112
+ if (items[i].predefinedClick)
113
+ {
114
+ $("#fieldlist"+opt.identifier+" .pb"+page).find("#"+items[i].name).attr("placeholder",items[i].predefined);
115
+ $("#fieldlist"+opt.identifier+" .pb"+page).find("#"+items[i].name).attr("value","");
116
+ }
117
+ if (items[i].userhelpTooltip)
118
+ {
119
+ var uh_t,uh = $("#fieldlist"+opt.identifier+" .pb"+page).find("#"+items[i].name).closest(".dfield");
120
+ if( uh.length == 0 )
121
+ {
122
+ uh = $("#fieldlist"+opt.identifier+" .pb"+page).find("#"+items[i].name).closest(".fields");
123
+ }
124
+ uh_t = uh.find(".uh");
125
+ if(uh_t.length && uh_t.text()!="")
126
+ {
127
+ uh.attr("uh",uh_t.text());
128
+ uh_t.text("");
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ else
135
+ {
136
+ var page = form_tag.find( '.pbreak' ).length,
137
+ i = items.length;
138
+ }
139
+
140
+ if (page>0)
141
+ {
142
+ if( !opt.cached ) // Check if the form is cached
143
+ {
144
+ $("#fieldlist"+opt.identifier+" .pb"+page).addClass("pbEnd");
145
+ $("#fieldlist"+opt.identifier+" .pbreak").each(function(index) {
146
+ var code = $(this).html();
147
+ var bSubmit = '';
148
+
149
+ if (index == page)
150
+ {
151
+ if ( $( "#cpcaptchalayer"+opt.identifier ).length && !/^\s*$/.test( $( "#cpcaptchalayer"+opt.identifier ).html() ) )
152
+ {
153
+ code += '<div class="captcha">'+$("#cpcaptchalayer"+opt.identifier).html()+'</div><div class="clearer"></div>';
154
+ $("#cpcaptchalayer"+opt.identifier).html("");
155
+ }
156
+ if ($("#cp_subbtn"+opt.identifier).html())
157
+ {
158
+ bSubmit = '<div class="pbSubmit" tabindex="0">'+$("#cp_subbtn"+opt.identifier).html()+'</div>';
159
+ }
160
+ }
161
+ $(this).html('<fieldset><legend>'+opt.messages.pageof.replace( /\{\s*\d+\s*\}/, (index+1) ).replace( /\{\s*\d+\s*\}/, (page+1) )+'</legend>'+code+'<div class="pbPrevious" tabindex="0">'+opt.messages.previous+'</div><div class="pbNext" tabindex="0">'+opt.messages.next+'</div>'+bSubmit+'<div class="clearer"></div></fieldset>');
162
+ });
163
+ }
164
+
165
+ $( '#fieldlist'+opt.identifier).find(".pbPrevious,.pbNext").bind("keyup", function(evt){
166
+ if(evt.which == 13 || evt.which == 32) $(this).click();
167
+ }).bind("click", {'identifier' : opt.identifier}, function(evt){
168
+ var identifier = evt.data.identifier;
169
+ if ( ($(this).hasClass("pbPrevious")) || (($(this).hasClass("pbNext")) && $(this).closest("form").valid()) )
170
+ {
171
+ var page = parseInt($(this).parents(".pbreak").attr("page"));
172
+
173
+ (($(this).hasClass("pbPrevious"))?page--:page++);
174
+ $("#fieldlist"+identifier+" .pbreak").css("display","none");
175
+ $("#fieldlist"+identifier+" .pbreak").find(".field").addClass("ignorepb");
176
+
177
+ $("#fieldlist"+identifier+" .pb"+page).css("display","block");
178
+ $("#fieldlist"+identifier+" .pb"+page).find(".field").removeClass("ignorepb");
179
+ if ($("#fieldlist"+identifier+" .pb"+page).find(".fields").length>0)
180
+ {
181
+ try
182
+ {
183
+ var ffocusable = $("#fieldlist"+identifier+" .pb"+page).find(":focusable"),
184
+ _wScrollTop = $(window).scrollTop(),
185
+ _viewportHeight = $(window).height(),
186
+ _scrollTop = $("#fieldlist"+identifier+" .pb"+page).closest('form').offset().top;
187
+
188
+ if( ffocusable.length )
189
+ {
190
+ ffocusable[0].focus();
191
+ }
192
+
193
+ if(_scrollTop < _wScrollTop || (_wScrollTop+_viewportHeight)<_scrollTop )
194
+ {
195
+ $( 'html, body' ).animate({scrollTop: _scrollTop}, 50);
196
+ }
197
+ }
198
+ catch(e){}
199
+ }
200
+ }
201
+ else
202
+ {
203
+ $(this).closest("form").validate().focusInvalid();
204
+ }
205
+ return false;
206
+ });
207
+ }
208
+ else
209
+ {
210
+ if( !opt.cached )
211
+ {
212
+ if ( $( "#cpcaptchalayer"+opt.identifier ).length && !/^\s*$/.test( $( "#cpcaptchalayer"+opt.identifier ).html() ) )
213
+ {
214
+ $("#fieldlist"+opt.identifier+" .pb"+page).append('<div class="captcha">'+$("#cpcaptchalayer"+opt.identifier).html()+'</div>');
215
+ $("#cpcaptchalayer"+opt.identifier).html("");
216
+ }
217
+ if ($("#cp_subbtn"+opt.identifier).html())
218
+ {
219
+ $("#fieldlist"+opt.identifier+" .pb"+page).append('<div class="pbSubmit" tabindex="0">'+$("#cp_subbtn"+opt.identifier).html()+'</div>');
220
+ }
221
+ }
222
+ }
223
+
224
+ if( !opt.cached && opt.setCache)
225
+ {
226
+ // Set Cache
227
+ var url = document.location.href,
228
+ data = {
229
+ 'cffaction' : 'cff_cache',
230
+ 'cache' : form_tag.html().replace( /\n+/g, '' ),
231
+ 'form' : form_tag.find( '[name="cp_calculatedfieldsf_id"]').val()
232
+ };
233
+ $.post( url, data, function( data ){ if(typeof console != 'undefined' )console.log( data ); } );
234
+ }
235
+
236
+ // Set Captcha Event
237
+ $( document ).on( 'click', '#fbuilder .captcha img', function(){ var e = $( this ); e.attr( 'src', e.attr( 'src' ).replace( /&\d+$/, '' ) + '&' + Math.floor( Math.random()*1000 ) ); } );
238
+ $( form_tag ).find( '.captcha img' ).click();
239
+
240
+ $( '#fieldlist'+opt.identifier).find(".pbSubmit").bind("keyup", function(evt){
241
+ if(evt.which == 13 || evt.which == 32) $(this).click();
242
+ }).bind("click", { 'identifier' : opt.identifier }, function(evt){
243
+ $(this).closest("form").submit();
244
+ });
245
+
246
+ if (i>0)
247
+ {
248
+ theForm.after_show( opt.identifier );
249
+ for (var i=0;i<items.length;i++)
250
+ {
251
+ items[i].after_show();
252
+ }
253
+
254
+ $.fbuilder.showHideDep(
255
+ {
256
+ 'formIdentifier' : opt.identifier,
257
+ 'throwEvent' : true
258
+ }
259
+ );
260
+
261
+ $( '#fieldlist'+opt.identifier).find(".depItemSel,.depItem").bind("change", { 'identifier' : opt.identifier }, function( evt )
262
+ {
263
+ $.fbuilder.showHideDep(
264
+ {
265
+ 'formIdentifier' : evt.data.identifier,
266
+ 'fieldItentifier': evt.target.id,
267
+ 'throwEvent' : true
268
+ }
269
+ );
270
+ });
271
+ try
272
+ {
273
+ $( "#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){
274
+ var duration = ('undefined' != typeof tooltip_duration && /^\d+$/.test(tooltip_duration)) ? tooltip_duration : 3000;
275
+ setTimeout( function(){$(ui.tooltip).hide('fade'); }, duration);
276
+ }}catch( err ){}} });
277
+ } catch(e){}
278
+ }
279
+ $("#fieldlist"+opt.identifier+" .pbreak:not(.pb0)").find(".field").addClass("ignorepb");
280
+ };
281
+
282
+ var fform=function(){};
283
+ $.extend(fform.prototype,
284
+ {
285
+ title:"Untitled Form",
286
+ description:"This is my form. Please fill it out. It's awesome!",
287
+ formlayout:"top_aligned",
288
+ formtemplate:"",
289
+ evalequations:1,
290
+ evalequationsevent:2,
291
+ autocomplete:1,
292
+ show:function(){
293
+ return '<div class="fform" id="field"><h2>'+this.title+'</h2><span>'+this.description+'</span></div>';
294
+ },
295
+ after_show:function( id ){
296
+ var form = $( '#cp_calculatedfieldsf_pform'+id );
297
+
298
+ if(typeof $.fn.fbuilder_localstorage != 'undefined' && form.hasClass('persist-form'))
299
+ {
300
+ form.fbuilder_localstorage();
301
+ }
302
+
303
+ form.attr( 'data-evalequations', this.evalequations )
304
+ .attr( 'data-evalequationsevent', this.evalequationsevent )
305
+ .attr( 'autocomplete', ( ( this.autocomplete ) ? 'on' : 'off' ) )
306
+ .find( 'input,select' )
307
+ .blur( function(){ try{ $(this).valid(); }catch(e){};} );
308
+ }
309
+ });
310
+
311
+ //var theForm = new fform(),
312
+ var theForm,
313
+ ffunct = {
314
+ toShow : {},
315
+ toHide : {},
316
+ hiddenByContainer : {},
317
+ getItem: function( name )
318
+ {
319
+ for( var i in items )
320
+ {
321
+ if( items[ i ].name == name )
322
+ {
323
+ return items[ i ];
324
+ }
325
+ }
326
+ return false;
327
+ },
328
+ getItems: function()
329
+ {
330
+ return items;
331
+ },
332
+ loadData:function(f)
333
+ {
334
+ var d = window[ f ];
335
+ if ( typeof d != 'undefined' )
336
+ {
337
+ if( typeof d == 'object' && ( typeof d.nodeType !== 'undefined' || d instanceof jQuery ) ){ d = jQuery.parseJSON( jQuery(d).val() ); }
338
+ else if( typeof d == 'string' ){ d = jQuery.parseJSON( d ); }
339
+
340
+ if (d.length == 2)
341
+ {
342
+ this.formId = d[ 1 ][ 'formid' ];
343
+ items = [];
344
+ for (var i=0;i<d[0].length;i++)
345
+ {
346
+ var obj = new $.fbuilder.controls[d[0][i].ftype]();
347
+ obj = $.extend(true, {}, obj,d[0][i]);
348
+ obj.name = obj.name+opt.identifier;
349
+ obj.form_identifier = opt.identifier;
350
+ obj.init();
351
+ items[items.length] = obj;
352
+ }
353
+ theForm = new fform();
354
+ theForm = $.extend(theForm,d[1][0]);
355
+
356
+ opt.cached = (typeof d[ 1 ][ 'cached' ] != 'undefined' && d[ 1 ][ 'cached' ] ) ? true : false;
357
+ opt.setCache = (!this.cached && typeof d[ 1 ][ 'setCache' ] != 'undefined' && d[ 1 ][ 'setCache' ]) ? true : false;
358
+
359
+ reloadItemsPublic();
360
+ }
361
+ $.fbuilder.cpcff_load_defaults( opt );
362
+ }
363
+ }
364
+ };
365
+
366
+ $.fbuilder[ 'forms' ][ opt.identifier ] = ffunct;
367
+ this.fBuild = ffunct;
368
+ return this;
369
+ }; // End fbuilder plugin
370
+
371
+ $.fbuilder[ 'showSettings' ] = {
372
+ formlayoutList : [{id:"top_aligned",name:"Top Aligned"},{id:"left_aligned",name:"Left Aligned"},{id:"right_aligned",name:"Right Aligned"}]
373
+ };
374
+
375
+ $.fbuilder.controls[ 'ffields' ] = function(){};
376
+ $.extend($.fbuilder.controls[ 'ffields' ].prototype,
377
+ {
378
+ form_identifier:"",
379
+ name:"",
380
+ shortlabel:"",
381
+ index:-1,
382
+ ftype:"",
383
+ userhelp:"",
384
+ userhelpTooltip:false,
385
+ csslayout:"",
386
+ init:function(){},
387
+ show:function()
388
+ {
389
+ return 'Not available yet';
390
+ },
391
+ after_show:function(){},
392
+ val:function(){
393
+ var e = $( "[id='" + this.name + "']:not(.ignore)" );
394
+ if( e.length )
395
+ {
396
+ return $.fbuilder.parseVal( $.trim( e.val() ) );
397
+ }
398
+ return 0;
399
+ },
400
+ setVal:function( v )
401
+ {
402
+ $( "[id='" + this.name + "']" ).val( v );
403
+ }
404
+ });
405
+
406
+ $.fbuilder[ 'showHideDep' ] = function( configObj )
407
+ {
408
+ /**
409
+ * If isNotFirstTime is defined, the equations associated to the fields should be inserted in the queue of equations
410
+ */
411
+ var process_items = function( items, isNotFirstTime )
412
+ {
413
+ for( var i = 0, h = items.length; i < h; i++ )
414
+ {
415
+ if( typeof items[ i ] == 'string' ) items[i] = $.fbuilder[ 'forms' ][ identifier ].getItem( items[i] );
416
+ if( isNotFirstTime && items[i] && items[i].usedInEquations ) $.fbuilder[ 'calculator' ].enqueueEquation( identifier, items[i].usedInEquations );
417
+ if( typeof items[ i ][ 'showHideDep' ] != 'undefined' )
418
+ {
419
+ var list = items[ i ][ 'showHideDep' ]( toShow, toHide, hiddenByContainer );
420
+ if( typeof list != 'undefined' && list.length )
421
+ process_items( list, true );
422
+ }
423
+ }
424
+ };
425
+
426
+ if( typeof configObj[ 'formIdentifier' ] !== 'undefined' )
427
+ {
428
+ var identifier = configObj[ 'formIdentifier' ];
429
+
430
+ if( typeof $.fbuilder[ 'forms' ][ identifier ] != 'undefined' )
431
+ {
432
+ var toShow = $.fbuilder[ 'forms' ][ identifier ][ 'toShow' ],
433
+ toHide = $.fbuilder[ 'forms' ][ identifier ][ 'toHide' ],
434
+ hiddenByContainer = $.fbuilder[ 'forms' ][ identifier ][ 'hiddenByContainer' ],
435
+ items = (typeof configObj[ 'fieldItentifier' ] != 'undefined' ) ? [ $.fbuilder[ 'forms' ][ identifier ].getItem(configObj[ 'fieldItentifier' ]) ] : $.fbuilder[ 'forms' ][ identifier ].getItems();
436
+
437
+ process_items( items );
438
+
439
+ if( typeof configObj[ 'throwEvent' ] == 'undefined' || configObj[ 'throwEvent' ] )
440
+ {
441
+ $( document ).trigger( 'showHideDepEvent', $.fbuilder[ 'forms' ][ identifier ][ 'formId' ] );
442
+ }
443
+ }
444
+ }
445
+ }; // End showHideDep
446
+
447
+ // Load default values
448
+ $.fbuilder[ 'cpcff_load_defaults' ] = function( o )
449
+ {
450
+ var $ = fbuilderjQuery,
451
+ id,
452
+ item,
453
+ form_data,
454
+ form_obj;
455
+
456
+ if( typeof cpcff_default != 'undefined' )
457
+ {
458
+ id = o.identifier.replace( /[^\d]/g, '' );
459
+ if( typeof cpcff_default[ id ] != 'undefined' )
460
+ {
461
+ form_data = cpcff_default[ id ];
462
+ id = '_'+id;
463
+ form_obj = $.fbuilder[ 'forms' ][ id ];
464
+
465
+ for( var field_id in form_data )
466
+ {
467
+ item = form_obj.getItem( field_id+id );
468
+ if( typeof item[ 'setVal' ] != 'undefined' ) item.setVal( form_data[ field_id ] );
469
+ }
470
+
471
+ $.fbuilder.showHideDep(
472
+ {
473
+ 'formIdentifier' : o.identifier,
474
+ 'throwEvent' : true
475
+ }
476
+ );
477
+ }
478
+ }
479
+ };
js/fields-admin/000_category.form.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ if( typeof $.fbuilder[ 'categoryList' ] == 'undefined' ) $.fbuilder[ 'categoryList' ] = [];
2
+ $.fbuilder.categoryList[1]={
3
+ title : "Form Controls",
4
+ description : ""
5
+ };
js/fields-admin/001_category.ds.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ if( typeof $.fbuilder[ 'categoryList' ] == 'undefined' ) $.fbuilder[ 'categoryList' ] = [];
2
+ $.fbuilder.categoryList[20]={
3
+ title : "Form Controls with Datasource Connection",
4
+ description : "<div style='color: #666;border: 1px solid #EF7E59;display: block;padding: 5px;background: #FBF0EC;border-radius: 4px;text-align: center;'><em>Available only in the <a href='http://cff.dwbooster.com/download' target='_blank'>Developer and Platinum versions</a> of the plugin</em></div>"
5
+ };
js/fields-admin/002_category.complementary.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ if( typeof $.fbuilder[ 'categoryList' ] == 'undefined' ) $.fbuilder[ 'categoryList' ] = [];
2
+ $.fbuilder.categoryList[30]={
3
+ title : "Complementary Blocks",
4
+ description : "<div class='complementary-blocks-category' style='color: #666;border: 1px solid #EF7E59;display: block;padding: 5px;background: #FBF0EC;border-radius: 4px;text-align: center;'><em>Need more controls or operations?<br />Install the <a href='https://wordpress.org/plugins/cp-blocks/' target='_blank' style='font-weight:bold;'>CP BLOCKS</a> plugin:<br />- with buttons<br />- testimonial blocks<br />- additional features<br />...and more</em></div>"
5
+ };
js/fields-admin/003_category.containers.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ if( typeof $.fbuilder[ 'categoryList' ] == 'undefined' ) $.fbuilder[ 'categoryList' ] = [];
2
+ $.fbuilder.categoryList[10]={
3
+ title : "Container Controls",
4
+ description : ""
5
+ };
js/fields-admin/00_jquery.parse.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*
2
+ Papa Parse
3
+ v2.0.3
4
+ https://github.com/mholt/jquery.parse
5
+ */
6
+ ;(function(e){"use strict";function t(e){return typeof e==="function"}function n(e,t){function a(n){var r=s+n.target.result;s="";if(r>=t.chunkSize){var u=r.lastIndexOf("\n");if(u<0)u=r.lastIndexOf("\r");if(u>-1){s=r.substring(u+1);r=r.substring(0,u)}}var a=o.parse(r);if(i>=e.size)return f(n);else if(a.errors.abort)return;else c()}function f(n){if(typeof t.onComplete==="function")t.onComplete(undefined,e,t.inputElem,n)}function l(){if(typeof t.onFileError==="function")t.onFileError(u.error,e,t.inputElem)}function c(){if(i<e.size){u.readAsText(e.slice(i,Math.min(i+t.chunkSize,e.size)));i+=t.chunkSize}}if(!t)t={};if(!t.chunkSize)t.chunkSize=1024*1024*5;if(t.config.step){var n=t.config.step;t.config.step=function(r){n(r,e,t.inputElem)}}var i=0;var s="";var o=new r(t.config);var u=new FileReader;u.onload=a;u.onerror=l;this.stream=function(e,n){t.onComplete=e;t.onFileError=n;c()};}function r(e){function c(e){if(typeof e!=="object")e={};if(typeof e.delimiter!=="string"||e.delimiter.length!=1)e.delimiter=f.delimiter;if(e.deimiter=='"'||e.delimiter=="\n")e.delimiter=f.delimiter;if(typeof e.header!=="boolean")e.header=f.header;if(typeof e.dynamicTyping!=="boolean")e.dynamicTyping=f.dynamicTyping;if(typeof e.preview!=="number")e.preview=f.preview;if(typeof e.step!=="function")e.step=f.step;return e}function h(e){var t=[","," ","|",";"];var n,i,s;for(var o in t){var a=t[o];var f=0,l=0;var c=(new r({delimiter:a,header:false,dynamicTyping:false,preview:10})).parse(e);for(var h in c.results){var p=c.results[h].length;l+=p;if(typeof s==="undefined"){s=p;continue}else if(p>1){f+=Math.abs(p-s);s=p}}l/=c.results.length;if((typeof i==="undefined"||f<i)&&l>1.99){i=f;n=a}}u.delimiter=n;return!!n}function p(){var e=a.i>0&&g(a.i-1)||a.i==0;var t=a.i<i.length-1&&g(a.i+1)||a.i==i.length-1;var n=a.i<i.length-1&&i[a.i+1]=='"';if(a.inQuotes&&n){a.fieldVal+='"';a.i++}else if(e||t)a.inQuotes=!a.inQuotes;else C("Quotes","UnexpectedQuotes","Unexpected quotes")}function d(){v()}function v(){a.fieldVal+=a.ch}function m(){if(a.ch==u.delimiter)b();else if(a.ch=="\r"&&a.i<i.length-1&&i[a.i+1]=="\n"||a.ch=="\n"&&a.i<i.length-1&&i[a.i+1]=="\r"){w();a.i++}else if(a.ch=="\n"||a.ch=="\r")w();else v()}function g(e){if(e>=i.length)return false;var t=i[e];if(t==u.delimiter||t=="\n"||t=="\r"&&e<i.length-1&&i[e+1]=="\n")return true;else return false}function y(e){if(e>=i.length)return false;if(e<i.length-1)return i[e]=="\n"||i[e]=="\r"&&i[e+1]=="\n";else return i[e]=="\n"}function b(){if(u.header){if(a.lineNum==1&&n==1)a.parsed.fields.push(a.fieldVal);else{var e=a.parsed.rows[a.parsed.rows.length-1];var t=a.parsed.fields[a.field];if(t){if(u.dynamicTyping)a.fieldVal=x(a.fieldVal);e[t]=a.fieldVal}else{if(typeof e.__parsed_extra==="undefined")e.__parsed_extra=[];e.__parsed_extra.push(a.fieldVal)}}}else{if(u.dynamicTyping)a.fieldVal=x(a.fieldVal);a.parsed[a.parsed.length-1].push(a.fieldVal)}a.fieldVal="";a.field++}function w(){E();if(S()){a.errors={};a.errors.length=0}if(u.header&&a.lineNum>0){if(S())a.parsed.rows=[{}];else a.parsed.rows.push({})}else{if(S())a.parsed=[[]];else a.parsed.push([])}a.lineNum++;a.line="";a.field=0}function E(){if(o)return;b();var e=T();if(!e&&u.header)N();if(S()&&(!u.header||u.header&&a.parsed.rows.length>0)){var t=u.step(k());if(t===false)o=true}}function S(){return typeof u.step==="function"}function x(e){var t=l.floats.test(e);return t?parseFloat(e):e}function T(){if(l.empty.test(a.line)){if(u.header){if(a.lineNum==1){a.parsed.fields=[];a.lineNum--}else a.parsed.rows.splice(a.parsed.rows.length-1,1)}else a.parsed.splice(a.parsed.length-1,1);return true}return false}function N(){if(!u.header)return true;if(a.parsed.rows.length==0)return true;var e=a.parsed.fields.length;var t=0;var n=a.parsed.rows[a.parsed.rows.length-1];for(var r in n)if(n.hasOwnProperty(r))t++;if(t<e)return C("FieldMismatch","TooFewFields","Too few fields: expected "+e+" fields but parsed "+t);else if(t>e)return C("FieldMismatch","TooManyFields","Too many fields: expected "+e+" fields but parsed "+t);return true}function C(e,t,n,r){var i=u.header?a.parsed.rows.length?a.parsed.rows.length-1:undefined:a.parsed.length-1;var o=r||i;if(typeof a.errors[o]==="undefined")a.errors[o]=[];a.errors[o].push({type:e,code:t,message:n,line:a.lineNum,row:i,index:a.i+s});a.errors.length++;return false}function k(){return{results:a.parsed,errors:a.errors}}function L(e){n++;if(n>1&&S())s+=e.length;a=A();i=e}function A(){var e;if(u.header){e={fields:S()?a.parsed.fields||[]:[],rows:S()&&n>1?[{}]:[]}}else e=[[]];return{i:0,lineNum:S()?a.lineNum:1,field:0,fieldVal:"",line:"",ch:"",inQuotes:false,parsed:e,errors:{length:0}}}var t=this;var n=0;var i="";var s=0;var o=false;var u={};var a=A();var f={delimiter:"",header:true,dynamicTyping:true,preview:0};var l={floats:/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,empty:/^\s*$/};e=c(e);u={delimiter:e.delimiter,header:e.header,dynamicTyping:e.dynamicTyping,preview:e.preview,step:e.step};this.parse=function(e){if(typeof e!=="string")return k();L(e);if(!u.delimiter&&!h(e)){C("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to comma","config");u.delimiter=","}for(a.i=0;a.i<i.length;a.i++){if(o||u.preview>0&&a.lineNum>u.preview)break;a.ch=i[a.i];a.line+=a.ch;if(a.ch=='"')p();else if(a.inQuotes)d();else m()}if(o)C("Abort","ParseAbort","Parsing was aborted by the user's step function","abort");else{E();if(a.inQuotes)C("Quotes","MissingQuotes","Unescaped or mismatched quotes")}return k()};this.getOptions=function(){return{delimiter:u.delimiter,header:u.header,dynamicTyping:u.dynamicTyping,preview:u.preview,step:u.step}}}e.fn.parse=function(r){function o(i){var s=a,o;if(t(r.error))o=function(){r.error(c.error,i.file,i.inputElem)};if(t(r.complete))s=function(e,t,n,i){r.complete(e,t,n,i);a()};if(t(r.before)){var f=r.before(i.file,i.inputElem);if(typeof f==="object")i.instanceConfig=e.extend(i.instanceConfig,f);else if(f==="skip")return a();else if(f===false){u("AbortError",i.file,i.inputElem);return}}if(i.instanceConfig.step){var l=new n(i.file,{inputElem:i.inputElem,config:e.extend({},i.instanceConfig)});l.stream(s,o)}else{var c=new FileReader;c.onerror=o;c.onload=function(t){var n=t.target.result;var r=e.parse(n,i.instanceConfig);s(r,i.file,i.inputElem,t)};c.readAsText(i.file)}}function u(e,n,i){if(t(r.error))r.error({name:e},n,i)}function a(){s.splice(0,1);if(s.length>0)o(s[0])}var i=r.config||{};var s=[];this.each(function(t){var n=e(this).prop("tagName").toUpperCase()=="INPUT"&&e(this).attr("type")=="file"&&window.FileReader;if(!n)return true;var r=e.extend({},i);if(!this.files||this.files.length==0){u("NoFileError",undefined,this);return true}for(var a=0;a<this.files.length;a++)s.push({file:this.files[a],inputElem:this,instanceConfig:r});if(s.length>0)o(s[0])});return this};e.parse=function(e,t){var n=new r(t);return n.parse(e)}})(jQuery);
js/fields-admin/01_fbuilder.ftext.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"ftext",
4
+ name:"Single Line Text",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'ftext' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'ftext' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"ftext",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ readonly:false,
19
+ size:"medium",
20
+ minlength:"",
21
+ maxlength:"",
22
+ equalTo:"",
23
+ regExp:"",
24
+ regExpMssg:"",
25
+ display:function()
26
+ {
27
+ 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"><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>';
28
+ },
29
+ editItemEvents:function()
30
+ {
31
+ var me = this, evt = [
32
+ {s:"#sSize",e:"change", l:"size"},
33
+ {s:"#sMinlength",e:"change keyup", l:"minlength"},
34
+ {s:"#sMaxlength",e:"change keyup", l:"maxlength"},
35
+ {s:"#sRegExp",e:"change keyup", l:"regExp"},
36
+ {s:"#sRegExpMssg",e:"change keyup", l:"regExpMssg"},
37
+ {s:"#sEqualTo",e:"change", l:"equalTo"}
38
+ ],
39
+ items = this.fBuild.getItems();
40
+ $('.equalTo').each(function(){
41
+ var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
42
+ for (var i=0;i<items.length;i++)
43
+ {
44
+ if ((items[i].ftype=="ftext" || items[i].ftype=="femail" || items[i].ftype=="fpassword") && (items[i].name != $(this).attr("dname")))
45
+ {
46
+ str += '<option value="'+$.fbuilder.htmlEncode(items[i].name)+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].title)+'</option>';
47
+ }
48
+ }
49
+ $(this).html(str);
50
+ });
51
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
52
+ },
53
+ showSpecialDataInstance: function()
54
+ {
55
+ return '<div class="column"><label>Min length/characters</label><br /><input name="sMinlength" id="sMinlength" value="'+$.fbuilder.htmlEncode(this.minlength)+'"></div><div class="column"><label>Max length/characters</label><br /><input name="sMaxlength" id="sMaxlength" value="'+$.fbuilder.htmlEncode(this.maxlength)+'"></div><div class="clearer"></div><div><label>Validate against a regular expression</label><input type="text" name="sRegExp" id="sRegExp" value="'+$.fbuilder.htmlEncode(this.regExp)+'" class="large" /></div><div><label>Error message when the regular expression fails</label><input type="text" name="sRegExpMssg" id="sRegExpMssg" value="'+$.fbuilder.htmlEncode(this.regExpMssg)+'" class="large" /></div>';
56
+ }
57
+ });
js/fields-admin/02_fbuilder.fcurrency.js ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fcurrency",
4
+ name:"Currency",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fcurrency' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fcurrency' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Currency",
14
+ ftype:"fcurrency",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ readonly:false,
19
+ size:"small",
20
+ currencySymbol:"$",
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*$/.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
+ {
45
+ v = v.toString();
46
+ var parts = v.toString().split("."),
47
+ counter = 0,
48
+ str = '';
49
+
50
+ if( !/^\s*$/.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
+ {
68
+ return this.predefined;
69
+ }
70
+ },
71
+ display:function()
72
+ {
73
+ 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"><input class="field disabled '+this.size+'" type="text" value="'+$.fbuilder.htmlEncode(this.getPredefinedValue())+'"/><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
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
+ ];
87
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
88
+ },
89
+ showSpecialDataInstance: function()
90
+ {
91
+ return this.showCurrencyFormat();
92
+ },
93
+ showCurrencyFormat: function()
94
+ {
95
+ var str = '<div><label>Currency Symbol</label><br /><input type="text" name="sCurrencySymbol" id="sCurrencySymbol" value="'+$.fbuilder.htmlEncode(this.currencySymbol)+'" class="large"></div>';
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()
103
+ {
104
+ return '<div class="clearer"></div><div class="column"><label>Min</label><br /><input name="sMin" id="sMin" value="'+$.fbuilder.htmlEncode(this.min)+'"></div><div class="column"><label>Max</label><br /><input name="sMax" id="sMax" value="'+$.fbuilder.htmlEncode(this.max)+'"></div><div class="clearer">Enter the min/max values as numbers, and not as currencies</div>';
105
+ }
106
+ });
js/fields-admin/02_fbuilder.fnumber.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fnumber",
4
+ name:"Number",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fnumber' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fnumber' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Number",
14
+ ftype:"fnumber",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ readonly:false,
19
+ size:"small",
20
+ thousandSeparator:"",
21
+ decimalSymbol:".",
22
+ min:"",
23
+ max:"",
24
+ formatDynamically:false,
25
+ dformat:"digits",
26
+ formats:new Array("digits","number"),
27
+ display:function()
28
+ {
29
+ 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"><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>';
30
+ },
31
+ editItemEvents:function()
32
+ {
33
+ var evt = [
34
+ {s:"#sSize",e:"change", l:"size"},
35
+ {s:"#sFormat",e:"change", l:"dformat", f:function(el){
36
+ var v = el.val();
37
+ $( '.fnumber-symbols' )[(v == 'digits')?'hide':'show']();
38
+ return v;
39
+ }
40
+ },
41
+ {s:"#sMin",e:"change keyup", l:"min"},
42
+ {s:"#sMax",e:"change keyup", l:"max"},
43
+ {s:"#sThousandSeparator",e:"change keyup", l:"thousandSeparator"},
44
+ {s:"#sDecimalSymbol",e:"change keyup", l:"decimalSymbol"},
45
+ {s:"#sFormatDynamically",e:"click", l:"formatDynamically",f:function(el){return el.is(':checked');}},
46
+ ];
47
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
48
+ },
49
+ showFormatIntance: function()
50
+ {
51
+ var str = "";
52
+ for (var i=0;i<this.formats.length;i++)
53
+ {
54
+
55
+ str += '<option value="'+this.formats[i]+'" '+((this.formats[i]==this.dformat)?"selected":"")+'>'+this.formats[i]+'</option>';
56
+ }
57
+ return '<div><label>Number Format</label><br /><select name="sFormat" id="sFormat">'+str+'</select></div><div class="fnumber-symbols" '+( (this.dformat == 'digits') ? 'style="display:none;"' : '' )+'><label>Decimals separator symbol (Ex: 25.20)</label><input type="text" name="sDecimalSymbol" id="sDecimalSymbol" class="large" value="'+$.fbuilder.htmlEncode(this.decimalSymbol)+'" /><label>Symbol for grouping thousands (Ex: 3,000,000)</label><input type="text" name="sThousandSeparator" id="sThousandSeparator" class="large" value="'+$.fbuilder.htmlEncode(this.thousandSeparator)+'" /><label>Format Dynamically</label><br /><input type="checkbox" name="sFormatDynamically" id="sFormatDynamically" '+( (this.formatDynamically) ? 'CHECKED' : '')+'></div>';
58
+ },
59
+ showRangeIntance: function()
60
+ {
61
+ return '<div class="column"><label>Min</label><br /><input name="sMin" id="sMin" value="'+$.fbuilder.htmlEncode(this.min)+'"></div><div class="column"><label>Max</label><br /><input name="sMax" id="sMax" value="'+$.fbuilder.htmlEncode(this.max)+'"></div><div class="clearer"></div>';
62
+ }
63
+ });
js/fields-admin/02_fbuilder.fslider.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fslider",
4
+ name:"Slider",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fslider' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fslider' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Slider",
14
+ ftype:"fslider",
15
+ predefined:"",
16
+ predefinedMin:"",
17
+ predefinedMax:"",
18
+ predefinedClick:false,
19
+ size:"small",
20
+ thousandSeparator:",",
21
+ centSeparator:".",
22
+ min:0,
23
+ max:100,
24
+ step:1,
25
+ range:false,
26
+ caption:"{0}",
27
+ minCaption:"",
28
+ maxCaption:"",
29
+ display:function()
30
+ {
31
+ 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+'</label><div class="dfield"><input class="field disabled '+this.size+'" type="text" value="'+( ( !this.range ) ? $.fbuilder.htmlEncode( this.predefined ) : $.fbuilder.htmlEncode( '['+this.predefinedMin+','+this.predefinedMax+']' ) )+'"/><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
32
+ },
33
+ editItemEvents:function()
34
+ {
35
+ var evt = [
36
+ {s:"#sSize",e:"change", l:"size"},
37
+ {s:"#sMin",e:"change keyup", l:"min"},
38
+ {s:"#sMax",e:"change keyup", l:"max"},
39
+ {s:"#sStep",e:"change keyup", l:"step"},
40
+ {s:"#sRange",e:"change", l:"range", f:function(el){
41
+ var v = el.is(':checked');
42
+ $( 'div.range' )[ ( v ) ? 'show' : 'hide' ]();
43
+ $( 'div.no-range' )[ ( v ) ? 'hide' : 'show' ]();
44
+ return v;
45
+ }
46
+ },
47
+ {s:"#sCaption",e:"change keyup", l:"caption"},
48
+ {s:"#sMinCaption",e:"change keyup", l:"minCaption"},
49
+ {s:"#sMaxCaption",e:"change keyup", l:"maxCaption"},
50
+ {s:"#sPredefinedMin",e:"change keyup", l:"predefinedMin"},
51
+ {s:"#sPredefinedMax",e:"change keyup", l:"predefinedMax"},
52
+ {s:"#sThousandSeparator",e:"change keyup", l:"thousandSeparator"},
53
+ {s:"#sCentSeparator",e:"change keyup", l:"centSeparator"}
54
+ ];
55
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
56
+ },
57
+ showRequired: function(){ return ''; },
58
+ showPredefined: function()
59
+ {
60
+ return '<div class="no-range" style="display:'+( ( this.range ) ? 'none' : 'block')+';"><label>Predefined Value</label><input class="large" name="sPredefined" id="sPredefined" value="'+$.fbuilder.htmlEncode( this.predefined )+'"></div><div class="range" style="display:'+( ( this.range ) ? 'block' : 'none')+';"><div class="column"><label>Predefined Min</label><br /><input name="sPredefinedMin" id="sPredefinedMin" value="'+$.fbuilder.htmlEncode( this.predefinedMin )+'" style="width:95%;"></div><div class="column"><label>Predefined Max</label><br /><input name="sPredefinedMax" id="sPredefinedMax" value="'+$.fbuilder.htmlEncode( this.predefinedMax )+'" style="width:95%;"></div><div class="clearer"></div></div>';
61
+ },
62
+ showRangeIntance: function()
63
+ {
64
+ return '<div><div class="column" style="width:30%;"><label>Min</label><br /><input name="sMin" id="sMin" value="'+$.fbuilder.htmlEncode(this.min)+'" placeholder="0 by default" style="width:95%;"></div><div class="column" style="width:30%;"><label>Max</label><br /><input name="sMax" id="sMax" value="'+$.fbuilder.htmlEncode(this.max)+'" placeholder="100 by default" style="width:95%;"></div><div class="column" style="width:30%;"><label>Step</label><br /><input name="sStep" id="sStep" value="'+$.fbuilder.htmlEncode(this.step)+'" placeholder="1 by default" style="width:95%;"></div><div class="clearer"></div></div><div><input type="checkbox" name="sRange" id="sRange" '+( ( this.range ) ? 'CHECKED' : '' )+' /> Range slider </div><div><label>Field Caption</label><br /><input class="large" type="text" name="sCaption" id="sCaption" value="'+$.fbuilder.htmlEncode( this.caption )+'"></div><div><label>Min Corner Caption</label><br /><input class="large" type="text" name="sMinCaption" id="sMinCaption" value="'+$.fbuilder.htmlEncode( this.minCaption )+'"></div><div><label>Max Corner Caption</label><br /><input class="large" type="text" name="sMaxCaption" id="sMaxCaption" value="'+$.fbuilder.htmlEncode( this.maxCaption )+'"></div><div><label>Symbol for grouping thousands in the field\'s caption(Ex: 3,000,000)</label><input type="text" name="sThousandSeparator" id="sThousandSeparator" class="large" value="'+$.fbuilder.htmlEncode( this.thousandSeparator )+'" /></div><div><label>Decimals separator symbol (Ex: 25.20)</label><input type="text" name="sCentSeparator" id="sCentSeparator" class="large" value="'+$.fbuilder.htmlEncode( this.centSeparator )+'" /></div>';
65
+ }
66
+ });
js/fields-admin/03_fbuilder.femail.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"femail",
4
+ name:"Email",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'femail'] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'femail' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Email",
14
+ ftype:"femail",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ readonly:false,
19
+ size:"medium",
20
+ equalTo:"",
21
+ display:function()
22
+ {
23
+ 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"><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>';
24
+ },
25
+ editItemEvents:function()
26
+ {
27
+ var evt = [
28
+ {s:"#sSize",e:"change", l:"size"},
29
+ {s:"#sEqualTo",e:"change", l:"equalTo"}
30
+ ],
31
+ items = this.fBuild.getItems();
32
+ $('.equalTo').each(function()
33
+ {
34
+ var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
35
+ for (var i=0;i<items.length;i++)
36
+ {
37
+ if ((items[i].ftype=="ftext" || items[i].ftype=="femail" || items[i].ftype=="fpassword") && (items[i].name != $(this).attr("dname")))
38
+ {
39
+ str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].title)+'</option>';
40
+ }
41
+ }
42
+ $(this).html(str);
43
+ });
44
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
45
+ },
46
+ showSpecialDataInstance: function()
47
+ {
48
+ var str = "";
49
+ return str;
50
+ }
51
+ });
js/fields-admin/04_fbuilder.fdate.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fdate",
4
+ name:"Date Time",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fdate' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fdate' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Date",
14
+ ftype:"fdate",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ size:"medium",
18
+ required:false,
19
+ dformat:"mm/dd/yyyy",
20
+ tformat:"24",
21
+ showDropdown:false,
22
+ dropdownRange:"-10:+10",
23
+
24
+ minDate:"",
25
+ maxDate:"",
26
+ invalidDates:"",
27
+ minHour:0,
28
+ maxHour:23,
29
+ minMinute:0,
30
+ maxMinute:59,
31
+
32
+ stepHour: 1,
33
+ stepMinute: 1,
34
+
35
+ showDatepicker: true,
36
+ showTimepicker: false,
37
+
38
+ defaultDate:"",
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
+ {
50
+ var evt = [
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"},
57
+ {s:"#sInvalidDates",e:"change keyup", l:"invalidDates"},
58
+ {s:"#sDefaultDate",e:"change keyup", l:"defaultDate"},
59
+ {s:"#sShowDropdown",e:"click", l:"showDropdown", f:function(el){
60
+ var v = el.is(':checked');
61
+ $("#divdropdownRange")[( v ) ? 'show' : 'hide']();
62
+ return v;
63
+ }
64
+ },
65
+ {s:"#sShowTimepicker",e:"click", l:"showTimepicker", f:function(el){
66
+ var v = el.is(':checked');
67
+ $(".time-options")[( v ) ? 'show' : 'hide']();
68
+ return v;
69
+ }
70
+ },
71
+ {s:"#sShowDatepicker",e:"click", l:"showDatepicker", f:function(el){return el.is(':checked');}},
72
+ {s:"#sMinHour",e:"change keyup", l:"minHour"},
73
+ {s:"#sMaxHour",e:"change keyup", l:"maxHour"},
74
+ {s:"#sMinMinute",e:"change keyup", l:"minMinute"},
75
+ {s:"#sMaxMinute",e:"change keyup", l:"maxMinute"},
76
+ {s:"#sStepHour",e:"change keyup", l:"stepHour"},
77
+ {s:"#sStepMinute",e:"change keyup", l:"stepMinute"},
78
+ {s:"#sDefaultTime",e:"change keyup", l:"defaultTime"}
79
+ ];
80
+ $(".working_dates input").bind("click", {obj: this}, function(e) {
81
+ e.data.obj.working_dates[$(this).val()] = $(this).is(':checked');
82
+ $.fbuilder.reloadItems({'field':e.data.obj});
83
+ });
84
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
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
+ {
97
+ var str = "";
98
+ str += '<div><label>Default date [<a class="helpfbuilder" text="You can put one of the following type of values into this field:\n\nEmpty: Leave empty for current date.\n\nDate: A Fixed date with the same date format indicated in the &quot;Date Format&quot; drop-down field.\n\nNumber: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.\n\nString: A smart text indicating a relative date. Relative dates must contain value (number) and period pairs; valid periods are &quot;y&quot; for years, &quot;m&quot; for months, &quot;w&quot; for weeks, and &quot;d&quot; for days. For example, &quot;+1m +7d&quot; represents one month and seven days from today.">help?</a>]</label><br /><input class="large" name="sDefaultDate" id="sDefaultDate" value="'+$.fbuilder.htmlEncode(this.defaultDate)+'" /></div>';
99
+ str += '<div><label>Min date [<a class="helpfbuilder" text="You can put one of the following type of values into this field:\n\nEmpty: No min Date.\n\nDate: A Fixed date with the same date format indicated in the &quot;Date Format&quot; drop-down field.\n\nNumber: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.\n\nString: A smart text indicating a relative date. Relative dates must contain value (number) and period pairs; valid periods are &quot;y&quot; for years, &quot;m&quot; for months, &quot;w&quot; for weeks, and &quot;d&quot; for days. For example, &quot;+1m +7d&quot; represents one month and seven days from today.">help?</a>]</label><br /><input class="large" name="sMinDate" id="sMinDate" value="'+$.fbuilder.htmlEncode(this.minDate)+'" /></div>';
100
+ str += '<div><label>Max date [<a class="helpfbuilder" text="You can put one of the following type of values into this field:\n\nEmpty: No max Date.\n\nDate: A Fixed date with the same date format indicated in the &quot;Date Format&quot; drop-down field.\n\nNumber: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.\n\nString: A smart text indicating a relative date. Relative dates must contain value (number) and period pairs; valid periods are &quot;y&quot; for years, &quot;m&quot; for months, &quot;w&quot; for weeks, and &quot;d&quot; for days. For example, &quot;+1m +7d&quot; represents one month and seven days from today.">help?</a>]</label><br /><input class="large" name="sMaxDate" id="sMaxDate" value="'+$.fbuilder.htmlEncode(this.maxDate)+'" /></div>';
101
+ str += '<div><label>Invalid Dates [<a class="helpfbuilder" text="To define some dates as invalid, enter the dates with the format: mm/dd/yyyy separated by comma; for example: 12/31/2014,02/20/2014 or by hyphen for intervals; for example: 12/20/2014-12/28/2014 ">help?</a>]</label><br /><input class="large" name="sInvalidDates" id="sInvalidDates" value="'+$.fbuilder.htmlEncode(this.invalidDates)+'" /></div>';
102
+ str += '<div><input type="checkbox" name="sShowDropdown" id="sShowDropdown" '+((this.showDropdown)?"checked":"")+'/><label>Show Dropdown Year and Month</label><div id="divdropdownRange" style="display:'+((this.showDropdown)?"":"none")+'">Year Range [<a class="helpfbuilder" text="The range of years displayed in the year drop-down: either relative to today\'s year (&quot;-nn:+nn&quot;), absolute (&quot;nnnn:nnnn&quot;), or combinations of these formats (&quot;nnnn:-nn&quot;)">help?</a>]: <input type="text" name="sDropdownRange" id="sDropdownRange" value="'+$.fbuilder.htmlEncode(this.dropdownRange)+'"/></div></div>';
103
+ str += '<div class="working_dates"><label>Selectable dates </label><br /><input name="sWD0" id="sWD0" value="0" type="checkbox" '+((this.working_dates[0])?"checked":"")+'/>Su<input name="sWD1" id="sWD1" value="1" type="checkbox" '+((this.working_dates[1])?"checked":"")+'/>Mo<input name="sWD2" id="sWD2" value="2" type="checkbox" '+((this.working_dates[2])?"checked":"")+'/>Tu<input name="sWD3" id="sWD3" value="3" type="checkbox" '+((this.working_dates[3])?"checked":"")+'/>We<input name="sWD4" id="sWD4" value="4" type="checkbox" '+((this.working_dates[4])?"checked":"")+'/>Th<input name="sWD5" id="sWD5" value="5" type="checkbox" '+((this.working_dates[5])?"checked":"")+'/>Fr<input name="sWD6" id="sWD6" value="6" type="checkbox" '+((this.working_dates[6])?"checked":"")+'/>Sa</div>';
104
+
105
+ // Fields for timepicker
106
+ str += '<hr></hr>'
107
+ str += '<div><input type="checkbox" name="sShowTimepicker" id="sShowTimepicker" '+( ( this.showTimepicker ) ? 'CHECKED' : '' )+' > <label>Include time</label></div>';
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>';
118
+ str += '</div>';
119
+ str += '<hr></hr>';
120
+ return str;
121
+ }
122
+ });
js/fields-admin/05_fbuilder.ftextarea.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"ftextarea",
4
+ name:"Text Area",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'ftextarea' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'ftextarea' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"ftextarea",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ readonly:false,
19
+ size:"medium",
20
+ minlength:"",
21
+ maxlength:"",
22
+ rows:4,
23
+ display:function()
24
+ {
25
+ 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"><textarea '+((!/^\s*$/.test(this.rows)) ? 'rows='+this.rows : '' )+' class="field disabled '+this.size+'">'+this.predefined+'</textarea><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
26
+ },
27
+ editItemEvents:function()
28
+ {
29
+ var evt = [
30
+ {s:"#sSize",e:"change", l:"size"},
31
+ {s:"#sMinlength",e:"change keyup", l:"minlength"},
32
+ {s:"#sMaxlength",e:"change keyup", l:"maxlength"},
33
+ {s:"#sRows",e:"change keyup", l:"rows"}
34
+ ];
35
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
36
+ },
37
+ showSpecialDataInstance: function()
38
+ {
39
+ return '<div class="column"><label>Min length/characters</label><br /><input name="sMinlength" id="sMinlength" value="'+$.fbuilder.htmlEncode(this.minlength)+'"></div><div class="column"><label>Max length/characters</label><br /><input name="sMaxlength" id="sMaxlength" value="'+$.fbuilder.htmlEncode(this.maxlength)+'"></div><div class="clearer"></div><div><label>Number of rows</label><br><input type="text" name="sRows" id="sRows" value="'+$.fbuilder.htmlEncode(this.rows)+'" /></div><div class="clearer"></div>';
40
+ }
41
+ });
js/fields-admin/06_fbuilder.fcheck.js ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fcheck",
4
+ name:"Checkboxes",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fcheck' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fcheck' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Check All That Apply",
14
+ ftype:"fcheck",
15
+ layout:"one_column",
16
+ required:false,
17
+ toSubmit:'text',
18
+ merge:1,
19
+ max:-1,
20
+ maxError:"Check no more than {0} boxes",
21
+ showDep:false,
22
+ init:function()
23
+ {
24
+ this.choices = new Array("First Choice","Second Choice","Third Choice");
25
+ this.choicesVal = new Array("First Choice","Second Choice","Third Choice");
26
+ this.choiceSelected = new Array(false,false,false);
27
+ this.choicesDep = new Array(new Array(),new Array(),new Array());
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
+ {
35
+ str += '<div class="'+this.layout+'"><input class="field" disabled="true" type="checkbox" '+((this.choiceSelected[i])?"checked":"")+'/> '+$.fbuilder.htmlDecode(this.choices[i])+'</div>';
36
+ }
37
+ 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">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
38
+ },
39
+ editItemEvents:function()
40
+ {
41
+ $(".choice_text").bind("change keyup", {obj: this}, function(e)
42
+ {
43
+ if (e.data.obj.choices[$(this).attr("i")] == e.data.obj.choicesVal[$(this).attr("i")])
44
+ {
45
+ $("#"+$(this).attr("id")+"V"+$(this).attr("i")).val($(this).val());
46
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
47
+ }
48
+ e.data.obj.choices[$(this).attr("i")]= $(this).val();
49
+ $.fbuilder.reloadItems({'field':e.data.obj});
50
+ });
51
+ $(".choice_value").bind("change keyup", {obj: this}, function(e)
52
+ {
53
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
54
+ $.fbuilder.reloadItems({'field':e.data.obj});
55
+ });
56
+ $(".choice_check").bind("click", {obj: this}, function(e)
57
+ {
58
+ if ($(this).is(':checked'))
59
+ {
60
+ e.data.obj.choiceSelected[$(this).attr("i")] = true;
61
+ }
62
+ else
63
+ {
64
+ e.data.obj.choiceSelected[$(this).attr("i")] = false;
65
+ }
66
+ $.fbuilder.reloadItems({'field':e.data.obj});
67
+ });
68
+ $("#sLayout").bind("change", {obj: this}, function(e)
69
+ {
70
+ e.data.obj.layout = $(this).val();
71
+ $.fbuilder.reloadItems({'field':e.data.obj});
72
+ });
73
+ $(".choice_up").bind("click", {obj: this}, function(e)
74
+ {
75
+ var i = $(this).attr("i")*1;
76
+ if (i!=0)
77
+ {
78
+ e.data.obj.choices.splice(i-1, 0, e.data.obj.choices.splice(i, 1)[0]);
79
+ e.data.obj.choicesVal.splice(i-1, 0, e.data.obj.choicesVal.splice(i, 1)[0]);
80
+ e.data.obj.choicesDep.splice(i-1, 0, e.data.obj.choicesDep.splice(i, 1)[0]);
81
+ }
82
+ $.fbuilder.editItem(e.data.obj.index);
83
+ $.fbuilder.reloadItems({'field':e.data.obj});
84
+ });
85
+ $(".choice_down").bind("click", {obj: this}, function(e)
86
+ {
87
+ var i = $(this).attr("i")*1;
88
+ var n = $(this).attr("n")*1;
89
+ if (i!=n)
90
+ {
91
+ e.data.obj.choices.splice(i, 0, e.data.obj.choices.splice(i+1, 1)[0]);
92
+ e.data.obj.choicesVal.splice(i, 0, e.data.obj.choicesVal.splice(i+1, 1)[0]);
93
+ e.data.obj.choicesDep.splice(i, 0, e.data.obj.choicesDep.splice(i+1, 1)[0]);
94
+ }
95
+ $.fbuilder.editItem(e.data.obj.index);
96
+ $.fbuilder.reloadItems({'field':e.data.obj});
97
+ });
98
+ $(".choice_removeDep").bind("click", {obj: this}, function(e)
99
+ {
100
+ if (e.data.obj.choices.length==1)
101
+ {
102
+ e.data.obj.choicesDep[$(this).attr("i")][0]="";
103
+ }
104
+ else
105
+ {
106
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j"),1);
107
+ }
108
+ $.fbuilder.editItem(e.data.obj.index);
109
+ $.fbuilder.reloadItems({'field':e.data.obj});
110
+ });
111
+ $(".choice_addDep").bind("click", {obj: this}, function(e)
112
+ {
113
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j")*1+1,0,"");
114
+ $.fbuilder.editItem(e.data.obj.index);
115
+ $.fbuilder.reloadItems({'field':e.data.obj});
116
+ });
117
+ $(".choice_remove").bind("click", {obj: this}, function(e)
118
+ {
119
+ if (e.data.obj.choices.length==1)
120
+ {
121
+ e.data.obj.choices[0]="";
122
+ e.data.obj.choicesVal[0]="";
123
+ e.data.obj.choicesDep[0]=new Array();
124
+ }
125
+ else
126
+ {
127
+ e.data.obj.choices.splice($(this).attr("i"),1);
128
+ e.data.obj.choicesVal.splice($(this).attr("i"),1);
129
+ e.data.obj.choicesDep.splice($(this).attr("i"),1);
130
+ }
131
+ if (e.data.obj.ftype=="fcheck" && 0 < e.data.obj.choiceSelected.length)
132
+ {
133
+ if (e.data.obj.choiceSelected.length==1)
134
+ {
135
+ e.data.obj.choiceSelected[0]="";
136
+ }
137
+ else
138
+ {
139
+ e.data.obj.choiceSelected.splice($(this).attr("i"),1);
140
+ }
141
+ }
142
+ $.fbuilder.editItem(e.data.obj.index);
143
+ $.fbuilder.reloadItems({'field':e.data.obj});
144
+ });
145
+ $(".choice_add").bind("click", {obj: this}, function(e)
146
+ {
147
+ e.data.obj.choices.splice($(this).attr("i")*1+1,0,"");
148
+ e.data.obj.choicesVal.splice($(this).attr("i")*1+1,0,"");
149
+ e.data.obj.choicesDep.splice($(this).attr("i")*1+1,0,new Array());
150
+ if (e.data.obj.ftype=="fcheck")
151
+ {
152
+ e.data.obj.choiceSelected.splice($(this).attr("i")*1+1,0,false);
153
+ }
154
+ $.fbuilder.editItem(e.data.obj.index);
155
+ $.fbuilder.reloadItems({'field':e.data.obj});
156
+ });
157
+ $(".showHideDependencies").bind("click", {obj: this}, function(e)
158
+ {
159
+ if (e.data.obj.showDep)
160
+ {
161
+ $(this).parent().removeClass("show");
162
+ $(this).parent().addClass("hide");
163
+ $(this).html("Show Dependencies");
164
+ e.data.obj.showDep = false;
165
+ }
166
+ else
167
+ {
168
+ $(this).parent().addClass("show");
169
+ $(this).parent().removeClass("hide");
170
+ $(this).html("Hide Dependencies");
171
+ e.data.obj.showDep = true;
172
+ }
173
+ return false;
174
+ });
175
+ $('.dependencies').bind("change", {obj: this}, function(e)
176
+ {
177
+ e.data.obj.choicesDep[$(this).attr("i")][$(this).attr("j")] = $(this).val();
178
+ $.fbuilder.reloadItems({'field':e.data.obj});
179
+ });
180
+ var me = this,
181
+ items = me.fBuild.getItems(),
182
+ evt = [
183
+ {s:'[name="sToSubmit"]', e:"click", l:"toSubmit"},
184
+ {s:'[name="sMerge"]', e:"change", l:"merge", f: function(el){return (el.is(':checked')) ? 1 : 0;}},
185
+ {s:'[name="sMax"]', e:"change keyup", l:"max", f: function(el){
186
+ var v = el.val();
187
+ return ($.isNumeric(v)) ? Math.round(v) : -1;
188
+ }},
189
+ {s:'[name="sMaxError"]', e:"change keyup", l:"maxError"}
190
+ ];
191
+ $('.dependencies').each(function()
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
+ });
199
+
200
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
201
+ },
202
+ mergeValues: function()
203
+ {
204
+ return '<div class="choicesSet"><label><input type="checkbox" name="sMerge" '+((this.merge) ? ' CHECKED ' : '')+'/> Merge ticked up options (sum or concatenation) or their values are returned as an array.</label></div>';
205
+ },
206
+ attributeToSubmit: function()
207
+ {
208
+ 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>';
209
+ },
210
+ maxChoices: function()
211
+ {
212
+ return '<div><input type="number" name="sMax" value="'+(($.isNumeric(this.max) && 0<=this.max) ? this.max : '')+'" style="max-width:60px;" min="1" /> Maximum number of choices to be ticked.</div>'+
213
+ '<div><input type="text" name="sMaxError" style="width:100%" value="'+$.fbuilder.htmlEncode($.fbuilder.htmlDecode(this.maxError))+'" placeholder="Max choices error messages" /></div>';
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;
221
+ if (!(typeof(this.choicesDep) != "undefined" && this.choicesDep !== null))
222
+ {
223
+ this.choicesDep = new Array();
224
+ for (var i=0;i<l.length;i++)
225
+ {
226
+ this.choicesDep[i] = new Array();
227
+ }
228
+ }
229
+ var d = this.choicesDep,
230
+ str = "";
231
+ for (var i=0;i<l.length;i++)
232
+ {
233
+ str += '<div class="choicesEdit"><input class="choice_check" i="'+i+'" type="checkbox" '+((this.choiceSelected[i])?"checked":"")+'/><input class="choice_text" i="'+i+'" type="text" name="sChoice'+this.name+'" id="sChoice'+this.name+'" value="'+$.fbuilder.htmlEncode($.fbuilder.htmlDecode(l[i]))+'"/><input class="choice_value" i="'+i+'" type="text" name="sChoice'+this.name+'V'+i+'" id="sChoice'+this.name+'V'+i+'" value="'+$.fbuilder.htmlEncode($.fbuilder.htmlDecode(lv[i]))+'"/><div class="choice-ctrls"><a class="choice_down ui-icon ui-icon-arrowthick-1-s" i="'+i+'" n="'+(l.length-1)+'" title="Down"></a><a class="choice_up ui-icon ui-icon-arrowthick-1-n" i="'+i+'" title="Up"></a><a class="choice_add ui-icon ui-icon-circle-plus" i="'+i+'" title="Add another choice."></a><a class="choice_remove ui-icon ui-icon-circle-minus" i="'+i+'" title="Delete this choice."></a></div></div>';
234
+ for (var j=0;j<d[i].length;j++)
235
+ {
236
+ str += '<div class="choicesEditDep"><span>If selected show:</span> <select class="dependencies" i="'+i+'" j="'+j+'" dname="'+this.name+'" dvalue="'+d[i][j]+'" ></select><div class="choice-ctrls"><a class="choice_addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+j+'" title="Add another dependency."></a><a class="choice_removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+j+'" title="Delete this dependency."></a></div></div>';
237
+ }
238
+ if (d[i].length==0)
239
+ {
240
+ 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>';
241
+ }
242
+ }
243
+ 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.mergeValues()+this.attributeToSubmit()+this.maxChoices()+'</div>';
244
+ }
245
+ });
js/fields-admin/07_fbuilder.fradio.js ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fradio",
4
+ name:"Radio Buttons",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fradio' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fradio' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Select a Choice",
14
+ ftype:"fradio",
15
+ layout:"one_column",
16
+ required:false,
17
+ toSubmit:'text',
18
+ choiceSelected:"",
19
+ showDep:false,
20
+ init:function()
21
+ {
22
+ this.choices = new Array("First Choice","Second Choice","Third Choice");
23
+ this.choicesVal = new Array("First Choice","Second Choice","Third Choice");
24
+ this.choicesDep = new Array(new Array(),new Array(),new Array());
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
+ {
32
+ str += '<div class="'+this.layout+'"><input class="field" disabled="true" type="radio" i="'+i+'" '+(( this.choices[i]+' - '+this.choicesVal[i]==this.choiceSelected)?"checked":"")+'/> '+$.fbuilder.htmlDecode( this.choices[i] )+'</div>';
33
+ }
34
+ 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">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
35
+ },
36
+ editItemEvents:function()
37
+ {
38
+ $(".choice_text").bind("change keyup", {obj: this}, function(e)
39
+ {
40
+ if (e.data.obj.choices[$(this).attr("i")] == e.data.obj.choicesVal[$(this).attr("i")])
41
+ {
42
+ $("#"+$(this).attr("id")+"V"+$(this).attr("i")).val($(this).val());
43
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
44
+ }
45
+ e.data.obj.choices[$(this).attr("i")]= $(this).val();
46
+ $.fbuilder.reloadItems({'field':e.data.obj});
47
+ });
48
+ $(".choice_value").bind("change keyup", {obj: this}, function(e)
49
+ {
50
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
51
+ $.fbuilder.reloadItems({'field':e.data.obj});
52
+ });
53
+ $(".choice_radio").bind("mousedown", function(){$(this).data('previous-status', $(this).is(':checked'));});
54
+ $(".choice_radio").bind("click", {obj: this}, function(e)
55
+ {
56
+ var el = $(this),
57
+ i = el.attr("i");
58
+
59
+ el.prop('checked', !el.data('previous-status'));
60
+ e.data.obj.choiceSelected = (el.is(':checked')) ? e.data.obj.choices[i] + ' - ' + e.data.obj.choicesVal[i] : "";
61
+ $.fbuilder.reloadItems({'field':e.data.obj});
62
+ });
63
+ $("#sLayout").bind("change", {obj: this}, function(e)
64
+ {
65
+ e.data.obj.layout = $(this).val();
66
+ $.fbuilder.reloadItems({'field':e.data.obj});
67
+ });
68
+ $(".choice_up").bind("click", {obj: this}, function(e)
69
+ {
70
+ var i = $(this).attr("i")*1;
71
+ if (i!=0)
72
+ {
73
+ e.data.obj.choices.splice(i-1, 0, e.data.obj.choices.splice(i, 1)[0]);
74
+ e.data.obj.choicesVal.splice(i-1, 0, e.data.obj.choicesVal.splice(i, 1)[0]);
75
+ e.data.obj.choicesDep.splice(i-1, 0, e.data.obj.choicesDep.splice(i, 1)[0]);
76
+ }
77
+ $.fbuilder.editItem(e.data.obj.index);
78
+ $.fbuilder.reloadItems({'field':e.data.obj});
79
+ });
80
+ $(".choice_down").bind("click", {obj: this}, function(e)
81
+ {
82
+ var i = $(this).attr("i")*1;
83
+ var n = $(this).attr("n")*1;
84
+ if (i!=n)
85
+ {
86
+ e.data.obj.choices.splice(i, 0, e.data.obj.choices.splice(i+1, 1)[0]);
87
+ e.data.obj.choicesVal.splice(i, 0, e.data.obj.choicesVal.splice(i+1, 1)[0]);
88
+ e.data.obj.choicesDep.splice(i, 0, e.data.obj.choicesDep.splice(i+1, 1)[0]);
89
+ }
90
+ $.fbuilder.editItem(e.data.obj.index);
91
+ $.fbuilder.reloadItems({'field':e.data.obj});
92
+ });
93
+ $(".choice_removeDep").bind("click", {obj: this}, function(e)
94
+ {
95
+ if (e.data.obj.choices.length==1)
96
+ {
97
+ e.data.obj.choicesDep[$(this).attr("i")][0]="";
98
+ }
99
+ else
100
+ {
101
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j"),1);
102
+ }
103
+ $.fbuilder.editItem(e.data.obj.index);
104
+ $.fbuilder.reloadItems({'field':e.data.obj});
105
+ });
106
+ $(".choice_addDep").bind("click", {obj: this}, function(e)
107
+ {
108
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j")*1+1,0,"");
109
+ $.fbuilder.editItem(e.data.obj.index);
110
+ $.fbuilder.reloadItems({'field':e.data.obj});
111
+ });
112
+ $(".choice_remove").bind("click", {obj: this}, function(e)
113
+ {
114
+ var i = $(this).attr("i");
115
+
116
+ if( e.data.obj.choices[ i ] + ' - ' + e.data.obj.choicesVal[ i ] == e.data.obj.choiceSelected )
117
+ {
118
+ e.data.obj.choiceSelected = "";
119
+ }
120
+
121
+ if (e.data.obj.choices.length==1)
122
+ {
123
+ e.data.obj.choices[0]="";
124
+ e.data.obj.choicesVal[0]="";
125
+ e.data.obj.choicesDep[0]=new Array();
126
+ }
127
+ else
128
+ {
129
+ e.data.obj.choices.splice(i,1);
130
+ e.data.obj.choicesVal.splice(i,1);
131
+ e.data.obj.choicesDep.splice(i,1);
132
+ }
133
+ $.fbuilder.editItem(e.data.obj.index);
134
+ $.fbuilder.reloadItems({'field':e.data.obj});
135
+ });
136
+ $(".choice_add").bind("click", {obj: this}, function(e)
137
+ {
138
+ var i = $(this).attr("i")*1+1;
139
+
140
+ e.data.obj.choices.splice(i,0,"");
141
+ e.data.obj.choicesVal.splice(i,0,"");
142
+ e.data.obj.choicesDep.splice(i,0,new Array());
143
+ $.fbuilder.editItem(e.data.obj.index);
144
+ $.fbuilder.reloadItems({'field':e.data.obj});
145
+ });
146
+ $(".showHideDependencies").bind("click", {obj: this}, function(e)
147
+ {
148
+ if (e.data.obj.showDep)
149
+ {
150
+ $(this).parent().removeClass("show");
151
+ $(this).parent().addClass("hide");
152
+ $(this).html("Show Dependencies");
153
+ e.data.obj.showDep = false;
154
+ }
155
+ else
156
+ {
157
+ $(this).parent().addClass("show");
158
+ $(this).parent().removeClass("hide");
159
+ $(this).html("Hide Dependencies");
160
+ e.data.obj.showDep = true;
161
+ }
162
+ return false;
163
+ });
164
+ $('.dependencies').bind("change", {obj: this}, function(e)
165
+ {
166
+ e.data.obj.choicesDep[$(this).attr("i")][$(this).attr("j")] = $(this).val();
167
+ $.fbuilder.reloadItems({'field':e.data.obj});
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
+ }
181
+ }
182
+ $(this).html(str);
183
+ });
184
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
185
+ },
186
+ attributeToSubmit: function()
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))
196
+ {
197
+ this.choicesDep = new Array();
198
+ for (var i=0;i<l.length;i++)
199
+ {
200
+ this.choicesDep[i] = new Array();
201
+ }
202
+ }
203
+ var d = this.choicesDep;
204
+ var str = "";
205
+ for (var i=0;i<l.length;i++)
206
+ {
207
+ str += '<div class="choicesEdit"><input class="choice_radio" i="'+i+'" type="radio" '+((this.choiceSelected==l[i]+' - '+lv[i])?"checked":"")+' name="choice_radio" /><input class="choice_text" i="'+i+'" type="text" name="sChoice'+this.name+'" id="sChoice'+this.name+'" value="'+$.fbuilder.htmlEncode($.fbuilder.htmlDecode(l[i]))+'"/><input class="choice_value" i="'+i+'" type="text" name="sChoice'+this.name+'V'+i+'" id="sChoice'+this.name+'V'+i+'" value="'+$.fbuilder.htmlEncode($.fbuilder.htmlDecode(lv[i]))+'"/><div class="choice-ctrls"><a class="choice_down ui-icon ui-icon-arrowthick-1-s" i="'+i+'" n="'+(l.length-1)+'" title="Down"></a><a class="choice_up ui-icon ui-icon-arrowthick-1-n" i="'+i+'" title="Up"></a><a class="choice_add ui-icon ui-icon-circle-plus" i="'+i+'" title="Add another choice."></a><a class="choice_remove ui-icon ui-icon-circle-minus" i="'+i+'" title="Delete this choice."></a></div></div>';
208
+ for (var j=0;j<d[i].length;j++)
209
+ {
210
+ str += '<div class="choicesEditDep"><span>If selected show:</span> <select class="dependencies" i="'+i+'" j="'+j+'" dname="'+this.name+'" dvalue="'+d[i][j]+'" ></select><div class="choice-ctrls"><a class="choice_addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+j+'" title="Add another dependency."></a><a class="choice_removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+j+'" title="Delete this dependency."></a></div></div>';
211
+ }
212
+ if (d[i].length==0)
213
+ {
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
+ });
js/fields-admin/08_fbuilder.fdropdown.js ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fdropdown",
4
+ name:"Dropdown",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fdropdown' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fdropdown' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Select a Choice",
14
+ ftype:"fdropdown",
15
+ size:"medium",
16
+ required:false,
17
+ toSubmit:'text',
18
+ merge:0,
19
+ choiceSelected:"",
20
+ multiple: false,
21
+ vChoices: 1,
22
+ showDep:false,
23
+ init:function()
24
+ {
25
+ this.choices = new Array("First Choice","Second Choice","Third Choice");
26
+ this.optgroup = new Array(false,false,false);
27
+ this.choicesVal = new Array("First Choice","Second Choice","Third Choice");
28
+ this.choicesDep = new Array(new Array(),new Array(),new Array());
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()
36
+ {
37
+ $(".choice_text").bind("change keyup", {obj: this}, function(e)
38
+ {
39
+ if (e.data.obj.choices[$(this).attr("i")] == e.data.obj.choicesVal[$(this).attr("i")])
40
+ {
41
+ $("#"+$(this).attr("id")+"V"+$(this).attr("i")).val($(this).val());
42
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
43
+ }
44
+ e.data.obj.choices[$(this).attr("i")]= $(this).val();
45
+ $.fbuilder.reloadItems({'field':e.data.obj});
46
+ });
47
+ $(".choice_value").bind("change keyup", {obj: this}, function(e)
48
+ {
49
+ e.data.obj.choicesVal[$(this).attr("i")]= $(this).val();
50
+ $.fbuilder.reloadItems({'field':e.data.obj});
51
+ });
52
+ $(".choice_optgroup").bind("change", {obj: this}, function(e)
53
+ {
54
+ e.data.obj.optgroup[$(this).attr("i")]= $(this).is(':checked');
55
+ $.fbuilder.reloadItems({'field':e.data.obj});
56
+ });
57
+ $(".choice_select").bind("mousedown", function(){$(this).data('previous-status', $(this).is(':checked'));});
58
+ $(".choice_select").bind("click", {obj: this}, function(e)
59
+ {
60
+ var el = $(this),
61
+ i = el.attr("i");
62
+
63
+ el.prop('checked', !el.data('previous-status'));
64
+ e.data.obj.choiceSelected = (el.is(':checked')) ? e.data.obj.choices[i] + ' - ' + e.data.obj.choicesVal[i] : "";
65
+ $.fbuilder.reloadItems({'field':e.data.obj});
66
+ });
67
+ $("#sSize").bind("change", {obj: this}, function(e)
68
+ {
69
+ e.data.obj.size = $(this).val();
70
+ $.fbuilder.reloadItems({'field':e.data.obj});
71
+ });
72
+ $(".choice_up").bind("click", {obj: this}, function(e)
73
+ {
74
+ var i = $(this).attr("i")*1;
75
+ if (i!=0)
76
+ {
77
+ e.data.obj.choices.splice(i-1, 0, e.data.obj.choices.splice(i, 1)[0]);
78
+ e.data.obj.choicesVal.splice(i-1, 0, e.data.obj.choicesVal.splice(i, 1)[0]);
79
+ e.data.obj.choicesDep.splice(i-1, 0, e.data.obj.choicesDep.splice(i, 1)[0]);
80
+ e.data.obj.optgroup.splice(i-1, 0, e.data.obj.optgroup.splice(i, 1)[0]);
81
+ }
82
+ $.fbuilder.editItem(e.data.obj.index);
83
+ $.fbuilder.reloadItems({'field':e.data.obj});
84
+ });
85
+ $(".choice_down").bind("click", {obj: this}, function(e)
86
+ {
87
+ var i = $(this).attr("i")*1;
88
+ var n = $(this).attr("n")*1;
89
+ if (i!=n)
90
+ {
91
+ e.data.obj.choices.splice(i, 0, e.data.obj.choices.splice(i+1, 1)[0]);
92
+ e.data.obj.choicesVal.splice(i, 0, e.data.obj.choicesVal.splice(i+1, 1)[0]);
93
+ e.data.obj.choicesDep.splice(i, 0, e.data.obj.choicesDep.splice(i+1, 1)[0]);
94
+ e.data.obj.optgroup.splice(i, 0, e.data.obj.optgroup.splice(i+1, 1)[0]);
95
+ }
96
+ $.fbuilder.editItem(e.data.obj.index);
97
+ $.fbuilder.reloadItems({'field':e.data.obj});
98
+ });
99
+ $(".choice_removeDep").bind("click", {obj: this}, function(e)
100
+ {
101
+ if (e.data.obj.choices.length==1)
102
+ {
103
+ e.data.obj.choicesDep[$(this).attr("i")][0]="";
104
+ }
105
+ else
106
+ {
107
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j"),1);
108
+ }
109
+ $.fbuilder.editItem(e.data.obj.index);
110
+ $.fbuilder.reloadItems({'field':e.data.obj});
111
+ });
112
+ $(".choice_addDep").bind("click", {obj: this}, function(e)
113
+ {
114
+ e.data.obj.choicesDep[$(this).attr("i")].splice($(this).attr("j")*1+1,0,"");
115
+ $.fbuilder.editItem(e.data.obj.index);
116
+ $.fbuilder.reloadItems({'field':e.data.obj});
117
+ });
118
+ $(".choice_remove").bind("click", {obj: this}, function(e)
119
+ {
120
+ var i = $(this).attr("i");
121
+
122
+ if( e.data.obj.choices[ i ] + ' - ' + e.data.obj.choicesVal[ i ] == e.data.obj.choiceSelected )
123
+ {
124
+ e.data.obj.choiceSelected = "";
125
+ }
126
+
127
+ if (e.data.obj.choices.length==1)
128
+ {
129
+ e.data.obj.choices[0]="";
130
+ e.data.obj.choicesVal[0]="";
131
+ e.data.obj.optgroup[0]=false;
132
+ e.data.obj.choicesDep[0]=new Array();
133
+ }
134
+ else
135
+ {
136
+ e.data.obj.choices.splice( i, 1 );
137
+ e.data.obj.choicesVal.splice( i, 1 );
138
+ e.data.obj.choicesDep.splice( i, 1 );
139
+ e.data.obj.optgroup.splice( i, 1 );
140
+ }
141
+
142
+ $.fbuilder.editItem(e.data.obj.index);
143
+ $.fbuilder.reloadItems({'field':e.data.obj});
144
+ });
145
+ $(".choice_add").bind("click", {obj: this}, function(e)
146
+ {
147
+ e.data.obj.choices.splice($(this).attr("i")*1+1,0,"");
148
+ e.data.obj.choicesVal.splice($(this).attr("i")*1+1,0,"");
149
+ e.data.obj.optgroup.splice($(this).attr("i")*1+1,0,false);
150
+ e.data.obj.choicesDep.splice($(this).attr("i")*1+1,0,new Array());
151
+ $.fbuilder.editItem(e.data.obj.index);
152
+ $.fbuilder.reloadItems({'field':e.data.obj});
153
+ });
154
+ $(".showHideDependencies").bind("click", {obj: this}, function(e)
155
+ {
156
+ if (e.data.obj.showDep)
157
+ {
158
+ $(this).parent().removeClass("show");
159
+ $(this).parent().addClass("hide");
160
+ $(this).html("Show Dependencies");
161
+ e.data.obj.showDep = false;
162
+ }
163
+ else
164
+ {
165
+ $(this).parent().addClass("show");
166
+ $(this).parent().removeClass("hide");
167
+ $(this).html("Hide Dependencies");
168
+ e.data.obj.showDep = true;
169
+ }
170
+ return false;
171
+ });
172
+ $('.dependencies').bind("change", {obj: this}, function(e)
173
+ {
174
+ e.data.obj.choicesDep[$(this).attr("i")][$(this).attr("j")] = $(this).val();
175
+ $.fbuilder.reloadItems({'field':e.data.obj});
176
+ });
177
+ var me = this,
178
+ items = me.fBuild.getItems(),
179
+ evt = [
180
+ {s:'[name="sToSubmit"]', e:"click", l:"toSubmit"},
181
+ {s:'[name="sMerge"]', e:"change", l:"merge", f: function(el){return (el.is(':checked')) ? 1 : 0;}},
182
+ {s:'[name="sMultiple"]', e:"click", l:"multiple", f: function(el){
183
+ return el.is(':checked');
184
+ }},
185
+ {s:'[name="sVChoices"]', e:"change keyup", l:"vChoices", f: function(el){
186
+ var v = el.val();
187
+ return ($.isNumeric(v)) ? Math.ceil(v) : 1;
188
+ }}
189
+ ];
190
+ $('.dependencies').each(function()
191
+ {
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
+ }
199
+ }
200
+ $(this).html(str);
201
+ });
202
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
203
+ },
204
+ mergeValues: function()
205
+ {
206
+ return '<div class="choicesSet"><label><input type="checkbox" name="sMerge" '+((this.merge) ? ' CHECKED ' : '')+'/> Merge selected options (sum or concatenation) or their values are returned as an array (only applied when multiple choices selection is enabled).</label></div>';
207
+ },
208
+ attributeToSubmit: function()
209
+ {
210
+ 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>';
211
+ },
212
+ multipleSelection: function()
213
+ {
214
+ return '<div><input type="checkbox" name="sMultiple" '+((typeof this.multiple != 'undefined' && this.multiple) ? ' CHECKED ' : '')+' /> Allows to select multiple choices.</div>'+
215
+ '<div><input type="number" name="sVChoices" value="'+(($.isNumeric(this.vChoices) && this.vChoices) ? this.vChoices : 1)+'" style="max-width:60px;" min="1" /> Number of visual choices.</div>';
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,
223
+ lv = this.choicesVal,
224
+ og = this.optgroup;
225
+
226
+ if (!(typeof(this.choicesDep) != "undefined" && this.choicesDep !== null))
227
+ {
228
+ this.choicesDep = new Array();
229
+ for (var i=0;i<l.length;i++)
230
+ {
231
+ this.choicesDep[i] = new Array();
232
+ }
233
+ }
234
+ var d = this.choicesDep;
235
+ var str = "";
236
+ for (var i=0;i<l.length;i++)
237
+ {
238
+ if(typeof og[i] == 'undefined') og[i] = false;
239
+
240
+ str += '<div class="choicesEdit"><input class="choice_select" i="'+i+'" type="radio" '+((this.choiceSelected==l[i]+' - '+lv[i])?"checked":"")+' name="choice_select" /><input class="choice_text" i="'+i+'" type="text" name="sChoice'+this.name+'" id="sChoice'+this.name+'" value="'+$.fbuilder.htmlEncode(l[i])+'"/><input class="choice_value" i="'+i+'" type="text" name="sChoice'+this.name+'V'+i+'" id="sChoice'+this.name+'V'+i+'" value="'+$.fbuilder.htmlEncode(lv[i])+'"/><input type="checkbox" name="optgroup" i="'+i+'" '+((og[i]) ? ' CHECKED ' : '' )+' class="choice_optgroup" /><div class="choice-ctrls"><a class="choice_down ui-icon ui-icon-arrowthick-1-s" i="'+i+'" n="'+(l.length-1)+'" title="Down"></a><a class="choice_up ui-icon ui-icon-arrowthick-1-n" i="'+i+'" title="Up"></a><a class="choice_add ui-icon ui-icon-circle-plus" i="'+i+'" title="Add another choice."></a><a class="choice_remove ui-icon ui-icon-circle-minus" i="'+i+'" title="Delete this choice."></a></div></div>';
241
+
242
+ for (var j=0;j<d[i].length;j++)
243
+ {
244
+ str += '<div class="choicesEditDep"><span>If selected show:</span> <select class="dependencies" i="'+i+'" j="'+j+'" dname="'+this.name+'" dvalue="'+d[i][j]+'" ></select><div class="choice-ctrls"><a class="choice_addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+j+'" title="Add another dependency."></a><a class="choice_removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+j+'" title="Delete this dependency."></a></div></div>';
245
+ }
246
+ if (d[i].length==0)
247
+ {
248
+ 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>';
249
+ }
250
+ }
251
+ 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>optgroup</div><div class="clearer"></div></div>'+str+this.mergeValues()+this.attributeToSubmit()+this.multipleSelection()+'</div>';
252
+ }
253
+ });
js/fields-admin/09_fbuilder.ffile.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"ffile",
4
+ name:"Upload File",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'ffile' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'ffile' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"ffile",
15
+ required:false,
16
+ size:"medium",
17
+ accept:"",
18
+ upload_size:"",
19
+ multiple:false,
20
+ display:function()
21
+ {
22
+ 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"><input type="file" disabled class="field '+this.size+'" /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
23
+ },
24
+ editItemEvents:function()
25
+ {
26
+ var evt = [
27
+ {s:"#sSize",e:"change", l:"size"},
28
+ {s:"#sAccept",e:"change keyup", l:"accept"},
29
+ {s:"#sUpload_size",e:"change keyup", l:"upload_size"},
30
+ {s:"#sMultiple",e:"click", l:"multiple",f:function(el){return el.is(":checked");}}
31
+ ];
32
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
33
+ },
34
+ showSpecialDataInstance: function()
35
+ {
36
+ return '<div><label>Accept these file extensions [<a class="helpfbuilder" text="Extensions comma separated and without the dot.\n\nExample: jpg,png,gif,pdf">help?</a>]</label><br /><input name="sAccept" id="sAccept" value="'+$.fbuilder.htmlEncode(this.accept)+'" class="large"></div><div><label>Maximun upload size in kB [<a class="helpfbuilder" text="1024 kB = 1 MB.\n\nThe support for this HTML5 feature may be partially available or not available in some browsers.">help?</a>]</label><br /><input name="sUpload_size" id="sUpload_size" value="'+$.fbuilder.htmlEncode(this.upload_size)+'" class="large"></div><div><label><input type="checkbox" id="sMultiple" name="sMultiple" '+( ( typeof this.multiple != 'undefined' && this.multiple ) ? 'CHECKED' : '' )+' /> Upload multiple files</label></div><div class="clearer"></div>';
37
+ }
38
+ });
js/fields-admin/10_fbuilder.fpassword.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fpassword",
4
+ name:"Password",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fpassword' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fpassword' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"fpassword",
15
+ predefined:"",
16
+ predefinedClick:false,
17
+ required:false,
18
+ size:"medium",
19
+ minlength:"",
20
+ maxlength:"",
21
+ equalTo:"",
22
+ display:function()
23
+ {
24
+ 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"><input class="field disabled '+this.size+'" type="password" value="'+$.fbuilder.htmlEncode(this.predefined)+'"/><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
25
+ },
26
+ editItemEvents:function()
27
+ {
28
+ var evt = [
29
+ {s:"#sSize",e:"change", l:"size"},
30
+ {s:"#sMinlength",e:"change keyup", l:"minlength"},
31
+ {s:"#sMaxlength",e:"change keyup", l:"maxlength"},
32
+ {s:"#sEqualTo",e:"change", l:"equalTo"}
33
+ ],
34
+ items = this.fBuild.getItems();
35
+ $('.equalTo').each(function()
36
+ {
37
+ var str = '<option value="" '+(("" == $(this).attr("dvalue"))?"selected":"")+'></option>';
38
+ for (var i=0;i<items.length;i++)
39
+ {
40
+ if ((items[i].ftype=="ftext" || items[i].ftype=="femail" || items[i].ftype=="fpassword") && (items[i].name != $(this).attr("dname")))
41
+ {
42
+ str += '<option value="'+items[i].name+'" '+((items[i].name == $(this).attr("dvalue"))?"selected":"")+'>'+(items[i].title)+'</option>';
43
+ }
44
+ }
45
+ $(this).html(str);
46
+ });
47
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
48
+ },
49
+ showSpecialDataInstance: function()
50
+ {
51
+ return '<div class="column"><label>Min length/characters</label><br /><input name="sMinlength" id="sMinlength" value="'+$.fbuilder.htmlEncode(this.minlength)+'"></div><div class="column"><label>Max length/characters</label><br /><input name="sMaxlength" id="sMaxlength" value="'+$.fbuilder.htmlEncode(this.maxlength)+'"></div><div class="clearer"></div>';
52
+ }
53
+ });
js/fields-admin/11_fbuilder.fphone.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fPhone",
4
+ name:"Phone field",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fPhone' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fPhone' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Phone",
14
+ ftype:"fPhone",
15
+ required:false,
16
+ readonly:false,
17
+ dformat:"### ### ####",
18
+ predefined:"888 888 8888",
19
+ display:function()
20
+ {
21
+ var str = "";
22
+ var tmp = this.dformat.split(' ');
23
+ var tmpv = this.predefined.split(' ');
24
+ for (var i=0;i<tmpv.length;i++)
25
+ {
26
+ if ($.trim(tmpv[i])=="")
27
+ {
28
+ tmpv.splice(i,1);
29
+ }
30
+ }
31
+ for (var i=0;i<tmp.length;i++)
32
+ {
33
+ if ($.trim(tmp[i])!="")
34
+ {
35
+ str += '<div class="uh_phone" ><input type="text" class="field disabled" style="width:'+(15*$.trim(tmp[i]).length)+'px" value="'+((tmpv[i])?tmpv[i]:"")+'" maxlength="'+$.trim(tmp[i]).length+'" /><div class="l">'+$.trim(tmp[i])+'</div></div>';
36
+ }
37
+ }
38
+ 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">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
39
+ },
40
+ editItemEvents:function()
41
+ {
42
+ var evt = [{s:"#sFormat",e:"change keyup", l:"dformat"}];
43
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
44
+ },
45
+ showFormatIntance: function()
46
+ {
47
+ return '<div><label>Number Format</label><br /><input type="text" name="sFormat" id="sFormat" value="'+$.fbuilder.htmlEncode(this.dformat)+'" class="large" /></div>';
48
+ }
49
+ });
js/fields-admin/12_fbuilder.fcommentarea.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fCommentArea",
4
+ name:"Instruct. Text",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fCommentArea' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fCommentArea' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Comments here",
14
+ ftype:"fCommentArea",
15
+ userhelp:"A description of the section goes here.",
16
+ display:function()
17
+ {
18
+ 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+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
19
+ },
20
+ editItemEvents:function()
21
+ {
22
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this);
23
+ }
24
+ });
js/fields-admin/13_fbuilder.fhidden.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fhidden",
4
+ name:"Hidden",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fhidden' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fhidden' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Hidden",
14
+ ftype:"fhidden",
15
+ predefined:"",
16
+ display:function()
17
+ {
18
+ 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+'</label><span class="uh">'+this.predefined+'</span><div class="clearer"></div></div>';
19
+ },
20
+ editItemEvents:function()
21
+ {
22
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this);
23
+ },
24
+ showTitle: function(f)
25
+ {
26
+ return '<div><label>Field Label</label><textarea class="large" name="sTitle" id="sTitle">'+this.title+'</textarea><span class="uh">The field label is only for the admin section, never for the public page</span></div>';
27
+ },
28
+ showUserhelp:function(){ return ''; },
29
+ showPredefined: function()
30
+ {
31
+ return '<div><label>Value</label><textarea class="large" name="sPredefined" id="sPredefined">'+this.predefined+'</textarea></div>';
32
+ }
33
+ });
js/fields-admin/14_fbuilder.fsectionbreak.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fSectionBreak",
4
+ name:"Section break",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fSectionBreak' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fSectionBreak' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Section Break",
14
+ ftype:"fSectionBreak",
15
+ userhelp:"A description of the section goes here.",
16
+ display:function()
17
+ {
18
+ 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><div class="section_break"></div><label>'+this.title+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
19
+ },
20
+ editItemEvents:function()
21
+ {
22
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this);
23
+ }
24
+ });
js/fields-admin/15_fbuilder.fpagebreak.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fPageBreak",
4
+ name:"Page break",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fPageBreak' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fPageBreak' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Page Break",
14
+ ftype:"fPageBreak",
15
+ display:function()
16
+ {
17
+ 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><div class="section_break"></div><label>'+this.title+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
18
+ },
19
+ editItemEvents:function()
20
+ {
21
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this);
22
+ },
23
+ showTitle: function(){ return ''; },
24
+ showName: function(){ return ''; },
25
+ showShortLabel: function(){ return ''; },
26
+ showUserhelp: function(){ return ''; },
27
+ showCsslayout: function(){ return ''; }
28
+ });
js/fields-admin/16_fbuilder.fsummary.js ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fsummary",
4
+ name:"Summary",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fsummary' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fsummary' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Summary",
14
+ ftype:"fsummary",
15
+ fields:"",
16
+ titleClassname:"summary-field-title",
17
+ valueClassname:"summary-field-value",
18
+ display:function()
19
+ {
20
+ 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"><span class="field">'+this.fields+'</span></div><div class="clearer"></div></div>';
21
+ },
22
+ editItemEvents:function()
23
+ {
24
+ var evt = [
25
+ {s:"#sFields",e:"change keyup", l:"fields"},
26
+ {s:"#sTitleClassname",e:"change keyup", l:"titleClassname"},
27
+ {s:"#sValueClassname",e:"change keyup", l:"valueClassname"},
28
+ {s:"#sPlusBtn",e:"click", l:"fields",f:function(){
29
+ var v = $( "#sSelectedField" ).val(),
30
+ e = $( "#sFields" ),
31
+ f = $.trim( e.val() );
32
+ f += ((f!='')?',':'')+v;
33
+ e.val(f)
34
+ return f;
35
+ }
36
+ }
37
+ ];
38
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
39
+ },
40
+ showAllSettings:function()
41
+ {
42
+ return this.showTitle()+this.showSummaryFields()+this.showCsslayout();
43
+ },
44
+ showSummaryFields: function()
45
+ {
46
+ var str = '',
47
+ items = this.fBuild.getItems();
48
+
49
+ str += '<div><label>Fields to display on summary</label><br /><input name="sFields" id="sFields" class="large" value="'+$.fbuilder.htmlEncode(this.fields)+'"></div><div class="clearer"></div>';
50
+
51
+ str += '<div><label>Select field and press the plus button</label><br /><select name="sSelectedField" id="sSelectedField" style="width:80%;">';
52
+ for ( var i=0; i<items.length; i++ )
53
+ {
54
+ str += '<option value="'+items[i].name+'">'+( ( typeof items[i].title != 'undefined' ) ? items[i].title : '' )+'('+items[i].name+')'+'</option>';
55
+ }
56
+ str += '</select><input type="button" value="+" name="sPlusBtn" id="sPlusBtn" style="padding:3px 10px;" /></div><div class="clearer"></div>';
57
+
58
+ str += '<div><label>Classname for fields titles</label><br /><input class="large" name="sTitleClassname" id="sTitleClassname" value="'+$.fbuilder.htmlEncode(this.titleClassname)+'"></div><div class="clearer"></div>';
59
+ str += '<div><label>Classname for fields values</label><br /><input class="large" name="sValueClassname" id="sValueClassname" value="'+$.fbuilder.htmlEncode(this.valueClassname)+'"></div><div class="clearer"></div>';
60
+
61
+ return str;
62
+ }
63
+ });
js/fields-admin/28_fbuilder.fcontainer.js ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fcontainer' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fcontainer' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ fields:[],
7
+ columns:1,
8
+ editItemEvents:function()
9
+ {
10
+ var evt=[{s:"#sColumns",e:"change", l:"columns"}];
11
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
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()
26
+ {
27
+ var fieldsIndex = this.fBuild.getFieldsIndex();
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
+ {
37
+ if( this.fields[ i ] == currentField )
38
+ {
39
+ this.fields.splice( i+1, 0, newField );
40
+ return;
41
+ }
42
+ }
43
+ },
44
+ addItem: function( newField, afterField )
45
+ {
46
+ if( typeof afterField != 'undefined' )
47
+ {
48
+ for( var i = 0, h = this.fields.length; i < h; i++ )
49
+ {
50
+ if( this.fields[ i ] == afterField )
51
+ {
52
+ this.fields.splice( i+1, 0, newField );
53
+ return;
54
+ }
55
+ }
56
+ }
57
+ this.fields.push( newField );
58
+ },
59
+ after_show:function()
60
+ {
61
+ var me = this,
62
+ e = $( '#field' + me.form_identifier + '-' + me.index + ' .fieldscontainer' ),
63
+ tmp = [],
64
+ items = me.fBuild.getItems(),
65
+ fieldsIndex = me.fBuild.getFieldsIndex();
66
+
67
+ for( var i = 0, h = me.fields.length; i < h; i++ )
68
+ {
69
+ if( typeof fieldsIndex[ me.fields[ i ] ] != 'undefined' )
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');
94
+ if( p.length && $(this ).parents( '.fields' ).attr( 'id' ) == p.attr( 'id' ) )
95
+ {
96
+ // receive or or changing the ordering in the fieldscontainer
97
+ me.fields = [];
98
+ $( event.target ).children( '.fields' )
99
+ .each( function()
100
+ {
101
+ me.fields.push( /((fieldname)|(separator))\d+/.exec( $(this).attr( 'class' ) )[ 0 ] );
102
+ } );
103
+ $.fbuilder.reloadItems();
104
+ $( '.'+/((fieldname)|(separator))\d+/.exec( ui.item.attr( 'class' ) )[ 0 ] ).click();
105
+ }
106
+ else
107
+ {
108
+ // remove
109
+ var index = $.inArray( me.fBuild.getItems()[ ui.item.attr( 'id' ).replace( 'field-', '' ) ].name, me.fields );
110
+ if( index != -1 ) me.fields.splice( index, 1 );
111
+ }
112
+ }
113
+ }
114
+ );
115
+ }
116
+ });
js/fields-admin/29_fbuilder.ffieldset.fc.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"ffieldset",
4
+ name:"Fieldset",
5
+ control_category:10
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'ffieldset' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'ffieldset' ].prototype,
11
+ $.fbuilder.controls[ 'fcontainer' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"ffieldset",
15
+ fields:[],
16
+ columns:1,
17
+ collapsed:false,
18
+ display:function()
19
+ {
20
+ return '<div class="fields '+this.name+((this.collapsed) ? ' collapsed' : '')+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Collapse" class="collapse ui-icon ui-icon-folder-collapsed "></div><div title="Uncollapse" class="uncollapse ui-icon ui-icon-folder-open "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><div class="dfield"><FIELDSET class="fcontainer">'+( ( !/^\s*$/.test( this.title ) ) ? '<LEGEND>'+this.title+'</LEGEND>' : '' )+'<label class="collapsed-label">Collapsed ['+this.name+']</label><div class="fieldscontainer"></div></FIELDSET></div><div class="clearer"></div></div>';
21
+ },
22
+ editItemEvents:function()
23
+ {
24
+ $.fbuilder.controls[ 'fcontainer' ].prototype.editItemEvents.call(this);
25
+ },
26
+ remove : function()
27
+ {
28
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.remove.call(this);
29
+ },
30
+ duplicateItem: function( currentField, newField )
31
+ {
32
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.duplicateItem.call( this, currentField, newField );
33
+ },
34
+ after_show:function()
35
+ {
36
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.after_show.call(this);
37
+ }
38
+ });
js/fields-admin/30_fbuilder.fdiv.fc.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fdiv",
4
+ name:"Div",
5
+ control_category:10
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fdiv' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fdiv' ].prototype,
11
+ $.fbuilder.controls[ 'fcontainer' ].prototype,
12
+ {
13
+ title: 'div',
14
+ ftype:"fdiv",
15
+ fields:[],
16
+ columns:1,
17
+ collapsed:false,
18
+ display:function()
19
+ {
20
+ return '<div class="fields '+this.name+((this.collapsed) ? ' collapsed' : '')+'" id="field'+this.form_identifier+'-'+this.index+'" title="'+this.name+'"><div class="arrow ui-icon ui-icon-play "></div><div title="Collapse" class="collapse ui-icon ui-icon-folder-collapsed "></div><div title="Uncollapse" class="uncollapse ui-icon ui-icon-folder-open "></div><div title="Delete" class="remove ui-icon ui-icon-trash "></div><div title="Duplicate" class="copy ui-icon ui-icon-copy "></div><div class="dfield"><div class="fcontainer"><label class="collapsed-label">Collapsed ['+this.name+']</label><div class="fieldscontainer"></div></div></div><div class="clearer"></div></div>';
21
+ },
22
+ showTitle:function(){ return ''; },
23
+ editItemEvents:function()
24
+ {
25
+ $.fbuilder.controls[ 'fcontainer' ].prototype.editItemEvents.call(this);
26
+ },
27
+ remove : function()
28
+ {
29
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.remove.call(this);
30
+ },
31
+ duplicateItem: function( currentField, newField )
32
+ {
33
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.duplicateItem.call( this, currentField, newField );
34
+ },
35
+ after_show:function()
36
+ {
37
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.after_show.call(this);
38
+ }
39
+ });
js/fields-admin/31_fbuilder.fmedia.js ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fMedia",
4
+ name:"Media",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fMedia' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fMedia' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ ftype:"fMedia",
14
+ sMediaType:"image", // image, audio, video
15
+ init : function()
16
+ {
17
+ this.data = {
18
+ image:{
19
+ sWidth:"",
20
+ sHeight:"",
21
+ sSrc:"",
22
+ sAlt:"",
23
+ sLink:"",
24
+ sTarget:"",
25
+ sFigcaption: ""
26
+ },
27
+ audio:{
28
+ sWidth:"",
29
+ sSrc:"",
30
+ sSrcAlt:"",
31
+ sControls:1,
32
+ sLoop:0,
33
+ sAutoplay:0,
34
+ sMuted:0,
35
+ sPreload: "auto",
36
+ sFallback: "",
37
+ sFigcaption: ""
38
+ },
39
+ video:{
40
+ sWidth:"",
41
+ sHeight:"",
42
+ sSrc:"",
43
+ sSrcAlt:"",
44
+ sPoster:"",
45
+ sControls:1,
46
+ sLoop:0,
47
+ sAutoplay:0,
48
+ sMuted:0,
49
+ sPreload: "auto",
50
+ sFallback: "",
51
+ sFigcaption: ""
52
+ }
53
+ };
54
+ },
55
+ _display_image: function()
56
+ {
57
+ var d = this.data.image,
58
+ esc = $.fbuilder.htmlEncode,
59
+ a = [],
60
+ l = [],
61
+ r = '';
62
+
63
+ if( $.trim( d.sWidth ) ) a.push( 'width="'+esc( d.sWidth )+'"' );
64
+ if( $.trim( d.sHeight ) ) a.push( 'height="'+esc( d.sHeight )+'"' );
65
+ if( $.trim( d.sSrc ) ) a.push( 'src="'+esc( d.sSrc )+'"' );
66
+ if( $.trim( d.sAlt ) ) a.push( 'alt="'+esc( d.sAlt )+'"' );
67
+ if( $.trim( d.sLink ) )
68
+ {
69
+ l.push( 'href="'+esc( d.sLink )+'"' );
70
+ if( $.trim( d.sTarget ) ) l.push( 'target="'+esc( d.sTarget )+'"' );
71
+ r = '<a '+l.join( ' ' )+' ><img '+a.join( ' ' )+' /></a>';
72
+ }
73
+ else
74
+ {
75
+ r = '<img '+a.join( ' ' )+' />';
76
+ }
77
+
78
+ return r;
79
+ },
80
+ _display_audio_video: function( d, isV )
81
+ {
82
+ var esc = $.fbuilder.htmlEncode,
83
+ a = [],
84
+ t = ( isV ) ? 'video' : 'audio' ;
85
+
86
+ if( $.trim( d.sWidth ) ) a.push( 'width="'+esc( d.sWidth )+'"' );
87
+ if( isV && $.trim( d.sHeight ) ) a.push( 'height="'+esc( d.sHeight )+'"' );
88
+ if( isV && $.trim( d.sPoster ) ) a.push( 'poster="'+esc( d.sPoster )+'"' );
89
+ if( $.trim( d.sSrc ) ) a.push( 'src="'+esc( d.sSrc )+'"' );
90
+ if( d.sAutoplay ) a.push( 'autoplay' );
91
+ if( d.sControls ) a.push( 'controls' );
92
+ if( d.sLoop ) a.push( 'loop' );
93
+ if( d.sMuted ) a.push( 'muted' );
94
+ a.push( 'preload="'+esc( d.sPreload )+'"' );
95
+
96
+ return '<'+t+' '+a.join( ' ' )+'>'+( ( $.trim( d.sSrcAlt ) ) ? '<source src="'+esc( d.sSrcAlt )+'" />' : '' )+'<p>'+d.sFallback+'</p></'+t+'>';
97
+ },
98
+ _display_audio: function()
99
+ {
100
+ return this._display_audio_video( this.data.audio, false );
101
+ },
102
+ _display_video: function()
103
+ {
104
+ return this._display_audio_video( this.data.video, true );
105
+ },
106
+ display:function()
107
+ {
108
+ return '<div class="fields fmark '+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[ '_display_' + this.sMediaType ]()+'</label><span class="uh">'+this.data[ this.sMediaType ][ 'sFigcaption' ]+'</span><div class="clearer"></div></div>';
109
+ },
110
+ editItemEvents:function()
111
+ {
112
+ var me = this;
113
+ $("#sMediaBtn").bind("click", function(e)
114
+ {
115
+ me._loadMedia( 'sSrc', me.sMediaType );
116
+ });
117
+ $("#sMediaAltBtn").bind("click", function(e)
118
+ {
119
+ me._loadMedia( 'sSrcAlt', me.sMediaType );
120
+ });
121
+ $("#sPosterBtn").bind("click", function(e)
122
+ {
123
+ me._loadMedia( 'sPoster', 'image' );
124
+ });
125
+ $("[name='sMediaType']").bind("click", {obj: this}, function(e)
126
+ {
127
+ e.data.obj[ this.name ] = $(this).val();
128
+ $.fbuilder.editItem( e.data.obj.index );
129
+ $.fbuilder.reloadItems({'field':e.data.obj});
130
+ });
131
+ $("#sControls,#sLoop,#sAutoplay,#sMuted").bind("click", {obj: this}, function(e)
132
+ {
133
+ e.data.obj[ 'data' ][ e.data.obj[ 'sMediaType' ] ][ this.id ] = ( this.checked ) ? 1 : 0;
134
+ $.fbuilder.reloadItems({'field':e.data.obj});
135
+ });
136
+ $("#sWidth,#sHeight,#sSrc,#sSrcAlt,#sPoster,#sAlt,#sLink,#sTarget,#sFallback,#sFigcaption,#sPreload").bind("change keyup", {obj: this}, function(e)
137
+ {
138
+ e.data.obj[ 'data' ][ e.data.obj[ 'sMediaType' ] ][ this.id ] = $(this).val();
139
+ $.fbuilder.reloadItems({'field':e.data.obj});
140
+ });
141
+
142
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this);
143
+ },
144
+ showSpecialDataInstance: function()
145
+ {
146
+ return this._showMediaList() + this._showSettingsBox();
147
+ },
148
+ _showMediaList: function()
149
+ {
150
+ var l = [ 'image', 'audio', 'video' ],
151
+ r = "", v;
152
+
153
+ for( var i = 0, h = l.length; i < h; i++ )
154
+ {
155
+ v = l[ i ];
156
+ r += '<label style="margin-right:10px;"><input type="radio" name="sMediaType" value="' + v + '" ' + ( ( this.sMediaType == v ) ? 'CHECKED' : '' ) + ' >' + v + '</label>';
157
+ }
158
+ return '<div><label>Select media type</label><br/>' + r + '</div>';
159
+ },
160
+ _loadMedia: function( f, type )
161
+ {
162
+ var src_field = $( '#'+f ),
163
+ media = wp.media({
164
+ title: 'Select Source',
165
+ button: {
166
+ text: 'Select Source'
167
+ },
168
+ multiple: false
169
+ }).on('select',
170
+ (function( field, type ){
171
+ return function() {
172
+ var regExp = new RegExp( type, 'i'),
173
+ attachment = media.state().get('selection').first().toJSON();
174
+ if( !regExp.test( attachment.mime ) )
175
+ {
176
+ alert( 'Invalid mime type' );
177
+ return;
178
+ }
179
+ field.val( attachment.url ).change();
180
+ };
181
+ })( src_field, type )
182
+ ).open();
183
+ return false;
184
+ },
185
+ _showSettingsBox: function()
186
+ {
187
+ var d = this.data[ this.sMediaType ];
188
+ return '<div class="groupBox">' + this[ '_showSettings_'+this.sMediaType ]( d ) + '</div>';
189
+ },
190
+ _showSettings_image: function( d )
191
+ {
192
+ var r = '',
193
+ esc = $.fbuilder.htmlEncode;
194
+ r = '<label>Width</label><input type="text" class="large" name="sWidth" id="sWidth" value="'+esc(d.sWidth)+'">';
195
+ r += '<label>Height</label><input type="text" class="large" name="sHeight" id="sHeight" value="'+esc(d.sHeight)+'">';
196
+ r += '<label>Source</label><div><input type="text" style="width:70%;" name="sSrc" id="sSrc" value="'+esc(d.sSrc)+'"><input id="sMediaBtn" type="button" value="Browse" style="width:28%;" /></div>';
197
+ r += '<label>Alternate</label><input type="text" class="large" name="sAlt" id="sAlt" value="'+esc(d.sAlt)+'">';
198
+ r += '<label>Figcaption</label><input type="text" class="large" name="sFigcaption" id="sFigcaption" value="'+esc(d.sFigcaption)+'">';
199
+ r += '<label>Link</label><input type="text" class="large" name="sLink" id="sLink" value="'+esc(d.sLink)+'">';
200
+ r += '<label>Target</label><input type="text" class="large" name="sTarget" id="sTarget" value="'+esc(d.sTarget)+'" /><span class="uh">_blank, _new, _parent, _self, _top</span>';
201
+ return r;
202
+ },
203
+ _showSettings_audio_video: function( d, isV )
204
+ {
205
+ var r = '',
206
+ esc = $.fbuilder.htmlEncode;
207
+ r = '<label>Width</label><input type="text" class="large" name="sWidth" id="sWidth" value="'+esc(d.sWidth)+'">';
208
+
209
+ if( isV )
210
+ r += '<label>Height</label><input type="text" class="large" name="sHeight" id="sHeight" value="'+esc(d.sHeight)+'">';
211
+
212
+ r += '<label>Source</label><div><input type="text" style="width:70%;" name="sSrc" id="sSrc" value="'+esc(d.sSrc)+'"><input id="sMediaBtn" type="button" value="Browse" style="width:28%;" /></div>';
213
+
214
+ if( isV )
215
+ r += '<label>Poster</label><div><input type="text" style="width:70%;" name="sPoster" id="sPoster" value="'+esc(d.sPoster)+'"><input id="sPosterBtn" type="button" value="Browse" style="width:28%;" /></div>';
216
+
217
+ r += '<label>Alternative Source</label><div><input type="text" style="width:70%;" name="sSrcAlt" id="sSrcAlt" value="'+esc(d.sSrcAlt)+'"><input id="sMediaAltBtn" type="button" value="Browse" style="width:28%;" /></div>';
218
+ r += '<input type="checkbox" name="sControls" id="sControls" value="1" '+( ( d.sControls ) ? 'CHECKED' : '')+'><label>Controls</label><br />';
219
+ r += '<input type="checkbox" name="sLoop" id="sLoop" value="1" '+( ( d.sLoop ) ? 'CHECKED' : '')+'><label>Loop</label><br />';
220
+ r += '<input type="checkbox" name="sAutoplay" id="sAutoplay" value="1" '+( ( d.sAutoplay ) ? 'CHECKED' : '')+'><label>Autoplay</label><br />';
221
+ r += '<input type="checkbox" name="sMuted" id="sMuted" value="1" '+( ( d.sMuted ) ? 'CHECKED' : '')+'><label>Muted</label><br />';
222
+ var s = '',
223
+ l = [ 'none', 'auto', 'metadata' ];
224
+ for( var i = 0; i < 3; i++ )
225
+ {
226
+ s += '<option value="' + l[ i ] + '" ' + ( ( l[ i ] == d.sPreload ) ? 'SELECTED' : '' ) + '>' + l[ i ] + '</option>';
227
+ }
228
+ r += '<label>Preload</label><select class="large" name="sPreload" id="sPreload">'+s+'</select>';
229
+ r += '<label>Fallback Text</label><input type="text" class="large" name="sFallback" id="sFallback" value="'+esc(d.sFallback)+'">';
230
+ r += '<label>Figcaption</label><input type="text" class="large" name="sFigcaption" id="sFigcaption" value="'+esc(d.sFigcaption)+'">';
231
+ return r;
232
+ },
233
+ _showSettings_audio: function( d )
234
+ {
235
+ return this._showSettings_audio_video( d, false );
236
+ },
237
+ _showSettings_video: function( d )
238
+ {
239
+ return this._showSettings_audio_video( d, true );
240
+ },
241
+ showTitle: function(){ return ''; },
242
+ showShortLabel: function(){ return ''; },
243
+ showUserhelp: function(){ return ''; }
244
+ });
js/fields-admin/32_fbuilder.fbutton.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fButton",
4
+ name:"Button",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fButton' ]=function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fButton' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ ftype:"fButton",
14
+ sType:"button", // button, reset, calculate
15
+ sValue:"button",
16
+ sOnclick:"",
17
+ userhelp:"A description of the section goes here.",
18
+ display:function()
19
+ {
20
+ 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><input type="button" disabled value="'+$.fbuilder.htmlEncode(this.sValue)+'"><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
21
+ },
22
+ editItemEvents:function()
23
+ {
24
+ var evt=[
25
+ {s:"#sValue",e:"change keyup", l:"sValue"},
26
+ {s:"#sOnclick",e:"change keyup", l:"sOnclick"},
27
+ {s:"[name='sType']",e:"click", l:"sType"}
28
+ ];
29
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
30
+ },
31
+ showSpecialDataInstance: function()
32
+ {
33
+ return this._showTypeSettings() + this._showValueSettings() + this._showOnclickSettings();
34
+ },
35
+ _showTypeSettings: function()
36
+ {
37
+ var l = [ 'reset', 'button', 'calculate' ],
38
+ r = "", v;
39
+
40
+ for( var i = 0, h = l.length; i < h; i++ )
41
+ {
42
+ v = l[ i ];
43
+ r += '<label style="margin-right:10px;"><input type="radio" name="sType" value="' + v + '" ' + ( ( this.sType == v ) ? 'CHECKED' : '' ) + ' >' + v + '</label>';
44
+ }
45
+ return '<div><label>Select button type</label><br/>' + r + '</div>';
46
+ },
47
+ _showValueSettings: function()
48
+ {
49
+ return '<label>Value</label><input type="text" class="large" name="sValue" id="sValue" value="'+$.fbuilder.htmlEncode(this.sValue)+'" />';
50
+ },
51
+ _showOnclickSettings: function()
52
+ {
53
+ return '<label>OnClick event</label><textarea class="large" name="sOnclick" id="sOnclick">'+this.sOnclick+'</textarea>';
54
+ },
55
+ showTitle: function(){ return ''; },
56
+ showShortLabel: function(){ return ''; }
57
+ });
js/fields-admin/34_fbuilder.fhtml.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fhtml",
4
+ name:"HTML content",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fhtml' ]=function(){ this.init(); };
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fhtml' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ ftype:"fhtml",
14
+ fcontent: "",
15
+ display:function()
16
+ {
17
+ return '<div class="fields '+this.name+' fhtml" 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/>' ).html( this.fcontent ).find( 'script,style' ).remove().end().html()+'<div class="clearer"></div></div>';
18
+ },
19
+ editItemEvents:function()
20
+ {
21
+ var evt=[{s:"#sContent",e:"change keyup", l:"fcontent"}];
22
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this,evt);
23
+ },
24
+ showContent:function()
25
+ {
26
+ return '<label>HTML Content</label><textarea class="large" name="sContent" id="sContent" style="height:150px;">'+$( '<div/>' ).text( this.fcontent ).html()+'</textarea>';
27
+ },
28
+ showAllSettings:function()
29
+ {
30
+ return this.showFieldType()+this.showName()+this.showContent()+this.showCsslayout();
31
+ }
32
+ }
33
+ );
js/fields-admin/36_fbuilder.acceptance.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"facceptance",
4
+ name:"Acceptance (GDPR)",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'facceptance' ] = function(){};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'facceptance' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Accept terms and conditions",
14
+ ftype:"facceptance",
15
+ value:"I accept",
16
+ url:"",
17
+ message:"",
18
+ required:true,
19
+ display:function()
20
+ {
21
+ var str = '<div class="one_column"><input class="field" disabled="true" type="checkbox"/> '+this.title+((this.required)?"*":"")+'</div>';
22
+ 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><div class="dfield">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
23
+ },
24
+ editItemEvents:function()
25
+ {
26
+ var me = this;
27
+ evt = [
28
+ {s:"#sValue",e:"change keyup", l:"value"},
29
+ {s:"#sURL",e:"change keyup", l:"url"},
30
+ {s:"#sMessage",e:"change keyup", l:"message"}
31
+ ];
32
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
33
+ },
34
+ showRequired: function(v)
35
+ {
36
+ return '<div><input type="checkbox" checked disabled><label>Acceptance fields are always required</label></div>';
37
+ },
38
+ showUserhelp: function(){ return ''; },
39
+ showValue:function()
40
+ {
41
+ return '<div><label>Value</label><input class="large" type="text" name="sValue" id="sValue" value="'+$.fbuilder.htmlEncode(this.value)+'"></div>';
42
+ },
43
+ showURL:function()
44
+ {
45
+ return '<div><label>URL to the Consent and Acknowledgement page</label><input class="large" type="text" name="sURL" id="sURL" value="'+$.fbuilder.htmlEncode(this.url)+'"></div>';
46
+ },
47
+ showMessage:function()
48
+ {
49
+ return '<div><label>- or - enter the Consent and Acknowledgement text</label><textarea class="large" name="sMessage" id="sMessage" style="height:150px;">'+this.message+'</textarea></div>';
50
+ },
51
+ showCsslayout:function()
52
+ {
53
+ var str = '<div style="color: #666;border: 1px solid #EF7E59;display: block;padding: 5px;background: #FBF0EC;border-radius: 4px;text-align: center;margin-top:20px;">The Acceptance control helps to make the form comply with one of requirements of the General Data Protection Regulation (GDPR)</div>';
54
+
55
+ return $.fbuilder.controls[ 'ffields' ].prototype.showCsslayout.call(this)+str;
56
+ },
57
+ showSpecialDataInstance: function()
58
+ {
59
+ return this.showValue()+this.showURL()+this.showMessage();
60
+ }
61
+ });
js/fields-admin/fbuilder.fcalculated.js ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.typeList.push(
2
+ {
3
+ id:"fCalculated",
4
+ name:"Calculated Field",
5
+ control_category:1
6
+ }
7
+ );
8
+ $.fbuilder.controls[ 'fCalculated' ]=function(){this.dependencies = [{'rule':'', 'complex':false, 'fields':['']}];};
9
+ $.extend(
10
+ $.fbuilder.controls[ 'fCalculated' ].prototype,
11
+ $.fbuilder.controls[ 'ffields' ].prototype,
12
+ {
13
+ title:"Untitled",
14
+ ftype:"fCalculated",
15
+ predefined:"",
16
+ required:false,
17
+ size:"medium",
18
+ toolbar:"default|mathematical",
19
+ eq:"",
20
+ suffix:"",
21
+ prefix:"",
22
+ decimalsymbol:".",
23
+ groupingsymbol:"",
24
+ readonly:true,
25
+ hidefield:false,
26
+ init:function()
27
+ {
28
+ if( typeof this[ 'eq_factored' ] != 'undefined' ) this[ 'eq_factored' ] = "";
29
+ },
30
+ display:function()
31
+ {
32
+ this.init();
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"><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>';
34
+ },
35
+ editItemEvents:function()
36
+ {
37
+ var evt=[
38
+ {s:"#sSuffix",e:"change keyup", l:"suffix"},
39
+ {s:"#sPrefix",e:"change keyup", l:"prefix"},
40
+ {s:"#sDecimalSymbol",e:"change keyup", l:"decimalsymbol"},
41
+ {s:"#sGroupingSymbol",e:"change keyup", l:"groupingsymbol"},
42
+ {s:"#sHideField",e:"click", l:"hidefield", f:function(el){return el.is(':checked');}},
43
+ {s:"#sSize",e:"change", l:"size"}
44
+ ];
45
+ $("#sEq").bind("change keyup", {obj: this}, function(e)
46
+ {
47
+ if( $.inArray( e.keyCode, [16,17,18,27,37,38,39,40] ) == -1 )
48
+ {
49
+ e.data.obj.eq = $(this).val();
50
+ $.fbuilder.reloadItems({'field':e.data.obj});
51
+ }
52
+ });
53
+ $('.displayWizard').bind("click", {obj: this}, function(e)
54
+ {
55
+ e.preventDefault();
56
+ var me = $( this ),
57
+ i = me.attr("i");
58
+ e.data.obj.dependencies[ i ].rule = '';
59
+ e.data.obj.dependencies[ i ].complex = false;
60
+ $.fbuilder.editItem( e.data.obj.index );
61
+ $.fbuilder.reloadItems({'field':e.data.obj});
62
+ });
63
+ $('.displayComplexRule').bind("click", {obj: this}, function(e)
64
+ {
65
+ e.preventDefault();
66
+ e.data.obj.dependencies[ $(this).attr( "i" ) ].complex = true;
67
+ $.fbuilder.editItem( e.data.obj.index );
68
+ $.fbuilder.reloadItems({'field':e.data.obj});
69
+ });
70
+ $( ".cf_dependence_operator" ).bind("change", {obj: this}, function(e)
71
+ {
72
+ var me = $(this),
73
+ i = me.attr("i"),
74
+ o = e.data.obj.dependencies[ i ];
75
+
76
+ o.rule = 'value'+me.val()+$(".cf_dependence_value[i='"+i+"']").val().replace(/'/g, "\'");
77
+ o.complex = false;
78
+ e.data.obj.dependencies[ me.attr("i") ].rule = o.rule;
79
+ $.fbuilder.reloadItems({'field':e.data.obj});
80
+ });
81
+ $( ".cf_dependence_value" ).bind("change keyup", {obj: this}, function(e)
82
+ {
83
+ var me = $(this),
84
+ i = me.attr("i"),
85
+ o = e.data.obj.dependencies[ i ];
86
+
87
+ o.rule = 'value'+$(".cf_dependence_operator[i='"+i+"']").val()+me.val();
88
+ o.complex = false;
89
+ e.data.obj.dependencies[ me.attr("i") ].rule = o.rule;
90
+ $.fbuilder.reloadItems({'field':e.data.obj});
91
+ });
92
+ $( ".cf_dependence_rule" ).bind("change keyup", {obj: this}, function(e)
93
+ {
94
+ var me = $(this);
95
+ e.data.obj.dependencies[ me.attr("i") ].rule = me.val();
96
+ e.data.obj.dependencies[ me.attr("i") ].complex = true;
97
+ $.fbuilder.reloadItems({'field':e.data.obj});
98
+ });
99
+ $( ".cf_dependence_field" ).bind("change", {obj: this}, function(e)
100
+ {
101
+ var me = $(this);
102
+ e.data.obj.dependencies[ me.attr("i") ].fields[ me.attr("j") ] = me.val();
103
+ $.fbuilder.reloadItems({'field':e.data.obj});
104
+ });
105
+ $( ".addDep" ).bind("click", {obj: this}, function(e)
106
+ {
107
+ var j = $(this).attr("j");
108
+ if( typeof j == 'undefined' )
109
+ {
110
+ e.data.obj.dependencies.splice($(this).attr("i")*1+1, 0, { 'rule' : '', 'complex' : false, 'fields' : [''] } );
111
+ }else
112
+ {
113
+ e.data.obj.dependencies[$(this).attr("i")].fields.splice( j+1, 0, "")
114
+ }
115
+
116
+ $.fbuilder.editItem( e.data.obj.index );
117
+ $.fbuilder.reloadItems({'field':e.data.obj});
118
+ });
119
+ $( ".removeDep" ).bind("click", {obj: this}, function(e)
120
+ {
121
+ var i = $(this).attr("i"),
122
+ j = $(this).attr("j");
123
+
124
+ if( typeof j != 'undefined' )
125
+ {
126
+ if( e.data.obj.dependencies[ i ].fields.length != 1 )
127
+ {
128
+ e.data.obj.dependencies[ i ].fields.splice( j, 1 );
129
+ }else
130
+ {
131
+ e.data.obj.dependencies[ i ].fields = [''];
132
+ }
133
+ }
134
+ else
135
+ {
136
+ if( e.data.obj.dependencies.length != 1 )
137
+ {
138
+ e.data.obj.dependencies.splice( i, 1 );
139
+ }
140
+ else
141
+ {
142
+ e.data.obj.dependencies[ 0 ] = { 'rule' : '', 'complex' : false, 'fields' : [''] };
143
+ }
144
+ }
145
+
146
+ $.fbuilder.editItem( e.data.obj.index );
147
+ $.fbuilder.reloadItems({'field':e.data.obj});
148
+ });
149
+ $.fbuilder.controls[ 'ffields' ].prototype.editItemEvents.call(this, evt);
150
+ },
151
+ showSpecialDataInstance: function()
152
+ {
153
+ return this.showHideField()+this.showEqEditor()+this.showDependencies();
154
+ },
155
+ showDependencies : function()
156
+ {
157
+ // Instance
158
+ var me = this;
159
+
160
+ function setOperator( indx, op )
161
+ {
162
+ var ops = [
163
+ {'text' : 'Equal to', 'value' : '=='},
164
+ {'text' : 'Not equal to', 'value' : '!='},
165
+ {'text' : 'Greater than', 'value' : '>'},
166
+ {'text' : 'Greater than or equal to', 'value' : '>='},
167
+ {'text' : 'Less than', 'value' : '<'},
168
+ {'text' : 'Less than or equal to', 'value' : '<='}
169
+ ],
170
+ r = '';
171
+
172
+ for( var i = 0, h = ops.length; i < h; i++)
173
+ {
174
+ r += '<option value="'+$.fbuilder.htmlEncode(ops[i]['value'])+'" '+( ( op == ops[i]['value'] ) ? 'SELECTED' : '' )+'>'+ops[i]['text']+'</option>';
175
+ }
176
+
177
+ return '<select i="'+$.fbuilder.htmlEncode(indx)+'" class="cf_dependence_operator">'+r+'</select>';
178
+ }
179
+
180
+ var r = '';
181
+ var items = this.fBuild.getItems();
182
+ $.each( this.dependencies, function ( i, o )
183
+ {
184
+ if( o.complex )
185
+ {
186
+ r += '<div><div style="position:relative;"><span style="font-weight:bold;">If value is</span><span class="cf_dependence_edition" i="'+i+'" ><input class="cf_dependence_rule" type="text" i="'+i+'" value="'+o.rule.replace(/"/g, '&quot;')+'" /></span><div class="choice-ctrls"><a class="addDep ui-icon ui-icon-circle-plus" i="'+i+'" title="Add another dependency."></a><a class="removeDep ui-icon ui-icon-circle-minus" i="'+i+'" title="Delete this dependency."></a></div><div style="text-align:right;position:relative;"><span style="float:left;">Ex: value==10</span><a href="#" class="displayWizard" i="'+i+'">Edit through wizard</a><br />(The rule entered will lost)</div></div>';
187
+ }
188
+ else
189
+ {
190
+ var operator = '',
191
+ value = '';
192
+
193
+ if( !/^\s*$/.test( o.rule ) )
194
+ {
195
+ var re = new RegExp( '^value([!=<>]+)(.*)$'),
196
+ parts = re.exec( o.rule );
197
+
198
+ operator = parts[1];
199
+ value = parts[2];
200
+ }
201
+
202
+ r += '<div><div style="position:relative;"><span style="font-weight:bold;">If value is</span><span class="cf_dependence_edition" i="'+i+'" >'+setOperator( i, operator )+' <input type="text" i="'+i+'" class="cf_dependence_value" value="'+value.replace(/"/g, '&quot;')+'" /></span><div class="choice-ctrls"><a class="addDep ui-icon ui-icon-circle-plus" i="'+i+'" title="Add another dependency."></a><a class="removeDep ui-icon ui-icon-circle-minus" i="'+i+'" title="Delete this dependency."></a></div><div style="text-align:right;"><a i="'+i+'" class="displayComplexRule" href="#">Edit rule manually</a></div></div>';
203
+ }
204
+
205
+ r += '<div>';
206
+ $.each( o.fields, function( j, v )
207
+ {
208
+
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
+ }
216
+ }
217
+ r += '<div style="position:relative;"><span>If rule is valid show:</span> <select class="cf_dependence_field" i="'+i+'" j="'+j+'" >'+opt+'</select><div class="choice-ctrls"><a class="addDep ui-icon ui-icon-circle-plus" i="'+i+'" j="'+j+'" title="Add another dependency."></a><a class="removeDep ui-icon ui-icon-circle-minus" i="'+i+'" j="'+j+'" title="Delete this dependency."></a></div></div>';
218
+ });
219
+ r += '</div>';
220
+ r += '</div>';
221
+ });
222
+
223
+ return '<label>Define dependencies</label><div class="dependenciesBox">'+r+'</div>';
224
+ },
225
+ showHideField:function()
226
+ {
227
+ return '<div><input type="checkbox" name="sHideField" id="sHideField" '+((this.hidefield)?"checked":"")+'><label>Hide Field From Public Page</label></div>';
228
+ },
229
+ showEqEditor:function(eq)
230
+ {
231
+ var me = this,
232
+ tools = $.fbuilder[ 'objName' ]+'.fbuilder.controls.fCalculated.tools';
233
+
234
+ $.fbuilder.controls[ 'fCalculated' ][ 'tools' ] = {
235
+ setField : function()
236
+ {
237
+ this.setSymbol( $( '#sFieldList' ).val() );
238
+ },
239
+ setSymbol : function(s)
240
+ {
241
+ var sEQ = $('#sEq');
242
+ if(sEQ.length)
243
+ {
244
+ var p = sEQ.caret(),
245
+ v = sEQ.val(),
246
+ nv;
247
+
248
+ sEQ.val(v.substr(0,p)+s+v.substr(p));
249
+ sEQ.caret(p+s.length);
250
+ me.eq = sEQ.val();
251
+ $.fbuilder.reloadItems({'field':me});
252
+ }
253
+ },
254
+ loadTutorial : function( toolbar )
255
+ {
256
+ var parts = toolbar.split('|'),
257
+ out = '';
258
+
259
+ if( $.fbuilder[ 'modules' ][ parts[ 0 ] ][ 'tutorial' ] )
260
+ {
261
+ out = '<input type="button" class="eq_btn" onclick="window.open(\'' + $.fbuilder[ 'modules' ][ parts[ 0 ] ][ 'tutorial' ] + '\');" value="?" title="Tutorial" />';
262
+ }
263
+ $('#sEqModuleTutorial').html( out );
264
+ return out;
265
+ },
266
+ loadToolbarList : function()
267
+ {
268
+ var out = '<select id="sToolbarList" onchange="'+tools+'.loadToolbar(this.options[this.selectedIndex].value);'+tools+'.loadTutorial(this.options[this.selectedIndex].value);">';
269
+
270
+ if( $.fbuilder[ 'modules' ] )
271
+ {
272
+ for( var m in $.fbuilder[ 'modules' ] )
273
+ {
274
+ var module = $.fbuilder[ 'modules' ][ m ];
275
+ for( var toolbar in module[ 'toolbars' ] )
276
+ {
277
+ out += '<option value="'+m+'|'+toolbar+'" '+( ( me.toolbar == m+'|'+toolbar) ? 'SELECTED' : '')+'>'+module[ 'toolbars' ][ toolbar ][ 'label' ]+'</options>';
278
+ }
279
+ }
280
+ }
281
+ out += '</select>';
282
+ return out;
283
+ },
284
+ loadToolbar : function( toolbar )
285
+ {
286
+ var parts = toolbar.split('|'),
287
+ out = '';
288
+
289
+ if( $.fbuilder[ 'modules' ][ parts[ 0 ] ][ 'toolbars' ][ parts[ 1 ] ] )
290
+ {
291
+ var buttons = $.fbuilder[ 'modules' ][ parts[ 0 ] ][ 'toolbars' ][ parts[ 1 ] ][ 'buttons' ];
292
+ for( var i = 0, h = buttons.length; i < h; i++ )
293
+ {
294
+ out += '<input type="button" value="'+buttons[ i ][ 'value' ]+'" onclick="'+tools+'.setSymbol(\''+buttons[ i ][ 'code' ]+'\');'+tools+'.setTip(\''+buttons[ i ][ 'tip' ]+'\');" class="eq_btn" />';
295
+ }
296
+ this.setTip( '' );
297
+ }
298
+
299
+ $( '#sEqButtonsContainer' ).html( out );
300
+ return out;
301
+ },
302
+ setTip : function( t )
303
+ {
304
+ if( !/^\s*$/.test( t ))
305
+ {
306
+ $('#sEqTipsContainer').html( t ).show();
307
+ }
308
+ else
309
+ {
310
+ $('#sEqTipsContainer').html( '' ).hide();
311
+ }
312
+ }
313
+ };
314
+
315
+ var out = '<label>Set Equation</label><textarea class="large" name="sEq" id="sEq" style="height:150px;">'+me.eq+'</textarea><label>Operands</label><div style="float:right;"><a href="javascript:window.open(\'http://wordpress.dwbooster.com/includes/calculated-field/equations.html\', \'_blak\');">Read an equation tutorial</a></div><div class="groupBox"><select id="sFieldList">';
316
+
317
+ var items = this.fBuild.getItems(),
318
+ invalidFields = { 'fSectionBreak':1, 'fPageBreak':1, 'fsummary':1, 'ffieldset':1, 'fdiv':1, 'fMedia':1, 'fButton':1, 'fhtml':1, 'ffile':1 };
319
+
320
+ for( var i in items )
321
+ {
322
+ var item = items[ i ];
323
+ if( item[ 'name' ] != this.name && typeof invalidFields[ item.ftype ] == 'undefined' )
324
+ {
325
+ var fName = item[ 'name' ],
326
+ fTitle = item[ 'title' ];
327
+
328
+ fName = fName.replace( /'/g, "\'" ).replace( /"/g, '\"' );
329
+ out += '<option value="' + fName + '">'+item[ 'name' ] + ( ( item[ 'title' ] && !/^\s*$/.test( item[ 'title' ] ) ) ? '('+item[ 'title' ] + ')' : '' ) + '</option>';
330
+ }
331
+ }
332
+ out += ' </select><input type="button" value="+" class="eq_btn" onclick="'+tools+'.setField();" /></div><label>Operators</label><div style="text-align:center;" class="groupBox"><div style="text-align:left;">'+$.fbuilder.controls[ 'fCalculated' ][ 'tools' ].loadToolbarList()+'<span id="sEqModuleTutorial">'+$.fbuilder.controls[ 'fCalculated' ][ 'tools' ].loadTutorial( me.toolbar )+'</span></div><div id="sEqButtonsContainer">'+$.fbuilder.controls[ 'fCalculated' ][ 'tools' ].loadToolbar( me.toolbar )+'</div><div id="sEqTipsContainer" style="background-color:#DFEFFF;border:1px solid #C2D7EF;padding:5px;margin:5px;display:none;text-align:left;"></div></div><label>Symbol to display at beginning of calculated field</label><input type="text" name="sPrefix" id="sPrefix" class="large" value="'+$.fbuilder.htmlEncode(me.prefix)+'" /><label>Symbol to display at the end of calculated field</label><input type="text" name="sSuffix" id="sSuffix" class="large" value="'+$.fbuilder.htmlEncode(me.suffix)+'" /><label>Decimals separator symbol (Ex: 25.20)</label><input type="text" name="sDecimalSymbol" id="sDecimalSymbol" class="large" value="'+$.fbuilder.htmlEncode(me.decimalsymbol)+'" /><label>Symbol for grouping thousands (Ex: 3,000,000)</label><input type="text" name="sGroupingSymbol" id="sGroupingSymbol" class="large" value="'+$.fbuilder.htmlEncode(me.groupingsymbol)+'" />';
333
+
334
+ return out;
335
+ }
336
+ });
js/fields-public/01_fbuilder.ftext.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'ftext' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'ftext' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"ftext",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ readonly:false,
12
+ size:"medium",
13
+ minlength:"",
14
+ maxlength:"",
15
+ equalTo:"",
16
+ regExp:"",
17
+ regExpMssg:"",
18
+ show:function()
19
+ {
20
+ this.minlength = $.fbuilder.htmlEncode($.trim(this.minlength));
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
+ {
28
+ if( this.regExp != "" && typeof $[ 'validator' ] != 'undefined' )
29
+ {
30
+ var parts = this.regExp.match(/(\/)(.*)(\/)([gimy]{0,4})$/i);
31
+ this.regExp = ( parts === null ) ? new RegExp(this.regExp) : new RegExp(parts[2],parts[4].toLowerCase());
32
+
33
+ $.validator.addMethod( 'pattern', function( value, element, param )
34
+ {
35
+ try{
36
+ return this.optional(element) || param.test( value );
37
+ }
38
+ catch(err){return true;}
39
+ }
40
+ );
41
+ $('#'+this.name).rules('add',{'pattern':this.regExp, messages:{'pattern':this.regExpMssg}});
42
+ }
43
+ },
44
+ val:function()
45
+ {
46
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
47
+ if( e.length ) return $.fbuilder.parseValStr( e.val() );
48
+ return 0;
49
+ }
50
+ }
51
+ );
js/fields-public/02_fbuilder.fcurrency.js ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fcurrency' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fcurrency' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Currency",
7
+ ftype:"fcurrency",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ readonly:false,
12
+ size:"small",
13
+ currencyText:"USD",
14
+ thousandSeparator:",",
15
+ centSeparator:".",
16
+ min:"",
17
+ max:"",
18
+ formatDynamically:false,
19
+
20
+ getFormattedValue:function( value )
21
+ {
22
+ this.centSeparator = $.trim(this.centSeparator);
23
+ if( /^\s*$/.test( this.centSeparator ) ) this.centSeparator = '.';
24
+
25
+ var v = $.trim( value ), parts = [], counter = 0, str = '', s = '';
26
+ v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencySymbol), 'g' ), '' )
27
+ .replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencyText), 'g' ), '' );
28
+ v = $.fbuilder.parseVal( v, this.thousandSeparator, this.centSeparator );
29
+ if( !isNaN( v ) )
30
+ {
31
+ if(v < 0) s = '-';
32
+ v = ABS(v);
33
+ parts = v.toString().split(".");
34
+
35
+ if( !/^\s*$/.test( this.thousandSeparator ) )
36
+ {
37
+ for( var i = parts[0].length-1; i >= 0; i--){
38
+ counter++;
39
+ str = parts[0][i] + str;
40
+ if( counter%3 == 0 && i != 0 ) str = this.thousandSeparator + str;
41
+
42
+ }
43
+ parts[0] = str;
44
+ }
45
+ if( typeof parts[ 1 ] != 'undefined' )
46
+ {
47
+ if(parts[ 1 ].length == 1) parts[ 1 ] += '0';
48
+ }
49
+ else parts[ 1 ] = '00';
50
+
51
+ return this.currencySymbol+s+parts.join( this.centSeparator )+this.currencyText;
52
+ }
53
+ else
54
+ {
55
+ return value;
56
+ }
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 '+this.dformat+' '+this.size+((this.required)?" required":"")+'" type="text" value="'+$.fbuilder.htmlEncode( this.getFormattedValue( this.predefined ) )+'" '+( ( !/^\s*$/.test( this.min) ) ? 'min="'+$.fbuilder.parseVal( this.min, this.thousandSeparator, this.centSeparator )+'" ' : '' )+( ( !/^\s*$/.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
+ {
64
+ if( this.formatDynamically )
65
+ {
66
+
67
+ var me = this;
68
+ $( document ).on( 'change', '[name="' + me.name + '"]', function(){
69
+ this.value = me.getFormattedValue( this.value );
70
+ } );
71
+ }
72
+
73
+ if( typeof $[ 'validator' ] != 'undefined' )
74
+ {
75
+ $.validator.addMethod( 'min', function( value, element, param )
76
+ {
77
+ var e = element;
78
+ if( element.id.match( /_\d+$/) )
79
+ {
80
+ e = $.fbuilder[ 'forms' ][ element.id.match( /_\d+$/)[ 0 ] ].getItem( element.name )
81
+ }
82
+ else if(
83
+ typeof $.fbuilder[ 'forms' ] != 'undefined' &&
84
+ typeof $.fbuilder[ 'forms' ][ '' ] != 'undefined'
85
+ )
86
+ {
87
+ e = $.fbuilder[ 'forms' ][ '' ].getItem( element.name )
88
+ }
89
+
90
+ var thousandSeparator = ( typeof e.thousandSeparator != 'undefined' ) ? e.thousandSeparator : '',
91
+ centSymbol = ( typeof e.centSeparator != 'undefined' && $.trim( e.centSeparator ) ) ? e.centSeparator : '.';
92
+
93
+ return this.optional(element) || $.fbuilder.parseVal( value, thousandSeparator, centSymbol ) >= param;
94
+ }
95
+ );
96
+
97
+ $.validator.addMethod( 'max', function( value, element, param )
98
+ {
99
+ var e = element;
100
+ if( element.id.match( /_\d+$/) )
101
+ {
102
+ e = $.fbuilder[ 'forms' ][ element.id.match( /_\d+$/)[ 0 ] ].getItem( element.name )
103
+ }
104
+ else if(
105
+ typeof $.fbuilder[ 'forms' ] != 'undefined' &&
106
+ typeof $.fbuilder[ 'forms' ][ '' ] != 'undefined'
107
+ )
108
+ {
109
+ e = $.fbuilder[ 'forms' ][ '' ].getItem( element.name )
110
+ }
111
+
112
+
113
+ var thousandSeparator = ( typeof e.thousandSeparator != 'undefined' ) ? e.thousandSeparator : '',
114
+ centSymbol = ( typeof e.centSeparator != 'undefined' && $.trim( e.centSeparator ) ) ? e.centSeparator : '.';
115
+
116
+ return this.optional(element) || $.fbuilder.parseVal( value, thousandSeparator, centSymbol ) <= param;
117
+ }
118
+ );
119
+
120
+ }
121
+ },
122
+ val:function()
123
+ {
124
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
125
+ if( e.length )
126
+ {
127
+ var v = $.trim( e.val() );
128
+
129
+ v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencySymbol), 'g' ), '' )
130
+ .replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.currencyText), 'g' ), '' );
131
+
132
+ return $.fbuilder.parseVal( v, this.thousandSeparator, this.centSeparator );
133
+ }
134
+ return 0;
135
+ }
136
+ }
137
+ );
js/fields-public/02_fbuilder.fnumber.js ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fnumber' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fnumber' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Number",
7
+ ftype:"fnumber",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ readonly:false,
12
+ size:"small",
13
+ thousandSeparator:"",
14
+ decimalSymbol:".",
15
+ min:"",
16
+ max:"",
17
+ formatDynamically:false,
18
+ dformat:"digits",
19
+ formats:new Array("digits","number"),
20
+ getFormattedValue:function( value )
21
+ {
22
+ this.decimalSymbol = $.trim(this.decimalSymbol);
23
+ if( /^\s*$/.test( this.decimalSymbol ) ) this.decimalSymbol = '.';
24
+ var v = $.trim( value ), s = '', counter = 0, str = '', parts = [];
25
+ v = $.fbuilder.parseVal( v, this.thousandSeparator, this.decimalSymbol );
26
+ if( !isNaN( v ) )
27
+ {
28
+ if(v < 0) s = '-';
29
+ v = ABS(v);
30
+ parts = v.toString().split(".");
31
+
32
+ if( !/^\s*$/.test( this.thousandSeparator ) )
33
+ {
34
+ for( var i = parts[0].length-1; i >= 0; i--){
35
+ counter++;
36
+ str = parts[0][i] + str;
37
+ if( counter%3 == 0 && i != 0 ) str = this.thousandSeparator + str;
38
+
39
+ }
40
+ parts[0] = str;
41
+ }
42
+ return s+parts.join( this.decimalSymbol );
43
+ }
44
+ else
45
+ {
46
+ return value;
47
+ }
48
+ },
49
+ show:function()
50
+ {
51
+ var _type = ( this.dformat == 'digits' || ( /^\s*$/.test( this.thousandSeparator ) && /^\s*\.\s*$/.test( this.decimalSymbol ) ) ) ? 'number' : 'text';
52
+
53
+ return '<div class="fields '+this.csslayout+' cff-number-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+'" '+( ( !/^\s*$/.test( this.min) ) ? 'min="'+$.fbuilder.parseVal( this.min, this.thousandSeparator, this.decimalSymbol )+'" ' : '' )+( ( !/^\s*$/.test( this.max) ) ? ' max="'+$.fbuilder.parseVal( this.max, this.thousandSeparator, this.decimalSymbol )+'" ' : '' )+' class="field '+this.dformat+' '+this.size+((this.required)?" required":"")+'" type="'+_type+'" value="'+$.fbuilder.htmlEncode(this.predefined)+'" '+((this.readonly)?'readonly':'')+' /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
54
+ },
55
+ after_show:function()
56
+ {
57
+ if( this.formatDynamically && this.dformat != 'digits' )
58
+ {
59
+
60
+ var me = this;
61
+ $( document ).on( 'change', '[name="' + me.name + '"]', function(){
62
+ this.value = me.getFormattedValue( this.value );
63
+ } );
64
+ }
65
+
66
+ if( typeof $[ 'validator' ] != 'undefined' )
67
+ {
68
+ $.validator.addMethod( 'number', function( value, element )
69
+ {
70
+ var e = element;
71
+ if( element.id.match( /_\d+$/) )
72
+ {
73
+ e = $.fbuilder[ 'forms' ][ element.id.match( /_\d+$/)[ 0 ] ].getItem( element.name )
74
+ }
75
+ else if(
76
+ typeof $.fbuilder[ 'forms' ] != 'undefined' &&
77
+ typeof $.fbuilder[ 'forms' ][ '' ] != 'undefined'
78
+ )
79
+ {
80
+ e = $.fbuilder[ 'forms' ][ '' ].getItem( element.name )
81
+ }
82
+
83
+ var thousandSeparator = ( typeof e.thousandSeparator != 'undefined' ) ? e.thousandSeparator : '',
84
+ decimalSymbol = ( typeof e.decimalSymbol != 'undefined' && $.trim( e.decimalSymbol ) ) ? e.decimalSymbol : '.';
85
+
86
+ var regExp = new RegExp( '^-?(?:\\d+|\\d{1,3}(?:' + $.fbuilder.escape_symbol( thousandSeparator ) + '\\d{3})+)?(?:' + $.fbuilder.escape_symbol( decimalSymbol ) + '\\d+)?$' );
87
+
88
+ return this.optional(element) || regExp.test( value ) || $.isNumeric(value);
89
+ }
90
+ );
91
+
92
+ $.validator.addMethod( 'min', function( value, element, param )
93
+ {
94
+ var e = element;
95
+ if( element.id.match( /_\d+$/) )
96
+ {
97
+ e = $.fbuilder[ 'forms' ][ element.id.match( /_\d+$/)[ 0 ] ].getItem( element.name )
98
+ }
99
+ else if(
100
+ typeof $.fbuilder[ 'forms' ] != 'undefined' &&
101
+ typeof $.fbuilder[ 'forms' ][ '' ] != 'undefined'
102
+ )
103
+ {
104
+ e = $.fbuilder[ 'forms' ][ '' ].getItem( element.name )
105
+ }
106
+
107
+ var thousandSeparator = ( typeof e.thousandSeparator != 'undefined' ) ? e.thousandSeparator : '',
108
+ decimalSymbol = ( typeof e.decimalSymbol != 'undefined' && $.trim( e.decimalSymbol ) ) ? e.decimalSymbol : '.';
109
+
110
+ return this.optional(element) || $.fbuilder.parseVal( value, thousandSeparator, decimalSymbol ) >= param;
111
+ }
112
+ );
113
+
114
+ $.validator.addMethod( 'max', function( value, element, param )
115
+ {
116
+ var e = element;
117
+ if( element.id.match( /_\d+$/) )
118
+ {
119
+ e = $.fbuilder[ 'forms' ][ element.id.match( /_\d+$/)[ 0 ] ].getItem( element.name )
120
+ }
121
+ else if(
122
+ typeof $.fbuilder[ 'forms' ] != 'undefined' &&
123
+ typeof $.fbuilder[ 'forms' ][ '' ] != 'undefined'
124
+ )
125
+ {
126
+ e = $.fbuilder[ 'forms' ][ '' ].getItem( element.name )
127
+ }
128
+
129
+ var thousandSeparator = ( typeof e.thousandSeparator != 'undefined' ) ? e.thousandSeparator : '',
130
+ decimalSymbol = ( typeof e.decimalSymbol != 'undefined' && $.trim( e.decimalSymbol ) ) ? e.decimalSymbol : '.';
131
+
132
+ return this.optional(element) || $.fbuilder.parseVal( value, thousandSeparator, decimalSymbol ) <= param;
133
+ }
134
+ );
135
+
136
+ }
137
+ },
138
+ val:function()
139
+ {
140
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
141
+ if( e.length )
142
+ {
143
+ var v = $.trim( e.val() );
144
+ return $.fbuilder.parseVal( v, this.thousandSeparator, this.decimalSymbol );
145
+ }
146
+ return 0;
147
+ }
148
+ }
149
+ );
js/fields-public/02_fbuilder.fslider.js ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fslider' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fslider' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Slider",
7
+ ftype:"fslider",
8
+ predefined:"",
9
+ predefinedMin:"",
10
+ predefinedMax:"",
11
+ predefinedClick:false,
12
+ size:"small",
13
+ thousandSeparator:",",
14
+ centSeparator:".",
15
+ min:0,
16
+ max:100,
17
+ step:1,
18
+ range:false,
19
+ minCaption:"",
20
+ maxCaption:"",
21
+ caption:"{0}",
22
+ init:function()
23
+ {
24
+ this.min = ( /^\s*$/.test( this.min ) ) ? 0 : parseFloat( $.trim( this.min ) );
25
+ this.max = ( /^\s*$/.test( this.max ) ) ? 100 : parseFloat( $.trim( this.max ) );
26
+ this.step = ( /^\s*$/.test( this.step )) ? 1 : parseFloat( $.trim( this.step ) );
27
+ this.centSeparator = ( /^\s*$/.test( this.centSeparator )) ? '.' : $.trim( this.centSeparator );
28
+ this.thousandSeparator = $.trim( this.thousandSeparator );
29
+
30
+ this.predefinedMin = ( /^\s*$/.test( this.predefinedMin ) )? this.min : Math.min( Math.max( parseFloat( $.trim( this.predefinedMin ) ), this.min ), this.max );
31
+
32
+ this.predefinedMax = ( /^\s*$/.test( this.predefinedMax ) )? this.max : Math.min( Math.max( parseFloat( $.trim( this.predefinedMax ) ), this.min ), this.max );
33
+
34
+ this.predefined = ( /^\s*$/.test( this.predefined ) ) ? this.min : parseFloat( $.trim( this.predefined ) );
35
+ },
36
+ show:function()
37
+ {
38
+ return '<div class="fields '+this.csslayout+' cff-slider-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+'</label><div class="dfield slider-container"><input id="'+this.name+'" name="'+this.name+'" class="field" type="hidden" value="'+$.fbuilder.htmlEncode( $.trim( this.predefined ) )+'"/><div id="'+this.name+'_slider" class="slider '+this.size+'"></div><div class="corner_captions '+this.size+'"><span class="left-corner">'+this.minCaption+'</span><span class="right-corner" style="float:right;">'+this.maxCaption+'</span></div><div id="'+this.name+'_caption"></div><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
39
+ },
40
+ set_values:function()
41
+ {
42
+ var me = this;
43
+ function setThousandsSeparator( v )
44
+ {
45
+ v = $.fbuilder.parseVal( v, me.thousandSeparator, me.centSeparator );
46
+ if( !isNaN( v ) )
47
+ {
48
+ v = v.toString();
49
+ var parts = v.toString().split("."),
50
+ counter = 0,
51
+ str = '';
52
+
53
+ if( !/^\s*$/.test( me.thousandSeparator ) )
54
+ {
55
+ for( var i = parts[0].length-1; i >= 0; i--)
56
+ {
57
+ counter++;
58
+ str = parts[0][i] + str;
59
+ if( counter%3 == 0 && i != 0 ) str = me.thousandSeparator + str;
60
+
61
+ }
62
+ parts[0] = str;
63
+ }
64
+ if( typeof parts[ 1 ] != 'undefined' && parts[ 1 ].length == 1 )
65
+ {
66
+ parts[ 1 ] += '0';
67
+ }
68
+
69
+ return parts.join( me.centSeparator );
70
+ }
71
+ else
72
+ {
73
+ return v;
74
+ }
75
+ };
76
+
77
+ if( me.range )
78
+ {
79
+ var values = $( '#'+me.name+'_slider' ).slider( 'values' );
80
+ $( '#'+me.name ).val( '[' + values[ 0 ] + ',' + values[ 1 ] + ']' );
81
+ $( '#'+me.name+'_caption' ).html(
82
+ me.caption
83
+ .replace( /\{\s*0\s*\}/, setThousandsSeparator( values[ 0 ] ) )
84
+ .replace( /\{\s*0\s*\}/, setThousandsSeparator( values[ 1 ] ) )
85
+ );
86
+ }
87
+ else
88
+ {
89
+ var value = $( '#'+me.name+'_slider' ).slider( 'value' );
90
+ $( '#'+me.name ).val( value );
91
+ $( '#'+me.name+'_caption' ).html(
92
+ me.caption
93
+ .replace( /\{\s*0\s*\}/, setThousandsSeparator( value ) )
94
+ );
95
+ }
96
+ $( '#'+me.name ).change();
97
+ },
98
+ after_show:function()
99
+ {
100
+ var me = this,
101
+ opt = {
102
+ range: (me.range != false) ? me.range : "min",
103
+ min : me.min,
104
+ max : me.max,
105
+ step : me.step
106
+ };
107
+
108
+ if( me.range ) opt[ 'values' ] = [ me.predefinedMin, me.predefinedMax ];
109
+ else opt[ 'value' ] = me.predefined;
110
+ opt[ 'slide' ] = opt[ 'stop' ] = ( function( e ){
111
+ return function( event, ui )
112
+ {
113
+ if( typeof ui.value != 'undefined' ) $(this).slider('value', ui.value);
114
+ if( typeof ui.values != 'undefined' ) $(this).slider('values', ui.values);
115
+ e.set_values();
116
+ }
117
+ } )( me );
118
+ $( '#'+this.name+'_slider' ).slider( opt );
119
+ me.set_values();
120
+ $( '#cp_calculatedfieldsf_pform'+me.form_identifier ).bind( 'reset', function(){ $( '#'+me.name+'_slider' ).slider( opt ); me.set_values(); } );
121
+ },
122
+ val:function()
123
+ {
124
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
125
+ return ( e.length ) ? e.val() : 0;
126
+ },
127
+ setVal:function( v )
128
+ {
129
+ try{
130
+ v = JSON.parse(v);
131
+ }
132
+ catch(err){}
133
+ try{
134
+ $( '[name="'+this.name+'"]' ).val( v );
135
+ if( $.isArray( v ) )
136
+ {
137
+ this.predefinedMin = v[ 0 ];
138
+ this.predefinedMax = v[ 1 ];
139
+ }
140
+ else
141
+ {
142
+ this.predefined = v;
143
+ }
144
+ this.after_show();
145
+ }catch( err ){}
146
+ }
147
+ });
js/fields-public/03_fbuilder.femail.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'femail' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'femail' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Email",
7
+ ftype:"femail",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ readonly:false,
12
+ size:"medium",
13
+ equalTo:"",
14
+ show:function()
15
+ {
16
+ return '<div class="fields '+this.csslayout+' cff-email-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.equalTo!="")?"equalTo=\"#"+$.fbuilder.htmlEncode(this.equalTo+this.form_identifier)+"\"":"" )+' class="field email '+this.size+((this.required)?" required":"")+'" type="email" value="'+$.fbuilder.htmlEncode(this.predefined)+'" '+((this.readonly)?'readonly':'')+' /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
17
+ },
18
+ val:function()
19
+ {
20
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
21
+ if( e.length ) return $.fbuilder.parseValStr( e.val() );
22
+ return 0;
23
+ }
24
+ }
25
+ );
js/fields-public/04_fbuilder.fdate.js ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fdate' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fdate' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Date",
7
+ ftype:"fdate",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ size:"medium",
11
+ required:false,
12
+ dformat:"mm/dd/yyyy",
13
+ tformat:"24",
14
+ showDropdown:false,
15
+ dropdownRange:"-10:+10",
16
+ minDate:"",
17
+ maxDate:"",
18
+ invalidDates:"",
19
+ minHour:0,
20
+ maxHour:23,
21
+ minMinute:0,
22
+ maxMinute:59,
23
+
24
+ stepHour: 1,
25
+ stepMinute: 1,
26
+
27
+ showDatepicker: true,
28
+ showTimepicker: false,
29
+
30
+ defaultDate:"",
31
+ defaultTime:"",
32
+ working_dates:[true,true,true,true,true,true,true],
33
+ formats:new Array("mm/dd/yyyy","dd/mm/yyyy"),
34
+ init:function()
35
+ {
36
+ function checkValue( v, min, max )
37
+ {
38
+ v = parseInt( v );
39
+ if( isNaN( v ) ) v = max;
40
+ else if( v < min ) v = min;
41
+ else if( v > max ) v = max;
42
+ return v;
43
+ }
44
+
45
+ this.minHour = checkValue( this.minHour, 0, 23 );
46
+ this.maxHour = checkValue( this.maxHour, 0, 23 );
47
+ this.minMinute = checkValue( this.minMinute, 0, 59 );
48
+ this.maxMinute = checkValue( this.maxMinute, 0, 59 );
49
+ this.stepHour = checkValue( this.stepHour, 1, Math.max( 1, this.maxHour - this.minHour ) );
50
+ this.stepMinute = checkValue( this.stepMinute, 1, Math.max( 1, this.maxMinute - this.minMinute ) );
51
+
52
+ this.invalidDates = this.invalidDates.replace( /\s+/g, '' );
53
+ if( !/^\s*$/.test( this.invalidDates ) )
54
+ {
55
+ var dateRegExp = new RegExp( /^\d{1,2}\/\d{1,2}\/\d{4}$/ ),
56
+ counter = 0,
57
+ dates = this.invalidDates.split( ',' );
58
+ this.invalidDates = [];
59
+ for( var i = 0, h = dates.length; i < h; i++ )
60
+ {
61
+ var range = dates[ i ].split( '-' );
62
+
63
+ if( range.length == 2 && range[0].match( dateRegExp ) != null && range[1].match( dateRegExp ) != null )
64
+ {
65
+ var fromD = new Date( range[ 0 ] ),
66
+ toD = new Date( range[ 1 ] );
67
+ while( fromD <= toD )
68
+ {
69
+ this.invalidDates[ counter ] = fromD;
70
+ var tmp = new Date( fromD.valueOf() );
71
+ tmp.setDate( tmp.getDate() + 1 );
72
+ fromD = tmp;
73
+ counter++;
74
+
75
+ }
76
+ }
77
+ else
78
+ {
79
+ for( var j = 0, k = range.length; j < k; j++ )
80
+ {
81
+ if( range[ j ].match( dateRegExp ) != null )
82
+ {
83
+ this.invalidDates[ counter ] = new Date( range[ j ] );
84
+ counter++;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ },
91
+ get_hours:function()
92
+ {
93
+ var str = '',
94
+ i = 0,
95
+ h,
96
+ from = ( this.tformat == 12 ) ? 1 : this.minHour,
97
+ to = ( this.tformat == 12 ) ? 12 : this.maxHour;
98
+
99
+ while( ( h = from + this.stepHour * i ) <= to )
100
+ {
101
+
102
+ if( h < 10 ) h = '0'+''+h;
103
+ str += '<option value="' + h + '">' + h + '</option>';
104
+ i++;
105
+ }
106
+ return '<select id="'+this.name+'_hours" name="'+this.name+'_hours">' + str + '</select>:';
107
+ },
108
+ get_minutes:function()
109
+ {
110
+ var str = '',
111
+ i = 0,
112
+ m;
113
+
114
+ while( ( m = this.minMinute + this.stepMinute * i ) <= this.maxMinute )
115
+ {
116
+ if( m < 10 )
117
+ {
118
+ m = '0'+''+m;
119
+ }
120
+ str += '<option value="' + m + '">' + m + '</option>';
121
+ i++;
122
+ }
123
+ return '<select id="'+this.name+'_minutes" name="'+this.name+'_minutes">' + str + '</select>';
124
+ },
125
+ get_ampm:function()
126
+ {
127
+ var str = '';
128
+ if( this.tformat == 12 )
129
+ {
130
+ return '<select id="'+this.name+'_ampm"><option value="am">am</option><option value="pm">pm</option></select>';
131
+ }
132
+ return str;
133
+ },
134
+ set_date_time:function()
135
+ {
136
+ var str = $( '#'+this.name+'_date' ).val();
137
+ if( this.showTimepicker )
138
+ {
139
+ var h = $( '#'+this.name+'_hours' ).val()*1;
140
+ str += ' ';
141
+ if( this.tformat == 12 )
142
+ {
143
+ h = (h==12) ? 0 : h;
144
+ if( $( '#'+this.name+'_ampm' ).val() == 'pm' ) str += ( h + 12 );
145
+ else str += h;
146
+ }
147
+ else str += h;
148
+ str += ':'+$( '#'+this.name+'_minutes' ).val();
149
+ }
150
+ $( '#'+this.name ).val( str ).change();
151
+ },
152
+ show:function()
153
+ {
154
+ var attr = 'value',
155
+ format_label = [],
156
+ date_tag_type = 'text',
157
+ disabled = '',
158
+ date_tag_class = 'field date'+this.dformat.replace(/\//g,"")+' '+this.size+((this.required)?' required': '');
159
+
160
+ if( this.predefinedClick ) attr = 'placeholder';
161
+ if( this.showDatepicker ) format_label.push(this.dformat);
162
+ else{ date_tag_type = 'hidden'; disabled='disabled';}
163
+ if( this.showTimepicker ) format_label.push('HH:mm');
164
+
165
+ return '<div class="fields '+this.csslayout+' cff-date-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+( (format_label.length) ? ' <span class="dformat">('+format_label.join(' ')+')</span>' : '' )+'</label><div class="dfield"><input id="'+this.name+'" name="'+this.name+'" type="hidden" value="'+$.fbuilder.htmlEncode(this.predefined)+'"/><input id="'+this.name+'_date" name="'+this.name+'_date" class="'+date_tag_class+'" type="'+date_tag_type+'" '+attr+'="'+$.fbuilder.htmlEncode(this.predefined)+'" '+disabled+' />'+( ( this.showTimepicker ) ? ' '+this.get_hours()+this.get_minutes()+' '+this.get_ampm() : '' )+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
166
+ },
167
+ setDefaultDate : function()
168
+ {
169
+ var me = this,
170
+ p = {
171
+ dateFormat: me.dformat.replace(/yyyy/g,"yy"),
172
+ minDate: me.minDate,
173
+ maxDate: me.maxDate
174
+ },
175
+ dp = $( "#"+me.name+"_date" ),
176
+ dd = (me.defaultDate != "") ? me.defaultDate : ( ( me.predefined != "" ) ? me.predefined : new Date() );
177
+
178
+ dp.click( function(){ $(document).click(); $(this).focus(); } );
179
+ if (me.showDropdown )
180
+ {
181
+ if( me.dropdownRange.indexOf( ':' ) == -1 ) me.dropdownRange = '-10:+10';
182
+ p = $.extend(p,{changeMonth: true,changeYear: true,yearRange: me.dropdownRange});
183
+ }
184
+ p = $.extend(p, { beforeShowDay: ( function ( w, i ) { return function( d ){ return me.validateDate( d, w, i ); }; } )( me.working_dates, me.invalidDates ) } );
185
+ dp.datepicker(p);
186
+ if( !me.predefinedClick ) dp.datepicker( "setDate", dd);
187
+ if( !me.validateDate( dp.datepicker( "getDate"), me.working_dates, me.invalidDates)[ 0 ] )
188
+ {
189
+ dp.datepicker( "setDate", '');
190
+ }
191
+ },
192
+ setDefaultTime : function()
193
+ {
194
+ function setValue( f, v, m )
195
+ {
196
+ v = Math.min( v*1, m*1 );
197
+ v = ( v < 10 ) ? 0+''+v : v;
198
+ $( '#' + f + ' [value="' + v + '"]' ).prop( 'selected', true );
199
+ };
200
+
201
+ if( this.showTimepicker )
202
+ {
203
+ var parts, time = {}, tmp = 0;
204
+ if( ( parts = /(\d{1,2}):(\d{1,2})/g.exec( this.defaultTime ) ) != null )
205
+ {
206
+ time[ 'hour' ] = parts[ 1 ];
207
+ time[ 'minute' ] = parts[ 2 ];
208
+ }
209
+ else
210
+ {
211
+ var d = new Date();
212
+ time[ 'hour' ] = d.getHours();
213
+ time[ 'minute' ] = d.getMinutes();
214
+ }
215
+
216
+ setValue(
217
+ this.name+'_hours',
218
+ ( this.tformat == 12 ) ? ( ( time[ 'hour' ] > 12 ) ? time[ 'hour' ] - 12 : ( ( time[ 'hour' ] == 0 ) ? 12 : time[ 'hour' ] ) ) : time[ 'hour' ],
219
+ ( this.tformat == 12 ) ? 12 : this.maxHour
220
+ );
221
+
222
+ setValue( this.name+'_minutes', time[ 'minute' ], this.maxMinute );
223
+ $( '#'+this.name+'_ampm'+' [value="' + ( ( time[ 'hour' ] < 12 ) ? 'am' : 'pm' ) + '"]' ).prop( 'selected', true );
224
+ }
225
+ },
226
+ setEvents : function()
227
+ {
228
+ var me = this,
229
+ f = function(){
230
+ $( '#'+me.name+'_date' ).valid();
231
+ me.set_date_time();
232
+ };
233
+
234
+ $( document ).on( 'change', '#'+me.name+'_date', function(){ f(); } );
235
+ $( document ).on( 'change', '#'+me.name+'_hours', function(){ f(); } );
236
+ $( document ).on( 'change', '#'+me.name+'_minutes', function(){ f(); } );
237
+ $( document ).on( 'change', '#'+me.name+'_ampm', function(){ f(); } );
238
+
239
+ $( '#cp_calculatedfieldsf_pform'+me.form_identifier ).bind( 'reset', function(){ setTimeout( function(){ me.setDefaultDate(); me.setDefaultTime(); me.set_date_time(); }, 500 ); } );
240
+ },
241
+ validateDate: function( d, w, i )
242
+ {
243
+ try{
244
+ if( d === null ) return [false,""];
245
+ if ( !w[ d.getDay()]) return [false,""];
246
+ if( i !== null )
247
+ {
248
+ for( var j = 0, h = i.length; j < h; j++ )
249
+ {
250
+ if( d.getDate() == i[ j ].getDate() && d.getMonth() == i[ j ].getMonth() && d.getFullYear() == i[ j ].getFullYear() ) return [false,""];
251
+ }
252
+ }
253
+ }
254
+ catch( _err ){}
255
+ return [true,""];
256
+ },
257
+ validateTime : function( e, i )
258
+ {
259
+ if( i.showTimepicker )
260
+ {
261
+ var base = e.name.replace( '_date', '' ),
262
+ h = $('#'+base+'_hours').val(),
263
+ m = $('#'+base+'_minutes').val();
264
+ if( i.tformat == 12 )
265
+ {
266
+ if( $('#'+base+'_ampm').val() == 'pm' && h != 12 ) h = h*1 + 12;
267
+ if( $('#'+base+'_ampm').val() == 'am' && h == 12 ) h = 0;
268
+ }
269
+ if( h < i.minHour || h > i.maxHour ) return false;
270
+ }
271
+ return true;
272
+ },
273
+ after_show:function()
274
+ {
275
+ var me = this;
276
+ var validator = function( v, e )
277
+ {
278
+
279
+ try
280
+ {
281
+ var _dp = $.datepicker,
282
+ _fb = $.fbuilder,
283
+ p = e.name.replace( '_date', '' ).split( '_' ),
284
+ _index = ( p.length > 1 ) ? '_'+p[ 1 ] : '',
285
+ item = (
286
+ typeof _fb[ 'forms' ] != 'undefined' &&
287
+ typeof _fb[ 'forms' ][ _index ] != 'undefined'
288
+ ) ? _fb[ 'forms' ][ _index ].getItem( p[ 0 ]+'_'+p[ 1 ] ) : null,
289
+ inst = _dp._getInst( e ),
290
+ minDate = _dp._determineDate( inst, _dp._get( inst, 'minDate'), null),
291
+ maxDate = _dp._determineDate(inst, _dp._get(inst, 'maxDate'), null),
292
+ dateFormat = _dp._get(inst, 'dateFormat'),
293
+ date = _dp.parseDate(dateFormat, v, _dp._getFormatConfig(inst));
294
+
295
+ if( item != null )
296
+ {
297
+ return this.optional( e ) ||
298
+ (
299
+ ( minDate == null || date >= minDate ) &&
300
+ ( maxDate == null || date <= maxDate ) &&
301
+ me.validateDate( $( e ).datepicker( 'getDate' ), item.working_dates, item.invalidDates )[ 0 ] &&
302
+ me.validateTime( e, item )
303
+ );
304
+ }
305
+ return true;
306
+ }
307
+ catch( er )
308
+ {
309
+ return false;
310
+ }
311
+ };
312
+
313
+ $.validator.addMethod("dateddmmyyyy", validator );
314
+ $.validator.addMethod("datemmddyyyy", validator );
315
+
316
+ me.setDefaultDate();
317
+ me.setDefaultTime();
318
+ me.setEvents();
319
+ me.set_date_time();
320
+ },
321
+ val:function()
322
+ {
323
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
324
+ if( e.length )
325
+ {
326
+ var rt;
327
+ if( this.dformat == 'yyyy/mm/dd' || this.dformat == 'yyyy/dd/mm' )
328
+ rt = '(\\d{4})[\\/\\-\\.](\\d{1,2})[\\/\\-\\.](\\d{1,2})';
329
+ else
330
+ rt = '(\\d{1,2})[\\/\\-\\.](\\d{1,2})[\\/\\-\\.](\\d{4})';
331
+
332
+ var v = $.trim( e.val() ),
333
+ re = new RegExp( rt+'(\\s(\\d{1,2})[:\\.](\\d{1,2}))?' ),
334
+ d = re.exec( v ),
335
+ h = 0,
336
+ m = 0,
337
+ date;
338
+
339
+ if( d )
340
+ {
341
+ if( typeof d[ 5 ] != 'undefined' ) h = d[ 5 ];
342
+ if( typeof d[ 6 ] != 'undefined' ) m = d[ 6 ];
343
+
344
+ switch( this.dformat )
345
+ {
346
+ case 'yyyy/dd/mm':
347
+ date = new Date( d[ 1 ], ( d[ 3 ] * 1 - 1 ), d[ 2 ], h, m, 0, 0 );
348
+ break;
349
+ case 'yyyy/mm/dd':
350
+ date = new Date( d[ 1 ], ( d[ 2 ] * 1 - 1 ), d[ 3 ], h, m, 0, 0 );
351
+ break;
352
+ case 'dd/mm/yyyy':
353
+ date = new Date( d[ 3 ], ( d[ 2 ] * 1 - 1 ), d[ 1 ], h, m, 0, 0 );
354
+ break;
355
+ case 'mm/dd/yyyy':
356
+ date = new Date( d[ 3 ], ( d[ 1 ] * 1 - 1 ), d[ 2 ], h, m, 0, 0 );
357
+ break;
358
+ }
359
+
360
+ if( this.showTimepicker )
361
+ {
362
+ return date.valueOf() / 86400000;
363
+ }
364
+ else
365
+ {
366
+ return Math.ceil( date.valueOf() / 86400000 );
367
+ }
368
+ }
369
+ }
370
+ return 0;
371
+ },
372
+ setVal:function( v )
373
+ {
374
+ try
375
+ {
376
+ v = $.trim(v)
377
+ .replace( /\s+/g, ' ' )
378
+ .split( ' ' );
379
+ this.defaultDate = v[ 0 ];
380
+ this.setDefaultDate();
381
+ if( v.length == 2 )
382
+ {
383
+ this.defaultTime = v[ 1 ];
384
+ this.setDefaultTime();
385
+ }
386
+ this.set_date_time();
387
+ }
388
+ catch( err )
389
+ {}
390
+ }
391
+ }
392
+ );
js/fields-public/05_fbuilder.ftextarea.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'ftextarea' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'ftextarea' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"ftextarea",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ readonly:false,
12
+ size:"medium",
13
+ minlength:"",
14
+ maxlength:"",
15
+ rows:4,
16
+ show:function()
17
+ {
18
+ return '<div class="fields '+this.csslayout+' cff-textarea-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield"><textarea '+((!/^\s*$/.test(this.rows)) ? 'rows='+this.rows : '' )+' id="'+this.name+'" name="'+this.name+'" minlength="'+(this.minlength)+'" maxlength="'+$.fbuilder.htmlEncode(this.maxlength)+'" class="field '+this.size+((this.required)?" required":"")+'" '+((this.readonly)?'readonly':'')+'>'+((!this.predefinedClick) ? this.predefined : '')+'</textarea><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
19
+ },
20
+ val:function()
21
+ {
22
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
23
+ if( e.length ) return $.fbuilder.parseValStr( e.val().replace( /[\n\r]+/g, ' ') );
24
+ return 0;
25
+ }
26
+ }
27
+ );
js/fields-public/06_fbuilder.fcheck.js ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fcheck' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fcheck' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Check All That Apply",
7
+ ftype:"fcheck",
8
+ layout:"one_column",
9
+ required:false,
10
+ merge:1,
11
+ max:-1,
12
+ maxError:"Check no more than {0} boxes",
13
+ toSubmit:"text",
14
+ showDep:false,
15
+ show:function()
16
+ {
17
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
18
+ var str = "",
19
+ classDep;
20
+
21
+ if ( typeof this.choicesDep == "undefined" || this.choicesDep == null )
22
+ this.choicesDep = new Array();
23
+
24
+ for (var i=0, h=this.choices.length; i<h; i++)
25
+ {
26
+ if( typeof this.choicesDep[i] != 'undefined' )
27
+ this.choicesDep[i] = $.grep(this.choicesDep[i],function(n){ return n != ""; });
28
+ else
29
+ this.choicesDep[i] = [];
30
+
31
+ classDep = (this.choicesDep[ i ].length) ? 'depItem': '';
32
+
33
+ str += '<div class="'+this.layout+'"><label><input name="'+this.name+'[]" id="'+this.name+'" class="field '+classDep+' group '+((this.required)?" required":"")+'" value="'+$.fbuilder.htmlEncode(this.choicesVal[i])+'" vt="'+$.fbuilder.htmlEncode((this.toSubmit == 'text') ? this.choices[i] : this.choicesVal[i])+'" type="checkbox" '+((this.choiceSelected[i])?"checked":"")+'/> <span>'+$.fbuilder.htmlDecode( this.choices[i] )+'</span></label></div>';
34
+ }
35
+ return '<div class="fields '+this.csslayout+' cff-checkbox-field" id="field'+this.form_identifier+'-'+this.index+'"><label>'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
36
+ },
37
+ after_show:function()
38
+ {
39
+ var m = this;
40
+ $(document).on('click','[id*="'+m.name+'"]', function(){
41
+ if(0 < m.max)
42
+ {
43
+ var d = true;
44
+ if($('[id*="'+m.name+'"]:checked').length < m.max) d = false;
45
+ $('[id*="'+m.name+'"]:not(:checked)').prop('disabled', d);
46
+ }
47
+ });
48
+
49
+ if(0 < m.max)
50
+ $('[id*="'+m.name+'"]').rules('add',{maxlength:m.max, messages:{maxlength:m.maxError}});
51
+ },
52
+ showHideDep:function( toShow, toHide, hiddenByContainer )
53
+ {
54
+ var me = this,
55
+ item = $( '[id="'+me.name+'"]' ),
56
+ form_identifier = me.form_identifier,
57
+ isHidden = (typeof toHide[ me.name ] != 'undefined' || typeof hiddenByContainer[ me.name ] != 'undefined' ),
58
+ result = [];
59
+
60
+ try
61
+ {
62
+ item.each(function(i,e){
63
+ if( typeof me.choicesDep[i] != 'undefined' && me.choicesDep[ i ].length )
64
+ {
65
+ var checked = e.checked;
66
+ for( var j = 0, k = me.choicesDep[ i ].length; j < k; j++)
67
+ {
68
+ var dep = me.choicesDep[i][j]+form_identifier;
69
+ if( isHidden || !checked)
70
+ {
71
+ if( typeof toShow[ dep ] != 'undefined' )
72
+ {
73
+ delete toShow[ dep ][ 'ref' ][ me.name+'_'+i ];
74
+ if( $.isEmptyObject(toShow[ dep ][ 'ref' ]) )
75
+ delete toShow[ dep ];
76
+ }
77
+
78
+ if( typeof toShow[ dep ] == 'undefined' )
79
+ {
80
+ $( '#'+dep ).closest( '.fields' ).hide();
81
+ $( '[id*="'+dep+'"]:not(.ignore)' ).addClass( 'ignore' );
82
+ toHide[ dep ] = {};
83
+ }
84
+ }
85
+ else
86
+ {
87
+ delete toHide[ dep ];
88
+ if( typeof toShow[ dep ] == 'undefined' )
89
+ toShow[ dep ] = { 'ref': {}};
90
+ toShow[ dep ][ 'ref' ][ me.name+'_'+i ] = 1;
91
+ if(!(dep in hiddenByContainer))
92
+ {
93
+ $( '#'+dep ).closest( '.fields' ).show();
94
+ $( '[id*="'+dep+'"].ignore' ).removeClass( 'ignore' );
95
+ }
96
+ }
97
+ if($.inArray(dep,result) == -1) result.push( dep );
98
+ }
99
+ }
100
+ });
101
+ }
102
+ catch( e ){ }
103
+ return result;
104
+ },
105
+ val:function()
106
+ {
107
+ var e = $( '[id="' + this.name + '"]:checked:not(.ignore)' ),
108
+ v, me = this;
109
+ if(!me.merge) v = [];
110
+ if( e.length )
111
+ {
112
+ e.each( function(){
113
+ var t = $.fbuilder[(me.merge)?'parseVal':'parseValStr']( this.value );
114
+ if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');
115
+ if(me.merge) v = (v)?v+t:t;
116
+ else v.push(t);
117
+ });
118
+ }
119
+ return (typeof v == 'object' && typeof v['length'] !== 'undefined') ? v : ((v) ? (($.isNumeric(v)) ? v : '"'+v+'"') : 0);
120
+ },
121
+ setVal:function( v )
122
+ {
123
+ var t, n = this.name;
124
+ if( !$.isArray( v ) ) v = [v];
125
+ $( '[id="'+n+'"]' ).prop( 'checked', false );
126
+ for( var i in v )
127
+ {
128
+ t = (new String(v[i])).replace(/(['"])/g, "\\$1");
129
+ $( '[id="'+n+'"][vt="'+t+'"],[id="'+n+'"][value="'+t+'"]' ).prop( 'checked', true );
130
+ }
131
+ $( '[id="'+n+'"]' ).change();
132
+ }
133
+ }
134
+ );
js/fields-public/07_fbuilder.fradio.js ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fradio' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fradio' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Select a Choice",
7
+ ftype:"fradio",
8
+ layout:"one_column",
9
+ required:false,
10
+ toSubmit:"text",
11
+ choiceSelected:"",
12
+ showDep:false,
13
+ show:function()
14
+ {
15
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices);
16
+
17
+ var l = this.choices.length,
18
+ str = "",
19
+ classDep = "";
20
+
21
+ if ( typeof this.choicesDep == "undefined" || this.choicesDep == null )
22
+ this.choicesDep = new Array();
23
+
24
+ for (var i=0;i<l;i++)
25
+ {
26
+ if( typeof this.choicesDep[i] != 'undefined' )
27
+ this.choicesDep[i] = $.grep(this.choicesDep[i],function(n){ return n != ""; });
28
+ else
29
+ this.choicesDep[i] = [];
30
+
31
+ if( this.choicesDep[i].length )
32
+ classDep = 'depItem';
33
+ }
34
+
35
+ for (var i=0;i<l;i++)
36
+ {
37
+ str += '<div class="'+this.layout+'"><label><input name="'+this.name+'" id="'+this.name+'" class="field '+classDep+' group '+((this.required)?" required":"")+'" value="'+$.fbuilder.htmlEncode(this.choicesVal[i])+'" vt="'+$.fbuilder.htmlEncode((this.toSubmit=='text') ? this.choices[i] : this.choicesVal[i])+'" type="radio" '+((this.choices[i]+' - '+this.choicesVal[i]==this.choiceSelected)?"checked":"")+'/> <span>'+$.fbuilder.htmlDecode( this.choices[i] )+'</span></label></div>';
38
+ }
39
+
40
+ return '<div class="fields '+this.csslayout+' cff-radiobutton-field" id="field'+this.form_identifier+'-'+this.index+'"><label>'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label><div class="dfield">'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
41
+ },
42
+ after_show: function()
43
+ {
44
+ var n = this.name;
45
+ $(document).off('click', '[id*="'+n+'"]').on('click', '[id*="'+n+'"]', function(){
46
+ var m = this,
47
+ e = $(m);
48
+
49
+ $('[id*="'+n+'"]').each(function(){if(m !== this) $(this).data('previous-status', false);});
50
+ if(e.data('previous-status')){ m.checked = false; e.change();}
51
+ e.data('previous-status', m.checked);
52
+ });
53
+ },
54
+ showHideDep:function( toShow, toHide, hiddenByContainer )
55
+ {
56
+ var me = this,
57
+ item = $( '[id="'+me.name+'"]' ),
58
+ form_identifier = me.form_identifier,
59
+ isHidden = ( typeof toHide[ me.name ] != 'undefined' || typeof hiddenByContainer[ me.name ] != 'undefined' ),
60
+ result = [];
61
+
62
+ try
63
+ {
64
+ item.each(function(i,e){
65
+ if( typeof me.choicesDep[i] != 'undefined' && me.choicesDep[ i ].length )
66
+ {
67
+ var checked = e.checked;
68
+ for( var j = 0, k = me.choicesDep[ i ].length; j < k; j++)
69
+ {
70
+ var dep = me.choicesDep[i][j]+form_identifier;
71
+ if(isHidden || !checked)
72
+ {
73
+ if(typeof toShow[ dep ] != 'undefined')
74
+ {
75
+ delete toShow[ dep ][ 'ref' ][ me.name+'_'+i ];
76
+ if( $.isEmptyObject(toShow[ dep ][ 'ref' ]) )
77
+ delete toShow[ dep ];
78
+ }
79
+
80
+ if( typeof toShow[ dep ] == 'undefined' )
81
+ {
82
+ $( '#'+dep ).closest( '.fields' ).hide();
83
+ $( '[id*="'+dep+'"]:not(.ignore)' ).addClass( 'ignore' );
84
+ toHide[ dep ] = {};
85
+ }
86
+ }
87
+ else
88
+ {
89
+ delete toHide[ dep ];
90
+ if( typeof toShow[ dep ] == 'undefined' )
91
+ toShow[ dep ] = { 'ref': {}};
92
+ toShow[ dep ][ 'ref' ][ me.name+'_'+i ] = 1;
93
+ if(!(dep in hiddenByContainer))
94
+ {
95
+ $( '#'+dep ).closest( '.fields' ).show();
96
+ $( '[id*="'+dep+'"].ignore' ).removeClass( 'ignore' );
97
+ }
98
+ }
99
+ if($.inArray(dep,result) == -1) result.push( dep );
100
+ }
101
+ }
102
+ });
103
+ }
104
+ catch( e ){ }
105
+ return result;
106
+ },
107
+ val:function()
108
+ {
109
+ var e = $( '[id="' + this.name + '"]:not(.ignore):checked' );
110
+ if( e.length ) return $.fbuilder.parseValStr( e.val() );
111
+ return 0;
112
+ },
113
+ setVal:function( v )
114
+ {
115
+ var t = (new String(v)).replace(/(['"])/g, "\\$1"), n = this.name;
116
+ $( '[id="'+n+'"]' ).prop( 'checked', false );
117
+ $( '[id="'+n+'"][vt="'+t+'"],[id="'+n+'"][value="'+t+'"]' ).prop( 'checked', true );
118
+ $( '[id="'+n+'"]' ).change();
119
+ }
120
+ }
121
+ );
js/fields-public/08_fbuilder.fdropdown.js ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fdropdown' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fdropdown' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Select a Choice",
7
+ ftype:"fdropdown",
8
+ size:"medium",
9
+ required:false,
10
+ toSubmit:"text",
11
+ merge:0,
12
+ choiceSelected:"",
13
+ multiple:false,
14
+ vChoices:1,
15
+ showDep:false,
16
+ show:function()
17
+ {
18
+ this.choicesVal = ((typeof(this.choicesVal) != "undefined" && this.choicesVal !== null)?this.choicesVal:this.choices)
19
+
20
+ var c = this.choices,
21
+ cv = this.choicesVal,
22
+ og = (typeof this.optgroup == 'undefined') ? new Array() : this.optgroup,
23
+ op_o = false,
24
+ l = c.length,
25
+ classDep = '',
26
+ str = '';
27
+
28
+ if ( typeof this.choicesDep == "undefined" || this.choicesDep == null )
29
+ this.choicesDep = new Array();
30
+
31
+ for (var i=0;i<l;i++)
32
+ {
33
+ if( typeof this.choicesDep[i] != 'undefined' && (typeof og[i] == 'undefined' || !og[i]))
34
+ this.choicesDep[i] = $.grep(this.choicesDep[i],function(n){ return n != ""; });
35
+ else
36
+ this.choicesDep[i] = [];
37
+
38
+ if( this.choicesDep[i].length && (typeof og[i] == 'undefined' || !og[i]) )
39
+ classDep = 'depItem';
40
+ }
41
+
42
+ for (var i=0;i<l;i++)
43
+ {
44
+ if(og[i])
45
+ {
46
+ if(op_o) str += '</optgroup>';
47
+ str += '<optgroup label="'+$.fbuilder.htmlEncode(c[i])+'">';
48
+ op_o = true;
49
+ }
50
+ else
51
+ {
52
+ str += '<option '+((this.choiceSelected == c[i]+' - '+cv[i])?"selected":"")+' '+( ( classDep != '' ) ? 'class="'+classDep+'"' : '' )+' value="'+$.fbuilder.htmlEncode(cv[i])+'" vt="'+$.fbuilder.htmlEncode((this.toSubmit=='text') ? c[i] : cv[i])+'" data-i="'+i+'">'+c[i]+'</option>';
53
+ }
54
+ }
55
+ if(op_o) str += '</optgroup>';
56
+ return '<div class="fields '+this.csslayout+' cff-dropdown-field" id="field'+this.form_identifier+'-'+this.index+'"><label for="'+this.name+'">'+this.title+''+((this.required)?"<span class='r'>*</span>":"")+'</label>'+
57
+ '<div class="dfield"><select id="'+this.name+'" name="'+this.name+((this.multiple)? '[]':'')+'" class="field '+( ( classDep != '' ) ? ' depItemSel ' : '' )+this.size+((this.required)?' required':'')+'" '+((this.multiple == true)?' multiple="multiple" size="'+((this.vChoices) ? this.vChoices : 1)+'"':'')+'>'+str+'</select><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div><div class="clearer"></div></div>';
58
+ },
59
+ showHideDep:function( toShow, toHide, hiddenByContainer )
60
+ {
61
+ var me = this,
62
+ item = $( '#'+me.name+'.depItemSel' ),
63
+ form_identifier = me.form_identifier,
64
+ isHidden = ( typeof toHide[ me.name ] != 'undefined' || typeof hiddenByContainer[ me.name ] != 'undefined' ),
65
+ result = [];
66
+
67
+ try
68
+ {
69
+ if( item.length )
70
+ {
71
+ var selected = [];
72
+ $(item).find(':selected').each(function(){selected.push($(this).data('i'));});
73
+
74
+ for( var i = 0, h = me.choices.length; i < h; i++ )
75
+ {
76
+ if( typeof me.choicesDep[i] != 'undefined' && me.choicesDep[ i ].length )
77
+ {
78
+ for( var j = 0, k = me.choicesDep[ i ].length; j < k; j++)
79
+ {
80
+ var dep = me.choicesDep[i][j]+form_identifier;
81
+ if( isHidden || $.inArray(i,selected) == -1)
82
+ {
83
+ if( typeof toShow[ dep ] != 'undefined' )
84
+ {
85
+ delete toShow[ dep ][ 'ref' ][ me.name+'_'+i ];
86
+ if( $.isEmptyObject(toShow[ dep ][ 'ref' ]) )
87
+ delete toShow[ dep ];
88
+ }
89
+
90
+ if( typeof toShow[ dep ] == 'undefined' )
91
+ {
92
+ $( '#'+dep ).closest( '.fields' ).hide();
93
+ $( '[id*="'+dep+'"]:not(.ignore)' ).addClass( 'ignore' );
94
+ toHide[ dep ] = {};
95
+ }
96
+ }
97
+ else
98
+ {
99
+ delete toHide[ dep ];
100
+ if( typeof toShow[ dep ] == 'undefined' )
101
+ toShow[ dep ] = { 'ref': {}};
102
+ toShow[ dep ][ 'ref' ][ me.name+'_'+i ] = 1;
103
+ if(!(dep in hiddenByContainer))
104
+ {
105
+ $( '#'+dep ).closest( '.fields' ).show();
106
+ $( '[id*="'+dep+'"].ignore' ).removeClass( 'ignore' );
107
+ }
108
+ }
109
+ if($.inArray(dep,result) == -1) result.push( dep );
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ catch( e ){}
116
+ return result;
117
+ },
118
+ val:function()
119
+ {
120
+ var e = $( '[id="' + this.name + '"]:not(.ignore) option:selected' ),
121
+ v,
122
+ m = this.multiple,
123
+ g = this.merge;
124
+
125
+ if(m && !g) v = [];
126
+ if(e.length)
127
+ {
128
+ e.each(function(){
129
+ var t = $.fbuilder.parseValStr( this.value );
130
+ if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');
131
+ if(!m || g) v = (v)?v+t:t;
132
+ else v.push(t);
133
+ });
134
+ }
135
+ return (typeof v == 'object' && typeof v['length'] !== 'undefined') ? v : ((v) ? (($.isNumeric(v)) ? v : '"'+v+'"') : 0);
136
+ },
137
+ setVal:function( v )
138
+ {
139
+ if( !$.isArray( v ) ) v = [v];
140
+ var t, n = this.name;
141
+ for(var i in v)
142
+ {
143
+ t = (new String(v[i])).replace(/(['"])/g, "\\$1");
144
+ $( '[id="'+n+'"] OPTION[vt="'+t+'"],[id="'+n+'"] OPTION[value="'+t+'"]' ).prop( 'selected', true );
145
+
146
+ }
147
+ $( '[id="'+n+'"]' ).change();
148
+ }
149
+ }
150
+ );
js/fields-public/09_fbuilder.ffile.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'ffile' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'ffile' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"ffile",
8
+ required:false,
9
+ size:"medium",
10
+ accept:"",
11
+ upload_size:"",
12
+ multiple:false,
13
+ show:function()
14
+ {
15
+ this.accept = $.fbuilder.htmlEncode($.trim(this.accept));
16
+ this.upload_size = $.fbuilder.htmlEncode($.trim(this.upload_size));
17
+
18
+ return '<div class="fields '+this.csslayout+' cff-file-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 type="file" id="'+this.name+'" name="'+this.name+'[]"'+((this.accept.length) ? ' accept="'+this.accept+'"' : '')+((this.upload_size.length) ? ' upload_size="'+this.upload_size+'"' : '')+' class="field '+this.size+((this.required)?" required":"")+'" '+( ( this.multiple ) ? 'multiple' : '' )+' /><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
19
+ },
20
+ after_show:function()
21
+ {
22
+ var me = this;
23
+
24
+ $.validator.addMethod("accept", function(value, element, param)
25
+ {
26
+ if( this.optional( element ) ) return true;
27
+ else{
28
+ param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
29
+ var regExpObj = new RegExp(".(" + param + ")$", "i");
30
+ for( var i = 0, h = element.files.length; i < h; i++ )
31
+ if( !element.files[ i ].name.match( regExpObj ) ) return false;
32
+ return true;
33
+ }
34
+ });
35
+
36
+ $.validator.addMethod("upload_size", function(value, element,params)
37
+ {
38
+ if( this.optional( element ) ) return true;
39
+ else{
40
+ var total = 0;
41
+ for( var i = 0, h = element.files.length; i < h; i++ )
42
+ total += element.files[ i ].size/1024;
43
+ return ( total <= params );
44
+ }
45
+ });
46
+
47
+ $( '#'+me.name ).change( function(){
48
+ $( this ).siblings( 'span.files-list' ).remove();
49
+ if( this.files.length > 1 )
50
+ {
51
+ var filesList = [];
52
+ for( var i = 0, h = this.files.length; i < h; i++ )
53
+ filesList.push( this.files[ i ].name )
54
+ $( this ).after( '<span class="files-list">'+filesList.join( ', ' )+'</span>' );
55
+ }
56
+ });
57
+ }
58
+ }
59
+ );
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
js/fields-public/10_fbuilder.fpassword.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fpassword' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fpassword' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"fpassword",
8
+ predefined:"",
9
+ predefinedClick:false,
10
+ required:false,
11
+ size:"medium",
12
+ minlength:"",
13
+ maxlength:"",
14
+ equalTo:"",
15
+ show:function()
16
+ {
17
+ return '<div class="fields '+this.csslayout+' cff-password-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+'" minlength="'+(this.minlength)+'" maxlength="'+$.fbuilder.htmlEncode(this.maxlength)+'" '+((this.equalTo!="")?"equalTo=\"#"+$.fbuilder.htmlEncode(this.equalTo+this.form_identifier)+"\"":"" )+' class="field '+this.size+((this.required)?" required":"")+'" type="password" value="'+$.fbuilder.htmlEncode(this.predefined)+'"/><span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
18
+ },
19
+ val:function()
20
+ {
21
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
22
+ if( e.length ) return $.fbuilder.parseValStr( e.val() );
23
+ return 0;
24
+ }
25
+ }
26
+ );
js/fields-public/11_fbuilder.fphone.js ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fPhone' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fPhone' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Phone",
7
+ ftype:"fPhone",
8
+ required:false,
9
+ readonly:false,
10
+ dformat:"### ### ####",
11
+ predefined:"888 888 8888",
12
+ show:function()
13
+ {
14
+ var me = this,
15
+ str = "",
16
+ tmp = this.dformat.split(' '),
17
+ tmpv = this.predefined.split(' '),
18
+ attr = ( typeof this.predefinedClick != 'undefined' && this.predefinedClick ) ? 'placeholder' : 'value';
19
+
20
+ for (var i=0;i<tmpv.length;i++)
21
+ {
22
+ if ($.trim(tmpv[i])=="")
23
+ {
24
+ tmpv.splice(i,1);
25
+ }
26
+ }
27
+
28
+ for (var i=0;i<tmp.length;i++)
29
+ {
30
+ if ($.trim(tmp[i])!="")
31
+ {
32
+ str += '<div class="uh_phone" ><input type="text" id="'+this.name+'_'+i+'" name="'+this.name+'_'+i+'" class="field '+((i==0) ? ' phone ' : ' digits ')+((this.required) ? ' required ' : '')+'" size="'+$.trim(tmp[i]).length+'" '+attr+'="'+((tmpv[i])?tmpv[i]:"")+'" maxlength="'+$.trim(tmp[i]).length+'" minlength="'+$.trim(tmp[i]).length+'" '+((this.readonly)?'readonly':'')+' /><div class="l">'+$.trim(tmp[i])+'</div></div>';
33
+ }
34
+ }
35
+
36
+ return '<div class="fields '+this.csslayout+' cff-phone-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 type="hidden" id="'+this.name+'" name="'+this.name+'" class="field " />'+str+'<span class="uh">'+this.userhelp+'</span></div><div class="clearer"></div></div>';
37
+ },
38
+ after_show: function()
39
+ {
40
+ var me = this,
41
+ tmp = me.dformat.split(' ');
42
+
43
+ $.validator.addMethod("phone", function(value, element)
44
+ {
45
+ if( this.optional( element ) ) return true;
46
+ else return /^\+{0,1}\d*$/.test(value);
47
+ });
48
+
49
+ for (var i = 0, h = tmp.length; i < h; i++ )
50
+ {
51
+ $( '#'+me.name+'_'+i ).bind( 'change', function(){
52
+ var v = '';
53
+ for( var i = 0; i < tmp.length; i++ )
54
+ {
55
+ v += $( '#'+me.name+'_'+i ).val();
56
+ }
57
+ $( '#'+me.name ).val( v ).change();
58
+ } );
59
+ if( i+1 < h )
60
+ {
61
+ $('#'+me.name+'_'+i).bind( 'keyup', { 'next': i+1 }, function( evt ){
62
+ var e = $( this );
63
+ if( e.val().length == e.attr( 'maxlength' ) )
64
+ {
65
+ e.change();
66
+ $( '#'+me.name+'_'+evt.data.next ).focus();
67
+ }
68
+ } );
69
+ }
70
+ }
71
+ },
72
+ val:function()
73
+ {
74
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
75
+ if( e.length ) return $.fbuilder.parseValStr( e.val() );
76
+ return 0;
77
+ },
78
+ setVal:function( v )
79
+ {
80
+ $( '[name="'+this.name+'"]' ).val( v );
81
+ v = $.trim( v ).replace( /[^\d]/g, ' ').split( ' ' );
82
+ for( var i in v ) $( '[id="' + this.name + '_' + i + '"]' ).val( v[ i ] );
83
+ }
84
+ }
85
+ );
js/fields-public/12_fbuilder.fcommentarea.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fCommentArea' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fCommentArea' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Comments here",
7
+ ftype:"fCommentArea",
8
+ userhelp:"A description of the section goes here.",
9
+ show:function()
10
+ {
11
+ return '<div class="fields '+this.csslayout+' comment_area" id="field'+this.form_identifier+'-'+this.index+'"><label id="'+this.name+'">'+this.title+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
12
+ }
13
+ }
14
+ );
js/fields-public/13_fbuilder.fhidden.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fhidden' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fhidden' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ ftype:"fhidden",
7
+ title:"",
8
+ predefined:"",
9
+ show:function()
10
+ {
11
+ return '<div class="fields '+this.csslayout+' cff-hidden-field" id="field'+this.form_identifier+'-'+this.index+'" style="padding:0;margin:0;border:0;width:0;height:0;overflow:hidden;"><label for="'+this.name+'">'+this.title+'</label><div class="dfield"><input id="'+this.name+'" name="'+this.name+'" type="hidden" value="'+$.fbuilder.htmlEncode(this.predefined)+'" class="field" /></div></div>';
12
+ }
13
+ }
14
+ );
js/fields-public/14_fbuilder.fsectionbreak.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fSectionBreak' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fSectionBreak' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Section Break",
7
+ ftype:"fSectionBreak",
8
+ userhelp:"A description of the section goes here.",
9
+ show:function()
10
+ {
11
+ return '<div class="fields '+this.csslayout+' section_breaks" id="field'+this.form_identifier+'-'+this.index+'"><div class="section_break" id="'+this.name+'" ></div><label>'+this.title+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
12
+ }
13
+ }
14
+ );
js/fields-public/15_fbuilder.fpagebreak.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fPageBreak' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fPageBreak' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Page Break",
7
+ ftype:"fPageBreak",
8
+ show:function()
9
+ {
10
+ return '<div class="fields '+this.csslayout+' section_breaks" id="field'+this.form_identifier+'-'+this.index+'"><div class="section_break" id="'+this.name+'" ></div><label>'+this.title+'</label><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
11
+ }
12
+ }
13
+ );
js/fields-public/16_fbuilder.fsummary.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fsummary' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fsummary' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Summary",
7
+ ftype:"fsummary",
8
+ fields:"",
9
+ titleClassname:"summary-field-title",
10
+ valueClassname:"summary-field-value",
11
+ fieldsArray:[],
12
+ show:function()
13
+ {
14
+ var me = this,
15
+ p = $.trim( me.fields.replace( /\,+/g, ',') ).split( ',' ),
16
+ l = p.length;
17
+ if( l )
18
+ {
19
+ var str = '<div class="fields '+me.csslayout+' cff-summary-field" id="field'+me.form_identifier+'-'+me.index+'">'+( ( !/^\s*$/.test( me.title ) ) ? '<h2>'+me.title+'</h2>': '' )+'<div id="'+me.name+'">';
20
+ for( var i = 0; i < l; i++ )
21
+ {
22
+ if( !/^\s*$/.test( p[ i ] ) )
23
+ {
24
+ p[ i ] = $.trim( p[ i ] );
25
+ str += '<div ref="'+p[i]+me.form_identifier+'" class="cff-summary-item"><span class="'+me.titleClassname+' cff-summary-title"></span><span class="'+me.valueClassname+' cff-summary-value"></span></div>';
26
+ }
27
+ }
28
+ str += '</div></div>';
29
+
30
+ return str;
31
+ }
32
+ },
33
+ after_show: function(){
34
+ var me = this,
35
+ p = $.trim(me.fields.replace( /\,+/g, ',') ).split( ',' ),
36
+ l = p.length;
37
+
38
+ if( l )
39
+ {
40
+ for( var i = 0; i < l; i++ )
41
+ {
42
+ if( !/^\s*$/.test( p[ i ] ) )
43
+ {
44
+ p[ i ] = $.trim( p[ i ] );
45
+ me.fieldsArray.push( p[ i ] + me.form_identifier );
46
+ $( document ).on( 'change', '#' + p[ i ] + me.form_identifier, function(){ me.update(); } );
47
+ }
48
+ }
49
+ $( document ).on( 'showHideDepEvent', function( evt, form_identifier )
50
+ {
51
+ me.update();
52
+ });
53
+
54
+ $( '#cp_calculatedfieldsf_pform'+me.form_identifier ).bind( 'reset', function(){ setTimeout( function(){ me.update(); }, 10 ); } );
55
+ }
56
+ },
57
+ update:function()
58
+ {
59
+ for ( var j = 0, k = this.fieldsArray.length; j < k; j++ )
60
+ {
61
+ var i = this.fieldsArray[ j ],
62
+ e = $( '[id="' + i + '"]'),
63
+ tt = $( '[ref="' + i + '"]');
64
+
65
+ if( e.length && tt.length )
66
+ {
67
+ var l = $( '#' + i )
68
+ .closest( '.fields' )
69
+ .find( 'label:first' )
70
+ .clone()
71
+ .find('.r,.dformat')
72
+ .remove()
73
+ .end(),
74
+ t = $.trim(l.text())
75
+ .replace(/\:$/,''),
76
+ v = [];
77
+
78
+ e.each(
79
+ function(){
80
+ var e = $(this);
81
+ if( /(checkbox|radio)/i.test( e.attr( 'type' ) ) && !e.is( ':checked' ) )
82
+ {
83
+ return;
84
+ }
85
+ else if( e[0].tagName == 'SELECT' )
86
+ {
87
+ v.push( $(e[0].options[ e[0].selectedIndex ]).attr( 'vt' ) );
88
+ }
89
+ else
90
+ {
91
+ if( e.attr( 'vt' ) )
92
+ {
93
+ v.push( e.attr( 'vt' ) );
94
+ }
95
+ else
96
+ {
97
+ var c = $( '[id="'+i+'_caption"]' );
98
+ v.push( ( c.length && !/^\s*$/.test( c.html() ) ) ? c.html() : e.val() );
99
+ }
100
+ }
101
+ }
102
+ );
103
+
104
+ tt.find( '.cff-summary-title' )[(/^\s*$/.test(t)) ? 'hide' : 'show']().html(t);
105
+ tt.find( '.cff-summary-value' ).html( v.join( ', ' ) );
106
+ if( e.hasClass( 'ignore' ) )
107
+ {
108
+ tt.hide();
109
+ }
110
+ else
111
+ {
112
+ tt.show();
113
+ }
114
+ }
115
+ }
116
+ }
117
+ });
js/fields-public/28_fbuilder.fcontainer.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fcontainer' ] = function(){};
2
+ $.fbuilder.controls[ 'fcontainer' ].prototype = {
3
+ fields:[],
4
+ columns:1,
5
+ after_show: function()
6
+ {
7
+ var e = $( '#'+this.name ), f;
8
+ for( var i = 0, h = this.fields.length; i < h; i++ )
9
+ {
10
+ f = $( '#'+this.fields[ i ]+this.form_identifier ).closest( '.fields' ).detach();
11
+ if( this.columns > 1 )
12
+ {
13
+ f.addClass( 'column'+this.columns );
14
+ if( i%this.columns == 0 ) f.css( 'clear', 'left' );
15
+ }
16
+ f.appendTo( e );
17
+ }
18
+ },
19
+ showHideDep:function( toShow, toHide, hiddenByContainer )
20
+ {
21
+ var me = this,
22
+ isHidden = ( typeof toHide[ me.name ] != 'undefined' || typeof hiddenByContainer[ me.name ] != 'undefined' ),
23
+ fId,
24
+ result = [];
25
+
26
+ for( var i = 0, h = me.fields.length; i < h; i++ )
27
+ {
28
+ fId = me.fields[ i ]+me.form_identifier;
29
+ if( isHidden )
30
+ {
31
+ if( typeof hiddenByContainer[ fId ] == 'undefined' ) hiddenByContainer[ fId ] = {};
32
+ if( typeof hiddenByContainer[ fId ][ me.name ] == 'undefined' )
33
+ {
34
+ hiddenByContainer[ fId ][ me.name ] = {};
35
+
36
+ if( typeof toHide[ fId ] == 'undefined' )
37
+ {
38
+ $( '#'+fId ).closest( '.fields' ).hide();
39
+ $( '[id*="'+fId+'"]:not(.ignore)' ).addClass( 'ignore' );
40
+ result.push( fId );
41
+ }
42
+ }
43
+ }
44
+ else
45
+ {
46
+ if( typeof hiddenByContainer[ fId ] != 'undefined' )
47
+ {
48
+ delete hiddenByContainer[ fId ][ me.name ];
49
+ if( $.isEmptyObject( hiddenByContainer[ fId ] ) )
50
+ {
51
+ delete hiddenByContainer[ fId ];
52
+ if( typeof toHide[ fId ] == 'undefined' )
53
+ {
54
+ $( '#'+fId ).closest( '.fields' ).show();
55
+ $( '[id*="'+fId+'"].ignore' ).removeClass( 'ignore' );
56
+ result.push( fId );
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ return result;
63
+ }
64
+ };
js/fields-public/29_fbuilder.ffieldset.fc.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'ffieldset' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'ffieldset' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"ffieldset",
8
+ fields:[],
9
+ columns:1,
10
+ show:function()
11
+ {
12
+ return '<div class="fields '+this.csslayout+' cff-container-field" id="field'+this.form_identifier+'-'+this.index+'"><FIELDSET id="'+this.name+'">'+( ( !/^\s*$/.test( this.title ) ) ? '<LEGEND>'+this.title+'</LEGEND>' : '' )+'</FIELDSET><div class="clearer"></div></div>';
13
+ },
14
+ after_show: function()
15
+ {
16
+ $.fbuilder.controls[ 'fcontainer' ].prototype.after_show.call(this);
17
+ },
18
+ showHideDep:function( toShow, toHide, hiddenByContainer )
19
+ {
20
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.showHideDep.call( this, toShow, toHide, hiddenByContainer );
21
+ }
22
+ }
23
+ );
js/fields-public/30_fbuilder.fdiv.fc.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fdiv' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fdiv' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ ftype:"fdiv",
7
+ fields:[],
8
+ columns:1,
9
+ show:function()
10
+ {
11
+ return '<div class="fields '+this.csslayout+' cff-container-field" id="field'+this.form_identifier+'-'+this.index+'"><div id="'+this.name+'"></div><div class="clearer"></div></div>';
12
+ },
13
+ after_show: function()
14
+ {
15
+ $.fbuilder.controls[ 'fcontainer' ].prototype.after_show.call(this);
16
+ },
17
+ showHideDep:function( toShow, toHide, hiddenByContainer )
18
+ {
19
+ return $.fbuilder.controls[ 'fcontainer' ].prototype.showHideDep.call( this, toShow, toHide, hiddenByContainer );
20
+ }
21
+ }
22
+ );
js/fields-public/31_fbuilder.fmedia.js ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fMedia' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fMedia' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ ftype:"fMedia",
7
+ sMediaType:"image", // image, audio, video
8
+ data:{
9
+ image:{
10
+ sWidth:"",
11
+ sHeight:"",
12
+ sSrc:"",
13
+ sAlt:"",
14
+ sLink:"",
15
+ sTarget:"",
16
+ sFigcaption: ""
17
+ },
18
+ audio:{
19
+ sWidth:"",
20
+ sSrc:"",
21
+ sSrcAlt:"",
22
+ sControls:1,
23
+ sLoop:0,
24
+ sAutoplay:0,
25
+ sMuted:0,
26
+ sPreload: "auto",
27
+ sFallback: "",
28
+ sFigcaption: ""
29
+ },
30
+ video:{
31
+ sWidth:"",
32
+ sHeight:"",
33
+ sSrc:"",
34
+ sSrcAlt:"",
35
+ sPoster:"",
36
+ sControls:1,
37
+ sLoop:0,
38
+ sAutoplay:0,
39
+ sMuted:0,
40
+ sPreload: "auto",
41
+ sFallback: "",
42
+ sFigcaption: ""
43
+ }
44
+ },
45
+ _show_image: function()
46
+ {
47
+ var d = this.data.image,
48
+ esc = $.fbuilder.htmlEncode,
49
+ a = [],
50
+ l = [],
51
+ r = '';
52
+
53
+ if( $.trim( d.sWidth ) ) a.push( 'width="'+esc( d.sWidth )+'"' );
54
+ if( $.trim( d.sHeight ) ) a.push( 'height="'+esc( d.sHeight )+'"' );
55
+ if( $.trim( d.sSrc ) ) a.push( 'src="'+esc( d.sSrc )+'"' );
56
+ if( $.trim( d.sAlt ) ) a.push( 'alt="'+esc( d.sAlt )+'"' );
57
+ if( $.trim( d.sLink ) )
58
+ {
59
+ l.push( 'href="'+esc( d.sLink )+'"' );
60
+ if( $.trim( d.sTarget ) ) l.push( 'target="'+esc( d.sTarget )+'"' );
61
+ r = '<a '+l.join( ' ' )+' ><img '+a.join( ' ' )+' /></a>';
62
+ }
63
+ else
64
+ {
65
+ r = '<img '+a.join( ' ' )+' />';
66
+ }
67
+
68
+ return r;
69
+ },
70
+ _show_audio_video: function( d, isV )
71
+ {
72
+ var esc = $.fbuilder.htmlEncode,
73
+ a = [],
74
+ t = ( isV ) ? 'video' : 'audio' ;
75
+
76
+ if( $.trim( d.sWidth ) ) a.push( 'width="'+esc( d.sWidth )+'"' );
77
+ if( isV && $.trim( d.sHeight ) ) a.push( 'height="'+esc( d.sHeight )+'"' );
78
+ if( isV && $.trim( d.sPoster ) ) a.push( 'poster="'+esc( d.sPoster )+'"' );
79
+ if( $.trim( d.sSrc ) ) a.push( 'src="'+esc( d.sSrc )+'"' );
80
+ if( d.sAutoplay ) a.push( 'autoplay' );
81
+ if( d.sControls ) a.push( 'controls' );
82
+ if( d.sLoop ) a.push( 'loop' );
83
+ if( d.sMuted ) a.push( 'muted' );
84
+ a.push( 'preload="'+esc( d.sPreload )+'"' );
85
+
86
+ return '<'+t+' '+a.join( ' ' )+'>'+( ( $.trim( d.sSrcAlt ) ) ? '<source src="'+esc( d.sSrcAlt )+'" />' : '' )+'<p>'+d.sFallback+'</p></'+t+'>';
87
+ },
88
+ _show_audio: function()
89
+ {
90
+ return this._show_audio_video( this.data.audio, false );
91
+ },
92
+ _show_video: function()
93
+ {
94
+ return this._show_audio_video( this.data.video, true );
95
+ },
96
+ show:function()
97
+ {
98
+ return '<div class="fields '+this.csslayout+' cff-media-field" id="field'+this.form_identifier+'-'+this.index+'"><div class="clearer"><div class="field" id="'+this.name+'">'+this[ '_show_'+this.sMediaType]()+'</div></div><span class="uh">'+this.data[ this.sMediaType].sFigcaption+'</span><div class="clearer"></div></div>';
99
+ }
100
+ }
101
+ );
js/fields-public/32_fbuilder.fbutton.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fButton' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fButton' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ ftype:"fButton",
7
+ sType:"button",
8
+ sValue:"button",
9
+ sOnclick:"",
10
+ userhelp:"A description of the section goes here.",
11
+ show:function()
12
+ {
13
+ var esc = function( v ){ v = v.replace( /&lt/g, '&amp;').replace(/"/g, "&quot;").replace( /\n+/g, ' ' ); return v;},
14
+ type = this.sType,
15
+ clss = '';
16
+
17
+ if( this.sType == 'calculate' )
18
+ {
19
+ type = 'button';
20
+ clss = 'calculate-button';
21
+ }
22
+ else if( this.sType == 'reset' )
23
+ {
24
+ clss = 'reset-button';
25
+ }
26
+
27
+ return '<div class="fields '+this.csslayout+' cff-button-field" id="field'+this.form_identifier+'-'+this.index+'"><input id="'+this.name+'" type="'+type+'" value="'+esc( this.sValue )+'" class="field '+clss+'" onclick="'+esc( this.sOnclick )+'" /><span class="uh">'+this.userhelp+'</span><div class="clearer"></div></div>';
28
+ },
29
+ after_show:function()
30
+ {
31
+ $( '#'+this.name ).click(
32
+ function()
33
+ {
34
+ var e = $( this );
35
+ if( e.hasClass( 'calculate-button' ) )
36
+ {
37
+ var suffix = e.attr( 'id' ).match(/_\d+$/)[0],
38
+ items = $.fbuilder[ 'forms' ][ suffix ].getItems();
39
+
40
+ $.fbuilder[ 'calculator' ].defaultCalc( '#'+e.closest( 'form' ).attr( 'id' ) );
41
+ for(var i = 0, h = items.length; i < h; i++ )
42
+ {
43
+ if(items[i].ftype == 'fsummary')
44
+ {
45
+ items[i].update();
46
+ }
47
+ }
48
+ }
49
+ if( e.hasClass( 'reset-button' ) )
50
+ {
51
+ setTimeout(
52
+ function()
53
+ {
54
+ var identifier = e.closest( 'form' ).attr( 'id' ).replace( /cp_calculatedfieldsf_pform/, '' );
55
+ $.fbuilder[ 'showHideDep' ]( { 'formIdentifier' : identifier } );
56
+
57
+ var page = parseInt( e.closest( '.pbreak' ).attr( 'page' ) );
58
+ if( page )
59
+ {
60
+ $("#fieldlist"+identifier+" .pbreak").css("display","none");
61
+ $("#fieldlist"+identifier+" .pbreak").find(".field").addClass("ignorepb");
62
+ $("#fieldlist"+identifier+" .pb0").css("display","block");
63
+ if ($("#fieldlist"+identifier+" .pb0").find(".field").length>0)
64
+ {
65
+ $("#fieldlist"+identifier+" .pb0").find(".field").removeClass("ignorepb");
66
+ try
67
+ {
68
+ $("#fieldlist"+identifier+" .pb0").find(".field")[0].focus();
69
+ }
70
+ catch(e){}
71
+ }
72
+ }
73
+ },
74
+ 50
75
+ );
76
+ }
77
+ }
78
+ );
79
+ }
80
+ }
81
+ );
js/fields-public/34_fbuilder.fhtml.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fhtml' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fhtml' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ ftype:"fhtml",
7
+ fcontent:"",
8
+ show:function()
9
+ {
10
+ return '<div class="fields '+this.csslayout+' cff-html-field" id="field'+this.form_identifier+'-'+this.index+'"><div id="'+this.name+'" class="dfield">'+$( '<div/>' ).html( this.fcontent ).html()+'</div><div class="clearer"></div></div>';
11
+ }
12
+ }
13
+ );
js/fields-public/36_fbuilder.acceptance.js ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'facceptance' ]=function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'facceptance' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Accept terms and conditions",
7
+ ftype:"facceptance",
8
+ value:"I accept",
9
+ required:true,
10
+ url:"",
11
+ message:"",
12
+ show:function()
13
+ {
14
+ var me = this,
15
+ dlg = '',
16
+ label = me.title;
17
+
18
+ if(!/^\s*$/.test(me.url))
19
+ {
20
+ label = '<a href="'+$.fbuilder.htmlEncode($.trim(me.url))+'" target="_blank">'+label+'</a>';
21
+ }
22
+ else if(!/^\s*$/.test(me.message))
23
+ {
24
+ label = '<a href="javascript:void(0);" class="cff-open-dlg">'+label+'</a>';
25
+ dlg += '<div class="cff-dialog hide"><span class="cff-close-dlg"></span><div class="cff-dialog-content">'+me.message+'</div></div>'
26
+ }
27
+ return '<div class="fields '+me.csslayout+' cff-checkbox-field" id="field'+me.form_identifier+'-'+me.index+'"><div class="dfield">'+
28
+ '<div class="one_column"><label><input name="'+me.name+'" id="'+me.name+'" class="field required" value="'+$.fbuilder.htmlEncode(me.value)+'" vt="'+$.fbuilder.htmlEncode((/^\s*$/.test(me.value)) ? me.title : me.value)+'" type="checkbox" /> <span>'+
29
+ $.fbuilder.htmlDecode( label )+''+((me.required)?'<span class="r">*</span>':'')+
30
+ '</span></label></div>'+
31
+ dlg+
32
+ '</div><div class="clearer"></div></div>';
33
+ },
34
+ after_show:function()
35
+ {
36
+ $(document).on('click','.cff-open-dlg', function(){
37
+ var dlg = $(this).closest('.fields').find('.cff-dialog'), w = dlg.data('width'), h=dlg.data('height');
38
+ dlg.removeClass('hide');
39
+
40
+ if('undefined' == typeof w) w = MIN($(this).closest('form').width(), $(window).width(), dlg.width());
41
+ if('undefined' == typeof h) h = MIN($(this).closest('form').height(), $(window).height(), dlg.height());
42
+
43
+ dlg.data('width',w);
44
+ dlg.data('height',h);
45
+
46
+ dlg.css({'width': w+'px', 'height': h+'px', 'margin-top': (-1*h/2)+'px', 'margin-left': (-1*w/2)+'px'});
47
+ });
48
+ $(document).on('click','.cff-close-dlg', function(){$(this).closest('.cff-dialog').addClass('hide');});
49
+ },
50
+ val:function()
51
+ {
52
+ var e = $('[id="'+this.name+'"]:checked:not(.ignore)');
53
+ if( e.length )
54
+ {
55
+ var t = $.fbuilder.parseValStr( e[0].value );
56
+ if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');
57
+ }
58
+ return (v) ? (($.isNumeric(v)) ? v : '"'+v+'"') : 0;
59
+ }
60
+ }
61
+ );
js/fields-public/fbuilder.fcalculated.js ADDED
@@ -0,0 +1,580 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $.fbuilder.controls[ 'fCalculated' ] = function(){};
2
+ $.extend(
3
+ $.fbuilder.controls[ 'fCalculated' ].prototype,
4
+ $.fbuilder.controls[ 'ffields' ].prototype,
5
+ {
6
+ title:"Untitled",
7
+ ftype:"fCalculated",
8
+ predefined:"",
9
+ required:false,
10
+ size:"medium",
11
+ eq:"",
12
+ suffix:"",
13
+ prefix:"",
14
+ decimalsymbol:".",
15
+ groupingsymbol:"",
16
+ dependencies:[ {'rule' : '', 'complex' : false, 'fields' : [ '' ] } ],
17
+ readonly:true,
18
+ hidefield:false,
19
+ show:function()
20
+ {
21
+ return '<div class="fields '+this.csslayout+' cff-calculated-field" id="field'+this.form_identifier+'-'+this.index+'" style="'+((this.hidefield)? 'padding:0;margin:0;border:0;opacity:0;width:0;height:0;overflow:hidden;' : '' )+'"><label>'+this.title+''+( ( this.required ) ? '<span class="r">*</span>' : '' )+'</label><div class="dfield"><input id="'+this.name+'" name="'+this.name+'" '+((this.readonly) ? ' readonly ' : '')+' class="codepeoplecalculatedfield field '+this.size+((this.required)?" required":"")+'" type="'+( ( this.hidefield ) ? 'hidden' : 'text' )+'" value="'+this.predefined+'"/>'+( ( !this.hidefield ) ? '<span class="uh">'+this.userhelp+'</span>' : '' )+'</div><div class="clearer"></div></div>';
22
+ },
23
+ after_show:function()
24
+ {
25
+ // Add equations
26
+ var me = this,
27
+ configuration = { "suffix" : me.suffix, "prefix" : me.prefix, "groupingsymbol" : me.groupingsymbol, "decimalsymbol" : me.decimalsymbol },
28
+ dependencies = [];
29
+
30
+ $.each( me.dependencies, function( i, d )
31
+ {
32
+ d.rule = d.rule.replace( /^\s+/, '').replace( /\s+$/, '');
33
+ if( d.rule != '' && d.fields.length ){
34
+
35
+ var fields = [];
36
+ $.each( d.fields, function( j, f ){
37
+ if( f != '' )
38
+ {
39
+ fields.push( f );
40
+ }
41
+ });
42
+
43
+ if( fields.length ){
44
+ dependencies.push( { 'rule' : d.rule, 'fields' : fields } );
45
+ }
46
+ }
47
+ });
48
+
49
+ me.dependencies = dependencies;
50
+ var eq = me.eq;
51
+ eq = eq.replace(/\n/g, ' ').replace(/fieldname(\d+)/g, "fieldname$1"+me.form_identifier).replace( /form_identifier/g, '\''+this[ 'form_identifier' ]+'\'').replace( /;\s*\)/g, ')').replace(/;\s*$/, '');
52
+
53
+ if( !/^\s*$/.test(eq) )
54
+ {
55
+ $.fbuilder.calculator.addEquation( me.name, eq, configuration, dependencies, me.form_identifier );
56
+ }
57
+
58
+ // Events
59
+ var e = $( '[id="'+me.name+'"]' );
60
+ e.bind(
61
+ 'calcualtedfield_changed',
62
+ {obj: me},
63
+ function( evt ){
64
+ if( $.fbuilder[ 'calculator' ].getDepList( evt.data.obj.name, evt.data.obj.val(), evt.data.obj.dependencies ) )
65
+ {
66
+ $.fbuilder.showHideDep(
67
+ {
68
+ 'formIdentifier' : evt.data.obj.form_identifier,
69
+ 'fieldIdentifier': evt.data.obj.name,
70
+ 'throwEvent' : false
71
+ }
72
+ );
73
+ }
74
+ }
75
+ );
76
+ },
77
+ showHideDep: function( toShow, toHide, hiddenByContainer )
78
+ {
79
+ var me = this,
80
+ result = [];
81
+
82
+ if($.fbuilder[ 'calculator' ].getDepList(me.name, me.val(), me.dependencies))
83
+ {
84
+ var item = $( '#'+me.name ),
85
+ identifier = me.form_identifier,
86
+ isHidden= ( typeof toHide[ me.name ] != 'undefined' || typeof hiddenByContainer[ me.name ] != 'undefined' ),
87
+ d, n, dep,
88
+ clearRef = function(id){
89
+ if( typeof toShow[ id ] != 'undefined' )
90
+ {
91
+ delete toShow[ id ][ 'ref' ][ me.name ];
92
+ if( $.isEmptyObject(toShow[ id ][ 'ref' ]) )
93
+ delete toShow[ id ];
94
+ }
95
+ },
96
+ hideField = function(id){
97
+ $( '#'+id ).closest( '.fields' ).hide();
98
+ $( '[id*="'+id+'"]:not(.ignore)' ).addClass( 'ignore' );
99
+ toHide[ id ] = {};
100
+ };
101
+
102
+ try
103
+ {
104
+ d = item.attr( 'dep' );
105
+ if( typeof d != 'undefined' && !/^\s*$/.test( d ) ) d = d.split( ',' );
106
+ else d = [];
107
+
108
+ n = item.attr( 'notdep' );
109
+ if( typeof n != 'undefined' && !/^\s*$/.test( n ) ) n = n.split( ',' );
110
+ else n = [];
111
+
112
+ if(isHidden)
113
+ {
114
+ n = n.concat(d);
115
+ d = [];
116
+ }
117
+
118
+ for ( i=0; i<d.length; i++ )
119
+ {
120
+ dep = d[i]+identifier;
121
+ delete toHide[ dep ];
122
+ if( typeof toShow[ dep ] == 'undefined' )
123
+ toShow[ dep ] = { 'ref': {}};
124
+ toShow[ dep ][ 'ref' ][ me.name ] = 1;
125
+ if(!(dep in hiddenByContainer))
126
+ {
127
+ $( '#' + dep ).closest( '.fields' ).show();
128
+ $( '[id*="'+dep+'"].ignore' ).removeClass( 'ignore' );
129
+ }
130
+ if($.inArray(dep,result) == -1) result.push( dep );
131
+ }
132
+
133
+ for ( i=0; i<n.length; i++ )
134
+ {
135
+ dep = n[i]+identifier;
136
+ clearRef(dep);
137
+ if (
138
+ typeof toShow[ dep ] == 'undefined' &&
139
+ typeof toHide[ dep ] == 'undefined'
140
+ ) hideField(dep);
141
+ if($.inArray(dep,result) == -1) result.push( dep );
142
+ }
143
+ }
144
+ catch(e){}
145
+ }
146
+ return result;
147
+ },
148
+ val : function()
149
+ {
150
+ var e = $( '[id="' + this.name + '"]:not(.ignore)' );
151
+ if( e.length )
152
+ {
153
+ var v = $.trim( e.val() );
154
+
155
+ v = v.replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.prefix), 'g' ), '' )
156
+ .replace( new RegExp( $.fbuilder[ 'escape_symbol' ](this.suffix), 'g' ), '' );
157
+
158
+ return $.fbuilder.parseVal( v, this.groupingsymbol, this.decimalsymbol );
159
+ }
160
+ return 0;
161
+ }
162
+ }
163
+ );
164
+
165
+ /*
166
+ * Extend the window object with the methods of obj, the prefix is used to avoid redefine window methods
167
+ */
168
+ $.fbuilder[ 'extend_window' ] = function( prefix, obj)
169
+ {
170
+ for( method in obj )
171
+ {
172
+ window[ prefix+method ] = (function( m )
173
+ {
174
+ return function()
175
+ {
176
+ return m.obj[ m.method_name ].apply( m.obj, arguments );
177
+ };
178
+ })({ "method_name" : method, 'obj' : obj });
179
+ }
180
+ };
181
+
182
+ // Calculate Field code
183
+ $.fbuilder[ 'calculator' ] = (function()
184
+ {
185
+ // Used to validate the equations results
186
+ var validators = [];
187
+
188
+ // Loading available modules
189
+ if( typeof $.fbuilder[ 'modules' ] != 'undefined' )
190
+ {
191
+ var modules = $.fbuilder[ 'modules' ];
192
+ for( var module in modules )
193
+ {
194
+ if( typeof modules[ module ][ 'callback' ] != 'undefined' )
195
+ {
196
+ modules[ module ][ 'callback' ]();
197
+ }
198
+
199
+ if( typeof modules[ module ][ 'validator' ] != 'undefined' )
200
+ {
201
+ validators.push( modules[ module ][ 'validator' ] );
202
+ }
203
+ }
204
+ }
205
+
206
+ // Private function to validate the equation results
207
+ _validate_result = function( v )
208
+ {
209
+ if( validators.length )
210
+ {
211
+ var h = validators.length;
212
+ while( h-- )
213
+ {
214
+ if( validators[ h ]( v ) )
215
+ {
216
+ return true;
217
+ }
218
+ }
219
+ }
220
+ else
221
+ {
222
+ return true;
223
+ }
224
+
225
+ return false;
226
+ };
227
+
228
+ // Private function, the variable names in the equations are replaced by its values, return the equation result or false if error
229
+ _calculate = function( eq, suffix, __ME__ )
230
+ {
231
+ var _match,
232
+ field_regexp = new RegExp( '(fieldname\\d+'+suffix+')([\\D\\b])'),
233
+ __ME__ = (__ME__) ? $.fbuilder['forms'][suffix].getItem( __ME__ ).val() : '';
234
+
235
+ $.fbuilder['currentFormId'] = $.fbuilder['forms'][suffix].formId;
236
+
237
+ eq = '(' + eq + ')';
238
+
239
+ while ( _match = field_regexp.exec( eq ) )
240
+ {
241
+ var field = $.fbuilder[ 'forms' ][ suffix ].getItem( _match[1] ),
242
+ v = '';
243
+ if( field )
244
+ {
245
+ v = field.val();
246
+ if( $.isNumeric( v ) ) v = '('+v+')';
247
+ else if( typeof v == 'object' && typeof window.JSON != 'undefined' ) v = JSON.stringify( v );
248
+ }
249
+ eq = eq.replace( _match[0], v+''+_match[2] ); // Replace the variable name by value
250
+ }
251
+ try
252
+ {
253
+ var r = eval( eq.replace( /^\(/, '' ).replace( /\)$/, '' ).replace( /\b__ME__\b/g, __ME__ ) ); // Evaluate the final equation
254
+ return ( typeof r != 'undefined' && _validate_result( r ) ) ? r : false;
255
+ }
256
+ catch(e)
257
+ {
258
+ return false;
259
+ }
260
+ };
261
+
262
+ _checkValueThrowingEquation = function( t )
263
+ {
264
+ if( typeof t.attr( 'data-timeout' ) != 'undefined' ) clearTimeout( t.attr( 'data-timeout' ) );
265
+ if( typeof t.attr( 'data-previousvalue' ) == 'undefined' ) t.attr( 'data-previousvalue', t.val() );
266
+ else
267
+ {
268
+ if( t.val() == t.attr( 'data-previousvalue' ) )
269
+ {
270
+ t.removeAttr( 'data-timeout' );
271
+ obj.Calculate( t[0] );
272
+ return;
273
+ }
274
+ t.attr( 'data-previousvalue', t.val() );
275
+ }
276
+ t.attr( 'data-timeout', setTimeout( _checkValueThrowingEquation, 500, t ) );
277
+ };
278
+
279
+ // The public object
280
+ var CalcFieldClss = function(){};
281
+ CalcFieldClss.prototype = {
282
+ processing_queue : false, // Flag indicating the queued equations are being processed
283
+ // object where attributes names are the forms identifiers, and their values the queue of equations
284
+ queued_equations : {},
285
+ addEquation : function( calculated_field, equation, configuration, dependencies, form_identifier )
286
+ {
287
+ var equation_result = $('[id="'+calculated_field+'"]');
288
+ if(equation_result.length)
289
+ {
290
+ var form = equation_result[0].form,
291
+ equationObj, field,
292
+ regexp = new RegExp( '(fieldname\\d+)_' ),
293
+ match;
294
+
295
+ if( typeof form.equations == 'undefined' ) form['equations'] = [];
296
+ var i, j=-1, h = form.equations.length;
297
+
298
+ // Avoid insert the equation multiple times to the form
299
+ for( i = 0 ; i < h; i++ )
300
+ {
301
+ if( form.equations[ i ].result == calculated_field ) break;
302
+ if( form.equations[ i ].equation.match( calculated_field ) ){ j = i; break; }
303
+ }
304
+
305
+ // The equation hasn't been inserted previously
306
+ if( i == h || j != -1)
307
+ {
308
+ equationObj = {'result':calculated_field, 'equation':equation, 'conf':configuration, 'dep':dependencies, 'identifier':form_identifier};
309
+ form.equations.splice(i, 0, equationObj);
310
+ while ( match = regexp.exec( equation ) )
311
+ {
312
+ field = $.fbuilder[ 'forms' ][ form_identifier ].getItem( match[1]+form_identifier );
313
+ if( field )
314
+ {
315
+ if( typeof field.usedInEquations == 'undefined' ) field.usedInEquations = [];
316
+ field.usedInEquations.push( equationObj );
317
+ }
318
+ equation = equation.replace( new RegExp( match[0], 'g' ), '' );
319
+ }
320
+ }
321
+ }
322
+
323
+ },
324
+ enqueueEquation : function( form_identifier, equations )
325
+ {
326
+ if( typeof this.queued_equations[ form_identifier ] == 'undefined' )
327
+ this.queued_equations[ form_identifier ] = [];
328
+ var queue = this.queued_equations[ form_identifier ], f;
329
+
330
+ for( var i = 0, h = equations.length; i < h; i++ )
331
+ {
332
+ f = -1;
333
+ for( var j = 0, k = queue.length; j < k; j++ )
334
+ {
335
+ if( queue[ j ].result == equations[ i ].result ) break;
336
+ if( queue[ j ].equation.match( equations[ i ].result ) ){ f = j; break; }
337
+ }
338
+ if( j == k || f != -1)
339
+ {
340
+ queue.splice(j, 0, equations[ i ]);
341
+ }
342
+ }
343
+ },
344
+ getDepList : function( calculated_field, value, dependencies ) // Get the list of dependent fields
345
+ {
346
+ var list = [], // Fields that comply the rules
347
+ list_h = []; // Fields that don't comply the rules
348
+
349
+ // The value is correct and the field has dependencies
350
+ if( value !== false && dependencies.length )
351
+ {
352
+ for( var i = 0, h = dependencies.length; i < h; i++ )
353
+ {
354
+ try
355
+ {
356
+ // Get the rule and evaluate
357
+ var rule = eval(dependencies[i].rule.replace( /value/gi, value ));
358
+ $.each( dependencies[i].fields, function( j, e )
359
+ {
360
+ if( e != '' )
361
+ {
362
+ if( rule )
363
+ {
364
+ var k = $.inArray(e, list_h);
365
+ if( k != -1) list_h.splice( k, 1 );
366
+ if( $.inArray(e, list) == -1) list.push( e );
367
+ }
368
+ else
369
+ {
370
+ if( $.inArray(e, list) == -1) list_h.push( e );
371
+ }
372
+ }
373
+ });
374
+
375
+ }
376
+ catch(e)
377
+ {
378
+ continue;
379
+ }
380
+ }
381
+ }
382
+
383
+ $('[id="'+calculated_field+'"]').attr( 'dep', list.join(',') ).attr('notdep', list_h.join( ',' ) );
384
+ return list.length || list_h.length;
385
+ },
386
+
387
+ defaultCalc : function( form_identifier, recalculate ) // Evaluate all equations in form
388
+ {
389
+ var form = $( form_identifier ),
390
+ fSec = form_identifier.match( /_\d+$/ )[0],
391
+ dep = false;
392
+
393
+ // The form exists and has equations
394
+ if( form.length )
395
+ {
396
+ if( typeof form[0].equations != 'undefined' )
397
+ {
398
+ this.queued_equations[ fSec ] = form[0].equations.slice( 0 );
399
+ this.processQueue( fSec );
400
+ }
401
+ $( form ).trigger( 'cpcff_default_calc' );
402
+ }
403
+ },
404
+
405
+ Calculate : function ( field )
406
+ {
407
+ if( field.id == undefined ) return;
408
+ var id = field.id,
409
+ fSec = id.match( /(_\d+)?_\d+$/ ),
410
+ item,
411
+ me = this;
412
+
413
+ if( fSec )
414
+ {
415
+ fSec = ( typeof fSec[1] != 'undefined' ) ? fSec[1] : fSec[0];
416
+ item = $.fbuilder[ 'forms' ][ fSec ].getItem( id );
417
+ if( item && typeof item['usedInEquations'] != 'undefined' )
418
+ {
419
+ me.enqueueEquation( fSec, item.usedInEquations );
420
+ me.processQueue( fSec );
421
+ }
422
+ }
423
+ },
424
+ processQueue : function( fSec )
425
+ {
426
+ if( this.processing_queue ) return;
427
+ this.processing_queue = true;
428
+
429
+ if( typeof this.queued_equations[ fSec ] != 'undefined' )
430
+ {
431
+ var queue = this.queued_equations[ fSec ], eq_obj;
432
+ while( queue.length )
433
+ {
434
+ eq_obj = queue.shift();
435
+ var field = $( '[id="' + eq_obj.result+'"]' ),
436
+ result = _calculate( eq_obj.equation, eq_obj.identifier, eq_obj.result),
437
+ bk = field.data('bk');
438
+
439
+ field.val( ( result !== false ) ? this.format( result, eq_obj.conf) : '' );
440
+ if(bk != field.val())
441
+ {
442
+ field.trigger( 'calcualtedfield_changed' );
443
+ field.change();
444
+ }
445
+ field.data('bk',field.val());
446
+ }
447
+ }
448
+
449
+ this.processing_queue = false;
450
+ },
451
+ format : function( value, config )
452
+ {
453
+ if( !/^\s*$/.test( value ) )
454
+ {
455
+ if( $.isNumeric( value ) && !/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)/.test( value ) )
456
+ {
457
+
458
+ var symbol = ( value < 0 ) ? '-' : '',
459
+ parts = value.toString().replace( "-", "" ).split("."),
460
+ counter = 0,
461
+ str = '';
462
+
463
+ if(config.groupingsymbol)
464
+ {
465
+ for( var i = parts[0].length-1; i >= 0; i--){
466
+ counter++;
467
+ str = parts[0][i] + str;
468
+ if( counter%3 == 0 && i != 0 ) str = config.groupingsymbol + str;
469
+
470
+ }
471
+ parts[0] = str;
472
+ }
473
+
474
+ value = symbol+parts.join( config.decimalsymbol );
475
+ }
476
+
477
+ if( config.prefix )
478
+ {
479
+ value = config.prefix + value;
480
+ }
481
+ if( config.suffix )
482
+ {
483
+ value += config.suffix;
484
+ }
485
+ }
486
+ return value;
487
+ },
488
+
489
+ unformat : function( field )
490
+ {
491
+
492
+ var escape_symbol = $.fbuilder.escape_symbol;
493
+
494
+ var eq = field[0].form.equations,
495
+ v = field.val();
496
+
497
+ for(var i = 0, h = eq.length; i < h; i++)
498
+ {
499
+ if(eq[i].result == field[0].id)
500
+ {
501
+ var c = eq[i].conf; // Configuration object
502
+
503
+ if( c.prefix && !/^\s*$/.test( c.prefix ) )
504
+ {
505
+ v = v.replace( new RegExp( "^" + escape_symbol( c.prefix ) ), '' );
506
+ }
507
+
508
+ if( c.suffix && !/^\s*$/.test( c.suffix ) )
509
+ {
510
+ v = v.replace( new RegExp( escape_symbol( c.suffix ) + "$" ), '' );
511
+ }
512
+
513
+ if( !/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)/.test( v ) )
514
+ {
515
+ if( c.groupingsymbol && !/^\s*$/.test( c.groupingsymbol ) )
516
+ {
517
+ v = v.replace( new RegExp( escape_symbol( c.groupingsymbol ), 'g' ), '' );
518
+ }
519
+
520
+ if( c.decimalsymbol && !/^\s*$/.test( c.decimalsymbol ) )
521
+ {
522
+ v = v.replace( new RegExp( escape_symbol( c.decimalsymbol ), 'g' ), '.' );
523
+ }
524
+ }
525
+ }
526
+ }
527
+ return v;
528
+ }
529
+ };
530
+
531
+ var obj = new CalcFieldClss();
532
+
533
+ // Associate events to the document for throw the corresponding equations
534
+ $( document ).bind('keyup change blur', function(evt)
535
+ {
536
+ // If evalequations = 0 the equations shouldn't be evaluated dynamically
537
+ var t = $( evt.target ),
538
+ f = t.closest( 'form' ),
539
+ evalequations = f.attr( 'data-evalequations' ),
540
+ evalequationsevent = f.attr( 'data-evalequationsevent' );
541
+
542
+ if(
543
+ typeof evalequations != 'undefined' &&
544
+ evalequations*1 == 0 &&
545
+ !( t.hasClass( 'codepeoplecalculatedfield' ) && evt.type == 'change' )
546
+ )
547
+ {
548
+ return;
549
+ }
550
+
551
+ if( evt.type == 'keyup' )
552
+ {
553
+ if('undefined' != typeof evalequationsevent && evalequationsevent*1 == 1)
554
+ {
555
+ return;
556
+ }
557
+ // The key out of range
558
+ if(evt.keyCode && (evt.keyCode >= 33 && evt.keyCode <= 40)) return;
559
+ _checkValueThrowingEquation( t );
560
+ }
561
+ else
562
+ {
563
+ if( t.hasClass( 'depItem' ) || ( t.prop( 'tagName' ) == 'INPUT' && t.attr( 'type' ).toLowerCase() == 'text' && evt.type != 'change' ) )
564
+ {
565
+ return;
566
+ }
567
+ obj.Calculate( t[0] );
568
+ }
569
+ });
570
+
571
+ //Associate an event to the document waiting for the showHideDepEvent and recalculate all equations
572
+ $(document).bind( 'showHideDepEvent', function( evt, form_identifier )
573
+ {
574
+ // If evalequations = 0 the equations shouldn't be evaluated dynamically
575
+ var fId = '#'+form_identifier, evalequations = $( fId ).attr( 'data-evalequations' );
576
+ if( typeof evalequations == 'undefined' || evalequations*1 == 1 ) obj.defaultCalc( fId );
577
+ });
578
+ return obj; // Return the public object
579
+ }
580
+ )();
js/fields-public/jquery.ui.touch-punch.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ try{
2
+ !function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
3
+ }catch( err ){}
js/fields-public/localstorage.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof $.fn['fbuilder_serializeObject'] == 'undefined')
2
+ {
3
+ $.fn.fbuilder_serializeObject = function()
4
+ {
5
+ var o = {},
6
+ a = this.serializeArray();
7
+
8
+ $.each(a, function() {
9
+ if(/^fieldname\d+_\d+(\[\])?$/.test(this.name)) this.name = this.name.match(/fieldname\d+/)[0];
10
+ else return;
11
+ if (o[this.name]) {
12
+ if (!o[this.name].push) {
13
+ o[this.name] = [o[this.name]];
14
+ }
15
+ o[this.name].push(this.value || '');
16
+ } else {
17
+ o[this.name] = this.value || '';
18
+ }
19
+ });
20
+ return o;
21
+ };
22
+ }
23
+
24
+ $.fn.fbuilder_localstorage = function(){
25
+ var form = this,
26
+ id = form.attr('id'),
27
+ sq = (typeof id == 'undefined') ? 1 : id.replace(/[^\d]/g,''),
28
+ localStore_obj,
29
+ fields;
30
+ if(sq == '') sq = 1;
31
+ localStore_obj = new $.fbuilder_localstorage(form, true);
32
+ $(document).on('change', '#'+id+' *', function(evt){
33
+ if(
34
+ typeof this['id'] != 'undefined' &&
35
+ /^fieldname\d+_\d+$/i.test(this.id) &&
36
+ typeof this['value'] != 'undefined'
37
+ )
38
+ {
39
+ localStore_obj.set_fields();
40
+ }
41
+ });
42
+ form.on('submit', function(){localStore_obj.clear_fields();});
43
+ fields = localStore_obj.get_fields();
44
+ if(!$.isEmptyObject(fields))
45
+ {
46
+ if(typeof cpcff_default == 'undefined') cpcff_default = {};
47
+ if(typeof cpcff_default[sq] == 'undefined') cpcff_default[sq] = {};
48
+ cpcff_default[sq] = $.extend(cpcff_default[sq], fields);
49
+ }
50
+ return this;
51
+ }
52
+
53
+ $.fbuilder_localstorage = function(form, debug){
54
+ this.form = form;
55
+ this.id = form.attr('id')+'_'+form.find('[name="cp_calculatedfieldsf_id"]').val();
56
+ this.debug = (typeof debug != 'undefined' && debug) ? true : false;
57
+ };
58
+
59
+ $.fbuilder_localstorage.prototype = (function(){
60
+
61
+ /** Private variables **/
62
+ var is_available;
63
+
64
+ /** Private functions **/
65
+ function _log(mssg)
66
+ {
67
+ if(typeof console != 'undefined') console.log(mssg);
68
+ };
69
+
70
+ return {
71
+ is_available : function() {
72
+ if(typeof is_available != 'undefined') return is_available;
73
+ try {
74
+ var storage = window['localStorage'],
75
+ x = '__storage_test__';
76
+ storage.setItem(x, x);
77
+ storage.removeItem(x);
78
+ is_available = true;
79
+ return true;
80
+ }
81
+ catch(e) {
82
+ if(this.debug) _log( 'localStorage object is not available' );
83
+ is_available = false;
84
+ return e instanceof DOMException && (
85
+ e.code === 22 ||
86
+ e.code === 1014 ||
87
+ e.name === 'QuotaExceededError' ||
88
+ e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
89
+ storage.length !== 0;
90
+ }
91
+ },
92
+
93
+ get_fields : function(){
94
+ try{
95
+ if(typeof this.fields == 'undefined') this.fields = JSON.parse(localStorage.getItem(this.id));
96
+ return this.fields;
97
+ } catch(err) {
98
+ _log( 'Error reading the fields.' );
99
+ _log( err );
100
+ }
101
+ },
102
+
103
+ set_fields : function(){
104
+ try{
105
+ this.fields = this.form.fbuilder_serializeObject();
106
+ localStorage.setItem(this.id, JSON.stringify(this.fields));
107
+ } catch(err) {
108
+ _log( 'Error saving the fields.' );
109
+ _log( err );
110
+ }
111
+ },
112
+
113
+ clear_fields : function(){
114
+ try{
115
+ localStorage.removeItem(this.id);
116
+ } catch(err) {
117
+ _log( 'Error deleting the fields.' );
118
+ _log( err );
119
+ }
120
+ }
121
+ };
122
+ })();
js/jQuery.stringify.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery = (typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
2
+
3
+ fbuilderjQuery(function(){
4
+ (function($) {
5
+ $.extend({
6
+
7
+ stringifyXX : function stringifyXX(obj) {
8
+ var enc = function(param) {
9
+ var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
10
+ meta = {
11
+ '\b' : '\\b',
12
+ '\t' : '\\t',
13
+ '\n' : '\\n',
14
+ '\f' : '\\f',
15
+ '\r' : '\\r',
16
+ '"' : '\\"',
17
+ '\\' : '\\\\'
18
+ };
19
+
20
+ escapable.lastIndex = 0;
21
+ return escapable.test(param) ? param.replace(escapable, function (a) {
22
+ var c = meta[a];
23
+ return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
24
+ }) : param;
25
+ };
26
+
27
+ var t = typeof (obj);
28
+ if (t != "object" || obj === null) {
29
+ // simple data type
30
+ if (t == "string") obj = '"' + obj + '"';
31
+ return String(obj);
32
+ } else {
33
+ // recurse array or object
34
+ var n, v, json = [], arr = (obj && obj.constructor == Array);
35
+
36
+ for (n in obj) {
37
+ v = obj[n];
38
+ t = typeof(v);
39
+ if (t!="function")
40
+ {
41
+ if (t == "string") v = '"' + enc(v) + '"'; else if (t == "object" && v !== null) v = $.stringifyXX(v);
42
+ json.push((arr ? "" : '"' + n + '":') + String(v));
43
+ }
44
+ }
45
+ return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
46
+ }
47
+ }
48
+ });
49
+ })(fbuilderjQuery);
50
+ });
js/jquery.caret.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery = (typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
2
+
3
+ (function($) {
4
+ $.fn.caret = function(pos) {
5
+ var target = this[0];
6
+ //get
7
+ if (arguments.length == 0) {
8
+ //HTML5
9
+ if (window.getSelection) {
10
+ //contenteditable
11
+ if (target.contentEditable == 'true') {
12
+ target.focus();
13
+ var range1 = window.getSelection().getRangeAt(0);
14
+ var range2 = range1.cloneRange();
15
+ range2.selectNodeContents(target);
16
+ range2.setEnd(range1.endContainer, range1.endOffset);
17
+ return range2.toString().length;
18
+ }
19
+ //textarea
20
+ return target.selectionStart;
21
+ }
22
+ //IE<9
23
+ if (document.selection) {
24
+ target.focus();
25
+ var range1 = document.selection.createRange();
26
+ var range2 = document.body.createTextRange();
27
+ range2.moveToElementText(target);
28
+ range2.setEndPoint('EndToEnd', range1);
29
+ return range2.text.length;
30
+ }
31
+ //not supported
32
+ return 0;
33
+ }
34
+ //set
35
+ //HTML5
36
+ if (window.getSelection) {
37
+ //contenteditable
38
+ if (target.contentEditable == 'true') {
39
+ target.focus();
40
+ window.getSelection().collapse(target.firstChild, pos);
41
+ }
42
+ //textarea
43
+ else
44
+ target.setSelectionRange(pos, pos);
45
+ }
46
+ //IE<9
47
+ else if (document.body.createTextRange) {
48
+ var range = document.body.createTextRange();
49
+ range.moveToElementText(target)
50
+ range.moveStart('character', pos);
51
+ range.collapse(true);
52
+ range.select();
53
+ }
54
+ }
55
+ })(fbuilderjQuery)
js/jquery.validate.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Validation Plugin v1.17.0
3
+ *
4
+ * https://jqueryvalidation.org/
5
+ *
6
+ * Copyright (c) 2017 Jörn Zaefferer
7
+ * Released under the MIT license
8
+ */
9
+ fbuilderjQuery=(typeof fbuilderjQuery!='undefined')?fbuilderjQuery:jQuery;(function(factory){if(typeof define==="function"&&define.amd){define(["fbuilderjQuery"],factory);}else if(typeof module==="object"&&module.exports){module.exports=factory(require("fbuilderjQuery"));}else{factory(fbuilderjQuery);}}(function($){$.extend($.fn,{validate:function(options){if(!this.length){if(options&&options.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.");} return;} var validator=$.data(this[0],"validator");if(validator){return validator;} this.attr("novalidate","novalidate");validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.on("click.validate",":submit",function(event){validator.submitButton=event.currentTarget;if($(this).hasClass("cancel")){validator.cancelSubmit=true;} if($(this).attr("formnovalidate")!==undefined){validator.cancelSubmit=true;}});this.on("submit.validate",function(event){if(validator.settings.debug){event.preventDefault();} function handle(){var hidden,result;if(validator.submitButton&&(validator.settings.submitHandler||validator.formSubmitted)){hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm);} if(validator.settings.submitHandler){result=validator.settings.submitHandler.call(validator,validator.currentForm,event);if(hidden){hidden.remove();} if(result!==undefined){return result;} return false;} return true;} if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();} if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;} return handle();}else{validator.focusInvalid();return false;}});} return validator;},valid:function(){var valid,validator,errorList;if($(this[0]).is("form")){valid=this.validate().form();}else{errorList=[];valid=true;validator=$(this[0].form).validate();this.each(function(){valid=validator.element(this)&&valid;if(!valid){errorList=errorList.concat(validator.errorList);}});validator.errorList=errorList;} return valid;},rules:function(command,argument){var element=this[0],settings,staticRules,existingRules,data,param,filtered;if(element==null){return;} if(!element.form&&element.hasAttribute("contenteditable")){element.form=this.closest("form")[0];element.name=this.attr("name");} if(element.form==null){return;} if(command){settings=$.data(element.form,"validator").settings;staticRules=settings.rules;existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));delete existingRules.messages;staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);} break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;} filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}} data=$.validator.normalizeRules($.extend({},$.validator.classRules(element),$.validator.attributeRules(element),$.validator.dataRules(element),$.validator.staticRules(element)),element);if(data.required){param=data.required;delete data.required;data=$.extend({required:param},data);} if(data.remote){param=data.remote;delete data.remote;data=$.extend(data,{remote:param});} return data;}});$.extend($.expr.pseudos||$.expr[":"],{blank:function(a){return!$.trim(""+$(a).val());},filled:function(a){var val=$(a).val();return val!==null&&!!$.trim(""+val);},unchecked:function(a){return!$(a).prop("checked");}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length===1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};} if(params===undefined){return source;} if(arguments.length>2&&params.constructor!==Array){params=$.makeArray(arguments).slice(1);} if(params.constructor!==Array){params=[params];} $.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),function(){return n;});});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"cpefb_error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:false,focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);} this.hideThese(this.errorsFor(element));}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element,event){var excludedKeys=[16,17,18,20,35,36,37,38,39,40,45,144,225];if(event.which===9&&this.elementValue(element)===""||$.inArray(event.keyCode,excludedKeys)!==-1){return;}else if(element.name in this.submitted||element.name in this.invalid){this.element(element);}},onclick:function(element){if(element.name in this.submitted){this.element(element);}else if(element.parentNode.name in this.submitted){this.element(element.parentNode);}},highlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).addClass(errorClass).removeClass(validClass);}else{$(element).addClass(errorClass).removeClass(validClass);}},unhighlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).removeClass(errorClass).addClass(validClass);}else{$(element).removeClass(errorClass).addClass(validClass);}}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}."),step:$.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={}),rules;$.each(this.settings.groups,function(key,value){if(typeof value==="string"){value=value.split(/\s/);} $.each(value,function(index,name){groups[name]=key;});});rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){if(!this.form&&this.hasAttribute("contenteditable")){this.form=$(this).closest("form")[0];this.name=$(this).attr("name");} var validator=$.data(this.form,"validator"),eventType="on"+event.type.replace(/^validate/,""),settings=validator.settings;if(settings[eventType]&&!$(this).is(settings.ignore)){settings[eventType].call(validator,this,event);}} $(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], "+"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], "+"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], "+"[type='radio'], [type='checkbox'], [contenteditable], [type='button']",delegate).on("click.validate","select, option, [type='radio'], [type='checkbox']",delegate);if(this.settings.invalidHandler){$(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler);}},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this]);} this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);} return this.valid();},element:function(element){var cleanElement=this.clean(element),checkElement=this.validationTargetFor(cleanElement),v=this,result=true,rs,group;if(checkElement===undefined){delete this.invalid[cleanElement.name];}else{this.prepareElement(checkElement);this.currentElements=$(checkElement);group=this.groups[checkElement.name];if(group){$.each(this.groups,function(name,testgroup){if(testgroup===group&&name!==checkElement.name){cleanElement=v.validationTargetFor(v.clean(v.findByName(name)));if(cleanElement&&cleanElement.name in v.invalid){v.currentElements.push(cleanElement);result=v.check(cleanElement)&&result;}}});} rs=this.check(checkElement)!==false;result=result&&rs;if(rs){this.invalid[checkElement.name]=false;}else{this.invalid[checkElement.name]=true;} if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);} this.showErrors();$(element).attr("aria-invalid",!rs);} return result;},showErrors:function(errors){if(errors){var validator=this;$.extend(this.errorMap,errors);this.errorList=$.map(this.errorMap,function(message,name){return{message:message,element:validator.findByName(name)[0]};});this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});} if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList);}else{this.defaultShowErrors();}},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm();} this.invalid={};this.submitted={};this.prepareForm();this.hideErrors();var elements=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(elements);},resetElements:function(elements){var i;if(this.settings.unhighlight){for(i=0;elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,"");this.findByName(elements[i].name).removeClass(this.settings.validClass);}}else{elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass);}},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0,i;for(i in obj){if(obj[i]!==undefined&&obj[i]!==null&&obj[i]!==false){count++;}} return count;},hideErrors:function(){this.hideThese(this.toHide);},hideThese:function(errors){errors.not(this.containers).text("");this.addWrapper(errors).hide();},valid:function(){return this.size()===0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name===lastActive.name;}).length===1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var name=this.name||$(this).attr("name");if(!name&&validator.settings.debug&&window.console){console.error("%o has no name assigned",this);} if(this.hasAttribute("contenteditable")){this.form=$(this).closest("form")[0];this.name=name;} if(name in rulesCache||!validator.objectLength($(this).rules())){return false;} rulesCache[name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){var errorClass=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+errorClass,this.errorContext);},resetInternals:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);},reset:function(){this.resetInternals();this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},elementValue:function(element){var $element=$(element),type=element.type,val,idx;if(type==="radio"||type==="checkbox"){return this.findByName(element.name).filter(":checked").val();}else if(type==="number"&&typeof element.validity!=="undefined"){return element.validity.badInput?"NaN":$element.val();} if(element.hasAttribute("contenteditable")){val=$element.text();}else{val=$element.val();} if(type==="file"){if(val.substr(0,12)==="C:\\fakepath\\"){return val.substr(12);} idx=val.lastIndexOf("/");if(idx>=0){return val.substr(idx+1);} idx=val.lastIndexOf("\\");if(idx>=0){return val.substr(idx+1);} return val;} if(typeof val==="string"){return val.replace(/\r/g,"");} return val;},check:function(element){element=this.validationTargetFor(this.clean(element));var rules=$(element).rules(),rulesCount=$.map(rules,function(n,i){return i;}).length,dependencyMismatch=false,val=this.elementValue(element),result,method,rule,normalizer;if(typeof rules.normalizer==="function"){normalizer=rules.normalizer;}else if(typeof this.settings.normalizer==="function"){normalizer=this.settings.normalizer;} if(normalizer){val=normalizer.call(element,val);if(typeof val!=="string"){throw new TypeError("The normalizer should return a string value.");} delete rules.normalizer;} for(method in rules){rule={method:method,parameters:rules[method]};try{result=$.validator.methods[method].call(this,val,element,rule.parameters);if(result==="dependency-mismatch"&&rulesCount===1){dependencyMismatch=true;continue;} dependencyMismatch=false;if(result==="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;} if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.",e);} if(e instanceof TypeError){e.message+=". Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method.";} throw e;}} if(dependencyMismatch){return;} if(this.objectLength(rules)){this.successList.push(element);} return true;},customDataMessage:function(element,method){return $(element).data("msg"+method.charAt(0).toUpperCase()+ method.substring(1).toLowerCase())||$(element).data("msg");},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i];}} return undefined;},defaultMessage:function(element,rule){if(typeof rule==="string"){rule={method:rule};} var message=this.findDefined(this.customMessage(element.name,rule.method),this.customDataMessage(element,rule.method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[rule.method],"<strong>Warning: No message defined for "+element.name+"</strong>"),theregex=/\$?\{(\d+)\}/g;if(typeof message==="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters);} return message;},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule);this.errorList.push({message:message,element:element,method:rule.method});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));} return toToggle;},defaultShowErrors:function(){var i,elements,error;for(i=0;this.errorList[i];i++){error=this.errorList[i];if(this.settings.highlight){this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);} this.showLabel(error.element,error.message);} if(this.errorList.length){this.toShow=this.toShow.add(this.containers);} if(this.settings.success){for(i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}} if(this.settings.unhighlight){for(i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}} this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var place,group,errorID,v,error=this.errorsFor(element),elementID=this.idOrName(element),describedBy=$(element).attr("aria-describedby");if(error.length){error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);error.html(message);}else{error=$("<"+this.settings.errorElement+">").attr("id",elementID+"-error").addClass(this.settings.errorClass).html(message||"");place=error;if(this.settings.wrapper){place=error.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();} if(this.labelContainer.length){this.labelContainer.append(place);}else if(this.settings.errorPlacement){this.settings.errorPlacement.call(this,place,$(element));}else{place.insertAfter(element);} if(error.is("label")){error.attr("for",elementID);}else if(error.parents("label[for='"+this.escapeCssMeta(elementID)+"']").length===0){errorID=error.attr("id");if(!describedBy){describedBy=errorID;}else if(!describedBy.match(new RegExp("\\b"+this.escapeCssMeta(errorID)+"\\b"))){describedBy+=" "+errorID;} $(element).attr("aria-describedby",describedBy);group=this.groups[element.name];if(group){v=this;$.each(v.groups,function(name,testgroup){if(testgroup===group){$("[name='"+v.escapeCssMeta(name)+"']",v.currentForm).attr("aria-describedby",error.attr("id"));}});}}} if(!message&&this.settings.success){error.text("");if(typeof this.settings.success==="string"){error.addClass(this.settings.success);}else{this.settings.success(error,element);}} this.toShow=this.toShow.add(error);},errorsFor:function(element){var name=this.escapeCssMeta(this.idOrName(element)),describer=$(element).attr("aria-describedby"),selector="label[for='"+name+"'], label[for='"+name+"'] *";if(describer){selector=selector+", #"+this.escapeCssMeta(describer).replace(/\s+/g,", #");} return this.errors().filter(selector);},escapeCssMeta:function(string){return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},validationTargetFor:function(element){if(this.checkable(element)){element=this.findByName(element.name);} return $(element).not(this.settings.ignore)[0];},checkable:function(element){return(/radio|checkbox/i).test(element.type);},findByName:function(name){return $(this.currentForm).find("[name='"+this.escapeCssMeta(name)+"']");},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length;}} return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;$(element).addClass(this.settings.pendingClass);this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0;} delete this.pending[element.name];$(element).removeClass(this.settings.pendingClass);if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();if(this.submitButton){$("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove();} this.formSubmitted=false;}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element,method){method=typeof method==="string"&&method||"remote";return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,{method:method})});},destroy:function(){this.resetForm();$(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur");}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){if(className.constructor===String){this.classRuleSettings[className]=rules;}else{$.extend(this.classRuleSettings,className);}},classRules:function(element){var rules={},classes=$(element).attr("class");if(classes){$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});} return rules;},normalizeAttributeRule:function(rules,type,method,value){if(/min|max|step/.test(method)&&(type===null||/number|range|text/.test(type))){if(!/^\s*$/.test(value))value=Number(value);if(isNaN(value)){value=undefined;}} if(value||value===0){rules[method]=value;}else if(type===method&&type!=="range"){rules[method]=true;}},attributeRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){if(method==="required"){value=element.getAttribute(method);if(value===""){value=true;} value=!!value;}else{value=$element.attr(method);} this.normalizeAttributeRule(rules,type,method,value);} if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;} return rules;},dataRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){value=$element.data("rule"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase());this.normalizeAttributeRule(rules,type,method,value);} return rules;},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};} return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;} if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;} if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{$.data(element.form,"validator").resetElements($(element));delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)&&rule!=="normalizer"?parameter(element):parameter;});$.each(["minlength","maxlength"],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(["rangelength","range"],function(){var parts;if(rules[this]){if($.isArray(rules[this])){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}else if(typeof rules[this]==="string"){parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/);rules[this]=[Number(parts[0]),Number(parts[1])];}}});if($.validator.autoCreateRanges){if(rules.min!=null&&rules.max!=null){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;} if(rules.minlength!=null&&rules.maxlength!=null){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}} return rules;},normalizeRule:function(data){if(typeof data==="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;} return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!==undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch";} if(element.nodeName.toLowerCase()==="select"){var val=$(element).val();return val&&val.length>0;} if(this.checkable(element)){return this.getLength(value,element)>0;} return value.length>0;},email:function(value,element){return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);},url:function(value,element){return this.optional(element)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString());},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);},number:function(value,element){return this.optional(element)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length>=param;},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length<=param;},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},step:function(value,element,param){var type=$(element).attr("type"),errorMessage="Step attribute on input type "+type+" is not supported.",supportedTypes=["text","number","range"],re=new RegExp("\\b"+type+"\\b"),notSupported=type&&!re.test(supportedTypes.join()),decimalPlaces=function(num){var match=(""+num).match(/(?:\.(\d+))?$/);if(!match){return 0;} return match[1]?match[1].length:0;},toInt=function(num){return Math.round(num*Math.pow(10,decimals));},valid=true,decimals;if(notSupported){throw new Error(errorMessage);} decimals=decimalPlaces(param);if(decimalPlaces(value)>decimals||toInt(value)%toInt(param)!==0){valid=false;} return this.optional(element)||valid;},equalTo:function(value,element,param){var target=$(param);if(this.settings.onfocusout&&target.not(".validate-equalTo-blur").length){target.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){$(element).valid();});} return value===target.val();},remote:function(value,element,param,method){if(this.optional(element)){return"dependency-mismatch";} method=typeof method==="string"&&method||"remote";var previous=this.previousValue(element,method),validator,data,optionDataString;if(!this.settings.messages[element.name]){this.settings.messages[element.name]={};} previous.originalMessage=previous.originalMessage||this.settings.messages[element.name][method];this.settings.messages[element.name][method]=previous.message;param=typeof param==="string"&&{url:param}||param;optionDataString=$.param($.extend({data:value},param.data));if(previous.old===optionDataString){return previous.valid;} previous.old=optionDataString;validator=this;this.startRequest(element);data={};data[element.name]=value;$.ajax($.extend(true,{mode:"abort",port:"validate"+element.name,dataType:"json",data:data,context:validator.currentForm,success:function(response){var valid=response===true||response==="true",errors,message,submitted;validator.settings.messages[element.name][method]=previous.originalMessage;if(valid){submitted=validator.formSubmitted;validator.resetInternals();validator.toHide=validator.errorsFor(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.invalid[element.name]=false;validator.showErrors();}else{errors={};message=response||validator.defaultMessage(element,{method:method,parameters:value});errors[element.name]=previous.message=message;validator.invalid[element.name]=true;validator.showErrors(errors);} previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}}});var pendingRequests={},ajax;if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();} pendingRequests[port]=xhr;}});}else{ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;if(mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort();} pendingRequests[port]=ajax.apply(this,arguments);return pendingRequests[port];} return ajax.apply(this,arguments);};} return $;}));
js/modules/01_mathematical_logical/admin/module_admin.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery = (typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
2
+ fbuilderjQuery[ 'fbuilder' ] = fbuilderjQuery[ 'fbuilder' ] || {};
3
+ fbuilderjQuery[ 'fbuilder' ][ 'modules' ] = fbuilderjQuery[ 'fbuilder' ][ 'modules' ] || {};
4
+
5
+ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ] = {
6
+ 'tutorial' : 'https://cff.dwbooster.com/documentation#mathematical-module',
7
+ 'toolbars' : {
8
+ 'mathematical' : {
9
+ 'label' : "Mathematical Operations",
10
+ 'buttons' : [
11
+ { "value" : "+", "code" : "+", "tip" : "" },
12
+ { "value" : "-", "code" : "-", "tip" : "" },
13
+ { "value" : "*", "code" : "*", "tip" : "" },
14
+ { "value" : "/", "code" : "/", "tip" : "" },
15
+ { "value" : "(", "code" : "(", "tip" : "" },
16
+ { "value" : ")", "code" : ")", "tip" : "" },
17
+ { "value" : ",", "code" : ",", "tip" : "" },
18
+ { "value" : "ABS", "code" : "ABS(", "tip" : "Returns the absolute value of the number passed as parameter. <strong>ABS(number)</strong>" },
19
+ { "value" : "CEIL", "code" : "CEIL(", "tip" : "Returns the next higher integer that is greater than or equal to the number passed as parameter. <strong>CEIL(number)</strong>" },
20
+ { "value" : "FLOOR", "code" : "FLOOR(", "tip" : "Returns the next lower integer that is less than or equal to the number passed as parameter. <strong>FLOOR(number)</strong>" },
21
+ { "value" : "ROUND", "code" : "ROUND(", "tip" : "Returns an integer that follows rounding rules. If the value of the passed parameter is greater than or equal to x.5, the returned value is x+1; otherwise the returned value is x. <strong>ROUND(number)</strong>" },
22
+ { "value" : "PREC", "code" : "PREC(", "tip" : "Returns the value of the number passed in the first parameter with so many decimal digits as the number passed in the second parameter. <strong>PREC(number1, number2)</strong>" },
23
+ { "value" : "CDATE", "code" : "CDATE(", "tip" : "Returns the number formatted like a Date. <strong>CDATE(number,format)</strong>. The second parameter defines the format of the output date: &quot;mm/dd.yyyy&quot;, &quot;dd/mm/yyyy&quot;" },
24
+ { "value" : "LOG", "code" : "LOG(", "tip" : "Returns the natural logarithm (base e) of the number passed as parameter. <strong>LOG(number)</strong>" },
25
+ { "value" : "LOGAB", "code" : "LOGAB(", "tip" : "Returns the logarithm of A (base B). <strong>LOGAB(number, base)</strong>" },
26
+ { "value" : "POW", "code" : "POW(", "tip" : "Returns the value of the first parameter raised to the power of the second parameter. <strong>POW(number1, number2)</strong>" },
27
+ { "value" : "SQRT", "code" : "SQRT(", "tip" : "Returns the square root of the number passed as parameter. <strong>SQRT(number1, number2)</strong>" },
28
+ { "value" : "MAX", "code" : "MAX(", "tip" : "Returns the greater value of the two parameters. <strong>MAX(number1, number2)</strong>" },
29
+ { "value" : "MIN", "code" : "MIN(", "tip" : "Returns the lesser value of the two parameters. <strong>MIN(number1, number2)</strong>" },
30
+ { "value" : "GCD", "code" : "GCD(", "tip" : "Returns greatest common divisor between the two parameters. <strong>GCD(number1, number2)</strong>" }
31
+ ]
32
+ },
33
+
34
+ 'logical' : {
35
+ 'label' : "Logical Operators",
36
+ 'buttons' : [
37
+ { "value" : "IF", "code" : "IF(", "tip" : "Checks whether a condition is met, and returns one value if true, and another if false. <strong>IF(logical_test, value_if_true, value_if_false)</strong>" },
38
+ { "value" : "AND", "code" : "AND(", "tip" : "Checks whether all arguments are true, and return true if all values are true. <strong>AND(logical1,logical2,...)</strong>" },
39
+ { "value" : "OR", "code" : "OR(", "tip" : "Checks whether any of arguments are true. Returns false only if all arguments are false. <strong>OR(logical1,logical2,...)</strong>" },
40
+ { "value" : "NOT", "code" : "NOT(", "tip" : "Changes false to true, or true to false. <strong>NOT(logical)</strong>" },
41
+ { "value" : "IN", "code" : "IN(", "tip" : "Checks whether the term is included in the second argument, the second argument may be a string or strings array. <strong>IN(term, string/array)</strong>" }
42
+ ]
43
+ },
44
+
45
+
46
+ }
47
+ };
js/modules/01_mathematical_logical/public/01_logical.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * logical.js v0.1
3
+ * By: CALCULATED FIELD PROGRAMMERS
4
+ * The script allows make logical operations like functions
5
+ * Copyright 2013 CODEPEOPLE
6
+ * You may use this project under MIT or GPL licenses.
7
+ */
8
+
9
+ ;(function(root){
10
+ var lib = {};
11
+
12
+ lib.cf_logical_version = '0.1';
13
+
14
+ // IF( logical_test, value_if_true, value_if_false )
15
+ lib.IF = function( _if, _then, _else ){
16
+ if ( _if ) {
17
+ return ( typeof _then === 'undefined' ) ? true : _then;
18
+ } else {
19
+ return ( typeof _else === 'undefined' ) ? false : _else;
20
+ }
21
+ };
22
+
23
+ // AND( logical1, logical2, ... )
24
+ lib.AND = function(){
25
+ for (var i = 0, h = arguments.length; i < h; i++) {
26
+ if (!arguments[i]) {
27
+ return false;
28
+ }
29
+ }
30
+ return true;
31
+ };
32
+
33
+ // OR( logical1, logical2, ... )
34
+ lib.OR = function(){
35
+ for (var i = 0, h = arguments.length; i < h; i++) {
36
+ if ( arguments[i] ) {
37
+ return true;
38
+ }
39
+ }
40
+ return false;
41
+ };
42
+
43
+ // NOT( term )
44
+ lib.NOT = function( _term ){
45
+ return ( typeof _term == 'undefined' ) ? true : !_term;
46
+ };
47
+
48
+ // IN( term, values ) values can be a string or an array
49
+ lib.IN = function( _term, _values ){
50
+ function _reduce( str ){
51
+ return String(str).replace( /^\s+/, '').replace(/\s+$/, '').replace(/\s+/, ' ').toLowerCase();
52
+ };
53
+
54
+ _term = _reduce( _term );
55
+ if( typeof _values == 'string' ) return _reduce( _values ).indexOf( _term ) != -1;
56
+ else if( typeof _values == 'object' && _values.length ){
57
+ for( var i = 0, h = _values.length; i < h; i++) if( _reduce( _values[ i ] ).indexOf( _term ) != -1 ) return true;
58
+ }
59
+ return false;
60
+ };
61
+
62
+
63
+ root.CF_LOGICAL = lib;
64
+
65
+ })(this);
js/modules/01_mathematical_logical/public/module_public.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery = ( typeof fbuilderjQuery != 'undefined' ) ? fbuilderjQuery : jQuery;
2
+ fbuilderjQuery[ 'fbuilder' ] = fbuilderjQuery[ 'fbuilder' ] || {};
3
+ fbuilderjQuery[ 'fbuilder' ][ 'modules' ] = fbuilderjQuery[ 'fbuilder' ][ 'modules' ] || {};
4
+
5
+ fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ] = {
6
+ 'prefix' : '',
7
+ 'callback' : function()
8
+ {
9
+ if(window.PREC == undefined)
10
+ {
11
+ window.PREC = window.prec = function (num, pr)
12
+ {
13
+ if(/^\d+$/.test(pr) && /^[+-]?\d+(\.\d+)?$/.test(num))
14
+ {
15
+ result = num.toFixed( pr );
16
+ return result;
17
+ }
18
+ return num;
19
+ };
20
+ } // End if window.PREC
21
+
22
+ if(window.CDATE == undefined)
23
+ {
24
+ window.CDATE = window.cdate = function ( num, format )
25
+ {
26
+ format = ( typeof format != 'undefined' ) ? format : ( ( typeof window.DATETIMEFORMAT != 'undefined' ) ? window.DATETIMEFORMAT : 'dd/mm/yyyy' );
27
+
28
+ if(isFinite(num*1))
29
+ {
30
+ num = Math.round(num*86400000);
31
+
32
+ var date = new Date(num),
33
+ d = date.getDate(),
34
+ m = date.getMonth()+1,
35
+ y = date.getFullYear(),
36
+ h = date.getHours(),
37
+ i = date.getMinutes(),
38
+ s = date.getSeconds(),
39
+ a = '';
40
+
41
+ m = (m < 10) ? '0'+m : m;
42
+ d = (d < 10) ? '0'+d : d;
43
+
44
+ if( /a/.test( format ) )
45
+ {
46
+ a = ( h >= 12 ) ? 'pm' : 'am';
47
+ h = h % 12;
48
+ h = ( h == 0 ) ? 12: h;
49
+ }
50
+ h = (h < 10) ? '0'+h : h;
51
+ i = (i < 10) ? '0'+i : i;
52
+ s = (s < 10) ? '0'+s : s;
53
+
54
+ return format.replace( /y+/i, y)
55
+ .replace( /m+/i, m)
56
+ .replace( /d+/i, d)
57
+ .replace( /h+/i, h)
58
+ .replace( /i+/i, i)
59
+ .replace( /s+/i, s)
60
+ .replace( /a+/i, a);
61
+ }
62
+ return num;
63
+ };
64
+ } // End if window.CDATE
65
+
66
+ if(window.GCD == undefined)
67
+ {
68
+ window.GCD = window.gcd = function( a, b)
69
+ {
70
+ if ( ! b) return a;
71
+ return GCD(b, a % b);
72
+ };
73
+ } // End if window.GCD
74
+
75
+ if(window.LOGAB == undefined)
76
+ {
77
+ window.LOGAB = window.logab = function( a, b)
78
+ {
79
+ return LOG(a)/LOG(b);
80
+ };
81
+ } // End if window.LOGAB
82
+
83
+ var math_prop = ["LN10", "PI", "E", "LOG10E", "SQRT2", "LOG2E", "SQRT1_2", "LN2", "cos", "pow", "log", "tan", "sqrt", "ceil", "asin", "abs", "max", "exp", "atan2", "random", "round", "floor", "acos", "atan", "min", "sin"];
84
+
85
+ for(var i = 0, h = math_prop.length; i < h; i++)
86
+ {
87
+ if( !window[ math_prop[ i ] ] )
88
+ {
89
+ window[ math_prop[ i ] ] = window[ math_prop[ i ].toUpperCase() ] = Math[ math_prop[ i ] ];
90
+ }
91
+ }
92
+
93
+ fbuilderjQuery[ 'fbuilder' ][ 'extend_window' ]( fbuilderjQuery[ 'fbuilder' ][ 'modules' ][ 'default' ][ 'prefix' ], CF_LOGICAL );
94
+ },
95
+
96
+ 'validator' : function( v )
97
+ {
98
+ return ( typeof v == 'number' ) ? isFinite( v ) : ( typeof v != 'undefined' );
99
+ }
100
+ };
js/modules/index.html ADDED
File without changes
js/redirect_script.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ if(
2
+ typeof cpcff_redirect != 'undefined' &&
3
+ typeof cpcff_redirect['url'] != 'undefined'
4
+ )
5
+ {
6
+ document.location.href = cpcff_redirect['url'];
7
+ }
languages/calculated-fields-form-en_US.mo ADDED
Binary file
languages/calculated-fields-form-en_US.po ADDED
@@ -0,0 +1,624 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2017-05-14 00:25+0200\n"
5
+ "PO-Revision-Date: 2017-05-14 00:25+0200\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: en_US\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 2.0.2\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-KeywordsList: __;_e;esc_attr__;esc_attr_e\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: cp_calculatedfieldsf.php:780
19
+ msgid "Request custom changes"
20
+ msgstr ""
21
+
22
+ #: cp_calculatedfieldsf.php:781 cp_calculatedfieldsf_admin_int_list.inc.php:233
23
+ msgid "Settings"
24
+ msgstr ""
25
+
26
+ #: cp_calculatedfieldsf.php:782 cp_calculatedfieldsf_admin_int_list.inc.php:293
27
+ msgid "Upgrade"
28
+ msgstr ""
29
+
30
+ #: cp_calculatedfieldsf.php:783 cp_calculatedfieldsf_admin_int.php:350
31
+ #: cp_calculatedfieldsf_admin_int.php:629
32
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:293
33
+ msgid "Help"
34
+ msgstr ""
35
+
36
+ #: cp_calculatedfieldsf.php:789 cp_calculatedfieldsf_admin_int.php:340
37
+ msgid "Insert Calculated Fields Form"
38
+ msgstr ""
39
+
40
+ #: cp_calculatedfieldsf.php:789
41
+ msgid "Create a JavaScript var from POST, GET, SESSION, or COOKIE var"
42
+ msgstr ""
43
+
44
+ #: cp_calculatedfieldsf.php:998
45
+ msgid ""
46
+ "<div class=\"error-text\">The data cannot be stored in database because has "
47
+ "occurred an error with the database structure. Please, go to the plugins "
48
+ "section and Deactivate/Activate the plugin to be sure the structure of "
49
+ "database has been checked, and corrected if needed. If the issue persist, "
50
+ "please <a href=\"http://wordpress.dwbooster.com/support\">contact us</a></"
51
+ "div>"
52
+ msgstr ""
53
+
54
+ #: cp_calculatedfieldsf.php:1014
55
+ msgid ""
56
+ "<div class=\"error-text\">The data cannot be stored in database because has "
57
+ "occurred an error with the form structure. Please, try to save the data "
58
+ "again. If have been copied and pasted data from external text editors, the "
59
+ "data can contain invalid characters. If the issue persist, please <a href="
60
+ "\"http://wordpress.dwbooster.com/support\">contact us</a></div>"
61
+ msgstr ""
62
+
63
+ #: cp_calculatedfieldsf_admin_int.php:5
64
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:5
65
+ msgid "Direct access not allowed."
66
+ msgstr ""
67
+
68
+ #: cp_calculatedfieldsf_admin_int.php:20
69
+ msgid "Settings saved"
70
+ msgstr ""
71
+
72
+ #: cp_calculatedfieldsf_admin_int.php:33
73
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:141
74
+ msgid "Calculated Fields Form"
75
+ msgstr ""
76
+
77
+ #: cp_calculatedfieldsf_admin_int.php:35
78
+ msgid "Back to items list..."
79
+ msgstr ""
80
+
81
+ #: cp_calculatedfieldsf_admin_int.php:45 cp_calculatedfieldsf_admin_int.php:205
82
+ msgid "Form Settings"
83
+ msgstr ""
84
+
85
+ #: cp_calculatedfieldsf_admin_int.php:47
86
+ msgid ""
87
+ "* Different form styles available on the tab Form Settings &gt;&gt; Form "
88
+ "Template"
89
+ msgstr ""
90
+
91
+ #: cp_calculatedfieldsf_admin_int.php:49
92
+ msgid "Form Builder"
93
+ msgstr ""
94
+
95
+ #: cp_calculatedfieldsf_admin_int.php:58
96
+ msgid ""
97
+ "If the form is not loading in the public website, go to the settings page of "
98
+ "the plugin through the menu option: \"Settings/Calculated Fields Form\", "
99
+ "select the \"Classic\" option for the attribute: \"Script load method\", and "
100
+ "press the \"Update\" button."
101
+ msgstr ""
102
+
103
+ #: cp_calculatedfieldsf_admin_int.php:58
104
+ msgid ""
105
+ "If you need also the form to be sent to the server side for processing (for "
106
+ "example to deliver emails) then the <a href=\"http://cff.dwbooster.com/\" "
107
+ "target=\"_blank\">Professional or Developer versions</a> of the plugin will "
108
+ "be required."
109
+ msgstr ""
110
+
111
+ #: cp_calculatedfieldsf_admin_int.php:94 cp_calculatedfieldsf_admin_int.php:100
112
+ #: cp_calculatedfieldsf_admin_int.php:106
113
+ #: cp_calculatedfieldsf_admin_int.php:112
114
+ #: cp_calculatedfieldsf_admin_int.php:118
115
+ msgid ""
116
+ "These features aren't available in this version. Do you want to open the "
117
+ "plugin's page to check other versions?"
118
+ msgstr ""
119
+
120
+ #: cp_calculatedfieldsf_admin_int.php:203
121
+ msgid "Add a Field"
122
+ msgstr ""
123
+
124
+ #: cp_calculatedfieldsf_admin_int.php:204
125
+ msgid "Field Settings"
126
+ msgstr ""
127
+
128
+ #: cp_calculatedfieldsf_admin_int.php:226
129
+ #: cp_calculatedfieldsf_admin_int.php:347
130
+ #: cp_calculatedfieldsf_admin_int.php:626
131
+ msgid "Save Changes"
132
+ msgstr ""
133
+
134
+ #: cp_calculatedfieldsf_admin_int.php:227
135
+ #: cp_calculatedfieldsf_admin_int.php:586
136
+ msgid "Preview"
137
+ msgstr ""
138
+
139
+ #: cp_calculatedfieldsf_admin_int.php:231
140
+ msgid "Define Texts"
141
+ msgstr ""
142
+
143
+ #: cp_calculatedfieldsf_admin_int.php:235
144
+ msgid "Previous button label (text)"
145
+ msgstr ""
146
+
147
+ #: cp_calculatedfieldsf_admin_int.php:239
148
+ msgid "Next button label (text)"
149
+ msgstr ""
150
+
151
+ #: cp_calculatedfieldsf_admin_int.php:244
152
+ msgid ""
153
+ "- The styles can be applied into any of the CSS files of your theme or into "
154
+ "the CSS file <em>\"calculated-fields-form\\css\\stylepublic.css\"</em>."
155
+ msgstr ""
156
+
157
+ #: cp_calculatedfieldsf_admin_int.php:245
158
+ msgid ""
159
+ "- For general CSS styles modifications to the form and samples <a href="
160
+ "\"http://cff.dwbooster.com/faq#q82\" target=\"_blank\">check this FAQ</a>."
161
+ msgstr ""
162
+
163
+ #: cp_calculatedfieldsf_admin_int.php:267
164
+ msgid "Validation Settings"
165
+ msgstr ""
166
+
167
+ #: cp_calculatedfieldsf_admin_int.php:271
168
+ msgid "Use Validation?"
169
+ msgstr ""
170
+
171
+ #: cp_calculatedfieldsf_admin_int.php:275
172
+ #: cp_calculatedfieldsf_admin_int.php:487
173
+ #: cp_calculatedfieldsf_admin_int.php:524
174
+ #: cp_calculatedfieldsf_admin_int.php:565
175
+ msgid "Yes"
176
+ msgstr ""
177
+
178
+ #: cp_calculatedfieldsf_admin_int.php:281
179
+ msgid "\"is required\" text"
180
+ msgstr ""
181
+
182
+ #: cp_calculatedfieldsf_admin_int.php:285
183
+ msgid "\"is email\" text"
184
+ msgstr ""
185
+
186
+ #: cp_calculatedfieldsf_admin_int.php:289
187
+ msgid "\"is valid captcha\" text"
188
+ msgstr ""
189
+
190
+ #: cp_calculatedfieldsf_admin_int.php:294
191
+ msgid "\"is valid date (mm/dd/yyyy)\" text"
192
+ msgstr ""
193
+
194
+ #: cp_calculatedfieldsf_admin_int.php:298
195
+ msgid "\"is valid date (dd/mm/yyyy)\" text"
196
+ msgstr ""
197
+
198
+ #: cp_calculatedfieldsf_admin_int.php:302
199
+ msgid "\"is number\" text"
200
+ msgstr ""
201
+
202
+ #: cp_calculatedfieldsf_admin_int.php:306
203
+ msgid "\"only digits\" text"
204
+ msgstr ""
205
+
206
+ #: cp_calculatedfieldsf_admin_int.php:310
207
+ msgid "\"under maximum\" text"
208
+ msgstr ""
209
+
210
+ #: cp_calculatedfieldsf_admin_int.php:314
211
+ msgid "\"over minimum\" text"
212
+ msgstr ""
213
+
214
+ #: cp_calculatedfieldsf_admin_int.php:337
215
+ msgid "Note"
216
+ msgstr ""
217
+
218
+ #: cp_calculatedfieldsf_admin_int.php:339
219
+ msgid "To insert this form in a post/page, use the dedicated icon"
220
+ msgstr ""
221
+
222
+ #: cp_calculatedfieldsf_admin_int.php:341
223
+ msgid ""
224
+ "which has been added to your Upload/Insert Menu, just below the title of "
225
+ "your Post/Page."
226
+ msgstr ""
227
+
228
+ #: cp_calculatedfieldsf_admin_int.php:350
229
+ #: cp_calculatedfieldsf_admin_int.php:629
230
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:293
231
+ msgid "Request Custom Modifications"
232
+ msgstr ""
233
+
234
+ #: cp_calculatedfieldsf_admin_int.php:354
235
+ msgid ""
236
+ "The following settings are available only in the <a href=\"http://cff."
237
+ "dwbooster.com/\">pro version</a>"
238
+ msgstr ""
239
+
240
+ #: cp_calculatedfieldsf_admin_int.php:356
241
+ msgid "Form Processing and Payment Settings"
242
+ msgstr ""
243
+
244
+ #: cp_calculatedfieldsf_admin_int.php:360
245
+ msgid "Payment Settings"
246
+ msgstr ""
247
+
248
+ #: cp_calculatedfieldsf_admin_int.php:365
249
+ msgid "Request cost"
250
+ msgstr ""
251
+
252
+ #: cp_calculatedfieldsf_admin_int.php:370
253
+ msgid "Currency"
254
+ msgstr ""
255
+
256
+ #: cp_calculatedfieldsf_admin_int.php:375
257
+ msgid "Base amount"
258
+ msgstr ""
259
+
260
+ #: cp_calculatedfieldsf_admin_int.php:376
261
+ msgid ""
262
+ "Minimum amount to charge. If the final price is lesser than this number, the "
263
+ "base amount will be applied."
264
+ msgstr ""
265
+
266
+ #: cp_calculatedfieldsf_admin_int.php:381
267
+ msgid "Paypal product name"
268
+ msgstr ""
269
+
270
+ #: cp_calculatedfieldsf_admin_int.php:386
271
+ msgid "Discount Codes"
272
+ msgstr ""
273
+
274
+ #: cp_calculatedfieldsf_admin_int.php:388
275
+ msgid "This feature isn't available in this version."
276
+ msgstr ""
277
+
278
+ #: cp_calculatedfieldsf_admin_int.php:391
279
+ msgid "Add new discount code"
280
+ msgstr ""
281
+
282
+ #: cp_calculatedfieldsf_admin_int.php:393
283
+ msgid "Code"
284
+ msgstr ""
285
+
286
+ #: cp_calculatedfieldsf_admin_int.php:394
287
+ msgid "Discount"
288
+ msgstr ""
289
+
290
+ #: cp_calculatedfieldsf_admin_int.php:395
291
+ msgid "Percent"
292
+ msgstr ""
293
+
294
+ #: cp_calculatedfieldsf_admin_int.php:396
295
+ msgid "Fixed Value"
296
+ msgstr ""
297
+
298
+ #: cp_calculatedfieldsf_admin_int.php:399
299
+ msgid "Valid until"
300
+ msgstr ""
301
+
302
+ #: cp_calculatedfieldsf_admin_int.php:400
303
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:253
304
+ msgid "Add"
305
+ msgstr ""
306
+
307
+ #: cp_calculatedfieldsf_admin_int.php:402
308
+ msgid "Note: Expiration date based in server time. Server time now is"
309
+ msgstr ""
310
+
311
+ #: cp_calculatedfieldsf_admin_int.php:410
312
+ msgid "Paypal Payment Configuration"
313
+ msgstr ""
314
+
315
+ #: cp_calculatedfieldsf_admin_int.php:415
316
+ msgid "Enable Paypal Payments?"
317
+ msgstr ""
318
+
319
+ #: cp_calculatedfieldsf_admin_int.php:420
320
+ msgid "Paypal Mode"
321
+ msgstr ""
322
+
323
+ #: cp_calculatedfieldsf_admin_int.php:422
324
+ msgid "Production - real payments processed"
325
+ msgstr ""
326
+
327
+ #: cp_calculatedfieldsf_admin_int.php:423
328
+ msgid "SandBox - PayPal testing sandbox area"
329
+ msgstr ""
330
+
331
+ #: cp_calculatedfieldsf_admin_int.php:429
332
+ msgid "Paypal email"
333
+ msgstr ""
334
+
335
+ #: cp_calculatedfieldsf_admin_int.php:434
336
+ msgid "A $0 amount to pay means"
337
+ msgstr ""
338
+
339
+ #: cp_calculatedfieldsf_admin_int.php:436
340
+ msgid "Let the user enter any amount at PayPal (ex: for a donation)"
341
+ msgstr ""
342
+
343
+ #: cp_calculatedfieldsf_admin_int.php:437
344
+ msgid "Don't require any payment. Form is submitted skiping the PayPal page."
345
+ msgstr ""
346
+
347
+ #: cp_calculatedfieldsf_admin_int.php:443
348
+ msgid "Paypal language"
349
+ msgstr ""
350
+
351
+ #: cp_calculatedfieldsf_admin_int.php:448
352
+ msgid "Payment frequency"
353
+ msgstr ""
354
+
355
+ #: cp_calculatedfieldsf_admin_int.php:452
356
+ msgid "One time payment (default option, user is billed only once)"
357
+ msgstr ""
358
+
359
+ #: cp_calculatedfieldsf_admin_int.php:453
360
+ msgid "Bill the user every 1 month"
361
+ msgstr ""
362
+
363
+ #: cp_calculatedfieldsf_admin_int.php:454
364
+ msgid "Bill the user every 3 months"
365
+ msgstr ""
366
+
367
+ #: cp_calculatedfieldsf_admin_int.php:455
368
+ msgid "Bill the user every 6 months"
369
+ msgstr ""
370
+
371
+ #: cp_calculatedfieldsf_admin_int.php:456
372
+ msgid "Bill the user every 12 months"
373
+ msgstr ""
374
+
375
+ #: cp_calculatedfieldsf_admin_int.php:467
376
+ msgid "Form Processing / Email Settings"
377
+ msgstr ""
378
+
379
+ #: cp_calculatedfieldsf_admin_int.php:471
380
+ msgid "\"From\" email"
381
+ msgstr ""
382
+
383
+ #: cp_calculatedfieldsf_admin_int.php:475
384
+ msgid "Destination emails (comma separated)"
385
+ msgstr ""
386
+
387
+ #: cp_calculatedfieldsf_admin_int.php:479
388
+ #: cp_calculatedfieldsf_admin_int.php:534
389
+ msgid "Email subject"
390
+ msgstr ""
391
+
392
+ #: cp_calculatedfieldsf_admin_int.php:483
393
+ msgid "Include additional information?"
394
+ msgstr ""
395
+
396
+ #: cp_calculatedfieldsf_admin_int.php:488
397
+ #: cp_calculatedfieldsf_admin_int.php:525
398
+ #: cp_calculatedfieldsf_admin_int.php:566
399
+ msgid "No"
400
+ msgstr ""
401
+
402
+ #: cp_calculatedfieldsf_admin_int.php:493
403
+ msgid "Thank you page (after sending the message)"
404
+ msgstr ""
405
+
406
+ #: cp_calculatedfieldsf_admin_int.php:497
407
+ #: cp_calculatedfieldsf_admin_int.php:538
408
+ msgid "Email format?"
409
+ msgstr ""
410
+
411
+ #: cp_calculatedfieldsf_admin_int.php:501
412
+ #: cp_calculatedfieldsf_admin_int.php:542
413
+ msgid "Plain Text (default)"
414
+ msgstr ""
415
+
416
+ #: cp_calculatedfieldsf_admin_int.php:502
417
+ #: cp_calculatedfieldsf_admin_int.php:543
418
+ msgid "HTML (use html in the textarea below)"
419
+ msgstr ""
420
+
421
+ #: cp_calculatedfieldsf_admin_int.php:507
422
+ #: cp_calculatedfieldsf_admin_int.php:548
423
+ msgid "Message"
424
+ msgstr ""
425
+
426
+ #: cp_calculatedfieldsf_admin_int.php:516
427
+ msgid "Email Copy to User"
428
+ msgstr ""
429
+
430
+ #: cp_calculatedfieldsf_admin_int.php:520
431
+ msgid "Send confirmation/thank you message to user?"
432
+ msgstr ""
433
+
434
+ #: cp_calculatedfieldsf_admin_int.php:530
435
+ msgid "Email field on the form"
436
+ msgstr ""
437
+
438
+ #: cp_calculatedfieldsf_admin_int.php:557
439
+ msgid "Captcha Verification"
440
+ msgstr ""
441
+
442
+ #: cp_calculatedfieldsf_admin_int.php:561
443
+ msgid "Use Captcha Verification?"
444
+ msgstr ""
445
+
446
+ #: cp_calculatedfieldsf_admin_int.php:572
447
+ msgid "Width"
448
+ msgstr ""
449
+
450
+ #: cp_calculatedfieldsf_admin_int.php:574
451
+ msgid "Height"
452
+ msgstr ""
453
+
454
+ #: cp_calculatedfieldsf_admin_int.php:576
455
+ msgid "Chars"
456
+ msgstr ""
457
+
458
+ #: cp_calculatedfieldsf_admin_int.php:581
459
+ msgid "Min font size"
460
+ msgstr ""
461
+
462
+ #: cp_calculatedfieldsf_admin_int.php:583
463
+ msgid "Max font size"
464
+ msgstr ""
465
+
466
+ #: cp_calculatedfieldsf_admin_int.php:588
467
+ msgid "security code"
468
+ msgstr ""
469
+
470
+ #: cp_calculatedfieldsf_admin_int.php:594
471
+ msgid "Noise"
472
+ msgstr ""
473
+
474
+ #: cp_calculatedfieldsf_admin_int.php:596
475
+ msgid "Noise Length"
476
+ msgstr ""
477
+
478
+ #: cp_calculatedfieldsf_admin_int.php:601
479
+ msgid "Background"
480
+ msgstr ""
481
+
482
+ #: cp_calculatedfieldsf_admin_int.php:608
483
+ msgid "Font"
484
+ msgstr ""
485
+
486
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:71
487
+ msgid "Item added"
488
+ msgstr ""
489
+
490
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:77
491
+ msgid "Item updated"
492
+ msgstr ""
493
+
494
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:86
495
+ msgid "Item deleted"
496
+ msgstr ""
497
+
498
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:94
499
+ msgid "Item duplicated/cloned"
500
+ msgstr ""
501
+
502
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:133
503
+ msgid "Troubleshoot settings updated"
504
+ msgstr ""
505
+
506
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:187
507
+ msgid "Are you sure that you want to delete this item?"
508
+ msgstr ""
509
+
510
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:195
511
+ msgid "Are you sure that you want to update these settings?"
512
+ msgstr ""
513
+
514
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:213
515
+ msgid "Form List / Items List"
516
+ msgstr ""
517
+
518
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:219
519
+ msgid "ID"
520
+ msgstr ""
521
+
522
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:219
523
+ msgid "Form Name"
524
+ msgstr ""
525
+
526
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:219
527
+ msgid "Options"
528
+ msgstr ""
529
+
530
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:219
531
+ msgid "Shortcode"
532
+ msgstr ""
533
+
534
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:232
535
+ msgid "Update"
536
+ msgstr ""
537
+
538
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:234
539
+ msgid "Messages"
540
+ msgstr ""
541
+
542
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:235
543
+ msgid "Clone"
544
+ msgstr ""
545
+
546
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:236
547
+ msgid "Delete"
548
+ msgstr ""
549
+
550
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:248
551
+ msgid "New Form"
552
+ msgstr ""
553
+
554
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:252
555
+ msgid "Item Name"
556
+ msgstr ""
557
+
558
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:260
559
+ msgid "Troubleshoot Area & General Settings"
560
+ msgstr ""
561
+
562
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:264
563
+ msgid ""
564
+ "<strong>Important!</strong>: Use this area <strong>only</strong> if you are "
565
+ "experiencing conflicts with third party plugins, with the theme scripts or "
566
+ "with the character encoding."
567
+ msgstr ""
568
+
569
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:265
570
+ msgid "Script load method"
571
+ msgstr ""
572
+
573
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:267
574
+ msgid "Classic (Recommended)"
575
+ msgstr ""
576
+
577
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:268
578
+ msgid "Direct"
579
+ msgstr ""
580
+
581
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:270
582
+ msgid ""
583
+ "* Change the script load method if the form doesn't appear in the public "
584
+ "website."
585
+ msgstr ""
586
+
587
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:272
588
+ msgid "Character encoding"
589
+ msgstr ""
590
+
591
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:274
592
+ msgid "Keep current charset (Recommended)"
593
+ msgstr ""
594
+
595
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:275
596
+ msgid "try this first"
597
+ msgstr ""
598
+
599
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:276
600
+ msgid "Only from MySQL 5.5"
601
+ msgstr ""
602
+
603
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:279
604
+ msgid ""
605
+ "* Update the charset if you are getting problems displaying special/non-"
606
+ "latin characters. After updated you need to edit the special characters "
607
+ "again."
608
+ msgstr ""
609
+
610
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:282
611
+ msgid "Activate Javascript Cache"
612
+ msgstr ""
613
+
614
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:284
615
+ msgid "Do not load the forms with crawlers"
616
+ msgstr ""
617
+
618
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:284
619
+ msgid "* The forms are not loaded when website is being indexed by searchers."
620
+ msgstr ""
621
+
622
+ #: cp_calculatedfieldsf_admin_int_list.inc.php:286
623
+ msgid "UPDATE"
624
+ msgstr ""
templates/01/bg_top.png ADDED
Binary file
templates/01/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_letter"
2
+ file="style.css"
3
+ title="Template 1"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Display your form with a letter design (class: .cp_cff_letter )"
templates/01/style.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_letter{background:url("bg_top.png") 0 0 repeat-x #E4E4E4; border:1px solid #C4C4C4; padding:10px;}
2
+ .cp_cff_letter #fbuilder{}
3
+ .cp_cff_letter #fbuilder h1,
4
+ .cp_cff_letter #fbuilder h2{color:#204a70;}
5
+
6
+
7
+ .cp_cff_letter #fbuilder input[type="password"],
8
+ .cp_cff_letter #fbuilder input[type="date"],
9
+ .cp_cff_letter #fbuilder input[type="datetime"],
10
+ .cp_cff_letter #fbuilder input[type="email"],
11
+ .cp_cff_letter #fbuilder input[type="search"],
12
+ .cp_cff_letter #fbuilder input[type="time"],
13
+ .cp_cff_letter #fbuilder input[type="url"],
14
+ .cp_cff_letter #fbuilder select,
15
+ .cp_cff_letter #fbuilder textarea,
16
+ .cp_cff_letter #fbuilder input[type="text"],
17
+ .cp_cff_letter #fbuilder input[type="number"],
18
+ .cp_cff_letter #fbuilder input[type="file"]{border-bottom:1px solid #bbb;border-top:1px solid #999;border-left:1px solid #bbb;border-right:1px solid #bbb;padding-top:5px;padding-bottom:5px;font-size:14px;-webkit-box-shadow:#fdfdfd 0px 1px 1px;color:#888;padding-left:5px; padding-right:5px;}
19
+
20
+ .cp_cff_letter #fbuilder .large{
21
+ width: calc( 100% - 12px ) !important;
22
+ width: -moz-calc( 100% - 12px ) !important;
23
+ width: -webkit-calc( 100% - 12px ) !important;
24
+ width: -o-calc( 100% - 12px ) !important;
25
+ }
26
+
27
+ @media screen and (min-width: 740px),print{
28
+ .cp_cff_letter #fbuilder .medium {
29
+ width: calc( 50% - 12px ) !important;
30
+ width: -moz-calc( 50% - 12px ) !important;
31
+ width: -webkit-calc( 50% - 12px ) !important;
32
+ width: -o-calc( 50% - 12px ) !important;
33
+ }
34
+ .cp_cff_letter #fbuilder .small {
35
+ width: calc( 25% - 12px ) !important;
36
+ width: -moz-calc( 25% - 12px ) !important;
37
+ width: -webkit-calc( 25% - 12px ) !important;
38
+ width: -o-calc( 25% - 12px ) !important;
39
+ }
40
+ }
41
+
42
+ @media screen and (max-width: 640px){
43
+ .cp_cff_letter #fbuilder .medium,
44
+ .cp_cff_letter #fbuilder .small {
45
+ width: calc( 100% - 12px ) !important;
46
+ width: -moz-calc( 100% - 12px ) !important;
47
+ width: -webkit-calc( 100% - 12px ) !important;
48
+ width: -o-calc( 100% - 12px ) !important;
49
+ }
50
+ }
51
+
52
+ .cp_cff_letter #fbuilder{text-shadow:0px 1px 0px #fff;}
53
+ .cp_cff_letter #fbuilder legend{background:#FFF; border:1px solid #C4C4C4;}
54
+ .cp_cff_letter #fbuilder fieldset{border:1px solid #C4C4C4;}
55
+
56
+ .cp_cff_letter #fbuilder input[type="button"],
57
+ .cp_cff_letter #fbuilder input[type="reset"],
58
+ .cp_cff_letter #fbuilder .pbSubmit,
59
+ .cp_cff_letter #fbuilder .pbPrevious,
60
+ .cp_cff_letter #fbuilder .pbNext{color:#fff;font-size:13px;font-weight:bold;text-shadow:0px 1px 0px #000;background:#3b679e; /* Old browsers */background:-moz-linear-gradient(top, #3b679e 0%, #2b88d9 50%, #207cca 51%, #7db9e8 100%); /* FF3.6+ */background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#3b679e), color-stop(50%,#2b88d9), color-stop(51%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */background:-webkit-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */background:-o-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* Opera 11.10+ */background:-ms-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* IE10+ */background:linear-gradient(to bottom, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* W3C */filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3b679e', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;padding: 5px 20px;border:0;}
61
+
62
+ .cp_cff_letter #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
63
+
64
+ .cp_cff_letter #fbuilder .slider{ border: 1px solid #bbb;}
65
+ .cp_cff_letter #fbuilder .ui-slider-range{background: rgba(125, 185, 232, .4);}
66
+ .cp_cff_letter #fbuilder .ui-slider-handle{
67
+ background:#3b679e; /* Old browsers */background:-moz-linear-gradient(top, #3b679e 0%, #2b88d9 50%, #207cca 51%, #7db9e8 100%); /* FF3.6+ */background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#3b679e), color-stop(50%,#2b88d9), color-stop(51%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */background:-webkit-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */background:-o-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* Opera 11.10+ */background:-ms-linear-gradient(top, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* IE10+ */background:linear-gradient(to bottom, #3b679e 0%,#2b88d9 50%,#207cca 51%,#7db9e8 100%); /* W3C */filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#3b679e', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */
68
+ border: 1px solid #204a70;
69
+ }
70
+
71
+ .cp_cff_letter #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/01/thumbnail.jpg ADDED
Binary file
templates/02/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_professional"
2
+ file="style.css"
3
+ title="Template 2"
4
+ thumbnail="thumbnail.png"
5
+ description="Professional design with appearance of mobile device (class: .cp_cff_professional)"
templates/02/style.css ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_professional{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;padding:10px;background: #5e513e;
2
+ background: -moz-linear-gradient(top, #5e513e 0%, #423524 100%);
3
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5e513e), color-stop(100%,#423524));
4
+ background: -webkit-linear-gradient(top, #5e513e 0%,#423524 100%);
5
+ background: -o-linear-gradient(top, #5e513e 0%,#423524 100%);
6
+ background: -ms-linear-gradient(top, #5e513e 0%,#423524 100%);
7
+ background: linear-gradient(to bottom, #5e513e 0%,#423524 100%);
8
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5e513e', endColorstr='#423524',GradientType=0 );
9
+ }
10
+
11
+ .cp_cff_professional #fbuilder{ color:#FFF;text-shadow:0px 1px 0px #000000;font-weight:normal; }
12
+ .cp_cff_professional #fbuilder .cpefb_error.message{text-shadow:none;color:#000;}
13
+ .cp_cff_professional #fbuilder .fields label{color:#FFF;}
14
+ .cp_cff_professional #fbuilder .dfield label,
15
+ .cp_cff_professional #fbuilder .uh{color:#c9c2b7;}
16
+
17
+ .cp_cff_professional #fbuilder .slider,
18
+
19
+ .cp_cff_professional #fbuilder input[type="password"],
20
+ .cp_cff_professional #fbuilder input[type="date"],
21
+ .cp_cff_professional #fbuilder input[type="datetime"],
22
+ .cp_cff_professional #fbuilder input[type="email"],
23
+ .cp_cff_professional #fbuilder input[type="search"],
24
+ .cp_cff_professional #fbuilder input[type="time"],
25
+ .cp_cff_professional #fbuilder input[type="url"],
26
+ .cp_cff_professional #fbuilder select,
27
+ .cp_cff_professional #fbuilder textarea,
28
+ .cp_cff_professional #fbuilder input[type="text"],
29
+ .cp_cff_professional #fbuilder input[type="number"],
30
+ .cp_cff_professional #fbuilder input[type="file"]{
31
+ border-bottom:1px solid #776D5D;
32
+ border-top:1px solid #252118;
33
+ border-left:1px solid #312C20;
34
+ border-right:1px solid #312C20;padding-top:5px;padding-bottom:5px;
35
+ color:#c9c2b7;
36
+ -webkit-border-radius:10px;
37
+ -moz-border-radius:10px;
38
+ border-radius:10px;
39
+ background: #322c20;
40
+ background: -moz-linear-gradient(top, #322c20 0%, #3b3425 8%, #483f2e 100%);
41
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#322c20), color-stop(8%,#3b3425), color-stop(100%,#483f2e));
42
+ background: -webkit-linear-gradient(top, #322c20 0%,#3b3425 8%,#483f2e 100%);
43
+ background: -o-linear-gradient(top, #322c20 0%,#3b3425 8%,#483f2e 100%);
44
+ background: -ms-linear-gradient(top, #322c20 0%,#3b3425 8%,#483f2e 100%);
45
+ background: linear-gradient(to bottom, #322c20 0%,#3b3425 8%,#483f2e 100%);
46
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#322c20', endColorstr='#483f2e',GradientType=0 );
47
+ padding-left:10px; padding-right:10px;
48
+ }
49
+
50
+ .cp_cff_professional #fbuilder .large{
51
+ width: calc( 100% - 22px ) !important;
52
+ width: -webkit-calc( 100% - 22px ) !important;
53
+ width: -moz-calc( 100% - 22px ) !important;
54
+ width: -o-calc( 100% - 22px ) !important;
55
+ }
56
+
57
+ @media screen and (min-width: 740px),print{
58
+ .cp_cff_professional #fbuilder .medium {
59
+ width: calc( 50% - 22px ) !important;
60
+ width: -moz-calc( 50% - 22px ) !important;
61
+ width: -webkit-calc( 50% - 22px ) !important;
62
+ width: -o-calc( 50% - 22px ) !important;
63
+ }
64
+ .cp_cff_professional #fbuilder .small {
65
+ width: calc( 25% - 22px ) !important;
66
+ width: -moz-calc( 25% - 22px ) !important;
67
+ width: -webkit-calc( 25% - 22px ) !important;
68
+ width: -o-calc( 25% - 22px ) !important;
69
+ }
70
+ }
71
+
72
+ @media screen and (max-width: 640px){
73
+ .cp_cff_professional #fbuilder .medium,
74
+ .cp_cff_professional #fbuilder .small {
75
+ width: calc( 100% - 22px ) !important;
76
+ width: -moz-calc( 100% - 22px ) !important;
77
+ width: -webkit-calc( 100% - 22px ) !important;
78
+ width: -o-calc( 100% - 22px ) !important;
79
+ }
80
+ }
81
+
82
+ .cp_cff_professional #fbuilder fieldset{border:0;}
83
+ .cp_cff_professional #fbuilder legend{border:0;padding:0;font-size:150%;}
84
+
85
+
86
+ .cp_cff_professional #fbuilder input[type="button"],
87
+ .cp_cff_professional #fbuilder input[type="reset"],
88
+ .cp_cff_professional #fbuilder .pbSubmit,
89
+ .cp_cff_professional #fbuilder .pbPrevious,
90
+ .cp_cff_professional #fbuilder .pbNext{color:#fff;font-size:13px;font-weight:bold;text-shadow:0px 1px 0px #000;background: #bfd255;
91
+ background: -moz-linear-gradient(top, #bfd255 0%, #8eb92a 50%, #72aa00 51%, #9ecb2d 100%);
92
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bfd255), color-stop(50%,#8eb92a), color-stop(51%,#72aa00), color-stop(100%,#9ecb2d));
93
+ background: -webkit-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
94
+ background: -o-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
95
+ background: -ms-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
96
+ background: linear-gradient(to bottom, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
97
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bfd255', endColorstr='#9ecb2d',GradientType=0 );
98
+ -webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;padding: 5px 20px;border:0;}
99
+ .cp_cff_professional #fbuilder .slider{ padding:0;}
100
+ .cp_cff_professional #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
101
+
102
+ .cp_cff_professional #fbuilder .ui-slider-range{background:rgba(173, 201, 69, .7);}
103
+ .cp_cff_professional #fbuilder .ui-slider-handle{
104
+ background: #bfd255;
105
+ background: -moz-linear-gradient(top, #bfd255 0%, #8eb92a 50%, #72aa00 51%, #9ecb2d 100%);
106
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bfd255), color-stop(50%,#8eb92a), color-stop(51%,#72aa00), color-stop(100%,#9ecb2d));
107
+ background: -webkit-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
108
+ background: -o-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
109
+ background: -ms-linear-gradient(top, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
110
+ background: linear-gradient(to bottom, #bfd255 0%,#8eb92a 50%,#72aa00 51%,#9ecb2d 100%);
111
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bfd255', endColorstr='#9ecb2d',GradientType=0 );
112
+ border: 1px solid #9ecb2d;
113
+ }
114
+
115
+ .cp_cff_professional #fbuilder .section_breaks{margin-top:20px; margin-bottom:20px;}
116
+ .cp_cff_professional #fbuilder .section_breaks>label{font-size:1.3em;}
117
+ .cp_cff_professional #fbuilder .section_breaks .section_break{border:0;}
118
+
119
+ .cp_cff_professional #fbuilder .apply-coupon{background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjYmZkMjU1IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xMSAwLTIgLjktMiAydjE0YzAgMS4xLjg5IDIgMiAyaDE0YzEuMTEgMCAyLS45IDItMlY1YzAtMS4xLS44OS0yLTItMnptLTkgMTRsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=');}
120
+
121
+ .cp_cff_professional #fbuilder .discount-container{margin-top:10px;font-weight:bold;color: #bfd255;}
templates/02/thumbnail.png ADDED
Binary file
templates/03/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_natural"
2
+ file="style.css"
3
+ title="Template 3"
4
+ thumbnail="thumbnail.jpg"
5
+ description="A design with natural decorations (class: .cp_cff_natural)"
templates/03/style.css ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_natural{background:url("top_bg.png") 0 0 repeat-x #f3f6ea; padding:10px;}
2
+ .cp_cff_natural #fbuilder{padding:10px;}
3
+ .cp_cff_natural #fbuilder h1,
4
+ .cp_cff_natural #fbuilder h2{color:rgb(255, 255, 255);font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;margin-bottom:0;font-size:200%;font-weight:normal;font-variant:small-caps;}
5
+ .cp_cff_natural #fbuilder .fform span{font-style:italic;font-family:Georgia, 'Times New Roman', Times, serif;}
6
+
7
+ .cp_cff_natural #fbuilder select,
8
+ .cp_cff_natural #fbuilder textarea,
9
+ .cp_cff_natural #fbuilder input[type=date],
10
+ .cp_cff_natural #fbuilder input[type=datetime],
11
+ .cp_cff_natural #fbuilder input[type=time],
12
+ .cp_cff_natural #fbuilder input[type=search],
13
+ .cp_cff_natural #fbuilder input[type=url],
14
+ .cp_cff_natural #fbuilder input[type=email],
15
+ .cp_cff_natural #fbuilder input[type=password],
16
+ .cp_cff_natural #fbuilder input[type=text],
17
+ .cp_cff_natural #fbuilder input[type=number],
18
+ .cp_cff_natural #fbuilder input[type=file]{
19
+ border:1px solid rgb(150, 150, 150);padding:5px;font-size:14px;background:#FFF;color:#000;
20
+ }
21
+
22
+ .cp_cff_natural #fbuilder .large{
23
+ width: calc( 100% - 12px ) !important;
24
+ width: -moz-calc( 100% - 12px ) !important;
25
+ width: -o-calc( 100% - 12px ) !important;
26
+ width: -webkit-calc( 100% - 12px ) !important;
27
+ }
28
+
29
+ @media screen and (min-width: 740px),print{
30
+ .cp_cff_natural #fbuilder .medium{
31
+ width: calc( 50% - 12px ) !important;
32
+ width: -moz-calc( 50% - 12px ) !important;
33
+ width: -o-calc( 50% - 12px ) !important;
34
+ width: -webkit-calc( 50% - 12px ) !important;
35
+ }
36
+
37
+ .cp_cff_natural #fbuilder .small{
38
+ width: calc( 25% - 12px ) !important;
39
+ width: -moz-calc( 25% - 12px ) !important;
40
+ width: -o-calc( 25% - 12px ) !important;
41
+ width: -webkit-calc( 25% - 12px ) !important;
42
+ }
43
+ }
44
+ @media screen and (max-width: 640px){
45
+ .cp_cff_natural #fbuilder .medium,{
46
+ .cp_cff_natural #fbuilder .small{
47
+ width: calc( 100% - 12px ) !important;
48
+ width: -moz-calc( 100% - 12px ) !important;
49
+ width: -o-calc( 100% - 12px ) !important;
50
+ width: -webkit-calc( 100% - 12px ) !important;
51
+ }
52
+ }
53
+
54
+ .cp_cff_natural #fbuilder{color:rgb(64, 63, 61);}
55
+ .cp_cff_natural #fbuilder .uh{color:rgb(112, 140, 0);}
56
+
57
+ .cp_cff_natural #fbuilder legend{background:url("top_bg.png"); border:3px solid #FFF;color:#FFF;font-weight:bold;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}
58
+ .cp_cff_natural #fbuilder fieldset{border:0;padding:0;}
59
+
60
+ .cp_cff_natural #fbuilder input[type=button],
61
+ .cp_cff_natural #fbuilder input[type=reset],
62
+ .cp_cff_natural #fbuilder .pbSubmit,
63
+ .cp_cff_natural #fbuilder .pbPrevious,
64
+ .cp_cff_natural #fbuilder .pbNext{color:#fff;font-variant:small-caps;font-size:14px;font-weight:bold;background:url("top_bg.png");-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;padding: 5px 20px;border:0;}
65
+
66
+ .cp_cff_natural #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
67
+
68
+ .cp_cff_natural #fbuilder .slider{ border: 1px solid rgb(150, 150, 150);}
69
+ .cp_cff_natural #fbuilder .ui-slider-range{background: rgba(153, 200, 115,.5);}
70
+ .cp_cff_natural #fbuilder .ui-slider-handle{
71
+ background: #99C878;
72
+ border: 1px solid #99C878;
73
+ }
74
+
75
+ .cp_cff_natural #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/03/thumbnail.jpg ADDED
Binary file
templates/03/top_bg.png ADDED
Binary file
templates/04/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_elegant"
2
+ file="style.css"
3
+ title="Template 4"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Elegant style with a light appearance (class: .cp_cff_elegant)"
templates/04/style.css ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_elegant{padding:10px;}
2
+ .cp_cff_elegant #fbuilder{color: rgb(81, 62, 43);font-family: Cambria, Georgia, 'Times New Roman', Times, serif;}
3
+ .cp_cff_elegant #fbuilder h1,
4
+ .cp_cff_elegant #fbuilder h2{color: rgb(81, 62, 43);font-family:p22-underground, arial, sans-serif;margin-bottom:0;font-size:200%;font-weight:normal;text-align: center;text-transform: uppercase;}
5
+ .cp_cff_elegant #fbuilder .fields.section_breaks{margin-bottom:15px;margin-top:15px;}
6
+ .cp_cff_elegant #fbuilder .fields.section_breaks,
7
+ .cp_cff_elegant #fbuilder .fform span{color:rgb(164, 147, 132);text-align:center;font-variant:small-caps;border-top:1px dotted rgb(164, 147, 132);border-bottom:1px dotted rgb(164, 147, 132);display:block;padding:0;}
8
+ .cp_cff_elegant #fbuilder .fields .section_break{display:none;}
9
+ .cp_cff_elegant #fbuilder select,
10
+ .cp_cff_elegant #fbuilder textarea,
11
+ .cp_cff_elegant #fbuilder input[type=date],
12
+ .cp_cff_elegant #fbuilder input[type=datetime],
13
+ .cp_cff_elegant #fbuilder input[type=time],
14
+ .cp_cff_elegant #fbuilder input[type=search],
15
+ .cp_cff_elegant #fbuilder input[type=url],
16
+ .cp_cff_elegant #fbuilder input[type=email],
17
+ .cp_cff_elegant #fbuilder input[type=password],
18
+ .cp_cff_elegant #fbuilder input[type=text],
19
+ .cp_cff_elegant #fbuilder input[type=number],
20
+ .cp_cff_elegant #fbuilder input[type=file]{border:1px solid rgb(148, 132, 116);padding-bottom:5px;padding-top:5px;font-size:14px;background:#FFF;color:rgb(81, 62, 43);-webkit-box-shadow:inset 0px 2px 7px 0px rgba(0, 0, 0, 0.09);-moz-box-shadow:inset 0px 2px 7px 0px rgba(0, 0, 0, 0.09);box-shadow:inset 0px 2px 7px 0px rgba(0, 0, 0, 0.09);padding-left:5px;padding-right:5px;}
21
+ .cp_cff_elegant #fbuilder .uh{color:rgb(164, 147, 132);}
22
+
23
+ .cp_cff_elegant #fbuilder legend{color:rgb(164, 147, 132);font-weight:normal;text-align:center;border:0;font-family:p22-underground, arial, sans-serif;}
24
+ .cp_cff_elegant #fbuilder legend:before,
25
+ .cp_cff_elegant #fbuilder legend:after{content:"\007E";}
26
+
27
+ .cp_cff_elegant #fbuilder fieldset{border:0;padding:0;}
28
+ .cp_cff_elegant #fbuilder input[type=button],
29
+ .cp_cff_elegant #fbuilder input[type=reset],
30
+ .cp_cff_elegant #fbuilder .pbSubmit,
31
+ .cp_cff_elegant #fbuilder .pbPrevious,
32
+ .cp_cff_elegant #fbuilder .pbNext{border:0; color:#fff;font-variant:small-caps;font-size:14px;font-weight:bold;background:rgb(115, 185, 214);-webkit-border-top-right-radius: 10px;-webkit-border-bottom-left-radius: 10px;-moz-border-radius-topright: 10px;-moz-border-radius-bottomleft: 10px;border-top-right-radius: 10px;border-bottom-left-radius: 10px;padding:5px 20px;}
33
+ .cp_cff_elegant #fbuilder .r{color:rgb(115, 185, 214);}
34
+
35
+ .cp_cff_elegant #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
36
+
37
+ .cp_cff_elegant #fbuilder .ui-slider-range{border-radius:0;background: rgb(115, 185, 214) !important; }
38
+ .cp_cff_elegant #fbuilder .slider{background: #DCDCDC !important; border-radius: 0;border:0;height: .3em;}
39
+ .cp_cff_elegant #fbuilder .ui-slider-handle{
40
+ height: .8em;
41
+ border-radius: 0;
42
+ width: .8em;
43
+ background: #FFF;
44
+ border: 1px solid rgb(148, 132, 116);
45
+ }
46
+
47
+ .cp_cff_elegant #fbuilder .apply-coupon{background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJyZ2IoMTE1LCAxODUsIDIxNCkiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTkgM0g1Yy0xLjExIDAtMiAuOS0yIDJ2MTRjMCAxLjEuODkgMiAyIDJoMTRjMS4xMSAwIDItLjkgMi0yVjVjMC0xLjEtLjg5LTItMi0yem0tOSAxNGwtNS01IDEuNDEtMS40MUwxMCAxNC4xN2w3LjU5LTcuNTlMMTkgOGwtOSA5eiIvPjwvc3ZnPg==');}
48
+
49
+ .cp_cff_elegant #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/04/thumbnail.jpg ADDED
Binary file
templates/05/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_decorative"
2
+ file="style.css"
3
+ title="Template 5"
4
+ thumbnail="thumbnail.png"
5
+ description="Decorative style (class: .cp_cff_decorative)"
templates/05/form_bg.jpg ADDED
Binary file
templates/05/style.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_decorative{padding:20px;background:url("form_bg.jpg");-webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;-webkit-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.32);-moz-box-shadow:0px 0px 5px 2px rgba(0, 0, 0, 0.32);box-shadow:0px 0px 5px 2px rgba(0, 0, 0, 0.32);}
2
+ .cp_cff_decorative #fbuilder{color: rgb(0, 34, 65);font-family: Cambria, Georgia, 'Times New Roman', Times, serif;}
3
+ .cp_cff_decorative #fbuilder h1,
4
+ .cp_cff_decorative #fbuilder h2{font: bold 43px/58px georgia, 'Times New Roman', Times, serif;color:rgb(0, 34, 65);margin-bottom:0;font-size:200%;font-weight:normal;text-align: center;text-transform: uppercase;letter-spacing:-2px;line-height:26px;margin-top:10px;}
5
+ .cp_cff_decorative #fbuilder .fform span{text-align:center;font-variant:small-caps;display:block;}
6
+ .cp_cff_decorative #fbuilder .fields.section_breaks{margin-bottom:20px; margin-top:20px;}
7
+ .cp_cff_decorative #fbuilder .fields.section_breaks label{text-align:center;font-variant:small-caps;display:block;font-size:1.3em;}
8
+ .cp_cff_decorative #fbuilder .fields.section_breaks span.uh{text-align:center;}
9
+ .cp_cff_decorative #fbuilder .fields .section_break{display:none;}
10
+ .cp_cff_decorative #fbuilder select,
11
+ .cp_cff_decorative #fbuilder textarea,
12
+ .cp_cff_decorative #fbuilder input[type=date],
13
+ .cp_cff_decorative #fbuilder input[type=datetime],
14
+ .cp_cff_decorative #fbuilder input[type=time],
15
+ .cp_cff_decorative #fbuilder input[type=search],
16
+ .cp_cff_decorative #fbuilder input[type=url],
17
+ .cp_cff_decorative #fbuilder input[type=email],
18
+ .cp_cff_decorative #fbuilder input[type=password],
19
+ .cp_cff_decorative #fbuilder input[type=text],
20
+ .cp_cff_decorative #fbuilder input[type=number],
21
+ .cp_cff_decorative #fbuilder input[type=file]{border-bottom: 1px solid rgb(223, 221, 193);border-left:0px;border-right:0px;border-top:0px;padding:5px 0;font-size:14px;background:#FCFAE6;color:rgb(0, 34, 65);}
22
+ .cp_cff_decorative #fbuilder textarea{border: 1px solid rgb(223, 221, 193);}
23
+ .cp_cff_decorative #fbuilder .fields:not(.section_breaks) label{font: bold 11px 'century gothic', Arial, Helvetica, sans-serif;text-transform: uppercase;color: rgb(229, 27, 36);}
24
+ .cp_cff_decorative #fbuilder .fields .dfield label{color: rgb(0, 34, 65);}
25
+
26
+ .cp_cff_decorative #fbuilder legend{font-weight:normal;text-align:center;border:0;}
27
+
28
+ .cp_cff_decorative #fbuilder fieldset{border:0;padding:0;}
29
+ .cp_cff_decorative #fbuilder input[type="button"],
30
+ .cp_cff_decorative #fbuilder input[type="reset"],
31
+ .cp_cff_decorative #fbuilder .pbSubmit,
32
+ .cp_cff_decorative #fbuilder .pbPrevious,
33
+ .cp_cff_decorative #fbuilder .pbNext{padding: 5px 20px;color:#fff;font-family: 'century gothic', Arial, Helvetica, sans-serif;text-transform:uppercase;font-size:14px;font-weight:bold;background: #cc3333;background:-moz-linear-gradient(top, #cc3333 11%, #8c0000 77%, #8c0000 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(11%,#cc3333), color-stop(77%,#8c0000), color-stop(100%,#8c0000));background: -webkit-linear-gradient(top, #cc3333 11%,#8c0000 77%,#8c0000 100%);background: -o-linear-gradient(top, #cc3333 11%,#8c0000 77%,#8c0000 100%);background: -ms-linear-gradient(top, #cc3333 11%,#8c0000 77%,#8c0000 100%);background: linear-gradient(to bottom, #cc3333 11%,#8c0000 77%,#8c0000 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc3333', endColorstr='#8c0000',GradientType=0 );border:2px solid #FCFAE6;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-webkit-box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.32);-moz-box-shadow:0px 0px 5px 2px rgba(0, 0, 0, 0.32);box-shadow:0px 0px 5px 2px rgba(0, 0, 0, 0.32);}
34
+ .cp_cff_decorative #fbuilder .r{color:rgb(0,0,0);}
35
+ .cp_cff_decorative #fbuilder .r:before{content:" (";}
36
+ .cp_cff_decorative #fbuilder .r:after{content:")";}
37
+
38
+ .cp_cff_decorative #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
39
+
40
+ .cp_cff_decorative #fbuilder .slider{background: rgb(223, 221, 193) !important; border-radius: 0;border:0;height: .3em;}
41
+ .cp_cff_decorative #fbuilder .ui-slider-handle{
42
+ height: .8em;
43
+ border-radius: 0;
44
+ width: .8em;
45
+ background: #cc3333;
46
+ border: 1px solid #cc3333;
47
+ }
48
+
49
+ .cp_cff_decorative #fbuilder .apply-coupon{background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjOGMwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xMSAwLTIgLjktMiAydjE0YzAgMS4xLjg5IDIgMiAyaDE0YzEuMTEgMCAyLS45IDItMlY1YzAtMS4xLS44OS0yLTItMnptLTkgMTRsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=');}
50
+
51
+ .cp_cff_decorative #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/05/thumbnail.png ADDED
Binary file
templates/06/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_clean"
2
+ file="style.css"
3
+ title="Template 6"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Clean style for forms (class: .cp_cff_clean)"
templates/06/style.css ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_clean #fbuilder{color:#384248;font-family: "MuseoSans-100" "Lucida Grande","Lucida Sans Unicode",Verdana,"Jamrul",sans-serif;text-shadow:0px 1px 0px #fff;}
2
+ .cp_cff_clean #fbuilder .fields.section_breaks label,
3
+ .cp_cff_clean #fbuilder .fform span,
4
+ .cp_cff_clean #fbuilder .uh{color:#0093DA;}
5
+
6
+ .cp_cff_clean #fbuilder .fields.section_breaks{margin-top:20px; margin-bottom:20px;}
7
+ .cp_cff_clean #fbuilder .fields.section_breaks .section_break{border: 0;}
8
+ .cp_cff_clean #fbuilder .fields.section_breaks label{font-size:1.3em;}
9
+
10
+ .cp_cff_clean #fbuilder input[type="date"],
11
+ .cp_cff_clean #fbuilder input[type="datetime"],
12
+ .cp_cff_clean #fbuilder input[type="search"],
13
+ .cp_cff_clean #fbuilder input[type="time"],
14
+ .cp_cff_clean #fbuilder input[type="url"],
15
+ .cp_cff_clean #fbuilder input[type=email],
16
+ .cp_cff_clean #fbuilder input[type="password"],
17
+ .cp_cff_clean #fbuilder select,
18
+ .cp_cff_clean #fbuilder textarea,
19
+ .cp_cff_clean #fbuilder input[type=text],
20
+ .cp_cff_clean #fbuilder input[type=number],
21
+ .cp_cff_clean #fbuilder input[type=file]{
22
+ border: solid 1px #D7D9DA;
23
+ background:#FFF;
24
+ padding:5px;
25
+ }
26
+
27
+ .cp_cff_clean #fbuilder input[type="date"].large,
28
+ .cp_cff_clean #fbuilder input[type="datetime"].large,
29
+ .cp_cff_clean #fbuilder input[type="search"].large,
30
+ .cp_cff_clean #fbuilder input[type="time"].large,
31
+ .cp_cff_clean #fbuilder input[type="url"].large,
32
+ .cp_cff_clean #fbuilder input[type=email].large,
33
+ .cp_cff_clean #fbuilder input[type="password"].large,
34
+ .cp_cff_clean #fbuilder select.large,
35
+ .cp_cff_clean #fbuilder textarea.large,
36
+ .cp_cff_clean #fbuilder input[type=text].large,
37
+ .cp_cff_clean #fbuilder input[type=number].large,
38
+ .cp_cff_clean #fbuilder input[type=file].large{
39
+ width: calc( 100% - 10px ) !important;
40
+ width: -moz-calc( 100% - 10px ) !important;
41
+ width: -o-calc( 100% - 10px ) !important;
42
+ width: -webkit-calc( 100% - 10px ) !important;
43
+ }
44
+
45
+ .cp_cff_clean #fbuilder .captcha{margin-bottom:10px;}
46
+ .cp_cff_clean #fbuilder .fields:not(.section_breaks){padding: 10px;margin-bottom:10px;background:#EBECEC;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}
47
+ .cp_cff_clean #fbuilder .fields.cff-container-field{padding:0px;margin-bottom:0px;}
48
+ .cp_cff_clean #fbuilder fieldset,
49
+ .cp_cff_clean #fbuilder legend{-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;border-color:#EBECEC;}
50
+ .cp_cff_clean #fbuilder legend{background: #EBECEC;border:0;}
51
+
52
+ @media screen and (min-width: 740px),print{
53
+ .cp_cff_clean #fbuilder .fields.column2{float:left;width:calc( 49.9% - 20px );width:-webkit-calc( 49.9% - 20px );width:-moz-calc( 49.9% - 20px );}
54
+ .cp_cff_clean #fbuilder .fields.column3{float:left;width:calc( 33.3% - 20px );width:-webkit-calc( 33.3% - 20px );width:-moz-calc( 33.3% - 20px );}
55
+ .cp_cff_clean #fbuilder .fields.column4{float:left;width:calc( 24.9% - 20px );width:-webkit-calc( 24.9% - 20px );width:-moz-calc( 24.9% - 20px );}
56
+ *[dir="rtl"] .cp_cff_clean #fbuilder .fields.column2{float:right;}
57
+ *[dir="rtl"] .cp_cff_clean #fbuilder .fields.column3{float:right;}
58
+ *[dir="rtl"] .cp_cff_clean #fbuilder .fields.column4{float:right;}
59
+ }
60
+
61
+ @media screen and (max-width: 740px){
62
+ .cp_cff_clean #fbuilder input[type="date"],
63
+ .cp_cff_clean #fbuilder input[type="datetime"],
64
+ .cp_cff_clean #fbuilder input[type="search"],
65
+ .cp_cff_clean #fbuilder input[type="time"],
66
+ .cp_cff_clean #fbuilder input[type="url"],
67
+ .cp_cff_clean #fbuilder input[type=email],
68
+ .cp_cff_clean #fbuilder input[type="password"],
69
+ .cp_cff_clean #fbuilder select,
70
+ .cp_cff_clean #fbuilder textarea,
71
+ .cp_cff_clean #fbuilder input[type=text],
72
+ .cp_cff_clean #fbuilder input[type=number],
73
+ .cp_cff_clean #fbuilder input[type=file]{
74
+ width: calc( 100% - 10px ) !important;
75
+ width: -moz-calc( 100% - 10px ) !important;
76
+ width: -o-calc( 100% - 10px ) !important;
77
+ width: -webkit-calc( 100% - 10px ) !important;
78
+ }
79
+ }
80
+
81
+ .cp_cff_clean #fbuilder input[type=button],
82
+ .cp_cff_clean #fbuilder input[type=reset],
83
+ .cp_cff_clean #fbuilder .pbSubmit,
84
+ .cp_cff_clean #fbuilder .pbPrevious,
85
+ .cp_cff_clean #fbuilder .pbNext{color:#fff;font-size:14px;background: #0093DA;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;margin:0 10px 0 0; text-shadow:none !important;border:0;padding: 5px 20px;}
86
+ .cp_cff_clean #fbuilder .r{color:rgb(255,0,0);}
87
+
88
+ .cp_cff_clean #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
89
+
90
+ .cp_cff_clean #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/06/thumbnail.jpg ADDED
Binary file
templates/07/config.ini ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ prefix="cp_cff_minimalist"
2
+ file="style.css"
3
+ js="js.js"
4
+ title="Template 7"
5
+ thumbnail="thumbnail.jpg"
6
+ description="Forms with minimalist design (class: .cp_cff_minimalist)"
templates/07/js.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery( window ).on( 'load', function(){
2
+ var progressBar = function( e )
3
+ {
4
+ var p = (e.find( '.pbreak:visible' ).attr( 'page' ))*1+1,
5
+ t = e.find( '.pbreak' ).length;
6
+ e.find( '.wizard-progressbar-value' ).css( 'width', (p/t*100)+'%' );
7
+ };
8
+ if( fbuilderjQuery( '.cp_cff_minimalist .pbreak' ).length > 1 )
9
+ {
10
+ fbuilderjQuery( '.cp_cff_minimalist .pbreak:visible' ).each(function(){
11
+ var p = fbuilderjQuery(this).parent();
12
+ if( p.find( '.wizard-progressbar' ).length != 0 ) return;
13
+ p.prepend( '<div><div class="wizard-progressbar"><div class="wizard-progressbar-value"></div></div></div>' );
14
+ progressBar( fbuilderjQuery( this ).closest( '#fbuilder' ) );
15
+ });
16
+
17
+ fbuilderjQuery( '.cp_cff_minimalist .pbNext' ).click(
18
+ (function( f ){
19
+ return function(){
20
+ f( fbuilderjQuery(this).closest( '#fbuilder' ) );
21
+ };
22
+ })( progressBar ) );
23
+
24
+ fbuilderjQuery( '.cp_cff_minimalist .pbPrevious' ).click(
25
+ (function( f ){
26
+ return function(){
27
+ f( fbuilderjQuery(this).closest( '#fbuilder' ) );
28
+ };
29
+ })( progressBar ) );
30
+ }
31
+ });
templates/07/style.css ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300');
2
+
3
+ .cp_cff_minimalist #fbuilder{
4
+ font-family: 'Open Sans Condensed', arial, sans;
5
+ padding: 30px;
6
+ background: #FFFFFF;
7
+ box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
8
+ -moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
9
+ -webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
10
+ }
11
+ .cp_cff_minimalist #fbuilder .fform{
12
+ background: #4D4D4D;
13
+ text-transform: uppercase;
14
+ font-family: 'Open Sans Condensed', sans-serif;
15
+ color: #797979;
16
+ font-size: 18px;
17
+ font-weight: 100;
18
+ padding: 20px;
19
+ margin: -30px -30px 30px -30px;
20
+ }
21
+ .cp_cff_minimalist #fbuilder .fform h1,
22
+ .cp_cff_minimalist #fbuilder .fform h2{
23
+ color: #797979;
24
+ font-size: 2em;
25
+ font-family: 'Open Sans Condensed', sans-serif;
26
+ }
27
+
28
+ .cp_cff_minimalist #fbuilder input[type="date"],
29
+ .cp_cff_minimalist #fbuilder input[type="datetime"],
30
+ .cp_cff_minimalist #fbuilder input[type="search"],
31
+ .cp_cff_minimalist #fbuilder input[type="time"],
32
+ .cp_cff_minimalist #fbuilder input[type="url"],
33
+ .cp_cff_minimalist #fbuilder input[type=email],
34
+ .cp_cff_minimalist #fbuilder input[type="text"],
35
+ .cp_cff_minimalist #fbuilder input[type="number"],
36
+ .cp_cff_minimalist #fbuilder input[type="password"],
37
+ .cp_cff_minimalist #fbuilder textarea,
38
+ .cp_cff_minimalist #fbuilder select
39
+ {
40
+ box-sizing: border-box;
41
+ -webkit-box-sizing: border-box;
42
+ -moz-box-sizing: border-box;
43
+ outline: none;
44
+ padding: 7px 0;
45
+ border: none;
46
+ border-bottom: 1px solid #ddd;
47
+ background: transparent;
48
+ margin-bottom: 10px;
49
+ font: 16px Arial, Helvetica, sans-serif;
50
+ height: 45px;
51
+ }
52
+ .cp_cff_minimalist #fbuilder textarea{height:auto;}
53
+ .cp_cff_minimalist #fbuilder .fields>label{font-size: 1.3em; }
54
+ .cp_cff_minimalist #fbuilder .pbSubmit,
55
+ .cp_cff_minimalist #fbuilder .pbreak .pbPrevious,
56
+ .cp_cff_minimalist #fbuilder .pbreak .pbNext,
57
+ .cp_cff_minimalist #fbuilder input[type="button"],
58
+ .cp_cff_minimalist #fbuilder input[type="reset"],
59
+ .cp_cff_minimalist #fbuilder input[type="submit"]{
60
+ -moz-box-shadow: inset 0px 1px 0px 0px #45D6D6;
61
+ -webkit-box-shadow: inset 0px 1px 0px 0px #45D6D6;
62
+ box-shadow: inset 0px 1px 0px 0px #45D6D6;
63
+ background-color: #2CBBBB;
64
+ border: 1px solid #27A0A0;
65
+ display: inline-block;
66
+ cursor: pointer;
67
+ color: #FFFFFF;
68
+ font-family: 'Open Sans Condensed', sans-serif;
69
+ font-size: 14px;
70
+ padding: 8px 18px;
71
+ text-decoration: none;
72
+ text-transform: uppercase;
73
+ }
74
+ .cp_cff_minimalist #fbuilder .pbSubmit:hover,
75
+ .cp_cff_minimalist #fbuilder .pbreak .pbPrevious:hover,
76
+ .cp_cff_minimalist #fbuilder .pbreak .pbNext:hover,
77
+ .cp_cff_minimalist #fbuilder input[type="button"]:hover,
78
+ .cp_cff_minimalist #fbuilder input[type="reset"]:hover,
79
+ .cp_cff_minimalist #fbuilder input[type="submit"]:hover {
80
+ background:linear-gradient(to bottom, #34CACA 5%, #30C9C9 100%);
81
+ background-color:#34CACA;
82
+ }
83
+ .cp_cff_minimalist #fbuilder .pbEnd .pbNext,
84
+ .cp_cff_minimalist #fbuilder .pb0 .pbPrevious{display:none;}
85
+ .cp_cff_minimalist #fbuilder fieldset,
86
+ .cp_cff_minimalist #fbuilder legend{border: 1px solid #ddd;}
87
+
88
+ .cp_cff_minimalist #fbuilder .fields.section_breaks .section_break,
89
+ .cp_cff_minimalist #fbuilder .pbreak>fieldset{border:0;}
90
+ .cp_cff_minimalist #fbuilder .pbreak>fieldset>legend{display: none;}
91
+ .cp_cff_minimalist #fbuilder .fields.section_breaks{border-left: 3px solid #27A0A0;padding-left:10px;margin-top:20px; margin-bottom:20px;}
92
+ .cp_cff_minimalist #fbuilder .fields.section_breaks label{font-weight: bold;}
93
+
94
+ .cp_cff_minimalist #fbuilder .r{color:#27A0A0;}
95
+
96
+ .cp_cff_minimalist #fbuilder .wizard-progressbar{width: 100%;height: 5px;background-color: #ddd;}
97
+ .cp_cff_minimalist #fbuilder .wizard-progressbar-value{display: block;background-color: #27A0A0; height: 5px;}
98
+ .cp_cff_minimalist #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important;padding-top:5px;}
99
+ .cp_cff_minimalist #fbuilder .slider{background: #ddd !important; border-radius: 0;border:0;height: .3em;}
100
+ .cp_cff_minimalist #fbuilder .ui-slider-handle{
101
+ height: .8em;
102
+ border-radius: 0;
103
+ width: .8em;
104
+ -moz-box-shadow: inset 0px 1px 0px 0px #45D6D6;
105
+ -webkit-box-shadow: inset 0px 1px 0px 0px #45D6D6;
106
+ box-shadow: inset 0px 1px 0px 0px #45D6D6;
107
+ background: #2CBBBB;
108
+ border: 1px solid #27A0A0;
109
+ }
110
+
111
+ .cp_cff_minimalist #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/07/thumbnail.jpg ADDED
Binary file
templates/08/checkbox.png ADDED
Binary file
templates/08/checkbox_checked.png ADDED
Binary file
templates/08/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_dark_notebook"
2
+ file="style.css"
3
+ title="Template 8"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Forms with dark notebook design (class: .cp_cff_dark_notebook)"
templates/08/radio.png ADDED
Binary file
templates/08/radio_checked.png ADDED
Binary file
templates/08/style.css ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_dark_notebook #fbuilder{
2
+ font-size: 16px;
3
+ background: #495C70;
4
+ padding: 20px 30px 15px 30px;
5
+ border: 5px solid #53687E;
6
+ color:#FFF;
7
+ }
8
+
9
+ .cp_cff_dark_notebook #fbuilder ::-webkit-input-placeholder { color:#A8BACE; font-size:12px;}
10
+ .cp_cff_dark_notebook #fbuilder :-moz-placeholder { color:#A8BACE; font-size:12px;}
11
+ .cp_cff_dark_notebook #fbuilder ::-moz-placeholder { color:#A8BACE; font-size:12px;}
12
+ .cp_cff_dark_notebook #fbuilder :-ms-input-placeholder { color:#A8BACE; font-size:12px;}
13
+
14
+ .cp_cff_dark_notebook #fbuilder .fform{
15
+ color: #FFF;
16
+ }
17
+
18
+ .cp_cff_dark_notebook #fbuilder .fform h1,
19
+ .cp_cff_dark_notebook #fbuilder .fform h2{
20
+ margin-top: 0;
21
+ color: #FFF;
22
+ }
23
+
24
+ .cp_cff_dark_notebook #fbuilder .fform span,
25
+ .cp_cff_dark_notebook #fbuilder span.uh{color:#A8BACE;font-style: italic;}
26
+
27
+ .cp_cff_dark_notebook #fbuilder .pbSubmit,
28
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbPrevious,
29
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbNext,
30
+ .cp_cff_dark_notebook #fbuilder input[type="date"],
31
+ .cp_cff_dark_notebook #fbuilder input[type="file"],
32
+ .cp_cff_dark_notebook #fbuilder input[type="datetime"],
33
+ .cp_cff_dark_notebook #fbuilder input[type="search"],
34
+ .cp_cff_dark_notebook #fbuilder input[type="time"],
35
+ .cp_cff_dark_notebook #fbuilder input[type="url"],
36
+ .cp_cff_dark_notebook #fbuilder input[type=submit],
37
+ .cp_cff_dark_notebook #fbuilder input[type=button],
38
+ .cp_cff_dark_notebook #fbuilder input[type=reset],
39
+ .cp_cff_dark_notebook #fbuilder input[type=text],
40
+ .cp_cff_dark_notebook #fbuilder input[type=number],
41
+ .cp_cff_dark_notebook #fbuilder input[type=email],
42
+ .cp_cff_dark_notebook #fbuilder input[type=password],
43
+ .cp_cff_dark_notebook #fbuilder select,
44
+ .cp_cff_dark_notebook #fbuilder textarea,
45
+ .cp_cff_dark_notebook #fbuilder label
46
+ {
47
+ font-family: Georgia, "Times New Roman", Times, serif;
48
+ font-size: 16px;
49
+ color: #fff;
50
+ outline: none;
51
+ }
52
+ .cp_cff_dark_notebook #fbuilder select{
53
+ background-color: #495C70;
54
+ border: 1px solid #83A4C5;
55
+ }
56
+ .cp_cff_dark_notebook #fbuilder .pbreak>fieldset{
57
+ padding-left:20px;
58
+ padding-right:20px;
59
+ }
60
+ .cp_cff_dark_notebook #fbuilder .r{color:#53687E;}
61
+ .cp_cff_dark_notebook #fbuilder input[type="date"],
62
+ .cp_cff_dark_notebook #fbuilder input[type="file"],
63
+ .cp_cff_dark_notebook #fbuilder input[type="datetime"],
64
+ .cp_cff_dark_notebook #fbuilder input[type="search"],
65
+ .cp_cff_dark_notebook #fbuilder input[type="time"],
66
+ .cp_cff_dark_notebook #fbuilder input[type="url"],
67
+ .cp_cff_dark_notebook #fbuilder input[type=text],
68
+ .cp_cff_dark_notebook #fbuilder input[type=number],
69
+ .cp_cff_dark_notebook #fbuilder input[type=email],
70
+ .cp_cff_dark_notebook #fbuilder input[type=password]
71
+ {
72
+ background: transparent;
73
+ border: none;
74
+ border-bottom: 1px dashed #83A4C5;
75
+ outline: none;
76
+ padding: 0px 0px 5px 0px;
77
+ font-style: italic;
78
+ }
79
+
80
+ .cp_cff_dark_notebook #fbuilder textarea{
81
+ font-style: italic;
82
+ padding: 0px 0px 5px 0px;
83
+ background: transparent;
84
+ outline: none;
85
+ border: none;
86
+ border-bottom: 1px dashed #83A4C5;
87
+ overflow: hidden;
88
+ resize:none;
89
+ }
90
+
91
+ .cp_cff_dark_notebook #fbuilder textarea:focus,
92
+ .cp_cff_dark_notebook #fbuilder input[type="date"]:focus,
93
+ .cp_cff_dark_notebook #fbuilder input[type="file"]:focus,
94
+ .cp_cff_dark_notebook #fbuilder input[type="datetime"]:focus,
95
+ .cp_cff_dark_notebook #fbuilder input[type="search"]:focus,
96
+ .cp_cff_dark_notebook #fbuilder input[type="time"]:focus,
97
+ .cp_cff_dark_notebook #fbuilder input[type="url"]:focus,
98
+ .cp_cff_dark_notebook #fbuilder input[type=text]:focus,
99
+ .cp_cff_dark_notebook #fbuilder input[type=number]:focus,
100
+ .cp_cff_dark_notebook #fbuilder input[type=email]:focus,
101
+ .cp_cff_dark_notebook #fbuilder input[type=password]:focus
102
+ {
103
+ border-bottom: 1px dashed #D9FFA9;
104
+ }
105
+
106
+ .cp_cff_dark_notebook #fbuilder select:focus
107
+ {
108
+ border-color: #D9FFA9;
109
+ }
110
+
111
+ .cp_cff_dark_notebook #fbuilder .pbSubmit,
112
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbPrevious,
113
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbNext,
114
+ .cp_cff_dark_notebook #fbuilder input[type=submit],
115
+ .cp_cff_dark_notebook #fbuilder input[type=reset],
116
+ .cp_cff_dark_notebook #fbuilder input[type=button]{
117
+ background: #576E86;
118
+ border: none;
119
+ padding: 8px 10px 8px 10px;
120
+ border-radius: 5px;
121
+ color: #A8BACE;
122
+ }
123
+
124
+ .cp_cff_dark_notebook #fbuilder .pbSubmit,
125
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbPrevious,
126
+ .cp_cff_dark_notebook #fbuilder .pbreak .pbNext,
127
+ .cp_cff_dark_notebook #fbuilder input[type=submit]:hover,
128
+ .cp_cff_dark_notebook #fbuilder input[type=reset]:hover,
129
+ .cp_cff_dark_notebook #fbuilder input[type=button]:hover{
130
+ background: #394D61;
131
+ }
132
+
133
+ .cp_cff_dark_notebook #fbuilder input[type=radio],
134
+ .cp_cff_dark_notebook #fbuilder input[type=checkbox]{
135
+ display: none;
136
+ }
137
+
138
+ .cp_cff_dark_notebook #fbuilder .cff-checkbox-field label span,
139
+ .cp_cff_dark_notebook #fbuilder .cff-radiobutton-field label span{
140
+ display: inline-block;
141
+ padding-left:20px;
142
+ height: 16px;
143
+ background: url('checkbox.png') no-repeat 0 0;
144
+ }
145
+
146
+ .cp_cff_dark_notebook #fbuilder .cff-radiobutton-field label span{
147
+ background: url('radio.png') no-repeat 0 0;
148
+ }
149
+
150
+
151
+ .cp_cff_dark_notebook #fbuilder input[type="checkbox"]:checked+span{
152
+ background: url('checkbox_checked.png') no-repeat 0 0;
153
+ }
154
+ .cp_cff_dark_notebook #fbuilder input[type="radio"]:checked+span{
155
+ background: url('radio_checked.png') no-repeat 0 0;
156
+ }
157
+
158
+ .cp_cff_dark_notebook #fbuilder .pbEnd .pbNext,
159
+ .cp_cff_dark_notebook #fbuilder .pb0 .pbPrevious{display:none;}
160
+
161
+
162
+ .cp_cff_dark_notebook #fbuilder fieldset legend,
163
+ .cp_cff_dark_notebook #fbuilder .fields.section_breaks{
164
+ background: #394D61;
165
+ padding-left: 10px;
166
+ padding-right: 10px;
167
+ border-radius: 5px;
168
+ color: #A8BACE !important;
169
+ }
170
+ .cp_cff_dark_notebook #fbuilder .fields.section_breaks{
171
+ margin-top:20px;
172
+ margin-bottom:20px;
173
+ }
174
+ .cp_cff_dark_notebook #fbuilder .fields.section_breaks label{
175
+ color: #A8BACE !important;
176
+ }
177
+ .cp_cff_dark_notebook #fbuilder fieldset,
178
+ .cp_cff_dark_notebook #fbuilder fieldset legend{
179
+ border: 3px solid #53687E;
180
+ padding-left: 10px;
181
+ padding-right: 10px;
182
+ border-radius: 5px;
183
+ }
184
+
185
+ .cp_cff_dark_notebook #fbuilder .fields.section_breaks .section_break{border:0;}
186
+ .cp_cff_dark_notebook #fbuilder .dfield.slider-container{padding-left: 10px !important; padding-right: 10px !important; padding-top:5px;}
187
+ .cp_cff_dark_notebook #fbuilder .slider{background: #53687E !important; border-radius: 0;border:0;height: .3em;}
188
+ .cp_cff_dark_notebook #fbuilder .ui-slider-range{background: #394D61;}
189
+ .cp_cff_dark_notebook #fbuilder .ui-slider-handle{
190
+ height: .8em;
191
+ border-radius: 0;
192
+ width: .8em;
193
+ background: #A8BACE;
194
+ border: 1px solid #394D61;
195
+ }
196
+
197
+ .cp_cff_dark_notebook #fbuilder .apply-coupon{background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMzk0RDYxIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xMSAwLTIgLjktMiAydjE0YzAgMS4xLjg5IDIgMiAyaDE0YzEuMTEgMCAyLS45IDItMlY1YzAtMS4xLS44OS0yLTItMnptLTkgMTRsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=');}
198
+
199
+ .cp_cff_dark_notebook #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/08/thumbnail.jpg ADDED
Binary file
templates/09/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_box"
2
+ file="style.css"
3
+ title="Template 9"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Closes the form's fields in boxes (class: .cp_cff_box)"
templates/09/style.css ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_box #fbuilder{background:#fff;}
2
+ .cp_cff_box #fbuilder .fform {text-align: center;}
3
+ .cp_cff_box #fbuilder .fform h1,
4
+ .cp_cff_box #fbuilder .fform h2{
5
+ text-align: center;
6
+ padding: 0;
7
+ margin: 0px;
8
+ color: #5C5C5C;
9
+ font-size:x-large;
10
+ }
11
+ .cp_cff_box #fbuilder fieldset,
12
+ .cp_cff_box #fbuilder fieldset legend,
13
+ .cp_cff_box #fbuilder .fields:not(.cff-container-field){
14
+ border:1px solid #DDDDDD;
15
+ border-radius: 3px;
16
+ margin-bottom: 20px;
17
+ padding: 10px;
18
+ }
19
+ .cp_cff_box #fbuilder .top_aligned .fields{padding: 5px 0 10px 0;}
20
+ .cp_cff_box #fbuilder .fields.cff-button-field{padding: 15px 15px 10px 15px;}
21
+ .cp_cff_box #fbuilder fieldset legend{padding: 5px 10px;color: #B9B9B9;}
22
+ .cp_cff_box #fbuilder .fields .dfield{padding: 0 15px;}
23
+ .cp_cff_box #fbuilder .top_aligned .fields .dfield{padding-top: 10px;}
24
+ .cp_cff_box #fbuilder .fields>label{ padding-left:5px;}
25
+ .cp_cff_box #fbuilder .top_aligned .fields>label{
26
+ display: block;
27
+ float: left;
28
+ background: #FFFFFF;
29
+ margin-top: -19px;
30
+ margin-left:5px;
31
+ padding: 2px 5px 2px 5px;
32
+ color: #B9B9B9;
33
+ font-size: 16px;
34
+ line-height: 16px;
35
+ overflow: hidden;
36
+ }
37
+ *[dir="rtl"] .cp_cff_box #fbuilder .top_aligned .fields>label{float:right;}
38
+ .cp_cff_box #fbuilder span.uh{color: #C0C0C0;font-size: 11px;}
39
+ .cp_cff_box #fbuilder .top_aligned span.uh{
40
+ text-align: center;
41
+ background: #F3F3F3;
42
+ display: block;
43
+ padding: 3px;
44
+ margin: 10px -15px -10px -15px;
45
+ -webkit-border-radius-bottom-left: 3px;
46
+ -webkit-border-radius-bottom-right: 3px;
47
+ -moz-border-radius-bottom-left: 3px;
48
+ -moz-border-radius-bottom-right: 3px;
49
+ border-radius-bottom-left: 3px;
50
+ border-radius-bottom-right: 3px;
51
+ }
52
+ .cp_cff_box #fbuilder .section_breaks>label{text-align:center;}
53
+ .cp_cff_box #fbuilder .section_breaks span.uh{margin:0;}
54
+ .cp_cff_box #fbuilder span.uh:empty{ display:none; }
55
+ .cp_cff_box #fbuilder .pbSubmit,
56
+ .cp_cff_box #fbuilder .pbreak .pbPrevious,
57
+ .cp_cff_box #fbuilder .pbreak .pbNext,
58
+ .cp_cff_box #fbuilder input[type=submit],
59
+ .cp_cff_box #fbuilder input[type=button],
60
+ .cp_cff_box #fbuilder input[type=reset]{
61
+ background: #2471FF;
62
+ border: none;
63
+ padding: 10px 20px 10px 20px;
64
+ border-bottom: 3px solid #5994FF;
65
+ border-radius: 3px;
66
+ color: #D2E2FF;
67
+ }
68
+ .cp_cff_box #fbuilder .pbSubmit:hover,
69
+ .cp_cff_box #fbuilder .pbreak .pbPrevious:hover,
70
+ .cp_cff_box #fbuilder .pbreak .pbNext:hover,
71
+ .cp_cff_box #fbuilder input[type=submit]:hover,
72
+ .cp_cff_box #fbuilder input[type=button]:hover,
73
+ .cp_cff_box #fbuilder input[type=reset]:hover{
74
+ background: #6B9FFF;
75
+ color:#fff;
76
+ }
77
+ .cp_cff_box #fbuilder .r{color:#6B9FFF;}
78
+ .cp_cff_box #fbuilder .pbEnd .pbNext,
79
+ .cp_cff_box #fbuilder .pb0 .pbPrevious{display:none;}
80
+
81
+ .cp_cff_box #fbuilder input[type="date"],
82
+ .cp_cff_box #fbuilder input[type="file"],
83
+ .cp_cff_box #fbuilder input[type="datetime"],
84
+ .cp_cff_box #fbuilder input[type="search"],
85
+ .cp_cff_box #fbuilder input[type="time"],
86
+ .cp_cff_box #fbuilder input[type="url"],
87
+ .cp_cff_box #fbuilder input[type=text],
88
+ .cp_cff_box #fbuilder input[type=number],
89
+ .cp_cff_box #fbuilder input[type=email],
90
+ .cp_cff_box #fbuilder input[type=password],
91
+ .cp_cff_box #fbuilder textarea{ border:0;outline:none;}
92
+ .cp_cff_box #fbuilder .ui-slider-handle{background:#6B9FFF;border:0;}
93
+ .cp_cff_box #fbuilder .dfield.slider-container{padding-left: 20px !important; padding-right: 20px !important;}
94
+ .cp_cff_box #fbuilder .fields.section_breaks{
95
+ border:0;
96
+ border-radius: 3px;
97
+ background: #F3F3F3;
98
+ }
99
+ .cp_cff_box #fbuilder .fields.section_breaks label{
100
+ float: none;
101
+ background: transparent;
102
+ margin-top: 0;
103
+ margin-left:0;
104
+ padding: 2px 5px 2px 5px;
105
+ color: #C0C0C0;
106
+ font-size: 16px;
107
+ line-height: 16px;
108
+ overflow: none;
109
+ }
110
+ .cp_cff_box #fbuilder .fields.section_breaks .section_break{border:0;}
111
+ @media screen and (min-width: 740px),print{
112
+ .cp_cff_box #fbuilder .fields.column2{float:left;width:calc( 49.9% - 5px );width:-moz-calc( 49.9% - 5px );width:-webkit-calc( 49.9% - 5px );}
113
+ .cp_cff_box #fbuilder .fields.column3{float:left;width:calc( 33.3% - 5px );width:-moz-calc( 33.3% - 5px );width:-webkit-calc( 33.3% - 5px );}
114
+ .cp_cff_box #fbuilder .fields.column4{float:left;width:calc( 24.9% - 5px );width:-moz-calc( 24.9% - 5px );width:-webkit-calc( 24.9% - 5px );}
115
+
116
+ *[dir="rtl"] .cp_cff_box #fbuilder .fields.column2{float:right;}
117
+ *[dir="rtl"] .cp_cff_box #fbuilder .fields.column3{float:right;}
118
+ *[dir="rtl"] .cp_cff_box #fbuilder .fields.column4{float:right;}
119
+ }
120
+
121
+ .cp_cff_box #fbuilder .apply-coupon{background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMjQ3MUZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDNINWMtMS4xMSAwLTIgLjktMiAydjE0YzAgMS4xLjg5IDIgMiAyaDE0YzEuMTEgMCAyLS45IDItMlY1YzAtMS4xLS44OS0yLTItMnptLTkgMTRsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=');}
122
+
123
+ .cp_cff_box #fbuilder .discount-container{margin-top:10px;}
templates/09/thumbnail.jpg ADDED
Binary file
templates/10/config.ini ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ prefix="cp_cff_pastel"
2
+ file="style.css"
3
+ title="Template 10"
4
+ thumbnail="thumbnail.jpg"
5
+ description="Display the forms with beautiful green pastel color (class: .cp_cff_pastel)"
templates/10/style.css ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cp_cff_pastel #fbuilder{
2
+ padding: 20px;
3
+ background: #f4f7f8;
4
+ border-radius: 8px;
5
+ color:#333;
6
+ }
7
+
8
+ .cp_cff_pastel #fbuilder input[type="text"],
9
+ .cp_cff_pastel #fbuilder input[type="file"],
10
+ .cp_cff_pastel #fbuilder input[type="date"],
11
+ .cp_cff_pastel #fbuilder input[type="password"],
12
+ .cp_cff_pastel #fbuilder input[type="datetime"],
13
+ .cp_cff_pastel #fbuilder input[type="email"],
14
+ .cp_cff_pastel #fbuilder input[type="number"],
15
+ .cp_cff_pastel #fbuilder input[type="search"],
16
+ .cp_cff_pastel #fbuilder input[type="time"],
17
+ .cp_cff_pastel #fbuilder input[type="url"],
18
+ .cp_cff_pastel #fbuilder textarea,
19
+ .cp_cff_pastel #fbuilder select {
20
+ border: none;
21
+ border-radius: 4px;
22
+ margin: 0;
23
+ outline: 0;
24
+ box-sizing: border-box;
25
+ -webkit-box-sizing: border-box;
26
+ -moz-box-sizing: border-box;
27
+ background-color: #e8eeef;
28
+ color:#8a97a0;
29
+ -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset;
30
+ box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset;
31
+ padding:5px;
32
+ }
33
+ .cp_cff_pastel #fbuilder input[type="date"]:focus,
34
+ .cp_cff_pastel #fbuilder input[type="file"]:focus,
35
+ .cp_cff_pastel #fbuilder input[type="text"]:focus,
36
+ .cp_cff_pastel #fbuilder input[type="password"]:focus,
37
+ .cp_cff_pastel #fbuilder input[type="datetime"]:focus,
38
+ .cp_cff_pastel #fbuilder input[type="email"]:focus,
39
+ .cp_cff_pastel #fbuilder input[type="number"]:focus,
40
+ .cp_cff_pastel #fbuilder input[type="search"]:focus,
41
+ .cp_cff_pastel #fbuilder input[type="time"]:focus,
42
+ .cp_cff_pastel #fbuilder input[type="url"]:focus,
43
+ .cp_cff_pastel #fbuilder textarea:focus,
44
+ .cp_cff_pastel #fbuilder select:focus{
45
+ background: #d2d9dd;
46
+ }
47
+ .cp_cff_pastel #fbuilder select{
48
+ -webkit-appearance: menulist-button;
49
+ height:35px;
50
+ }
51
+ .cp_cff_pastel #fbuilder .pbSubmit,
52
+ .cp_cff_pastel #fbuilder .pbreak .pbPrevious,
53
+ .cp_cff_pastel #fbuilder .pbreak .pbNext,
54
+ .cp_cff_pastel #fbuilder input[type=submit],
55
+ .cp_cff_pastel #fbuilder input[type=button],
56
+ .cp_cff_pastel #fbuilder input[type=reset]{
57
+ color: #FFF;
58
+ background: #1abc9c;
59
+ text-align: center;
60
+ font-style: normal;
61
+ border: 1px solid #16a085;
62
+ border-width: 1px 1px 3px;
63
+ }
64
+ .cp_cff_pastel #fbuilder .pbSubmit:hover,
65
+ .cp_cff_pastel #fbuilder .pbreak .pbPrevious:hover,
66
+ .cp_cff_pastel #fbuilder .pbreak .pbNext:hover,
67
+ .cp_cff_pastel #fbuilder input[type=submit]:hover,
68
+ .cp_cff_pastel #fbuilder input[type=button]:hover,
69
+ .cp_cff_pastel #fbuilder input[type=reset]:hover{
70
+ background: #109177;
71
+ }
72
+ .cp_cff_pastel #fbuilder .pbEnd .pbNext,
73
+ .cp_cff_pastel #fbuilder .pb0 .pbPrevious{display:none;}
74
+ .cp_cff_pastel #fbuilder fieldset,
75
+ .cp_cff_pastel #fbuilder fieldset legend{
76
+ border:1px solid #e8eeef;
77
+ padding: 10px;
78
+ border-radius: 8px;
79
+ }
80
+ .cp_cff_pastel #fbuilder fieldset legend{
81
+ padding: 5px 10px;
82
+ background:#d2d9dd;
83
+ border-radius: 4px;
84
+ }
85
+ .cp_cff_pastel #fbuilder span.uh{
86
+ font-size: 11px;
87
+ }
88
+ .cp_cff_pastel #fbuilder .fields:not(.section_breaks) span.uh{
89
+ color: #C0C0C0;
90
+ }
91
+ .cp_cff_pastel #fbuilder .r{color:#1abc9c;}
92
+ .cp_cff_pastel #fbuilder .ui-slider-handle{background:#1abc9c;border:0;border-radius:15px;height: .8em;width: .8em;}
93
+ .cp_cff_pastel #fbuilder .dfield.slider-container{padding-left: 10px !important; border-radius: 10px; padding-right: 10px !important; padding-top:5px;}
94
+ .cp_cff_pastel #fbuilder .slider{background: #e8eeef !important; border-radius: 10px;border:0;height: .3em;}
95
+ .cp_cff_pastel #fbuilder .ui-slider-range{background: #d2d9dd;}
96
+ .cp_cff_pastel #fbuilder .fields.section_breaks{
97
+ border:0;
98
+ border-radius: 4px;
99
+ background: #d2d9dd;
100
+ padding-left:10px;
101
+ padding-right:10px;
102
+ }
103
+ .cp_cff_pastel #fbuilder .fields.section_breaks .section_break{border:0;}
104
+
105
+ .cp_cff_pastel #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/10/thumbnail.jpg ADDED
Binary file
templates/11/config.ini ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ prefix="cp_cff_11"
2
+ file="style.css"
3
+ js="js.js"
4
+ title="Template 11"
5
+ thumbnail="thumbnail.jpg"
6
+ description="Form in white and blue colors, and input fields with rounded corners (class: .cp_cff_11)"
templates/11/js.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery(function(){
2
+ var $ = fbuilderjQuery;
3
+ $(document)
4
+ .on(
5
+ 'mouseover',
6
+ '.cp_cff_11 input,.cp_cff_11 textarea,.cp_cff_11 select,.cp_cff_11 .slider-container',
7
+ function()
8
+ {
9
+ $(this).closest( '.fields' ).addClass('highlight');
10
+ }
11
+ )
12
+ .on(
13
+ 'mouseout',
14
+ '.cp_cff_11 input,.cp_cff_11 textarea,.cp_cff_11 select,.cp_cff_11 .slider-container',
15
+ function()
16
+ {
17
+ $(this).closest( '.fields' ).removeClass('highlight');
18
+ }
19
+ );
20
+ });
templates/11/style.css ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css?family=Lato');
2
+
3
+ .cp_cff_11 #fbuilder * {
4
+ box-sizing: border-box;
5
+ -moz-box-sizing: border-box;
6
+ -webkit-box-sizing: border-box;
7
+ font-family: 'Lato', sans-serif;
8
+ }
9
+
10
+ .cp_cff_11 #fbuilder .fform{margin-bottom:20px;}
11
+
12
+ .cp_cff_11 #fbuilder h1,
13
+ .cp_cff_11 #fbuilder h2,
14
+ .cp_cff_11 #fbuilder h3{ text-transform:uppercase; }
15
+
16
+ .cp_cff_11 #fbuilder .fields:not(.cff-container-field){padding: 10px;}
17
+
18
+ .cp_cff_11 #fbuilder .fields.highlight{background: #FFF9DF !important;}
19
+
20
+ .cp_cff_11 #fbuilder input[type="text"],
21
+ .cp_cff_11 #fbuilder input[type="file"],
22
+ .cp_cff_11 #fbuilder input[type="password"],
23
+ .cp_cff_11 #fbuilder input[type="date"],
24
+ .cp_cff_11 #fbuilder input[type="datetime"],
25
+ .cp_cff_11 #fbuilder input[type="email"],
26
+ .cp_cff_11 #fbuilder input[type="number"],
27
+ .cp_cff_11 #fbuilder input[type="search"],
28
+ .cp_cff_11 #fbuilder input[type="time"],
29
+ .cp_cff_11 #fbuilder input[type="url"],
30
+ .cp_cff_11 #fbuilder textarea,
31
+ .cp_cff_11 #fbuilder select {
32
+ background: #FDFFFD;
33
+ border: 1px solid #dcdcdc;
34
+ border-radius: 4px;
35
+ border-width: 1px;
36
+ color: #57665E;
37
+ font-family: 'Questrial',sans-serif;
38
+ font-size: 13px;
39
+ margin: 1px 0;
40
+ padding: 15px;
41
+ }
42
+
43
+ .cp_cff_11 #fbuilder .large {
44
+ width: calc( 100% - 32px ) !important;
45
+ width: -moz-calc( 100% - 32px ) !important;
46
+ width: -webkit-calc( 100% - 32px ) !important;
47
+ width: -o-calc( 100% - 32px ) !important;
48
+ }
49
+
50
+ @media screen and (min-width: 740px),print{
51
+ .cp_cff_11 #fbuilder .medium {
52
+ width: calc( 50% - 32px ) !important;
53
+ width: -moz-calc( 50% - 32px ) !important;
54
+ width: -webkit-calc( 50% - 32px ) !important;
55
+ width: -o-calc( 50% - 32px ) !important;
56
+ }
57
+ .cp_cff_11 #fbuilder .small {
58
+ width: calc( 25% - 32px ) !important;
59
+ width: -moz-calc( 25% - 32px ) !important;
60
+ width: -webkit-calc( 25% - 32px ) !important;
61
+ width: -o-calc( 25% - 32px ) !important;
62
+ }
63
+ }
64
+
65
+ @media screen and (max-width: 640px){
66
+ .cp_cff_11 #fbuilder .medium,
67
+ .cp_cff_11 #fbuilder .small {
68
+ width: calc( 100% - 32px ) !important;
69
+ width: -moz-calc( 100% - 32px ) !important;
70
+ width: -webkit-calc( 100% - 32px ) !important;
71
+ width: -o-calc( 100% - 32px ) !important;
72
+ }
73
+ }
74
+
75
+ .cp_cff_11 #fbuilder input[type="date"]:focus,
76
+ .cp_cff_11 #fbuilder input[type="file"]:focus,
77
+ .cp_cff_11 #fbuilder input[type="password"]:focus,
78
+ .cp_cff_11 #fbuilder input[type="text"]:focus,
79
+ .cp_cff_11 #fbuilder input[type="datetime"]:focus,
80
+ .cp_cff_11 #fbuilder input[type="email"]:focus,
81
+ .cp_cff_11 #fbuilder input[type="number"]:focus,
82
+ .cp_cff_11 #fbuilder input[type="search"]:focus,
83
+ .cp_cff_11 #fbuilder input[type="time"]:focus,
84
+ .cp_cff_11 #fbuilder input[type="url"]:focus,
85
+ .cp_cff_11 #fbuilder textarea:focus,
86
+ .cp_cff_11 #fbuilder select:focus{
87
+ border-color: #1795FF;
88
+ outline: none;
89
+ }
90
+ .cp_cff_11 #fbuilder .pbSubmit,
91
+ .cp_cff_11 #fbuilder .pbreak .pbPrevious,
92
+ .cp_cff_11 #fbuilder .pbreak .pbNext,
93
+ .cp_cff_11 #fbuilder input[type=submit],
94
+ .cp_cff_11 #fbuilder input[type=button],
95
+ .cp_cff_11 #fbuilder input[type=reset]{
96
+ color: #FFF;
97
+ background: #1795FF;
98
+ text-align: center;
99
+ font-style: normal;
100
+ border-radius: 3px;
101
+ border: 0;
102
+ padding:10px 30px;
103
+ }
104
+ .cp_cff_11 #fbuilder .pbSubmit:hover,
105
+ .cp_cff_11 #fbuilder .pbreak .pbPrevious:hover,
106
+ .cp_cff_11 #fbuilder .pbreak .pbNext:hover,
107
+ .cp_cff_11 #fbuilder input[type=submit]:hover,
108
+ .cp_cff_11 #fbuilder input[type=button]:hover,
109
+ .cp_cff_11 #fbuilder input[type=reset]:hover{
110
+ background: #1485e5;
111
+ }
112
+ .cp_cff_11 #fbuilder .pbEnd .pbNext,
113
+ .cp_cff_11 #fbuilder .pb0 .pbPrevious{display:none;}
114
+
115
+ .cp_cff_11 #fbuilder .r{color:#FF0000;}
116
+ .cp_cff_11 #fbuilder .ui-slider-handle{background:#1485e5;border:0;border-radius:15px;height: .8em;width: .8em;}
117
+ .cp_cff_11 #fbuilder .dfield.slider-container{padding-left: 10px !important; border-radius: 10px; padding-right: 10px !important; padding-top:5px;}
118
+ .cp_cff_11 #fbuilder .slider{background: #ececec !important; border-radius: 10px;border:0;height: .3em;}
119
+ .cp_cff_11 #fbuilder .ui-slider-range{background: #1795FF;}
120
+
121
+ .cp_cff_11 #fbuilder span.uh{
122
+ font-size: 11px;
123
+ font-style: italic;
124
+ }
125
+
126
+ .cp_cff_11 #fbuilder fieldset{
127
+ border-left:1px solid #dcdcdc;
128
+ border-top: 0;
129
+ border-right: 0;
130
+ border-bottom: 0;
131
+ }
132
+
133
+ .cp_cff_11 #fbuilder fieldset legend{
134
+ padding: 5px 10px;
135
+ font-weight:bold;
136
+ text-transform:uppercase;
137
+ border: 0 !important;
138
+ border-left: 3px solid #1795FF !important;
139
+ margin-left:-11px !important;
140
+ }
141
+
142
+ .cp_cff_11 #fbuilder .fields.section_breaks{ border-left: 3px solid #1795FF !important;margin-top:10px !important; margin-bottom:10px !important;}
143
+ .cp_cff_11 #fbuilder .fields.section_breaks>label{font-size:1.3em;font-weight:900;text-transform:uppercase;}
144
+ .cp_cff_11 #fbuilder .fields.section_breaks .section_break{border:0;}
145
+
146
+ .cp_cff_11 #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/11/thumbnail.jpg ADDED
Binary file
templates/12/config.ini ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ prefix="cp_cff_12"
2
+ file="style.css"
3
+ js="js.js"
4
+ title="Template 12"
5
+ thumbnail="thumbnail.jpg"
6
+ description="Form in light colors with icons as background in the input fields and effects on buttons (class: .cp_cff_12)"
templates/12/js.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ fbuilderjQuery(function(){
2
+ var $ = fbuilderjQuery;
3
+
4
+ $( '.cp_cff_12 #fbuilder .pbNext' )
5
+ .add( '.cp_cff_12 #fbuilder .pbPrevious' )
6
+ .add( '.cp_cff_12 #fbuilder .pbSubmit' )
7
+ .add( '.cp_cff_12 #fbuilder input[type=submit]' )
8
+ .add( '.cp_cff_12 #fbuilder input[type=reset]' )
9
+ .add( '.cp_cff_12 #fbuilder input[type=button]' )
10
+ .addClass( 'bttn-unite bttn-md bttn-primary' );
11
+ });
templates/12/style.css ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css?family=Lato');
2
+ @import url('unite.css');
3
+
4
+ .cp_cff_12 #fbuilder * {
5
+ box-sizing: border-box;
6
+ -moz-box-sizing: border-box;
7
+ -webkit-box-sizing: border-box;
8
+ -webkit-appearance: none;
9
+ font-family: 'Lato', sans-serif;
10
+ }
11
+
12
+ .cp_cff_12 #fbuilder .fform{margin-bottom:20px;}
13
+
14
+ .cp_cff_12 #fbuilder h1,
15
+ .cp_cff_12 #fbuilder h2,
16
+ .cp_cff_12 #fbuilder h3{ text-transform:uppercase; }
17
+
18
+ .cp_cff_12 #fbuilder .fields:not(.cff-container-field){padding: 10px;}
19
+
20
+ .cp_cff_12 #fbuilder .fields.highlight{background: #FFF9DF !important;}
21
+
22
+ .cp_cff_12 #fbuilder input[type="text"],
23
+ .cp_cff_12 #fbuilder input[type="file"],
24
+ .cp_cff_12 #fbuilder input[type="password"],
25
+ .cp_cff_12 #fbuilder input[type="date"],
26
+ .cp_cff_12 #fbuilder input[type="datetime"],
27
+ .cp_cff_12 #fbuilder input[type="email"],
28
+ .cp_cff_12 #fbuilder input[type="number"],
29
+ .cp_cff_12 #fbuilder input[type="search"],
30
+ .cp_cff_12 #fbuilder input[type="time"],
31
+ .cp_cff_12 #fbuilder input[type="url"],
32
+ .cp_cff_12 #fbuilder textarea,
33
+ .cp_cff_12 #fbuilder select {
34
+ background: #FDFFFD;
35
+ border: 1px solid #dcdcdc;
36
+ border-radius: 4px;
37
+ border-width: 1px;
38
+ color: #57665E;
39
+ font-family: 'Questrial',sans-serif;
40
+ font-size: 13px;
41
+ margin: 1px 0;
42
+ padding: 5px;
43
+ }
44
+
45
+ .cp_cff_12 #fbuilder .large {
46
+ width: calc( 100% - 32px ) !important;
47
+ width: -moz-calc( 100% - 32px ) !important;
48
+ width: -webkit-calc( 100% - 32px ) !important;
49
+ width: -o-calc( 100% - 32px ) !important;
50
+ }
51
+
52
+ @media screen and (min-width: 740px),print{
53
+ .cp_cff_12 #fbuilder .medium {
54
+ width: calc( 50% - 32px ) !important;
55
+ width: -moz-calc( 50% - 32px ) !important;
56
+ width: -webkit-calc( 50% - 32px ) !important;
57
+ width: -o-calc( 50% - 32px ) !important;
58
+ }
59
+ .cp_cff_12 #fbuilder .small {
60
+ width: calc( 25% - 32px ) !important;
61
+ width: -moz-calc( 25% - 32px ) !important;
62
+ width: -webkit-calc( 25% - 32px ) !important;
63
+ width: -o-calc( 25% - 32px ) !important;
64
+ }
65
+ }
66
+
67
+ @media screen and (max-width: 640px){
68
+ .cp_cff_12 #fbuilder .medium,
69
+ .cp_cff_12 #fbuilder .small {
70
+ width: calc( 100% - 32px ) !important;
71
+ width: -moz-calc( 100% - 32px ) !important;
72
+ width: -webkit-calc( 100% - 32px ) !important;
73
+ width: -o-calc( 100% - 32px ) !important;
74
+ }
75
+ }
76
+
77
+ .cp_cff_12 #fbuilder .cff-text-field input,
78
+ .cp_cff_12 #fbuilder .cff-number-field input,
79
+ .cp_cff_12 #fbuilder .cff-email-field input,
80
+ .cp_cff_12 #fbuilder .cff-date-field input,
81
+ .cp_cff_12 #fbuilder .cff-phone-field input,
82
+ .cp_cff_12 #fbuilder .cff-textarea-field textarea,
83
+ .cp_cff_12 #fbuilder .cff-file-field input,
84
+ .cp_cff_12 #fbuilder .cff-password-field input,
85
+ .cp_cff_12 #fbuilder .cff-calculated-field input,
86
+ .cp_cff_12 #fbuilder .cff-currency-field input{
87
+ background-position: 5px center; background-repeat:no-repeat;padding-left:35px;
88
+ }
89
+
90
+ .cp_cff_12 #fbuilder .cff-text-field input,
91
+ .cp_cff_12 #fbuilder .cff-text-field input:-webkit-autofill{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0zIDE3LjI1VjIxaDMuNzVMMTcuODEgOS45NGwtMy43NS0zLjc1TDMgMTcuMjV6TTIwLjcxIDcuMDRjLjM5LS4zOS4zOS0xLjAyIDAtMS40MWwtMi4zNC0yLjM0Yy0uMzktLjM5LTEuMDItLjM5LTEuNDEgMGwtMS44MyAxLjgzIDMuNzUgMy43NSAxLjgzLTEuODN6IiBmaWxsLW9wYWNpdHk9IjAuMyIgLz4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KPC9zdmc+");}
92
+
93
+ .cp_cff_12 #fbuilder .cff-number-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik0xMiAyQzYuNDggMiAyIDYuNDggMiAxMnM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTBTMTcuNTIgMiAxMiAyem01IDExaC00djRoLTJ2LTRIN3YtMmg0VjdoMnY0aDR2MnoiIGZpbGwtb3BhY2l0eT0iMC4zIiAvPgo8L3N2Zz4=");}
94
+
95
+ .cp_cff_12 #fbuilder .cff-currency-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xMiAyQzYuNDggMiAyIDYuNDggMiAxMnM0LjQ4IDEwIDEwIDEwIDEwLTQuNDggMTAtMTBTMTcuNTIgMiAxMiAyem0xLjQxIDE2LjA5VjIwaC0yLjY3di0xLjkzYy0xLjcxLS4zNi0zLjE2LTEuNDYtMy4yNy0zLjRoMS45NmMuMSAxLjA1LjgyIDEuODcgMi42NSAxLjg3IDEuOTYgMCAyLjQtLjk4IDIuNC0xLjU5IDAtLjgzLS40NC0xLjYxLTIuNjctMi4xNC0yLjQ4LS42LTQuMTgtMS42Mi00LjE4LTMuNjcgMC0xLjcyIDEuMzktMi44NCAzLjExLTMuMjFWNGgyLjY3djEuOTVjMS44Ni40NSAyLjc5IDEuODYgMi44NSAzLjM5SDE0LjNjLS4wNS0xLjExLS42NC0xLjg3LTIuMjItMS44Ny0xLjUgMC0yLjQuNjgtMi40IDEuNjQgMCAuODQuNjUgMS4zOSAyLjY3IDEuOTFzNC4xOCAxLjM5IDQuMTggMy45MWMtLjAxIDEuODMtMS4zOCAyLjgzLTMuMTIgMy4xNnoiIGZpbGwtb3BhY2l0eT0iMC4zIiAvPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPgo8L3N2Zz4=");}
96
+
97
+ .cp_cff_12 #fbuilder .cff-email-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0yMCA0SDRjLTEuMSAwLTEuOTkuOS0xLjk5IDJMMiAxOGMwIDEuMS45IDIgMiAyaDE2YzEuMSAwIDItLjkgMi0yVjZjMC0xLjEtLjktMi0yLTJ6bTAgNGwtOCA1LTgtNVY2bDggNSA4LTV2MnoiIGZpbGwtb3BhY2l0eT0iMC4zIiAvPgogICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPgo8L3N2Zz4=");}
98
+
99
+ .cp_cff_12 #fbuilder .cff-date-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik0xNi41MyAxMS4wNkwxNS40NyAxMGwtNC44OCA0Ljg4LTIuMTItMi4xMi0xLjA2IDEuMDZMMTAuNTkgMTdsNS45NC01Ljk0ek0xOSAzaC0xVjFoLTJ2Mkg4VjFINnYySDVjLTEuMTEgMC0xLjk5LjktMS45OSAyTDMgMTljMCAxLjEuODkgMiAyIDJoMTRjMS4xIDAgMi0uOSAyLTJWNWMwLTEuMS0uOS0yLTItMnptMCAxNkg1VjhoMTR2MTF6IiBmaWxsLW9wYWNpdHk9IjAuMyIgLz4KPC9zdmc+");}
100
+
101
+ .cp_cff_12 #fbuilder .cff-file-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik00IDZIMnYxNGMwIDEuMS45IDIgMiAyaDE0di0ySDRWNnptMTYtNEg4Yy0xLjEgMC0yIC45LTIgMnYxMmMwIDEuMS45IDIgMiAyaDEyYzEuMSAwIDItLjkgMi0yVjRjMC0xLjEtLjktMi0yLTJ6bS0xIDloLTR2NGgtMnYtNEg5VjloNFY1aDJ2NGg0djJ6IiBmaWxsLW9wYWNpdHk9IjAuMyIgLz4KPC9zdmc+");}
102
+
103
+ .cp_cff_12 #fbuilder .cff-phone-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik02LjYyIDEwLjc5YzEuNDQgMi44MyAzLjc2IDUuMTQgNi41OSA2LjU5bDIuMi0yLjJjLjI3LS4yNy42Ny0uMzYgMS4wMi0uMjQgMS4xMi4zNyAyLjMzLjU3IDMuNTcuNTcuNTUgMCAxIC40NSAxIDFWMjBjMCAuNTUtLjQ1IDEtMSAxLTkuMzkgMC0xNy03LjYxLTE3LTE3IDAtLjU1LjQ1LTEgMS0xaDMuNWMuNTUgMCAxIC40NSAxIDEgMCAxLjI1LjIgMi40NS41NyAzLjU3LjExLjM1LjAzLjc0LS4yNSAxLjAybC0yLjIgMi4yeiIgZmlsbC1vcGFjaXR5PSIwLjMiIC8+Cjwvc3ZnPg==");}
104
+
105
+ .cp_cff_12 #fbuilder .cff-password-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xNy44MSA0LjQ3Yy0uMDggMC0uMTYtLjAyLS4yMy0uMDZDMTUuNjYgMy40MiAxNCAzIDEyLjAxIDNjLTEuOTggMC0zLjg2LjQ3LTUuNTcgMS40MS0uMjQuMTMtLjU0LjA0LS42OC0uMi0uMTMtLjI0LS4wNC0uNTUuMi0uNjhDNy44MiAyLjUyIDkuODYgMiAxMi4wMSAyYzIuMTMgMCAzLjk5LjQ3IDYuMDMgMS41Mi4yNS4xMy4zNC40My4yMS42Ny0uMDkuMTgtLjI2LjI4LS40NC4yOHpNMy41IDkuNzJjLS4xIDAtLjItLjAzLS4yOS0uMDktLjIzLS4xNi0uMjgtLjQ3LS4xMi0uNy45OS0xLjQgMi4yNS0yLjUgMy43NS0zLjI3QzkuOTggNC4wNCAxNCA0LjAzIDE3LjE1IDUuNjVjMS41Ljc3IDIuNzYgMS44NiAzLjc1IDMuMjUuMTYuMjIuMTEuNTQtLjEyLjctLjIzLjE2LS41NC4xMS0uNy0uMTItLjktMS4yNi0yLjA0LTIuMjUtMy4zOS0yLjk0LTIuODctMS40Ny02LjU0LTEuNDctOS40LjAxLTEuMzYuNy0yLjUgMS43LTMuNCAyLjk2LS4wOC4xNC0uMjMuMjEtLjM5LjIxem02LjI1IDEyLjA3Yy0uMTMgMC0uMjYtLjA1LS4zNS0uMTUtLjg3LS44Ny0xLjM0LTEuNDMtMi4wMS0yLjY0LS42OS0xLjIzLTEuMDUtMi43My0xLjA1LTQuMzQgMC0yLjk3IDIuNTQtNS4zOSA1LjY2LTUuMzlzNS42NiAyLjQyIDUuNjYgNS4zOWMwIC4yOC0uMjIuNS0uNS41cy0uNS0uMjItLjUtLjVjMC0yLjQyLTIuMDktNC4zOS00LjY2LTQuMzktMi41NyAwLTQuNjYgMS45Ny00LjY2IDQuMzkgMCAxLjQ0LjMyIDIuNzcuOTMgMy44NS42NCAxLjE1IDEuMDggMS42NCAxLjg1IDIuNDIuMTkuMi4xOS41MSAwIC43MS0uMTEuMS0uMjQuMTUtLjM3LjE1em03LjE3LTEuODVjLTEuMTkgMC0yLjI0LS4zLTMuMS0uODktMS40OS0xLjAxLTIuMzgtMi42NS0yLjM4LTQuMzkgMC0uMjguMjItLjUuNS0uNXMuNS4yMi41LjVjMCAxLjQxLjcyIDIuNzQgMS45NCAzLjU2LjcxLjQ4IDEuNTQuNzEgMi41NC43MS4yNCAwIC42NC0uMDMgMS4wNC0uMS4yNy0uMDUuNTMuMTMuNTguNDEuMDUuMjctLjEzLjUzLS40MS41OC0uNTcuMTEtMS4wNy4xMi0xLjIxLjEyek0xNC45MSAyMmMtLjA0IDAtLjA5LS4wMS0uMTMtLjAyLTEuNTktLjQ0LTIuNjMtMS4wMy0zLjcyLTIuMS0xLjQtMS4zOS0yLjE3LTMuMjQtMi4xNy01LjIyIDAtMS42MiAxLjM4LTIuOTQgMy4wOC0yLjk0IDEuNyAwIDMuMDggMS4zMiAzLjA4IDIuOTQgMCAxLjA3LjkzIDEuOTQgMi4wOCAxLjk0czIuMDgtLjg3IDIuMDgtMS45NGMwLTMuNzctMy4yNS02LjgzLTcuMjUtNi44My0yLjg0IDAtNS40NCAxLjU4LTYuNjEgNC4wMy0uMzkuODEtLjU5IDEuNzYtLjU5IDIuOCAwIC43OC4wNyAyLjAxLjY3IDMuNjEuMS4yNi0uMDMuNTUtLjI5LjY0LS4yNi4xLS41NS0uMDQtLjY0LS4yOS0uNDktMS4zMS0uNzMtMi42MS0uNzMtMy45NiAwLTEuMi4yMy0yLjI5LjY4LTMuMjQgMS4zMy0yLjc5IDQuMjgtNC42IDcuNTEtNC42IDQuNTUgMCA4LjI1IDMuNTEgOC4yNSA3LjgzIDAgMS42Mi0xLjM4IDIuOTQtMy4wOCAyLjk0cy0zLjA4LTEuMzItMy4wOC0yLjk0YzAtMS4wNy0uOTMtMS45NC0yLjA4LTEuOTRzLTIuMDguODctMi4wOCAxLjk0YzAgMS43MS42NiAzLjMxIDEuODcgNC41MS45NS45NCAxLjg2IDEuNDYgMy4yNyAxLjg1LjI3LjA3LjQyLjM1LjM1LjYxLS4wNS4yMy0uMjYuMzgtLjQ3LjM4eiIgZmlsbC1vcGFjaXR5PSIwLjMiIC8+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+Cjwvc3ZnPg==");}
106
+
107
+ .cp_cff_12 #fbuilder .cff-textarea-field textarea{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0zIDIxaDE4di0ySDN2MnptMC00aDE4di0ySDN2MnptMC00aDE4di0ySDN2MnptMC00aDE4VjdIM3Yyem0wLTZ2MmgxOFYzSDN6IiBmaWxsLW9wYWNpdHk9IjAuMyIgLz4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KPC9zdmc+");background-position: 5px 5px;}
108
+
109
+ .cp_cff_12 #fbuilder .cff-calculated-field input{ background-image: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik05IDE2LjJMNC44IDEybC0xLjQgMS40TDkgMTkgMjEgN2wtMS40LTEuNEw5IDE2LjJ6IiBmaWxsLW9wYWNpdHk9IjAuMyIgLz4KPC9zdmc+");}
110
+
111
+ .cp_cff_12 #fbuilder .pbEnd .pbNext,
112
+ .cp_cff_12 #fbuilder .pb0 .pbPrevious{display:none;}
113
+
114
+ .cp_cff_12 #fbuilder .r{color:#FF0000;}
115
+ .cp_cff_12 #fbuilder .ui-slider-handle{background:#1485e5;border:0;border-radius:15px;height: 1.5em;width: 1.5em;top:-0.6em;}
116
+ .cp_cff_12 #fbuilder .dfield.slider-container{padding-left: 10px !important; border-radius: 10px; padding-right: 10px !important; padding-top:5px;}
117
+ .cp_cff_12 #fbuilder .slider{background: #ececec !important; border-radius: 10px;border:0;height: .3em;}
118
+ .cp_cff_12 #fbuilder .ui-slider-range{background: #1795FF;}
119
+ .cp_cff_12 #fbuilder .corner_captions{margin-top:10px;}
120
+
121
+ .cp_cff_12 #fbuilder span.uh{
122
+ font-size: 11px;
123
+ font-style: italic;
124
+ }
125
+
126
+ .cp_cff_12 #fbuilder fieldset{
127
+ border:1px solid #dcdcdc;
128
+ border-radius: 5px;
129
+ }
130
+
131
+ .cp_cff_12 #fbuilder fieldset legend{
132
+ padding: 5px 10px;
133
+ border:1px solid #dcdcdc !important;
134
+ font-weight:bold;
135
+ text-transform:uppercase;
136
+ border-radius: 5px;
137
+ }
138
+
139
+ .cp_cff_12 #fbuilder .fields.section_breaks{ margin-top:10px !important; margin-bottom:10px !important;}
140
+ .cp_cff_12 #fbuilder .fields.section_breaks>label{font-size:1.3em;font-weight:900;text-transform:uppercase;border-bottom:1px solid #dcdcdc}
141
+ .cp_cff_12 #fbuilder .fields.section_breaks .section_break{border:0;}
142
+
143
+ .cp_cff_12 #fbuilder .discount-container{margin-top:10px;font-weight:bold;}
templates/12/thumbnail.jpg ADDED
Binary file
templates/12/unite.css ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @charset "UTF-8" !important;
2
+ /*!
3
+ *
4
+ * bttn.css - https://ganapativs.github.io/bttn.css
5
+ * Version - 0.2.4
6
+ * Demo: https://bttn.surge.sh
7
+ *
8
+ * Licensed under the MIT license - http://opensource.org/licenses/MIT
9
+ *
10
+ * Copyright (c) 2016 Ganapati V S (@ganapativs)
11
+ *
12
+ */
13
+ /* standalone - .bttn-unite */
14
+ .bttn-default {
15
+ color: #fff !important;
16
+ }
17
+ .bttn-primary,
18
+ .bttn,
19
+ .bttn-lg,
20
+ .bttn-md,
21
+ .bttn-sm,
22
+ .bttn-xs {
23
+ color: #1d89ff !important;
24
+ }
25
+ .bttn-warning {
26
+ color: #feab3a !important;
27
+ }
28
+ .bttn-danger {
29
+ color: #ff5964 !important;
30
+ }
31
+ .bttn-success {
32
+ color: #28b78d !important;
33
+ }
34
+ .bttn-royal {
35
+ color: #bd2df5 !important;
36
+ }
37
+ .bttn,
38
+ .bttn-lg,
39
+ .bttn-md,
40
+ .bttn-sm,
41
+ .bttn-xs {
42
+ margin: 0 !important;
43
+ padding: 0 !important;
44
+ border-width: 0 !important;
45
+ border-color: transparent !important;
46
+ background: transparent !important;
47
+ font-weight: 400 !important;
48
+ cursor: pointer !important;
49
+ position: relative !important;
50
+ }
51
+ .bttn-lg {
52
+ padding: 8px 15px !important;
53
+ font-size: 24px !important;
54
+ font-family: inherit !important;
55
+ }
56
+ .bttn-md {
57
+ font-size: 20px !important;
58
+ font-family: inherit !important;
59
+ padding: 5px 12px !important;
60
+ }
61
+ .bttn-sm {
62
+ padding: 4px 10px !important;
63
+ font-size: 16px !important;
64
+ font-family: inherit !important;
65
+ }
66
+ .bttn-xs {
67
+ padding: 3px 8px !important;
68
+ font-size: 12px !important;
69
+ font-family: inherit !important;
70
+ }
71
+ .bttn-unite {
72
+ margin: 0 !important;
73
+ padding: 0 !important;
74
+ border-width: 0 !important;
75
+ border-color: transparent !important;
76
+ background: transparent !important;
77
+ font-weight: 400 !important;
78
+ cursor: pointer !important;
79
+ position: relative !important;
80
+ font-size: 20px !important;
81
+ font-family: inherit !important;
82
+ padding: 5px 12px !important;
83
+ z-index: 0 !important;
84
+ overflow: hidden !important;
85
+ border: 1px solid #1d89ff !important;
86
+ border-radius: 100px !important;
87
+ background: #fff !important;
88
+ color: #1d89ff !important;
89
+ -webkit-transition: color 0.3s cubic-bezier(0.02, 0.01, 0.47, 1), border-color 0.3s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
90
+ transition: color 0.3s cubic-bezier(0.02, 0.01, 0.47, 1), border-color 0.3s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
91
+ }
92
+ .bttn-unite:before {
93
+ position: absolute !important;
94
+ top: 0 !important;
95
+ left: 0 !important;
96
+ width: 100% !important;
97
+ height: 120% !important;
98
+ background: #d6e3ff !important;
99
+ content: '' !important;
100
+ opacity: 0 !important;
101
+ z-index: -1 !important;
102
+ -webkit-transition: opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
103
+ transition: opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
104
+ transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
105
+ transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
106
+ -webkit-transform: translate3d(-110%, -10%, 0) skewX(-20deg) !important;
107
+ transform: translate3d(-110%, -10%, 0) skewX(-20deg) !important;
108
+ }
109
+ .bttn-unite:after {
110
+ position: absolute !important;
111
+ top: 0 !important;
112
+ left: 0 !important;
113
+ width: 100% !important;
114
+ height: 120% !important;
115
+ background: rgba(214,227,255,0.7) !important;
116
+ content: '' !important;
117
+ opacity: 0 !important;
118
+ z-index: -1 !important;
119
+ -webkit-transition: opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
120
+ transition: opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
121
+ transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
122
+ transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
123
+ -webkit-transform: translate3d(110%, -10%, 0) skewX(-20deg) !important;
124
+ transform: translate3d(110%, -10%, 0) skewX(-20deg) !important;
125
+ }
126
+ .bttn-unite:hover,
127
+ .bttn-unite:focus {
128
+ box-shadow: 0 1px 8px rgba(58,51,53,0.3) !important;
129
+ color: #1d89ff !important;
130
+ -webkit-transition: all 0.5s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
131
+ transition: all 0.5s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
132
+ }
133
+ .bttn-unite:hover:before,
134
+ .bttn-unite:focus:before {
135
+ opacity: 1 !important;
136
+ -webkit-transition: opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
137
+ transition: opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
138
+ transition: transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
139
+ transition: transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
140
+ -webkit-transform: translate3d(-50%, -10%, 0) skewX(-20deg) !important;
141
+ transform: translate3d(-50%, -10%, 0) skewX(-20deg) !important;
142
+ }
143
+ .bttn-unite:hover:after,
144
+ .bttn-unite:focus:after {
145
+ opacity: 1 !important;
146
+ -webkit-transition: opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
147
+ transition: opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
148
+ transition: transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
149
+ transition: transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.25s cubic-bezier(0.02, 0.01, 0.47, 1), -webkit-transform 0.25s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
150
+ -webkit-transform: translate3d(50%, -10%, 0) skewX(-20deg) !important;
151
+ transform: translate3d(50%, -10%, 0) skewX(-20deg) !important;
152
+ }
153
+ .bttn-unite.bttn-xs {
154
+ padding: 3px 8px !important;
155
+ font-size: 12px !important;
156
+ font-family: inherit !important;
157
+ }
158
+ .bttn-unite.bttn-xs:hover,
159
+ .bttn-unite.bttn-xs:focus {
160
+ box-shadow: 0 1px 4px rgba(58,51,53,0.3) !important;
161
+ }
162
+ .bttn-unite.bttn-sm {
163
+ padding: 4px 10px !important;
164
+ font-size: 16px !important;
165
+ font-family: inherit !important;
166
+ }
167
+ .bttn-unite.bttn-sm:hover,
168
+ .bttn-unite.bttn-sm:focus {
169
+ box-shadow: 0 1px 6px rgba(58,51,53,0.3) !important;
170
+ }
171
+ .bttn-unite.bttn-md {
172
+ font-size: 20px !important;
173
+ font-family: inherit !important;
174
+ padding: 5px 12px !important;
175
+ }
176
+ .bttn-unite.bttn-md:hover,
177
+ .bttn-unite.bttn-md:focus {
178
+ box-shadow: 0 1px 8px rgba(58,51,53,0.3) !important;
179
+ }
180
+ .bttn-unite.bttn-lg {
181
+ padding: 8px 15px !important;
182
+ font-size: 24px !important;
183
+ font-family: inherit !important;
184
+ }
185
+ .bttn-unite.bttn-lg:hover,
186
+ .bttn-unite.bttn-lg:focus {
187
+ box-shadow: 0 1px 10px rgba(58,51,53,0.3) !important;
188
+ }
189
+ .bttn-unite.bttn-default {
190
+ border-color: #1d89ff !important;
191
+ color: #1d89ff !important;
192
+ }
193
+ .bttn-unite.bttn-default:hover,
194
+ .bttn-unite.bttn-default:focus {
195
+ background: #d6e3ff !important;
196
+ color: #1d89ff !important;
197
+ }
198
+ .bttn-unite.bttn-default:before {
199
+ background: #a7c3ff !important;
200
+ }
201
+ .bttn-unite.bttn-default:after {
202
+ background: #d6e3ff !important;
203
+ }
204
+ .bttn-unite.bttn-primary {
205
+ border-color: #1d89ff !important;
206
+ color: #1d89ff !important;
207
+ }
208
+ .bttn-unite.bttn-primary:hover,
209
+ .bttn-unite.bttn-primary:focus {
210
+ background: #1d89ff !important;
211
+ color: #fff !important;
212
+ }
213
+ .bttn-unite.bttn-primary:before {
214
+ background: #006de3 !important;
215
+ }
216
+ .bttn-unite.bttn-primary:after {
217
+ background: #1d89ff !important;
218
+ }
219
+ .bttn-unite.bttn-warning {
220
+ border-color: #feab3a !important;
221
+ color: #feab3a !important;
222
+ }
223
+ .bttn-unite.bttn-warning:hover,
224
+ .bttn-unite.bttn-warning:focus {
225
+ background: #feab3a !important;
226
+ color: #fff !important;
227
+ }
228
+ .bttn-unite.bttn-warning:before {
229
+ background: #f89001 !important;
230
+ }
231
+ .bttn-unite.bttn-warning:after {
232
+ background: #feab3a !important;
233
+ }
234
+ .bttn-unite.bttn-danger {
235
+ border-color: #ff5964 !important;
236
+ color: #ff5964 !important;
237
+ }
238
+ .bttn-unite.bttn-danger:hover,
239
+ .bttn-unite.bttn-danger:focus {
240
+ background: #ff5964 !important;
241
+ color: #fff !important;
242
+ }
243
+ .bttn-unite.bttn-danger:before {
244
+ background: #ff1424 !important;
245
+ }
246
+ .bttn-unite.bttn-danger:after {
247
+ background: #ff5964 !important;
248
+ }
249
+ .bttn-unite.bttn-success {
250
+ border-color: #28b78d !important;
251
+ color: #28b78d !important;
252
+ }
253
+ .bttn-unite.bttn-success:hover,
254
+ .bttn-unite.bttn-success:focus {
255
+ background: #28b78d !important;
256
+ color: #fff !important;
257
+ }
258
+ .bttn-unite.bttn-success:before {
259
+ background: #209271 !important;
260
+ }
261
+ .bttn-unite.bttn-success:after {
262
+ background: #28b78d !important;
263
+ }
264
+ .bttn-unite.bttn-royal {
265
+ border-color: #bd2df5 !important;
266
+ color: #bd2df5 !important;
267
+ }
268
+ .bttn-unite.bttn-royal:hover,
269
+ .bttn-unite.bttn-royal:focus {
270
+ background: #bd2df5 !important;
271
+ color: #fff !important;
272
+ }
273
+ .bttn-unite.bttn-royal:before {
274
+ background: #a20bdd !important;
275
+ }
276
+ .bttn-unite.bttn-royal:after {
277
+ background: #bd2df5 !important;
278
+ }