Contact Form Builder – a plugin for creating contact and feedback forms - Version 1.0.67

Version Description

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form Builder – a plugin for creating contact and feedback forms
Version 1.0.67
Comparing to
See all releases

Code changes from version 1.0.66 to 1.0.67

contact-form-builder.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: https://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
- * Version: 1.0.66
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
- define('WD_CFM_VERSION', '1.0.66');
14
  define('WD_CFM_PREFIX', 'cfm');
15
  define('WD_CFM_NICENAME', __( 'Contact Form Builder', WD_CFM_PREFIX ));
16
 
@@ -117,6 +117,70 @@ function contact_form_maker_admin_ajax() {
117
  }
118
  add_action('admin_head', 'contact_form_maker_admin_ajax');
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  function cfm_do_output_buffer() {
121
  ob_start();
122
  }
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: https://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
+ * Version: 1.0.67
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
+ define('WD_CFM_VERSION', '1.0.67');
14
  define('WD_CFM_PREFIX', 'cfm');
15
  define('WD_CFM_NICENAME', __( 'Contact Form Builder', WD_CFM_PREFIX ));
16
 
117
  }
118
  add_action('admin_head', 'contact_form_maker_admin_ajax');
119
 
120
+ // Enqueue block editor assets for Gutenberg.
121
+ add_filter('tw_get_block_editor_assets', 'cfm_register_block_editor_assets');
122
+ add_action( 'enqueue_block_editor_assets', 'cfm_enqueue_block_editor_assets' );
123
+
124
+ function cfm_register_block_editor_assets($assets) {
125
+ $version = '2.0.0';
126
+ $js_path = WD_CFM_URL . '/js/tw-gb/block.js';
127
+ $css_path = WD_CFM_URL . '/css/tw-gb/block.css';
128
+ if (!isset($assets['version']) || version_compare($assets['version'], $version) === -1) {
129
+ $assets['version'] = $version;
130
+ $assets['js_path'] = $js_path;
131
+ $assets['css_path'] = $css_path;
132
+ }
133
+ return $assets;
134
+ }
135
+
136
+ function cfm_enqueue_block_editor_assets() {
137
+ require_once(WD_CFM_DIR . '/framework/WDW_CFM_Library.php');
138
+ $key = 'tw/contact-form-builder';
139
+ $plugin_name = WD_CFM_NICENAME;
140
+ $icon_url = WD_CFM_URL . '/images/tw-gb/icon_colored.svg';
141
+ $icon_svg = WD_CFM_URL . '/images/tw-gb/icon.svg';
142
+ $data = WDW_CFM_Library::get_shortcode_data();
143
+ ?>
144
+ <script>
145
+ if ( !window['tw_gb'] ) {
146
+ window['tw_gb'] = {};
147
+ }
148
+ if ( !window['tw_gb']['<?php echo $key; ?>'] ) {
149
+ window['tw_gb']['<?php echo $key; ?>'] = {
150
+ title: '<?php echo $plugin_name; ?>',
151
+ titleSelect: '<?php echo sprintf(__('Select %s', 'contact_form_maker'), $plugin_name); ?>',
152
+ iconUrl: '<?php echo $icon_url; ?>',
153
+ iconSvg: {
154
+ width: '20',
155
+ height: '20',
156
+ src: '<?php echo $icon_svg; ?>'
157
+ },
158
+ isPopup: false,
159
+ data: '<?php echo $data; ?>'
160
+ }
161
+ }
162
+ </script>
163
+ <?php
164
+ // Remove previously registered or enqueued versions
165
+ $wp_scripts = wp_scripts();
166
+ foreach ($wp_scripts->registered as $key => $value) {
167
+ // Check for an older versions with prefix.
168
+ if (strpos($key, 'tw-gb-block') > 0) {
169
+ wp_deregister_script( $key );
170
+ wp_deregister_style( $key );
171
+ }
172
+ }
173
+ // Get the last version from all 10Web plugins.
174
+ $assets = apply_filters('tw_get_block_editor_assets', array());
175
+ // Not performing unregister or unenqueue as in old versions all are with prefixes.
176
+ wp_enqueue_script('tw-gb-block', $assets['js_path'], array( 'wp-blocks', 'wp-element' ), $assets['version']);
177
+ wp_localize_script('tw-gb-block', 'tw_obj', array(
178
+ 'nothing_selected' => __('Nothing selected.', 'contact_form_maker'),
179
+ 'empty_item' => __('- Select -', 'contact_form_maker'),
180
+ ));
181
+ wp_enqueue_style('tw-gb-block', $assets['css_path'], array( 'wp-edit-blocks' ), $assets['version']);
182
+ }
183
+
184
  function cfm_do_output_buffer() {
185
  ob_start();
186
  }
css/tw-gb/block.css ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 10Web plugins Gutenberg integration
3
+ * version 2.0.0
4
+ */
5
+ .tw-container {
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ z-index: 9999999;
12
+ background: rgba(0,0,0,0.7);
13
+ }
14
+
15
+ .tw-container .tw-container-wrap {
16
+ background: #fff;
17
+ height: 100%;
18
+ width: 100%;
19
+ position: absolute;
20
+ top: 0;
21
+ bottom: 0;
22
+ margin: auto;
23
+ right: 0;
24
+ left: 0;
25
+ }
26
+
27
+ .tw-container .tw-container-wrap-520-400 {
28
+ max-width: 520px;
29
+ max-height: 400px;
30
+ }
31
+
32
+ .tw-container .tw-container-wrap-420-450 {
33
+ max-width: 420px;
34
+ max-height: 450px;
35
+ }
36
+
37
+ .tw-container .tw-container-wrap .media-modal-close{
38
+ line-height: 34px;
39
+ text-align: center;
40
+ height: 40px;
41
+ }
42
+
43
+ .tw-container .tw-container-wrap iframe {
44
+ height: 100%;
45
+ width: 100%;
46
+ }
47
+ .tw-gb-select {
48
+ width: 100%;
49
+ height: auto !important;
50
+ }
framework/WDW_CFM_Library.php CHANGED
@@ -423,6 +423,26 @@ class WDW_CFM_Library {
423
  <?php
424
  return ob_get_clean();
425
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  ////////////////////////////////////////////////////////////////////////////////////////
427
  // Private Methods //
428
  ////////////////////////////////////////////////////////////////////////////////////////
423
  <?php
424
  return ob_get_clean();
425
  }
426
+
427
+ /**
428
+ * Get shortcode data.
429
+ *
430
+ * @return json $data
431
+ */
432
+ public static function get_shortcode_data() {
433
+ global $wpdb;
434
+ $rows = $wpdb->get_results("SELECT `id`, `title` as name FROM `" . $wpdb->prefix . "contactformmaker`");
435
+ $data = array();
436
+ $data['shortcode_prefix'] = 'Contact_Form_Builder';
437
+ $data['inputs'][] = array(
438
+ 'type' => 'select',
439
+ 'id' => WD_CFM_PREFIX . '_id',
440
+ 'name' => WD_CFM_PREFIX . '_id',
441
+ 'shortcode_attibute_name' => 'id',
442
+ 'options' => $rows,
443
+ );
444
+ return json_encode($data);
445
+ }
446
  ////////////////////////////////////////////////////////////////////////////////////////
447
  // Private Methods //
448
  ////////////////////////////////////////////////////////////////////////////////////////
images/tw-gb/icon.svg ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 20 12.5" style="enable-background:new 0 0 20 12.5;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#F4F4F4;}
7
+ .st1{fill:#555D66;}
8
+ </style>
9
+ <g id="XMLID_43896_">
10
+ <path class="st0" d="M82.5-0.9H64.9c-0.7,0-1.2,0.5-1.2,1.2v11.9c0,0.7,0.5,1.2,1.2,1.2h17.6c0.7,0,1.2-0.5,1.2-1.2V0.3
11
+ C83.7-0.4,83.2-0.9,82.5-0.9z"/>
12
+ </g>
13
+ <rect id="XMLID_27593_" x="73.9" y="7" class="st1" width="8.3" height="0.5"/>
14
+ <rect id="XMLID_1_" x="73.9" y="5.8" class="st1" width="8.3" height="0.5"/>
15
+ <rect id="XMLID_100_" x="73.9" y="4.8" class="st1" width="8.3" height="0.5"/>
16
+ <rect id="XMLID_42880_" x="73.9" y="8" class="st1" width="8.3" height="0.5"/>
17
+ <rect id="XMLID_42649_" x="65.3" y="9" class="st1" width="17" height="0.5"/>
18
+ <rect id="XMLID_42418_" x="65.3" y="10" class="st1" width="17" height="0.5"/>
19
+ <rect id="XMLID_42187_" x="73.9" y="2.4" class="st1" width="2.3" height="1.7"/>
20
+ <rect id="XMLID_41956_" x="76.9" y="2.4" class="st1" width="2.3" height="1.7"/>
21
+ <rect id="XMLID_41725_" x="79.9" y="2.4" class="st1" width="2.3" height="1.7"/>
22
+ <rect id="XMLID_39345_" x="65.3" y="2.4" class="st1" width="7.1" height="5"/>
23
+ <g id="XMLID_27027_">
24
+
25
+ <image style="overflow:visible;opacity:0.1;" width="13" height="13" xlink:href="A49650EC.png" transform="matrix(1 0 0 1 62.7407 -2.4366)">
26
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3-0.3
51
+ V0.4C20,0.2,19.9,0,19.7,0z M18.6,9.8h-7.4V9.1h7.4V9.8z M18.6,8.7h-7.4V8.1h7.4V8.7z M18.6,7.7h-7.4V7h7.4V7.7z M18.6,6.6h-7.4V6
52
+ h7.4V6.6z M18.6,5.4h-7.4V2.8h7.4V5.4z"/>
53
+ <path id="XMLID_2084_" class="st1" d="M8.8,5.4c0,1.2-0.4,2.3-1.1,3.1l-0.1,0C7.3,8.3,6.8,8.1,6.2,7.9C5.9,7.8,5.7,7.7,5.5,7.6
54
+ C5.3,7.6,5.2,7.5,5.1,7.5c0-0.1,0-0.2,0-0.3V7c0-0.2,0-0.2,0.1-0.2c0.2-0.2,0.3-0.5,0.5-1.2c0-0.1,0-0.2,0.1-0.2
55
+ C5.8,5.2,5.8,5,5.9,4.6c0.1-0.3,0-0.5,0-0.7c0,0,0,0,0,0l0-0.2c0-0.1,0-0.3,0.1-0.6c0-0.4-0.1-1-0.6-1.5C5.1,1.3,4.5,0.9,3.5,0.9
56
+ c-0.1,0-0.3,0-0.3,0V0.7c0-0.2,0.1-0.3,0.3-0.3c0.1,0,0.2,0,0.3,0C6.6,0.4,8.8,2.6,8.8,5.4z"/>
57
+ </g>
58
+ </svg>
images/tw-gb/icon_colored.svg ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 20 12.5" style="enable-background:new 0 0 20 12.5;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#F4F4F4;}
7
+ .st1{fill:#555D66;}
8
+ .st2{fill:#113754;}
9
+ .st3{fill:#3DA0D4;}
10
+ </style>
11
+ <g id="XMLID_43896_">
12
+ <path class="st0" d="M82.5-0.9H64.9c-0.7,0-1.2,0.5-1.2,1.2v11.9c0,0.7,0.5,1.2,1.2,1.2h17.6c0.7,0,1.2-0.5,1.2-1.2V0.3
13
+ C83.7-0.4,83.2-0.9,82.5-0.9z"/>
14
+ </g>
15
+ <rect id="XMLID_27593_" x="73.9" y="7" class="st1" width="8.3" height="0.5"/>
16
+ <rect id="XMLID_1_" x="73.9" y="5.8" class="st1" width="8.3" height="0.5"/>
17
+ <rect id="XMLID_100_" x="73.9" y="4.8" class="st1" width="8.3" height="0.5"/>
18
+ <rect id="XMLID_42880_" x="73.9" y="8" class="st1" width="8.3" height="0.5"/>
19
+ <rect id="XMLID_42649_" x="65.3" y="9" class="st1" width="17" height="0.5"/>
20
+ <rect id="XMLID_42418_" x="65.3" y="10" class="st1" width="17" height="0.5"/>
21
+ <rect id="XMLID_42187_" x="73.9" y="2.4" class="st1" width="2.3" height="1.7"/>
22
+ <rect id="XMLID_41956_" x="76.9" y="2.4" class="st1" width="2.3" height="1.7"/>
23
+ <rect id="XMLID_41725_" x="79.9" y="2.4" class="st1" width="2.3" height="1.7"/>
24
+ <rect id="XMLID_39345_" x="65.3" y="2.4" class="st1" width="7.1" height="5"/>
25
+ <g id="XMLID_27027_">
26
+
27
+ <image style="overflow:visible;opacity:0.1;" width="13" height="13" xlink:href="D276F09D.png" transform="matrix(1 0 0 1 62.7407 -2.4366)">
28
+ </image>
29
+ <g>
30
+ <g>
31
+ <path class="st0" d="M71.7,7.2c-0.1-0.5-0.3-1-0.6-1.4c-0.2-0.4-0.5-0.6-0.8-0.9c0,0-0.1,0-0.1-0.1c0.1-0.1,0-0.1-0.1-0.2
32
+ c-0.1,0-0.1-0.1,0-0.1c0.5-0.6,0.6-1.2,0.3-1.9c0,0,0-0.1-0.1-0.1c-0.3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.2-0.4,2.3-1.1,3.1l-0.1,0C7.3,8.3,6.8,8.1,6.2,7.9C5.9,7.8,5.7,7.7,5.5,7.6
56
+ C5.3,7.6,5.2,7.5,5.1,7.5c0-0.1,0-0.2,0-0.3V7c0-0.2,0-0.2,0.1-0.2c0.2-0.2,0.3-0.5,0.5-1.2c0-0.1,0-0.2,0.1-0.2
57
+ C5.8,5.2,5.8,5,5.9,4.6c0.1-0.3,0-0.5,0-0.7c0,0,0,0,0,0l0-0.2c0-0.1,0-0.3,0.1-0.6c0-0.4-0.1-1-0.6-1.5C5.1,1.3,4.5,0.9,3.5,0.9
58
+ c-0.1,0-0.3,0-0.3,0V0.7c0-0.2,0.1-0.3,0.3-0.3c0.1,0,0.2,0,0.3,0C6.6,0.4,8.8,2.6,8.8,5.4z"/>
59
+ </g>
60
+ </svg>
js/tw-gb/block.js ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * 10Web plugins Gutenberg integration
3
+ * version 2.0.0
4
+ */
5
+ ( function ( blocks, element ) {
6
+ registerAllPluginBlocks();
7
+
8
+ function registerAllPluginBlocks() {
9
+ var twPluginsData = window['tw_gb'];
10
+ if ( !twPluginsData ) {
11
+ return;
12
+ }
13
+
14
+ for ( var pluginId in twPluginsData ) {
15
+ if ( !twPluginsData.hasOwnProperty( pluginId ) ) {
16
+ continue;
17
+ }
18
+
19
+ if ( !twPluginsData[pluginId].inited ) {
20
+ twPluginsData[pluginId].inited = true;
21
+ registerPluginBlock( blocks, element, pluginId, twPluginsData[pluginId] );
22
+ }
23
+ }
24
+ }
25
+
26
+ function registerPluginBlock( blocks, element, pluginId, pluginData ) {
27
+ var el = element.createElement;
28
+
29
+ var isPopup = pluginData.isPopup;
30
+
31
+ var iconEl = el( 'img', {
32
+ width: pluginData.iconSvg.width,
33
+ height: pluginData.iconSvg.height,
34
+ src: pluginData.iconSvg.src
35
+ } );
36
+
37
+ blocks.registerBlockType( pluginId, {
38
+ title: pluginData.title,
39
+ icon: iconEl,
40
+ category: 'common',
41
+ attributes: {
42
+ shortcode: {
43
+ type: 'string'
44
+ },
45
+ popupOpened: {
46
+ type: 'boolean',
47
+ value: true
48
+ },
49
+ notInitial: {
50
+ type: 'boolean'
51
+ },
52
+ shortcode_id: {
53
+ type: 'string'
54
+ }
55
+ },
56
+
57
+ edit: function ( props ) {
58
+ if ( !props.attributes.notInitial ) {
59
+ props.setAttributes( {
60
+ notInitial: true,
61
+ popupOpened: true
62
+ } );
63
+
64
+ return el( 'p' );
65
+ }
66
+
67
+ if ( props.attributes.popupOpened ) {
68
+ if ( isPopup ) {
69
+ return showPopup( props.attributes.shortcode, props.attributes.shortcode_id );
70
+ }
71
+ else {
72
+ return showShortcodeList( props.attributes.shortcode );
73
+ }
74
+ }
75
+
76
+ if ( props.attributes.shortcode ) {
77
+ return showShortcode();
78
+ }
79
+ else {
80
+ return showShortcodePlaceholder();
81
+ }
82
+
83
+ function showPopup( shortcode, shortcode_id ) {
84
+ var shortcodeCbName = generateUniqueCbName( pluginId );
85
+ // Store shortcode attribute into a global variable to get it from an iframe.
86
+ window[shortcodeCbName + '_shortcode'] = shortcode ? shortcode : '';
87
+ window[shortcodeCbName] = function ( shortcode, shortcode_id ) {
88
+ delete window[shortcodeCbName];
89
+
90
+ if ( props ) {
91
+ props.setAttributes( { shortcode: shortcode, shortcode_id: shortcode_id, popupOpened: false } );
92
+ }
93
+ };
94
+ props.setAttributes( { popupOpened: true } );
95
+ var elem = el( 'form', { className: 'tw-container' }, el( 'div', { className: 'tw-container-wrap' + (pluginData.containerClass ? ' ' + pluginData.containerClass : '') }, el( 'span', {
96
+ className: "media-modal-close",
97
+ onClick: close
98
+ }, el( "span", { className: "media-modal-icon" } ) ), el( 'iframe', { src: pluginData.data.shortcodeUrl + '&callback=' + shortcodeCbName + '&edit=' + shortcode_id } ) ) );
99
+ return elem;
100
+ }
101
+
102
+ function showShortcodeList( shortcode ) {
103
+ props.setAttributes( { popupOpened: true } );
104
+ var children = [];
105
+ var shortcodeList = JSON.parse( pluginData.data );
106
+ shortcodeList.inputs.forEach( function ( inputItem ) {
107
+ if ( inputItem.type === 'select' ) {
108
+ children.push( el( 'option', { value: '', dataId: 0 }, tw_obj.empty_item ) );
109
+ if ( inputItem.options.length ) {
110
+ inputItem.options.forEach( function ( optionItem ) {
111
+ var shortcode = '[' + shortcodeList.shortcode_prefix + ' ' + inputItem.shortcode_attibute_name + '="' + optionItem.id + '"]';
112
+ children.push(
113
+ el( 'option', { value: shortcode, dataId: optionItem.id }, optionItem.name )
114
+ );
115
+ } )
116
+ }
117
+ }
118
+ } );
119
+
120
+ if ( shortcodeList.shortcodes ) {
121
+ shortcodeList.shortcodes.forEach( function ( shortcodeItem ) {
122
+ children.push(
123
+ el( 'option', { value: shortcodeItem.shortcode, dataId: shortcodeItem.id }, shortcodeItem.name )
124
+ );
125
+ } );
126
+ }
127
+
128
+ return el( 'form', { onSubmit: chooseFromList }, el( 'div', {}, pluginData.titleSelect ), el( 'select', {
129
+ value: shortcode,
130
+ onChange: chooseFromList,
131
+ class: 'tw-gb-select'
132
+ }, children ) );
133
+ }
134
+
135
+ function showShortcodePlaceholder() {
136
+ props.setAttributes( { popupOpened: false } );
137
+ return el( 'p', {
138
+ style: {
139
+ 'cursor': "pointer"
140
+ },
141
+
142
+ onClick: function () {
143
+ props.setAttributes( { popupOpened: true } );
144
+ }.bind( this )
145
+ }, tw_obj.nothing_selected );
146
+ }
147
+
148
+ function showShortcode() {
149
+ return el( 'img', {
150
+ src: pluginData.iconUrl,
151
+ alt: pluginData.title,
152
+ style: {
153
+ 'height': "36px",
154
+ 'width': "36px"
155
+ },
156
+ onClick: function () {
157
+ props.setAttributes( { popupOpened: true } );
158
+ }.bind( this )
159
+ } );
160
+ }
161
+
162
+ function close() {
163
+ props.setAttributes( { popupOpened: false } );
164
+ }
165
+
166
+ function chooseFromList( event, shortcode_id ) {
167
+ var selected = event.target.querySelector( 'option:checked' );
168
+ props.setAttributes( { shortcode: selected.value, shortcode_id: selected.dataId, popupOpened: false } );
169
+ event.preventDefault();
170
+ }
171
+ },
172
+
173
+ save: function ( props ) {
174
+ return props.attributes.shortcode;
175
+ }
176
+ } );
177
+ }
178
+
179
+ function generateUniqueCbName( pluginId ) {
180
+ return 'wdg_cb_' + pluginId;
181
+ }
182
+ } )(
183
+ window.wp.blocks,
184
+ window.wp.element
185
+ );
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: webdorado
3
  Tags: contact form, contact forms, contact, feedback, form manager, captcha, custom form, email, form, form builder, forms, survey
4
  Requires at least: 3.4
5
- Tested up to: 4.9
6
- Stable tag: 1.0.66
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -78,6 +78,9 @@ After downloading the ZIP file,
78
 
79
  == Changelog ==
80
 
 
 
 
81
  = 1.0.66 =
82
  * Fixed: Editing longitude/latitude from map field settings.
83
 
2
  Contributors: webdorado
3
  Tags: contact form, contact forms, contact, feedback, form manager, captcha, custom form, email, form, form builder, forms, survey
4
  Requires at least: 3.4
5
+ Tested up to: 5.0
6
+ Stable tag: 1.0.67
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
78
 
79
  == Changelog ==
80
 
81
+ = 2.0.67 =
82
+ * Added: Gutenberg integration.
83
+
84
  = 1.0.66 =
85
  * Fixed: Editing longitude/latitude from map field settings.
86