Conditional Fields for Contact Form 7 - Version 0.1.6

Version Description

  • made compatible with wpcf7-form-control-signature-wrap plugin https://wordpress.org/support/topic/signature-add-on-not-working
Download this release

Release Info

Developer Jules Colle
Plugin Icon 128x128 Conditional Fields for Contact Form 7
Version 0.1.6
Comparing to
See all releases

Code changes from version 0.1.5 to 0.1.6

contact-form-7-conditional-fields.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Contact Form 7 Conditional Fields
4
  Plugin URI: http://bdwm.be/
5
  Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  Author: Jules Colle
7
- Version: 0.1.5
8
  Author URI: http://bdwm.be/
9
  */
10
 
@@ -26,7 +26,7 @@ Author URI: http://bdwm.be/
26
  ?>
27
  <?php
28
 
29
- define( 'WPCF7CF_VERSION', '0.1.5' );
30
  define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
31
  define( 'WPCF7CF_PLUGIN', __FILE__ );
32
  define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
4
  Plugin URI: http://bdwm.be/
5
  Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  Author: Jules Colle
7
+ Version: 0.1.6
8
  Author URI: http://bdwm.be/
9
  */
10
 
26
  ?>
27
  <?php
28
 
29
+ define( 'WPCF7CF_VERSION', '0.1.6' );
30
  define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
31
  define( 'WPCF7CF_PLUGIN', __FILE__ );
32
  define( 'WPCF7CF_PLUGIN_BASENAME', plugin_basename( WPCF7CF_PLUGIN ) );
js/scripts.js CHANGED
@@ -1,6 +1,6 @@
 
 
1
  (function($) {
2
- //if (typeof wpcf7cf_options == 'undefined') return; // return if there is no form on the page
3
- //console.log(wpcf7cf_options);
4
 
5
  var i=0;
6
  var options = [];
@@ -16,8 +16,19 @@
16
  $(document).ready(function() {
17
  function display_fields(unit_tag, wpcf7cf_conditions) {
18
 
19
- //console.log(unit_tag);
20
- //console.log(wpcf7cf_conditions);
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  $("#"+unit_tag+" [data-class='wpcf7cf_group']").hide();
23
  for (var i=0; i < wpcf7cf_conditions.length; i++) {
@@ -75,7 +86,6 @@
75
  var conditions = options[i]['conditions'];
76
  display_fields(unit_tag, conditions);
77
  $('#'+unit_tag+' input, #'+unit_tag+' select, #'+unit_tag+' textarea').change({unit_tag:unit_tag, conditions:conditions}, function(e) {
78
- console.log('triggered '+e.data.unit_tag);
79
  display_fields(e.data.unit_tag, e.data.conditions);
80
  });
81
  }
1
+ var cf7signature_resized = 0; // for compatibility with contact-form-7-signature-addon
2
+
3
  (function($) {
 
 
4
 
5
  var i=0;
6
  var options = [];
16
  $(document).ready(function() {
17
  function display_fields(unit_tag, wpcf7cf_conditions) {
18
 
19
+ //for compatibility with contact-form-7-signature-addon
20
+ if (cf7signature_resized == 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) {
21
+ if (signatures[0].canvas.width == 0) {
22
+ for (var i = 0; i < signatures.length; i++) {
23
+
24
+ jQuery(".wpcf7-form-control-signature-body>canvas").eq(0).attr('width', jQuery(".wpcf7-form-control-signature-wrap").width());
25
+ jQuery(".wpcf7-form-control-signature-body>canvas").eq(0).attr('height', jQuery(".wpcf7-form-control-signature-wrap").height());
26
+
27
+ cf7signature_resized = 1;
28
+ }
29
+ }
30
+ }
31
+
32
 
33
  $("#"+unit_tag+" [data-class='wpcf7cf_group']").hide();
34
  for (var i=0; i < wpcf7cf_conditions.length; i++) {
86
  var conditions = options[i]['conditions'];
87
  display_fields(unit_tag, conditions);
88
  $('#'+unit_tag+' input, #'+unit_tag+' select, #'+unit_tag+' textarea').change({unit_tag:unit_tag, conditions:conditions}, function(e) {
 
89
  display_fields(e.data.unit_tag, e.data.conditions);
90
  });
91
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 3.6.1
8
  Tested up to: 4.5.3
9
- Stable tag: 0.1.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -39,8 +39,12 @@ Because no questions have been asked frequently about this plugin.
39
 
40
  == Changelog ==
41
 
 
 
 
42
  = 0.1.5 =
43
  * fixed PHP notice thanks to @natalia_c https://wordpress.org/support/topic/php-notice-80
 
44
 
45
  = 0.1.4 =
46
 
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 3.6.1
8
  Tested up to: 4.5.3
9
+ Stable tag: 0.1.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
39
 
40
  == Changelog ==
41
 
42
+ = 0.1.6 =
43
+ * made compatible with wpcf7-form-control-signature-wrap plugin https://wordpress.org/support/topic/signature-add-on-not-working
44
+
45
  = 0.1.5 =
46
  * fixed PHP notice thanks to @natalia_c https://wordpress.org/support/topic/php-notice-80
47
+ * tested with WP 4.5.3
48
 
49
  = 0.1.4 =
50