Version Description
- Fixed: Rapid movement of slider.
- Added: Gutenberg integration.
Download this release
Release Info
Developer | webdorado |
Plugin | Slider by WD – Responsive Slider |
Version | 1.2.9 |
Comparing to | |
See all releases |
Code changes from version 1.2.8 to 1.2.9
- admin/controllers/WDSControllerWDSShortcode.php +2 -25
- admin/models/WDSModelWDSShortcode.php +3 -27
- css/tw-gb/block.css +50 -0
- framework/WDW_S_Library.php +20 -0
- images/wt-gb/icon.svg +52 -0
- images/wt-gb/wd_slider.svg +32 -0
- js/tw-gb/block.js +185 -0
- js/wds_frontend.js +48 -43
- readme.txt +5 -1
- slider-wd.php +67 -3
admin/controllers/WDSControllerWDSShortcode.php
CHANGED
@@ -1,23 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
class WDSControllerWDSShortcode {
|
4 |
-
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
public function __construct() {
|
17 |
}
|
18 |
-
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
public function execute() {
|
22 |
$this->display();
|
23 |
}
|
@@ -30,14 +17,4 @@ class WDSControllerWDSShortcode {
|
|
30 |
$view = new WDSViewWDSShortcode($model);
|
31 |
$view->display();
|
32 |
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
<?php
|
2 |
|
3 |
class WDSControllerWDSShortcode {
|
4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function __construct() {
|
6 |
}
|
7 |
+
|
|
|
|
|
8 |
public function execute() {
|
9 |
$this->display();
|
10 |
}
|
17 |
$view = new WDSViewWDSShortcode($model);
|
18 |
$view->display();
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
admin/models/WDSModelWDSShortcode.php
CHANGED
@@ -1,37 +1,13 @@
|
|
1 |
<?php
|
2 |
|
3 |
class WDSModelWDSShortcode {
|
4 |
-
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
public function __construct() {
|
17 |
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
|
22 |
public function get_row_data() {
|
23 |
global $wpdb;
|
24 |
-
$
|
25 |
-
return $
|
26 |
}
|
27 |
-
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Getters & Setters //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
-
// Private Methods //
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Listeners //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
}
|
1 |
<?php
|
2 |
|
3 |
class WDSModelWDSShortcode {
|
4 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function __construct() {
|
6 |
}
|
|
|
|
|
|
|
7 |
|
8 |
public function get_row_data() {
|
9 |
global $wpdb;
|
10 |
+
$rows = $wpdb->get_results('SELECT `id`, `name` FROM `' . $wpdb->prefix . 'wdsslider` ORDER BY `name` ASC');
|
11 |
+
return $rows;
|
12 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
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_S_Library.php
CHANGED
@@ -2387,6 +2387,26 @@ class WDW_S_Library {
|
|
2387 |
$str = ucfirst($str);
|
2388 |
return $str;
|
2389 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2390 |
}
|
2391 |
|
2392 |
/*
|
2387 |
$str = ucfirst($str);
|
2388 |
return $str;
|
2389 |
}
|
2390 |
+
|
2391 |
+
/**
|
2392 |
+
* Get shortcode data.
|
2393 |
+
*
|
2394 |
+
* @return json $data
|
2395 |
+
*/
|
2396 |
+
public static function get_shortcode_data() {
|
2397 |
+
global $wpdb;
|
2398 |
+
$rows = $wpdb->get_results('SELECT `id`, `name` FROM `' . $wpdb->prefix . 'wdsslider` ORDER BY `name` ASC');
|
2399 |
+
$data = array();
|
2400 |
+
$data['shortcode_prefix'] = WDS()->prefix;
|
2401 |
+
$data['inputs'][] = array(
|
2402 |
+
'type' => 'select',
|
2403 |
+
'id' => WDS()->prefix . '_id',
|
2404 |
+
'name' => WDS()->prefix . '_id',
|
2405 |
+
'shortcode_attibute_name' => 'id',
|
2406 |
+
'options' => $rows,
|
2407 |
+
);
|
2408 |
+
return json_encode($data);
|
2409 |
+
}
|
2410 |
}
|
2411 |
|
2412 |
/*
|
images/wt-gb/icon.svg
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 21.0.2, 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 30 21.9" style="enable-background:new 0 0 30 21.9;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:none;}
|
7 |
+
.st1{opacity:0.8;fill:#555D66;enable-background:new ;}
|
8 |
+
.st2{opacity:0.5;fill:#555D66;enable-background:new ;}
|
9 |
+
.st3{opacity:0.5;fill:#2296BC;enable-background:new ;}
|
10 |
+
</style>
|
11 |
+
<polygon class="st0" points="-35.8,41.7 -33.9,49.4 -35.8,56.9 -30,49.2 "/>
|
12 |
+
<polygon class="st0" points="-35.8,41.6 -33.8,49.4 -35.8,56.9 -29.9,49.2 "/>
|
13 |
+
<g>
|
14 |
+
<polygon class="st0" points="28,9.4 28.3,11 28,12.5 29.1,10.9 "/>
|
15 |
+
<rect x="12.9" y="9.1" class="st0" width="0.4" height="3.3"/>
|
16 |
+
<path class="st0" d="M15.2,9.1h-1v3.3h0.9c0.6,0,1-0.1,1.3-0.4c0.3-0.3,0.4-0.7,0.5-1.3c0-0.5-0.1-0.9-0.4-1.2
|
17 |
+
C16.1,9.2,15.7,9.1,15.2,9.1z M16.1,11.7c-0.2,0.2-0.6,0.4-1.1,0.4h-0.5V9.4h0.6c0.4,0,0.8,0.1,1,0.3c0.2,0.2,0.3,0.6,0.3,1
|
18 |
+
C16.4,11.2,16.3,11.5,16.1,11.7z"/>
|
19 |
+
<polygon class="st0" points="10.8,9.1 10.4,9.1 10.4,12.4 12.3,12.4 12.3,12.4 12.3,12 10.8,12 "/>
|
20 |
+
<polygon class="st0" points="17.6,12.4 19.4,12.4 19.4,12.4 19.4,12.1 18,12.1 18,10.8 19.3,10.8 19.3,10.5 18,10.5 18,9.4
|
21 |
+
19.4,9.4 19.4,9.1 17.6,9.1 "/>
|
22 |
+
<polygon class="st0" points="2,9.6 0.9,11.1 2,12.6 0.9,11.1 "/>
|
23 |
+
<path class="st0" d="M8.8,10.5c-0.2-0.1-0.4-0.1-0.5-0.2c-0.1-0.1-0.2-0.1-0.2-0.2S8.1,10,8.1,9.8c0-0.2,0.1-0.3,0.2-0.4
|
24 |
+
c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.8,0.2l0.1-0.3C9.4,9,9.1,9,8.7,9C8.5,9,8.2,9.1,8,9.2C7.8,9.4,7.7,9.6,7.7,9.8
|
25 |
+
c0,0.2,0.1,0.4,0.2,0.6s0.3,0.3,0.7,0.4C8.8,10.9,8.9,11,9,11.1c0.1,0.1,0.2,0.1,0.2,0.2c0.1,0.1,0.1,0.2,0.1,0.3
|
26 |
+
c0,0.2-0.1,0.3-0.2,0.4c-0.1,0.1-0.3,0.2-0.6,0.2c-0.2,0-0.3,0-0.5-0.1c-0.2,0-0.3-0.1-0.5-0.1v0.4c0.2,0.1,0.5,0.2,0.9,0.2
|
27 |
+
c0.4,0,0.7-0.1,0.9-0.3c0.2-0.2,0.3-0.4,0.3-0.7c0-0.2-0.1-0.4-0.2-0.6C9.4,10.8,9.2,10.7,8.8,10.5z"/>
|
28 |
+
<polygon class="st0" points="28,9.4 28.4,11 28,12.5 29.1,10.9 "/>
|
29 |
+
<path class="st0" d="M21.6,10.9c0.4-0.2,0.7-0.4,0.7-0.9c0-0.3-0.1-0.5-0.3-0.7c-0.2-0.2-0.5-0.2-0.9-0.2h-0.9v3.3h0.4V11h0.7
|
30 |
+
l0.8,1.4h0.5L21.6,10.9z M21.1,10.7h-0.5V9.4h0.5c0.3,0,0.5,0.1,0.6,0.2c0.1,0.1,0.2,0.3,0.2,0.5s-0.1,0.4-0.2,0.5
|
31 |
+
C21.5,10.6,21.3,10.7,21.1,10.7z"/>
|
32 |
+
<polygon class="st0" points="2,9.6 0.9,11.1 2,12.6 1.6,11.1 "/>
|
33 |
+
<path class="st1" d="M21.9,10c0-0.2-0.1-0.4-0.2-0.5c-0.1-0.1-0.3-0.2-0.6-0.2h-0.5v1.3h0.5c0.3,0,0.5-0.1,0.6-0.2
|
34 |
+
C21.8,10.4,21.9,10.3,21.9,10z"/>
|
35 |
+
<path class="st1" d="M15.1,9.4h-0.6v2.7H15c0.5,0,0.8-0.1,1.1-0.4c0.2-0.2,0.4-0.5,0.4-1c0-0.4-0.1-0.8-0.3-1
|
36 |
+
C15.9,9.5,15.5,9.4,15.1,9.4z"/>
|
37 |
+
<path class="st1" d="M14.9,0.3C9,0.3,4.2,5.1,4.2,11S9,21.7,14.9,21.7S25.6,16.9,25.6,11S20.8,0.3,14.9,0.3z M9.4,12.2
|
38 |
+
c-0.2,0.2-0.5,0.3-0.9,0.3c-0.4,0-0.7-0.1-0.9-0.2v-0.4C7.8,12,7.9,12,8.1,12.1c0.2,0,0.3,0.1,0.5,0.1c0.3,0,0.5-0.1,0.6-0.2
|
39 |
+
c0.1-0.1,0.2-0.2,0.2-0.4c0-0.1,0-0.2-0.1-0.3S9.2,11.1,9,11.1c-0.1-0.1-0.3-0.1-0.5-0.2c-0.3-0.1-0.5-0.2-0.7-0.4
|
40 |
+
c-0.1-0.2-0.2-0.4-0.2-0.6c0-0.2,0.1-0.5,0.3-0.6C8.2,9.1,8.5,9,8.7,9C9.1,9,9.4,9,9.7,9.2L9.5,9.5C9.3,9.4,9,9.3,8.7,9.3
|
41 |
+
c-0.2,0-0.4,0-0.5,0.1C8.2,9.6,8.1,9.7,8.1,9.8c0,0.1,0,0.2,0.1,0.3c0,0.1,0.1,0.1,0.2,0.2c0.1,0.1,0.3,0.1,0.5,0.2
|
42 |
+
c0.4,0.1,0.6,0.3,0.7,0.4c0.1,0.2,0.2,0.4,0.2,0.6C9.7,11.8,9.6,12,9.4,12.2z M12.3,12.4L12.3,12.4h-1.9V9.1h0.4v3h1.5V12.4z
|
43 |
+
M13.3,12.4h-0.4V9.1h0.4V12.4z M16.4,12c-0.3,0.3-0.7,0.4-1.3,0.4h-0.9V9.1h1c0.5,0,0.9,0.1,1.2,0.4c0.3,0.3,0.4,0.7,0.4,1.2
|
44 |
+
C16.8,11.2,16.7,11.7,16.4,12z M19.4,9.4H18v1.1h1.4v0.3H18v1.2h1.5v0.3h0h-1.8V9.1h1.9V9.4z M22,12.4L21.3,11h-0.7v1.4h-0.4V9.1
|
45 |
+
h0.9c0.4,0,0.7,0.1,0.9,0.2c0.2,0.2,0.3,0.4,0.3,0.7c0,0.5-0.2,0.7-0.7,0.9l0.9,1.5C22.5,12.4,22,12.4,22,12.4z"/>
|
46 |
+
<path class="st2" d="M24.7,4.6c1.3,1.8,2,4,2,6.4s-0.7,4.6-2,6.4c3-0.6,5.3-3.2,5.3-6.4C30,7.8,27.7,5.2,24.7,4.6z M28,12.5
|
47 |
+
l0.4-1.5L28,9.4l1.2,1.5L28,12.5z"/>
|
48 |
+
<path class="st2" d="M5.3,4.6C2.3,5.2,0,7.8,0,11s2.3,5.8,5.3,6.4c-1.3-1.8-2-4-2-6.4c0-1.2,0.2-2.4,0.6-3.6
|
49 |
+
C4.3,6.1,4.9,5.2,5.3,4.6C5.3,4.6,5.3,4.6,5.3,4.6C5.3,4.6,5.3,4.6,5.3,4.6z M2,12.6l-1.2-1.5L2,9.6l-0.4,1.5L2,12.6z"/>
|
50 |
+
<polygon class="st3" points="1.6,11.1 2,12.6 1.7,11.1 2,9.6 "/>
|
51 |
+
</g>
|
52 |
+
</svg>
|
images/wt-gb/wd_slider.svg
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 21.0.2, 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 |
+
width="153.6px" height="110px" viewBox="0 0 153.6 110" style="enable-background:new 0 0 153.6 110;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{opacity:0.8;fill:#2296BC;enable-background:new ;}
|
7 |
+
.st1{opacity:0.5;fill:#2296BC;enable-background:new ;}
|
8 |
+
.st2{enable-background:new ;}
|
9 |
+
.st3{fill:#FFFFFF;}
|
10 |
+
</style>
|
11 |
+
<g>
|
12 |
+
<circle id="XMLID_7582_" class="st0" cx="76.2" cy="55" r="55"/>
|
13 |
+
<path class="st1" d="M126.5,22.1c6.5,9.3,10.3,20.7,10.3,32.9s-3.8,23.5-10.3,32.9c15.4-3,27.1-16.6,27.1-32.9
|
14 |
+
C153.6,38.6,142,25,126.5,22.1z M143.3,62.3l2-7.6l-2-7.9l6,7.7L143.3,62.3z"/>
|
15 |
+
<path class="st1" d="M27.1,87.8c-6.5-9.3-10.3-20.7-10.3-32.9S20.6,31.4,27.1,22C11.7,25,0,38.6,0,54.9S11.7,84.8,27.1,87.8z
|
16 |
+
M10.3,47.5l-2,7.6l2,7.9l-6-7.7L10.3,47.5z"/>
|
17 |
+
</g>
|
18 |
+
<g class="st2">
|
19 |
+
<path class="st3" d="M49.8,57.5c0,1.5-0.5,2.7-1.6,3.5s-2.6,1.3-4.5,1.3c-2,0-3.6-0.3-4.7-0.8v-1.9c0.7,0.3,1.5,0.5,2.3,0.7
|
20 |
+
s1.6,0.3,2.5,0.3c1.3,0,2.3-0.3,3-0.8s1-1.2,1-2.1c0-0.6-0.1-1.1-0.4-1.5s-0.6-0.7-1.2-1s-1.4-0.7-2.5-1.1c-1.6-0.6-2.7-1.2-3.4-2
|
21 |
+
s-1-1.8-1-3.1c0-1.3,0.5-2.4,1.5-3.2s2.3-1.2,3.9-1.2c1.7,0,3.3,0.3,4.7,0.9l-0.6,1.7c-1.4-0.6-2.8-0.9-4.1-0.9
|
22 |
+
c-1.1,0-1.9,0.2-2.5,0.7s-0.9,1.1-0.9,1.9c0,0.6,0.1,1.1,0.3,1.5s0.6,0.7,1.1,1s1.3,0.7,2.4,1c1.8,0.6,3,1.3,3.7,2.1
|
23 |
+
S49.8,56.3,49.8,57.5z"/>
|
24 |
+
<path class="st3" d="M53.3,62V44.9h2v15.3h7.6V62H53.3z"/>
|
25 |
+
<path class="st3" d="M65.8,62V44.9h2V62H65.8z"/>
|
26 |
+
<path class="st3" d="M86.2,53.3c0,2.8-0.8,5-2.3,6.5S80.1,62,77.2,62h-4.7V44.9h5.3c2.7,0,4.7,0.7,6.2,2.2S86.2,50.7,86.2,53.3z
|
27 |
+
M84,53.4c0-2.2-0.6-3.9-1.7-5.1s-2.8-1.7-5-1.7h-2.9v13.7h2.4c2.4,0,4.2-0.6,5.4-1.8S84,55.7,84,53.4z"/>
|
28 |
+
<path class="st3" d="M99.5,62H90V44.9h9.6v1.8H92v5.5h7.1v1.8H92v6.3h7.6V62z"/>
|
29 |
+
<path class="st3" d="M105.3,54.9V62h-2V44.9h4.7c2.1,0,3.7,0.4,4.7,1.2s1.5,2,1.5,3.6c0,2.3-1.1,3.8-3.4,4.6l4.7,7.7H113l-4.1-7.1
|
30 |
+
H105.3z M105.3,53.2h2.7c1.4,0,2.4-0.3,3.1-0.8s1-1.4,1-2.5c0-1.1-0.3-1.9-1-2.4s-1.7-0.8-3.2-0.8h-2.6V53.2z"/>
|
31 |
+
</g>
|
32 |
+
</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 |
+
);
|
js/wds_frontend.js
CHANGED
@@ -24,53 +24,28 @@ jQuery(document).ready(function () {
|
|
24 |
if (wds_params[wds].carousel == 1) {
|
25 |
wds_carousel_params(wds);
|
26 |
}
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
if (jQuery
|
32 |
-
if (
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
else if (wds_params[wds].timer_bar_type != 'none') {
|
39 |
-
wds_params[wds].circle_timer_animate.stop();
|
40 |
-
if (wds_params[wds].carousel) {
|
41 |
-
wds_carousel[wds].pause();
|
42 |
}
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
jQuery(window).focus(function () {
|
48 |
-
if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
|
49 |
-
if (wds_params[wds].enable_slideshow_autoplay) {
|
50 |
-
play_wds(wds);
|
51 |
-
if (wds_params[wds].carousel == 1) {
|
52 |
-
wds_carousel[wds].start();
|
53 |
-
}
|
54 |
-
if (wds_params[wds].timer_bar_type != 'none') {
|
55 |
-
if (wds_params[wds].timer_bar_type != 'top') {
|
56 |
-
if (wds_params[wds].timer_bar_type != 'bottom') {
|
57 |
-
if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
|
58 |
-
wds_params[wds].circle_timer_animate.stop();
|
59 |
-
}
|
60 |
-
wds_circle_timer(wds, wds_params[wds].curent_time_deggree);
|
61 |
}
|
62 |
}
|
63 |
}
|
64 |
}
|
65 |
-
}
|
66 |
-
|
67 |
-
var i_wds = 0;
|
68 |
-
jQuery(".wds_slider_" + wds).children("span").each(function () {
|
69 |
-
if (jQuery(this).css('opacity') == 1) {
|
70 |
-
jQuery("#wds_current_image_key_" + wds).val(i_wds);
|
71 |
-
}
|
72 |
-
i_wds++;
|
73 |
-
});
|
74 |
}
|
75 |
});
|
76 |
});
|
@@ -129,6 +104,37 @@ jQuery(window).on('load', function () {
|
|
129 |
})
|
130 |
});
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
function wds_carousel_params(wds) {
|
133 |
var width, height;
|
134 |
var slide_orig_width = wds_params[wds].image_width;
|
@@ -2324,7 +2330,6 @@ function wds_ready_func( wds ) {
|
|
2324 |
return false;
|
2325 |
});
|
2326 |
jQuery('#wds_container1_'+wds).swiperight(function () {
|
2327 |
-
|
2328 |
wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds( wds )) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
|
2329 |
if ( wds_params[wds].carousel == 1 ) {
|
2330 |
wds_carousel[wds].prev();
|
24 |
if (wds_params[wds].carousel == 1) {
|
25 |
wds_carousel_params(wds);
|
26 |
}
|
27 |
+
document.addEventListener("visibilitychange", function() {
|
28 |
+
if(document.visibilityState != 'visible') {
|
29 |
+
window.clearInterval(wds_params[wds].wds_playInterval);
|
30 |
+
wds_event_stack_wds = [];
|
31 |
+
if (typeof jQuery().stop !== 'undefined') {
|
32 |
+
if (jQuery.isFunction(jQuery().stop)) {
|
33 |
+
if (wds_params[wds].timer_bar_type == 'top' || wds_params[wds].timer_bar_type == 'bottom') {
|
34 |
+
jQuery(".wds_line_timer_" + wds).stop();
|
35 |
+
if (wds_params[wds].carousel) {
|
36 |
+
wds_carousel[wds].pause();
|
37 |
+
}
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
+
else if (wds_params[wds].timer_bar_type != 'none') {
|
40 |
+
wds_params[wds].circle_timer_animate.stop();
|
41 |
+
if (wds_params[wds].carousel) {
|
42 |
+
wds_carousel[wds].pause();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
}
|
45 |
}
|
46 |
}
|
47 |
+
} else {
|
48 |
+
wds_restart_slideshow_autoplay( wds );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
});
|
51 |
});
|
104 |
})
|
105 |
});
|
106 |
|
107 |
+
// restart slideshow
|
108 |
+
function wds_restart_slideshow_autoplay( wds ) {
|
109 |
+
if (!jQuery(".wds_ctrl_btn_" + wds).hasClass("fa-play")) {
|
110 |
+
if (wds_params[wds].enable_slideshow_autoplay) {
|
111 |
+
play_wds(wds);
|
112 |
+
if (wds_params[wds].carousel == 1) {
|
113 |
+
wds_carousel[wds].start();
|
114 |
+
}
|
115 |
+
if (wds_params[wds].timer_bar_type != 'none') {
|
116 |
+
if (wds_params[wds].timer_bar_type != 'top') {
|
117 |
+
if (wds_params[wds].timer_bar_type != 'bottom') {
|
118 |
+
if (typeof wds_params[wds].circle_timer_animate !== 'undefined') {
|
119 |
+
wds_params[wds].circle_timer_animate.stop();
|
120 |
+
}
|
121 |
+
wds_circle_timer(wds, wds_params[wds].curent_time_deggree);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
if (wds_params[wds].carousel != 1) {
|
128 |
+
var i_wds = 0;
|
129 |
+
jQuery(".wds_slider_" + wds).children("span").each(function () {
|
130 |
+
if (jQuery(this).css('opacity') == 1) {
|
131 |
+
jQuery("#wds_current_image_key_" + wds).val(i_wds);
|
132 |
+
}
|
133 |
+
i_wds++;
|
134 |
+
});
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
function wds_carousel_params(wds) {
|
139 |
var width, height;
|
140 |
var slide_orig_width = wds_params[wds].image_width;
|
2330 |
return false;
|
2331 |
});
|
2332 |
jQuery('#wds_container1_'+wds).swiperight(function () {
|
|
|
2333 |
wds_change_image(wds, parseInt(jQuery('#wds_current_image_key_'+wds).val()), (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds(wds)) >= 0 ? (parseInt(jQuery('#wds_current_image_key_'+wds).val()) - wds_iterator_wds( wds )) % wds_params[wds].wds_data.length : wds_params[wds].wds_data.length - 1, wds_params[wds].wds_data, false, "left");
|
2334 |
if ( wds_params[wds].carousel == 1 ) {
|
2335 |
wds_carousel[wds].prev();
|
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: 4.9
|
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 |
|
@@ -405,6 +405,10 @@ The good part of this is that you can have a text slider with its picture slide,
|
|
405 |
|
406 |
== Changelog ==
|
407 |
|
|
|
|
|
|
|
|
|
408 |
= 1.2.8 =
|
409 |
* Fixed: Layer effect in animation in some case.
|
410 |
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 1.2.9
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
405 |
|
406 |
== Changelog ==
|
407 |
|
408 |
+
= 1.2.9 =
|
409 |
+
* Fixed: Rapid movement of slider.
|
410 |
+
* Added: Gutenberg integration.
|
411 |
+
|
412 |
= 1.2.8 =
|
413 |
* Fixed: Layer effect in animation in some case.
|
414 |
|
slider-wd.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Slider WD
|
5 |
* Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
|
6 |
* 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.
|
7 |
-
* Version: 1.2.
|
8 |
* Author: WebDorado
|
9 |
* Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -79,8 +79,8 @@ final class WDS {
|
|
79 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
80 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
81 |
$this->main_file = plugin_basename(__FILE__);
|
82 |
-
$this->plugin_version = '1.2.
|
83 |
-
$this->db_version = '1.2.
|
84 |
$this->prefix = 'wds';
|
85 |
$this->nicename = __('Slider WD', $this->prefix);
|
86 |
$this->use_home_url();
|
@@ -173,6 +173,10 @@ final class WDS {
|
|
173 |
if ( $this->is_free) {
|
174 |
add_filter('plugin_row_meta', array($this, 'add_plugin_meta_links'), 10, 2);
|
175 |
}
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
|
178 |
/**
|
@@ -1220,6 +1224,66 @@ final class WDS {
|
|
1220 |
return $meta_fields;
|
1221 |
}
|
1222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1223 |
}
|
1224 |
|
1225 |
/**
|
4 |
* Plugin Name: Slider WD
|
5 |
* Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
|
6 |
* 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.
|
7 |
+
* Version: 1.2.9
|
8 |
* Author: WebDorado
|
9 |
* Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
79 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
80 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
81 |
$this->main_file = plugin_basename(__FILE__);
|
82 |
+
$this->plugin_version = '1.2.9';
|
83 |
+
$this->db_version = '1.2.9';
|
84 |
$this->prefix = 'wds';
|
85 |
$this->nicename = __('Slider WD', $this->prefix);
|
86 |
$this->use_home_url();
|
173 |
if ( $this->is_free) {
|
174 |
add_filter('plugin_row_meta', array($this, 'add_plugin_meta_links'), 10, 2);
|
175 |
}
|
176 |
+
|
177 |
+
// Enqueue block editor assets for Gutenberg.
|
178 |
+
add_filter('tw_get_block_editor_assets', array($this, 'register_block_editor_assets'));
|
179 |
+
add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets') );
|
180 |
}
|
181 |
|
182 |
/**
|
1224 |
return $meta_fields;
|
1225 |
}
|
1226 |
|
1227 |
+
public function register_block_editor_assets($assets) {
|
1228 |
+
$version = '2.0.0';
|
1229 |
+
$js_path = $this->plugin_url . '/js/tw-gb/block.js';
|
1230 |
+
$css_path = $this->plugin_url . '/css/tw-gb/block.css';
|
1231 |
+
if (!isset($assets['version']) || version_compare($assets['version'], $version) === -1) {
|
1232 |
+
$assets['version'] = $version;
|
1233 |
+
$assets['js_path'] = $js_path;
|
1234 |
+
$assets['css_path'] = $css_path;
|
1235 |
+
}
|
1236 |
+
return $assets;
|
1237 |
+
}
|
1238 |
+
|
1239 |
+
/**
|
1240 |
+
* Enqueue block editor assets.
|
1241 |
+
*/
|
1242 |
+
public function enqueue_block_editor_assets() {
|
1243 |
+
$key = 'tw/' . $this->prefix;
|
1244 |
+
$plugin_name = $this->nicename;
|
1245 |
+
$data = WDW_S_Library::get_shortcode_data();
|
1246 |
+
$icon_url = $this->plugin_url . '/images/wt-gb/wd_slider.svg';
|
1247 |
+
$icon_svg = $this->plugin_url . '/images/wt-gb/icon.svg';
|
1248 |
+
?>
|
1249 |
+
<script>
|
1250 |
+
if ( !window['tw_gb'] ) {
|
1251 |
+
window['tw_gb'] = {};
|
1252 |
+
}
|
1253 |
+
if ( !window['tw_gb']['<?php echo $key; ?>'] ) {
|
1254 |
+
window['tw_gb']['<?php echo $key; ?>'] = {
|
1255 |
+
title: '<?php echo $plugin_name; ?>',
|
1256 |
+
titleSelect: '<?php echo sprintf(__('Select %s', $this->prefix), $plugin_name); ?>',
|
1257 |
+
iconUrl: '<?php echo $icon_url; ?>',
|
1258 |
+
iconSvg: {
|
1259 |
+
width: '30',
|
1260 |
+
height: '30',
|
1261 |
+
src: '<?php echo $icon_svg; ?>'
|
1262 |
+
},
|
1263 |
+
data: '<?php echo $data; ?>',
|
1264 |
+
};
|
1265 |
+
}
|
1266 |
+
</script>
|
1267 |
+
<?php
|
1268 |
+
// Remove previously registered or enqueued versions
|
1269 |
+
$wp_scripts = wp_scripts();
|
1270 |
+
foreach ($wp_scripts->registered as $key => $value) {
|
1271 |
+
// Check for an older versions with prefix.
|
1272 |
+
if (strpos($key, 'tw-gb-block') > 0) {
|
1273 |
+
wp_deregister_script( $key );
|
1274 |
+
wp_deregister_style( $key );
|
1275 |
+
}
|
1276 |
+
}
|
1277 |
+
// Get the last version from all 10Web plugins.
|
1278 |
+
$assets = apply_filters('tw_get_block_editor_assets', array());
|
1279 |
+
// Not performing unregister or unenqueue as in old versions all are with prefixes.
|
1280 |
+
wp_enqueue_script('tw-gb-block', $assets['js_path'], array( 'wp-blocks', 'wp-element' ), $assets['version']);
|
1281 |
+
wp_localize_script('tw-gb-block', 'tw_obj', array(
|
1282 |
+
'nothing_selected' => __('Nothing selected.', $this->prefix),
|
1283 |
+
'empty_item' => __('- Select -', $this->prefix),
|
1284 |
+
));
|
1285 |
+
wp_enqueue_style('tw-gb-block', $assets['css_path'], array( 'wp-edit-blocks' ), $assets['version']);
|
1286 |
+
}
|
1287 |
}
|
1288 |
|
1289 |
/**
|