Carousel, Slider, Gallery by WP Carousel – Image Carousel & Photo Gallery, Post Carousel & Post Grid, Product Carousel & Product Grid for WooCommerce - Version 2.4.7

Version Description

May 21, 2022 = * Tested: WordPress 6.0 compatibility. * Fix: CSS warning if the margin-bottom of section title leaves empty. * Fix: Hide the Carousel Settings tab when the gallery layout is selected.

Download this release

Release Info

Developer shapedplugin
Plugin Icon 128x128 Carousel, Slider, Gallery by WP Carousel – Image Carousel & Photo Gallery, Post Carousel & Post Grid, Product Carousel & Product Grid for WooCommerce
Version 2.4.7
Comparing to
See all releases

Code changes from version 2.4.6 to 2.4.7

admin/ElementAddons/Wp_Carousel_Shortcode_Widget.php CHANGED
@@ -91,7 +91,7 @@ class Wp_Carousel_Shortcode_Widget extends \Elementor\Widget_Base {
91
  );
92
 
93
  $this->add_control(
94
- 'sp_wp_carousel_free_shortcode',
95
  array(
96
  'label' => __( 'WP Carousel Shortcode(s)', 'wp-carousel-free' ),
97
  'type' => \Elementor\Controls_Manager::SELECT2,
@@ -114,7 +114,7 @@ class Wp_Carousel_Shortcode_Widget extends \Elementor\Widget_Base {
114
  protected function render() {
115
 
116
  $settings = $this->get_settings_for_display();
117
- $sp_wp_carousel_shortcode = $settings['sp_wp_carousel_free_shortcode'];
118
 
119
  if ( '' === $sp_wp_carousel_shortcode ) {
120
  echo '<div style="text-align: center; margin-top: 0; padding: 10px" class="elementor-add-section-drag-title">Select a shortcode</div>';
91
  );
92
 
93
  $this->add_control(
94
+ 'sp_wp_carousel_pro_shortcode',
95
  array(
96
  'label' => __( 'WP Carousel Shortcode(s)', 'wp-carousel-free' ),
97
  'type' => \Elementor\Controls_Manager::SELECT2,
114
  protected function render() {
115
 
116
  $settings = $this->get_settings_for_display();
117
+ $sp_wp_carousel_shortcode = $settings['sp_wp_carousel_pro_shortcode'];
118
 
119
  if ( '' === $sp_wp_carousel_shortcode ) {
120
  echo '<div style="text-align: center; margin-top: 0; padding: 10px" class="elementor-add-section-drag-title">Select a shortcode</div>';
admin/GutenbergBlock/build/index.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-escape-html', 'wp-i18n'), 'version' => '2fc517e69f34a6ebfeaf');
admin/GutenbergBlock/build/index.js CHANGED
@@ -1,340 +1 @@
1
- /******/ (function() { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ "./src/shortcode/blockIcon.js":
6
- /*!************************************!*\
7
- !*** ./src/shortcode/blockIcon.js ***!
8
- \************************************/
9
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
-
11
- __webpack_require__.r(__webpack_exports__);
12
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/escape-html */ "@wordpress/escape-html");
13
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__);
14
-
15
- const el = wp.element.createElement;
16
- const icons = {};
17
- icons.spwpcfIcon = el('img', {
18
- src: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_0__.escapeAttribute)(sp_wp_carousel_free.url + 'admin/GutenbergBlock/src/wp-carousel-icon.svg')
19
- });
20
- /* harmony default export */ __webpack_exports__["default"] = (icons);
21
-
22
- /***/ }),
23
-
24
- /***/ "./src/shortcode/dynamicShortcode.js":
25
- /*!*******************************************!*\
26
- !*** ./src/shortcode/dynamicShortcode.js ***!
27
- \*******************************************/
28
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
29
-
30
- __webpack_require__.r(__webpack_exports__);
31
- /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
32
- /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
33
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/escape-html */ "@wordpress/escape-html");
34
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__);
35
-
36
-
37
- /**
38
- * Shortcode select component.
39
- */
40
-
41
- const {
42
- __
43
- } = wp.i18n;
44
- const {
45
- Fragment
46
- } = wp.element;
47
- const el = wp.element.createElement;
48
-
49
- const DynamicShortcodeInput = _ref => {
50
- let {
51
- attributes: {
52
- shortcode,
53
- shortcodelist
54
- },
55
- shortcodeUpdate
56
- } = _ref;
57
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, el('div', {
58
- className: 'spwpcf-gutenberg-shortcode editor-styles-wrapper'
59
- }, el('select', {
60
- className: 'spwpcf-shortcode-selector',
61
- onChange: e => shortcodeUpdate(e),
62
- value: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeAttribute)(shortcode)
63
- }, el('option', {
64
- value: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeAttribute)('0')
65
- }, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeHTML)(__('-- Select a shortcode --', 'wp-carousel-free'))), shortcodelist.map(shortcode => {
66
- var title = shortcode.title.length > 35 ? shortcode.title.substring(0, 30) + '.... #(' + shortcode.id + ')' : shortcode.title + ' #(' + shortcode.id + ')';
67
- return el('option', {
68
- value: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeAttribute)(shortcode.id.toString()),
69
- key: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeAttribute)(shortcode.id.toString())
70
- }, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_1__.escapeHTML)(title));
71
- }))));
72
- };
73
-
74
- /* harmony default export */ __webpack_exports__["default"] = (DynamicShortcodeInput);
75
-
76
- /***/ }),
77
-
78
- /***/ "@wordpress/block-editor":
79
- /*!*************************************!*\
80
- !*** external ["wp","blockEditor"] ***!
81
- \*************************************/
82
- /***/ (function(module) {
83
-
84
- module.exports = window["wp"]["blockEditor"];
85
-
86
- /***/ }),
87
-
88
- /***/ "@wordpress/element":
89
- /*!*********************************!*\
90
- !*** external ["wp","element"] ***!
91
- \*********************************/
92
- /***/ (function(module) {
93
-
94
- module.exports = window["wp"]["element"];
95
-
96
- /***/ }),
97
-
98
- /***/ "@wordpress/escape-html":
99
- /*!************************************!*\
100
- !*** external ["wp","escapeHtml"] ***!
101
- \************************************/
102
- /***/ (function(module) {
103
-
104
- module.exports = window["wp"]["escapeHtml"];
105
-
106
- /***/ })
107
-
108
- /******/ });
109
- /************************************************************************/
110
- /******/ // The module cache
111
- /******/ var __webpack_module_cache__ = {};
112
- /******/
113
- /******/ // The require function
114
- /******/ function __webpack_require__(moduleId) {
115
- /******/ // Check if module is in cache
116
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
117
- /******/ if (cachedModule !== undefined) {
118
- /******/ return cachedModule.exports;
119
- /******/ }
120
- /******/ // Create a new module (and put it into the cache)
121
- /******/ var module = __webpack_module_cache__[moduleId] = {
122
- /******/ // no module.id needed
123
- /******/ // no module.loaded needed
124
- /******/ exports: {}
125
- /******/ };
126
- /******/
127
- /******/ // Execute the module function
128
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
129
- /******/
130
- /******/ // Return the exports of the module
131
- /******/ return module.exports;
132
- /******/ }
133
- /******/
134
- /************************************************************************/
135
- /******/ /* webpack/runtime/compat get default export */
136
- /******/ !function() {
137
- /******/ // getDefaultExport function for compatibility with non-harmony modules
138
- /******/ __webpack_require__.n = function(module) {
139
- /******/ var getter = module && module.__esModule ?
140
- /******/ function() { return module['default']; } :
141
- /******/ function() { return module; };
142
- /******/ __webpack_require__.d(getter, { a: getter });
143
- /******/ return getter;
144
- /******/ };
145
- /******/ }();
146
- /******/
147
- /******/ /* webpack/runtime/define property getters */
148
- /******/ !function() {
149
- /******/ // define getter functions for harmony exports
150
- /******/ __webpack_require__.d = function(exports, definition) {
151
- /******/ for(var key in definition) {
152
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
153
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
154
- /******/ }
155
- /******/ }
156
- /******/ };
157
- /******/ }();
158
- /******/
159
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
160
- /******/ !function() {
161
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
162
- /******/ }();
163
- /******/
164
- /******/ /* webpack/runtime/make namespace object */
165
- /******/ !function() {
166
- /******/ // define __esModule on exports
167
- /******/ __webpack_require__.r = function(exports) {
168
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
169
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
170
- /******/ }
171
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
172
- /******/ };
173
- /******/ }();
174
- /******/
175
- /************************************************************************/
176
- var __webpack_exports__ = {};
177
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
178
- !function() {
179
- /*!**********************!*\
180
- !*** ./src/index.js ***!
181
- \**********************/
182
- __webpack_require__.r(__webpack_exports__);
183
- /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
184
- /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
185
- /* harmony import */ var _shortcode_blockIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shortcode/blockIcon */ "./src/shortcode/blockIcon.js");
186
- /* harmony import */ var _shortcode_dynamicShortcode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shortcode/dynamicShortcode */ "./src/shortcode/dynamicShortcode.js");
187
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/escape-html */ "@wordpress/escape-html");
188
- /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__);
189
- /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
190
- /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__);
191
-
192
-
193
-
194
-
195
-
196
- const {
197
- __
198
- } = wp.i18n;
199
- const {
200
- registerBlockType
201
- } = wp.blocks;
202
- const {
203
- PanelBody,
204
- PanelRow
205
- } = wp.components;
206
- const {
207
- Fragment
208
- } = wp.element;
209
- const ServerSideRender = wp.serverSideRender;
210
- const el = wp.element.createElement;
211
- /**
212
- * Register: aa Gutenberg Block.
213
- */
214
-
215
- registerBlockType("sp-wp-carousel-free/shortcode", {
216
- title: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("WP Carousel", "wp-carousel-free")),
217
- description: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("Use WP Carousel to insert a carousel or gallery in your page.", "wp-carousel-free")),
218
- icon: _shortcode_blockIcon__WEBPACK_IMPORTED_MODULE_1__["default"].spwpcfIcon,
219
- category: "common",
220
- supports: {
221
- html: true
222
- },
223
- edit: props => {
224
- const {
225
- attributes,
226
- setAttributes
227
- } = props;
228
-
229
- let scriptLoad = shortcodeId => {
230
- let spwpcfBlockLoaded = false;
231
- let spwpcfBlockLoadedInterval = setInterval(function () {
232
- let uniqId = jQuery(".wpcp-wrapper-" + shortcodeId).parents().attr('id');
233
-
234
- if (document.getElementById(uniqId)) {
235
- //Actual functions goes here
236
- jQuery.getScript(sp_wp_carousel_free.loadScript);
237
- jQuery('#wpcp-preloader-' + shortcodeId).animate({
238
- opacity: 0
239
- }, 600).remove();
240
- jQuery('#sp-wp-carousel-free-id-' + shortcodeId).animate({
241
- opacity: 1
242
- }, 600);
243
- spwpcfBlockLoaded = true;
244
- uniqId = '';
245
- }
246
-
247
- if (spwpcfBlockLoaded) {
248
- clearInterval(spwpcfBlockLoadedInterval);
249
- }
250
-
251
- if (0 == shortcodeId) {
252
- clearInterval(spwpcfBlockLoadedInterval);
253
- }
254
- }, 10);
255
- };
256
-
257
- let updateShortcode = updateShortcode => {
258
- setAttributes({
259
- shortcode: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(updateShortcode.target.value)
260
- });
261
- };
262
-
263
- let shortcodeUpdate = e => {
264
- updateShortcode(e);
265
- let shortcodeId = (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(e.target.value);
266
- scriptLoad(shortcodeId);
267
- };
268
-
269
- document.addEventListener('readystatechange', event => {
270
- if (event.target.readyState === "complete") {
271
- let shortcodeId = (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(attributes.shortcode);
272
- scriptLoad(shortcodeId);
273
- }
274
- });
275
-
276
- if (attributes.preview) {
277
- return el('div', {
278
- className: 'spwpcf_shortcode_block_preview_image'
279
- }, el('img', {
280
- src: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(sp_wp_carousel_free.url + "admin/GutenbergBlock/src/wpc-block-preview.svg")
281
- }));
282
- }
283
-
284
- if (attributes.shortcodelist.length === 0) {
285
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, el('div', {
286
- className: 'components-placeholder components-placeholder is-large'
287
- }, el('div', {
288
- className: 'components-placeholder__label'
289
- }, el('img', {
290
- className: 'block-editor-block-icon',
291
- src: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(sp_wp_carousel_free.url + 'admin/GutenbergBlock/src/wp-carousel-icon.svg')
292
- }), (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("WP Carousel", "wp-carousel-free"))), el('div', {
293
- className: 'components-placeholder__instructions'
294
- }, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("No shortcode found. ", "wp-carousel-free")), el('a', {
295
- href: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(sp_wp_carousel_free.link)
296
- }, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("Create a shortcode now!", "wp-carousel-free"))))));
297
- }
298
-
299
- if (!attributes.shortcode || attributes.shortcode == 0) {
300
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, {
301
- title: "Select a shortcode"
302
- }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_shortcode_dynamicShortcode__WEBPACK_IMPORTED_MODULE_2__["default"], {
303
- attributes: attributes,
304
- shortcodeUpdate: shortcodeUpdate
305
- })))), el('div', {
306
- className: 'components-placeholder components-placeholder is-large'
307
- }, el('div', {
308
- className: 'components-placeholder__label'
309
- }, el('img', {
310
- className: 'block-editor-block-icon',
311
- src: (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeAttribute)(sp_wp_carousel_free.url + "admin/GutenbergBlock/src/wp-carousel-icon.svg")
312
- }), (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("WP Carousel", "wp-carousel-free"))), el('div', {
313
- className: 'components-placeholder__instructions'
314
- }, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_3__.escapeHTML)(__("Select a shortcode", "wp-carousel-free"))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_shortcode_dynamicShortcode__WEBPACK_IMPORTED_MODULE_2__["default"], {
315
- attributes: attributes,
316
- shortcodeUpdate: shortcodeUpdate
317
- })));
318
- }
319
-
320
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_4__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelBody, {
321
- title: "Select a shortcode"
322
- }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_shortcode_dynamicShortcode__WEBPACK_IMPORTED_MODULE_2__["default"], {
323
- attributes: attributes,
324
- shortcodeUpdate: shortcodeUpdate
325
- })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(ServerSideRender, {
326
- block: "sp-wp-carousel-free/shortcode",
327
- attributes: attributes
328
- }));
329
- },
330
-
331
- save() {
332
- // Rendering in PHP
333
- return null;
334
- }
335
-
336
- });
337
- }();
338
- /******/ })()
339
- ;
340
- //# sourceMappingURL=index.js.map
1
+ !function(){"use strict";var e=window.wp.escapeHtml;const t=wp.element.createElement,r={};r.spwpcfIcon=t("img",{src:(0,e.escapeAttribute)(sp_wp_carousel_free.url+"admin/GutenbergBlock/src/wp-carousel-icon.svg")});var o=r,s=window.wp.i18n,c=window.wp.element;const a=c.createElement;var l=t=>{let{attributes:{shortcode:r},shortCodeList:o,shortcodeUpdate:l}=t;return(0,c.createElement)(c.Fragment,null,a("div",{className:"spwpcf-gutenberg-shortcode editor-styles-wrapper"},a("select",{className:"spwpcf-shortcode-selector",onChange:e=>l(e),value:(0,e.escapeAttribute)(r)},a("option",{value:(0,e.escapeAttribute)("0")},(0,e.escapeHTML)((0,s.__)("-- Select a shortcode --","wp-carousel-free"))),o.map((t=>{var r=t.title.length>35?t.title.substring(0,30)+".... #("+t.id+")":t.title+" #("+t.id+")";return a("option",{value:(0,e.escapeAttribute)(t.id.toString()),key:(0,e.escapeAttribute)(t.id.toString())},(0,e.escapeHTML)(r))})))))},n=window.wp.blocks,p=window.wp.components,i=window.wp.blockEditor;const u=wp.serverSideRender,d=c.createElement;(0,n.registerBlockType)("sp-wp-carousel-pro/shortcode",{title:(0,e.escapeHTML)((0,s.__)("WP Carousel","wp-carousel-free")),description:(0,e.escapeHTML)((0,s.__)("Use WP Carousel to insert a carousel or gallery in your page.","wp-carousel-free")),icon:o.spwpcfIcon,category:"common",supports:{html:!0},edit:t=>{const{attributes:r,setAttributes:o}=t;var a=sp_wp_carousel_free.shortCodeList;let n=e=>{let t=!1,r=setInterval((function(){let o=jQuery(".wpcp-wrapper-"+e).parents().attr("id");document.getElementById(o)&&(jQuery.getScript(sp_wp_carousel_free.loadScript),jQuery("#wpcp-preloader-"+e).animate({opacity:0},600).remove(),jQuery("#sp-wp-carousel-free-id-"+e).animate({opacity:1},600),t=!0,o=""),t&&clearInterval(r),0==e&&clearInterval(r)}),10)},m=t=>{var r;r=t,o({shortcode:(0,e.escapeAttribute)(r.target.value)});let s=(0,e.escapeAttribute)(t.target.value);n(s)};return document.addEventListener("readystatechange",(t=>{if("complete"===t.target.readyState){let t=(0,e.escapeAttribute)(r.shortcode);n(t)}})),r.preview?d("div",{className:"spwpcf_shortcode_block_preview_image"},d("img",{src:(0,e.escapeAttribute)(sp_wp_carousel_free.url+"admin/GutenbergBlock/src/wpc-block-preview.svg")})):0===a.length?(0,c.createElement)(c.Fragment,null,d("div",{className:"components-placeholder components-placeholder is-large"},d("div",{className:"components-placeholder__label"},d("img",{className:"block-editor-block-icon",src:(0,e.escapeAttribute)(sp_wp_carousel_free.url+"admin/GutenbergBlock/src/wp-carousel-icon.svg")}),(0,e.escapeHTML)((0,s.__)("WP Carousel","wp-carousel-free"))),d("div",{className:"components-placeholder__instructions"},(0,e.escapeHTML)((0,s.__)("No shortcode found. ","wp-carousel-free")),d("a",{href:(0,e.escapeAttribute)(sp_wp_carousel_free.link)},(0,e.escapeHTML)((0,s.__)("Create a shortcode now!","wp-carousel-free")))))):r.shortcode&&0!=r.shortcode?(0,c.createElement)(c.Fragment,null,(0,c.createElement)(i.InspectorControls,null,(0,c.createElement)(p.PanelBody,{title:"Select a shortcode"},(0,c.createElement)(p.PanelRow,null,(0,c.createElement)(l,{attributes:r,shortCodeList:a,shortcodeUpdate:m})))),(0,c.createElement)(u,{block:"sp-wp-carousel-pro/shortcode",attributes:r})):(0,c.createElement)(c.Fragment,null,(0,c.createElement)(i.InspectorControls,null,(0,c.createElement)(p.PanelBody,{title:"Select a shortcode"},(0,c.createElement)(p.PanelRow,null,(0,c.createElement)(l,{attributes:r,shortCodeList:a,shortcodeUpdate:m})))),d("div",{className:"components-placeholder components-placeholder is-large"},d("div",{className:"components-placeholder__label"},d("img",{className:"block-editor-block-icon",src:(0,e.escapeAttribute)(sp_wp_carousel_free.url+"admin/GutenbergBlock/src/wp-carousel-icon.svg")}),(0,e.escapeHTML)((0,s.__)("WP Carousel","wp-carousel-free"))),d("div",{className:"components-placeholder__instructions"},(0,e.escapeHTML)((0,s.__)("Select a shortcode","wp-carousel-free"))),(0,c.createElement)(l,{attributes:r,shortCodeList:a,shortcodeUpdate:m})))},save:()=>null})}();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/GutenbergBlock/class-wp-carousel-free-gutenberg-block-init.php CHANGED
@@ -45,7 +45,7 @@ if ( ! class_exists( 'WP_Carousel_Free_Gutenberg_Block_Init' ) ) {
45
  wp_enqueue_script(
46
  'sp-wp-carousel-free-shortcode-block',
47
  plugins_url( '/GutenbergBlock/build/index.js', dirname( __FILE__ ) ),
48
- array( 'jquery', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components' ),
49
  WPCAROUSELF_VERSION,
50
  true
51
  );
@@ -105,21 +105,22 @@ if ( ! class_exists( 'WP_Carousel_Free_Gutenberg_Block_Init' ) ) {
105
  'wpcf-slick-config',
106
  'sp_wp_carousel_free',
107
  array(
108
- 'url' => WPCAROUSELF_URL,
109
- 'loadScript' => WPCAROUSELF_URL . 'public/js/wp-carousel-free-public.min.js',
110
- 'link' => admin_url( 'post-new.php?post_type=sp_wp_carousel' ),
 
111
  )
112
  );
113
  /**
114
  * Register Gutenberg block on server-side.
115
  */
116
  register_block_type(
117
- 'sp-wp-carousel-free/shortcode',
118
  array(
119
  'attributes' => array(
120
  'shortcodelist' => array(
121
  'type' => 'object',
122
- 'default' => $this->sp_wp_carousel_free_post_list(),
123
  ),
124
  'shortcode' => array(
125
  'type' => 'string',
45
  wp_enqueue_script(
46
  'sp-wp-carousel-free-shortcode-block',
47
  plugins_url( '/GutenbergBlock/build/index.js', dirname( __FILE__ ) ),
48
+ array( 'jquery' ),
49
  WPCAROUSELF_VERSION,
50
  true
51
  );
105
  'wpcf-slick-config',
106
  'sp_wp_carousel_free',
107
  array(
108
+ 'url' => WPCAROUSELF_URL,
109
+ 'loadScript' => WPCAROUSELF_URL . 'public/js/wp-carousel-free-public.min.js',
110
+ 'link' => admin_url( 'post-new.php?post_type=sp_wp_carousel' ),
111
+ 'shortCodeList' => $this->sp_wp_carousel_free_post_list(),
112
  )
113
  );
114
  /**
115
  * Register Gutenberg block on server-side.
116
  */
117
  register_block_type(
118
+ 'sp-wp-carousel-pro/shortcode',
119
  array(
120
  'attributes' => array(
121
  'shortcodelist' => array(
122
  'type' => 'object',
123
+ 'default' => '',
124
  ),
125
  'shortcode' => array(
126
  'type' => 'string',
admin/views/sp-framework/assets/js/main.js CHANGED
@@ -2318,7 +2318,7 @@
2318
  }, 0);
2319
  }, 2000);
2320
  });
2321
- $('.wpcp_post_pagination_type label:contains("Pro")').css({'pointer-events': 'none', 'color' : 'rgba(85,85,85,.6)!important'});
2322
 
2323
  // WP Carousel export.
2324
  var $export_type = $('.wpcp_what_export').find('input:checked').val();
@@ -2402,100 +2402,100 @@
2402
  }, 3000);
2403
  }
2404
  });
2405
- // hide carousel box
2406
- if($('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val() =='gallery'){
2407
- $(".wpcf-nav-metabox li:nth-child(3)").hide();
2408
- }else{
2409
- $(".wpcf-nav-metabox li:nth-child(3)").show();
2410
- }
2411
- $('.wpcf-field-image_select.wpcp_layout').on('change', function() {
2412
- if($('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val() == 'gallery' ){
2413
- $(".wpcf-nav-metabox li:nth-child(3)").hide();
2414
- }else{
2415
- $(".wpcf-nav-metabox li:nth-child(3)").show();
2416
- }
2417
- });
2418
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2419
  });
2420
- $(document).on('keyup change', '.sp_wp_carousel_page_wpcp_settings #wpcf-form', function (e) {
2421
  e.preventDefault();
2422
  var $button = $(this).find('.wpcf-save');
2423
- $button.css({"background-color": "#00C263", "pointer-events": "initial"}).val('Save Settings');
2424
  });
2425
- $('.sp_wp_carousel_page_wpcp_settings .wpcf-save').click(function(e) {
2426
  e.preventDefault();
2427
- $(this).css({"background-color": "#C5C5C6","pointer-events": "none"}).val('Changes Saved');
2428
- })
2429
 
2430
- $(document).on('keyup change', '.sp_wp_carousel_page_wpcp_settings #wpcf-form', function (e) {
2431
  e.preventDefault();
2432
  var $button = $(this).find('.wpcf-save');
2433
- $button.css({"background-color": "#00C263", "pointer-events": "initial"}).val('Save Settings');
2434
  });
2435
- $('.sp_wp_carousel_page_wpcp_settings .wpcf-save').click(function(e) {
2436
  e.preventDefault();
2437
- $(this).css({"background-color": "#C5C5C6","pointer-events": "none"}).val('Changes Saved');
2438
- })
2439
-
2440
- // Live Preview script for Wp-Carousel-free.
2441
- var preview_box = $('#sp-wpcf-preview-box');
2442
- var preview_display = $('#sp_wpcf_live_preview').hide();
2443
- $(document).on('click', '#sp__wpcf-show-preview:contains(Hide)', function (e) {
2444
- e.preventDefault();
2445
- var _this = $(this);
2446
- _this.html('<i class="fa fa-eye" aria-hidden="true"></i> Show Preview');
2447
- preview_box.html('');
2448
- preview_display.hide();
2449
- });
2450
- $(document).on('click', '#sp__wpcf-show-preview:not(:contains(Hide))', function (e) {
2451
- e.preventDefault();
2452
- var previewJS = wpcf_vars.previewJS;
2453
- var _data = $('form#post').serialize();
2454
- var _this = $(this);
2455
- var data = {
2456
- action: 'sp_wpcf_preview_meta_box',
2457
- data: _data,
2458
- ajax_nonce: $('#wpcf_metabox_noncesp_wpcf_live_preview').val()
2459
- };
2460
- $.ajax({
2461
- type: "POST",
2462
- url: ajaxurl,
2463
- data: data,
2464
- error: function (response) {
2465
- console.log(response)
2466
- },
2467
- success: function (response) {
2468
- preview_display.show();
2469
- preview_box.html(response);
2470
- $.getScript(previewJS, function () {
2471
- _this.html('<i class="fa fa-eye-slash" aria-hidden="true"></i> Hide Preview');
2472
- $(document).on('keyup change', '.post-type-sp_wp_carousel', function (e) {
2473
- e.preventDefault();
2474
- _this.html('<i class="fa fa-refresh" aria-hidden="true"></i> Update Preview');
2475
- });
2476
- $("html, body").animate({ scrollTop: preview_display.offset().top - 50 }, "slow");
2477
- });
2478
- $('.wpcp-carousel-preloader').animate({ opacity: 1 }, 600).hide();
2479
- var carousel_id = $('.wpcp-carousel-section.wpcp-preloader').attr('id');
2480
- $('#' + carousel_id).animate({ opacity: 1 }, 600);
2481
- $('.wpcpro-post-pagination-number').click(function (e) {
2482
- e.preventDefault();
2483
- e.stopPropagation();
2484
- $('.spwpc-pagination-not-work').animate({
2485
- opacity: 1,
2486
- bottom: 25
2487
- }, 300);
2488
- setTimeout(function () {
2489
- jQuery(".spwpc-pagination-not-work").animate({
2490
- opacity: 0,
2491
- }, 200);
2492
- jQuery(".spwpc-pagination-not-work").animate({
2493
- bottom: 0
2494
- }, 0);
2495
- }, 3000);
2496
- });
2497
- }
2498
  })
2499
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2500
 
2501
  })(jQuery, window, document);
2318
  }, 0);
2319
  }, 2000);
2320
  });
2321
+ $('.wpcp_post_pagination_type label:contains("Pro")').css({ 'pointer-events': 'none', 'color': 'rgba(85,85,85,.6)!important' });
2322
 
2323
  // WP Carousel export.
2324
  var $export_type = $('.wpcp_what_export').find('input:checked').val();
2402
  }, 3000);
2403
  }
2404
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
2405
 
2406
+ // hide Carousel Settings when grid layout will be selected.
2407
+ if ($('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val() == 'gallery') {
2408
+ $(".wpcf-nav-metabox li:nth-child(4)").hide();
2409
+ } else {
2410
+ $(".wpcf-nav-metabox li:nth-child(4)").show();
2411
+ }
2412
+ $('.wpcf-field-image_select.wpcp_layout').on('change', function () {
2413
+ if ($('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val() == 'gallery') {
2414
+ $(".wpcf-nav-metabox li:nth-child(4)").hide();
2415
+ } else {
2416
+ $(".wpcf-nav-metabox li:nth-child(4)").show();
2417
+ }
2418
+ });
2419
  });
2420
+ $(document).on('keyup change', '.sp_wp_carousel_page_wpcp_settings #wpcf-form', function (e) {
2421
  e.preventDefault();
2422
  var $button = $(this).find('.wpcf-save');
2423
+ $button.css({ "background-color": "#00C263", "pointer-events": "initial" }).val('Save Settings');
2424
  });
2425
+ $('.sp_wp_carousel_page_wpcp_settings .wpcf-save').click(function (e) {
2426
  e.preventDefault();
2427
+ $(this).css({ "background-color": "#C5C5C6", "pointer-events": "none" }).val('Changes Saved');
2428
+ })
2429
 
2430
+ $(document).on('keyup change', '.sp_wp_carousel_page_wpcp_settings #wpcf-form', function (e) {
2431
  e.preventDefault();
2432
  var $button = $(this).find('.wpcf-save');
2433
+ $button.css({ "background-color": "#00C263", "pointer-events": "initial" }).val('Save Settings');
2434
  });
2435
+ $('.sp_wp_carousel_page_wpcp_settings .wpcf-save').click(function (e) {
2436
  e.preventDefault();
2437
+ $(this).css({ "background-color": "#C5C5C6", "pointer-events": "none" }).val('Changes Saved');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2438
  })
2439
+
2440
+ // Live Preview script for Wp-Carousel-free.
2441
+ var preview_box = $('#sp-wpcf-preview-box');
2442
+ var preview_display = $('#sp_wpcf_live_preview').hide();
2443
+ $(document).on('click', '#sp__wpcf-show-preview:contains(Hide)', function (e) {
2444
+ e.preventDefault();
2445
+ var _this = $(this);
2446
+ _this.html('<i class="fa fa-eye" aria-hidden="true"></i> Show Preview');
2447
+ preview_box.html('');
2448
+ preview_display.hide();
2449
+ });
2450
+ $(document).on('click', '#sp__wpcf-show-preview:not(:contains(Hide))', function (e) {
2451
+ e.preventDefault();
2452
+ var previewJS = wpcf_vars.previewJS;
2453
+ var _data = $('form#post').serialize();
2454
+ var _this = $(this);
2455
+ var data = {
2456
+ action: 'sp_wpcf_preview_meta_box',
2457
+ data: _data,
2458
+ ajax_nonce: $('#wpcf_metabox_noncesp_wpcf_live_preview').val()
2459
+ };
2460
+ $.ajax({
2461
+ type: "POST",
2462
+ url: ajaxurl,
2463
+ data: data,
2464
+ error: function (response) {
2465
+ console.log(response)
2466
+ },
2467
+ success: function (response) {
2468
+ preview_display.show();
2469
+ preview_box.html(response);
2470
+ $.getScript(previewJS, function () {
2471
+ _this.html('<i class="fa fa-eye-slash" aria-hidden="true"></i> Hide Preview');
2472
+ $(document).on('keyup change', '.post-type-sp_wp_carousel', function (e) {
2473
+ e.preventDefault();
2474
+ _this.html('<i class="fa fa-refresh" aria-hidden="true"></i> Update Preview');
2475
+ });
2476
+ $("html, body").animate({ scrollTop: preview_display.offset().top - 50 }, "slow");
2477
+ });
2478
+ $('.wpcp-carousel-preloader').animate({ opacity: 1 }, 600).hide();
2479
+ var carousel_id = $('.wpcp-carousel-section.wpcp-preloader').attr('id');
2480
+ $('#' + carousel_id).animate({ opacity: 1 }, 600);
2481
+ $('.wpcpro-post-pagination-number').click(function (e) {
2482
+ e.preventDefault();
2483
+ e.stopPropagation();
2484
+ $('.spwpc-pagination-not-work').animate({
2485
+ opacity: 1,
2486
+ bottom: 25
2487
+ }, 300);
2488
+ setTimeout(function () {
2489
+ jQuery(".spwpc-pagination-not-work").animate({
2490
+ opacity: 0,
2491
+ }, 200);
2492
+ jQuery(".spwpc-pagination-not-work").animate({
2493
+ bottom: 0
2494
+ }, 0);
2495
+ }, 3000);
2496
+ });
2497
+ }
2498
+ })
2499
+ });
2500
 
2501
  })(jQuery, window, document);
admin/views/sp-framework/assets/js/main.min.js CHANGED
@@ -1 +1 @@
1
- !function($,window,document,undefined){"use strict";var SP_WPCF=SP_WPCF||{};SP_WPCF.funcs={},SP_WPCF.vars={onloaded:!1,$body:$("body"),$window:$(window),$document:$(document),$form_warning:null,is_confirm:!1,form_modified:!1,code_themes:[],is_rtl:$("body").hasClass("rtl")},SP_WPCF.helper={uid:function(prefix){return(prefix||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(str){return(str+"").replace(/(\[|\])/g,"\\$1")},name_nested_replace:function($selector,field_id){var checks=[],regex=new RegExp(SP_WPCF.helper.preg_quote(field_id+"[\\d+]"),"g");$selector.find(":radio").each((function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)})),$selector.each((function(index){$(this).find(":input").each((function(){this.name=this.name.replace(regex,field_id+"["+index+"]"),this.orginal_checked&&(this.checked=!0)}))}))},debounce:function(callback,threshold,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,threshold),callNow&&callback.apply(context,args)}},get_cookie:function(name){var e,b,cookie=document.cookie,p=name+"=";if(cookie){if(-1===(b=cookie.indexOf("; "+p))){if(0!==(b=cookie.indexOf(p)))return null}else b+=2;return-1===(e=cookie.indexOf(";",b))&&(e=cookie.length),decodeURIComponent(cookie.substring(b+p.length,e))}},set_cookie:function(name,value,expires,path,domain,secure){var d=new Date;"object"==typeof expires&&expires.toGMTString?expires=expires.toGMTString():parseInt(expires,10)?(d.setTime(d.getTime()+1e3*parseInt(expires,10)),expires=d.toGMTString()):expires="",document.cookie=name+"="+encodeURIComponent(value)+(expires?"; expires="+expires:"")+(path?"; path="+path:"")+(domain?"; domain="+domain:"")+(secure?"; secure":"")}},$.fn.wpcf_clone=function(){for(var base=$.fn.clone.apply(this,arguments),clone=this.find("select").add(this.filter("select")),cloned=base.find("select").add(base.filter("select")),i=0;i<clone.length;++i)for(var j=0;j<clone[i].options.length;++j)!0===clone[i].options[j].selected&&(cloned[i].options[j].selected=!0);return this.find(":radio").each((function(){this.orginal_checked=this.checked})),base},$.fn.wpcf_expand_all=function(){return this.each((function(){$(this).on("click",(function(e){e.preventDefault(),$(".wpcf-wrapper").toggleClass("wpcf-show-all"),$(".wpcf-section").wpcf_reload_script(),$(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")}))}))},$.fn.wpcf_nav_options=function(){return this.each((function(){var $nav=$(this),$window=$(window),$wpwrap=$("#wpwrap"),$links=$nav.find("a"),$last;$window.on("hashchange wpcf.hashchange",(function(){var hash=window.location.hash.replace("#tab=",""),slug=hash||$links.first().attr("href").replace("#tab=",""),$link=$('[data-tab-id="'+slug+'"]');if($link.length){$link.closest(".wpcf-tab-item").addClass("wpcf-tab-expanded").siblings().removeClass("wpcf-tab-expanded"),$link.next().is("ul")&&(slug=($link=$link.next().find("li").first().find("a")).data("tab-id")),$links.removeClass("wpcf-active"),$link.addClass("wpcf-active"),$last&&$last.addClass("hidden");var $section=$('[data-section-id="'+slug+'"]');$section.removeClass("hidden"),$section.wpcf_reload_script(),$(".wpcf-section-id").val($section.index()+1),$last=$section,$wpwrap.hasClass("wp-responsive-open")&&($("html, body").animate({scrollTop:$section.offset().top-50},200),$wpwrap.removeClass("wp-responsive-open"))}})).trigger("wpcf.hashchange")}))},$.fn.wpcf_nav_metabox=function(){return this.each((function(){var $nav=$(this),$links=$nav.find("a"),unique_id=$nav.data("unique"),post_id=$("#post_ID").val()||"global",$last_section,$last_link;$links.on("click",(function(e){e.preventDefault();var $link=$(this),section_id=$link.data("section");void 0!==$last_link&&$last_link.removeClass("wpcf-active"),void 0!==$last_section&&$last_section.addClass("hidden"),$link.addClass("wpcf-active");var $section=$("#wpcf-section-"+section_id);$section.removeClass("hidden"),$section.wpcf_reload_script(),SP_WPCF.helper.set_cookie("wpcf-last-metabox-tab-"+post_id+"-"+unique_id,section_id),$last_section=$section,$last_link=$link}));var get_cookie=SP_WPCF.helper.get_cookie("wpcf-last-metabox-tab-"+post_id+"-"+unique_id);get_cookie?$nav.find('a[data-section="'+get_cookie+'"]').trigger("click"):$links.first("a").trigger("click")}))},$.fn.wpcf_page_templates=function(){this.length&&$(document).on("change",".editor-page-attributes__template select, #page_template",(function(){var maybe_value=$(this).val()||"default";$(".wpcf-page-templates").removeClass("wpcf-metabox-show").addClass("wpcf-metabox-hide"),$(".wpcf-page-"+maybe_value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("wpcf-metabox-hide").addClass("wpcf-metabox-show")}))},$.fn.wpcf_post_formats=function(){this.length&&$(document).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',(function(){var maybe_value=$(this).val()||"default";maybe_value="0"===maybe_value?"default":maybe_value,$(".wpcf-post-formats").removeClass("wpcf-metabox-show").addClass("wpcf-metabox-hide"),$(".wpcf-post-format-"+maybe_value).removeClass("wpcf-metabox-hide").addClass("wpcf-metabox-show")}))},$.fn.wpcf_search=function(){return this.each((function(){var $this,$input;$(this).find("input").on("change keyup",(function(){var value=$(this).val(),$wrapper=$(".wpcf-wrapper"),$section,$fields=$wrapper.find(".wpcf-section").find("> .wpcf-field:not(.wpcf-depend-on)"),$titles=$fields.find("> .wpcf-title, .wpcf-search-tags");value.length>3?($fields.addClass("wpcf-metabox-hide"),$wrapper.addClass("wpcf-search-all"),$titles.each((function(){var $title=$(this);if($title.text().match(new RegExp(".*?"+value+".*?","i"))){var $field=$title.closest(".wpcf-field");$field.removeClass("wpcf-metabox-hide"),$field.parent().wpcf_reload_script()}}))):($fields.removeClass("wpcf-metabox-hide"),$wrapper.removeClass("wpcf-search-all"))}))}))},$.fn.wpcf_sticky=function(){return this.each((function(){var $this=$(this),$window=$(window),$inner=$this.find(".wpcf-header-inner"),padding=parseInt($inner.css("padding-left"))+parseInt($inner.css("padding-right")),offset=32,scrollTop=0,lastTop=0,ticking=!1,stickyUpdate=function(){var offsetTop=$this.offset().top,stickyTop=Math.max(32,offsetTop-scrollTop),winWidth=$window.innerWidth();stickyTop<=32&&winWidth>782?($inner.css({width:$this.outerWidth()-padding}),$this.css({height:$this.outerHeight()}).addClass("wpcf-sticky")):($inner.removeAttr("style"),$this.removeAttr("style").removeClass("wpcf-sticky"))},requestTick=function(){ticking||requestAnimationFrame((function(){stickyUpdate(),ticking=!1})),ticking=!0},onSticky=function(){scrollTop=$window.scrollTop(),requestTick()};$window.on("scroll resize",onSticky),onSticky()}))},$.fn.wpcf_dependency=function(){return this.each((function(){var $this=$(this),$fields=$this.children("[data-controller]");if($fields.length){var normal_ruleset=$.wpcf_deps.createRuleset(),global_ruleset=$.wpcf_deps.createRuleset(),normal_depends=[],global_depends=[];$fields.each((function(){var $field=$(this),controllers=$field.data("controller").split("|"),conditions=$field.data("condition").split("|"),values=$field.data("value").toString().split("|"),is_global=!!$field.data("depend-global"),ruleset=is_global?global_ruleset:normal_ruleset;$.each(controllers,(function(index,depend_id){var value=values[index]||"",condition=conditions[index]||conditions[0];(ruleset=ruleset.createRule('[data-depend-id="'+depend_id+'"]',condition,value)).include($field),is_global?global_depends.push(depend_id):normal_depends.push(depend_id)}))})),normal_depends.length&&$.wpcf_deps.enable($this,normal_ruleset,normal_depends),global_depends.length&&$.wpcf_deps.enable(SP_WPCF.vars.$body,global_ruleset,global_depends)}}))},$.fn.wpcf_field_code_editor=function(){return this.each((function(){if("function"==typeof CodeMirror){var $this=$(this),$textarea=$this.find("textarea"),$inited=$this.find(".CodeMirror"),data_editor=$textarea.data("editor");$inited.length&&$inited.remove();var interval=setInterval((function(){if($this.is(":visible")){var code_editor=CodeMirror.fromTextArea($textarea[0],data_editor);if("default"!==data_editor.theme&&-1===SP_WPCF.vars.code_themes.indexOf(data_editor.theme)){var $cssLink=$("<link>");$("#wpcf-codemirror-css").after($cssLink),$cssLink.attr({rel:"stylesheet",id:"wpcf-codemirror-"+data_editor.theme+"-css",href:data_editor.cdnURL+"/theme/"+data_editor.theme+".min.css",type:"text/css",media:"all"}),SP_WPCF.vars.code_themes.push(data_editor.theme)}CodeMirror.modeURL=data_editor.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(code_editor,data_editor.mode),code_editor.on("change",(function(editor,event){$textarea.val(code_editor.getValue()).trigger("change")})),clearInterval(interval)}}))}}))},$.fn.wpcf_field_gallery=function(){return this.each((function(){var $this=$(this),$edit=$this.find(".wpcf-edit-gallery"),$clear=$this.find(".wpcf-clear-gallery"),$list=$this.find("ul.sp-gallery-images"),$input=$this.find("input"),$img=$this.find("img"),wp_media_frame;$this.on("click",".wpcf-button, .wpcf-edit-gallery",(function(e){var $el=$(this),ids=$input.val(),what=$el.hasClass("wpcf-edit-gallery")?"edit":"add",state="add"!==what||ids.length?"gallery-edit":"gallery";e.preventDefault(),void 0!==window.wp&&window.wp.media&&window.wp.media.gallery&&("gallery"===state?(wp_media_frame=window.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(wp_media_frame=window.wp.media.gallery.edit('[gallery ids="'+ids+'"]'),"add"===what&&wp_media_frame.setState("gallery-library")),wp_media_frame.on("update",(function(selection){$list.empty();var selectedIds=selection.models.map((function(attachment){var item=attachment.toJSON(),thumb=item.sizes&&item.sizes.thumbnail&&item.sizes.thumbnail.url?item.sizes.thumbnail.url:item.url;return $list.append('<li><img src="'+thumb+'"></li>'),item.id}));$input.val(selectedIds.join(",")).trigger("change"),$clear.removeClass("hidden"),$edit.removeClass("hidden")})))})),$clear.on("click",(function(e){e.preventDefault(),$list.empty(),$input.val("").trigger("change"),$clear.addClass("hidden"),$edit.addClass("hidden")}))}))},$.fn.wpcf_field_slider=function(){return this.each((function(){var $this=$(this),$input=$this.find("input"),$slider=$this.find(".wpcf-slider-ui"),data=$input.data(),value=$input.val()||0;$slider.hasClass("ui-slider")&&$slider.empty(),$slider.slider({range:"min",value:value,min:data.min||0,max:data.max||100,step:data.step||1,slide:function(e,o){$input.val(o.value).trigger("change")}}),$input.on("keyup",(function(){$slider.slider("value",$input.val())}))}))},$.fn.wpcf_field_spinner=function(){return this.each((function(){var $this=$(this),$input=$this.find("input"),$inited=$this.find(".ui-button"),data=$input.data();$inited.length&&$inited.remove(),$input.spinner({min:data.min||0,max:data.max||100,step:data.step||1,create:function(event,ui){data.unit&&$input.after('<span class="ui-button wpcf--unit">'+data.unit+"</span>")},spin:function(event,ui){$input.val(ui.value).trigger("change")}})}))},$.fn.wpcf_field_switcher=function(){return this.each((function(){var $switcher=$(this).find(".wpcf--switcher");$switcher.on("click",(function(){var value=0,$input=$switcher.find("input");$switcher.hasClass("wpcf--active")?$switcher.removeClass("wpcf--active"):(value=1,$switcher.addClass("wpcf--active")),$input.val(value).trigger("change")}))}))},$.fn.wpcf_field_typography=function(){return this.each((function(){var base=this,$this=$(this),loaded_fonts=[],webfonts=wpcf_typography_json.webfonts,googlestyles=wpcf_typography_json.googlestyles,defaultstyles=wpcf_typography_json.defaultstyles;base.sanitize_subset=function(subset){return subset=(subset=subset.replace("-ext"," Extended")).charAt(0).toUpperCase()+subset.slice(1)},base.sanitize_style=function(style){return googlestyles[style]?googlestyles[style]:style},base.load_google_font=function(font_family,weight,style){font_family&&"object"==typeof WebFont&&(weight=weight?weight.replace("normal",""):"",style=style?style.replace("normal",""):"",(weight||style)&&(font_family=font_family+":"+weight+style),-1===loaded_fonts.indexOf(font_family)&&WebFont.load({google:{families:[font_family]}}),loaded_fonts.push(font_family))},base.append_select_options=function($select,options,condition,type,is_multi){$select.find("option").not(":first").remove();var opts="";$.each(options,(function(key,value){var selected,name=value;selected=is_multi?condition&&-1!==condition.indexOf(value)?" selected":"":condition&&condition===value?" selected":"","subset"===type?name=base.sanitize_subset(value):"style"===type&&(name=base.sanitize_style(value)),opts+='<option value="'+value+'"'+selected+">"+name+"</option>"})),$select.append(opts).trigger("wpcf.change").trigger("chosen:updated")},base.init=function(){var selected_styles=[],$typography=$this.find(".wpcf--typography"),$type=$this.find(".wpcf--type"),$styles=$this.find(".wpcf--block-font-style"),unit=$typography.data("unit"),line_height_unit=$typography.data("line-height-unit"),exclude_fonts=$typography.data("exclude")?$typography.data("exclude").split(","):[],$chosen_selects;$this.find(".wpcf--chosen").length&&$this.find("select").each((function(){var $chosen_select=$(this),$chosen_inited=$chosen_select.parent().find(".chosen-container");$chosen_inited.length&&$chosen_inited.remove(),$chosen_select.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})}));var $font_family_select=$this.find(".wpcf--font-family"),first_font_family=$font_family_select.val();$font_family_select.find("option").not(":first-child").remove();var opts="";$.each(webfonts,(function(type,group){exclude_fonts&&-1!==exclude_fonts.indexOf(type)||(opts+='<optgroup label="'+group.label+'">',$.each(group.fonts,(function(key,value){var selected;opts+='<option value="'+(value="object"==typeof value?key:value)+'" data-type="'+type+'"'+(value===first_font_family?" selected":"")+">"+value+"</option>"})),opts+="</optgroup>")})),$font_family_select.append(opts).trigger("chosen:updated");var $font_style_block=$this.find(".wpcf--block-font-style");if($font_style_block.length){var $font_style_select=$this.find(".wpcf--font-style-select"),first_style_value=$font_style_select.val()?$font_style_select.val().replace(/normal/g,""):"";$font_style_select.on("change wpcf.change",(function(event){var style_value=$font_style_select.val();!style_value&&selected_styles&&-1===selected_styles.indexOf("normal")&&(style_value=selected_styles[0]);var font_normal=style_value&&"italic"!==style_value&&"normal"===style_value?"normal":"",font_weight=style_value&&"italic"!==style_value&&"normal"!==style_value?style_value.replace("italic",""):font_normal,font_style=style_value&&"italic"===style_value.substr(-6)?"italic":"";$this.find(".wpcf--font-weight").val(font_weight),$this.find(".wpcf--font-style").val(font_style)}));var $extra_font_style_block=$this.find(".wpcf--block-extra-styles");if($extra_font_style_block.length)var $extra_font_style_select=$this.find(".wpcf--extra-styles"),first_extra_style_value=$extra_font_style_select.val()}var $subset_block=$this.find(".wpcf--block-subset");if($subset_block.length)var $subset_select=$this.find(".wpcf--subset"),first_subset_select_value=$subset_select.val(),subset_multi_select=$subset_select.data("multiple")||!1;var $backup_font_family_block=$this.find(".wpcf--block-backup-font-family");$font_family_select.on("change wpcf.change",(function(event){$subset_block.length&&$subset_block.addClass("hidden"),$extra_font_style_block.length&&$extra_font_style_block.addClass("hidden"),$backup_font_family_block.length&&$backup_font_family_block.addClass("hidden");var $selected=$font_family_select.find(":selected"),value=$selected.val(),type=$selected.data("type");if(type&&value){if("google"!==type&&"custom"!==type||!$backup_font_family_block.length||$backup_font_family_block.removeClass("hidden"),$font_style_block.length){var styles=defaultstyles;"google"===type&&webfonts[type].fonts[value][0]?styles=webfonts[type].fonts[value][0]:"custom"===type&&webfonts[type].fonts[value]&&(styles=webfonts[type].fonts[value]),selected_styles=styles;var set_auto_style=-1!==styles.indexOf("normal")?"normal":styles[0],set_style_value=first_style_value&&-1!==styles.indexOf(first_style_value)?first_style_value:set_auto_style;base.append_select_options($font_style_select,styles,set_style_value,"style"),first_style_value=!1,$font_style_block.removeClass("hidden"),"google"===type&&$extra_font_style_block.length&&styles.length>1&&(base.append_select_options($extra_font_style_select,styles,first_extra_style_value,"style",!0),first_extra_style_value=!1,$extra_font_style_block.removeClass("hidden"))}if("google"===type&&$subset_block.length&&webfonts[type].fonts[value][1]){var subsets=webfonts[type].fonts[value][1],set_auto_subset=subsets.length<2&&"latin"!==subsets[0]?subsets[0]:"",set_subset_value=first_subset_select_value&&-1!==subsets.indexOf(first_subset_select_value)?first_subset_select_value:set_auto_subset;set_subset_value=subset_multi_select&&first_subset_select_value?first_subset_select_value:set_subset_value,base.append_select_options($subset_select,subsets,set_subset_value,"subset",subset_multi_select),first_subset_select_value=!1,$subset_block.removeClass("hidden")}}else $styles.find(":input").val(""),$subset_block.length&&($subset_select.find("option").not(":first-child").remove(),$subset_select.trigger("chosen:updated")),$font_style_block.length&&($font_style_select.find("option").not(":first-child").remove(),$font_style_select.trigger("chosen:updated"));$type.val(type)})).trigger("wpcf.change");var $preview_block=$this.find(".wpcf--block-preview");if($preview_block.length){var $preview=$this.find(".wpcf--preview");$this.on("change",SP_WPCF.helper.debounce((function(event){$preview_block.removeClass("hidden");var font_family=$font_family_select.val(),font_weight=$this.find(".wpcf--font-weight").val(),font_style=$this.find(".wpcf--font-style").val(),font_size=$this.find(".wpcf--font-size").val(),font_variant=$this.find(".wpcf--font-variant").val(),line_height=$this.find(".wpcf--line-height").val(),text_align=$this.find(".wpcf--text-align").val(),text_transform=$this.find(".wpcf--text-transform").val(),text_decoration=$this.find(".wpcf--text-decoration").val(),text_color=$this.find(".wpcf--color").val(),word_spacing=$this.find(".wpcf--word-spacing").val(),letter_spacing=$this.find(".wpcf--letter-spacing").val(),custom_style=$this.find(".wpcf--custom-style").val(),type;"google"===$this.find(".wpcf--type").val()&&base.load_google_font(font_family,font_weight,font_style);var properties={};font_family&&(properties.fontFamily=font_family),font_weight&&(properties.fontWeight=font_weight),font_style&&(properties.fontStyle=font_style),font_variant&&(properties.fontVariant=font_variant),font_size&&(properties.fontSize=font_size+unit),line_height&&(properties.lineHeight=line_height+line_height_unit),letter_spacing&&(properties.letterSpacing=letter_spacing+unit),word_spacing&&(properties.wordSpacing=word_spacing+unit),text_align&&(properties.textAlign=text_align),text_transform&&(properties.textTransform=text_transform),text_decoration&&(properties.textDecoration=text_decoration),text_color&&(properties.color=text_color),$preview.removeAttr("style"),custom_style&&$preview.attr("style",custom_style),$preview.css(properties)}),100)),$preview_block.on("click",(function(){$preview.toggleClass("wpcf--black-background");var $toggle=$preview_block.find(".wpcf--toggle");$toggle.hasClass("fa-toggle-off")?$toggle.removeClass("fa-toggle-off").addClass("fa-toggle-on"):$toggle.removeClass("fa-toggle-on").addClass("fa-toggle-off")})),$preview_block.hasClass("hidden")||$this.trigger("change")}},base.init()}))},$.fn.wpcf_confirm=function(){return this.each((function(){$(this).on("click",(function(e){var confirm_text=$(this).data("confirm")||window.wpcf_vars.i18n.confirm,confirm_answer;if(!confirm(confirm_text))return e.preventDefault(),!1;SP_WPCF.vars.is_confirm=!0,SP_WPCF.vars.form_modified=!1}))}))},$.fn.serializeObject=function(){var obj={};return $.each(this.serializeArray(),(function(i,o){var n=o.name,v=o.value;obj[n]=void 0===obj[n]?v:$.isArray(obj[n])?obj[n].concat(v):[obj[n],v]})),obj},$.fn.wpcf_save=function(){return this.each((function(){var $this=$(this),$buttons=$(".wpcf-save"),$panel=$(".wpcf-options"),flooding=!1,timeout;$this.on("click",(function(e){if(!flooding){var $text=$this.data("save"),$value=$this.val();$buttons.attr("value",$text),$this.hasClass("wpcf-save-ajax")?(e.preventDefault(),$panel.addClass("wpcf-saving"),$buttons.prop("disabled",!0),window.wp.ajax.post("wpcf_"+$panel.data("unique")+"_ajax_save",{data:$("#wpcf-form").serializeJSONSP_WPCF()}).done((function(response){if($(".wpcf-error").remove(),Object.keys(response.errors).length){var error_icon='<i class="wpcf-label-error wpcf-error">!</i>';$.each(response.errors,(function(key,error_message){var $field=$('[data-depend-id="'+key+'"]'),$link=$('a[href="#tab='+$field.closest(".wpcf-section").data("section-id")+'"]'),$tab=$link.closest(".wpcf-tab-item");$field.closest(".wpcf-fieldset").append('<p class="wpcf-error wpcf-error-text">'+error_message+"</p>"),$link.find(".wpcf-error").length||$link.append(error_icon),$tab.find(".wpcf-arrow .wpcf-error").length||$tab.find(".wpcf-arrow").append(error_icon)}))}$panel.removeClass("wpcf-saving"),$buttons.prop("disabled",!1).attr("value",$value),flooding=!1,SP_WPCF.vars.form_modified=!1,SP_WPCF.vars.$form_warning.hide(),clearTimeout(timeout);var $result_success=$(".wpcf-form-success");$result_success.empty().append(response.notice).fadeIn("fast",(function(){timeout=setTimeout((function(){$result_success.fadeOut("fast")}),1e3)}))})).fail((function(response){alert(response.error)}))):SP_WPCF.vars.form_modified=!1}flooding=!0}))}))},$.fn.wpcf_options=function(){return this.each((function(){var $this=$(this),$content=$this.find(".wpcf-content"),$form_success=$this.find(".wpcf-form-success"),$form_warning=$this.find(".wpcf-form-warning"),$save_button=$this.find(".wpcf-header .wpcf-save");SP_WPCF.vars.$form_warning=$form_warning,$form_warning.length&&(window.onbeforeunload=function(){return!!SP_WPCF.vars.form_modified||void 0},$content.on("change keypress",":input",(function(){SP_WPCF.vars.form_modified||($form_success.hide(),$form_warning.fadeIn("fast"),SP_WPCF.vars.form_modified=!0)}))),$form_success.hasClass("wpcf-form-show")&&setTimeout((function(){$form_success.fadeOut("fast")}),1e3),$(document).keydown((function(event){if((event.ctrlKey||event.metaKey)&&83===event.which)return $save_button.trigger("click"),event.preventDefault(),!1}))}))},$.fn.wpcf_taxonomy=function(){return this.each((function(){var $this=$(this),$form=$this.parents("form");if("addtag"===$form.attr("id")){var $submit=$form.find("#submit"),$cloned=$this.find(".wpcf-field").wpcf_clone();$submit.on("click",(function(){$form.find(".form-required").hasClass("form-invalid")||($this.data("inited",!1),$this.empty(),$this.html($cloned),$cloned=$cloned.wpcf_clone(),$this.wpcf_reload_script())}))}}))},$.fn.wpcf_shortcode=function(){var base=this;return base.shortcode_parse=function(serialize,key){var shortcode="";return $.each(serialize,(function(shortcode_key,shortcode_values){shortcode+="["+(key=key||shortcode_key),$.each(shortcode_values,(function(shortcode_tag,shortcode_value){"content"===shortcode_tag?(shortcode+="]",shortcode+=shortcode_value,shortcode+="[/"+key):shortcode+=base.shortcode_tags(shortcode_tag,shortcode_value)})),shortcode+="]"})),shortcode},base.shortcode_tags=function(shortcode_tag,shortcode_value){var shortcode="";return""!==shortcode_value&&("object"!=typeof shortcode_value||$.isArray(shortcode_value)?shortcode+=" "+shortcode_tag.replace("-","_")+'="'+shortcode_value.toString()+'"':$.each(shortcode_value,(function(sub_shortcode_tag,sub_shortcode_value){switch(sub_shortcode_tag){case"background-image":sub_shortcode_value=sub_shortcode_value.url?sub_shortcode_value.url:""}""!==sub_shortcode_value&&(shortcode+=" "+sub_shortcode_tag.replace("-","_")+'="'+sub_shortcode_value.toString()+'"')}))),shortcode},base.insertAtChars=function(_this,currentValue){var obj=void 0!==_this[0].name?_this[0]:_this;return obj.value.length&&void 0!==obj.selectionStart?(obj.focus(),obj.value.substring(0,obj.selectionStart)+currentValue+obj.value.substring(obj.selectionEnd,obj.value.length)):(obj.focus(),currentValue)},base.send_to_editor=function(html,editor_id){var tinymce_editor;if("undefined"!=typeof tinymce&&(tinymce_editor=tinymce.get(editor_id)),tinymce_editor&&!tinymce_editor.isHidden())tinymce_editor.execCommand("mceInsertContent",!1,html);else{var $editor=$("#"+editor_id);$editor.val(base.insertAtChars($editor,html)).trigger("change")}},this.each((function(){var $modal=$(this),$load=$modal.find(".wpcf-modal-load"),$content=$modal.find(".wpcf-modal-content"),$insert=$modal.find(".wpcf-modal-insert"),$loading=$modal.find(".wpcf-modal-loading"),$select=$modal.find("select"),modal_id=$modal.data("modal-id"),nonce=$modal.data("nonce"),editor_id,target_id,gutenberg_id,sc_key,sc_name,sc_view,sc_group,$cloned,$button;$(document).on("click",'.wpcf-shortcode-button[data-modal-id="'+modal_id+'"]',(function(e){e.preventDefault(),$button=$(this),editor_id=$button.data("editor-id")||!1,target_id=$button.data("target-id")||!1,gutenberg_id=$button.data("gutenberg-id")||!1,$modal.removeClass("hidden"),$modal.hasClass("wpcf-shortcode-single")&&void 0===sc_name&&$select.trigger("change")})),$select.on("change",(function(){var $option=$(this),$selected=$option.find(":selected");sc_key=$option.val(),sc_name=$selected.data("shortcode"),sc_view=$selected.data("view")||"normal",sc_group=$selected.data("group")||sc_name,$load.empty(),sc_key?($loading.show(),window.wp.ajax.post("wpcf-get-shortcode-"+modal_id,{shortcode_key:sc_key,nonce:nonce}).done((function(response){$loading.hide();var $appended=$(response.content).appendTo($load);$insert.parent().removeClass("hidden"),$cloned=$appended.find(".wpcf--repeat-shortcode").wpcf_clone(),$appended.wpcf_reload_script(),$appended.find(".wpcf-fields").wpcf_reload_script()}))):$insert.parent().addClass("hidden")})),$insert.on("click",(function(e){if(e.preventDefault(),!$insert.prop("disabled")&&!$insert.attr("disabled")){var shortcode="",serialize=$modal.find(".wpcf-field:not(.wpcf-depend-on)").find(":input:not(.ignore)").serializeObjectSP_WPCF();switch(sc_view){case"contents":var contentsObj=sc_name?serialize[sc_name]:serialize;$.each(contentsObj,(function(sc_key,sc_value){var sc_tag=sc_name||sc_key;shortcode+="["+sc_tag+"]"+sc_value+"[/"+sc_tag+"]"}));break;case"group":shortcode+="["+sc_name,$.each(serialize[sc_name],(function(sc_key,sc_value){shortcode+=base.shortcode_tags(sc_key,sc_value)})),shortcode+="]",shortcode+=base.shortcode_parse(serialize[sc_group],sc_group),shortcode+="[/"+sc_name+"]";break;case"repeater":shortcode+=base.shortcode_parse(serialize[sc_group],sc_group);break;default:shortcode+=base.shortcode_parse(serialize)}if(shortcode=""===shortcode?"["+sc_name+"]":shortcode,gutenberg_id){var content=window.wpcf_gutenberg_props.attributes.hasOwnProperty("shortcode")?window.wpcf_gutenberg_props.attributes.shortcode:"";window.wpcf_gutenberg_props.setAttributes({shortcode:content+shortcode})}else if(editor_id)base.send_to_editor(shortcode,editor_id);else{var $textarea=target_id?$(target_id):$button.parent().find("textarea");$textarea.val(base.insertAtChars($textarea,shortcode)).trigger("change")}$modal.addClass("hidden")}})),$modal.on("click",".wpcf--repeat-button",(function(e){e.preventDefault();var $repeatable=$modal.find(".wpcf--repeatable"),$new_clone=$cloned.wpcf_clone(),$remove_btn=$new_clone.find(".wpcf-repeat-remove"),$appended=$new_clone.appendTo($repeatable);$new_clone.find(".wpcf-fields").wpcf_reload_script(),SP_WPCF.helper.name_nested_replace($modal.find(".wpcf--repeat-shortcode"),sc_group),$remove_btn.on("click",(function(){$new_clone.remove(),SP_WPCF.helper.name_nested_replace($modal.find(".wpcf--repeat-shortcode"),sc_group)}))})),$modal.on("click",".wpcf-modal-close, .wpcf-modal-overlay",(function(){$modal.addClass("hidden")}))}))},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var hex=parseInt(this._color,10).toString(16);if(this.error)return"";if(hex.length<6)for(var i=6-hex.length-1;i>=0;i--)hex="0"+hex;return"#"+hex}),SP_WPCF.funcs.parse_color=function(color){var value=color.replace(/\s+/g,""),trans=-1!==value.indexOf("rgba")?parseFloat(100*value.replace(/^.*,(.+)\)/,"$1")):100,rgba;return{value:value,transparent:trans,rgba:trans<100}},$.fn.wpcf_color=function(){return this.each((function(){var $input=$(this),picker_color=SP_WPCF.funcs.parse_color($input.val()),palette_color=!window.wpcf_vars.color_palette.length||window.wpcf_vars.color_palette,$container;$input.hasClass("wp-color-picker")&&$input.closest(".wp-picker-container").after($input).remove(),$input.wpColorPicker({palettes:palette_color,change:function(event,ui){var ui_color_value=ui.color.toString();$container.removeClass("wpcf--transparent-active"),$container.find(".wpcf--transparent-offset").css("background-color",ui_color_value),$input.val(ui_color_value).trigger("change")},create:function(){$container=$input.closest(".wp-picker-container");var a8cIris=$input.data("a8cIris"),$transparent_wrap=$('<div class="wpcf--transparent-wrap"><div class="wpcf--transparent-slider"></div><div class="wpcf--transparent-offset"></div><div class="wpcf--transparent-text"></div><div class="wpcf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo($container.find(".wp-picker-holder")),$transparent_slider=$transparent_wrap.find(".wpcf--transparent-slider"),$transparent_text=$transparent_wrap.find(".wpcf--transparent-text"),$transparent_offset=$transparent_wrap.find(".wpcf--transparent-offset"),$transparent_button=$transparent_wrap.find(".wpcf--transparent-button");"transparent"===$input.val()&&$container.addClass("wpcf--transparent-active"),$transparent_button.on("click",(function(){"transparent"!==$input.val()?($input.val("transparent").trigger("change").removeClass("iris-error"),$container.addClass("wpcf--transparent-active")):($input.val(a8cIris._color.toString()).trigger("change"),$container.removeClass("wpcf--transparent-active"))})),$transparent_slider.slider({value:picker_color.transparent,step:1,min:0,max:100,slide:function(event,ui){var slide_value=parseFloat(ui.value/100);a8cIris._color._alpha=slide_value,$input.wpColorPicker("color",a8cIris._color.toString()),$transparent_text.text(1===slide_value||0===slide_value?"":slide_value)},create:function(){var slide_value=parseFloat(picker_color.transparent/100),text_value=slide_value<1?slide_value:"";$transparent_text.text(text_value),$transparent_offset.css("background-color",picker_color.value),$container.on("click",".wp-picker-clear",(function(){a8cIris._color._alpha=1,$transparent_text.text(""),$transparent_slider.slider("option","value",100),$container.removeClass("wpcf--transparent-active"),$input.trigger("change")})),$container.on("click",".wp-picker-default",(function(){var default_color=SP_WPCF.funcs.parse_color($input.data("default-color")),default_value=parseFloat(default_color.transparent/100),default_text=default_value<1?default_value:"";a8cIris._color._alpha=default_value,$transparent_text.text(default_text),$transparent_slider.slider("option","value",default_color.transparent),"transparent"===default_color.value&&($input.removeClass("iris-error"),$container.addClass("wpcf--transparent-active"))}))}})}})}))},$.fn.wpcf_chosen=function(){return this.each((function(){var $this=$(this),$inited=$this.parent().find(".chosen-container"),is_sortable=$this.hasClass("wpcf-chosen-sortable")||!1,is_ajax=$this.hasClass("wpcf-chosen-ajax")||!1,is_multiple=$this.attr("multiple")||!1,set_width=is_multiple?"100%":"auto",set_options=$.extend({allow_single_deselect:!0,disable_search_threshold:10,width:set_width,no_results_text:window.wpcf_vars.i18n.no_results_text},$this.data("chosen-settings"));if($inited.length&&$inited.remove(),is_ajax){var set_ajax_options=$.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:window.wpcf_vars.i18n.typing_text,searching_text:window.wpcf_vars.i18n.searching_text,no_results_text:window.wpcf_vars.i18n.no_results_text},$this.data("chosen-settings"));$this.SP_WPCFAjaxChosen(set_ajax_options)}else $this.chosen(set_options);if(is_multiple){var $hidden_select=$this.parent().find(".wpcf-hide-select"),$hidden_value=$hidden_select.val()||[];$this.on("change",(function(obj,result){result&&result.selected?$hidden_select.append('<option value="'+result.selected+'" selected="selected">'+result.selected+"</option>"):result&&result.deselected&&$hidden_select.find('option[value="'+result.deselected+'"]').remove(),void 0!==window.wp.customize&&0===$hidden_select.children().length&&$hidden_select.data("customize-setting-link")&&window.wp.customize.control($hidden_select.data("customize-setting-link")).setting.set(""),$hidden_select.trigger("change")})),$this.SP_WPCFChosenOrder($hidden_value,!0)}if(is_sortable){var $chosen_container,$chosen_choices=$this.parent().find(".chosen-container").find(".chosen-choices");$chosen_choices.bind("mousedown",(function(event){$(event.target).is("span")&&event.stopPropagation()})),$chosen_choices.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,ui){ui.placeholder.width(ui.item.innerWidth()),ui.placeholder.height(ui.item.innerHeight())},update:function(e,ui){var select_options="",chosen_object=$this.data("chosen"),$prev_select=$this.parent().find(".wpcf-hide-select");$chosen_choices.find(".search-choice-close").each((function(){var option_array_index=$(this).data("option-array-index");$.each(chosen_object.results_data,(function(index,data){data.array_index===option_array_index&&(select_options+='<option value="'+data.value+'" selected>'+data.value+"</option>")}))})),$prev_select.children().remove(),$prev_select.append(select_options),$prev_select.trigger("change")}})}}))},$.fn.wpcf_checkbox=function(){return this.each((function(){var $this=$(this),$input=$this.find(".wpcf--input"),$checkbox=$this.find(".wpcf--checkbox");$checkbox.on("click",(function(){$input.val(Number($checkbox.prop("checked"))).trigger("change")}))}))},$.fn.wpcf_siblings=function(){return this.each((function(){var $this=$(this),$siblings=$this.find(".wpcf--sibling"),multiple=$this.data("multiple")||!1;$siblings.on("click",(function(){var $sibling=$(this);multiple?$sibling.hasClass("wpcf--active")?($sibling.removeClass("wpcf--active"),$sibling.find("input").prop("checked",!1).trigger("change")):($sibling.addClass("wpcf--active"),$sibling.find("input").prop("checked",!0).trigger("change")):($this.find("input").prop("checked",!1),$sibling.find("input").prop("checked",!0).trigger("change"),$sibling.addClass("wpcf--active").siblings().removeClass("wpcf--active"))}))}))},$.fn.wpcf_help=function(){return this.each((function(){var $this=$(this),$tooltip,offset_left;$this.on({mouseenter:function(){$tooltip=$('<div class="wpcf-tooltip"></div>').html($this.find(".wpcf-help-text").html()).appendTo("body"),SP_WPCF.vars.is_rtl,offset_left=$this.offset().left+24,$tooltip.css({top:$this.offset().top-($tooltip.outerHeight()/2-14),left:offset_left})},mouseleave:function(){void 0!==$tooltip&&$tooltip.remove()}})}))},$.fn.wpcf_customizer_refresh=function(){return this.each((function(){var $this=$(this),$complex=$this.closest(".wpcf-customize-complex");if($complex.length){var unique_id=$complex.data("unique-id");if(void 0===unique_id)return;var $input=$complex.find(":input"),option_id=$complex.data("option-id"),obj=$input.serializeObjectSP_WPCF(),data=!$.isEmptyObject(obj)&&obj[unique_id]&&obj[unique_id][option_id]?obj[unique_id][option_id]:"",control=window.wp.customize.control(unique_id+"["+option_id+"]");control.setting._value=null,control.setting.set(data)}else $this.find(":input").first().trigger("change");$(document).trigger("wpcf-customizer-refresh",$this)}))},SP_WPCF.vars.$window.on("resize wpcf.resize",SP_WPCF.helper.debounce((function(event){var window_width;(navigator.userAgent.indexOf("AppleWebKit/")>-1?SP_WPCF.vars.$window.width():window.innerWidth)<=782&&!SP_WPCF.vars.onloaded&&($(".wpcf-section").wpcf_reload_script(),SP_WPCF.vars.onloaded=!0)}),200)).trigger("wpcf.resize"),$.fn.wpcf_widgets=function(){this.length&&($(document).on("widget-added widget-updated",(function(event,$widget){$widget.find(".wpcf-fields").wpcf_reload_script()})),$(".widgets-sortables, .control-section-sidebar").on("sortstop",(function(event,ui){ui.item.find(".wpcf-fields").wpcf_reload_script_retry()})),$(document).on("click",".widget-top",(function(event){$(this).parent().find(".wpcf-fields").wpcf_reload_script()})))},$.fn.wpcf_nav_menu=function(){return this.each((function(){var $navmenu=$(this);$navmenu.on("click","a.item-edit",(function(){$(this).closest("li.menu-item").find(".wpcf-fields").wpcf_reload_script()})),$navmenu.on("sortstop",(function(event,ui){ui.item.find(".wpcf-fields").wpcf_reload_script_retry()}))}))},$.fn.wpcf_reload_script_retry=function(){return this.each((function(){var $this=$(this)}))},$.fn.wpcf_reload_script=function(options){var settings=$.extend({dependency:!0},options);return this.each((function(){var $this=$(this);$this.data("inited")||($this.children(".wpcf-field-code_editor").wpcf_field_code_editor(),$this.children(".wpcf-field-gallery").wpcf_field_gallery(),$this.children(".wpcf-field-slider").wpcf_field_slider(),$this.children(".wpcf-field-spinner").wpcf_field_spinner(),$this.children(".wpcf-field-switcher").wpcf_field_switcher(),$this.children(".wpcf-field-typography").wpcf_field_typography(),$this.children(".wpcf-field-border").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-color").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-color_group").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-typography").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-select").find(".wpcf-chosen").wpcf_chosen(),$this.children(".wpcf-field-checkbox").find(".wpcf-checkbox").wpcf_checkbox(),$this.children(".wpcf-field-button_set").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field-image_select").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field-carousel_type").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field").find(".wpcf-help").wpcf_help(),settings.dependency&&$this.wpcf_dependency(),$this.data("inited",!0),$(document).trigger("wpcf-reload-script",$this))}))},$(document).ready((function(){function wpcf_copyToClipboard(element){var $temp=$("<input>");$("body").append($temp),$temp.val($(element).text()).select(),document.execCommand("copy"),$temp.remove()}function wpcf_SelectText(element){var r=document.createRange(),w=element.get(0);r.selectNodeContents(w);var sel=window.getSelection();sel.removeAllRanges(),sel.addRange(r)}$(".wpcf-save").wpcf_save(),$(".wpcf-options").wpcf_options(),$(".wpcf-sticky-header").wpcf_sticky(),$(".wpcf-nav-options").wpcf_nav_options(),$(".wpcf-nav-metabox").wpcf_nav_metabox(),$(".wpcf-taxonomy").wpcf_taxonomy(),$(".wpcf-page-templates").wpcf_page_templates(),$(".wpcf-post-formats").wpcf_post_formats(),$(".wpcf-shortcode").wpcf_shortcode(),$(".wpcf-search").wpcf_search(),$(".wpcf-confirm").wpcf_confirm(),$(".wpcf-expand-all").wpcf_expand_all(),$(".wpcf-onload").wpcf_reload_script(),$(".widget").wpcf_widgets(),$("#menu-to-edit").wpcf_nav_menu(),$(".wpcf-shortcode-selectable").click((function(e){e.preventDefault(),wpcf_copyToClipboard($(this)),wpcf_SelectText($(this)),$(this).focus().select(),jQuery(".spwpc-after-copy-text").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-after-copy-text").animate({opacity:0},200),jQuery(".spwpc-after-copy-text").animate({bottom:0},0)}),2e3)})),$(".post-type-sp_wp_carousel .shortcode.column-shortcode input").click((function(e){var copyText;e.preventDefault(),$(this).select(),document.execCommand("copy"),jQuery(".spwpc-after-copy-text").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-after-copy-text").animate({opacity:0},200),jQuery(".spwpc-after-copy-text").animate({bottom:0},0)}),2e3)})),$('.wpcp_post_pagination_type label:contains("Pro")').css({"pointer-events":"none",color:"rgba(85,85,85,.6)!important"});var $export_type=$(".wpcp_what_export").find("input:checked").val();$(".wpcp_what_export").on("change",(function(){$export_type=$(this).find("input:checked").val()})),$(".wpcp_export .wpcf--button").click((function(event){event.preventDefault();var $shortcode_ids=$(".wpcp_post_ids select").val();console.log($shortcode_ids);var $ex_nonce=$("#wpcf_options_noncesp_wpcf_tools").val(),selected_shortcode;if("all_shortcodes"===$export_type||"selected_shortcodes"===$export_type)var data={action:"wpcp_export_shortcodes",wpcf_ids:"selected_shortcodes"===$export_type?$shortcode_ids:"all_shortcodes",nonce:$ex_nonce};else $(".wpcf-form-result.wpcf-form-success").text("No carousel selected.").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text("")}),3e3);$.post(ajaxurl,data,(function(resp){if(resp){var json=JSON.stringify(resp);json=[json];var blob=new Blob(json),link=document.createElement("a"),wpcp_time=$.now();link.href=window.URL.createObjectURL(blob),link.download="wp-carousel-export-"+wpcp_time+".json",link.click(),$(".wpcf-form-result.wpcf-form-success").text("Exported successfully!").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text(""),$(".wpcp_post_ids select").val("").trigger("chosen:updated")}),3e3)}}))})),$(".wpcp_import button.import").click((function(event){event.preventDefault();var wpcp_shortcodes=$("#import").prop("files")[0];if(""!=$("#import").val()){var $im_nonce=$("#wpcf_options_noncesp_wpcf_tools").val(),reader=new FileReader;reader.readAsText(wpcp_shortcodes),reader.onload=function(event){var jsonObj=JSON.stringify(event.target.result);$.ajax({url:ajaxurl,type:"POST",data:{shortcode:jsonObj,action:"wpcp_import_shortcodes",nonce:$im_nonce},success:function(resp){$(".wpcf-form-result.wpcf-form-success").text("Imported successfully!").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text(""),$("#import").val(""),window.location.replace($("#wpcf_shortcode_link_redirect").attr("href"))}),2e3)}})}}else $(".wpcf-form-result.wpcf-form-success").text("No exported json file chosen.").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text("")}),3e3)})),"gallery"==$('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val()?$(".wpcf-nav-metabox li:nth-child(3)").hide():$(".wpcf-nav-metabox li:nth-child(3)").show(),$(".wpcf-field-image_select.wpcp_layout").on("change",(function(){"gallery"==$('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val()?$(".wpcf-nav-metabox li:nth-child(3)").hide():$(".wpcf-nav-metabox li:nth-child(3)").show()}))})),$(document).on("keyup change",".sp_wp_carousel_page_wpcp_settings #wpcf-form",(function(e){var $button;e.preventDefault(),$(this).find(".wpcf-save").css({"background-color":"#00C263","pointer-events":"initial"}).val("Save Settings")})),$(".sp_wp_carousel_page_wpcp_settings .wpcf-save").click((function(e){e.preventDefault(),$(this).css({"background-color":"#C5C5C6","pointer-events":"none"}).val("Changes Saved")})),$(document).on("keyup change",".sp_wp_carousel_page_wpcp_settings #wpcf-form",(function(e){var $button;e.preventDefault(),$(this).find(".wpcf-save").css({"background-color":"#00C263","pointer-events":"initial"}).val("Save Settings")})),$(".sp_wp_carousel_page_wpcp_settings .wpcf-save").click((function(e){e.preventDefault(),$(this).css({"background-color":"#C5C5C6","pointer-events":"none"}).val("Changes Saved")}));var preview_box=$("#sp-wpcf-preview-box"),preview_display=$("#sp_wpcf_live_preview").hide();$(document).on("click","#sp__wpcf-show-preview:contains(Hide)",(function(e){var _this;e.preventDefault(),$(this).html('<i class="fa fa-eye" aria-hidden="true"></i> Show Preview'),preview_box.html(""),preview_display.hide()})),$(document).on("click","#sp__wpcf-show-preview:not(:contains(Hide))",(function(e){e.preventDefault();var previewJS=wpcf_vars.previewJS,_data=$("form#post").serialize(),_this=$(this),data={action:"sp_wpcf_preview_meta_box",data:_data,ajax_nonce:$("#wpcf_metabox_noncesp_wpcf_live_preview").val()};$.ajax({type:"POST",url:ajaxurl,data:data,error:function(response){console.log(response)},success:function(response){preview_display.show(),preview_box.html(response),$.getScript(previewJS,(function(){_this.html('<i class="fa fa-eye-slash" aria-hidden="true"></i> Hide Preview'),$(document).on("keyup change",".post-type-sp_wp_carousel",(function(e){e.preventDefault(),_this.html('<i class="fa fa-refresh" aria-hidden="true"></i> Update Preview')})),$("html, body").animate({scrollTop:preview_display.offset().top-50},"slow")})),$(".wpcp-carousel-preloader").animate({opacity:1},600).hide();var carousel_id=$(".wpcp-carousel-section.wpcp-preloader").attr("id");$("#"+carousel_id).animate({opacity:1},600),$(".wpcpro-post-pagination-number").click((function(e){e.preventDefault(),e.stopPropagation(),$(".spwpc-pagination-not-work").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-pagination-not-work").animate({opacity:0},200),jQuery(".spwpc-pagination-not-work").animate({bottom:0},0)}),3e3)}))}})}))}(jQuery,window,document);
1
+ !function($,window,document,undefined){"use strict";var SP_WPCF=SP_WPCF||{};SP_WPCF.funcs={},SP_WPCF.vars={onloaded:!1,$body:$("body"),$window:$(window),$document:$(document),$form_warning:null,is_confirm:!1,form_modified:!1,code_themes:[],is_rtl:$("body").hasClass("rtl")},SP_WPCF.helper={uid:function(prefix){return(prefix||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(str){return(str+"").replace(/(\[|\])/g,"\\$1")},name_nested_replace:function($selector,field_id){var checks=[],regex=new RegExp(SP_WPCF.helper.preg_quote(field_id+"[\\d+]"),"g");$selector.find(":radio").each((function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)})),$selector.each((function(index){$(this).find(":input").each((function(){this.name=this.name.replace(regex,field_id+"["+index+"]"),this.orginal_checked&&(this.checked=!0)}))}))},debounce:function(callback,threshold,immediate){var timeout;return function(){var context=this,args=arguments,later=function(){timeout=null,immediate||callback.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,threshold),callNow&&callback.apply(context,args)}},get_cookie:function(name){var e,b,cookie=document.cookie,p=name+"=";if(cookie){if(-1===(b=cookie.indexOf("; "+p))){if(0!==(b=cookie.indexOf(p)))return null}else b+=2;return-1===(e=cookie.indexOf(";",b))&&(e=cookie.length),decodeURIComponent(cookie.substring(b+p.length,e))}},set_cookie:function(name,value,expires,path,domain,secure){var d=new Date;"object"==typeof expires&&expires.toGMTString?expires=expires.toGMTString():parseInt(expires,10)?(d.setTime(d.getTime()+1e3*parseInt(expires,10)),expires=d.toGMTString()):expires="",document.cookie=name+"="+encodeURIComponent(value)+(expires?"; expires="+expires:"")+(path?"; path="+path:"")+(domain?"; domain="+domain:"")+(secure?"; secure":"")}},$.fn.wpcf_clone=function(){for(var base=$.fn.clone.apply(this,arguments),clone=this.find("select").add(this.filter("select")),cloned=base.find("select").add(base.filter("select")),i=0;i<clone.length;++i)for(var j=0;j<clone[i].options.length;++j)!0===clone[i].options[j].selected&&(cloned[i].options[j].selected=!0);return this.find(":radio").each((function(){this.orginal_checked=this.checked})),base},$.fn.wpcf_expand_all=function(){return this.each((function(){$(this).on("click",(function(e){e.preventDefault(),$(".wpcf-wrapper").toggleClass("wpcf-show-all"),$(".wpcf-section").wpcf_reload_script(),$(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")}))}))},$.fn.wpcf_nav_options=function(){return this.each((function(){var $nav=$(this),$window=$(window),$wpwrap=$("#wpwrap"),$links=$nav.find("a"),$last;$window.on("hashchange wpcf.hashchange",(function(){var hash=window.location.hash.replace("#tab=",""),slug=hash||$links.first().attr("href").replace("#tab=",""),$link=$('[data-tab-id="'+slug+'"]');if($link.length){$link.closest(".wpcf-tab-item").addClass("wpcf-tab-expanded").siblings().removeClass("wpcf-tab-expanded"),$link.next().is("ul")&&(slug=($link=$link.next().find("li").first().find("a")).data("tab-id")),$links.removeClass("wpcf-active"),$link.addClass("wpcf-active"),$last&&$last.addClass("hidden");var $section=$('[data-section-id="'+slug+'"]');$section.removeClass("hidden"),$section.wpcf_reload_script(),$(".wpcf-section-id").val($section.index()+1),$last=$section,$wpwrap.hasClass("wp-responsive-open")&&($("html, body").animate({scrollTop:$section.offset().top-50},200),$wpwrap.removeClass("wp-responsive-open"))}})).trigger("wpcf.hashchange")}))},$.fn.wpcf_nav_metabox=function(){return this.each((function(){var $nav=$(this),$links=$nav.find("a"),unique_id=$nav.data("unique"),post_id=$("#post_ID").val()||"global",$last_section,$last_link;$links.on("click",(function(e){e.preventDefault();var $link=$(this),section_id=$link.data("section");void 0!==$last_link&&$last_link.removeClass("wpcf-active"),void 0!==$last_section&&$last_section.addClass("hidden"),$link.addClass("wpcf-active");var $section=$("#wpcf-section-"+section_id);$section.removeClass("hidden"),$section.wpcf_reload_script(),SP_WPCF.helper.set_cookie("wpcf-last-metabox-tab-"+post_id+"-"+unique_id,section_id),$last_section=$section,$last_link=$link}));var get_cookie=SP_WPCF.helper.get_cookie("wpcf-last-metabox-tab-"+post_id+"-"+unique_id);get_cookie?$nav.find('a[data-section="'+get_cookie+'"]').trigger("click"):$links.first("a").trigger("click")}))},$.fn.wpcf_page_templates=function(){this.length&&$(document).on("change",".editor-page-attributes__template select, #page_template",(function(){var maybe_value=$(this).val()||"default";$(".wpcf-page-templates").removeClass("wpcf-metabox-show").addClass("wpcf-metabox-hide"),$(".wpcf-page-"+maybe_value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("wpcf-metabox-hide").addClass("wpcf-metabox-show")}))},$.fn.wpcf_post_formats=function(){this.length&&$(document).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',(function(){var maybe_value=$(this).val()||"default";maybe_value="0"===maybe_value?"default":maybe_value,$(".wpcf-post-formats").removeClass("wpcf-metabox-show").addClass("wpcf-metabox-hide"),$(".wpcf-post-format-"+maybe_value).removeClass("wpcf-metabox-hide").addClass("wpcf-metabox-show")}))},$.fn.wpcf_search=function(){return this.each((function(){var $this,$input;$(this).find("input").on("change keyup",(function(){var value=$(this).val(),$wrapper=$(".wpcf-wrapper"),$section,$fields=$wrapper.find(".wpcf-section").find("> .wpcf-field:not(.wpcf-depend-on)"),$titles=$fields.find("> .wpcf-title, .wpcf-search-tags");value.length>3?($fields.addClass("wpcf-metabox-hide"),$wrapper.addClass("wpcf-search-all"),$titles.each((function(){var $title=$(this);if($title.text().match(new RegExp(".*?"+value+".*?","i"))){var $field=$title.closest(".wpcf-field");$field.removeClass("wpcf-metabox-hide"),$field.parent().wpcf_reload_script()}}))):($fields.removeClass("wpcf-metabox-hide"),$wrapper.removeClass("wpcf-search-all"))}))}))},$.fn.wpcf_sticky=function(){return this.each((function(){var $this=$(this),$window=$(window),$inner=$this.find(".wpcf-header-inner"),padding=parseInt($inner.css("padding-left"))+parseInt($inner.css("padding-right")),offset=32,scrollTop=0,lastTop=0,ticking=!1,stickyUpdate=function(){var offsetTop=$this.offset().top,stickyTop=Math.max(32,offsetTop-scrollTop),winWidth=$window.innerWidth();stickyTop<=32&&winWidth>782?($inner.css({width:$this.outerWidth()-padding}),$this.css({height:$this.outerHeight()}).addClass("wpcf-sticky")):($inner.removeAttr("style"),$this.removeAttr("style").removeClass("wpcf-sticky"))},requestTick=function(){ticking||requestAnimationFrame((function(){stickyUpdate(),ticking=!1})),ticking=!0},onSticky=function(){scrollTop=$window.scrollTop(),requestTick()};$window.on("scroll resize",onSticky),onSticky()}))},$.fn.wpcf_dependency=function(){return this.each((function(){var $this=$(this),$fields=$this.children("[data-controller]");if($fields.length){var normal_ruleset=$.wpcf_deps.createRuleset(),global_ruleset=$.wpcf_deps.createRuleset(),normal_depends=[],global_depends=[];$fields.each((function(){var $field=$(this),controllers=$field.data("controller").split("|"),conditions=$field.data("condition").split("|"),values=$field.data("value").toString().split("|"),is_global=!!$field.data("depend-global"),ruleset=is_global?global_ruleset:normal_ruleset;$.each(controllers,(function(index,depend_id){var value=values[index]||"",condition=conditions[index]||conditions[0];(ruleset=ruleset.createRule('[data-depend-id="'+depend_id+'"]',condition,value)).include($field),is_global?global_depends.push(depend_id):normal_depends.push(depend_id)}))})),normal_depends.length&&$.wpcf_deps.enable($this,normal_ruleset,normal_depends),global_depends.length&&$.wpcf_deps.enable(SP_WPCF.vars.$body,global_ruleset,global_depends)}}))},$.fn.wpcf_field_code_editor=function(){return this.each((function(){if("function"==typeof CodeMirror){var $this=$(this),$textarea=$this.find("textarea"),$inited=$this.find(".CodeMirror"),data_editor=$textarea.data("editor");$inited.length&&$inited.remove();var interval=setInterval((function(){if($this.is(":visible")){var code_editor=CodeMirror.fromTextArea($textarea[0],data_editor);if("default"!==data_editor.theme&&-1===SP_WPCF.vars.code_themes.indexOf(data_editor.theme)){var $cssLink=$("<link>");$("#wpcf-codemirror-css").after($cssLink),$cssLink.attr({rel:"stylesheet",id:"wpcf-codemirror-"+data_editor.theme+"-css",href:data_editor.cdnURL+"/theme/"+data_editor.theme+".min.css",type:"text/css",media:"all"}),SP_WPCF.vars.code_themes.push(data_editor.theme)}CodeMirror.modeURL=data_editor.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(code_editor,data_editor.mode),code_editor.on("change",(function(editor,event){$textarea.val(code_editor.getValue()).trigger("change")})),clearInterval(interval)}}))}}))},$.fn.wpcf_field_gallery=function(){return this.each((function(){var $this=$(this),$edit=$this.find(".wpcf-edit-gallery"),$clear=$this.find(".wpcf-clear-gallery"),$list=$this.find("ul.sp-gallery-images"),$input=$this.find("input"),$img=$this.find("img"),wp_media_frame;$this.on("click",".wpcf-button, .wpcf-edit-gallery",(function(e){var $el=$(this),ids=$input.val(),what=$el.hasClass("wpcf-edit-gallery")?"edit":"add",state="add"!==what||ids.length?"gallery-edit":"gallery";e.preventDefault(),void 0!==window.wp&&window.wp.media&&window.wp.media.gallery&&("gallery"===state?(wp_media_frame=window.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(wp_media_frame=window.wp.media.gallery.edit('[gallery ids="'+ids+'"]'),"add"===what&&wp_media_frame.setState("gallery-library")),wp_media_frame.on("update",(function(selection){$list.empty();var selectedIds=selection.models.map((function(attachment){var item=attachment.toJSON(),thumb=item.sizes&&item.sizes.thumbnail&&item.sizes.thumbnail.url?item.sizes.thumbnail.url:item.url;return $list.append('<li><img src="'+thumb+'"></li>'),item.id}));$input.val(selectedIds.join(",")).trigger("change"),$clear.removeClass("hidden"),$edit.removeClass("hidden")})))})),$clear.on("click",(function(e){e.preventDefault(),$list.empty(),$input.val("").trigger("change"),$clear.addClass("hidden"),$edit.addClass("hidden")}))}))},$.fn.wpcf_field_slider=function(){return this.each((function(){var $this=$(this),$input=$this.find("input"),$slider=$this.find(".wpcf-slider-ui"),data=$input.data(),value=$input.val()||0;$slider.hasClass("ui-slider")&&$slider.empty(),$slider.slider({range:"min",value:value,min:data.min||0,max:data.max||100,step:data.step||1,slide:function(e,o){$input.val(o.value).trigger("change")}}),$input.on("keyup",(function(){$slider.slider("value",$input.val())}))}))},$.fn.wpcf_field_spinner=function(){return this.each((function(){var $this=$(this),$input=$this.find("input"),$inited=$this.find(".ui-button"),data=$input.data();$inited.length&&$inited.remove(),$input.spinner({min:data.min||0,max:data.max||100,step:data.step||1,create:function(event,ui){data.unit&&$input.after('<span class="ui-button wpcf--unit">'+data.unit+"</span>")},spin:function(event,ui){$input.val(ui.value).trigger("change")}})}))},$.fn.wpcf_field_switcher=function(){return this.each((function(){var $switcher=$(this).find(".wpcf--switcher");$switcher.on("click",(function(){var value=0,$input=$switcher.find("input");$switcher.hasClass("wpcf--active")?$switcher.removeClass("wpcf--active"):(value=1,$switcher.addClass("wpcf--active")),$input.val(value).trigger("change")}))}))},$.fn.wpcf_field_typography=function(){return this.each((function(){var base=this,$this=$(this),loaded_fonts=[],webfonts=wpcf_typography_json.webfonts,googlestyles=wpcf_typography_json.googlestyles,defaultstyles=wpcf_typography_json.defaultstyles;base.sanitize_subset=function(subset){return subset=(subset=subset.replace("-ext"," Extended")).charAt(0).toUpperCase()+subset.slice(1)},base.sanitize_style=function(style){return googlestyles[style]?googlestyles[style]:style},base.load_google_font=function(font_family,weight,style){font_family&&"object"==typeof WebFont&&(weight=weight?weight.replace("normal",""):"",style=style?style.replace("normal",""):"",(weight||style)&&(font_family=font_family+":"+weight+style),-1===loaded_fonts.indexOf(font_family)&&WebFont.load({google:{families:[font_family]}}),loaded_fonts.push(font_family))},base.append_select_options=function($select,options,condition,type,is_multi){$select.find("option").not(":first").remove();var opts="";$.each(options,(function(key,value){var selected,name=value;selected=is_multi?condition&&-1!==condition.indexOf(value)?" selected":"":condition&&condition===value?" selected":"","subset"===type?name=base.sanitize_subset(value):"style"===type&&(name=base.sanitize_style(value)),opts+='<option value="'+value+'"'+selected+">"+name+"</option>"})),$select.append(opts).trigger("wpcf.change").trigger("chosen:updated")},base.init=function(){var selected_styles=[],$typography=$this.find(".wpcf--typography"),$type=$this.find(".wpcf--type"),$styles=$this.find(".wpcf--block-font-style"),unit=$typography.data("unit"),line_height_unit=$typography.data("line-height-unit"),exclude_fonts=$typography.data("exclude")?$typography.data("exclude").split(","):[],$chosen_selects;$this.find(".wpcf--chosen").length&&$this.find("select").each((function(){var $chosen_select=$(this),$chosen_inited=$chosen_select.parent().find(".chosen-container");$chosen_inited.length&&$chosen_inited.remove(),$chosen_select.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})}));var $font_family_select=$this.find(".wpcf--font-family"),first_font_family=$font_family_select.val();$font_family_select.find("option").not(":first-child").remove();var opts="";$.each(webfonts,(function(type,group){exclude_fonts&&-1!==exclude_fonts.indexOf(type)||(opts+='<optgroup label="'+group.label+'">',$.each(group.fonts,(function(key,value){var selected;opts+='<option value="'+(value="object"==typeof value?key:value)+'" data-type="'+type+'"'+(value===first_font_family?" selected":"")+">"+value+"</option>"})),opts+="</optgroup>")})),$font_family_select.append(opts).trigger("chosen:updated");var $font_style_block=$this.find(".wpcf--block-font-style");if($font_style_block.length){var $font_style_select=$this.find(".wpcf--font-style-select"),first_style_value=$font_style_select.val()?$font_style_select.val().replace(/normal/g,""):"";$font_style_select.on("change wpcf.change",(function(event){var style_value=$font_style_select.val();!style_value&&selected_styles&&-1===selected_styles.indexOf("normal")&&(style_value=selected_styles[0]);var font_normal=style_value&&"italic"!==style_value&&"normal"===style_value?"normal":"",font_weight=style_value&&"italic"!==style_value&&"normal"!==style_value?style_value.replace("italic",""):font_normal,font_style=style_value&&"italic"===style_value.substr(-6)?"italic":"";$this.find(".wpcf--font-weight").val(font_weight),$this.find(".wpcf--font-style").val(font_style)}));var $extra_font_style_block=$this.find(".wpcf--block-extra-styles");if($extra_font_style_block.length)var $extra_font_style_select=$this.find(".wpcf--extra-styles"),first_extra_style_value=$extra_font_style_select.val()}var $subset_block=$this.find(".wpcf--block-subset");if($subset_block.length)var $subset_select=$this.find(".wpcf--subset"),first_subset_select_value=$subset_select.val(),subset_multi_select=$subset_select.data("multiple")||!1;var $backup_font_family_block=$this.find(".wpcf--block-backup-font-family");$font_family_select.on("change wpcf.change",(function(event){$subset_block.length&&$subset_block.addClass("hidden"),$extra_font_style_block.length&&$extra_font_style_block.addClass("hidden"),$backup_font_family_block.length&&$backup_font_family_block.addClass("hidden");var $selected=$font_family_select.find(":selected"),value=$selected.val(),type=$selected.data("type");if(type&&value){if("google"!==type&&"custom"!==type||!$backup_font_family_block.length||$backup_font_family_block.removeClass("hidden"),$font_style_block.length){var styles=defaultstyles;"google"===type&&webfonts[type].fonts[value][0]?styles=webfonts[type].fonts[value][0]:"custom"===type&&webfonts[type].fonts[value]&&(styles=webfonts[type].fonts[value]),selected_styles=styles;var set_auto_style=-1!==styles.indexOf("normal")?"normal":styles[0],set_style_value=first_style_value&&-1!==styles.indexOf(first_style_value)?first_style_value:set_auto_style;base.append_select_options($font_style_select,styles,set_style_value,"style"),first_style_value=!1,$font_style_block.removeClass("hidden"),"google"===type&&$extra_font_style_block.length&&styles.length>1&&(base.append_select_options($extra_font_style_select,styles,first_extra_style_value,"style",!0),first_extra_style_value=!1,$extra_font_style_block.removeClass("hidden"))}if("google"===type&&$subset_block.length&&webfonts[type].fonts[value][1]){var subsets=webfonts[type].fonts[value][1],set_auto_subset=subsets.length<2&&"latin"!==subsets[0]?subsets[0]:"",set_subset_value=first_subset_select_value&&-1!==subsets.indexOf(first_subset_select_value)?first_subset_select_value:set_auto_subset;set_subset_value=subset_multi_select&&first_subset_select_value?first_subset_select_value:set_subset_value,base.append_select_options($subset_select,subsets,set_subset_value,"subset",subset_multi_select),first_subset_select_value=!1,$subset_block.removeClass("hidden")}}else $styles.find(":input").val(""),$subset_block.length&&($subset_select.find("option").not(":first-child").remove(),$subset_select.trigger("chosen:updated")),$font_style_block.length&&($font_style_select.find("option").not(":first-child").remove(),$font_style_select.trigger("chosen:updated"));$type.val(type)})).trigger("wpcf.change");var $preview_block=$this.find(".wpcf--block-preview");if($preview_block.length){var $preview=$this.find(".wpcf--preview");$this.on("change",SP_WPCF.helper.debounce((function(event){$preview_block.removeClass("hidden");var font_family=$font_family_select.val(),font_weight=$this.find(".wpcf--font-weight").val(),font_style=$this.find(".wpcf--font-style").val(),font_size=$this.find(".wpcf--font-size").val(),font_variant=$this.find(".wpcf--font-variant").val(),line_height=$this.find(".wpcf--line-height").val(),text_align=$this.find(".wpcf--text-align").val(),text_transform=$this.find(".wpcf--text-transform").val(),text_decoration=$this.find(".wpcf--text-decoration").val(),text_color=$this.find(".wpcf--color").val(),word_spacing=$this.find(".wpcf--word-spacing").val(),letter_spacing=$this.find(".wpcf--letter-spacing").val(),custom_style=$this.find(".wpcf--custom-style").val(),type;"google"===$this.find(".wpcf--type").val()&&base.load_google_font(font_family,font_weight,font_style);var properties={};font_family&&(properties.fontFamily=font_family),font_weight&&(properties.fontWeight=font_weight),font_style&&(properties.fontStyle=font_style),font_variant&&(properties.fontVariant=font_variant),font_size&&(properties.fontSize=font_size+unit),line_height&&(properties.lineHeight=line_height+line_height_unit),letter_spacing&&(properties.letterSpacing=letter_spacing+unit),word_spacing&&(properties.wordSpacing=word_spacing+unit),text_align&&(properties.textAlign=text_align),text_transform&&(properties.textTransform=text_transform),text_decoration&&(properties.textDecoration=text_decoration),text_color&&(properties.color=text_color),$preview.removeAttr("style"),custom_style&&$preview.attr("style",custom_style),$preview.css(properties)}),100)),$preview_block.on("click",(function(){$preview.toggleClass("wpcf--black-background");var $toggle=$preview_block.find(".wpcf--toggle");$toggle.hasClass("fa-toggle-off")?$toggle.removeClass("fa-toggle-off").addClass("fa-toggle-on"):$toggle.removeClass("fa-toggle-on").addClass("fa-toggle-off")})),$preview_block.hasClass("hidden")||$this.trigger("change")}},base.init()}))},$.fn.wpcf_confirm=function(){return this.each((function(){$(this).on("click",(function(e){var confirm_text=$(this).data("confirm")||window.wpcf_vars.i18n.confirm,confirm_answer;if(!confirm(confirm_text))return e.preventDefault(),!1;SP_WPCF.vars.is_confirm=!0,SP_WPCF.vars.form_modified=!1}))}))},$.fn.serializeObject=function(){var obj={};return $.each(this.serializeArray(),(function(i,o){var n=o.name,v=o.value;obj[n]=void 0===obj[n]?v:$.isArray(obj[n])?obj[n].concat(v):[obj[n],v]})),obj},$.fn.wpcf_save=function(){return this.each((function(){var $this=$(this),$buttons=$(".wpcf-save"),$panel=$(".wpcf-options"),flooding=!1,timeout;$this.on("click",(function(e){if(!flooding){var $text=$this.data("save"),$value=$this.val();$buttons.attr("value",$text),$this.hasClass("wpcf-save-ajax")?(e.preventDefault(),$panel.addClass("wpcf-saving"),$buttons.prop("disabled",!0),window.wp.ajax.post("wpcf_"+$panel.data("unique")+"_ajax_save",{data:$("#wpcf-form").serializeJSONSP_WPCF()}).done((function(response){if($(".wpcf-error").remove(),Object.keys(response.errors).length){var error_icon='<i class="wpcf-label-error wpcf-error">!</i>';$.each(response.errors,(function(key,error_message){var $field=$('[data-depend-id="'+key+'"]'),$link=$('a[href="#tab='+$field.closest(".wpcf-section").data("section-id")+'"]'),$tab=$link.closest(".wpcf-tab-item");$field.closest(".wpcf-fieldset").append('<p class="wpcf-error wpcf-error-text">'+error_message+"</p>"),$link.find(".wpcf-error").length||$link.append(error_icon),$tab.find(".wpcf-arrow .wpcf-error").length||$tab.find(".wpcf-arrow").append(error_icon)}))}$panel.removeClass("wpcf-saving"),$buttons.prop("disabled",!1).attr("value",$value),flooding=!1,SP_WPCF.vars.form_modified=!1,SP_WPCF.vars.$form_warning.hide(),clearTimeout(timeout);var $result_success=$(".wpcf-form-success");$result_success.empty().append(response.notice).fadeIn("fast",(function(){timeout=setTimeout((function(){$result_success.fadeOut("fast")}),1e3)}))})).fail((function(response){alert(response.error)}))):SP_WPCF.vars.form_modified=!1}flooding=!0}))}))},$.fn.wpcf_options=function(){return this.each((function(){var $this=$(this),$content=$this.find(".wpcf-content"),$form_success=$this.find(".wpcf-form-success"),$form_warning=$this.find(".wpcf-form-warning"),$save_button=$this.find(".wpcf-header .wpcf-save");SP_WPCF.vars.$form_warning=$form_warning,$form_warning.length&&(window.onbeforeunload=function(){return!!SP_WPCF.vars.form_modified||void 0},$content.on("change keypress",":input",(function(){SP_WPCF.vars.form_modified||($form_success.hide(),$form_warning.fadeIn("fast"),SP_WPCF.vars.form_modified=!0)}))),$form_success.hasClass("wpcf-form-show")&&setTimeout((function(){$form_success.fadeOut("fast")}),1e3),$(document).keydown((function(event){if((event.ctrlKey||event.metaKey)&&83===event.which)return $save_button.trigger("click"),event.preventDefault(),!1}))}))},$.fn.wpcf_taxonomy=function(){return this.each((function(){var $this=$(this),$form=$this.parents("form");if("addtag"===$form.attr("id")){var $submit=$form.find("#submit"),$cloned=$this.find(".wpcf-field").wpcf_clone();$submit.on("click",(function(){$form.find(".form-required").hasClass("form-invalid")||($this.data("inited",!1),$this.empty(),$this.html($cloned),$cloned=$cloned.wpcf_clone(),$this.wpcf_reload_script())}))}}))},$.fn.wpcf_shortcode=function(){var base=this;return base.shortcode_parse=function(serialize,key){var shortcode="";return $.each(serialize,(function(shortcode_key,shortcode_values){shortcode+="["+(key=key||shortcode_key),$.each(shortcode_values,(function(shortcode_tag,shortcode_value){"content"===shortcode_tag?(shortcode+="]",shortcode+=shortcode_value,shortcode+="[/"+key):shortcode+=base.shortcode_tags(shortcode_tag,shortcode_value)})),shortcode+="]"})),shortcode},base.shortcode_tags=function(shortcode_tag,shortcode_value){var shortcode="";return""!==shortcode_value&&("object"!=typeof shortcode_value||$.isArray(shortcode_value)?shortcode+=" "+shortcode_tag.replace("-","_")+'="'+shortcode_value.toString()+'"':$.each(shortcode_value,(function(sub_shortcode_tag,sub_shortcode_value){switch(sub_shortcode_tag){case"background-image":sub_shortcode_value=sub_shortcode_value.url?sub_shortcode_value.url:""}""!==sub_shortcode_value&&(shortcode+=" "+sub_shortcode_tag.replace("-","_")+'="'+sub_shortcode_value.toString()+'"')}))),shortcode},base.insertAtChars=function(_this,currentValue){var obj=void 0!==_this[0].name?_this[0]:_this;return obj.value.length&&void 0!==obj.selectionStart?(obj.focus(),obj.value.substring(0,obj.selectionStart)+currentValue+obj.value.substring(obj.selectionEnd,obj.value.length)):(obj.focus(),currentValue)},base.send_to_editor=function(html,editor_id){var tinymce_editor;if("undefined"!=typeof tinymce&&(tinymce_editor=tinymce.get(editor_id)),tinymce_editor&&!tinymce_editor.isHidden())tinymce_editor.execCommand("mceInsertContent",!1,html);else{var $editor=$("#"+editor_id);$editor.val(base.insertAtChars($editor,html)).trigger("change")}},this.each((function(){var $modal=$(this),$load=$modal.find(".wpcf-modal-load"),$content=$modal.find(".wpcf-modal-content"),$insert=$modal.find(".wpcf-modal-insert"),$loading=$modal.find(".wpcf-modal-loading"),$select=$modal.find("select"),modal_id=$modal.data("modal-id"),nonce=$modal.data("nonce"),editor_id,target_id,gutenberg_id,sc_key,sc_name,sc_view,sc_group,$cloned,$button;$(document).on("click",'.wpcf-shortcode-button[data-modal-id="'+modal_id+'"]',(function(e){e.preventDefault(),$button=$(this),editor_id=$button.data("editor-id")||!1,target_id=$button.data("target-id")||!1,gutenberg_id=$button.data("gutenberg-id")||!1,$modal.removeClass("hidden"),$modal.hasClass("wpcf-shortcode-single")&&void 0===sc_name&&$select.trigger("change")})),$select.on("change",(function(){var $option=$(this),$selected=$option.find(":selected");sc_key=$option.val(),sc_name=$selected.data("shortcode"),sc_view=$selected.data("view")||"normal",sc_group=$selected.data("group")||sc_name,$load.empty(),sc_key?($loading.show(),window.wp.ajax.post("wpcf-get-shortcode-"+modal_id,{shortcode_key:sc_key,nonce:nonce}).done((function(response){$loading.hide();var $appended=$(response.content).appendTo($load);$insert.parent().removeClass("hidden"),$cloned=$appended.find(".wpcf--repeat-shortcode").wpcf_clone(),$appended.wpcf_reload_script(),$appended.find(".wpcf-fields").wpcf_reload_script()}))):$insert.parent().addClass("hidden")})),$insert.on("click",(function(e){if(e.preventDefault(),!$insert.prop("disabled")&&!$insert.attr("disabled")){var shortcode="",serialize=$modal.find(".wpcf-field:not(.wpcf-depend-on)").find(":input:not(.ignore)").serializeObjectSP_WPCF();switch(sc_view){case"contents":var contentsObj=sc_name?serialize[sc_name]:serialize;$.each(contentsObj,(function(sc_key,sc_value){var sc_tag=sc_name||sc_key;shortcode+="["+sc_tag+"]"+sc_value+"[/"+sc_tag+"]"}));break;case"group":shortcode+="["+sc_name,$.each(serialize[sc_name],(function(sc_key,sc_value){shortcode+=base.shortcode_tags(sc_key,sc_value)})),shortcode+="]",shortcode+=base.shortcode_parse(serialize[sc_group],sc_group),shortcode+="[/"+sc_name+"]";break;case"repeater":shortcode+=base.shortcode_parse(serialize[sc_group],sc_group);break;default:shortcode+=base.shortcode_parse(serialize)}if(shortcode=""===shortcode?"["+sc_name+"]":shortcode,gutenberg_id){var content=window.wpcf_gutenberg_props.attributes.hasOwnProperty("shortcode")?window.wpcf_gutenberg_props.attributes.shortcode:"";window.wpcf_gutenberg_props.setAttributes({shortcode:content+shortcode})}else if(editor_id)base.send_to_editor(shortcode,editor_id);else{var $textarea=target_id?$(target_id):$button.parent().find("textarea");$textarea.val(base.insertAtChars($textarea,shortcode)).trigger("change")}$modal.addClass("hidden")}})),$modal.on("click",".wpcf--repeat-button",(function(e){e.preventDefault();var $repeatable=$modal.find(".wpcf--repeatable"),$new_clone=$cloned.wpcf_clone(),$remove_btn=$new_clone.find(".wpcf-repeat-remove"),$appended=$new_clone.appendTo($repeatable);$new_clone.find(".wpcf-fields").wpcf_reload_script(),SP_WPCF.helper.name_nested_replace($modal.find(".wpcf--repeat-shortcode"),sc_group),$remove_btn.on("click",(function(){$new_clone.remove(),SP_WPCF.helper.name_nested_replace($modal.find(".wpcf--repeat-shortcode"),sc_group)}))})),$modal.on("click",".wpcf-modal-close, .wpcf-modal-overlay",(function(){$modal.addClass("hidden")}))}))},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var hex=parseInt(this._color,10).toString(16);if(this.error)return"";if(hex.length<6)for(var i=6-hex.length-1;i>=0;i--)hex="0"+hex;return"#"+hex}),SP_WPCF.funcs.parse_color=function(color){var value=color.replace(/\s+/g,""),trans=-1!==value.indexOf("rgba")?parseFloat(100*value.replace(/^.*,(.+)\)/,"$1")):100,rgba;return{value:value,transparent:trans,rgba:trans<100}},$.fn.wpcf_color=function(){return this.each((function(){var $input=$(this),picker_color=SP_WPCF.funcs.parse_color($input.val()),palette_color=!window.wpcf_vars.color_palette.length||window.wpcf_vars.color_palette,$container;$input.hasClass("wp-color-picker")&&$input.closest(".wp-picker-container").after($input).remove(),$input.wpColorPicker({palettes:palette_color,change:function(event,ui){var ui_color_value=ui.color.toString();$container.removeClass("wpcf--transparent-active"),$container.find(".wpcf--transparent-offset").css("background-color",ui_color_value),$input.val(ui_color_value).trigger("change")},create:function(){$container=$input.closest(".wp-picker-container");var a8cIris=$input.data("a8cIris"),$transparent_wrap=$('<div class="wpcf--transparent-wrap"><div class="wpcf--transparent-slider"></div><div class="wpcf--transparent-offset"></div><div class="wpcf--transparent-text"></div><div class="wpcf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo($container.find(".wp-picker-holder")),$transparent_slider=$transparent_wrap.find(".wpcf--transparent-slider"),$transparent_text=$transparent_wrap.find(".wpcf--transparent-text"),$transparent_offset=$transparent_wrap.find(".wpcf--transparent-offset"),$transparent_button=$transparent_wrap.find(".wpcf--transparent-button");"transparent"===$input.val()&&$container.addClass("wpcf--transparent-active"),$transparent_button.on("click",(function(){"transparent"!==$input.val()?($input.val("transparent").trigger("change").removeClass("iris-error"),$container.addClass("wpcf--transparent-active")):($input.val(a8cIris._color.toString()).trigger("change"),$container.removeClass("wpcf--transparent-active"))})),$transparent_slider.slider({value:picker_color.transparent,step:1,min:0,max:100,slide:function(event,ui){var slide_value=parseFloat(ui.value/100);a8cIris._color._alpha=slide_value,$input.wpColorPicker("color",a8cIris._color.toString()),$transparent_text.text(1===slide_value||0===slide_value?"":slide_value)},create:function(){var slide_value=parseFloat(picker_color.transparent/100),text_value=slide_value<1?slide_value:"";$transparent_text.text(text_value),$transparent_offset.css("background-color",picker_color.value),$container.on("click",".wp-picker-clear",(function(){a8cIris._color._alpha=1,$transparent_text.text(""),$transparent_slider.slider("option","value",100),$container.removeClass("wpcf--transparent-active"),$input.trigger("change")})),$container.on("click",".wp-picker-default",(function(){var default_color=SP_WPCF.funcs.parse_color($input.data("default-color")),default_value=parseFloat(default_color.transparent/100),default_text=default_value<1?default_value:"";a8cIris._color._alpha=default_value,$transparent_text.text(default_text),$transparent_slider.slider("option","value",default_color.transparent),"transparent"===default_color.value&&($input.removeClass("iris-error"),$container.addClass("wpcf--transparent-active"))}))}})}})}))},$.fn.wpcf_chosen=function(){return this.each((function(){var $this=$(this),$inited=$this.parent().find(".chosen-container"),is_sortable=$this.hasClass("wpcf-chosen-sortable")||!1,is_ajax=$this.hasClass("wpcf-chosen-ajax")||!1,is_multiple=$this.attr("multiple")||!1,set_width=is_multiple?"100%":"auto",set_options=$.extend({allow_single_deselect:!0,disable_search_threshold:10,width:set_width,no_results_text:window.wpcf_vars.i18n.no_results_text},$this.data("chosen-settings"));if($inited.length&&$inited.remove(),is_ajax){var set_ajax_options=$.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:window.wpcf_vars.i18n.typing_text,searching_text:window.wpcf_vars.i18n.searching_text,no_results_text:window.wpcf_vars.i18n.no_results_text},$this.data("chosen-settings"));$this.SP_WPCFAjaxChosen(set_ajax_options)}else $this.chosen(set_options);if(is_multiple){var $hidden_select=$this.parent().find(".wpcf-hide-select"),$hidden_value=$hidden_select.val()||[];$this.on("change",(function(obj,result){result&&result.selected?$hidden_select.append('<option value="'+result.selected+'" selected="selected">'+result.selected+"</option>"):result&&result.deselected&&$hidden_select.find('option[value="'+result.deselected+'"]').remove(),void 0!==window.wp.customize&&0===$hidden_select.children().length&&$hidden_select.data("customize-setting-link")&&window.wp.customize.control($hidden_select.data("customize-setting-link")).setting.set(""),$hidden_select.trigger("change")})),$this.SP_WPCFChosenOrder($hidden_value,!0)}if(is_sortable){var $chosen_container,$chosen_choices=$this.parent().find(".chosen-container").find(".chosen-choices");$chosen_choices.bind("mousedown",(function(event){$(event.target).is("span")&&event.stopPropagation()})),$chosen_choices.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,ui){ui.placeholder.width(ui.item.innerWidth()),ui.placeholder.height(ui.item.innerHeight())},update:function(e,ui){var select_options="",chosen_object=$this.data("chosen"),$prev_select=$this.parent().find(".wpcf-hide-select");$chosen_choices.find(".search-choice-close").each((function(){var option_array_index=$(this).data("option-array-index");$.each(chosen_object.results_data,(function(index,data){data.array_index===option_array_index&&(select_options+='<option value="'+data.value+'" selected>'+data.value+"</option>")}))})),$prev_select.children().remove(),$prev_select.append(select_options),$prev_select.trigger("change")}})}}))},$.fn.wpcf_checkbox=function(){return this.each((function(){var $this=$(this),$input=$this.find(".wpcf--input"),$checkbox=$this.find(".wpcf--checkbox");$checkbox.on("click",(function(){$input.val(Number($checkbox.prop("checked"))).trigger("change")}))}))},$.fn.wpcf_siblings=function(){return this.each((function(){var $this=$(this),$siblings=$this.find(".wpcf--sibling"),multiple=$this.data("multiple")||!1;$siblings.on("click",(function(){var $sibling=$(this);multiple?$sibling.hasClass("wpcf--active")?($sibling.removeClass("wpcf--active"),$sibling.find("input").prop("checked",!1).trigger("change")):($sibling.addClass("wpcf--active"),$sibling.find("input").prop("checked",!0).trigger("change")):($this.find("input").prop("checked",!1),$sibling.find("input").prop("checked",!0).trigger("change"),$sibling.addClass("wpcf--active").siblings().removeClass("wpcf--active"))}))}))},$.fn.wpcf_help=function(){return this.each((function(){var $this=$(this),$tooltip,offset_left;$this.on({mouseenter:function(){$tooltip=$('<div class="wpcf-tooltip"></div>').html($this.find(".wpcf-help-text").html()).appendTo("body"),SP_WPCF.vars.is_rtl,offset_left=$this.offset().left+24,$tooltip.css({top:$this.offset().top-($tooltip.outerHeight()/2-14),left:offset_left})},mouseleave:function(){void 0!==$tooltip&&$tooltip.remove()}})}))},$.fn.wpcf_customizer_refresh=function(){return this.each((function(){var $this=$(this),$complex=$this.closest(".wpcf-customize-complex");if($complex.length){var unique_id=$complex.data("unique-id");if(void 0===unique_id)return;var $input=$complex.find(":input"),option_id=$complex.data("option-id"),obj=$input.serializeObjectSP_WPCF(),data=!$.isEmptyObject(obj)&&obj[unique_id]&&obj[unique_id][option_id]?obj[unique_id][option_id]:"",control=window.wp.customize.control(unique_id+"["+option_id+"]");control.setting._value=null,control.setting.set(data)}else $this.find(":input").first().trigger("change");$(document).trigger("wpcf-customizer-refresh",$this)}))},SP_WPCF.vars.$window.on("resize wpcf.resize",SP_WPCF.helper.debounce((function(event){var window_width;(navigator.userAgent.indexOf("AppleWebKit/")>-1?SP_WPCF.vars.$window.width():window.innerWidth)<=782&&!SP_WPCF.vars.onloaded&&($(".wpcf-section").wpcf_reload_script(),SP_WPCF.vars.onloaded=!0)}),200)).trigger("wpcf.resize"),$.fn.wpcf_widgets=function(){this.length&&($(document).on("widget-added widget-updated",(function(event,$widget){$widget.find(".wpcf-fields").wpcf_reload_script()})),$(".widgets-sortables, .control-section-sidebar").on("sortstop",(function(event,ui){ui.item.find(".wpcf-fields").wpcf_reload_script_retry()})),$(document).on("click",".widget-top",(function(event){$(this).parent().find(".wpcf-fields").wpcf_reload_script()})))},$.fn.wpcf_nav_menu=function(){return this.each((function(){var $navmenu=$(this);$navmenu.on("click","a.item-edit",(function(){$(this).closest("li.menu-item").find(".wpcf-fields").wpcf_reload_script()})),$navmenu.on("sortstop",(function(event,ui){ui.item.find(".wpcf-fields").wpcf_reload_script_retry()}))}))},$.fn.wpcf_reload_script_retry=function(){return this.each((function(){var $this=$(this)}))},$.fn.wpcf_reload_script=function(options){var settings=$.extend({dependency:!0},options);return this.each((function(){var $this=$(this);$this.data("inited")||($this.children(".wpcf-field-code_editor").wpcf_field_code_editor(),$this.children(".wpcf-field-gallery").wpcf_field_gallery(),$this.children(".wpcf-field-slider").wpcf_field_slider(),$this.children(".wpcf-field-spinner").wpcf_field_spinner(),$this.children(".wpcf-field-switcher").wpcf_field_switcher(),$this.children(".wpcf-field-typography").wpcf_field_typography(),$this.children(".wpcf-field-border").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-color").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-color_group").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-typography").find(".wpcf-color").wpcf_color(),$this.children(".wpcf-field-select").find(".wpcf-chosen").wpcf_chosen(),$this.children(".wpcf-field-checkbox").find(".wpcf-checkbox").wpcf_checkbox(),$this.children(".wpcf-field-button_set").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field-image_select").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field-carousel_type").find(".wpcf-siblings").wpcf_siblings(),$this.children(".wpcf-field").find(".wpcf-help").wpcf_help(),settings.dependency&&$this.wpcf_dependency(),$this.data("inited",!0),$(document).trigger("wpcf-reload-script",$this))}))},$(document).ready((function(){function wpcf_copyToClipboard(element){var $temp=$("<input>");$("body").append($temp),$temp.val($(element).text()).select(),document.execCommand("copy"),$temp.remove()}function wpcf_SelectText(element){var r=document.createRange(),w=element.get(0);r.selectNodeContents(w);var sel=window.getSelection();sel.removeAllRanges(),sel.addRange(r)}$(".wpcf-save").wpcf_save(),$(".wpcf-options").wpcf_options(),$(".wpcf-sticky-header").wpcf_sticky(),$(".wpcf-nav-options").wpcf_nav_options(),$(".wpcf-nav-metabox").wpcf_nav_metabox(),$(".wpcf-taxonomy").wpcf_taxonomy(),$(".wpcf-page-templates").wpcf_page_templates(),$(".wpcf-post-formats").wpcf_post_formats(),$(".wpcf-shortcode").wpcf_shortcode(),$(".wpcf-search").wpcf_search(),$(".wpcf-confirm").wpcf_confirm(),$(".wpcf-expand-all").wpcf_expand_all(),$(".wpcf-onload").wpcf_reload_script(),$(".widget").wpcf_widgets(),$("#menu-to-edit").wpcf_nav_menu(),$(".wpcf-shortcode-selectable").click((function(e){e.preventDefault(),wpcf_copyToClipboard($(this)),wpcf_SelectText($(this)),$(this).focus().select(),jQuery(".spwpc-after-copy-text").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-after-copy-text").animate({opacity:0},200),jQuery(".spwpc-after-copy-text").animate({bottom:0},0)}),2e3)})),$(".post-type-sp_wp_carousel .shortcode.column-shortcode input").click((function(e){var copyText;e.preventDefault(),$(this).select(),document.execCommand("copy"),jQuery(".spwpc-after-copy-text").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-after-copy-text").animate({opacity:0},200),jQuery(".spwpc-after-copy-text").animate({bottom:0},0)}),2e3)})),$('.wpcp_post_pagination_type label:contains("Pro")').css({"pointer-events":"none",color:"rgba(85,85,85,.6)!important"});var $export_type=$(".wpcp_what_export").find("input:checked").val();$(".wpcp_what_export").on("change",(function(){$export_type=$(this).find("input:checked").val()})),$(".wpcp_export .wpcf--button").click((function(event){event.preventDefault();var $shortcode_ids=$(".wpcp_post_ids select").val();console.log($shortcode_ids);var $ex_nonce=$("#wpcf_options_noncesp_wpcf_tools").val(),selected_shortcode;if("all_shortcodes"===$export_type||"selected_shortcodes"===$export_type)var data={action:"wpcp_export_shortcodes",wpcf_ids:"selected_shortcodes"===$export_type?$shortcode_ids:"all_shortcodes",nonce:$ex_nonce};else $(".wpcf-form-result.wpcf-form-success").text("No carousel selected.").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text("")}),3e3);$.post(ajaxurl,data,(function(resp){if(resp){var json=JSON.stringify(resp);json=[json];var blob=new Blob(json),link=document.createElement("a"),wpcp_time=$.now();link.href=window.URL.createObjectURL(blob),link.download="wp-carousel-export-"+wpcp_time+".json",link.click(),$(".wpcf-form-result.wpcf-form-success").text("Exported successfully!").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text(""),$(".wpcp_post_ids select").val("").trigger("chosen:updated")}),3e3)}}))})),$(".wpcp_import button.import").click((function(event){event.preventDefault();var wpcp_shortcodes=$("#import").prop("files")[0];if(""!=$("#import").val()){var $im_nonce=$("#wpcf_options_noncesp_wpcf_tools").val(),reader=new FileReader;reader.readAsText(wpcp_shortcodes),reader.onload=function(event){var jsonObj=JSON.stringify(event.target.result);$.ajax({url:ajaxurl,type:"POST",data:{shortcode:jsonObj,action:"wpcp_import_shortcodes",nonce:$im_nonce},success:function(resp){$(".wpcf-form-result.wpcf-form-success").text("Imported successfully!").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text(""),$("#import").val(""),window.location.replace($("#wpcf_shortcode_link_redirect").attr("href"))}),2e3)}})}}else $(".wpcf-form-result.wpcf-form-success").text("No exported json file chosen.").show(),setTimeout((function(){$(".wpcf-form-result.wpcf-form-success").hide().text("")}),3e3)})),"gallery"==$('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val()?$(".wpcf-nav-metabox li:nth-child(4)").hide():$(".wpcf-nav-metabox li:nth-child(4)").show(),$(".wpcf-field-image_select.wpcp_layout").on("change",(function(){"gallery"==$('.wpcp_layout input[name="sp_wpcp_shortcode_options[wpcp_layout]"]:checked').val()?$(".wpcf-nav-metabox li:nth-child(4)").hide():$(".wpcf-nav-metabox li:nth-child(4)").show()}))})),$(document).on("keyup change",".sp_wp_carousel_page_wpcp_settings #wpcf-form",(function(e){var $button;e.preventDefault(),$(this).find(".wpcf-save").css({"background-color":"#00C263","pointer-events":"initial"}).val("Save Settings")})),$(".sp_wp_carousel_page_wpcp_settings .wpcf-save").click((function(e){e.preventDefault(),$(this).css({"background-color":"#C5C5C6","pointer-events":"none"}).val("Changes Saved")})),$(document).on("keyup change",".sp_wp_carousel_page_wpcp_settings #wpcf-form",(function(e){var $button;e.preventDefault(),$(this).find(".wpcf-save").css({"background-color":"#00C263","pointer-events":"initial"}).val("Save Settings")})),$(".sp_wp_carousel_page_wpcp_settings .wpcf-save").click((function(e){e.preventDefault(),$(this).css({"background-color":"#C5C5C6","pointer-events":"none"}).val("Changes Saved")}));var preview_box=$("#sp-wpcf-preview-box"),preview_display=$("#sp_wpcf_live_preview").hide();$(document).on("click","#sp__wpcf-show-preview:contains(Hide)",(function(e){var _this;e.preventDefault(),$(this).html('<i class="fa fa-eye" aria-hidden="true"></i> Show Preview'),preview_box.html(""),preview_display.hide()})),$(document).on("click","#sp__wpcf-show-preview:not(:contains(Hide))",(function(e){e.preventDefault();var previewJS=wpcf_vars.previewJS,_data=$("form#post").serialize(),_this=$(this),data={action:"sp_wpcf_preview_meta_box",data:_data,ajax_nonce:$("#wpcf_metabox_noncesp_wpcf_live_preview").val()};$.ajax({type:"POST",url:ajaxurl,data:data,error:function(response){console.log(response)},success:function(response){preview_display.show(),preview_box.html(response),$.getScript(previewJS,(function(){_this.html('<i class="fa fa-eye-slash" aria-hidden="true"></i> Hide Preview'),$(document).on("keyup change",".post-type-sp_wp_carousel",(function(e){e.preventDefault(),_this.html('<i class="fa fa-refresh" aria-hidden="true"></i> Update Preview')})),$("html, body").animate({scrollTop:preview_display.offset().top-50},"slow")})),$(".wpcp-carousel-preloader").animate({opacity:1},600).hide();var carousel_id=$(".wpcp-carousel-section.wpcp-preloader").attr("id");$("#"+carousel_id).animate({opacity:1},600),$(".wpcpro-post-pagination-number").click((function(e){e.preventDefault(),e.stopPropagation(),$(".spwpc-pagination-not-work").animate({opacity:1,bottom:25},300),setTimeout((function(){jQuery(".spwpc-pagination-not-work").animate({opacity:0},200),jQuery(".spwpc-pagination-not-work").animate({bottom:0},0)}),3e3)}))}})}))}(jQuery,window,document);
includes/class-wp-carosuel-free-updates.php CHANGED
@@ -28,6 +28,7 @@ class WP_Carousel_Free_Updates {
28
  */
29
  private static $updates = array(
30
  '2.1.7' => 'updates/update-2.1.7.php',
 
31
  );
32
 
33
  /**
28
  */
29
  private static $updates = array(
30
  '2.1.7' => 'updates/update-2.1.7.php',
31
+ '2.4.7' => 'updates/update-2.4.7.php',
32
  );
33
 
34
  /**
includes/updates/update-2.4.7.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Update version
4
+ *
5
+ * @link https://shapedplugin.com/
6
+ * @since 2.4.7
7
+ *
8
+ * @package WP_Carousel_Free
9
+ * @subpackage WP_Carousel_Free/includes/updates
10
+ */
11
+
12
+ /**
13
+ * Update version.
14
+ */
15
+ update_option( 'wp_carousel_free_version', '2.4.7' );
16
+ update_option( 'wp_carousel_free_db_version', '2.4.7' );
17
+
18
+ /**
19
+ * Update Settings.
20
+ */
21
+ $args = new \WP_Query(
22
+ array(
23
+ 'post_type' => array( 'page' ),
24
+ 'post_status' => 'publish',
25
+ 'posts_per_page' => '300',
26
+ )
27
+ );
28
+
29
+ $post_ids = wp_list_pluck( $args->posts, 'ID' );
30
+ if ( count( $post_ids ) > 0 ) {
31
+ add_filter( 'wp_revisions_to_keep', '__return_false' );
32
+ foreach ( $post_ids as $post_key => $pid ) {
33
+ $post_data = get_post( $pid );
34
+ $post_content = isset( $post_data->post_content ) ? $post_data->post_content : '';
35
+
36
+ if ( ! empty( $post_content ) && ( strpos( $post_content, 'wp:sp-wp-carousel-free' ) !== false ) ) {
37
+ $post_content = preg_replace( '/wp:sp-wp-carousel-free/i', 'wp:sp-wp-carousel-pro', $post_content );
38
+
39
+ $gutenberg_post = array(
40
+ 'ID' => $pid,
41
+ 'post_content' => $post_content,
42
+ );
43
+ // Update the post into the database.
44
+ $pid = wp_update_post( $gutenberg_post );
45
+
46
+ }
47
+
48
+ $post_meta = get_post_meta( $pid, '_elementor_data', true );
49
+
50
+ if ( ! empty( $post_meta ) && ( strpos( $post_meta, 'sp_wp_carousel_free_shortcode' ) !== false ) ) {
51
+ $post_meta = preg_replace( '/sp_wp_carousel_free_shortcode/i', 'sp_wp_carousel_pro_shortcode', $post_meta );
52
+
53
+ update_post_meta( $pid, '_elementor_data', $post_meta );
54
+ }
55
+ }
56
+ }
languages/wp-carousel-free.pot CHANGED
File without changes
public/css/wp-carousel-free-public.min.css CHANGED
File without changes
public/dynamic-style.php CHANGED
@@ -20,7 +20,7 @@ $wpcp_dots = isset( $shortcode_data['wpcp_pagination'] ) ? $shortcode_data['
20
 
21
  if ( $section_title ) {
22
  $old_section_title_margin = isset( $shortcode_data['section_title_margin_bottom'] ) && is_numeric( $shortcode_data['section_title_margin_bottom'] ) ? $shortcode_data['section_title_margin_bottom'] : '30';
23
- $section_title_margin = isset( $shortcode_data['section_title_margin_bottom']['all'] ) && ( $shortcode_data['section_title_margin_bottom']['all'] >= 0 ) ? $shortcode_data['section_title_margin_bottom']['all'] : $old_section_title_margin;
24
  $section_title_dynamic_css .= '
25
  .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title, .postbox .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title, #poststuff .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title {
26
  margin-bottom: ' . $section_title_margin . 'px;
20
 
21
  if ( $section_title ) {
22
  $old_section_title_margin = isset( $shortcode_data['section_title_margin_bottom'] ) && is_numeric( $shortcode_data['section_title_margin_bottom'] ) ? $shortcode_data['section_title_margin_bottom'] : '30';
23
+ $section_title_margin = isset( $shortcode_data['section_title_margin_bottom']['all'] ) && ! empty( $shortcode_data['section_title_margin_bottom']['all'] ) && ( $shortcode_data['section_title_margin_bottom']['all'] >= 0 ) ? $shortcode_data['section_title_margin_bottom']['all'] : $old_section_title_margin;
24
  $section_title_dynamic_css .= '
25
  .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title, .postbox .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title, #poststuff .wpcp-wrapper-' . $post_id . ' .sp-wpcpro-section-title {
26
  margin-bottom: ' . $section_title_margin . 'px;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: shapedplugin, khalilu, shamimmiashuhagh, rubel_miah
3
  Donate link: http://shapedplugin.com/donate
4
  Tags: wordpress carousel, best carousel plugin, image carousel, image slider, post carousel, custom post carousel, custom taxonomy carousel, woocommerce product carousel, content carousel, video carousel, video slider, video lightbox, youtube carousel, video gallery, carousel, slider, responsive slider, responsive carousel, carousel slider, ticker carousel, center mode carousel, slide anything, image gallery, image lightbox, wordpress image gallery, photo gallery, gallery slider, wordpress gallery plugin, gallery, post slider, vimeo slider, self hosted video carousel, content slider, wordpress slider, featured content slider, html slider, horizontal carousel slider, posts content slider, product carousel, woocommerce slider, woocommerce product slider
5
  Requires at least: 4.5
6
- Tested up to: 5.9.3
7
- Stable tag: 2.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -327,10 +327,15 @@ Thank you!
327
 
328
  == Changelog ==
329
 
 
 
 
 
 
330
  = 2.4.6 – Apr 30, 2022 =
331
  * Improved: SVG preloading icon has been added as a pre-loader image.
332
  * Updated: The language (.pot) file.
333
- * Fix: Some assets of the backend are not loaded properly when the hosting directory is different.
334
  * Fix: RTL Slider direction issue.
335
 
336
  = 2.4.5 – Apr 16, 2022 =
3
  Donate link: http://shapedplugin.com/donate
4
  Tags: wordpress carousel, best carousel plugin, image carousel, image slider, post carousel, custom post carousel, custom taxonomy carousel, woocommerce product carousel, content carousel, video carousel, video slider, video lightbox, youtube carousel, video gallery, carousel, slider, responsive slider, responsive carousel, carousel slider, ticker carousel, center mode carousel, slide anything, image gallery, image lightbox, wordpress image gallery, photo gallery, gallery slider, wordpress gallery plugin, gallery, post slider, vimeo slider, self hosted video carousel, content slider, wordpress slider, featured content slider, html slider, horizontal carousel slider, posts content slider, product carousel, woocommerce slider, woocommerce product slider
5
  Requires at least: 4.5
6
+ Tested up to: 6.0
7
+ Stable tag: 2.4.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
327
 
328
  == Changelog ==
329
 
330
+ = 2.4.7 – May 21, 2022 =
331
+ * Tested: WordPress 6.0 compatibility.
332
+ * Fix: CSS warning if the margin-bottom of section title leaves empty.
333
+ * Fix: Hide the Carousel Settings tab when the gallery layout is selected.
334
+
335
  = 2.4.6 – Apr 30, 2022 =
336
  * Improved: SVG preloading icon has been added as a pre-loader image.
337
  * Updated: The language (.pot) file.
338
+ * Fix: Some assets of the backend don't load properly when the hosting directory is different.
339
  * Fix: RTL Slider direction issue.
340
 
341
  = 2.4.5 – Apr 16, 2022 =
wp-carousel-free.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: WordPress Carousel
10
  * Plugin URI: https://shapedplugin.com/plugin/wordpress-carousel-pro/?ref=1
11
  * Description: The Most Powerful and User-friendly WordPress Carousel Plugin. Create beautiful carousels in minutes using Images, Posts, WooCommerce Products etc.
12
- * Version: 2.4.6
13
  * Author: ShapedPlugin
14
  * Author URI: https://shapedplugin.com/
15
  * License: GPL-2.0+
@@ -119,7 +119,7 @@ class SP_WP_Carousel_Free {
119
  */
120
  public function setup() {
121
  $this->plugin_name = 'wp-carousel-free';
122
- $this->version = '2.4.6';
123
  $this->define_constants();
124
  $this->includes();
125
  $this->load_dependencies();
9
  * Plugin Name: WordPress Carousel
10
  * Plugin URI: https://shapedplugin.com/plugin/wordpress-carousel-pro/?ref=1
11
  * Description: The Most Powerful and User-friendly WordPress Carousel Plugin. Create beautiful carousels in minutes using Images, Posts, WooCommerce Products etc.
12
+ * Version: 2.4.7
13
  * Author: ShapedPlugin
14
  * Author URI: https://shapedplugin.com/
15
  * License: GPL-2.0+
119
  */
120
  public function setup() {
121
  $this->plugin_name = 'wp-carousel-free';
122
+ $this->version = '2.4.7';
123
  $this->define_constants();
124
  $this->includes();
125
  $this->load_dependencies();