Version Description
- Changed: PHP function shortcode check if function exists.
- Fixed: Do not print js before DOCTYPE.
- Fixed: Error when clicking allow or skip to collect some usage data more then once.
Download this release
Release Info
Developer | webdorado |
Plugin | Slider by WD – Responsive Slider |
Version | 1.2.21 |
Comparing to | |
See all releases |
Code changes from version 1.2.20 to 1.2.21
- admin/controllers/elementorWidget.php +1 -1
- admin/views/Sliders.php +1 -1
- css/tw-gb/block.css +24 -17
- demo_sliders/demo_sliders.php +31 -18
- framework/WDW_S_Library.php +3 -4
- js/tw-gb/block.js +180 -165
- readme.txt +6 -1
- slider-wd.php +29 -33
- wd/assets/js/subsribe.js +16 -36
admin/controllers/elementorWidget.php
CHANGED
@@ -25,7 +25,7 @@ class WDSElementor extends \Elementor\Widget_Base {
|
|
25 |
* @return string Widget icon.
|
26 |
*/
|
27 |
public function get_icon() {
|
28 |
-
return 'fa
|
29 |
}
|
30 |
|
31 |
/**
|
25 |
* @return string Widget icon.
|
26 |
*/
|
27 |
public function get_icon() {
|
28 |
+
return 'fa twbb-slider-wd twbb-widget-icon';
|
29 |
}
|
30 |
|
31 |
/**
|
admin/views/Sliders.php
CHANGED
@@ -115,7 +115,7 @@ class SlidersView_wds extends AdminView_wds {
|
|
115 |
<input type="text" value='[wds id="<?php echo $row->id; ?>"]' onclick="spider_select_value(this)" size="11" readonly="readonly" />
|
116 |
</td>
|
117 |
<td data-colname="<?php _e('PHP function', WDS()->prefix); ?>">
|
118 |
-
<input type="text" value="<?php wd_slider(<?php echo $row->id; ?>); ?>" onclick="spider_select_value(this)" size="17" readonly="readonly" />
|
119 |
</td>
|
120 |
</tr>
|
121 |
<?php
|
115 |
<input type="text" value='[wds id="<?php echo $row->id; ?>"]' onclick="spider_select_value(this)" size="11" readonly="readonly" />
|
116 |
</td>
|
117 |
<td data-colname="<?php _e('PHP function', WDS()->prefix); ?>">
|
118 |
+
<input type="text" value="<?php if( function_exists('wd_slider') ) { wd_slider(<?php echo $row->id; ?>); } ?>" onclick="spider_select_value(this)" size="17" readonly="readonly" />
|
119 |
</td>
|
120 |
</tr>
|
121 |
<?php
|
css/tw-gb/block.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* 10Web plugins Gutenberg integration
|
3 |
-
* version 2.0.
|
4 |
*/
|
5 |
.tw-container {
|
6 |
position: fixed;
|
@@ -13,31 +13,38 @@
|
|
13 |
}
|
14 |
|
15 |
.tw-container .tw-container-wrap {
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
.tw-container .tw-container-wrap-520-400 {
|
28 |
-
|
29 |
-
|
30 |
}
|
31 |
|
32 |
.tw-container .tw-container-wrap-420-450 {
|
33 |
-
|
34 |
-
|
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 {
|
@@ -45,6 +52,6 @@
|
|
45 |
width: 100%;
|
46 |
}
|
47 |
.tw-gb-select {
|
48 |
-
|
49 |
-
|
50 |
-
}
|
1 |
/**
|
2 |
* 10Web plugins Gutenberg integration
|
3 |
+
* version 2.0.3
|
4 |
*/
|
5 |
.tw-container {
|
6 |
position: fixed;
|
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 |
+
padding-top: 40px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.tw-container .tw-container-wrap-800-540 {
|
29 |
+
max-width: 800px;
|
30 |
+
max-height: 540px;
|
31 |
}
|
32 |
|
33 |
.tw-container .tw-container-wrap-520-400 {
|
34 |
+
max-width: 520px;
|
35 |
+
max-height: 400px;
|
36 |
}
|
37 |
|
38 |
.tw-container .tw-container-wrap-420-450 {
|
39 |
+
max-width: 420px;
|
40 |
+
max-height: 450px;
|
41 |
}
|
42 |
|
43 |
.tw-container .tw-container-wrap .media-modal-close{
|
44 |
line-height: 34px;
|
45 |
text-align: center;
|
46 |
height: 40px;
|
47 |
+
top: 10px;
|
48 |
}
|
49 |
|
50 |
.tw-container .tw-container-wrap iframe {
|
52 |
width: 100%;
|
53 |
}
|
54 |
.tw-gb-select {
|
55 |
+
width: 100%;
|
56 |
+
height: auto !important;
|
57 |
+
}
|
demo_sliders/demo_sliders.php
CHANGED
@@ -1,25 +1,33 @@
|
|
1 |
<?php
|
2 |
if( isset($_REQUEST['wds_import_submit']) && ! empty($_FILES['fileimport']) ) {
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
}
|
21 |
|
22 |
function spider_demo_sliders() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
$demo_sliders = array(
|
24 |
'presentation' => array(
|
25 |
'name' => __('Presentation', WDS()->prefix),
|
@@ -74,9 +82,14 @@ function spider_demo_sliders() {
|
|
74 |
?>
|
75 |
<form method="post" enctype="multipart/form-data">
|
76 |
<div class="wd-group">
|
77 |
-
<input <?php echo WDS()->is_free ? 'disabled="disabled"' : ''; ?> type="file" name="fileimport" id="fileimport">
|
78 |
-
<input <?php echo WDS()->is_free ? 'disabled="disabled"' : ''; ?> type="submit" name="wds_import_submit" class="button button-primary" onclick="<?php echo(WDS()->is_free ? 'alert(\'' . addslashes(__('This functionality is disabled in free version.', WDS()->prefix)) . '\'); return false;' : 'if(!wds_getfileextension(document.getElementById(\'fileimport\').value)){ return false; }'); ?>" value="<?php _e('Import', WDS()->prefix); ?>">
|
79 |
<p class="description"><?php _e('Browse the .zip file of the slider.', WDS()->prefix); ?></p>
|
|
|
|
|
|
|
|
|
|
|
80 |
</div>
|
81 |
</form>
|
82 |
</div>
|
1 |
<?php
|
2 |
if( isset($_REQUEST['wds_import_submit']) && ! empty($_FILES['fileimport']) ) {
|
3 |
+
require_once(WDS()->plugin_dir . '/framework/WDW_S_Library.php');
|
4 |
+
global $wpdb;
|
5 |
+
$flag = FALSE;
|
6 |
+
$file = $_FILES['fileimport'];
|
7 |
+
$dest_dir = ABSPATH . WDS()->upload_dir;
|
8 |
+
if ( ! file_exists( $dest_dir ) ) {
|
9 |
+
mkdir( $dest_dir, 0777, true );
|
10 |
+
}
|
11 |
+
if ( move_uploaded_file($file["tmp_name"], $dest_dir .'/'. $file["name"]) ) {
|
12 |
+
$flag = WDW_S_Library::wds_import_zip_action( $dest_dir, $file["name"] );
|
13 |
+
}
|
14 |
|
15 |
+
$message_id = 24;
|
16 |
+
if ( $flag ) {
|
17 |
+
$message_id = 23;
|
18 |
+
}
|
19 |
+
WDW_S_Library::spider_redirect( add_query_arg( array( 'page' => 'sliders_wds', 'message' => $message_id), admin_url('admin.php') ) );
|
20 |
}
|
21 |
|
22 |
function spider_demo_sliders() {
|
23 |
+
$error_ext_mess = '';
|
24 |
+
if( !function_exists( 'simplexml_load_string' ) ) {
|
25 |
+
$error_ext_mess = WDW_S_Library::message_id(0, __('Slider import will not work correctly, as PHP XML Extension is disabled on your website. Please contact your hosting provider and ask them to enable it. ', WDS()->prefix),'error');
|
26 |
+
}
|
27 |
+
if ( !class_exists('ZipArchive') ) {
|
28 |
+
$error_ext_mess .= WDW_S_Library::message_id(0, __('Slider import will not work correctly, as ZipArchive PHP extension is disabled on your website. Please contact your hosting provider and ask them to enable it. ', WDS()->prefix),'error');
|
29 |
+
}
|
30 |
+
|
31 |
$demo_sliders = array(
|
32 |
'presentation' => array(
|
33 |
'name' => __('Presentation', WDS()->prefix),
|
82 |
?>
|
83 |
<form method="post" enctype="multipart/form-data">
|
84 |
<div class="wd-group">
|
85 |
+
<input <?php echo ( WDS()->is_free || $error_ext_mess != '' ) ? 'disabled="disabled"' : ''; ?> type="file" name="fileimport" id="fileimport">
|
86 |
+
<input <?php echo ( WDS()->is_free || $error_ext_mess != '' ) ? 'disabled="disabled"' : ''; ?> type="submit" name="wds_import_submit" class="button button-primary" onclick="<?php echo(WDS()->is_free ? 'alert(\'' . addslashes(__('This functionality is disabled in free version.', WDS()->prefix)) . '\'); return false;' : 'if(!wds_getfileextension(document.getElementById(\'fileimport\').value)){ return false; }'); ?>" value="<?php _e('Import', WDS()->prefix); ?>">
|
87 |
<p class="description"><?php _e('Browse the .zip file of the slider.', WDS()->prefix); ?></p>
|
88 |
+
<?php
|
89 |
+
if ( $error_ext_mess != '' && !WDS()->is_free ) {
|
90 |
+
echo $error_ext_mess;
|
91 |
+
}
|
92 |
+
?>
|
93 |
</div>
|
94 |
</form>
|
95 |
</div>
|
framework/WDW_S_Library.php
CHANGED
@@ -2581,11 +2581,11 @@ class WDW_S_Library {
|
|
2581 |
}
|
2582 |
$data_slider_id = array();
|
2583 |
$dest_dir = ABSPATH . WDS()->upload_dir;
|
2584 |
-
$filename = basename(
|
2585 |
if ( ! file_exists( $dest_dir ) ) {
|
2586 |
mkdir( $dest_dir, 0777, true );
|
2587 |
}
|
2588 |
-
if(
|
2589 |
$data_slider_id = self::wds_import_zip_action( $dest_dir, $filename );
|
2590 |
}
|
2591 |
return $data_slider_id;
|
@@ -2762,7 +2762,7 @@ class WDW_S_Library {
|
|
2762 |
} else return $flag;
|
2763 |
}
|
2764 |
|
2765 |
-
public static function get_unique_file_name($filename, $foldername, $zip_name) {
|
2766 |
if (file_exists($foldername . $filename)) {
|
2767 |
$p = 1;
|
2768 |
$fileName1 = $zip_name;
|
@@ -2775,5 +2775,4 @@ class WDW_S_Library {
|
|
2775 |
}
|
2776 |
return $zip_name;
|
2777 |
}
|
2778 |
-
|
2779 |
}
|
2581 |
}
|
2582 |
$data_slider_id = array();
|
2583 |
$dest_dir = ABSPATH . WDS()->upload_dir;
|
2584 |
+
$filename = basename($zipfilepath);
|
2585 |
if ( ! file_exists( $dest_dir ) ) {
|
2586 |
mkdir( $dest_dir, 0777, true );
|
2587 |
}
|
2588 |
+
if(copy( $zipfilepath, $dest_dir.'/'.$filename )) {
|
2589 |
$data_slider_id = self::wds_import_zip_action( $dest_dir, $filename );
|
2590 |
}
|
2591 |
return $data_slider_id;
|
2762 |
} else return $flag;
|
2763 |
}
|
2764 |
|
2765 |
+
public static function get_unique_file_name( $filename, $foldername, $zip_name ) {
|
2766 |
if (file_exists($foldername . $filename)) {
|
2767 |
$p = 1;
|
2768 |
$fileName1 = $zip_name;
|
2775 |
}
|
2776 |
return $zip_name;
|
2777 |
}
|
|
|
2778 |
}
|
js/tw-gb/block.js
CHANGED
@@ -1,185 +1,200 @@
|
|
1 |
/**
|
2 |
* 10Web plugins Gutenberg integration
|
3 |
-
* version 2.0.
|
4 |
*/
|
5 |
( function ( blocks, element ) {
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
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 |
-
|
80 |
-
|
81 |
}
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
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 |
-
|
103 |
-
|
104 |
-
|
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 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
},
|
141 |
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
} )(
|
183 |
-
|
184 |
-
|
185 |
);
|
1 |
/**
|
2 |
* 10Web plugins Gutenberg integration
|
3 |
+
* version 2.0.3
|
4 |
*/
|
5 |
( function ( blocks, element ) {
|
6 |
+
registerAllPluginBlocks();
|
7 |
|
8 |
+
function registerAllPluginBlocks() {
|
9 |
+
var twPluginsData = JSON.parse(tw_obj_translate.blocks);
|
10 |
+
for ( var pluginId in window['tw_gb'] ) {
|
11 |
+
if ( !window['tw_gb'].hasOwnProperty( pluginId ) ) {
|
12 |
+
continue;
|
13 |
+
}
|
14 |
+
twPluginsData[pluginId] = window['tw_gb'][pluginId];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
+
if ( !twPluginsData ) {
|
17 |
+
return;
|
18 |
}
|
19 |
|
20 |
+
for ( var pluginId in twPluginsData ) {
|
21 |
+
if ( !twPluginsData.hasOwnProperty( pluginId ) ) {
|
22 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
if ( !twPluginsData[pluginId].inited ) {
|
26 |
+
twPluginsData[pluginId].inited = true;
|
27 |
+
registerPluginBlock( blocks, element, pluginId, twPluginsData[pluginId] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
+
}
|
31 |
|
32 |
+
function registerPluginBlock( blocks, element, pluginId, pluginData ) {
|
33 |
+
var el = element.createElement;
|
34 |
+
|
35 |
+
var isPopup = pluginData.isPopup;
|
36 |
+
|
37 |
+
var iconEl = el( 'img', {
|
38 |
+
width: pluginData.iconSvg.width,
|
39 |
+
height: pluginData.iconSvg.height,
|
40 |
+
src: pluginData.iconSvg.src
|
41 |
+
} );
|
42 |
+
|
43 |
+
blocks.registerBlockType( pluginId, {
|
44 |
+
title: pluginData.title,
|
45 |
+
icon: iconEl,
|
46 |
+
category: 'common',
|
47 |
+
attributes: {
|
48 |
+
shortcode: {
|
49 |
+
type: 'string'
|
50 |
+
},
|
51 |
+
popupOpened: {
|
52 |
+
type: 'boolean',
|
53 |
+
value: true
|
54 |
+
},
|
55 |
+
notInitial: {
|
56 |
+
type: 'boolean'
|
57 |
+
},
|
58 |
+
shortcode_id: {
|
59 |
+
type: 'string'
|
60 |
+
}
|
61 |
},
|
62 |
|
63 |
+
edit: function ( props ) {
|
64 |
+
if ( !props.attributes.notInitial ) {
|
65 |
+
props.setAttributes( {
|
66 |
+
notInitial: true,
|
67 |
+
popupOpened: true
|
68 |
+
} );
|
69 |
+
|
70 |
+
return el( 'p' );
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( props.attributes.popupOpened ) {
|
74 |
+
if ( isPopup ) {
|
75 |
+
return showPopup( props.attributes.shortcode, props.attributes.shortcode_id );
|
76 |
+
}
|
77 |
+
else {
|
78 |
+
return showShortcodeList( props.attributes.shortcode );
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
if ( props.attributes.shortcode ) {
|
83 |
+
return showShortcode();
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
return showShortcodePlaceholder();
|
87 |
+
}
|
88 |
+
|
89 |
+
function showPopup( shortcode, shortcode_id ) {
|
90 |
+
var shortcodeCbName = generateUniqueCbName( pluginId );
|
91 |
+
/* Store shortcode attribute into a global variable to get it from an iframe. */
|
92 |
+
window[shortcodeCbName + '_shortcode'] = shortcode ? shortcode : '';
|
93 |
+
window[shortcodeCbName] = function ( shortcode, shortcode_id ) {
|
94 |
+
delete window[shortcodeCbName];
|
95 |
+
|
96 |
+
if ( props ) {
|
97 |
+
props.setAttributes( { shortcode: shortcode, shortcode_id: shortcode_id, popupOpened: false } );
|
98 |
+
}
|
99 |
+
};
|
100 |
+
props.setAttributes( { popupOpened: true } );
|
101 |
+
if (!shortcode_id && undefined != shortcode) {
|
102 |
+
var shortcode_extract = shortcode.split(' ');
|
103 |
+
for (i = 0; i < shortcode_extract.length; i++) {
|
104 |
+
var attributes = shortcode_extract[i].split('=');
|
105 |
+
if ('id'== attributes[0]) {
|
106 |
+
shortcode_id = attributes[1].replace(/"/g, "");
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
var elem = el( 'form', { className: 'tw-container' }, el( 'div', { className: 'tw-container-wrap' + (pluginData.containerClass ? ' ' + pluginData.containerClass : '') }, el( 'span', {
|
111 |
+
className: "media-modal-close",
|
112 |
+
onClick: close
|
113 |
+
}, el( "span", { className: "media-modal-icon" } ) ), el( 'iframe', { src: pluginData.data.shortcodeUrl + '&callback=' + shortcodeCbName + '&edit=' + shortcode_id } ) ) );
|
114 |
+
return elem;
|
115 |
+
}
|
116 |
+
|
117 |
+
function showShortcodeList( shortcode ) {
|
118 |
+
props.setAttributes( { popupOpened: true } );
|
119 |
+
var children = [];
|
120 |
+
var shortcodeList = JSON.parse( pluginData.data );
|
121 |
+
shortcodeList.inputs.forEach( function ( inputItem ) {
|
122 |
+
if ( inputItem.type === 'select' ) {
|
123 |
+
children.push( el( 'option', { value: '', dataId: 0 }, tw_obj_translate.empty_item ) );
|
124 |
+
if ( inputItem.options.length ) {
|
125 |
+
inputItem.options.forEach( function ( optionItem ) {
|
126 |
+
var shortcode = '[' + shortcodeList.shortcode_prefix + ' ' + inputItem.shortcode_attibute_name + '="' + optionItem.id + '"]';
|
127 |
+
children.push(
|
128 |
+
el( 'option', { value: shortcode, dataId: optionItem.id }, optionItem.name )
|
129 |
+
);
|
130 |
+
} )
|
131 |
+
}
|
132 |
+
}
|
133 |
+
} );
|
134 |
+
|
135 |
+
if ( shortcodeList.shortcodes ) {
|
136 |
+
shortcodeList.shortcodes.forEach( function ( shortcodeItem ) {
|
137 |
+
children.push(
|
138 |
+
el( 'option', { value: shortcodeItem.shortcode, dataId: shortcodeItem.id }, shortcodeItem.name )
|
139 |
+
);
|
140 |
+
} );
|
141 |
+
}
|
142 |
+
|
143 |
+
return el( 'form', { onSubmit: chooseFromList }, el( 'div', {}, pluginData.titleSelect ), el( 'select', {
|
144 |
+
value: shortcode,
|
145 |
+
onChange: chooseFromList,
|
146 |
+
class: 'tw-gb-select'
|
147 |
+
}, children ) );
|
148 |
+
}
|
149 |
+
|
150 |
+
function showShortcodePlaceholder() {
|
151 |
+
props.setAttributes( { popupOpened: false } );
|
152 |
+
return el( 'p', {
|
153 |
+
style: {
|
154 |
+
'cursor': "pointer"
|
155 |
+
},
|
156 |
+
|
157 |
+
onClick: function () {
|
158 |
+
props.setAttributes( { popupOpened: true } );
|
159 |
+
}.bind( this )
|
160 |
+
}, tw_obj_translate.nothing_selected );
|
161 |
+
}
|
162 |
+
|
163 |
+
function showShortcode() {
|
164 |
+
return el( 'img', {
|
165 |
+
src: pluginData.iconUrl,
|
166 |
+
alt: pluginData.title,
|
167 |
+
style: {
|
168 |
+
'height': "36px",
|
169 |
+
'width': "36px"
|
170 |
+
},
|
171 |
+
onClick: function () {
|
172 |
+
props.setAttributes( { popupOpened: true } );
|
173 |
+
}.bind( this )
|
174 |
+
} );
|
175 |
+
}
|
176 |
+
|
177 |
+
function close() {
|
178 |
+
props.setAttributes( { popupOpened: false } );
|
179 |
+
}
|
180 |
+
|
181 |
+
function chooseFromList( event, shortcode_id ) {
|
182 |
+
var selected = event.target.querySelector( 'option:checked' );
|
183 |
+
props.setAttributes( { shortcode: selected.value, shortcode_id: selected.dataId, popupOpened: false } );
|
184 |
+
event.preventDefault();
|
185 |
+
}
|
186 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
+
save: function ( props ) {
|
189 |
+
return props.attributes.shortcode;
|
190 |
+
}
|
191 |
+
} );
|
192 |
+
}
|
193 |
|
194 |
+
function generateUniqueCbName( pluginId ) {
|
195 |
+
return 'wdg_cb_' + pluginId;
|
196 |
+
}
|
197 |
} )(
|
198 |
+
window.wp.blocks,
|
199 |
+
window.wp.element
|
200 |
);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: responsive slider, slider, slideshow, wordpress slider, image slider, gall
|
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -446,6 +446,11 @@ The plugin takes the full width of the widget area if the **Boxed Layout** in **
|
|
446 |
|
447 |
== Changelog ==
|
448 |
|
|
|
|
|
|
|
|
|
|
|
449 |
= 1.2.20 =
|
450 |
* Added: Message during import for PHP XML and ZipArchive PHP extensions.
|
451 |
* Added: The Separate section for 10Web Plugins in Elementor.
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 1.2.21
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
446 |
|
447 |
== Changelog ==
|
448 |
|
449 |
+
= 1.2.21 =
|
450 |
+
* Changed: PHP function shortcode check if function exists.
|
451 |
+
* Fixed: Do not print js before DOCTYPE.
|
452 |
+
* Fixed: Error when clicking allow or skip to collect some usage data more then once.
|
453 |
+
|
454 |
= 1.2.20 =
|
455 |
* Added: Message during import for PHP XML and ZipArchive PHP extensions.
|
456 |
* Added: The Separate section for 10Web Plugins in Elementor.
|
slider-wd.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/
|
5 |
* Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: 10Web
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -78,8 +78,8 @@ final class WDS {
|
|
78 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
79 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
80 |
$this->main_file = plugin_basename(__FILE__);
|
81 |
-
$this->plugin_version = '1.2.
|
82 |
-
$this->db_version = '1.2.
|
83 |
$this->prefix = 'wds';
|
84 |
$this->nicename = __('Slider', $this->prefix);
|
85 |
$this->use_home_url();
|
@@ -174,8 +174,9 @@ final class WDS {
|
|
174 |
}
|
175 |
add_action('plugins_loaded', array($this, 'plugins_loaded'), 9);
|
176 |
|
|
|
177 |
// Enqueue block editor assets for Gutenberg.
|
178 |
-
add_filter('tw_get_block_editor_assets', array($this, '
|
179 |
add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets') );
|
180 |
|
181 |
// Privacy policy.
|
@@ -185,10 +186,15 @@ final class WDS {
|
|
185 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widget'));
|
186 |
// Register 10Web category for Elementor widget if 10Web builder doesn't installed.
|
187 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
|
|
|
|
188 |
|
189 |
// Import slider from builder
|
190 |
add_filter('builder_import_slider', array('WDW_S_Library', 'twbb_wds_import'));
|
|
|
191 |
|
|
|
|
|
192 |
}
|
193 |
|
194 |
/**
|
@@ -1158,9 +1164,22 @@ final class WDS {
|
|
1158 |
|
1159 |
return $meta_fields;
|
1160 |
}
|
1161 |
-
|
1162 |
-
|
1163 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1164 |
$js_path = $this->plugin_url . '/js/tw-gb/block.js';
|
1165 |
$css_path = $this->plugin_url . '/css/tw-gb/block.css';
|
1166 |
if (!isset($assets['version']) || version_compare($assets['version'], $version) === -1) {
|
@@ -1175,31 +1194,6 @@ final class WDS {
|
|
1175 |
* Enqueue block editor assets.
|
1176 |
*/
|
1177 |
public function enqueue_block_editor_assets() {
|
1178 |
-
$key = 'tw/' . $this->prefix;
|
1179 |
-
$plugin_name = $this->nicename;
|
1180 |
-
$data = WDW_S_Library::get_shortcode_data();
|
1181 |
-
$icon_url = $this->plugin_url . '/images/wt-gb/wd_slider.svg';
|
1182 |
-
$icon_svg = $this->plugin_url . '/images/wt-gb/icon.svg';
|
1183 |
-
?>
|
1184 |
-
<script>
|
1185 |
-
if ( !window['tw_gb'] ) {
|
1186 |
-
window['tw_gb'] = {};
|
1187 |
-
}
|
1188 |
-
if ( !window['tw_gb']['<?php echo $key; ?>'] ) {
|
1189 |
-
window['tw_gb']['<?php echo $key; ?>'] = {
|
1190 |
-
title: '<?php echo $plugin_name; ?>',
|
1191 |
-
titleSelect: '<?php echo sprintf(__('Select %s', $this->prefix), $plugin_name); ?>',
|
1192 |
-
iconUrl: '<?php echo $icon_url; ?>',
|
1193 |
-
iconSvg: {
|
1194 |
-
width: '30',
|
1195 |
-
height: '30',
|
1196 |
-
src: '<?php echo $icon_svg; ?>'
|
1197 |
-
},
|
1198 |
-
data: '<?php echo $data; ?>',
|
1199 |
-
};
|
1200 |
-
}
|
1201 |
-
</script>
|
1202 |
-
<?php
|
1203 |
// Remove previously registered or enqueued versions
|
1204 |
$wp_scripts = wp_scripts();
|
1205 |
foreach ($wp_scripts->registered as $key => $value) {
|
@@ -1209,13 +1203,15 @@ final class WDS {
|
|
1209 |
wp_deregister_style( $key );
|
1210 |
}
|
1211 |
}
|
|
|
1212 |
// Get the last version from all 10Web plugins.
|
1213 |
$assets = apply_filters('tw_get_block_editor_assets', array());
|
1214 |
// Not performing unregister or unenqueue as in old versions all are with prefixes.
|
1215 |
wp_enqueue_script('tw-gb-block', $assets['js_path'], array( 'wp-blocks', 'wp-element' ), $assets['version']);
|
1216 |
-
wp_localize_script('tw-gb-block', '
|
1217 |
'nothing_selected' => __('Nothing selected.', $this->prefix),
|
1218 |
'empty_item' => __('- Select -', $this->prefix),
|
|
|
1219 |
));
|
1220 |
wp_enqueue_style('tw-gb-block', $assets['css_path'], array( 'wp-edit-blocks' ), $assets['version']);
|
1221 |
}
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/
|
5 |
* Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
|
6 |
+
* Version: 1.2.21
|
7 |
* Author: 10Web
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
78 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
79 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
80 |
$this->main_file = plugin_basename(__FILE__);
|
81 |
+
$this->plugin_version = '1.2.21';
|
82 |
+
$this->db_version = '1.2.21';
|
83 |
$this->prefix = 'wds';
|
84 |
$this->nicename = __('Slider', $this->prefix);
|
85 |
$this->use_home_url();
|
174 |
}
|
175 |
add_action('plugins_loaded', array($this, 'plugins_loaded'), 9);
|
176 |
|
177 |
+
add_filter('tw_get_plugin_blocks', array($this,'wds_register_plugin_block'));
|
178 |
// Enqueue block editor assets for Gutenberg.
|
179 |
+
add_filter('tw_get_block_editor_assets', array($this, 'wds_register_block_editor_assets'));
|
180 |
add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets') );
|
181 |
|
182 |
// Privacy policy.
|
186 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widget'));
|
187 |
// Register 10Web category for Elementor widget if 10Web builder doesn't installed.
|
188 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
189 |
+
//fires after elementor editor styles and scripts are enqueued.
|
190 |
+
add_action('elementor/editor/after_enqueue_styles', array($this, 'enqueue_editor_styles'), 11);
|
191 |
|
192 |
// Import slider from builder
|
193 |
add_filter('builder_import_slider', array('WDW_S_Library', 'twbb_wds_import'));
|
194 |
+
}
|
195 |
|
196 |
+
public function enqueue_editor_styles() {
|
197 |
+
wp_enqueue_style('twbb-editor-styles', $this->plugin_url . '/css/wds_elementor_icon/wds_elementor_icon.css', array(), '1.0.0');
|
198 |
}
|
199 |
|
200 |
/**
|
1164 |
|
1165 |
return $meta_fields;
|
1166 |
}
|
1167 |
+
public function wds_register_plugin_block($blocks) {
|
1168 |
+
$key = 'tw/' . $this->prefix;
|
1169 |
+
$plugin_name = $this->nicename;
|
1170 |
+
$data = WDW_S_Library::get_shortcode_data();
|
1171 |
+
$blocks[$key] = array(
|
1172 |
+
'title' => $plugin_name,
|
1173 |
+
'titleSelect' => sprintf(__('Select %s', $this->prefix), $plugin_name),
|
1174 |
+
'iconUrl' => $this->plugin_url . '/images/wt-gb/wd_slider.svg',
|
1175 |
+
'iconSvg' => array('width' => 20, 'height' => 20, 'src' => $this->plugin_url . '/images/wt-gb/icon.svg'),
|
1176 |
+
'isPopup' => false,
|
1177 |
+
'data' => $data,
|
1178 |
+
);
|
1179 |
+
return $blocks;
|
1180 |
+
}
|
1181 |
+
public function wds_register_block_editor_assets($assets) {
|
1182 |
+
$version = '2.0.3';
|
1183 |
$js_path = $this->plugin_url . '/js/tw-gb/block.js';
|
1184 |
$css_path = $this->plugin_url . '/css/tw-gb/block.css';
|
1185 |
if (!isset($assets['version']) || version_compare($assets['version'], $version) === -1) {
|
1194 |
* Enqueue block editor assets.
|
1195 |
*/
|
1196 |
public function enqueue_block_editor_assets() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1197 |
// Remove previously registered or enqueued versions
|
1198 |
$wp_scripts = wp_scripts();
|
1199 |
foreach ($wp_scripts->registered as $key => $value) {
|
1203 |
wp_deregister_style( $key );
|
1204 |
}
|
1205 |
}
|
1206 |
+
$blocks = apply_filters('tw_get_plugin_blocks', array());
|
1207 |
// Get the last version from all 10Web plugins.
|
1208 |
$assets = apply_filters('tw_get_block_editor_assets', array());
|
1209 |
// Not performing unregister or unenqueue as in old versions all are with prefixes.
|
1210 |
wp_enqueue_script('tw-gb-block', $assets['js_path'], array( 'wp-blocks', 'wp-element' ), $assets['version']);
|
1211 |
+
wp_localize_script('tw-gb-block', 'tw_obj_translate', array(
|
1212 |
'nothing_selected' => __('Nothing selected.', $this->prefix),
|
1213 |
'empty_item' => __('- Select -', $this->prefix),
|
1214 |
+
'blocks' => json_encode($blocks)
|
1215 |
));
|
1216 |
wp_enqueue_style('tw-gb-block', $assets['css_path'], array( 'wp-edit-blocks' ), $assets['version']);
|
1217 |
}
|
wd/assets/js/subsribe.js
CHANGED
@@ -1,37 +1,17 @@
|
|
1 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2 |
-
// Events //
|
3 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Constants //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Variables //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Constructor & Destructor //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
jQuery(document).on("ready", function () {
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
jQuery(
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
// Getters & Setters //
|
31 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
// Private Methods //
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
// Listeners //
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery(document).on("ready", function () {
|
2 |
+
jQuery(".permissions").on("click", function () {
|
3 |
+
jQuery(this).toggleClass("active");
|
4 |
+
jQuery(".list").slideToggle("fast");
|
5 |
+
return false;
|
6 |
+
});
|
7 |
+
jQuery(".allow_and_continue, .skip").on("click", function () {
|
8 |
+
var url = jQuery(this).attr("href");
|
9 |
+
if ( url ) {
|
10 |
+
jQuery(".allow_and_continue, .skip").css("opacity", "0.5");
|
11 |
+
jQuery(".allow_and_continue, .skip").attr("disabled", "disabled");
|
12 |
+
jQuery(".allow_and_continue, .skip").removeAttr("href");
|
13 |
+
jQuery(".wd_loader").css("display", "inline-block");
|
14 |
+
window.location = url;
|
15 |
+
}
|
16 |
+
});
|
17 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|