Version Description
- 14 September 2020 =
- Block Editor: Added SEO support for multiple Layout Block instances.
- Yoast SEO Sitemap: Added images added using Page Builder.
- Prevented potential
Are you sure you want to navigate away?
notice. - Post Loop: Resolved
Undefined index
notice when used outside of Page Builder. - Android Chrome: Improved edit widget touch detection.
- Yoast SEO: Resolved version
14.6
integration issue. - Block Editor: Used new categories for the Layout Block for WP 5.5+.
- Block Editor: Resolved potential Layout Block data validation issue by running
wp_targeted_link_rel
on the generated preview content. - Block Editor: Added preview support for the Layout Block.
- Block Editor: Updated translation functions to avoid potential conflicts.
- Block Editor: Added the page name and block number to Layout Block JSON export files.
- Block Editor: Improved SEO plugin support.
- Added a global
Row Mobile Bottom Margin
setting atSettings > Page Builder > Layout
. - Ensured Yoast SEO is ready before running compatibility functionality.
- Global Settings: Resolved a jQuery Migrate Helper warning.
Download this release
Release Info
Developer | gpriday |
Plugin | Page Builder by SiteOrigin |
Version | 2.11.3 |
Comparing to | |
See all releases |
Code changes from version 2.11.2 to 2.11.3
- compat/js/siteorigin-panels-layout-block.js +59 -12
- compat/js/siteorigin-panels-layout-block.min.js +1 -1
- compat/layout-block.php +7 -0
- compat/yoast-sitemap.php +40 -0
- css/admin.css +0 -0
- css/images/cell-selected.png +0 -0
- css/images/cell-width.png +0 -0
- css/images/dialog-separator.png +0 -0
- css/images/dialog-separator@2x.png +0 -0
- css/images/dropdown-pointer.png +0 -0
- css/images/tooltip-pointer.png +0 -0
- css/images/wpspin_light-2x.gif +0 -0
- css/images/wpspin_light.gif +0 -0
- inc/admin.php +11 -2
- inc/live-editor.php +0 -0
- inc/renderer.php +1 -1
- inc/revisions.php +0 -0
- inc/settings.php +18 -10
- inc/sidebars-emulator.php +0 -0
- inc/styles.php +0 -0
- inc/widgets/post-loop.php +24 -13
- js/seo-compat.js +40 -21
- js/seo-compat.min.js +1 -1
- js/siteorigin-panels.js +60 -29
- js/siteorigin-panels.min.js +2 -2
- js/styling.js +5 -5
- js/styling.min.js +1 -1
- lang/siteorigin-panels.pot +124 -116
- license.txt +0 -0
- readme.txt +20 -2
- settings/admin-settings.css +0 -0
- settings/admin-settings.js +2 -3
- settings/admin-settings.min.js +1 -1
- settings/images/icon-layer.png +0 -0
- settings/tpl/help.php +0 -0
- settings/tpl/settings.php +0 -0
- siteorigin-panels.php +47 -42
- tpl/admin-home-page.php +0 -0
- tpl/help.php +0 -0
- tpl/js-templates.php +0 -0
- tpl/metabox-panels.php +0 -0
- widgets/img/checks/black.png +0 -0
- widgets/img/checks/blue.png +0 -0
- widgets/img/checks/charcoal.png +0 -0
- widgets/img/checks/green.png +0 -0
- widgets/img/checks/light.png +0 -0
- widgets/img/checks/orange.png +0 -0
- widgets/img/checks/pink.png +0 -0
- widgets/img/checks/purple.png +0 -0
- widgets/img/checks/slate.png +0 -0
- widgets/img/checks/tirquoise.png +0 -0
- widgets/img/textures/dark-dashed.png +0 -0
- widgets/img/textures/light-dashed.png +0 -0
- widgets/js/admin.js +0 -0
- widgets/js/embedded-video.js +0 -0
- widgets/js/jquery.fitvids.min.js +0 -0
- widgets/less/functions.php +0 -0
- widgets/lib/color.php +0 -0
- widgets/lib/lessc.inc.php +0 -0
- widgets/migration.php +0 -0
- widgets/widgets.php +0 -0
- widgets/widgets/animated-image/animated-image.php +0 -0
- widgets/widgets/animated-image/js/main.js +0 -0
- widgets/widgets/animated-image/js/onscreen.js +0 -0
- widgets/widgets/animated-image/tpl/default.php +0 -0
- widgets/widgets/button/button.php +0 -0
- widgets/widgets/button/presets/simple.php +0 -0
- widgets/widgets/button/styles/simple.less +0 -0
- widgets/widgets/button/tpl/simple.php +0 -0
- widgets/widgets/call-to-action/call-to-action.php +0 -0
- widgets/widgets/call-to-action/presets/simple.php +0 -0
- widgets/widgets/call-to-action/styles/simple.less +0 -0
- widgets/widgets/call-to-action/tpl/simple.php +0 -0
- widgets/widgets/list/list.php +0 -0
- widgets/widgets/list/presets/simple.php +0 -0
- widgets/widgets/list/styles/simple.less +0 -0
- widgets/widgets/list/tpl/simple.php +0 -0
- widgets/widgets/price-box/presets/simple.php +0 -0
- widgets/widgets/price-box/price-box.php +0 -0
- widgets/widgets/price-box/styles/simple.less +0 -0
- widgets/widgets/price-box/tpl/simple.php +0 -0
- widgets/widgets/testimonial/presets/simple.php +0 -0
- widgets/widgets/testimonial/styles/simple.less +0 -0
- widgets/widgets/testimonial/testimonial.php +0 -0
- widgets/widgets/testimonial/tpl/simple.php +0 -0
compat/js/siteorigin-panels-layout-block.js
CHANGED
@@ -8,16 +8,46 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
8 |
Â
|
9 |
Â
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
10 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
11 |
Â
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
12 |
Â
|
13 |
Â
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
14 |
Â
|
15 |
Â
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
16 |
Â
|
17 |
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
18 |
-
|
19 |
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
20 |
-
|
21 |
Â
var _lodash = lodash,
|
22 |
Â
isEqual = _lodash.isEqual,
|
23 |
Â
debounce = _lodash.debounce,
|
@@ -34,7 +64,6 @@ var _wp$components = wp.components,
|
|
34 |
Â
Toolbar = _wp$components.Toolbar,
|
35 |
Â
IconButton = _wp$components.IconButton,
|
36 |
Â
Spinner = _wp$components.Spinner;
|
37 |
-
var __ = wp.i18n.__;
|
38 |
Â
var _window = window,
|
39 |
Â
soPanelsBlockEditorAdmin = _window.soPanelsBlockEditorAdmin;
|
40 |
Â
|
@@ -43,12 +72,14 @@ var SiteOriginPanelsLayoutBlock =
|
|
43 |
Â
function (_Component) {
|
44 |
Â
_inherits(SiteOriginPanelsLayoutBlock, _Component);
|
45 |
Â
|
Â
|
|
Â
|
|
46 |
Â
function SiteOriginPanelsLayoutBlock(props) {
|
47 |
Â
var _this;
|
48 |
Â
|
49 |
Â
_classCallCheck(this, SiteOriginPanelsLayoutBlock);
|
50 |
Â
|
51 |
-
_this =
|
52 |
Â
var editMode = soPanelsBlockEditorAdmin.defaultMode === 'edit' || isEmpty(props.panelsData);
|
53 |
Â
_this.state = {
|
54 |
Â
editing: editMode,
|
@@ -167,6 +198,12 @@ function (_Component) {
|
|
167 |
Â
}
|
168 |
Â
});
|
169 |
Â
jQuery(document).trigger('panels_setup', this.builderView);
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
170 |
Â
this.panelsInitialized = true;
|
171 |
Â
}
|
172 |
Â
}, {
|
@@ -222,7 +259,7 @@ function (_Component) {
|
|
222 |
Â
return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
|
223 |
Â
icon: "visibility",
|
224 |
Â
className: "components-icon-button components-toolbar__control",
|
225 |
-
label: __('Preview layout.', 'siteorigin-panels'),
|
226 |
Â
onClick: switchToPreview
|
227 |
Â
}))), React.createElement("div", {
|
228 |
Â
key: "layout-block",
|
@@ -234,7 +271,7 @@ function (_Component) {
|
|
234 |
Â
return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
|
235 |
Â
icon: "edit",
|
236 |
Â
className: "components-icon-button components-toolbar__control",
|
237 |
-
label: __('Edit layout.', 'siteorigin-panels'),
|
238 |
Â
onClick: switchToEditing
|
239 |
Â
}))), React.createElement("div", {
|
240 |
Â
key: "preview",
|
@@ -252,15 +289,18 @@ function (_Component) {
|
|
252 |
Â
return SiteOriginPanelsLayoutBlock;
|
253 |
Â
}(Component);
|
254 |
Â
|
Â
|
|
Â
|
|
Â
|
|
255 |
Â
registerBlockType('siteorigin-panels/layout-block', {
|
256 |
-
title: __('SiteOrigin Layout', 'siteorigin-panels'),
|
257 |
-
description: __("Build a layout using SiteOrigin's Page Builder.", 'siteorigin-panels'),
|
258 |
Â
icon: function icon() {
|
259 |
Â
return React.createElement("span", {
|
260 |
Â
className: "siteorigin-panels-block-icon"
|
261 |
Â
});
|
262 |
Â
},
|
263 |
-
category: 'layout',
|
264 |
Â
keywords: ['page builder', 'column,grid', 'panel'],
|
265 |
Â
supports: {
|
266 |
Â
html: false
|
@@ -364,4 +404,11 @@ registerBlockType('siteorigin-panels/layout-block', {
|
|
364 |
Â
}, 100);
|
365 |
Â
});
|
366 |
Â
}
|
367 |
-
})(jQuery);
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
8 |
Â
|
9 |
Â
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
10 |
Â
|
11 |
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
12 |
+
|
13 |
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
14 |
+
|
15 |
+
function _createSuper(Derived) {
|
16 |
+
function isNativeReflectConstruct() {
|
17 |
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
18 |
+
if (Reflect.construct.sham) return false;
|
19 |
+
if (typeof Proxy === "function") return true;
|
20 |
+
|
21 |
+
try {
|
22 |
+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
23 |
+
return true;
|
24 |
+
} catch (e) {
|
25 |
+
return false;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
return function () {
|
30 |
+
var Super = _getPrototypeOf(Derived),
|
31 |
+
result;
|
32 |
+
|
33 |
+
if (isNativeReflectConstruct()) {
|
34 |
+
var NewTarget = _getPrototypeOf(this).constructor;
|
35 |
+
|
36 |
+
result = Reflect.construct(Super, arguments, NewTarget);
|
37 |
+
} else {
|
38 |
+
result = Super.apply(this, arguments);
|
39 |
+
}
|
40 |
+
|
41 |
+
return _possibleConstructorReturn(this, result);
|
42 |
+
};
|
43 |
+
}
|
44 |
+
|
45 |
Â
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
46 |
Â
|
47 |
Â
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
48 |
Â
|
49 |
Â
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
50 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
51 |
Â
var _lodash = lodash,
|
52 |
Â
isEqual = _lodash.isEqual,
|
53 |
Â
debounce = _lodash.debounce,
|
64 |
Â
Toolbar = _wp$components.Toolbar,
|
65 |
Â
IconButton = _wp$components.IconButton,
|
66 |
Â
Spinner = _wp$components.Spinner;
|
Â
|
|
67 |
Â
var _window = window,
|
68 |
Â
soPanelsBlockEditorAdmin = _window.soPanelsBlockEditorAdmin;
|
69 |
Â
|
72 |
Â
function (_Component) {
|
73 |
Â
_inherits(SiteOriginPanelsLayoutBlock, _Component);
|
74 |
Â
|
75 |
+
var _super = _createSuper(SiteOriginPanelsLayoutBlock);
|
76 |
+
|
77 |
Â
function SiteOriginPanelsLayoutBlock(props) {
|
78 |
Â
var _this;
|
79 |
Â
|
80 |
Â
_classCallCheck(this, SiteOriginPanelsLayoutBlock);
|
81 |
Â
|
82 |
+
_this = _super.call(this, props);
|
83 |
Â
var editMode = soPanelsBlockEditorAdmin.defaultMode === 'edit' || isEmpty(props.panelsData);
|
84 |
Â
_this.state = {
|
85 |
Â
editing: editMode,
|
198 |
Â
}
|
199 |
Â
});
|
200 |
Â
jQuery(document).trigger('panels_setup', this.builderView);
|
201 |
+
|
202 |
+
if ( typeof window.soPanelsBuilderView == 'undefined' ) {
|
203 |
+
window.soPanelsBuilderView = [];
|
204 |
+
}
|
205 |
+
window.soPanelsBuilderView.push( this.builderView );
|
206 |
+
|
207 |
Â
this.panelsInitialized = true;
|
208 |
Â
}
|
209 |
Â
}, {
|
259 |
Â
return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
|
260 |
Â
icon: "visibility",
|
261 |
Â
className: "components-icon-button components-toolbar__control",
|
262 |
+
label: wp.i18n.__('Preview layout.', 'siteorigin-panels'),
|
263 |
Â
onClick: switchToPreview
|
264 |
Â
}))), React.createElement("div", {
|
265 |
Â
key: "layout-block",
|
271 |
Â
return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
|
272 |
Â
icon: "edit",
|
273 |
Â
className: "components-icon-button components-toolbar__control",
|
274 |
+
label: wp.i18n.__('Edit layout.', 'siteorigin-panels'),
|
275 |
Â
onClick: switchToEditing
|
276 |
Â
}))), React.createElement("div", {
|
277 |
Â
key: "preview",
|
289 |
Â
return SiteOriginPanelsLayoutBlock;
|
290 |
Â
}(Component);
|
291 |
Â
|
292 |
+
var hasLayoutCategory = wp.blocks.getCategories().some(function (category) {
|
293 |
+
return category.slug === 'layout';
|
294 |
+
});
|
295 |
Â
registerBlockType('siteorigin-panels/layout-block', {
|
296 |
+
title: wp.i18n.__('SiteOrigin Layout', 'siteorigin-panels'),
|
297 |
+
description: wp.i18n.__("Build a layout using SiteOrigin's Page Builder.", 'siteorigin-panels'),
|
298 |
Â
icon: function icon() {
|
299 |
Â
return React.createElement("span", {
|
300 |
Â
className: "siteorigin-panels-block-icon"
|
301 |
Â
});
|
302 |
Â
},
|
303 |
+
category: hasLayoutCategory ? 'layout' : 'design',
|
304 |
Â
keywords: ['page builder', 'column,grid', 'panel'],
|
305 |
Â
supports: {
|
306 |
Â
html: false
|
404 |
Â
}, 100);
|
405 |
Â
});
|
406 |
Â
}
|
407 |
+
})(jQuery);
|
408 |
+
|
409 |
+
// Detect preview mode changes, and trigger resize.
|
410 |
+
jQuery(document).on('click', '.block-editor-post-preview__button-resize', function (e) {
|
411 |
+
if (!jQuery(this).hasClass('has-icon')) {
|
412 |
+
jQuery(window).trigger('resize');
|
413 |
+
}
|
414 |
+
});
|
compat/js/siteorigin-panels-layout-block.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function
|
1 |
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,i=_getPrototypeOf(e);if(t()){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _lodash=lodash,isEqual=_lodash.isEqual,debounce=_lodash.debounce,isEmpty=_lodash.isEmpty,isFunction=_lodash.isFunction,registerBlockType=wp.blocks.registerBlockType,_wp$element=wp.element,Component=_wp$element.Component,Fragment=_wp$element.Fragment,RawHTML=_wp$element.RawHTML,createRef=_wp$element.createRef,BlockControls=wp.editor.BlockControls,_wp$components=wp.components,Toolbar=_wp$components.Toolbar,IconButton=_wp$components.IconButton,Spinner=_wp$components.Spinner,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){_inherits(n,Component);var t=_createSuper(n);function n(e){var i;_classCallCheck(this,n),i=t.call(this,e);var o="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return i.state={editing:o,loadingPreview:!o,previewHtml:""},i.panelsContainer=createRef(),i.previewContainer=createRef(),i.panelsInitialized=!1,i.previewInitialized=!1,i}return _createClass(n,[{key:"componentDidMount",value:function(){this.isStillMounted=!0,this.state.editing?this.setupPanels():this.state.editing||this.previewInitialized||(this.fetchPreview(this.props),this.fetchPreview=debounce(this.fetchPreview,500))}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1,this.builderView&&this.builderView.off("content_change")}},{key:"componentDidUpdate",value:function(e){this.state.editing&&!this.panelsInitialized?this.setupPanels():this.state.loadingPreview?this.fetchPreview(this.props):!this.previewInitialized&&this.previewContainer.current&&(jQuery(document).trigger("panels_setup_preview"),this.previewInitialized=!0)}},{key:"setupPanels",value:function(){var e=this,t=jQuery(this.panelsContainer.current),n={editorType:"standalone",loadLiveEditor:!1,postId:soPanelsBlockEditorAdmin.postId,liveEditorPreview:soPanelsBlockEditorAdmin.liveEditor},i=new panels.model.builder;this.builderView=new panels.view.builder({model:i,config:n});var o=JSON.parse(JSON.stringify(jQuery.extend({},this.props.panelsData))),r=function(){isFunction(e.props.onRowOrWidgetMouseDown)&&e.props.onRowOrWidgetMouseDown();jQuery(document).on("mouseup",(function t(){jQuery(document).off("mouseup",t),isFunction(e.props.onRowOrWidgetMouseUp)&&e.props.onRowOrWidgetMouseUp()}))};this.builderView.on("row_added",(function(){e.builderView.$(".so-row-move").off("mousedown",r),e.builderView.$(".so-row-move").on("mousedown",r),e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.on("widget_added",(function(){e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.render().attach({container:t}).setData(o),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",(function(){var t=e.builderView.getData();e.panelsDataChanged=!isEqual(o,t),e.panelsDataChanged&&(e.props.onContentChange&&isFunction(e.props.onContentChange)&&e.props.onContentChange(t),e.setState({loadingPreview:!0,previewHtml:""}))})),jQuery(document).trigger("panels_setup",this.builderView),void 0===window.soPanelsBuilderView&&(window.soPanelsBuilderView=[]),window.soPanelsBuilderView.push(this.builderView),this.panelsInitialized=!0}},{key:"fetchPreview",value:function(e){var t=this;if(this.isStillMounted){this.previewInitialized=!1;var n=this.currentFetchRequest=jQuery.post({url:soPanelsBlockEditorAdmin.previewUrl,data:{action:"so_panels_layout_block_preview",panelsData:JSON.stringify(e.panelsData)}}).then((function(e){t.isStillMounted&&n===t.currentFetchRequest&&e&&t.setState({previewHtml:e,loadingPreview:!1})}));return n}}},{key:"render",value:function(){var e=this,t=this.props.panelsData;if(this.state.editing)return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"visibility",className:"components-icon-button components-toolbar__control",label:wp.i18n.__("Preview layout.","siteorigin-panels"),onClick:function(){t&&e.setState({editing:!1})}}))),React.createElement("div",{key:"layout-block",className:"siteorigin-panels-layout-block-container",ref:this.panelsContainer}));var n=this.state.loadingPreview;return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"edit",className:"components-icon-button components-toolbar__control",label:wp.i18n.__("Edit layout.","siteorigin-panels"),onClick:function(){e.panelsInitialized=!1,e.setState({editing:!0})}}))),React.createElement("div",{key:"preview",className:"so-panels-block-layout-preview-container"},n?React.createElement("div",{className:"so-panels-spinner-container"},React.createElement("span",null,React.createElement(Spinner,null))):React.createElement("div",{className:"so-panels-raw-html-container",ref:this.previewContainer},React.createElement(RawHTML,null,this.state.previewHtml))))}}]),n}(),hasLayoutCategory=wp.blocks.getCategories().some((function(e){return"layout"===e.slug}));registerBlockType("siteorigin-panels/layout-block",{title:wp.i18n.__("SiteOrigin Layout","siteorigin-panels"),description:wp.i18n.__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:hasLayoutCategory?"layout":"design",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"},contentPreview:{type:"string"}},edit:function(e){var t=e.attributes,n=e.setAttributes,i=e.toggleSelection;return React.createElement(SiteOriginPanelsLayoutBlock,{panelsData:t.panelsData,onContentChange:function(e){_.isEmpty(e.widgets)||(wp.data.dispatch("core/editor").lockPostSaving(),jQuery.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:wp.data.select("core/editor").getCurrentPostId()},(function(e){var t={};""!==e.sanitized_panels_data&&(t.panelsData=e.sanitized_panels_data),""!==e.preview&&(t.contentPreview=e.preview),n(t),wp.data.dispatch("core/editor").unlockPostSaving()})))},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(e){var t=e.attributes;return t.hasOwnProperty("contentPreview")?React.createElement(RawHTML,null,t.contentPreview):null}}),function(e){soPanelsBlockEditorAdmin.showAddButton&&e((function(){setTimeout((function(){var t=wp.data.dispatch("core/editor"),n=wp.data.select("core/editor"),i=e("#siteorigin-panels-add-layout-block-button").html(),o=e(i).insertAfter(".editor-writing-flow > div:first, .block-editor-writing-flow > div:not([tabindex])");o.on("click",(function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(n.isEditedPostEmpty()){var i=n.getBlocks();i.length?t.replaceBlock(i[0].clientId,e):t.insertBlock(e)}else t.insertBlock(e)}));var r=function(){wp.data.select("core/editor").isEditedPostEmpty()?o.show():o.hide()};wp.data.subscribe(r),r()}),100)}))}(jQuery),jQuery(document).on("click",".block-editor-post-preview__button-resize",(function(e){jQuery(this).hasClass("has-icon")||jQuery(window).trigger("resize")}));
|
compat/layout-block.php
CHANGED
@@ -20,6 +20,9 @@ class SiteOrigin_Panels_Compat_Layout_Block {
|
|
20 |
Â
// This action is slightly later than `enqueue_block_editor_assets`,
|
21 |
Â
// which we need to use to ensure our templates are loaded at the right time.
|
22 |
Â
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_layout_block_editor_assets' ) );
|
Â
|
|
Â
|
|
Â
|
|
23 |
Â
}
|
24 |
Â
|
25 |
Â
public function register_layout_block() {
|
@@ -113,4 +116,8 @@ class SiteOrigin_Panels_Compat_Layout_Block {
|
|
113 |
Â
$panels_data = SiteOrigin_Panels_Styles_Admin::single()->sanitize_all( $panels_data );
|
114 |
Â
return $panels_data;
|
115 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
116 |
Â
}
|
20 |
Â
// This action is slightly later than `enqueue_block_editor_assets`,
|
21 |
Â
// which we need to use to ensure our templates are loaded at the right time.
|
22 |
Â
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_layout_block_editor_assets' ) );
|
23 |
+
|
24 |
+
// We need to override the container when using the Block Editor to allow for resizing.
|
25 |
+
add_filter( 'siteorigin_panels_full_width_container', array( $this, 'override_container' ) );
|
26 |
Â
}
|
27 |
Â
|
28 |
Â
public function register_layout_block() {
|
116 |
Â
$panels_data = SiteOrigin_Panels_Styles_Admin::single()->sanitize_all( $panels_data );
|
117 |
Â
return $panels_data;
|
118 |
Â
}
|
119 |
+
|
120 |
+
function override_container( $container ) {
|
121 |
+
return SiteOrigin_Panels_Admin::is_block_editor() ? '.editor-styles-wrapper' : $container;
|
122 |
+
}
|
123 |
Â
}
|
compat/yoast-sitemap.php
ADDED
@@ -0,0 +1,40 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Returns a list of all images added using Page Builder.
|
5 |
+
*
|
6 |
+
* @param $images an array of all detected images used in the current post.
|
7 |
+
* @param $post_id the current post id.
|
8 |
+
*
|
9 |
+
* @return array
|
10 |
+
*/
|
11 |
+
function siteorigin_yoast_sitemap_images_compat( $images, $post_id ) {
|
12 |
+
if (
|
13 |
+
get_post_meta( $post_id, 'panels_data', true ) &&
|
14 |
+
extension_loaded( 'xml' ) &&
|
15 |
+
class_exists( 'DOMDocument' )
|
16 |
+
) {
|
17 |
+
$content = SiteOrigin_Panels::renderer()->render(
|
18 |
+
$post_id,
|
19 |
+
false
|
20 |
+
);
|
21 |
+
|
22 |
+
libxml_use_internal_errors( true );
|
23 |
+
$dom = new DOMDocument();
|
24 |
+
$dom->loadHTML( '<?xml encoding="UTF-8">' . $content );
|
25 |
+
libxml_clear_errors();
|
26 |
+
|
27 |
+
foreach ( $dom->getElementsByTagName( 'img' ) as $img ) {
|
28 |
+
$src = $img->getAttribute( 'src' );
|
29 |
+
|
30 |
+
if ( ! empty( $src ) && $src == esc_url( $src ) ) {
|
31 |
+
$images[] = array(
|
32 |
+
'src' => $src,
|
33 |
+
);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
return $images;
|
39 |
+
}
|
40 |
+
add_filter( 'wpseo_sitemap_urlimages', 'siteorigin_yoast_sitemap_images_compat', 10, 2 );
|
css/admin.css
CHANGED
File without changes
|
css/images/cell-selected.png
CHANGED
File without changes
|
css/images/cell-width.png
CHANGED
File without changes
|
css/images/dialog-separator.png
CHANGED
File without changes
|
css/images/dialog-separator@2x.png
CHANGED
File without changes
|
css/images/dropdown-pointer.png
CHANGED
File without changes
|
css/images/tooltip-pointer.png
CHANGED
File without changes
|
css/images/wpspin_light-2x.gif
CHANGED
File without changes
|
css/images/wpspin_light.gif
CHANGED
File without changes
|
inc/admin.php
CHANGED
@@ -528,11 +528,17 @@ class SiteOrigin_Panels_Admin {
|
|
528 |
Â
|
529 |
Â
public function enqueue_seo_compat(){
|
530 |
Â
if ( self::is_admin() ) {
|
531 |
-
if (
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
532 |
Â
wp_enqueue_script(
|
533 |
Â
'so-panels-seo-compat',
|
534 |
Â
siteorigin_panels_url( 'js/seo-compat' . SITEORIGIN_PANELS_JS_SUFFIX . '.js' ),
|
535 |
-
array('jquery'
|
536 |
Â
SITEORIGIN_PANELS_VERSION,
|
537 |
Â
true
|
538 |
Â
);
|
@@ -1124,6 +1130,9 @@ class SiteOrigin_Panels_Admin {
|
|
1124 |
Â
|
1125 |
Â
$GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] = true;
|
1126 |
Â
$return['preview'] = SiteOrigin_Panels::renderer()->render( intval( $_POST['post_id'] ), false, $panels_data );
|
Â
|
|
Â
|
|
Â
|
|
1127 |
Â
unset( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] );
|
1128 |
Â
|
1129 |
Â
echo json_encode( $return );
|
528 |
Â
|
529 |
Â
public function enqueue_seo_compat(){
|
530 |
Â
if ( self::is_admin() ) {
|
531 |
+
if (
|
532 |
+
defined( 'WPSEO_FILE' ) &&
|
533 |
+
(
|
534 |
+
wp_script_is( 'yoast-seo-admin-global-script' ) || // => 14.6
|
535 |
+
wp_script_is( 'yoast-seo-metabox' ) // <= 14.5
|
536 |
+
)
|
537 |
+
) {
|
538 |
Â
wp_enqueue_script(
|
539 |
Â
'so-panels-seo-compat',
|
540 |
Â
siteorigin_panels_url( 'js/seo-compat' . SITEORIGIN_PANELS_JS_SUFFIX . '.js' ),
|
541 |
+
array( 'jquery' ),
|
542 |
Â
SITEORIGIN_PANELS_VERSION,
|
543 |
Â
true
|
544 |
Â
);
|
1130 |
Â
|
1131 |
Â
$GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] = true;
|
1132 |
Â
$return['preview'] = SiteOrigin_Panels::renderer()->render( intval( $_POST['post_id'] ), false, $panels_data );
|
1133 |
+
if ( function_exists( 'wp_targeted_link_rel' ) ) {
|
1134 |
+
$return['preview'] = wp_targeted_link_rel( $return['preview'] );
|
1135 |
+
}
|
1136 |
Â
unset( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] );
|
1137 |
Â
|
1138 |
Â
echo json_encode( $return );
|
inc/live-editor.php
CHANGED
File without changes
|
inc/renderer.php
CHANGED
@@ -73,7 +73,7 @@ class SiteOrigin_Panels_Renderer {
|
|
73 |
Â
|
74 |
Â
// Filter the bottom margin for this row with the arguments
|
75 |
Â
$panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', $settings['margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
|
76 |
-
$panels_mobile_margin_bottom = apply_filters( 'siteorigin_panels_css_row_mobile_margin_bottom', '', $row, $ri, $panels_data, $post_id );
|
77 |
Â
|
78 |
Â
if ( empty( $row['cells'] ) ) {
|
79 |
Â
continue;
|
73 |
Â
|
74 |
Â
// Filter the bottom margin for this row with the arguments
|
75 |
Â
$panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', $settings['margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
|
76 |
+
$panels_mobile_margin_bottom = apply_filters( 'siteorigin_panels_css_row_mobile_margin_bottom', $settings['row-mobile-margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
|
77 |
Â
|
78 |
Â
if ( empty( $row['cells'] ) ) {
|
79 |
Â
continue;
|
inc/revisions.php
CHANGED
File without changes
|
inc/settings.php
CHANGED
@@ -134,15 +134,16 @@ class SiteOrigin_Panels_Settings {
|
|
134 |
Â
$defaults['instant-open-widgets'] = false;
|
135 |
Â
|
136 |
Â
// The layout fields
|
137 |
-
$defaults['responsive']
|
138 |
-
$defaults['tablet-layout']
|
139 |
-
$defaults['legacy-layout']
|
140 |
-
$defaults['tablet-width']
|
141 |
-
$defaults['mobile-width']
|
142 |
-
$defaults['margin-bottom']
|
143 |
-
$defaults['margin-bottom
|
144 |
-
$defaults['margin-
|
145 |
-
$defaults['
|
Â
|
|
146 |
Â
|
147 |
Â
// Content fields
|
148 |
Â
$defaults['copy-content'] = true;
|
@@ -253,7 +254,7 @@ class SiteOrigin_Panels_Settings {
|
|
253 |
Â
|
254 |
Â
$fields['general']['fields']['use-classic'] = array(
|
255 |
Â
'type' => 'checkbox',
|
256 |
-
'label' => __( 'Use Classic Editor for
|
257 |
Â
'description' => __( 'New posts of the above Post Types will be created using the Classic Editor.', 'siteorigin-panels' )
|
258 |
Â
);
|
259 |
Â
|
@@ -417,6 +418,13 @@ class SiteOrigin_Panels_Settings {
|
|
417 |
Â
'description' => __( 'Default margin below rows and widgets.', 'siteorigin-panels' ),
|
418 |
Â
);
|
419 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
420 |
Â
$fields['layout']['fields']['margin-bottom-last-row'] = array(
|
421 |
Â
'type' => 'checkbox',
|
422 |
Â
'label' => __( 'Last Row With Margin', 'siteorigin-panels' ),
|
134 |
Â
$defaults['instant-open-widgets'] = false;
|
135 |
Â
|
136 |
Â
// The layout fields
|
137 |
+
$defaults['responsive'] = true;
|
138 |
+
$defaults['tablet-layout'] = false;
|
139 |
+
$defaults['legacy-layout'] = 'auto';
|
140 |
+
$defaults['tablet-width'] = 1024;
|
141 |
+
$defaults['mobile-width'] = 780;
|
142 |
+
$defaults['margin-bottom'] = 30;
|
143 |
+
$defaults['row-mobile-margin-bottom'] = '';
|
144 |
+
$defaults['margin-bottom-last-row'] = false;
|
145 |
+
$defaults['margin-sides'] = 30;
|
146 |
+
$defaults['full-width-container'] = 'body';
|
147 |
Â
|
148 |
Â
// Content fields
|
149 |
Â
$defaults['copy-content'] = true;
|
254 |
Â
|
255 |
Â
$fields['general']['fields']['use-classic'] = array(
|
256 |
Â
'type' => 'checkbox',
|
257 |
+
'label' => __( 'Use Classic Editor for New Posts', 'siteorigin-panels' ),
|
258 |
Â
'description' => __( 'New posts of the above Post Types will be created using the Classic Editor.', 'siteorigin-panels' )
|
259 |
Â
);
|
260 |
Â
|
418 |
Â
'description' => __( 'Default margin below rows and widgets.', 'siteorigin-panels' ),
|
419 |
Â
);
|
420 |
Â
|
421 |
+
$fields['layout']['fields']['row-mobile-margin-bottom'] = array(
|
422 |
+
'type' => 'number',
|
423 |
+
'unit' => 'px',
|
424 |
+
'label' => __( 'Row Mobile Bottom Margin', 'siteorigin-panels' ),
|
425 |
+
'description' => __( 'The default margin below rows on mobile.', 'siteorigin-panels' ),
|
426 |
+
);
|
427 |
+
|
428 |
Â
$fields['layout']['fields']['margin-bottom-last-row'] = array(
|
429 |
Â
'type' => 'checkbox',
|
430 |
Â
'label' => __( 'Last Row With Margin', 'siteorigin-panels' ),
|
inc/sidebars-emulator.php
CHANGED
File without changes
|
inc/styles.php
CHANGED
File without changes
|
inc/widgets/post-loop.php
CHANGED
@@ -75,6 +75,7 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget {
|
|
75 |
Â
* @return array
|
76 |
Â
*/
|
77 |
Â
function update( $new, $old ){
|
Â
|
|
78 |
Â
if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
|
79 |
Â
$helper = $this->get_helper_widget( $this->get_loop_templates() );
|
80 |
Â
return $helper->update( $new, $old );
|
@@ -141,22 +142,32 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget {
|
|
141 |
Â
|
142 |
Â
if( $wp_rewrite->using_permalinks() ) {
|
143 |
Â
|
144 |
-
if(
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
Â
|
|
Â
|
|
Â
|
|
152 |
Â
} else {
|
153 |
-
|
154 |
-
|
155 |
-
$query_args['paged'] =
|
156 |
-
} else {
|
157 |
-
|
Â
|
|
Â
|
|
Â
|
|
158 |
Â
}
|
159 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
160 |
Â
} else {
|
161 |
Â
// Get current page number when we're not using permalinks
|
162 |
Â
$query_args['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 1;
|
75 |
Â
* @return array
|
76 |
Â
*/
|
77 |
Â
function update( $new, $old ){
|
78 |
+
$new['pagination_id'] = rand();
|
79 |
Â
if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
|
80 |
Â
$helper = $this->get_helper_widget( $this->get_loop_templates() );
|
81 |
Â
return $helper->update( $new, $old );
|
142 |
Â
|
143 |
Â
if( $wp_rewrite->using_permalinks() ) {
|
144 |
Â
|
145 |
+
if ( apply_filters( 'siteorigin_panels_post_loop_custom_pagination', false ) ) {
|
146 |
+
if ( isset( $instance['pagination_id'] ) ) {
|
147 |
+
self::$current_pagination_id = $instance['pagination_id'];
|
148 |
+
|
149 |
+
if (
|
150 |
+
isset( $_GET[ 'page-' . self::$current_pagination_id ] ) &&
|
151 |
+
is_numeric( $_GET[ 'page-' . self::$current_pagination_id ] )
|
152 |
+
) {
|
153 |
+
$query_args['paged'] = $_GET[ 'page-' . self::$current_pagination_id ];
|
154 |
+
}
|
155 |
+
}
|
156 |
Â
} else {
|
157 |
+
if ( get_query_var( 'paged' ) ) {
|
158 |
+
// When the widget appears on a sub page.
|
159 |
+
$query_args['paged'] = get_query_var('paged');
|
160 |
+
} else if ( strpos( $_SERVER['REQUEST_URI'], '/page/' ) !== false ) {
|
161 |
+
// When the widget appears on the home page.
|
162 |
+
preg_match('/\/page\/([0-9]+)\//', $_SERVER['REQUEST_URI'], $matches);
|
163 |
+
if(!empty($matches[1])) $query_args['paged'] = intval($matches[1]);
|
164 |
+
else $query_args['paged'] = 1;
|
165 |
Â
}
|
166 |
Â
}
|
167 |
+
|
168 |
+
if ( ! isset( $query_args['paged'] ) ) {
|
169 |
+
$query_args['paged'] = 1;
|
170 |
+
}
|
171 |
Â
} else {
|
172 |
Â
// Get current page number when we're not using permalinks
|
173 |
Â
$query_args['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 1;
|
js/seo-compat.js
CHANGED
@@ -16,20 +16,8 @@ jQuery(function($){
|
|
16 |
Â
|
17 |
Â
};
|
18 |
Â
|
19 |
-
SiteOriginSeoCompat.prototype.contentModification = function(data) {
|
20 |
-
if(
|
21 |
-
typeof window.soPanelsBuilderView !== 'undefined' &&
|
22 |
-
window.soPanelsBuilderView.contentPreview
|
23 |
-
) {
|
24 |
-
var $data = $( window.soPanelsBuilderView.contentPreview );
|
25 |
-
|
26 |
-
if( $data.find('.so-panel.widget').length === 0 ) {
|
27 |
-
// Skip this for empty pages
|
28 |
-
return data;
|
29 |
-
}
|
30 |
-
|
31 |
-
// Remove style tags created by Widgets Bundle
|
32 |
-
$data.find('style').remove();
|
33 |
Â
|
34 |
Â
var whitelist = [
|
35 |
Â
'p', 'a', 'img', 'caption', 'br',
|
@@ -39,18 +27,49 @@ jQuery(function($){
|
|
39 |
Â
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
40 |
Â
'ul', 'ol', 'li',
|
41 |
Â
'table', 'tr', 'th', 'td'
|
42 |
-
].join(',');
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
43 |
Â
|
44 |
-
|
45 |
-
|
46 |
-
$(this).replaceWith(content);
|
47 |
-
});
|
48 |
Â
|
49 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
50 |
Â
}
|
51 |
Â
|
52 |
Â
return data;
|
53 |
Â
};
|
54 |
Â
|
55 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
56 |
Â
});
|
16 |
Â
|
17 |
Â
};
|
18 |
Â
|
19 |
+
SiteOriginSeoCompat.prototype.contentModification = function( data ) {
|
20 |
+
if ( typeof window.soPanelsBuilderView !== 'undefined' ) {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
21 |
Â
|
22 |
Â
var whitelist = [
|
23 |
Â
'p', 'a', 'img', 'caption', 'br',
|
27 |
Â
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
28 |
Â
'ul', 'ol', 'li',
|
29 |
Â
'table', 'tr', 'th', 'td'
|
30 |
+
].join( ',' );
|
31 |
+
|
32 |
+
var extractContent = function( data ) {
|
33 |
+
var $data = $( data );
|
34 |
+
|
35 |
+
if( $data.find( '.so-panel.widget' ).length === 0 ) {
|
36 |
+
// Skip this for empty pages
|
37 |
+
return data;
|
38 |
+
}
|
39 |
Â
|
40 |
+
// Remove style tags created by Widgets Bundle
|
41 |
+
$data.find( 'style' ).remove();
|
Â
|
|
Â
|
|
42 |
Â
|
43 |
+
$data.find( "*") .not( whitelist ).each( function() {
|
44 |
+
var content = $( this ).contents();
|
45 |
+
$( this ).replaceWith( content );
|
46 |
+
} );
|
47 |
+
|
48 |
+
return $data.html();
|
49 |
+
};
|
50 |
+
|
51 |
+
if ( ! Array.isArray( window.soPanelsBuilderView ) ) {
|
52 |
+
data = extractContent( window.soPanelsBuilderView.contentPreview );
|
53 |
+
} else {
|
54 |
+
var $this = this;
|
55 |
+
data = null;
|
56 |
+
window.soPanelsBuilderView.forEach( function( panel ) {
|
57 |
+
data += extractContent( panel.contentPreview );
|
58 |
+
} );
|
59 |
+
}
|
60 |
Â
}
|
61 |
Â
|
62 |
Â
return data;
|
63 |
Â
};
|
64 |
Â
|
65 |
+
if ( typeof rankMathEditor !== 'undefined' ) {
|
66 |
+
new SiteOriginSeoCompat();
|
67 |
+
} else {
|
68 |
+
$( window ).on(
|
69 |
+
'YoastSEO:ready',
|
70 |
+
function () {
|
71 |
+
new SiteOriginSeoCompat();
|
72 |
+
}
|
73 |
+
);
|
74 |
+
}
|
75 |
Â
});
|
js/seo-compat.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery((function(t){var i=function(){"undefined"!=typeof YoastSEO&&(YoastSEO.app.registerPlugin("SiteOriginSeoCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"SiteOriginSeoCompat",5)),"undefined"!=typeof rankMathEditor&&wp.hooks.addFilter("rank_math_content","SiteOriginSeoCompat",this.contentModification)};i.prototype.contentModification=function(i){if(void 0!==window.soPanelsBuilderView
|
1 |
+
jQuery((function(t){var i=function(){"undefined"!=typeof YoastSEO&&(YoastSEO.app.registerPlugin("SiteOriginSeoCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"SiteOriginSeoCompat",5)),"undefined"!=typeof rankMathEditor&&wp.hooks.addFilter("rank_math_content","SiteOriginSeoCompat",this.contentModification)};i.prototype.contentModification=function(i){if(void 0!==window.soPanelsBuilderView){var n=["p","a","img","caption","br","blockquote","cite","em","strong","i","b","q","h1","h2","h3","h4","h5","h6","ul","ol","li","table","tr","th","td"].join(","),e=function(i){var e=t(i);return 0===e.find(".so-panel.widget").length?i:(e.find("style").remove(),e.find("*").not(n).each((function(){var i=t(this).contents();t(this).replaceWith(i)})),e.html())};if(Array.isArray(window.soPanelsBuilderView)){i=null,window.soPanelsBuilderView.forEach((function(t){i+=e(t.contentPreview)}))}else i=e(window.soPanelsBuilderView.contentPreview)}return i},"undefined"!=typeof rankMathEditor?new i:t(window).on("YoastSEO:ready",(function(){new i}))}));
|
js/siteorigin-panels.js
CHANGED
@@ -554,9 +554,15 @@ module.exports = panels.view.dialog.extend( {
|
|
554 |
Â
c.find( '.so-export' ).submit( function ( e ) {
|
555 |
Â
var $$ = $( this );
|
556 |
Â
var panelsData = thisView.builder.model.getPanelsData();
|
557 |
-
var postName = $('input[name="post_title"]').val();
|
558 |
Â
if ( ! postName ) {
|
559 |
Â
postName = $('input[name="post_ID"]').val();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
560 |
Â
}
|
561 |
Â
panelsData.name = postName;
|
562 |
Â
$$.find( 'input[name="panels_export_data"]' ).val( JSON.stringify( panelsData ) );
|
@@ -564,6 +570,16 @@ module.exports = panels.view.dialog.extend( {
|
|
564 |
Â
|
565 |
Â
},
|
566 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
567 |
Â
/**
|
568 |
Â
* Display the layout directory tab.
|
569 |
Â
*
|
@@ -1894,7 +1910,7 @@ module.exports = panels.view.dialog.extend( {
|
|
1894 |
Â
|
1895 |
Â
} );
|
1896 |
Â
|
1897 |
-
},{"../view/widgets/js-widget":
|
1898 |
Â
var panels = window.panels, $ = jQuery;
|
1899 |
Â
|
1900 |
Â
module.exports = panels.view.dialog.extend( {
|
@@ -2203,6 +2219,17 @@ module.exports = {
|
|
2203 |
Â
};
|
2204 |
Â
|
2205 |
Â
},{}],12:[function(require,module,exports){
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2206 |
Â
module.exports = {
|
2207 |
Â
/**
|
2208 |
Â
* Lock window scrolling for the main overlay
|
@@ -2249,7 +2276,7 @@ module.exports = {
|
|
2249 |
Â
},
|
2250 |
Â
};
|
2251 |
Â
|
2252 |
-
},{}],
|
2253 |
Â
/*
|
2254 |
Â
This is a modified version of https://github.com/underdogio/backbone-serialize/
|
2255 |
Â
*/
|
@@ -2360,7 +2387,7 @@ module.exports = {
|
|
2360 |
Â
}
|
2361 |
Â
};
|
2362 |
Â
|
2363 |
-
},{}],
|
2364 |
Â
module.exports = {
|
2365 |
Â
|
2366 |
Â
generateUUID: function(){
|
@@ -2397,7 +2424,7 @@ module.exports = {
|
|
2397 |
Â
|
2398 |
Â
}
|
2399 |
Â
|
2400 |
-
},{}],
|
2401 |
Â
/* global _, jQuery, panels */
|
2402 |
Â
|
2403 |
Â
var panels = window.panels, $ = jQuery;
|
@@ -2486,7 +2513,7 @@ module.exports = function ( config, force ) {
|
|
2486 |
Â
} );
|
2487 |
Â
};
|
2488 |
Â
|
2489 |
-
},{}],
|
2490 |
Â
/**
|
2491 |
Â
* Everything we need for SiteOrigin Page Builder.
|
2492 |
Â
*
|
@@ -2506,6 +2533,7 @@ window.siteoriginPanels = panels;
|
|
2506 |
Â
panels.helpers = {};
|
2507 |
Â
panels.helpers.clipboard = require( './helpers/clipboard' );
|
2508 |
Â
panels.helpers.utils = require( './helpers/utils' );
|
Â
|
|
2509 |
Â
panels.helpers.serialize = require( './helpers/serialize' );
|
2510 |
Â
panels.helpers.pageScroll = require( './helpers/page-scroll' );
|
2511 |
Â
|
@@ -2660,7 +2688,7 @@ jQuery( function ( $ ) {
|
|
2660 |
Â
});
|
2661 |
Â
} );
|
2662 |
Â
|
2663 |
-
},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/page-scroll":
|
2664 |
Â
module.exports = Backbone.Model.extend({
|
2665 |
Â
layoutPosition: {
|
2666 |
Â
BEFORE: 'before',
|
@@ -3202,7 +3230,7 @@ module.exports = Backbone.Model.extend({
|
|
3202 |
Â
}
|
3203 |
Â
} );
|
3204 |
Â
|
3205 |
-
},{}],
|
3206 |
Â
module.exports = Backbone.Model.extend( {
|
3207 |
Â
/* A collection of widgets */
|
3208 |
Â
widgets: {},
|
@@ -3259,7 +3287,7 @@ module.exports = Backbone.Model.extend( {
|
|
3259 |
Â
|
3260 |
Â
} );
|
3261 |
Â
|
3262 |
-
},{}],
|
3263 |
Â
module.exports = Backbone.Model.extend( {
|
3264 |
Â
defaults: {
|
3265 |
Â
text: '',
|
@@ -3269,7 +3297,7 @@ module.exports = Backbone.Model.extend( {
|
|
3269 |
Â
}
|
3270 |
Â
} );
|
3271 |
Â
|
3272 |
-
},{}],
|
3273 |
Â
module.exports = Backbone.Model.extend( {
|
3274 |
Â
/* The builder model */
|
3275 |
Â
builder: null,
|
@@ -3393,7 +3421,7 @@ module.exports = Backbone.Model.extend( {
|
|
3393 |
Â
}
|
3394 |
Â
} );
|
3395 |
Â
|
3396 |
-
},{}],
|
3397 |
Â
/**
|
3398 |
Â
* Model for an instance of a widget
|
3399 |
Â
*/
|
@@ -3597,7 +3625,7 @@ module.exports = Backbone.Model.extend( {
|
|
3597 |
Â
|
3598 |
Â
} );
|
3599 |
Â
|
3600 |
-
},{}],
|
3601 |
Â
var panels = window.panels, $ = jQuery;
|
3602 |
Â
|
3603 |
Â
module.exports = Backbone.View.extend( {
|
@@ -3918,7 +3946,7 @@ module.exports = Backbone.View.extend( {
|
|
3918 |
Â
|
3919 |
Â
} );
|
3920 |
Â
|
3921 |
-
},{}],
|
3922 |
Â
var panels = window.panels, $ = jQuery;
|
3923 |
Â
|
3924 |
Â
module.exports = Backbone.View.extend( {
|
@@ -4652,8 +4680,7 @@ module.exports = Backbone.View.extend( {
|
|
4652 |
Â
handleContentChange: function () {
|
4653 |
Â
|
4654 |
Â
// Make sure we actually need to copy content.
|
4655 |
-
if ( panelsOptions.copy_content
|
4656 |
-
|
4657 |
Â
var panelsData = this.model.getPanelsData();
|
4658 |
Â
if ( !_.isEmpty( panelsData.widgets ) ) {
|
4659 |
Â
// We're going to create a copy of page builder content into the post content
|
@@ -4665,12 +4692,14 @@ module.exports = Backbone.View.extend( {
|
|
4665 |
Â
post_id: this.config.postId
|
4666 |
Â
},
|
4667 |
Â
function ( content ) {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
4668 |
Â
if ( content.preview !== '' ) {
|
4669 |
Â
this.contentPreview = content.preview;
|
4670 |
Â
}
|
4671 |
-
if ( content.post_content !== '' ) {
|
4672 |
-
this.updateEditorContent( content.post_content );
|
4673 |
-
}
|
4674 |
Â
}.bind( this )
|
4675 |
Â
);
|
4676 |
Â
}
|
@@ -4891,7 +4920,7 @@ module.exports = Backbone.View.extend( {
|
|
4891 |
Â
},
|
4892 |
Â
} );
|
4893 |
Â
|
4894 |
-
},{}],
|
4895 |
Â
var panels = window.panels, $ = jQuery;
|
4896 |
Â
|
4897 |
Â
module.exports = Backbone.View.extend( {
|
@@ -5279,7 +5308,7 @@ module.exports = Backbone.View.extend( {
|
|
5279 |
Â
}
|
5280 |
Â
} );
|
5281 |
Â
|
5282 |
-
},{}],
|
5283 |
Â
var panels = window.panels, $ = jQuery;
|
5284 |
Â
|
5285 |
Â
module.exports = Backbone.View.extend( {
|
@@ -5886,7 +5915,7 @@ module.exports = Backbone.View.extend( {
|
|
5886 |
Â
|
5887 |
Â
} );
|
5888 |
Â
|
5889 |
-
},{}],
|
5890 |
Â
var panels = window.panels, $ = jQuery;
|
5891 |
Â
|
5892 |
Â
module.exports = Backbone.View.extend( {
|
@@ -6315,7 +6344,7 @@ module.exports = Backbone.View.extend( {
|
|
6315 |
Â
}
|
6316 |
Â
} );
|
6317 |
Â
|
6318 |
-
},{}],
|
6319 |
Â
var panels = window.panels, $ = jQuery;
|
6320 |
Â
|
6321 |
Â
module.exports = Backbone.View.extend( {
|
@@ -6726,7 +6755,7 @@ module.exports = Backbone.View.extend( {
|
|
6726 |
Â
},
|
6727 |
Â
} );
|
6728 |
Â
|
6729 |
-
},{}],
|
6730 |
Â
var panels = window.panels, $ = jQuery;
|
6731 |
Â
|
6732 |
Â
module.exports = Backbone.View.extend( {
|
@@ -7024,7 +7053,7 @@ module.exports = Backbone.View.extend( {
|
|
7024 |
Â
|
7025 |
Â
} );
|
7026 |
Â
|
7027 |
-
},{}],
|
7028 |
Â
var panels = window.panels, $ = jQuery;
|
7029 |
Â
|
7030 |
Â
module.exports = Backbone.View.extend( {
|
@@ -7038,7 +7067,9 @@ module.exports = Backbone.View.extend( {
|
|
7038 |
Â
|
7039 |
Â
events: {
|
7040 |
Â
'click .widget-edit': 'editHandler',
|
Â
|
|
7041 |
Â
'click .title h4': 'editHandler',
|
Â
|
|
7042 |
Â
'click .actions .widget-duplicate': 'duplicateHandler',
|
7043 |
Â
'click .actions .widget-delete': 'deleteHandler'
|
7044 |
Â
},
|
@@ -7316,7 +7347,7 @@ module.exports = Backbone.View.extend( {
|
|
7316 |
Â
|
7317 |
Â
} );
|
7318 |
Â
|
7319 |
-
},{}],
|
7320 |
Â
var $ = jQuery;
|
7321 |
Â
|
7322 |
Â
var customHtmlWidget = {
|
@@ -7343,7 +7374,7 @@ var customHtmlWidget = {
|
|
7343 |
Â
|
7344 |
Â
module.exports = customHtmlWidget;
|
7345 |
Â
|
7346 |
-
},{}],
|
7347 |
Â
var customHtmlWidget = require( './custom-html-widget' );
|
7348 |
Â
var mediaWidget = require( './media-widget' );
|
7349 |
Â
var textWidget = require( './text-widget' );
|
@@ -7381,7 +7412,7 @@ var jsWidget = {
|
|
7381 |
Â
|
7382 |
Â
module.exports = jsWidget;
|
7383 |
Â
|
7384 |
-
},{"./custom-html-widget":
|
7385 |
Â
var $ = jQuery;
|
7386 |
Â
|
7387 |
Â
var mediaWidget = {
|
@@ -7421,7 +7452,7 @@ var mediaWidget = {
|
|
7421 |
Â
|
7422 |
Â
module.exports = mediaWidget;
|
7423 |
Â
|
7424 |
-
},{}],
|
7425 |
Â
var $ = jQuery;
|
7426 |
Â
|
7427 |
Â
var textWidget = {
|
@@ -7465,4 +7496,4 @@ var textWidget = {
|
|
7465 |
Â
|
7466 |
Â
module.exports = textWidget;
|
7467 |
Â
|
7468 |
-
},{}]},{},[
|
554 |
Â
c.find( '.so-export' ).submit( function ( e ) {
|
555 |
Â
var $$ = $( this );
|
556 |
Â
var panelsData = thisView.builder.model.getPanelsData();
|
557 |
+
var postName = $( 'input[name="post_title"], .editor-post-title__input' ).val();
|
558 |
Â
if ( ! postName ) {
|
559 |
Â
postName = $('input[name="post_ID"]').val();
|
560 |
+
} else if ( typeof wp.data != 'undefined' ) {
|
561 |
+
var currentBlockPosition = thisView.getCurrentBlockPosition();
|
562 |
+
if ( currentBlockPosition >= 0 ) {
|
563 |
+
postName += '-' + currentBlockPosition;
|
564 |
+
}
|
565 |
+
|
566 |
Â
}
|
567 |
Â
panelsData.name = postName;
|
568 |
Â
$$.find( 'input[name="panels_export_data"]' ).val( JSON.stringify( panelsData ) );
|
570 |
Â
|
571 |
Â
},
|
572 |
Â
|
573 |
+
/**
|
574 |
+
* Return current block index.
|
575 |
+
*/
|
576 |
+
getCurrentBlockPosition: function() {
|
577 |
+
var selectedBlockClientId = wp.data.select( 'core/block-editor' ).getSelectedBlockClientId();
|
578 |
+
return wp.data.select( 'core/block-editor' ).getBlocks().findIndex( function ( block ) {
|
579 |
+
return block.clientId === selectedBlockClientId;
|
580 |
+
} );
|
581 |
+
},
|
582 |
+
|
583 |
Â
/**
|
584 |
Â
* Display the layout directory tab.
|
585 |
Â
*
|
1910 |
Â
|
1911 |
Â
} );
|
1912 |
Â
|
1913 |
+
},{"../view/widgets/js-widget":32}],10:[function(require,module,exports){
|
1914 |
Â
var panels = window.panels, $ = jQuery;
|
1915 |
Â
|
1916 |
Â
module.exports = panels.view.dialog.extend( {
|
2219 |
Â
};
|
2220 |
Â
|
2221 |
Â
},{}],12:[function(require,module,exports){
|
2222 |
+
module.exports = {
|
2223 |
+
isBlockEditor: function() {
|
2224 |
+
return typeof wp.blocks !== 'undefined';
|
2225 |
+
},
|
2226 |
+
|
2227 |
+
isClassicEditor: function( builder ) {
|
2228 |
+
return builder.attachedToEditor && builder.$el.is( ':visible' );
|
2229 |
+
},
|
2230 |
+
}
|
2231 |
+
|
2232 |
+
},{}],13:[function(require,module,exports){
|
2233 |
Â
module.exports = {
|
2234 |
Â
/**
|
2235 |
Â
* Lock window scrolling for the main overlay
|
2276 |
Â
},
|
2277 |
Â
};
|
2278 |
Â
|
2279 |
+
},{}],14:[function(require,module,exports){
|
2280 |
Â
/*
|
2281 |
Â
This is a modified version of https://github.com/underdogio/backbone-serialize/
|
2282 |
Â
*/
|
2387 |
Â
}
|
2388 |
Â
};
|
2389 |
Â
|
2390 |
+
},{}],15:[function(require,module,exports){
|
2391 |
Â
module.exports = {
|
2392 |
Â
|
2393 |
Â
generateUUID: function(){
|
2424 |
Â
|
2425 |
Â
}
|
2426 |
Â
|
2427 |
+
},{}],16:[function(require,module,exports){
|
2428 |
Â
/* global _, jQuery, panels */
|
2429 |
Â
|
2430 |
Â
var panels = window.panels, $ = jQuery;
|
2513 |
Â
} );
|
2514 |
Â
};
|
2515 |
Â
|
2516 |
+
},{}],17:[function(require,module,exports){
|
2517 |
Â
/**
|
2518 |
Â
* Everything we need for SiteOrigin Page Builder.
|
2519 |
Â
*
|
2533 |
Â
panels.helpers = {};
|
2534 |
Â
panels.helpers.clipboard = require( './helpers/clipboard' );
|
2535 |
Â
panels.helpers.utils = require( './helpers/utils' );
|
2536 |
+
panels.helpers.editor = require( './helpers/editor' );
|
2537 |
Â
panels.helpers.serialize = require( './helpers/serialize' );
|
2538 |
Â
panels.helpers.pageScroll = require( './helpers/page-scroll' );
|
2539 |
Â
|
2688 |
Â
});
|
2689 |
Â
} );
|
2690 |
Â
|
2691 |
+
},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/editor":12,"./helpers/page-scroll":13,"./helpers/serialize":14,"./helpers/utils":15,"./jquery/setup-builder-widget":16,"./model/builder":18,"./model/cell":19,"./model/history-entry":20,"./model/row":21,"./model/widget":22,"./utils/menu":23,"./view/builder":24,"./view/cell":25,"./view/dialog":26,"./view/live-editor":27,"./view/row":28,"./view/styles":29,"./view/widget":30}],18:[function(require,module,exports){
|
2692 |
Â
module.exports = Backbone.Model.extend({
|
2693 |
Â
layoutPosition: {
|
2694 |
Â
BEFORE: 'before',
|
3230 |
Â
}
|
3231 |
Â
} );
|
3232 |
Â
|
3233 |
+
},{}],19:[function(require,module,exports){
|
3234 |
Â
module.exports = Backbone.Model.extend( {
|
3235 |
Â
/* A collection of widgets */
|
3236 |
Â
widgets: {},
|
3287 |
Â
|
3288 |
Â
} );
|
3289 |
Â
|
3290 |
+
},{}],20:[function(require,module,exports){
|
3291 |
Â
module.exports = Backbone.Model.extend( {
|
3292 |
Â
defaults: {
|
3293 |
Â
text: '',
|
3297 |
Â
}
|
3298 |
Â
} );
|
3299 |
Â
|
3300 |
+
},{}],21:[function(require,module,exports){
|
3301 |
Â
module.exports = Backbone.Model.extend( {
|
3302 |
Â
/* The builder model */
|
3303 |
Â
builder: null,
|
3421 |
Â
}
|
3422 |
Â
} );
|
3423 |
Â
|
3424 |
+
},{}],22:[function(require,module,exports){
|
3425 |
Â
/**
|
3426 |
Â
* Model for an instance of a widget
|
3427 |
Â
*/
|
3625 |
Â
|
3626 |
Â
} );
|
3627 |
Â
|
3628 |
+
},{}],23:[function(require,module,exports){
|
3629 |
Â
var panels = window.panels, $ = jQuery;
|
3630 |
Â
|
3631 |
Â
module.exports = Backbone.View.extend( {
|
3946 |
Â
|
3947 |
Â
} );
|
3948 |
Â
|
3949 |
+
},{}],24:[function(require,module,exports){
|
3950 |
Â
var panels = window.panels, $ = jQuery;
|
3951 |
Â
|
3952 |
Â
module.exports = Backbone.View.extend( {
|
4680 |
Â
handleContentChange: function () {
|
4681 |
Â
|
4682 |
Â
// Make sure we actually need to copy content.
|
4683 |
+
if ( panelsOptions.copy_content && ( panels.helpers.editor.isBlockEditor() || panels.helpers.editor.isClassicEditor( this ) ) ) {
|
Â
|
|
4684 |
Â
var panelsData = this.model.getPanelsData();
|
4685 |
Â
if ( !_.isEmpty( panelsData.widgets ) ) {
|
4686 |
Â
// We're going to create a copy of page builder content into the post content
|
4692 |
Â
post_id: this.config.postId
|
4693 |
Â
},
|
4694 |
Â
function ( content ) {
|
4695 |
+
// Post content doesn't need to be generated on load while contentPreview does.
|
4696 |
+
if ( this.contentPreview && content.post_content !== '' ) {
|
4697 |
+
this.updateEditorContent( content.post_content );
|
4698 |
+
}
|
4699 |
+
|
4700 |
Â
if ( content.preview !== '' ) {
|
4701 |
Â
this.contentPreview = content.preview;
|
4702 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
4703 |
Â
}.bind( this )
|
4704 |
Â
);
|
4705 |
Â
}
|
4920 |
Â
},
|
4921 |
Â
} );
|
4922 |
Â
|
4923 |
+
},{}],25:[function(require,module,exports){
|
4924 |
Â
var panels = window.panels, $ = jQuery;
|
4925 |
Â
|
4926 |
Â
module.exports = Backbone.View.extend( {
|
5308 |
Â
}
|
5309 |
Â
} );
|
5310 |
Â
|
5311 |
+
},{}],26:[function(require,module,exports){
|
5312 |
Â
var panels = window.panels, $ = jQuery;
|
5313 |
Â
|
5314 |
Â
module.exports = Backbone.View.extend( {
|
5915 |
Â
|
5916 |
Â
} );
|
5917 |
Â
|
5918 |
+
},{}],27:[function(require,module,exports){
|
5919 |
Â
var panels = window.panels, $ = jQuery;
|
5920 |
Â
|
5921 |
Â
module.exports = Backbone.View.extend( {
|
6344 |
Â
}
|
6345 |
Â
} );
|
6346 |
Â
|
6347 |
+
},{}],28:[function(require,module,exports){
|
6348 |
Â
var panels = window.panels, $ = jQuery;
|
6349 |
Â
|
6350 |
Â
module.exports = Backbone.View.extend( {
|
6755 |
Â
},
|
6756 |
Â
} );
|
6757 |
Â
|
6758 |
+
},{}],29:[function(require,module,exports){
|
6759 |
Â
var panels = window.panels, $ = jQuery;
|
6760 |
Â
|
6761 |
Â
module.exports = Backbone.View.extend( {
|
7053 |
Â
|
7054 |
Â
} );
|
7055 |
Â
|
7056 |
+
},{}],30:[function(require,module,exports){
|
7057 |
Â
var panels = window.panels, $ = jQuery;
|
7058 |
Â
|
7059 |
Â
module.exports = Backbone.View.extend( {
|
7067 |
Â
|
7068 |
Â
events: {
|
7069 |
Â
'click .widget-edit': 'editHandler',
|
7070 |
+
'touchend .widget-edit': 'editHandler',
|
7071 |
Â
'click .title h4': 'editHandler',
|
7072 |
+
'touchend .title h4': 'editHandler',
|
7073 |
Â
'click .actions .widget-duplicate': 'duplicateHandler',
|
7074 |
Â
'click .actions .widget-delete': 'deleteHandler'
|
7075 |
Â
},
|
7347 |
Â
|
7348 |
Â
} );
|
7349 |
Â
|
7350 |
+
},{}],31:[function(require,module,exports){
|
7351 |
Â
var $ = jQuery;
|
7352 |
Â
|
7353 |
Â
var customHtmlWidget = {
|
7374 |
Â
|
7375 |
Â
module.exports = customHtmlWidget;
|
7376 |
Â
|
7377 |
+
},{}],32:[function(require,module,exports){
|
7378 |
Â
var customHtmlWidget = require( './custom-html-widget' );
|
7379 |
Â
var mediaWidget = require( './media-widget' );
|
7380 |
Â
var textWidget = require( './text-widget' );
|
7412 |
Â
|
7413 |
Â
module.exports = jsWidget;
|
7414 |
Â
|
7415 |
+
},{"./custom-html-widget":31,"./media-widget":33,"./text-widget":34}],33:[function(require,module,exports){
|
7416 |
Â
var $ = jQuery;
|
7417 |
Â
|
7418 |
Â
var mediaWidget = {
|
7452 |
Â
|
7453 |
Â
module.exports = mediaWidget;
|
7454 |
Â
|
7455 |
+
},{}],34:[function(require,module,exports){
|
7456 |
Â
var $ = jQuery;
|
7457 |
Â
|
7458 |
Â
var textWidget = {
|
7496 |
Â
|
7497 |
Â
module.exports = textWidget;
|
7498 |
Â
|
7499 |
+
},{}]},{},[17]);
|
js/siteorigin-panels.min.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
!function e(t,i,s){function l(n,a){if(!i[n]){if(!t[n]){var r="function"==typeof require&&require;if(!a&&r)return r(n,!0);if(o)return o(n,!0);var d=new Error("Cannot find module '"+n+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[n]={exports:{}};t[n][0].call(h.exports,(function(e){return l(t[n][1][e]||e)}),h,h.exports,e,t,i,s)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n<s.length;n++)l(s[n]);return l}({1:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.cell,initialize:function(){},totalWeight:function(){var e=0;return this.each((function(t){e+=t.get("weight")})),e}})},{}],2:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.historyEntry,builder:null,maxSize:12,initialize:function(){this.on("add",this.onAddEntry,this)},addEntry:function(e,t){_.isEmpty(t)&&(t=this.builder.getPanelsData());var i=new s.model.historyEntry({text:e,data:JSON.stringify(t),time:parseInt((new Date).getTime()/1e3),collection:this});this.add(i)},onAddEntry:function(e){if(this.models.length>1){var t=this.at(this.models.length-2);(e.get("text")===t.get("text")&&e.get("time")-t.get("time")<15||e.get("data")===t.get("data"))&&(this.remove(e),t.set("count",t.get("count")+1))}for(;this.models.length>this.maxSize;)this.shift()}})},{}],3:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.row,empty:function(){for(var e;;){if(!(e=this.collection.first()))break;e.destroy()}}})},{}],4:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.widget,initialize:function(){}})},{}],5:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({dialogClass:"so-panels-dialog-add-builder",render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-builder").html(),{})),this.$(".so-content .siteorigin-panels-builder").append(this.builder.$el)},initializeDialog:function(){var e=this;this.once("open_dialog_complete",(function(){e.builder.initSortable()})),this.on("open_dialog_complete",(function(){e.builder.trigger("builder_resize")}))}})},{}],6:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({historyEntryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-history-entry").html())),entries:{},currentEntry:null,revertEntry:null,selectedEntry:null,previewScrollTop:null,dialogClass:"so-panels-dialog-history",dialogIcon:"history",events:{"click .so-close":"closeDialog","click .so-restore":"restoreSelectedEntry"},initializeDialog:function(){this.entries=new s.collection.historyEntries,this.on("open_dialog",this.setCurrentEntry,this),this.on("open_dialog",this.renderHistoryEntries,this)},render:function(){var e=this;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-history").html(),{})),this.$("iframe.siteorigin-panels-history-iframe").load((function(){var t=l(this);t.show(),t.contents().scrollTop(e.previewScrollTop)}))},setRevertEntry:function(e){this.revertEntry=new s.model.historyEntry({data:JSON.stringify(e.getPanelsData()),time:parseInt((new Date).getTime()/1e3)})},setCurrentEntry:function(){this.currentEntry=new s.model.historyEntry({data:JSON.stringify(this.builder.model.getPanelsData()),time:parseInt((new Date).getTime()/1e3)}),this.selectedEntry=this.currentEntry,this.previewEntry(this.currentEntry),this.$(".so-buttons .so-restore").addClass("disabled")},renderHistoryEntries:function(){var e=this,t=this.$(".history-entries").empty();this.currentEntry.get("data")===this.revertEntry.get("data")&&_.isEmpty(this.entries.models)||l(this.historyEntryTemplate({title:panelsOptions.loc.history.revert,count:1})).data("historyEntry",this.revertEntry).prependTo(t),this.entries.each((function(i){var s=e.historyEntryTemplate({title:panelsOptions.loc.history[i.get("text")],count:i.get("count")});l(s).data("historyEntry",i).prependTo(t)})),l(this.historyEntryTemplate({title:panelsOptions.loc.history.current,count:1})).data("historyEntry",this.currentEntry).addClass("so-selected").prependTo(t),t.find(".history-entry").click((function(){var i=jQuery(this);t.find(".history-entry").not(i).removeClass("so-selected"),i.addClass("so-selected");var s=i.data("historyEntry");e.selectedEntry=s,e.selectedEntry.cid!==e.currentEntry.cid?e.$(".so-buttons .so-restore").removeClass("disabled"):e.$(".so-buttons .so-restore").addClass("disabled"),e.previewEntry(s)})),this.updateEntryTimes()},previewEntry:function(e){var t=this.$("iframe.siteorigin-panels-history-iframe");t.hide(),this.previewScrollTop=t.contents().scrollTop(),this.$('form.history-form input[name="live_editor_panels_data"]').val(e.get("data")),this.$('form.history-form input[name="live_editor_post_ID"]').val(this.builder.config.postId),this.$("form.history-form").submit()},restoreSelectedEntry:function(){return!this.$(".so-buttons .so-restore").hasClass("disabled")&&(this.currentEntry.get("data")===this.selectedEntry.get("data")?(this.closeDialog(),!1):("restore"!==this.selectedEntry.get("text")&&this.builder.addHistoryEntry("restore",this.builder.model.getPanelsData()),this.builder.model.loadPanelsData(JSON.parse(this.selectedEntry.get("data"))),this.closeDialog(),!1))},updateEntryTimes:function(){var e=this;this.$(".history-entries .history-entry").each((function(){var t=jQuery(this),i=t.find(".timesince"),s=t.data("historyEntry");i.html(e.timeSince(s.get("time")))}))},timeSince:function(e){var t,i=parseInt((new Date).getTime()/1e3)-e,s=[];return i>3600&&(1===(t=Math.floor(i/3600))?s.push(panelsOptions.loc.time.hour.replace("%d",t)):s.push(panelsOptions.loc.time.hours.replace("%d",t)),i-=3600*t),i>60&&(1===(t=Math.floor(i/60))?s.push(panelsOptions.loc.time.minute.replace("%d",t)):s.push(panelsOptions.loc.time.minutes.replace("%d",t)),i-=60*t),i>0&&(1===i?s.push(panelsOptions.loc.time.second.replace("%d",i)):s.push(panelsOptions.loc.time.seconds.replace("%d",i))),_.isEmpty(s)?panelsOptions.loc.time.now:panelsOptions.loc.time.ago.replace("%s",s.slice(0,2).join(", "))}})},{}],7:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({directoryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-directory-items").html())),builder:null,dialogClass:"so-panels-dialog-prebuilt-layouts",dialogIcon:"layouts",layoutCache:{},currentTab:!1,directoryPage:1,events:{"click .so-close":"closeDialog","click .so-sidebar-tabs li a":"tabClickHandler","click .so-content .layout":"layoutClickHandler","keyup .so-sidebar-search":"searchHandler","click .so-screenshot, .so-title":"directoryItemClickHandler"},initializeDialog:function(){var e=this;this.on("open_dialog",(function(){e.$(".so-sidebar-tabs li a").first().click(),e.$(".so-status").removeClass("so-panels-loading")})),this.on("button_click",this.toolbarButtonClick,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-prebuilt").html(),{})),this.initToolbar()},tabClickHandler:function(e){e.preventDefault(),this.selectedLayoutItem=null,this.uploadedLayout=null,this.updateButtonState(!1),this.$(".so-sidebar-tabs li").removeClass("tab-active");var t=l(e.target),i=t.attr("href").split("#")[1];t.parent().addClass("tab-active");this.$(".so-content").empty(),this.currentTab=i,"import"==i?this.displayImportExport():this.displayLayoutDirectory("",1,i),this.$(".so-sidebar-search").val("")},displayImportExport:function(){var e=this.$(".so-content").empty().removeClass("so-panels-loading");e.html(l("#siteorigin-panels-dialog-prebuilt-importexport").html());var t=this,i=t.$(".import-upload-ui"),s=new plupload.Uploader({runtimes:"html5,silverlight,flash,html4",browse_button:i.find(".file-browse-button").get(0),container:i.get(0),drop_element:i.find(".drag-upload-area").get(0),file_data_name:"panels_import_data",multiple_queues:!1,max_file_size:panelsOptions.plupload.max_file_size,url:panelsOptions.plupload.url,flash_swf_url:panelsOptions.plupload.flash_swf_url,silverlight_xap_url:panelsOptions.plupload.silverlight_xap_url,filters:[{title:panelsOptions.plupload.filter_title,extensions:"json"}],multipart_params:{action:"so_panels_import_layout"},init:{PostInit:function(e){e.features.dragdrop&&i.addClass("has-drag-drop"),i.find(".progress-precent").css("width","0%")},FilesAdded:function(e){i.find(".file-browse-button").blur(),i.find(".drag-upload-area").removeClass("file-dragover"),i.find(".progress-bar").fadeIn("fast"),t.$(".js-so-selected-file").text(panelsOptions.loc.prebuilt_loading),e.start()},UploadProgress:function(e,t){i.find(".progress-precent").css("width",t.percent+"%")},FileUploaded:function(e,s,l){var o=JSON.parse(l.response);_.isUndefined(o.widgets)?alert(panelsOptions.plupload.error_message):(t.uploadedLayout=o,i.find(".progress-bar").hide(),t.$(".js-so-selected-file").text(panelsOptions.loc.ready_to_insert.replace("%s",s.name)),t.updateButtonState(!0))},Error:function(){alert(panelsOptions.plupload.error_message)}}});s.init(),/Edge\/\d./i.test(navigator.userAgent)&&setTimeout((function(){s.refresh()}),250),i.find(".drag-upload-area").on("dragover",(function(){l(this).addClass("file-dragover")})).on("dragleave",(function(){l(this).removeClass("file-dragover")})),e.find(".so-export").submit((function(e){var i=l(this),s=t.builder.model.getPanelsData(),o=l('input[name="post_title"]').val();o||(o=l('input[name="post_ID"]').val()),s.name=o,i.find('input[name="panels_export_data"]').val(JSON.stringify(s))}))},displayLayoutDirectory:function(e,t,i){var s=this,o=this.$(".so-content").empty().addClass("so-panels-loading");if(void 0===e&&(e=""),void 0===t&&(t=1),void 0===i&&(i="directory-siteorigin"),i.match("^directory-")&&!panelsOptions.directory_enabled)return o.removeClass("so-panels-loading").html(l("#siteorigin-panels-directory-enable").html()),void o.find(".so-panels-enable-directory").click((function(n){n.preventDefault(),l.get(panelsOptions.ajaxurl,{action:"so_panels_directory_enable"},(function(){})),panelsOptions.directory_enabled=!0,o.addClass("so-panels-loading"),s.displayLayoutDirectory(e,t,i)}));l.get(panelsOptions.ajaxurl,{action:"so_panels_layouts_query",search:e,page:t,type:i,builderType:this.builder.config.builderType},(function(n){if(s.currentTab===i){o.removeClass("so-panels-loading").html(s.directoryTemplate(n));var a=o.find(".so-previous"),r=o.find(".so-next");t<=1?a.addClass("button-disabled"):a.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t-1,s.currentTab)})),t===n.max_num_pages||0===n.max_num_pages?r.addClass("button-disabled"):r.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t+1,s.currentTab)})),o.find(".so-screenshot").each((function(){var e=l(this),t=e.find(".so-screenshot-wrapper");if(t.css("height",t.width()/4*3+"px").addClass("so-loading"),""!==e.data("src"))var i=l("<img/>").attr("src",e.data("src")).load((function(){t.removeClass("so-loading").css("height","auto"),i.appendTo(t).hide().fadeIn("fast")}));else l("<img/>").attr("src",panelsOptions.prebuiltDefaultScreenshot).appendTo(t).hide().fadeIn("fast")})),o.find(".so-directory-browse").html(n.title)}}),"json")},directoryItemClickHandler:function(e){var t=this.$(e.target).closest(".so-directory-item");this.$(".so-directory-items").find(".selected").removeClass("selected"),t.addClass("selected"),this.selectedLayoutItem={lid:t.data("layout-id"),type:t.data("layout-type")},this.updateButtonState(!0)},toolbarButtonClick:function(e){if(!this.canAddLayout())return!1;var t=e.data("value");if(_.isUndefined(t))return!1;if(this.updateButtonState(!1),e.hasClass("so-needs-confirm")&&!e.hasClass("so-confirmed")){if(this.updateButtonState(!0),e.hasClass("so-confirming"))return;e.addClass("so-confirming");var i=e.html();return e.html('<span class="dashicons dashicons-yes"></span>'+e.data("confirm")),setTimeout((function(){e.removeClass("so-confirmed").html(i)}),2500),setTimeout((function(){e.removeClass("so-confirming"),e.addClass("so-confirmed")}),200),!1}this.addingLayout=!0,"import"===this.currentTab?this.addLayoutToBuilder(this.uploadedLayout,t):this.loadSelectedLayout().then(function(e){this.addLayoutToBuilder(e,t)}.bind(this))},canAddLayout:function(){return(this.selectedLayoutItem||this.uploadedLayout)&&!this.addingLayout},loadSelectedLayout:function(){this.setStatusMessage(panelsOptions.loc.prebuilt_loading,!0);var e=_.extend(this.selectedLayoutItem,{action:"so_panels_get_layout",builderType:this.builder.config.builderType}),t=new l.Deferred;return l.get(panelsOptions.ajaxurl,e,function(e){var i="";e.success?t.resolve(e.data):(i=e.data.message,t.reject(e.data)),this.setStatusMessage(i,!1,!e.success),this.updateButtonState(!0)}.bind(this)),t.promise()},searchHandler:function(e){13===e.keyCode&&this.displayLayoutDirectory(l(e.currentTarget).val(),1,this.currentTab)},updateButtonState:function(e){e=e&&(this.selectedLayoutItem||this.uploadedLayout);var t=this.$(".so-import-layout");t.prop("disabled",!e),e?t.removeClass("disabled"):t.addClass("disabled")},addLayoutToBuilder:function(e,t){this.builder.addHistoryEntry("prebuilt_loaded"),this.builder.model.loadPanelsData(e,t),this.addingLayout=!1,this.closeDialog()}})},{}],8:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({cellPreviewTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-row-cell-preview").html())),editableLabel:!0,events:{"click .so-close":"closeDialog","click .so-toolbar .so-save":"saveHandler","click .so-toolbar .so-insert":"insertHandler","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler","change .row-set-form > *":"setCellsFromForm","click .row-set-form button.set-row":"setCellsFromForm"},rowView:null,dialogIcon:"add-row",dialogClass:"so-panels-dialog-row-edit",styleType:"row",dialogType:"edit",row:{cells:null,style:{}},cellStylesCache:[],initializeDialog:function(){this.on("open_dialog",(function(){_.isUndefined(this.model)||_.isEmpty(this.model.get("cells"))?this.setRowModel(null):this.setRowModel(this.model),this.regenerateRowPreview(),this.renderStyles(),this.openSelectedCellStyles()}),this),this.row={cells:new s.collection.cells([{weight:.5},{weight:.5}]),style:{}},this.dialogFormsLoaded=0;var e=this;this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("close_dialog",this.closeHandler),this.on("edit_label",function(e){if(e!==panelsOptions.loc.row.add&&e!==panelsOptions.loc.row.edit||(e=""),this.model.set("label",e),_.isEmpty(e)){var t="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.$(".so-title").text(t)}}.bind(this))},setRowDialogType:function(e){this.dialogType=e},render:function(){var e="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-row").html(),{title:e,dialogType:this.dialogType}));var t=this.$(".so-title");return this.model.has("label")&&!_.isEmpty(this.model.get("label"))&&t.text(this.model.get("label")),this.$(".so-edit-title").val(t.text()),this.builder.supports("addRow")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteRow")||this.$(".so-buttons .so-delete").remove(),_.isUndefined(this.model)||(this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction"))),this.$("input.so-row-field").keyup((function(){l(this).trigger("change")})),this},renderStyles:function(){this.styles&&(this.styles.off("styles_loaded"),this.styles.remove()),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("row",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var e=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(e),this.styles.on("styles_loaded",(function(t){t||(this.styles.remove(),0===e.children().length&&(e.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),e.hide()))}),this)},setRowModel:function(e){return this.model=e,_.isEmpty(this.model)?this:(this.row={cells:this.model.get("cells").clone(),style:{},ratio:this.model.get("ratio"),ratio_direction:this.model.get("ratio_direction")},this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction")),this.clearCellStylesCache(),this)},regenerateRowPreview:function(){var e,t=this,i=this.$(".row-preview"),s=this.getSelectedCellIndex();i.empty(),this.row.cells.each((function(o,n){var a=l(this.cellPreviewTemplate({weight:o.get("weight")}));i.append(a),n==s&&a.find(".preview-cell-in").addClass("cell-selected");var r,d=a.prev();d.length&&((r=l('<div class="resize-handle"></div>')).appendTo(a).dblclick((function(){var e=t.row.cells.at(n-1),i=o.get("weight")+e.get("weight");o.set("weight",i/2),e.set("weight",i/2),t.scaleRowWidths()})),r.draggable({axis:"x",containment:i,start:function(e,t){var i=a.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:a.outerWidth(),left:6,height:a.outerHeight()});i.find(".resize-handle").remove();var s=d.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:d.outerWidth(),right:6,height:d.outerHeight()});s.find(".resize-handle").remove(),l(this).data({newCellClone:i,prevCellClone:s}),a.find("> .preview-cell-in").css("visibility","hidden"),d.find("> .preview-cell-in").css("visibility","hidden")},drag:function(e,s){var o=t.row.cells.at(n).get("weight"),a=t.row.cells.at(n-1).get("weight"),r=o-(s.position.left+6)/i.width(),d=a+(s.position.left+6)/i.width();s.helper.offset().left,i.offset().left;l(this).data("newCellClone").css("width",i.width()*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10),l(this).data("prevCellClone").css("width",i.width()*d).find(".preview-cell-weight").html(Math.round(1e3*d)/10)},stop:function(e,s){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove(),a.find(".preview-cell-in").css("visibility","visible"),d.find(".preview-cell-in").css("visibility","visible");var o=(s.position.left+6)/i.width(),r=t.row.cells.at(n),h=t.row.cells.at(n-1);r.get("weight")-o>.02&&h.get("weight")+o>.02&&(r.set("weight",r.get("weight")-o),h.set("weight",h.get("weight")+o)),t.scaleRowWidths(),s.helper.css("left",-6)}})),a.click(function(e){if(l(e.target).is(".preview-cell")||l(e.target).is(".preview-cell-in")){var t=l(e.target);t.closest(".row-preview").find(".preview-cell .preview-cell-in").removeClass("cell-selected"),t.addClass("cell-selected"),this.openSelectedCellStyles()}}.bind(this)),a.find(".preview-cell-weight").click((function(s){t.$(".resize-handle").css("pointer-event","none").draggable("disable"),i.find(".preview-cell-weight").each((function(){var s=jQuery(this).hide();l('<input type="text" class="preview-cell-weight-input no-user-interacted" />').val(parseFloat(s.html())).insertAfter(s).focus((function(){clearTimeout(e)})).keyup((function(e){9!==e.keyCode&&l(this).removeClass("no-user-interacted"),13===e.keyCode&&(e.preventDefault(),l(this).blur())})).keydown((function(e){if(9===e.keyCode){e.preventDefault();var t=i.find(".preview-cell-weight-input"),s=t.index(l(this));s===t.length-1?t.eq(0).focus().select():t.eq(s+1).focus().select()}})).blur((function(){i.find(".preview-cell-weight-input").each((function(e,i){isNaN(parseFloat(l(i).val()))&&l(i).val(Math.floor(1e3*t.row.cells.at(e).get("weight"))/10)})),e=setTimeout((function(){if(0===i.find(".preview-cell-weight-input").length)return!1;var e=[],s=[],o=0,n=0;if(i.find(".preview-cell-weight-input").each((function(i,a){var r=parseFloat(l(a).val());r=isNaN(r)?1/t.row.cells.length:Math.round(10*r)/1e3;var d=!l(a).hasClass("no-user-interacted");e.push(r),s.push(d),d?o+=r:n+=r})),o>0&&n>0&&1-o>0)for(var a=0;a<e.length;a++)s[a]||(e[a]=e[a]/n*(1-o));var r=_.reduce(e,(function(e,t){return e+t}));e=e.map((function(e){return e/r})),Math.min.apply(Math,e)>.01&&t.row.cells.each((function(t,i){t.set("weight",e[i])})),i.find(".preview-cell").each((function(e,i){var s=t.row.cells.at(e).get("weight");l(i).animate({width:Math.round(1e3*s)/10+"%"},250),l(i).find(".preview-cell-weight-input").val(Math.round(1e3*s)/10)})),i.find(".preview-cell").css("overflow","visible"),setTimeout(t.regenerateRowPreview.bind(t),260)}),100)})).click((function(){l(this).select()}))})),l(this).siblings(".preview-cell-weight-input").select()}))}),this),this.trigger("form_loaded",this)},getSelectedCellIndex:function(){var e=-1;return this.$(".preview-cell .preview-cell-in").each((function(t,i){l(i).is(".cell-selected")&&(e=t)})),e},openSelectedCellStyles:function(){if(!_.isUndefined(this.cellStyles)){if(this.cellStyles.stylesLoaded){var e={};try{e=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",e)}this.cellStyles.detach()}if(this.cellStyles=this.getSelectedCellStyles(),this.cellStyles){var t=this.$(".so-sidebar.so-right-sidebar");this.cellStyles.attach(t),this.cellStyles.on("styles_loaded",(function(e){e&&(t.closest(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"),t.show())}))}},getSelectedCellStyles:function(){var e=this.getSelectedCellIndex();if(e>-1){var t=this.cellStylesCache[e];t||((t=new s.view.styles).model=this.row.cells.at(e),t.render("cell",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this,index:e}),this.cellStylesCache[e]=t)}return t},clearCellStylesCache:function(){this.cellStylesCache.forEach((function(e){e.remove(),e.off("styles_loaded")})),this.cellStylesCache=[]},scaleRowWidths:function(){var e=this;this.$(".row-preview .preview-cell").each((function(t,i){var s=e.row.cells.at(t);l(i).css("width",100*s.get("weight")+"%").find(".preview-cell-weight").html(Math.round(1e3*s.get("weight"))/10)}))},setCellsFromForm:function(){try{var e={cells:parseInt(this.$('.row-set-form input[name="cells"]').val()),ratio:parseFloat(this.$('.row-set-form select[name="ratio"]').val()),direction:this.$('.row-set-form select[name="ratio_direction"]').val()};_.isNaN(e.cells)&&(e.cells=1),isNaN(e.ratio)&&(e.ratio=1),e.cells<1?(e.cells=1,this.$('.row-set-form input[name="cells"]').val(e.cells)):e.cells>12&&(e.cells=12,this.$('.row-set-form input[name="cells"]').val(e.cells)),this.$('.row-set-form select[name="ratio"]').val(e.ratio);for(var t=[],i=this.row.cells.length!==e.cells,o=1,n=0;n<e.cells;n++)t.push(o),o*=e.ratio;var a=_.reduce(t,(function(e,t){return e+t}));if(t=_.map(t,(function(e){return e/a})),t=_.filter(t,(function(e){return e>.01})),"left"===e.direction&&(t=t.reverse()),this.row.cells=new s.collection.cells(this.row.cells.first(t.length)),_.each(t,function(e,t){var i=this.row.cells.at(t);i?i.set("weight",e):(i=new s.model.cell({weight:e,row:this.model}),this.row.cells.add(i))}.bind(this)),this.row.ratio=e.ratio,this.row.ratio_direction=e.direction,i)this.regenerateRowPreview();else{var r=this;this.$(".preview-cell").each((function(e,t){var i=r.row.cells.at(e).get("weight");l(t).animate({width:Math.round(1e3*i)/10+"%"},250),l(t).find(".preview-cell-weight").html(Math.round(1e3*i)/10)})),this.$(".preview-cell").css("overflow","visible"),setTimeout(r.regenerateRowPreview.bind(r),260)}}catch(e){console.log("Error setting cells - "+e.message)}this.$(".row-set-form .so-button-row-set").removeClass("button-primary")},tabClickHandler:function(e){"#row-layout"===e.attr("href")?this.$(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"):this.$(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar")},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),_.isEmpty(this.model)||(this.model.setCells(this.row.cells),this.model.set("ratio",this.row.ratio),this.model.set("ratio_direction",this.row.ratio_direction)),!_.isUndefined(this.styles)&&this.styles.stylesLoaded){var t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-row-styles").style}catch(e){console.log("Error retrieving row styles - "+e.message)}this.model.set("style",t)}if(!_.isUndefined(this.cellStyles)&&this.cellStyles.stylesLoaded){t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",t)}e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},insertHandler:function(){this.builder.addHistoryEntry("row_added"),this.updateModel();var e=this.builder.getActiveCell({createCell:!1}),t={};return null!==e&&(t.at=this.builder.model.get("rows").indexOf(e.row)+1),this.model.collection=this.builder.model.get("rows"),this.builder.model.get("rows").add(this.model,t),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},saveHandler:function(){return this.builder.addHistoryEntry("row_edited"),this.updateModel(),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},deleteHandler:function(){return this.rowView.visualDestroyModel(),this.closeDialog({silent:!0}),!1},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);return this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.closeDialog({silent:!0}),!1},closeHandler:function(){this.clearCellStylesCache(),_.isUndefined(this.cellStyles)||(this.cellStyles=void 0)}})},{}],9:[function(e,t,i){var s=window.panels,l=jQuery,o=e("../view/widgets/js-widget");t.exports=s.view.dialog.extend({builder:null,sidebarWidgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widget-sidebar-widget").html())),dialogClass:"so-panels-dialog-edit-widget",dialogIcon:"add-widget",widgetView:!1,savingWidget:!1,editableLabel:!0,events:{"click .so-close":"saveHandler","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler"},initializeDialog:function(){var e=this;this.listenTo(this.model,"change:values",this.handleChangeValues),this.listenTo(this.model,"destroy",this.remove),this.dialogFormsLoaded=0,this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("edit_label",function(e){e===panelsOptions.widgets[this.model.get("class")].title&&(e=""),this.model.set("label",e),_.isEmpty(e)&&this.$(".so-title").text(this.model.getWidgetField("title"))}.bind(this))},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widget").html(),{})),this.loadForm();var e=this.model.getWidgetField("title");this.$(".so-title .widget-name").html(e),this.$(".so-edit-title").val(e),this.builder.supports("addWidget")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteWidget")||this.$(".so-buttons .so-delete").remove(),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("widget",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var t=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(t),this.styles.on("styles_loaded",(function(e){e||(t.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),t.remove())}),this)},getPrevDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(0===i)return!1;do{if(t=e.eq(--i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t)&&i>0);return!1},getNextDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(i===e.length-1)return!1;do{if(t=e.eq(++i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t));return!1},loadForm:function(){if(this.$("> *").length){this.$(".so-content").addClass("so-panels-loading");var e={action:"so_panels_widget_form",widget:this.model.get("class"),instance:JSON.stringify(this.model.get("values")),raw:this.model.get("raw")},t=this.$(".so-content");l.post(panelsOptions.ajaxurl,e,null,"html").done(function(e){var i=e.replace(/{\$id}/g,this.model.cid);t.removeClass("so-panels-loading").html(i),this.trigger("form_loaded",this),this.$(".panel-dialog").trigger("panelsopen"),this.on("close_dialog",this.updateModel,this),t.find("> .widget-content").length>0&&o.addWidget(t,this.model.widget_id)}.bind(this)).fail((function(e){var i;i=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,t.removeClass("so-panels-loading").html(i)}))}},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),this.savingWidget=!0,!this.model.get("missing")){var t=this.getFormValues();t=_.isUndefined(t.widgets)?{}:(t=t.widgets)[Object.keys(t)[0]],this.model.setValues(t),this.model.set("raw",!0)}if(this.styles.stylesLoaded){var i={};try{i=this.getFormValues(".so-sidebar .so-visual-styles").style}catch(e){}this.model.set("style",i)}this.savingWidget=!1,e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},handleChangeValues:function(){this.savingWidget||this.loadForm()},saveHandler:function(){this.builder.addHistoryEntry("widget_edited"),this.closeDialog()},deleteHandler:function(){return this.widgetView.visualDestroyModel(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1},duplicateHandler:function(){return this.widgetView.duplicateHandler(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1}})},{"../view/widgets/js-widget":31}],10:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({builder:null,widgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widgets-widget").html())),filter:{},dialogClass:"so-panels-dialog-add-widget",dialogIcon:"add-widget",events:{"click .so-close":"closeDialog","click .widget-type":"widgetClickHandler","keyup .so-sidebar-search":"searchHandler"},initializeDialog:function(){this.on("open_dialog",(function(){this.filter.search="",this.filterWidgets(this.filter)}),this),this.on("open_dialog_complete",(function(){this.$(".so-sidebar-search").val("").focus(),this.balanceWidgetHeights()})),this.on("tab_click",this.tabClickHandler,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widgets").html(),{})),_.each(panelsOptions.widgets,(function(e){var t=l(this.widgetTemplate({title:e.title,description:e.description}));_.isUndefined(e.icon)&&(e.icon="dashicons dashicons-admin-generic"),l('<span class="widget-icon" />').addClass(e.icon).prependTo(t.find(".widget-type-wrapper")),t.data("class",e.class).appendTo(this.$(".widget-type-list"))}),this);var e=this.$(".so-sidebar-tabs");_.each(panelsOptions.widget_dialog_tabs,(function(t,i){l(this.dialogTabTemplate({title:t.title,tab:i})).data({message:t.message,filter:t.filter}).appendTo(e)}),this),this.initTabs();var t=this;l(window).resize((function(){t.balanceWidgetHeights()}))},tabClickHandler:function(e){this.filter=e.parent().data("filter"),this.filter.search=this.$(".so-sidebar-search").val();var t=e.parent().data("message");return _.isEmpty(t)&&(t=""),this.$(".so-toolbar .so-status").html(t),this.filterWidgets(this.filter),!1},searchHandler:function(e){if(13===e.which){var t=this.$(".widget-type-list .widget-type:visible");1===t.length&&t.click()}else this.filter.search=l(e.target).val().trim(),this.filterWidgets(this.filter)},filterWidgets:function(e){_.isUndefined(e)&&(e={}),_.isUndefined(e.groups)&&(e.groups=""),this.$(".widget-type-list .widget-type").each((function(){var t,i=l(this),s=i.data("class"),o=_.isUndefined(panelsOptions.widgets[s])?null:panelsOptions.widgets[s];(t=!!_.isEmpty(e.groups)||null!==o&&!_.isEmpty(_.intersection(e.groups,panelsOptions.widgets[s].groups)))&&(_.isUndefined(e.search)||""===e.search||-1===o.title.toLowerCase().indexOf(e.search.toLowerCase())&&(t=!1)),t?i.show():i.hide()})),this.balanceWidgetHeights()},widgetClickHandler:function(e){this.builder.trigger("before_user_adds_widget"),this.builder.addHistoryEntry("widget_added");var t=l(e.currentTarget),i=new s.model.widget({class:t.data("class")});i.cell=this.builder.getActiveCell(),i.cell.get("widgets").add(i),this.closeDialog(),this.builder.model.refreshPanelsData(),this.builder.trigger("after_user_adds_widget",i)},balanceWidgetHeights:function(e){var t=[[]],i=null,s=Math.round(this.$(".widget-type").parent().width()/this.$(".widget-type").width());this.$(".widget-type").css("clear","none").filter(":visible").each((function(e,t){e%s==0&&0!==e&&l(t).css("clear","both")})),this.$(".widget-type-wrapper").css("height","auto").filter(":visible").each((function(e,s){var o=l(s);null!==i&&i.position().top!==o.position().top&&(t[t.length]=[]),i=o,t[t.length-1].push(o)})),_.each(t,(function(e,t){var i=_.max(e.map((function(e){return e.height()})));_.each(e,(function(e){e.height(i)}))}))}})},{}],11:[function(e,t,i){t.exports={canCopyPaste:function(){return"undefined"!=typeof Storage&&panelsOptions.user},setModel:function(e){if(!this.canCopyPaste())return!1;var t=panels.helpers.serialize.serialize(e);return e instanceof panels.model.row?t.thingType="row-model":e instanceof panels.model.widget&&(t.thingType="widget-model"),localStorage["panels_clipboard_"+panelsOptions.user]=JSON.stringify(t),!0},isModel:function(e){if(!this.canCopyPaste())return!1;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&((t=JSON.parse(t)).thingType&&t.thingType===e)},getModel:function(e){if(!this.canCopyPaste())return null;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&(t=JSON.parse(t)).thingType&&t.thingType===e?panels.helpers.serialize.unserialize(t,t.thingType,null):null}}},{}],12:[function(e,t,i){t.exports={lock:function(){if("hidden"!==jQuery("body").css("overflow")){var e=[self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];jQuery("body").data({"scroll-position":e}).css("overflow","hidden"),_.isUndefined(e)||window.scrollTo(e[0],e[1])}},unlock:function(){if("hidden"===jQuery("body").css("overflow")&&!jQuery(".so-panels-dialog-wrapper").is(":visible")&&!jQuery(".so-panels-live-editor").is(":visible")){jQuery("body").css("overflow","visible");var e=jQuery("body").data("scroll-position");_.isUndefined(e)||window.scrollTo(e[0],e[1])}}}},{}],13:[function(e,t,i){t.exports={serialize:function(e){var t;if(e instanceof Backbone.Model){var i={};for(var s in e.attributes)if(e.attributes.hasOwnProperty(s)){if("builder"===s||"collection"===s)continue;(t=e.attributes[s])instanceof Backbone.Model||t instanceof Backbone.Collection?i[s]=this.serialize(t):i[s]=t}return i}if(e instanceof Backbone.Collection){for(var l=[],o=0;o<e.models.length;o++)(t=e.models[o])instanceof Backbone.Model||t instanceof Backbone.Collection?l.push(this.serialize(t)):l.push(t);return l}},unserialize:function(e,t,i){var s;switch(t){case"row-model":(s=new panels.model.row).builder=i;var l={style:e.style};e.hasOwnProperty("label")&&(l.label=e.label),e.hasOwnProperty("color_label")&&(l.color_label=e.color_label),s.set(l),s.setCells(this.unserialize(e.cells,"cell-collection",s));break;case"cell-model":(s=new panels.model.cell).row=i,s.set("weight",e.weight),s.set("style",e.style),s.set("widgets",this.unserialize(e.widgets,"widget-collection",s));break;case"widget-model":for(var o in(s=new panels.model.widget).cell=i,e)e.hasOwnProperty(o)&&s.set(o,e[o]);s.set("widget_id",panels.helpers.utils.generateUUID());break;case"cell-collection":s=new panels.collection.cells;for(var n=0;n<e.length;n++)s.push(this.unserialize(e[n],"cell-model",i));break;case"widget-collection":s=new panels.collection.widgets;for(n=0;n<e.length;n++)s.push(this.unserialize(e[n],"widget-model",i));break;default:console.log("Unknown Thing - "+t)}return s}}},{}],14:[function(e,t,i){t.exports={generateUUID:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))},processTemplate:function(e){return _.isUndefined(e)||_.isNull(e)?"":e=(e=(e=e.replace(/{{%/g,"<%")).replace(/%}}/g,"%>")).trim()},selectElementContents:function(e){var t=document.createRange();t.selectNodeContents(e);var i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}},{}],15:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=function(e,t){return this.each((function(){var i=jQuery(this);if(!i.data("soPanelsBuilderWidgetInitialized")||t){var o=i.closest("form").find(".widget-id").val(),n=l.extend(!0,{builderSupports:i.data("builder-supports")},e);if(_.isUndefined(o)||!(o.indexOf("__i__")>-1)){var a=new s.model.builder,r=new s.view.builder({model:a,config:n}),d=i.closest(".so-panels-dialog-wrapper").data("view");_.isUndefined(d)||(d.on("close_dialog",(function(){a.refreshPanelsData()})),d.on("open_dialog_complete",(function(){r.trigger("builder_resize")})),d.model.on("destroy",(function(){a.emptyRows().destroy()})),r.setDialogParents(panelsOptions.loc.layout_widget,d));var h=Boolean(i.closest(".widget-content").length);r.render().attach({container:i,dialog:h||"dialog"===i.data("mode"),type:i.data("type")}).setDataField(i.find("input.panels-data")),h||"dialog"===i.data("mode")?(r.setDialogParents(panelsOptions.loc.layout_widget,r.dialog),i.find(".siteorigin-panels-display-builder").click((function(e){e.preventDefault(),r.dialog.openDialog()}))):i.find(".siteorigin-panels-display-builder").parent().remove(),l(document).trigger("panels_setup",r),i.data("soPanelsBuilderWidgetInitialized",!0)}}}))}},{}],16:[function(e,t,i){
|
2 |
Â
/**
|
3 |
Â
* Everything we need for SiteOrigin Page Builder.
|
4 |
Â
*
|
5 |
Â
* @copyright Greg Priday 2013 - 2016 - <https://siteorigin.com/>
|
6 |
Â
* @license GPL 3.0 http://www.gnu.org/licenses/gpl.html
|
7 |
Â
*/
|
8 |
-
var s={};window.panels=s,window.siteoriginPanels=s,s.helpers={},s.helpers.clipboard=e("./helpers/clipboard"),s.helpers.utils=e("./helpers/utils"),s.helpers.serialize=e("./helpers/serialize"),s.helpers.pageScroll=e("./helpers/page-scroll"),s.model={},s.model.widget=e("./model/widget"),s.model.cell=e("./model/cell"),s.model.row=e("./model/row"),s.model.builder=e("./model/builder"),s.model.historyEntry=e("./model/history-entry"),s.collection={},s.collection.widgets=e("./collection/widgets"),s.collection.cells=e("./collection/cells"),s.collection.rows=e("./collection/rows"),s.collection.historyEntries=e("./collection/history-entries"),s.view={},s.view.widget=e("./view/widget"),s.view.cell=e("./view/cell"),s.view.row=e("./view/row"),s.view.builder=e("./view/builder"),s.view.dialog=e("./view/dialog"),s.view.styles=e("./view/styles"),s.view.liveEditor=e("./view/live-editor"),s.dialog={},s.dialog.builder=e("./dialog/builder"),s.dialog.widgets=e("./dialog/widgets"),s.dialog.widget=e("./dialog/widget"),s.dialog.prebuilt=e("./dialog/prebuilt"),s.dialog.row=e("./dialog/row"),s.dialog.history=e("./dialog/history"),s.utils={},s.utils.menu=e("./utils/menu"),jQuery.fn.soPanelsSetupBuilderWidget=e("./jquery/setup-builder-widget"),jQuery((function(e){var t,i,s,l,o=e("#siteorigin-panels-metabox");if(s=e("form#post"),o.length&&s.length)t=o,i=o.find(".siteorigin-panels-data-field"),l={editorType:"tinyMCE",postId:e("#post_ID").val(),editorId:"#content",builderType:o.data("builder-type"),builderSupports:o.data("builder-supports"),loadOnAttach:panelsOptions.loadOnAttach&&1==e("#auto_draft").val(),loadLiveEditor:1==o.data("live-editor"),liveEditorPreview:t.data("preview-url")};else if(e(".siteorigin-panels-builder-form").length){var n=e(".siteorigin-panels-builder-form");t=n.find(".siteorigin-panels-builder-container"),i=n.find('input[name="panels_data"]'),s=n,l={editorType:"standalone",postId:n.data("post-id"),editorId:"#post_content",builderType:n.data("type"),builderSupports:n.data("builder-supports"),loadLiveEditor:!1,liveEditorPreview:n.data("preview-url")}}if(!_.isUndefined(t)){var a=window.siteoriginPanels,r=new a.model.builder,d=new a.view.builder({model:r,config:l});e(document).trigger("before_panels_setup",d),d.render().attach({container:t}).setDataField(i).attachToEditor(),s.submit((function(){r.refreshPanelsData()})),t.removeClass("so-panels-loading"),e(document).trigger("panels_setup",d,window.panels),window.soPanelsBuilderView=d}e(document).on("widget-added",(function(t,i){e(i).find(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e("body").hasClass("wp-customizer")||e((function(){e(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e(window).on("keyup",(function(t){27===t.which&&e(".so-panels-dialog-wrapper, .so-panels-live-editor").filter(":visible").last().find(".so-title-bar .so-close, .live-editor-close").click()}))}))},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/page-scroll":12,"./helpers/serialize":13,"./helpers/utils":14,"./jquery/setup-builder-widget":15,"./model/builder":17,"./model/cell":18,"./model/history-entry":19,"./model/row":20,"./model/widget":21,"./utils/menu":22,"./view/builder":23,"./view/cell":24,"./view/dialog":25,"./view/live-editor":26,"./view/row":27,"./view/styles":28,"./view/widget":29}],17:[function(e,t,i){t.exports=Backbone.Model.extend({layoutPosition:{BEFORE:"before",AFTER:"after",REPLACE:"replace"},rows:{},defaults:{data:{widgets:[],grids:[],grid_cells:[]}},initialize:function(){this.set("rows",new panels.collection.rows)},addRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var s=new panels.collection.cells(t);e=_.extend({collection:this.get("rows"),cells:s},e);var l=new panels.model.row(e);return l.builder=this,this.get("rows").add(l,i),l},loadPanelsData:function(e,t){try{t===this.layoutPosition.BEFORE?e=this.concatPanelsData(e,this.getPanelsData()):t===this.layoutPosition.AFTER&&(e=this.concatPanelsData(this.getPanelsData(),e)),this.emptyRows(),this.set("data",JSON.parse(JSON.stringify(e)),{silent:!0});var i,s=[];if(_.isUndefined(e.grid_cells))return void this.trigger("load_panels_data");for(var l=0;l<e.grid_cells.length;l++)i=parseInt(e.grid_cells[l].grid),_.isUndefined(s[i])&&(s[i]=[]),s[i].push(e.grid_cells[l]);var o=this;if(_.each(s,(function(t,i){var s={};_.isUndefined(e.grids[i].style)||(s.style=e.grids[i].style),_.isUndefined(e.grids[i].ratio)||(s.ratio=e.grids[i].ratio),_.isUndefined(e.grids[i].ratio_direction)||(s.ratio_direction=e.grids[i].ratio_direction),_.isUndefined(e.grids[i].color_label)||(s.color_label=e.grids[i].color_label),_.isUndefined(e.grids[i].label)||(s.label=e.grids[i].label),o.addRow(s,t,{noAnimate:!0})})),_.isUndefined(e.widgets))return;_.each(e.widgets,(function(e){var t=null;_.isUndefined(e.panels_info)?(t=e.info,delete e.info):(t=e.panels_info,delete e.panels_info);var i=o.get("rows").at(parseInt(t.grid)).get("cells").at(parseInt(t.cell)),s=new panels.model.widget({class:t.class,values:e});_.isUndefined(t.style)||s.set("style",t.style),_.isUndefined(t.read_only)||s.set("read_only",t.read_only),_.isUndefined(t.widget_id)?s.set("widget_id",panels.helpers.utils.generateUUID()):s.set("widget_id",t.widget_id),_.isUndefined(t.label)||s.set("label",t.label),s.cell=i,i.get("widgets").add(s,{noAnimate:!0})})),this.trigger("load_panels_data")}catch(e){console.log("Error loading data: "+e.message)}},concatPanelsData:function(e,t){if(_.isUndefined(t)||_.isUndefined(t.grids)||_.isEmpty(t.grids)||_.isUndefined(t.grid_cells)||_.isEmpty(t.grid_cells))return e;if(_.isUndefined(e)||_.isUndefined(e.grids)||_.isEmpty(e.grids))return t;var i,s=e.grids.length,l=_.isUndefined(e.widgets)?0:e.widgets.length,o={grids:[],grid_cells:[],widgets:[]};for(o.grids=e.grids.concat(t.grids),_.isUndefined(e.grid_cells)||(o.grid_cells=e.grid_cells.slice()),_.isUndefined(e.widgets)||(o.widgets=e.widgets.slice()),i=0;i<t.grid_cells.length;i++){var n=t.grid_cells[i];n.grid=parseInt(n.grid)+s,o.grid_cells.push(n)}if(!_.isUndefined(t.widgets))for(i=0;i<t.widgets.length;i++){var a=t.widgets[i];a.panels_info.grid=parseInt(a.panels_info.grid)+s,a.panels_info.id=parseInt(a.panels_info.id)+l,o.widgets.push(a)}return o},getPanelsData:function(){var e={widgets:[],grids:[],grid_cells:[]},t=0;return this.get("rows").each((function(i,s){i.get("cells").each((function(i,l){i.get("widgets").each((function(i,o){var n={class:i.get("class"),raw:i.get("raw"),grid:s,cell:l,id:t++,widget_id:i.get("widget_id"),style:i.get("style"),label:i.get("label")};_.isEmpty(n.widget_id)&&(n.widget_id=panels.helpers.utils.generateUUID());var a=_.extend(_.clone(i.get("values")),{panels_info:n});e.widgets.push(a)})),e.grid_cells.push({grid:s,index:l,weight:i.get("weight"),style:i.get("style")})})),e.grids.push({cells:i.get("cells").length,style:i.get("style"),ratio:i.get("ratio"),ratio_direction:i.get("ratio_direction"),color_label:i.get("color_label"),label:i.get("label")})})),e},refreshPanelsData:function(e){e=_.extend({silent:!1},e);var t=this.get("data"),i=this.getPanelsData();this.set("data",i,{silent:!0}),e.silent||JSON.stringify(i)===JSON.stringify(t)||(this.trigger("change"),this.trigger("change:data"),this.trigger("refresh_panels_data",i,e))},emptyRows:function(){return _.invoke(this.get("rows").toArray(),"destroy"),this.get("rows").reset(),this},isValidLayoutPosition:function(e){return e===this.layoutPosition.BEFORE||e===this.layoutPosition.AFTER||e===this.layoutPosition.REPLACE},getPanelsDataFromHtml:function(e,t){var i,s=this,l=jQuery('<div id="wrapper">'+e+"</div>");if(l.find(".panel-layout .panel-grid").length){var o={grids:[],grid_cells:[],widgets:[]},n=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),a=(i=document.createElement("div"),function(e){return e&&"string"==typeof e&&(e=(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),i.innerHTML=e,e=i.textContent,i.textContent=""),e}),r=function(e){var t,i=e.find("div");if(!i.length)return e.html();for(t=0;t<i.length-1&&jQuery.trim(i.eq(t).text())==jQuery.trim(i.eq(t+1).text());t++);var s=i.eq(t).find(".widget-title:header"),l="";return s.length&&(l=s.html(),s.remove()),{title:l,text:i.eq(t).html()}},d=l.find(".panel-layout").eq(0),h=function(e,t){return jQuery(t).closest(".panel-layout").is(d)};return l.find("> .panel-layout > .panel-grid").filter(h).each((function(e,i){var l=jQuery(i),d=l.find(".panel-grid-cell").filter(h);o.grids.push({cells:d.length,style:l.data("style"),ratio:l.data("ratio"),ratio_direction:l.data("ratio-direction"),color_label:l.data("color-label"),label:l.data("label")}),d.each((function(i,l){var d=jQuery(l),c=d.find(".so-panel").filter(h);o.grid_cells.push({grid:e,weight:_.isUndefined(d.data("weight"))?1:parseFloat(d.data("weight")),style:d.data("style")}),c.each((function(l,d){var h=jQuery(d),c=h.find(".panel-widget-style").length?h.find(".panel-widget-style").html():h.html(),u={grid:e,cell:i,style:h.data("style"),raw:!1,label:h.data("label")};c=c.trim();var p=n.exec(c);if(!_.isNull(p)&&""===c.replace(n,"").trim()){try{var g=/class="(.*?)"/.exec(p[3]),f=jQuery(p[5]),w=JSON.parse(a(f.val())).instance;u.class=g[1].replace(/\\\\+/g,"\\"),u.raw=!1,w.panels_info=u,o.widgets.push(w)}catch(e){u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u}))}return!0}return-1!==c.indexOf("panel-layout")&&jQuery("<div>"+c+"</div>").find(".panel-layout .panel-grid").length?(u.class="SiteOrigin_Panels_Widgets_Layout",o.widgets.push({panels_data:s.getPanelsDataFromHtml(c,t),panels_info:u}),!0):(u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u})),!0)}))}))})),l.find(".panel-layout").remove(),l.find("style[data-panels-style-for-post]").remove(),l.html().replace(/^\s+|\s+$/gm,"").length&&(o.grids.push({cells:1,style:{}}),o.grid_cells.push({grid:o.grids.length-1,weight:1}),o.widgets.push({filter:"1",text:l.html().replace(/^\s+|\s+$/gm,""),title:"",type:"visual",panels_info:{class:t,raw:!1,grid:o.grids.length-1,cell:0}})),o}return{grid_cells:[{grid:0,weight:1}],grids:[{cells:1}],widgets:[{filter:"1",text:e,title:"",type:"visual",panels_info:{class:t,raw:!1,grid:0,cell:0}}]}}})},{}],18:[function(e,t,i){t.exports=Backbone.Model.extend({widgets:{},row:null,defaults:{weight:0,style:{}},indexes:null,initialize:function(){this.set("widgets",new panels.collection.widgets),this.on("destroy",this.onDestroy,this)},onDestroy:function(){_.invoke(this.get("widgets").toArray(),"destroy"),this.get("widgets").reset()},clone:function(e,t){_.isUndefined(e)&&(e=this.row),t=_.extend({cloneWidgets:!0},t);var i=new this.constructor(this.attributes);return i.set("collection",e.get("cells"),{silent:!0}),i.row=e,t.cloneWidgets&&this.get("widgets").each((function(e){i.get("widgets").add(e.clone(i,t),{silent:!0})})),i}})},{}],19:[function(e,t,i){t.exports=Backbone.Model.extend({defaults:{text:"",data:"",time:null,count:1}})},{}],20:[function(e,t,i){t.exports=Backbone.Model.extend({builder:null,defaults:{style:{}},indexes:null,initialize:function(){_.isEmpty(this.get("cells"))?this.set("cells",new panels.collection.cells):this.get("cells").each(function(e){e.row=this}.bind(this)),this.on("destroy",this.onDestroy,this)},setCells:function(e){var t=this.get("cells")||new panels.collection.cells,i=[];t.each((function(s,l){var o=e.at(l);if(o)s.set("weight",o.get("weight"));else{for(var n=t.at(e.length-1),a=s.get("widgets").models.slice(),r=0;r<a.length;r++)a[r].moveToCell(n,{silent:!1});i.push(s)}})),_.each(i,(function(e){t.remove(e)})),e.length>t.length&&_.each(e.slice(t.length,e.length),function(e){e.set({collection:t}),e.row=this,t.add(e)}.bind(this)),this.reweightCells()},reweightCells:function(){var e=0,t=this.get("cells");t.each((function(t){e+=t.get("weight")})),t.each((function(t){t.set("weight",t.get("weight")/e)})),this.trigger("reweight_cells")},onDestroy:function(){_.invoke(this.get("cells").toArray(),"destroy"),this.get("cells").reset()},clone:function(e){_.isUndefined(e)&&(e=this.builder);var t=new this.constructor(this.attributes);t.set("collection",e.get("rows"),{silent:!0}),t.builder=e;var i=new panels.collection.cells;return this.get("cells").each((function(e){i.add(e.clone(t),{silent:!0})})),t.set("cells",i),t}})},{}],21:[function(e,t,i){t.exports=Backbone.Model.extend({cell:null,defaults:{class:null,missing:!1,values:{},raw:!1,style:{},read_only:!1,widget_id:""},indexes:null,initialize:function(){var e=this.get("class");!_.isUndefined(panelsOptions.widgets[e])&&panelsOptions.widgets[e].installed||this.set("missing",!0)},getWidgetField:function(e){return _.isUndefined(panelsOptions.widgets[this.get("class")])?"title"===e||"description"===e?panelsOptions.loc.missing_widget[e]:"":this.has("label")&&!_.isEmpty(this.get("label"))?this.get("label"):panelsOptions.widgets[this.get("class")][e]},moveToCell:function(e,t,i){return t=_.extend({silent:!0},t),this.cell=e,this.collection.remove(this,t),e.get("widgets").add(this,_.extend({at:i},t)),this.trigger("move_to_cell",e,i),this},setValues:function(e){var t=!1;JSON.stringify(e)!==JSON.stringify(this.get("values"))&&(t=!0),this.set("values",e,{silent:!0}),t&&(this.trigger("change",this),this.trigger("change:values"))},clone:function(e,t){_.isUndefined(e)&&(e=this.cell);var i=new this.constructor(this.attributes),s=JSON.parse(JSON.stringify(this.get("values"))),l=function(e){return _.each(e,(function(t,i){_.isString(i)&&"_"===i[0]?delete e[i]:_.isObject(e[i])&&l(e[i])})),e};return s=l(s),"SiteOrigin_Panels_Widgets_Layout"===this.get("class")&&(s.builder_id=Math.random().toString(36).substr(2)),i.set("widget_id",""),i.set("values",s,{silent:!0}),i.set("collection",e.get("widgets"),{silent:!0}),i.cell=e,i.isDuplicate=!0,i},getTitle:function(){var e=panelsOptions.widgets[this.get("class")];if(_.isUndefined(e))return this.get("class").replace(/_/g," ");if(!_.isUndefined(e.panels_title)&&!1===e.panels_title)return panelsOptions.widgets[this.get("class")].description;var t=this.get("values"),i=["title","text"];for(var s in t)"_"!==s.charAt(0)&&"so_sidebar_emulator_id"!==s&&"option_name"!==s&&t.hasOwnProperty(s)&&i.push(s);for(var l in i=_.uniq(i))if(!_.isUndefined(t[i[l]])&&_.isString(t[i[l]])&&""!==t[i[l]]&&"on"!==t[i[l]]&&"true"!==t[i[l]]&&"false"!==t[i[l]]&&"_"!==i[l][0]&&!jQuery.isNumeric(t[i[l]])){var o=t[i[l]],n=(o=o.replace(/<\/?[^>]+(>|$)/g,"")).split(" ");return(n=n.slice(0,20)).join(" ")}return this.getWidgetField("description")}})},{}],22:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({wrapperTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu").html())),sectionTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu-section").html())),contexts:[],active:!1,events:{"keyup .so-search-wrapper input":"searchKeyUp"},initialize:function(){this.listenContextMenu(),this.render(),this.attach()},listenContextMenu:function(){var e=this;l(window).on("contextmenu",(function(t){return e.active&&!e.isOverEl(e.$el,t)?(e.closeMenu(),e.active=!1,t.preventDefault(),!1):!!e.active||(e.active=!1,e.trigger("activate_context",t,e),void(e.active&&(t.preventDefault(),e.openMenu({left:t.pageX,top:t.pageY}))))}))},render:function(){this.setElement(this.wrapperTemplate())},attach:function(){this.$el.appendTo("body")},openMenu:function(e){this.trigger("open_menu"),l(window).on("keyup",{menu:this},this.keyboardListen),l(window).on("click",{menu:this},this.clickOutsideListen),this.$el.css("max-height",l(window).height()-20),e.left+this.$el.outerWidth()+10>=l(window).width()&&(e.left=l(window).width()-this.$el.outerWidth()-10),e.left<=0&&(e.left=10),e.top+this.$el.outerHeight()-l(window).scrollTop()+10>=l(window).height()&&(e.top=l(window).height()+l(window).scrollTop()-this.$el.outerHeight()-10),e.left<=0&&(e.left=10),this.$el.css({left:e.left+1,top:e.top+1}).show(),this.$(".so-search-wrapper input").focus()},closeMenu:function(){this.trigger("close_menu"),l(window).off("keyup",this.keyboardListen),l(window).off("click",this.clickOutsideListen),this.active=!1,this.$el.empty().hide()},keyboardListen:function(e){var t=e.data.menu;switch(e.which){case 27:t.closeMenu()}},clickOutsideListen:function(e){var t=e.data.menu;3!==e.which&&t.$el.is(":visible")&&!t.isOverEl(t.$el,e)&&t.closeMenu()},addSection:function(e,t,i,s){var o=this;t=_.extend({display:5,defaultDisplay:!1,search:!0,sectionTitle:"",searchPlaceholder:"",titleKey:"title"},t);var n=l(this.sectionTemplate({settings:t,items:i})).attr("id","panels-menu-section-"+e);this.$el.append(n),n.find(".so-item:not(.so-confirm)").click((function(){var e=l(this);s(e.data("key")),o.closeMenu()})),n.find(".so-item.so-confirm").click((function(){var e=l(this);if(e.hasClass("so-confirming"))return s(e.data("key")),void o.closeMenu();e.data("original-text",e.html()).addClass("so-confirming").html('<span class="dashicons dashicons-yes"></span> '+panelsOptions.loc.dropdown_confirm),setTimeout((function(){e.removeClass("so-confirming"),e.html(e.data("original-text"))}),2500)})),n.data("settings",t).find(".so-search-wrapper input").trigger("keyup"),this.active=!0},hasSection:function(e){return this.$el.find("#panels-menu-section-"+e).length>0},searchKeyUp:function(e){var t=l(e.currentTarget),i=t.closest(".so-section"),s=i.data("settings");if(38===e.which||40===e.which){var o=i.find("ul li:visible"),n=o.filter(".so-active").eq(0);if(n.length){o.removeClass("so-active");var a=o.index(n);38===e.which?n=a-1<0?o.last():o.eq(a-1):40===e.which&&(n=a+1>=o.length?o.first():o.eq(a+1))}else 38===e.which?n=o.last():40===e.which&&(n=o.first());return n.addClass("so-active"),!1}if(13===e.which)return 1===i.find("ul li:visible").length?(i.find("ul li:visible").trigger("click"),!1):(i.find("ul li.so-active:visible").trigger("click"),!1);if(""===t.val())if(s.defaultDisplay){i.find(".so-item").hide();for(var r=0;r<s.defaultDisplay.length;r++)i.find('.so-item[data-key="'+s.defaultDisplay[r]+'"]').show()}else i.find(".so-item").show();else i.find(".so-item").hide().each((function(){var e=l(this);-1!==e.html().toLowerCase().indexOf(t.val().toLowerCase())&&e.show()}));i.find(".so-item:visible:gt("+(s.display-1)+")").hide(),0===i.find(".so-item:visible").length&&""!==t.val()?i.find(".so-no-results").show():i.find(".so-no-results").hide()},isOverEl:function(e,t){var i=[[e.offset().left,e.offset().top],[e.offset().left+e.outerWidth(),e.offset().top+e.outerHeight()]];return t.pageX>=i[0][0]&&t.pageX<=i[1][0]&&t.pageY>=i[0][1]&&t.pageY<=i[1][1]}})},{}],23:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({config:{},template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder").html())),dialogs:{},rowsSortable:null,dataField:!1,currentData:"",contentPreview:"",attachedToEditor:!1,attachedVisible:!1,liveEditor:void 0,menu:!1,activeCell:null,events:{"click .so-tool-button.so-widget-add":"displayAddWidgetDialog","click .so-tool-button.so-row-add":"displayAddRowDialog","click .so-tool-button.so-prebuilt-add":"displayAddPrebuiltDialog","click .so-tool-button.so-history":"displayHistoryDialog","click .so-tool-button.so-live-editor":"displayLiveEditor"},rows:null,initialize:function(e){var t=this;return this.config=_.extend({loadLiveEditor:!1,builderSupports:{}},e.config),this.config.builderSupports=_.extend({addRow:!0,editRow:!0,deleteRow:!0,moveRow:!0,addWidget:!0,editWidget:!0,deleteWidget:!0,moveWidget:!0,prebuilt:!0,history:!0,liveEditor:!0,revertToEditor:!0},this.config.builderSupports),e.config.loadLiveEditor&&this.on("builder_live_editor_added",(function(){this.displayLiveEditor()})),this.dialogs={widgets:new s.dialog.widgets,row:new s.dialog.row,prebuilt:new s.dialog.prebuilt},_.each(this.dialogs,(function(e,i,s){s[i].setBuilder(t)})),this.dialogs.row.setRowDialogType("create"),this.listenTo(this.model.get("rows"),"add",this.onAddRow),l(window).resize((function(e){e.target===window&&t.trigger("builder_resize")})),this.listenTo(this.model,"change:data load_panels_data",this.storeModelData),this.listenTo(this.model,"change:data load_panels_data",this.toggleWelcomeDisplay),this.on("builder_attached_to_editor",this.handleContentChange,this),this.on("content_change",this.handleContentChange,this),this.on("display_builder",this.handleDisplayBuilder,this),this.on("hide_builder",this.handleHideBuilder,this),this.on("builder_rendered builder_resize",this.handleBuilderSizing,this),this.on("display_builder",this.wrapEditorExpandAdjust,this),this.menu=new s.utils.menu({}),this.listenTo(this.menu,"activate_context",this.activateContextMenu),this.config.loadOnAttach&&this.on("builder_attached_to_editor",(function(){this.displayAttachedBuilder({confirm:!1})}),this),this},render:function(){return this.setElement(this.template()),this.$el.attr("id","siteorigin-panels-builder-"+this.cid).addClass("so-builder-container"),this.trigger("builder_rendered"),this},attach:function(e){(e=_.extend({container:!1,dialog:!1},e)).dialog?(this.dialog=new s.dialog.builder,this.dialog.builder=this):(this.$el.appendTo(e.container),this.metabox=e.container.closest(".postbox"),this.initSortable(),this.trigger("attached_to_container",e.container)),this.trigger("builder_attached"),this.supports("liveEditor")&&this.addLiveEditor(),this.supports("history")&&this.addHistoryBrowser();var t=this.$(".so-builder-toolbar"),i=this.$(".so-panels-welcome-message"),l=panelsOptions.loc.welcomeMessage,o=[];this.supports("addWidget")?o.push(l.addWidgetButton):t.find(".so-widget-add").hide(),this.supports("addRow")?o.push(l.addRowButton):t.find(".so-row-add").hide(),this.supports("prebuilt")?o.push(l.addPrebuiltButton):t.find(".so-prebuilt-add").hide();var n="";3===o.length?n=l.threeEnabled:2===o.length?n=l.twoEnabled:1===o.length?n=l.oneEnabled:0===o.length&&(n=l.addingDisabled);var a=_.template(s.helpers.utils.processTemplate(n))({items:o})+" "+l.docsMessage;return i.find(".so-message-wrapper").html(a),this},attachToEditor:function(){if("tinyMCE"!==this.config.editorType)return this;this.attachedToEditor=!0;var e=this.metabox,t=this;l("#wp-content-wrap .wp-editor-tabs").find(".wp-switch-editor").click((function(e){e.preventDefault(),l("#wp-content-editor-container").show(),l("#wp-content-wrap").removeClass("panels-active"),l("#content-resize-handle").show(),t.trigger("hide_builder")})).end().append(l('<button type="button" id="content-panels" class="hide-if-no-js wp-switch-editor switch-panels">'+e.find("h2.hndle").html()+"</button>").click((function(e){t.displayAttachedBuilder({confirm:!0})&&e.preventDefault()}))),this.supports("revertToEditor")&&e.find(".so-switch-to-standard").click((function(i){i.preventDefault(),confirm(panelsOptions.loc.confirm_stop_builder)&&(t.addHistoryEntry("back_to_editor"),t.model.loadPanelsData(!1),l("#wp-content-wrap").show(),e.hide(),l(window).resize(),t.attachedVisible=!1,t.trigger("hide_builder"))})).show(),e.insertAfter("#wp-content-wrap").hide().addClass("attached-to-editor");var i=this.model.get("data");_.isEmpty(i.widgets)&&_.isEmpty(i.grids)&&this.supports("revertToEditor")||this.displayAttachedBuilder({confirm:!1});var s=function(){var e=t.$(".so-builder-toolbar");if(t.$el.hasClass("so-display-narrow"))return e.css({top:0,left:0,width:"100%",position:"absolute"}),void t.$el.css("padding-top",e.outerHeight());var i=l(window).scrollTop()-t.$el.offset().top;"fixed"===l("#wpadminbar").css("position")&&(i+=l("#wpadminbar").outerHeight());var s=0,o=t.$el.outerHeight()-e.outerHeight()+20;i>s&&i<o?"fixed"!==e.css("position")&&e.css({top:l("#wpadminbar").outerHeight(),left:t.$el.offset().left,width:t.$el.outerWidth(),position:"fixed"}):e.css({top:Math.min(Math.max(i,0),t.$el.outerHeight()-e.outerHeight()+20),left:0,width:"100%",position:"absolute"}),t.$el.css("padding-top",e.outerHeight())};return this.on("builder_resize",s,this),l(document).scroll(s),s(),this.trigger("builder_attached_to_editor"),this},displayAttachedBuilder:function(e){if((e=_.extend({confirm:!0},e)).confirm){var t="undefined"!=typeof tinyMCE&&tinyMCE.get("content");if(""!==(t&&_.isFunction(t.getContent)?t.getContent():l("textarea#content").val())&&!confirm(panelsOptions.loc.confirm_use_builder))return!1}return l("#wp-content-wrap").hide(),l("#editor-expand-toggle").on("change.editor-expand",(function(){l(this).prop("checked")||l("#wp-content-wrap").hide()})),this.metabox.show().find("> .inside").show(),l(window).resize(),l(document).scroll(),this.attachedVisible=!0,this.trigger("display_builder"),!0},initSortable:function(){if(!this.supports("moveRow"))return this;var e=this,t=e.$el.attr("id");return this.rowsSortable=this.$(".so-rows-container").sortable({appendTo:"#wpwrap",items:".so-row-container",handle:".so-row-move",connectWith:"#"+t+".so-rows-container,.block-editor .so-rows-container",axis:"y",tolerance:"pointer",scroll:!1,remove:function(t,i){e.model.get("rows").remove(l(i.item).data("view").model,{silent:!0}),e.model.refreshPanelsData()},receive:function(t,i){e.model.get("rows").add(l(i.item).data("view").model,{silent:!0,at:l(i.item).index()}),e.model.refreshPanelsData()},stop:function(t,i){var s=l(i.item),o=s.data("view"),n=e.model.get("rows");n.get(o.model)&&(e.addHistoryEntry("row_moved"),n.remove(o.model,{silent:!0}),n.add(o.model,{silent:!0,at:s.index()}),o.trigger("move",s.index()),e.model.refreshPanelsData())}}),this},refreshSortable:function(){_.isNull(this.rowsSortable)||this.rowsSortable.sortable("refresh")},setDataField:function(e,t){if(t=_.extend({load:!0},t),this.dataField=e,this.dataField.data("builder",this),t.load&&""!==e.val()){var i=this.dataField.val();try{i=JSON.parse(i)}catch(e){console.log("Failed to parse Page Builder layout data from supplied data field."),i={}}this.setData(i)}return this},setData:function(e){this.model.loadPanelsData(e),this.currentData=e,this.toggleWelcomeDisplay()},getData:function(){return this.model.get("data")},storeModelData:function(){var e=JSON.stringify(this.model.get("data"));l(this.dataField).val()!==e&&(l(this.dataField).val(e),l(this.dataField).trigger("change"),this.trigger("content_change"))},onAddRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.row({model:e});l.builder=this,l.render(),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".so-rows-container")):l.$el.insertAfter(this.$(".so-rows-container .so-row-container").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),l.resize(),this.trigger("row_added")},displayAddWidgetDialog:function(){this.dialogs.widgets.openDialog()},displayAddRowDialog:function(){var e=new s.model.row,t=new s.collection.cells([{weight:.5},{weight:.5}]);t.each((function(t){t.row=e})),e.set("cells",t),e.builder=this.model,this.dialogs.row.setRowModel(e),this.dialogs.row.openDialog()},displayAddPrebuiltDialog:function(){this.dialogs.prebuilt.openDialog()},displayHistoryDialog:function(){this.dialogs.history.openDialog()},pasteRowHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.addHistoryEntry("row_pasted"),e.builder=this.model,this.model.get("rows").add(e,{at:this.model.get("rows").indexOf(this.model)+1}),this.model.refreshPanelsData())},getActiveCell:function(e){if(e=_.extend({createCell:!0},e),!this.model.get("rows").length){if(!e.createCell)return null;this.model.addRow({},[{weight:1}],{noAnimate:!0})}var t=this.activeCell;return _.isEmpty(t)||-1===this.model.get("rows").indexOf(t.model.row)?this.model.get("rows").last().get("cells").first():t.model},addLiveEditor:function(){return _.isEmpty(this.config.liveEditorPreview)?this:(this.liveEditor=new s.view.liveEditor({builder:this,previewUrl:this.config.liveEditorPreview}),this.liveEditor.hasPreviewUrl()&&this.$(".so-builder-toolbar .so-live-editor").show(),this.trigger("builder_live_editor_added"),this)},displayLiveEditor:function(){_.isUndefined(this.liveEditor)||this.liveEditor.open()},addHistoryBrowser:function(){if(_.isEmpty(this.config.liveEditorPreview))return this;this.dialogs.history=new s.dialog.history,this.dialogs.history.builder=this,this.dialogs.history.entries.builder=this.model,this.dialogs.history.setRevertEntry(this.model),this.$(".so-builder-toolbar .so-history").show()},addHistoryEntry:function(e,t){_.isUndefined(t)&&(t=null),_.isUndefined(this.dialogs.history)||this.dialogs.history.entries.addEntry(e,t)},supports:function(e){return"rowAction"===e?this.supports("addRow")||this.supports("editRow")||this.supports("deleteRow"):"widgetAction"===e?this.supports("addWidget")||this.supports("editWidget")||this.supports("deleteWidget"):!_.isUndefined(this.config.builderSupports[e])&&this.config.builderSupports[e]},handleContentChange:function(){if(panelsOptions.copy_content&&this.attachedToEditor&&this.$el.is(":visible")){var e=this.model.getPanelsData();_.isEmpty(e.widgets)||l.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:this.config.postId},function(e){""!==e.preview&&(this.contentPreview=e.preview),""!==e.post_content&&this.updateEditorContent(e.post_content)}.bind(this))}},updateEditorContent:function(e){if("tinyMCE"!==this.config.editorType||"undefined"==typeof tinyMCE||_.isNull(tinyMCE.get("content"))){l(this.config.editorId).val(e).trigger("change").trigger("keyup")}else{var t=tinyMCE.get("content");t.setContent(e),t.fire("change"),t.fire("keyup")}this.triggerSeoChange()},triggerSeoChange:function(){"undefined"==typeof YoastSEO||_.isNull(YoastSEO)||_.isNull(YoastSEO.app.refresh)||YoastSEO.app.refresh(),"undefined"==typeof rankMathEditor||_.isNull(rankMathEditor)||_.isNull(rankMathEditor.refresh)||rankMathEditor.refresh("content")},handleDisplayBuilder:function(){var e="undefined"!=typeof tinyMCE&&tinyMCE.get("content"),t=e&&_.isFunction(e.getContent)?e.getContent():l("textarea#content").val();if((_.isEmpty(this.model.get("data"))||_.isEmpty(this.model.get("data").widgets)&&_.isEmpty(this.model.get("data").grids))&&""!==t){var i=panelsOptions.text_widget;if(_.isEmpty(i))return;this.model.loadPanelsData(this.model.getPanelsDataFromHtml(t,i)),this.model.trigger("change"),this.model.trigger("change:data")}l("#post-status-info").addClass("for-siteorigin-panels")},handleHideBuilder:function(){l("#post-status-info").show().removeClass("for-siteorigin-panels")},wrapEditorExpandAdjust:function(){try{for(var e,t=(l.hasData(window)&&l._data(window)).events.scroll,i=0;i<t.length;i++)if("editor-expand"===t[i].namespace){e=t[i],l(window).unbind("scroll",e.handler),l(window).bind("scroll",function(t){this.attachedVisible||e.handler(t)}.bind(this));break}}catch(e){return}},handleBuilderSizing:function(){var e=this.$el.width();return e?(e<575?this.$el.addClass("so-display-narrow"):this.$el.removeClass("so-display-narrow"),this):this},setDialogParents:function(e,t){_.each(this.dialogs,(function(i,s,l){l[s].setParent(e,t)})),this.on("add_dialog",(function(i){i.setParent(e,t)}),this)},toggleWelcomeDisplay:function(){this.model.get("rows").isEmpty()?this.$(".so-panels-welcome-message").show():this.$(".so-panels-welcome-message").hide()},activateContextMenu:function(e,t){if(l.contains(this.$el.get(0),e.target)){var i=l([]).add(this.$(".so-panels-welcome-message:visible")).add(this.$(".so-rows-container > .so-row-container")).add(this.$(".so-cells > .cell")).add(this.$(".cell-wrapper > .so-widget")).filter((function(i){return t.isOverEl(l(this),e)})),s=i.last().data("view");void 0!==s&&void 0!==s.buildContextualMenu?s.buildContextualMenu(e,t):i.last().hasClass("so-panels-welcome-message")&&this.buildContextualMenu(e,t)}},buildContextualMenu:function(e,t){var i={};this.supports("addRow")&&(i.add_row={title:panelsOptions.loc.contextual.add_row}),s.helpers.clipboard.canCopyPaste()&&s.helpers.clipboard.isModel("row-model")&&this.supports("addRow")&&(i.paste_row={title:panelsOptions.loc.contextual.row_paste}),_.isEmpty(i)||t.addSection("builder-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},i,function(e){switch(e){case"add_row":this.displayAddRowDialog();break;case"paste_row":this.pasteRowHandler()}}.bind(this))}})},{}],24:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-cell").html())),events:{"click .cell-wrapper":"handleCellClick"},row:null,widgetSortable:null,initialize:function(){this.listenTo(this.model.get("widgets"),"add",this.onAddWidget)},render:function(){var e={weight:this.model.get("weight"),totalWeight:this.row.model.get("cells").totalWeight()};this.setElement(this.template(e)),this.$el.data("view",this);var t=this;return this.model.get("widgets").each((function(e){var i=new s.view.widget({model:e});i.cell=t,i.render(),i.$el.appendTo(t.$(".widgets-container"))})),this.initSortable(),this.initResizable(),this},initSortable:function(){if(!this.row.builder.supports("moveWidget"))return this;var e=this,t=e.row.builder,i=t.$el.attr("id"),s=t.model;return this.widgetSortable=this.$(".widgets-container").sortable({placeholder:"so-widget-sortable-highlight",connectWith:"#"+i+" .so-cells .cell .widgets-container,.block-editor .so-cells .cell .widgets-container",tolerance:"pointer",scroll:!1,over:function(t,i){e.row.builder.trigger("widget_sortable_move")},remove:function(t,i){e.model.get("widgets").remove(l(i.item).data("view").model,{silent:!0}),s.refreshPanelsData()},receive:function(t,i){var o=l(i.item).data("view");o.cell=e;var n=o.model;n.cell=e.model,e.model.get("widgets").add(n,{silent:!0,at:l(i.item).index()}),s.refreshPanelsData()},stop:function(t,i){var o=l(i.item),n=o.data("view"),a=o.closest(".cell").data("view");e.model.get("widgets").get(n.model)&&(e.row.builder.addHistoryEntry("widget_moved"),n.model.moveToCell(a.model,{},o.index()),n.cell=a,s.refreshPanelsData())},helper:function(e,t){var i=t.clone().css({width:t.outerWidth(),"z-index":1e4,position:"fixed"}).addClass("widget-being-dragged").appendTo("body");return t.outerWidth()>720&&i.animate({"margin-left":e.pageX-t.offset().left-240,width:480},"fast"),i}}),this},refreshSortable:function(){_.isNull(this.widgetSortable)||this.widgetSortable.sortable("refresh")},initResizable:function(){if(!this.row.builder.supports("editRow"))return this;var e,t=this.$(".resize-handle").css("position","absolute"),i=this.row.$el,s=this;return t.draggable({axis:"x",containment:i,start:function(t,i){if(e=s.$el.prev().data("view"),!_.isUndefined(e)){var o=s.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:s.$el.outerWidth(),left:5,height:s.$el.outerHeight()});o.find(".resize-handle").remove();var n=e.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:e.$el.outerWidth(),right:5,height:e.$el.outerHeight()});n.find(".resize-handle").remove(),l(this).data({newCellClone:o,prevCellClone:n})}},drag:function(i,o){var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;l(this).data("newCellClone").css("width",n*a).find(".preview-cell-weight").html(Math.round(1e3*a)/10),l(this).data("prevCellClone").css("width",n*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10)},stop:function(i,o){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove();var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;a>.02&&r>.02&&(s.row.builder.addHistoryEntry("cell_resized"),s.model.set("weight",a),e.model.set("weight",r),s.row.resize()),o.helper.css("left",-t.outerWidth()/2),s.row.builder.model.refreshPanelsData()}}),this},onAddWidget:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.widget({model:e});l.cell=this,_.isUndefined(e.isDuplicate)&&(e.isDuplicate=!1),l.render({loadForm:e.isDuplicate}),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".widgets-container")):l.$el.insertAfter(this.$(".widgets-container .so-widget").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),this.row.resize(),this.row.builder.trigger("widget_added",l)},handleCellClick:function(e){this.row.builder.$el.find(".so-cells .cell").removeClass("cell-selected"),this.row.builder.activeCell!==this||this.model.get("widgets").length?(this.$el.addClass("cell-selected"),this.row.builder.activeCell=this):this.row.builder.activeCell=null},pasteHandler:function(){var e=s.helpers.clipboard.getModel("widget-model");!_.isEmpty(e)&&e instanceof s.model.widget&&(this.row.builder.addHistoryEntry("widget_pasted"),e.cell=this.model,this.model.get("widgets").add(e),this.row.builder.model.refreshPanelsData())},buildContextualMenu:function(e,t){var i=this;t.hasSection("add-widget-below")||t.addSection("add-widget-cell",{sectionTitle:panelsOptions.loc.contextual.add_widget_cell,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,(function(e){i.row.builder.trigger("before_user_adds_widget"),i.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=i.model,t.cell.get("widgets").add(t),i.row.builder.model.refreshPanelsData(),i.row.builder.trigger("after_user_adds_widget",t)}));var l={};this.row.builder.supports("addWidget")&&s.helpers.clipboard.isModel("widget-model")&&(l.paste={title:panelsOptions.loc.contextual.cell_paste_widget}),_.isEmpty(l)||t.addSection("cell-actions",{sectionTitle:panelsOptions.loc.contextual.cell_actions,search:!1},l,function(e){switch(e){case"paste":this.pasteHandler()}this.row.builder.model.refreshPanelsData()}.bind(this)),this.row.buildContextualMenu(e,t)}})},{}],25:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({dialogTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog").html())),dialogTabTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-tab").html())),tabbed:!1,rendered:!1,builder:!1,className:"so-panels-dialog-wrapper",dialogClass:"",dialogIcon:"",parentDialog:!1,dialogOpen:!1,editableLabel:!1,events:{"click .so-close":"closeDialog","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext"},initialize:function(){this.once("open_dialog",this.render),this.once("open_dialog",this.attach),this.once("open_dialog",this.setDialogClass),this.trigger("initialize_dialog",this),_.isUndefined(this.initializeDialog)||this.initializeDialog(),_.bindAll(this,"initSidebars","hasSidebar","onResize","toggleLeftSideBar","toggleRightSideBar")},getNextDialog:function(){return null},getPrevDialog:function(){return null},setDialogClass:function(){""!==this.dialogClass&&this.$(".so-panels-dialog").addClass(this.dialogClass)},setBuilder:function(e){return this.builder=e,e.trigger("add_dialog",this,this.builder),this},attach:function(){return this.$el.appendTo("body"),this},parseDialogContent:function(e,t){t=_.extend({cid:this.cid},t);var i=l(_.template(s.helpers.utils.processTemplate(e))(t)),o={title:i.find(".title").html(),buttons:i.find(".buttons").html(),content:i.find(".content").html()};return i.has(".left-sidebar")&&(o.left_sidebar=i.find(".left-sidebar").html()),i.has(".right-sidebar")&&(o.right_sidebar=i.find(".right-sidebar").html()),o},renderDialog:function(e){if(e=_.extend({editableLabel:this.editableLabel,dialogIcon:this.dialogIcon},e),this.$el.html(this.dialogTemplate(e)).hide(),this.$el.data("view",this),this.$el.addClass("so-panels-dialog-wrapper"),!1!==this.parentDialog){var t=l('<h3 class="so-parent-link"></h3>').html(this.parentDialog.text+'<div class="so-separator"></div>');t.click(function(e){e.preventDefault(),this.closeDialog(),this.parentDialog.dialog.openDialog()}.bind(this)),this.$(".so-title-bar .so-title").before(t)}return this.$(".so-title-bar .so-title-editable").length&&this.initEditableLabel(),setTimeout(this.initSidebars,1),this},initSidebars:function(){var e=this.$(".so-show-left-sidebar").hide(),t=this.$(".so-show-right-sidebar").hide(),i=this.hasSidebar("left"),s=this.hasSidebar("right");(i||s)&&(l(window).on("resize",this.onResize),i&&(e.show(),e.on("click",this.toggleLeftSideBar)),s&&(t.show(),t.on("click",this.toggleRightSideBar))),this.onResize()},initTabs:function(){var e=this.$(".so-sidebar-tabs li a");if(0===e.length)return this;var t=this;return e.click((function(e){e.preventDefault();var i=l(this);t.$(".so-sidebar-tabs li").removeClass("tab-active"),t.$(".so-content .so-content-tabs > *").hide(),i.parent().addClass("tab-active");var s=i.attr("href");if(!_.isUndefined(s)&&"#"===s.charAt(0)){var o=s.split("#")[1];t.$(".so-content .so-content-tabs .tab-"+o).show()}t.trigger("tab_click",i)})),this.$(".so-sidebar-tabs li a").first().click(),this},initToolbar:function(){this.$(".so-toolbar .so-buttons .so-toolbar-button").click(function(e){e.preventDefault(),this.trigger("button_click",l(e.currentTarget))}.bind(this)),this.$(".so-toolbar .so-buttons .so-dropdown-button").click(function(e){e.preventDefault();var t=l(e.currentTarget).siblings(".so-dropdown-links-wrapper");t.is(".hidden")?t.removeClass("hidden"):t.addClass("hidden")}.bind(this)),l("html").click(function(e){this.$(".so-dropdown-links-wrapper").not(".hidden").each((function(t,i){var s=l(i),o=l(e.target);0!==o.length&&(o.is(".so-needs-confirm")&&!o.is(".so-confirmed")||o.is(".so-dropdown-button"))||s.addClass("hidden")}))}.bind(this))},initEditableLabel:function(){var e=this.$(".so-title-bar .so-title-editable");e.keypress((function(t){var i="keypress"===t.type&&13===t.keyCode;if(i){var s=l(":tabbable"),o=s.index(e);s.eq(o+1).focus(),window.getSelection().removeAllRanges()}return!i})).blur(function(){var t=e.text().replace(/^\s+|\s+$/gm,"");t!==e.data("original-value").replace(/^\s+|\s+$/gm,"")&&(e.text(t),this.trigger("edit_label",t))}.bind(this)),e.focus((function(){e.data("original-value",e.text()),s.helpers.utils.selectElementContents(this)}))},setupDialog:function(){this.openDialog(),this.closeDialog()},refreshDialogNav:function(){this.$(".so-title-bar .so-nav").show().removeClass("so-disabled");var e=this.getNextDialog(),t=this.$(".so-title-bar .so-next"),i=this.getPrevDialog(),s=this.$(".so-title-bar .so-previous");null===e?t.hide():!1===e&&t.addClass("so-disabled"),null===i?s.hide():!1===i&&s.addClass("so-disabled")},openDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("open_dialog"),this.dialogOpen=!0,this.refreshDialogNav(),s.helpers.pageScroll.lock(),this.onResize(),this.$el.show(),e.silent||(this.trigger("open_dialog_complete"),this.builder.trigger("open_dialog",this),l(document).trigger("open_dialog",this))},closeDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("close_dialog"),this.dialogOpen=!1,this.$el.hide(),s.helpers.pageScroll.unlock(),e.silent||(this.trigger("close_dialog_complete"),this.builder.trigger("close_dialog",this))},navToPrevious:function(){this.closeDialog();var e=this.getPrevDialog();null!==e&&!1!==e&&e.openDialog()},navToNext:function(){this.closeDialog();var e=this.getNextDialog();null!==e&&!1!==e&&e.openDialog()},getFormValues:function(e){_.isUndefined(e)&&(e=".so-content");var t,i=this.$(e),s={};return i.find("[name]").each((function(){var e=l(this);try{var i=/([A-Za-z_]+)\[(.*)\]/.exec(e.attr("name"));if(_.isEmpty(i))return!0;_.isUndefined(i[2])?t=e.attr("name"):(t=i[2].split("][")).unshift(i[1]),t=t.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var o=s,n=null,a=!!_.isString(e.attr("type"))&&e.attr("type").toLowerCase();if("checkbox"===a)n=e.is(":checked")?""===e.val()||e.val():null;else if("radio"===a){if(!e.is(":checked"))return;n=e.val()}else if("SELECT"===e.prop("tagName")){var r=e.find("option:selected");1===r.length?n=e.find("option:selected").val():r.length>1&&(n=_.map(e.find("option:selected"),(function(e,t){return l(e).val()})))}else n=e.val();if(!_.isUndefined(e.data("panels-filter")))switch(e.data("panels-filter")){case"json_parse":try{n=JSON.parse(n)}catch(e){n=""}}if(null!==n)for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?o.push(n):o[t[d]]=n:(_.isUndefined(o[t[d]])&&(""===t[d+1]?o[t[d]]=[]:o[t[d]]={}),o=o[t[d]])}catch(t){console.log("Field ["+e.attr("name")+"] could not be processed and was skipped - "+t.message)}})),s},setStatusMessage:function(e,t,i){var s=i?'<span class="dashicons dashicons-warning"></span>'+e:e;this.$(".so-toolbar .so-status").html(s),!_.isUndefined(t)&&t?this.$(".so-toolbar .so-status").addClass("so-panels-loading"):this.$(".so-toolbar .so-status").removeClass("so-panels-loading")},setParent:function(e,t){this.parentDialog={text:e,dialog:t}},onResize:function(){var e=window.matchMedia("(max-width: 980px)");["left","right"].forEach(function(t){var i=this.$(".so-"+t+"-sidebar"),s=this.$(".so-show-"+t+"-sidebar");this.hasSidebar(t)?(s.hide(),e.matches?(s.show(),s.closest(".so-title-bar").addClass("so-has-"+t+"-button"),i.hide(),i.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-"+t+"-sidebar")):(s.hide(),s.closest(".so-title-bar").removeClass("so-has-"+t+"-button"),i.show(),i.closest(".so-panels-dialog").addClass("so-panels-dialog-has-"+t+"-sidebar"))):(i.hide(),s.hide())}.bind(this))},hasSidebar:function(e){return this.$(".so-"+e+"-sidebar").children().length>0},toggleLeftSideBar:function(){this.toggleSidebar("left")},toggleRightSideBar:function(){this.toggleSidebar("right")},toggleSidebar:function(e){var t=this.$(".so-"+e+"-sidebar");t.is(":visible")?t.hide():t.show()}})},{}],26:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-live-editor").html())),previewScrollTop:0,loadTimes:[],previewFrameId:1,previewUrl:null,previewIframe:null,events:{"click .live-editor-close":"close","click .live-editor-save":"closeAndSave","click .live-editor-collapse":"collapse","click .live-editor-mode":"mobileToggle"},initialize:function(e){e=_.extend({builder:!1,previewUrl:!1},e),_.isEmpty(e.previewUrl)&&(e.previewUrl=panelsOptions.ajaxurl+"&action=so_panels_live_editor_preview"),this.builder=e.builder,this.previewUrl=e.previewUrl,this.listenTo(this.builder.model,"refresh_panels_data",this.handleRefreshData),this.listenTo(this.builder.model,"load_panels_data",this.handleLoadData)},render:function(){if(this.setElement(this.template()),this.$el.hide(),l("#submitdiv #save-post").length>0){var e=this.$el.find(".live-editor-save");e.text(e.data("save"))}var t=!1;l(document).mousedown((function(){t=!0})).mouseup((function(){t=!1}));var i=this;return this.$el.on("mouseenter",".so-widget-wrapper",(function(){var e=l(this).data("live-editor-preview-widget");t||void 0===e||!e.length||i.$(".so-preview-overlay").is(":visible")||(i.highlightElement(e),i.scrollToElement(e))})),this.$el.on("mouseleave",".so-widget-wrapper",function(){this.resetHighlights()}.bind(this)),this.listenTo(this.builder,"open_dialog",(function(){this.resetHighlights()})),this},attach:function(){this.$el.appendTo("body")},open:function(){if(""===this.$el.html()&&this.render(),0===this.$el.closest("body").length&&this.attach(),s.helpers.pageScroll.lock(),this.$el.is(":visible"))return this;if(this.$el.show(),this.refreshPreview(this.builder.model.getPanelsData()),this.originalContainer=this.builder.$el.parent(),this.builder.$el.appendTo(this.$(".so-live-editor-builder")),this.builder.$(".so-tool-button.so-live-editor").hide(),this.builder.trigger("builder_resize"),"auto-draft"===l("#original_post_status").val()&&!this.autoSaved){var e=this;wp.autosave&&(""===l('#title[name="post_title"]').val()&&l('#title[name="post_title"]').val(panelsOptions.loc.draft).trigger("keydown"),l(document).one("heartbeat-tick.autosave",(function(){e.autoSaved=!0,e.refreshPreview(e.builder.model.getPanelsData())})),wp.autosave.server.triggerSave())}},close:function(){if(!this.$el.is(":visible"))return this;this.$el.hide(),s.helpers.pageScroll.unlock(),this.builder.$el.appendTo(this.originalContainer),this.builder.$(".so-tool-button.so-live-editor").show(),this.builder.trigger("builder_resize")},closeAndSave:function(){this.close(),l('#submitdiv input[type="submit"][name="save"]').click()},collapse:function(){this.$el.toggleClass("so-collapsed")},highlightElement:function(e){_.isUndefined(this.resetHighlightTimeout)||clearTimeout(this.resetHighlightTimeout),this.previewIframe.contents().find("body").find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return 0===l(this).parents(".so-panel").length})).not(e).addClass("so-panels-faded"),e.removeClass("so-panels-faded").addClass("so-panels-highlighted")},resetHighlights:function(){var e=this.previewIframe.contents().find("body");this.resetHighlightTimeout=setTimeout((function(){e.find(".panel-grid .panel-grid-cell .so-panel").removeClass("so-panels-faded so-panels-highlighted")}),100)},scrollToElement:function(e){this.$(".so-preview iframe")[0].contentWindow.liveEditorScrollTo(e)},handleRefreshData:function(e){if(!this.$el.is(":visible"))return this;this.refreshPreview(e)},handleLoadData:function(){if(!this.$el.is(":visible"))return this;this.refreshPreview(this.builder.model.getPanelsData())},refreshPreview:function(e){var t=this.loadTimes.length?_.reduce(this.loadTimes,(function(e,t){return e+t}),0)/this.loadTimes.length:1e3;_.isNull(this.previewIframe)||this.$(".so-preview-overlay").is(":visible")||(this.previewScrollTop=this.previewIframe.contents().scrollTop()),this.$(".so-preview-overlay").show(),this.$(".so-preview-overlay .so-loading-bar").clearQueue().css("width","0%").animate({width:"100%"},parseInt(t)+100),this.postToIframe({live_editor_panels_data:JSON.stringify(e),live_editor_post_ID:this.builder.config.postId},this.previewUrl,this.$(".so-preview")),this.previewIframe.data("load-start",(new Date).getTime())},postToIframe:function(e,t,i){_.isNull(this.previewIframe)||this.previewIframe.remove();var s="siteorigin-panels-live-preview-"+this.previewFrameId;this.previewIframe=l('<iframe src="'+t+'" />').attr({id:s,name:s}).appendTo(i),this.setupPreviewFrame(this.previewIframe);var o=l('<form id="soPostToPreviewFrame" method="post" />').attr({id:s,target:this.previewIframe.attr("id"),action:t}).appendTo("body");return l.each(e,(function(e,t){l('<input type="hidden" />').attr({name:e,value:t}).appendTo(o)})),o.submit().remove(),this.previewFrameId++,this.previewIframe},setupPreviewFrame:function(e){var t=this;e.data("iframeready",!1).on("iframeready",(function(){var e=l(this),i=e.contents();if(!e.data("iframeready")){e.data("iframeready",!0),void 0!==e.data("load-start")&&(t.loadTimes.unshift((new Date).getTime()-e.data("load-start")),_.isEmpty(t.loadTimes)||(t.loadTimes=t.loadTimes.slice(0,4))),l(".live-editor-mode.so-active").length&&(l(".so-panels-live-editor .so-preview iframe").css("transition","none"),t.mobileToggle()),setTimeout((function(){i.scrollTop(t.previewScrollTop),t.$(".so-preview-overlay").hide(),l(".so-panels-live-editor .so-preview iframe").css("transition","all .2s ease")}),100);var s=i.find("#pl-"+t.builder.config.postId);s.find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return l(this).closest(".panel-layout").is(s)})).each((function(e,i){var s=l(i),o=t.$(".so-live-editor-builder .so-widget-wrapper").eq(s.data("index"));o.data("live-editor-preview-widget",s),s.css({cursor:"pointer"}).mouseenter((function(){o.parent().addClass("so-hovered"),t.highlightElement(s)})).mouseleave((function(){o.parent().removeClass("so-hovered"),t.resetHighlights()})).click((function(e){e.preventDefault(),o.find(".title h4").click()}))})),i.find("a").css({"pointer-events":"none"}).click((function(e){e.preventDefault()}))}})).on("load",(function(){var e=l(this);e.data("iframeready")||e.trigger("iframeready")}))},hasPreviewUrl:function(){return""!==this.$("form.live-editor-form").attr("action")},mobileToggle:function(e){var t=l(void 0!==e?e.currentTarget:".live-editor-mode.so-active");this.$(".live-editor-mode").not(t).removeClass("so-active"),t.addClass("so-active"),this.$el.removeClass("live-editor-desktop-mode live-editor-tablet-mode live-editor-mobile-mode").addClass("live-editor-"+t.data("mode")+"-mode").find("iframe").css("width",t.data("width"))}})},{}],27:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-row").html())),events:{"click .so-row-settings":"editSettingsHandler","click .so-row-duplicate":"duplicateHandler","click .so-row-delete":"confirmedDeleteHandler","click .so-row-color":"rowColorChangeHandler"},builder:null,dialog:null,initialize:function(){var e=this.model.get("cells");this.listenTo(e,"add",this.handleCellAdd),this.listenTo(e,"remove",this.handleCellRemove),this.listenTo(this.model,"reweight_cells",this.resize),this.listenTo(this.model,"destroy",this.onModelDestroy);var t=this;e.each((function(e){t.listenTo(e.get("widgets"),"add",t.resize)})),e.on("add",(function(e){t.listenTo(e.get("widgets"),"add",t.resize)}),this),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(){var e=this.model.has("color_label")?this.model.get("color_label"):1,t=this.model.has("label")?this.model.get("label"):"";this.setElement(this.template({rowColorLabel:e,rowLabel:t})),this.$el.data("view",this);var i=this;return this.model.get("cells").each((function(e){var t=new s.view.cell({model:e});t.row=i,t.render(),t.$el.appendTo(i.$(".so-cells"))})),this.builder.supports("rowAction")?(this.builder.supports("editRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-settings").parent().remove(),this.$el.addClass("so-row-no-edit")),this.builder.supports("addRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-duplicate").parent().remove(),this.$el.addClass("so-row-no-duplicate")),this.builder.supports("deleteRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-delete").parent().remove(),this.$el.addClass("so-row-no-delete"))):(this.$(".so-row-toolbar .so-dropdown-wrapper").remove(),this.$el.addClass("so-row-no-actions")),this.builder.supports("moveRow")||(this.$(".so-row-toolbar .so-row-move").remove(),this.$el.addClass("so-row-no-move")),l.trim(this.$(".so-row-toolbar").html()).length||this.$(".so-row-toolbar").remove(),this.listenTo(this.builder,"widget_sortable_move",this.resize),this.listenTo(this.builder,"builder_resize",this.resize),this.resize(),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},resize:function(e){if(this.$el.is(":visible")){this.$(".so-cells .cell-wrapper").css("min-height",0),this.$(".so-cells .resize-handle").css("height",0);var t=0;this.$(".so-cells .cell").each((function(){t=Math.max(t,l(this).height()),l(this).css("width",100*l(this).data("view").model.get("weight")+"%")})),this.$(".so-cells .cell-wrapper").css("min-height",Math.max(t,63)),this.$(".so-cells .resize-handle").css("height",this.$(".so-cells .cell-wrapper").outerHeight())}},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){this.builder.addHistoryEntry("row_deleted");var e=this;this.$el.fadeOut("normal",(function(){e.model.destroy(),e.builder.model.refreshPanelsData()}))},onLabelChange:function(e,t){0==this.$(".so-row-label").length?this.$(".so-row-toolbar").prepend('<h3 class="so-row-label">'+t+"</h3>"):this.$(".so-row-label").text(t)},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},pasteHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.builder.addHistoryEntry("row_pasted"),e.builder=this.builder.model,this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData())},confirmedDeleteHandler:function(e){var t=l(e.target);if(t.hasClass("dashicons")&&(t=t.parent()),t.hasClass("so-confirmed"))this.visualDestroyModel();else{var i=t.html();t.addClass("so-confirmed").html('<span class="dashicons dashicons-yes"></span>'+panelsOptions.loc.dropdown_confirm),setTimeout((function(){t.removeClass("so-confirmed").html(i)}),2500)}},editSettingsHandler:function(){if(this.builder.supports("editRow"))return null===this.dialog&&(this.dialog=new s.dialog.row,this.dialog.setBuilder(this.builder).setRowModel(this.model),this.dialog.rowView=this),this.dialog.openDialog(),this},deleteHandler:function(){return this.model.destroy(),this},rowColorChangeHandler:function(e){this.$(".so-row-color").removeClass("so-row-color-selected");var t=l(e.target),i=t.data("color-label"),s=this.model.has("color_label")?this.model.get("color_label"):1;t.addClass("so-row-color-selected"),this.$el.removeClass("so-row-color-"+s),this.$el.addClass("so-row-color-"+i),this.model.set("color_label",i)},handleCellAdd:function(e){var t=new s.view.cell({model:e});t.row=this,t.render(),t.$el.appendTo(this.$(".so-cells"))},handleCellRemove:function(e){this.$(".so-cells > .cell").each((function(){var t=l(this).data("view");_.isUndefined(t)||t.model.cid===e.cid&&t.remove()}))},buildContextualMenu:function(e,t){for(var i=[],l=1;l<5;l++)i.push({title:l+" "+panelsOptions.loc.contextual.column});this.builder.supports("addRow")&&t.addSection("add-row",{sectionTitle:panelsOptions.loc.contextual.add_row,search:!1},i,function(e){this.builder.addHistoryEntry("row_added");for(var t=Number(e)+1,i=[],l=0;l<t;l++)i.push({weight:100/t});var o=new s.model.row({collection:this.collection}),n=new s.collection.cells(i);n.each((function(e){e.row=o})),o.setCells(n),o.builder=this.builder.model,this.builder.model.get("rows").add(o,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()}.bind(this));var o={};this.builder.supports("editRow")&&(o.edit={title:panelsOptions.loc.contextual.row_edit}),s.helpers.clipboard.canCopyPaste()&&(o.copy={title:panelsOptions.loc.contextual.row_copy},this.builder.supports("addRow")&&s.helpers.clipboard.isModel("row-model")&&(o.paste={title:panelsOptions.loc.contextual.row_paste})),this.builder.supports("addRow")&&(o.duplicate={title:panelsOptions.loc.contextual.row_duplicate}),this.builder.supports("deleteRow")&&(o.delete={title:panelsOptions.loc.contextual.row_delete,confirm:!0}),_.isEmpty(o)||t.addSection("row-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},o,function(e){switch(e){case"edit":this.editSettingsHandler();break;case"copy":this.copyHandler();break;case"paste":this.pasteHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this))}})},{}],28:[function(e,t,i){window.panels;var s=jQuery;t.exports=Backbone.View.extend({stylesLoaded:!1,initialize:function(){},render:function(e,t,i){if(!_.isUndefined(e)){i=_.extend({builderType:"",dialog:null},i),this.$el.addClass("so-visual-styles so-"+e+"-styles so-panels-loading");var l={builderType:i.builderType};return"cell"===e&&(l.index=i.index),s.post(panelsOptions.ajaxurl,{action:"so_panels_style_form",type:e,style:this.model.get("style"),args:JSON.stringify(l),postId:t},null,"html").done(function(e){this.$el.html(e),this.setupFields(),this.stylesLoaded=!0,this.trigger("styles_loaded",!_.isEmpty(e)),_.isNull(i.dialog)||i.dialog.trigger("styles_loaded",!_.isEmpty(e))}.bind(this)).fail(function(e){var t;t=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,this.$el.html(t)}.bind(this)).always(function(){this.$el.removeClass("so-panels-loading")}.bind(this)),this}},attach:function(e){e.append(this.$el)},detach:function(){this.$el.detach()},setupFields:function(){this.$(".style-section-wrapper").each((function(){var e=s(this);e.find(".style-section-head").click((function(t){t.preventDefault(),e.find(".style-section-fields").slideToggle("fast")}))})),_.isUndefined(s.fn.wpColorPicker)||(_.isObject(panelsOptions.wpColorPickerOptions.palettes)&&!s.isArray(panelsOptions.wpColorPickerOptions.palettes)&&(panelsOptions.wpColorPickerOptions.palettes=s.map(panelsOptions.wpColorPickerOptions.palettes,(function(e){return e}))),this.$(".so-wp-color-field").wpColorPicker(panelsOptions.wpColorPickerOptions)),this.$(".style-field-image").each((function(){var e=null,t=s(this);t.find(".so-image-selector").click((function(i){i.preventDefault(),null===e&&(e=wp.media({title:"choose",library:{type:"image"},button:{text:"Done",close:!0}})).on("select",(function(){var i=e.state().get("selection").first().attributes,s=i.url;if(!_.isUndefined(i.sizes))try{s=i.sizes.thumbnail.url}catch(e){s=i.sizes.full.url}t.find(".current-image").css("background-image","url("+s+")"),t.find(".so-image-selector > input").val(i.id),t.find(".remove-image").removeClass("hidden")})),e.open()})),t.find(".remove-image").click((function(e){e.preventDefault(),t.find(".current-image").css("background-image","none"),t.find(".so-image-selector > input").val(""),t.find(".remove-image").addClass("hidden")}))})),this.$(".style-field-measurement").each((function(){var e=s(this),t=e.find('input[type="text"]'),i=e.find("select"),l=e.find('input[type="hidden"]');t.focus((function(){s(this).select()}));!function(e){if(""!==e){var o=/(?:([0-9\.,\-]+)(.*))+/,n=l.val().split(" "),a=[];for(var r in n){var d=o.exec(n[r]);_.isNull(d)||_.isUndefined(d[1])||_.isUndefined(d[2])||(a.push(d[1]),i.val(d[2]))}1===t.length?t.val(a.join(" ")):(1===a.length?a=[a[0],a[0],a[0],a[0]]:2===a.length?a=[a[0],a[1],a[0],a[1]]:3===a.length&&(a=[a[0],a[1],a[2],a[1]]),t.each((function(e,t){s(t).val(a[e])})))}}(l.val());var o=function(e){if(1===t.length){var o=t.val().split(" ").filter((function(e){return""!==e})).map((function(e){return e+i.val()})).join(" ");l.val(o)}else{var n=s(e.target),a=[],r=[],d=[];t.each((function(e,t){var i=""!==s(t).val()?parseFloat(s(t).val()):null;a.push(i),null===i?r.push(e):d.push(e)})),3===r.length&&d[0]===t.index(n)&&(t.val(n.val()),a=[n.val(),n.val(),n.val(),n.val()]),JSON.stringify(a)===JSON.stringify([null,null,null,null])?l.val(""):l.val(a.map((function(e){return(null===e?0:e)+i.val()})).join(" "))}};t.change(o),i.change(o)}))}})},{}],29:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-widget").html())),cell:null,dialog:null,events:{"click .widget-edit":"editHandler","click .title h4":"editHandler","click .actions .widget-duplicate":"duplicateHandler","click .actions .widget-delete":"deleteHandler"},initialize:function(){this.listenTo(this.model,"destroy",this.onModelDestroy),this.listenTo(this.model,"change:values",this.onModelChange),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(e){if(e=_.extend({loadForm:!1},e),this.setElement(this.template({title:this.model.getWidgetField("title"),description:this.model.getTitle(),widget_class:this.model.attributes.class})),this.$el.data("view",this),this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")||(this.$(".actions .widget-edit").remove(),this.$el.addClass("so-widget-no-edit")),this.cell.row.builder.supports("addWidget")||(this.$(".actions .widget-duplicate").remove(),this.$el.addClass("so-widget-no-duplicate")),this.cell.row.builder.supports("deleteWidget")||(this.$(".actions .widget-delete").remove(),this.$el.addClass("so-widget-no-delete")),this.cell.row.builder.supports("moveWidget")||this.$el.addClass("so-widget-no-move"),l.trim(this.$(".actions").html()).length||this.$(".actions").remove(),this.model.get("read_only")&&this.$el.addClass("so-widget-read-only"),0===_.size(this.model.get("values"))||e.loadForm){var t=this.getEditDialog();t.once("form_loaded",t.saveWidget,t),t.setupDialog()}return this.listenTo(this.cell.row.builder,"after_user_adds_widget",this.afterUserAddsWidgetHandler),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},getEditDialog:function(){return null===this.dialog&&(this.dialog=new s.dialog.widget({model:this.model}),this.dialog.setBuilder(this.cell.row.builder),this.dialog.widgetView=this),this.dialog},editHandler:function(){return!this.cell.row.builder.supports("editWidget")||this.model.get("read_only")?this:(this.getEditDialog().openDialog(),this)},duplicateHandler:function(){this.cell.row.builder.addHistoryEntry("widget_duplicated");var e=this.model.clone(this.model.cell);return this.cell.model.get("widgets").add(e,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},deleteHandler:function(){return this.visualDestroyModel(),this},onModelChange:function(){this.$(".description").html(this.model.getTitle())},onLabelChange:function(e){this.$(".title > h4").text(e.getWidgetField("title"))},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){return this.cell.row.builder.addHistoryEntry("widget_deleted"),this.$el.fadeOut("fast",function(){this.cell.row.resize(),this.model.destroy(),this.cell.row.builder.model.refreshPanelsData(),this.remove()}.bind(this)),this},buildContextualMenu:function(e,t){this.cell.row.builder.supports("addWidget")&&t.addSection("add-widget-below",{sectionTitle:panelsOptions.loc.contextual.add_widget_below,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,function(e){this.cell.row.builder.trigger("before_user_adds_widget"),this.cell.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=this.cell.model,this.cell.model.get("widgets").add(t,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this.cell.row.builder.trigger("after_user_adds_widget",t)}.bind(this));var i={};this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")&&(i.edit={title:panelsOptions.loc.contextual.widget_edit}),s.helpers.clipboard.canCopyPaste()&&(i.copy={title:panelsOptions.loc.contextual.widget_copy}),this.cell.row.builder.supports("addWidget")&&(i.duplicate={title:panelsOptions.loc.contextual.widget_duplicate}),this.cell.row.builder.supports("deleteWidget")&&(i.delete={title:panelsOptions.loc.contextual.widget_delete,confirm:!0}),_.isEmpty(i)||t.addSection("widget-actions",{sectionTitle:panelsOptions.loc.contextual.widget_actions,search:!1},i,function(e){switch(e){case"edit":this.editHandler();break;case"copy":this.copyHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this)),this.cell.buildContextualMenu(e,t)},afterUserAddsWidgetHandler:function(e){this.model===e&&panelsOptions.instant_open&&setTimeout(this.editHandler.bind(this),350)}})},{}],30:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.customHtmlWidgets,o=s("<div></div>"),n=t.find(".widget-content:first");n.before(o);var a=new l.CustomHtmlWidgetControl({el:o,syncContainer:n});return a.initializeEditor(),a.editor.codemirror.refresh(),a}};t.exports=l},{}],31:[function(e,t,i){var s=e("./custom-html-widget"),l=e("./media-widget"),o=e("./text-widget"),n={CUSTOM_HTML:"custom_html",MEDIA_AUDIO:"media_audio",MEDIA_GALLERY:"media_gallery",MEDIA_IMAGE:"media_image",MEDIA_VIDEO:"media_video",TEXT:"text",addWidget:function(e,t){var i,n=e.find("> .id_base").val();switch(n){case this.CUSTOM_HTML:i=s;break;case this.MEDIA_AUDIO:case this.MEDIA_GALLERY:case this.MEDIA_IMAGE:case this.MEDIA_VIDEO:i=l;break;case this.TEXT:i=o}i.addWidget(n,e,t)}};t.exports=n},{"./custom-html-widget":30,"./media-widget":32,"./text-widget":33}],32:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.mediaWidgets,o=l.controlConstructors[e];if(o){var n=l.modelConstructors[e]||l.MediaWidgetModel,a=t.find("> .widget-content"),r=s('<div class="media-widget-control"></div>');a.before(r);var d={};a.find(".media-widget-instance-property").each((function(){var e=s(this);d[e.data("property")]=e.val()})),d.widget_id=i;var h=new o({el:r,syncContainer:a,model:new n(d)});return h.render(),h}}};t.exports=l},{}],33:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.textWidgets,o={},n=t.find(".visual");if(n.length>0){if(!n.val())return null;var a=s("<div></div>"),r=t.find(".widget-content:first");r.before(a),o={el:a,syncContainer:r}}else o={el:t};var d=new l.TextWidgetControl(o),h=wp.oldEditor?wp.oldEditor:wp.editor;return h&&h.hasOwnProperty("autop")&&(wp.editor.autop=h.autop,wp.editor.removep=h.removep,wp.editor.initialize=h.initialize),d.initializeEditor(),d}};t.exports=l},{}]},{},[16]);
|
1 |
+
!function e(t,i,s){function l(n,a){if(!i[n]){if(!t[n]){var r="function"==typeof require&&require;if(!a&&r)return r(n,!0);if(o)return o(n,!0);var d=new Error("Cannot find module '"+n+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[n]={exports:{}};t[n][0].call(h.exports,(function(e){return l(t[n][1][e]||e)}),h,h.exports,e,t,i,s)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n<s.length;n++)l(s[n]);return l}({1:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.cell,initialize:function(){},totalWeight:function(){var e=0;return this.each((function(t){e+=t.get("weight")})),e}})},{}],2:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.historyEntry,builder:null,maxSize:12,initialize:function(){this.on("add",this.onAddEntry,this)},addEntry:function(e,t){_.isEmpty(t)&&(t=this.builder.getPanelsData());var i=new s.model.historyEntry({text:e,data:JSON.stringify(t),time:parseInt((new Date).getTime()/1e3),collection:this});this.add(i)},onAddEntry:function(e){if(this.models.length>1){var t=this.at(this.models.length-2);(e.get("text")===t.get("text")&&e.get("time")-t.get("time")<15||e.get("data")===t.get("data"))&&(this.remove(e),t.set("count",t.get("count")+1))}for(;this.models.length>this.maxSize;)this.shift()}})},{}],3:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.row,empty:function(){for(var e;;){if(!(e=this.collection.first()))break;e.destroy()}}})},{}],4:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.widget,initialize:function(){}})},{}],5:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({dialogClass:"so-panels-dialog-add-builder",render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-builder").html(),{})),this.$(".so-content .siteorigin-panels-builder").append(this.builder.$el)},initializeDialog:function(){var e=this;this.once("open_dialog_complete",(function(){e.builder.initSortable()})),this.on("open_dialog_complete",(function(){e.builder.trigger("builder_resize")}))}})},{}],6:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({historyEntryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-history-entry").html())),entries:{},currentEntry:null,revertEntry:null,selectedEntry:null,previewScrollTop:null,dialogClass:"so-panels-dialog-history",dialogIcon:"history",events:{"click .so-close":"closeDialog","click .so-restore":"restoreSelectedEntry"},initializeDialog:function(){this.entries=new s.collection.historyEntries,this.on("open_dialog",this.setCurrentEntry,this),this.on("open_dialog",this.renderHistoryEntries,this)},render:function(){var e=this;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-history").html(),{})),this.$("iframe.siteorigin-panels-history-iframe").load((function(){var t=l(this);t.show(),t.contents().scrollTop(e.previewScrollTop)}))},setRevertEntry:function(e){this.revertEntry=new s.model.historyEntry({data:JSON.stringify(e.getPanelsData()),time:parseInt((new Date).getTime()/1e3)})},setCurrentEntry:function(){this.currentEntry=new s.model.historyEntry({data:JSON.stringify(this.builder.model.getPanelsData()),time:parseInt((new Date).getTime()/1e3)}),this.selectedEntry=this.currentEntry,this.previewEntry(this.currentEntry),this.$(".so-buttons .so-restore").addClass("disabled")},renderHistoryEntries:function(){var e=this,t=this.$(".history-entries").empty();this.currentEntry.get("data")===this.revertEntry.get("data")&&_.isEmpty(this.entries.models)||l(this.historyEntryTemplate({title:panelsOptions.loc.history.revert,count:1})).data("historyEntry",this.revertEntry).prependTo(t),this.entries.each((function(i){var s=e.historyEntryTemplate({title:panelsOptions.loc.history[i.get("text")],count:i.get("count")});l(s).data("historyEntry",i).prependTo(t)})),l(this.historyEntryTemplate({title:panelsOptions.loc.history.current,count:1})).data("historyEntry",this.currentEntry).addClass("so-selected").prependTo(t),t.find(".history-entry").click((function(){var i=jQuery(this);t.find(".history-entry").not(i).removeClass("so-selected"),i.addClass("so-selected");var s=i.data("historyEntry");e.selectedEntry=s,e.selectedEntry.cid!==e.currentEntry.cid?e.$(".so-buttons .so-restore").removeClass("disabled"):e.$(".so-buttons .so-restore").addClass("disabled"),e.previewEntry(s)})),this.updateEntryTimes()},previewEntry:function(e){var t=this.$("iframe.siteorigin-panels-history-iframe");t.hide(),this.previewScrollTop=t.contents().scrollTop(),this.$('form.history-form input[name="live_editor_panels_data"]').val(e.get("data")),this.$('form.history-form input[name="live_editor_post_ID"]').val(this.builder.config.postId),this.$("form.history-form").submit()},restoreSelectedEntry:function(){return!this.$(".so-buttons .so-restore").hasClass("disabled")&&(this.currentEntry.get("data")===this.selectedEntry.get("data")?(this.closeDialog(),!1):("restore"!==this.selectedEntry.get("text")&&this.builder.addHistoryEntry("restore",this.builder.model.getPanelsData()),this.builder.model.loadPanelsData(JSON.parse(this.selectedEntry.get("data"))),this.closeDialog(),!1))},updateEntryTimes:function(){var e=this;this.$(".history-entries .history-entry").each((function(){var t=jQuery(this),i=t.find(".timesince"),s=t.data("historyEntry");i.html(e.timeSince(s.get("time")))}))},timeSince:function(e){var t,i=parseInt((new Date).getTime()/1e3)-e,s=[];return i>3600&&(1===(t=Math.floor(i/3600))?s.push(panelsOptions.loc.time.hour.replace("%d",t)):s.push(panelsOptions.loc.time.hours.replace("%d",t)),i-=3600*t),i>60&&(1===(t=Math.floor(i/60))?s.push(panelsOptions.loc.time.minute.replace("%d",t)):s.push(panelsOptions.loc.time.minutes.replace("%d",t)),i-=60*t),i>0&&(1===i?s.push(panelsOptions.loc.time.second.replace("%d",i)):s.push(panelsOptions.loc.time.seconds.replace("%d",i))),_.isEmpty(s)?panelsOptions.loc.time.now:panelsOptions.loc.time.ago.replace("%s",s.slice(0,2).join(", "))}})},{}],7:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({directoryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-directory-items").html())),builder:null,dialogClass:"so-panels-dialog-prebuilt-layouts",dialogIcon:"layouts",layoutCache:{},currentTab:!1,directoryPage:1,events:{"click .so-close":"closeDialog","click .so-sidebar-tabs li a":"tabClickHandler","click .so-content .layout":"layoutClickHandler","keyup .so-sidebar-search":"searchHandler","click .so-screenshot, .so-title":"directoryItemClickHandler"},initializeDialog:function(){var e=this;this.on("open_dialog",(function(){e.$(".so-sidebar-tabs li a").first().click(),e.$(".so-status").removeClass("so-panels-loading")})),this.on("button_click",this.toolbarButtonClick,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-prebuilt").html(),{})),this.initToolbar()},tabClickHandler:function(e){e.preventDefault(),this.selectedLayoutItem=null,this.uploadedLayout=null,this.updateButtonState(!1),this.$(".so-sidebar-tabs li").removeClass("tab-active");var t=l(e.target),i=t.attr("href").split("#")[1];t.parent().addClass("tab-active");this.$(".so-content").empty(),this.currentTab=i,"import"==i?this.displayImportExport():this.displayLayoutDirectory("",1,i),this.$(".so-sidebar-search").val("")},displayImportExport:function(){var e=this.$(".so-content").empty().removeClass("so-panels-loading");e.html(l("#siteorigin-panels-dialog-prebuilt-importexport").html());var t=this,i=t.$(".import-upload-ui"),s=new plupload.Uploader({runtimes:"html5,silverlight,flash,html4",browse_button:i.find(".file-browse-button").get(0),container:i.get(0),drop_element:i.find(".drag-upload-area").get(0),file_data_name:"panels_import_data",multiple_queues:!1,max_file_size:panelsOptions.plupload.max_file_size,url:panelsOptions.plupload.url,flash_swf_url:panelsOptions.plupload.flash_swf_url,silverlight_xap_url:panelsOptions.plupload.silverlight_xap_url,filters:[{title:panelsOptions.plupload.filter_title,extensions:"json"}],multipart_params:{action:"so_panels_import_layout"},init:{PostInit:function(e){e.features.dragdrop&&i.addClass("has-drag-drop"),i.find(".progress-precent").css("width","0%")},FilesAdded:function(e){i.find(".file-browse-button").blur(),i.find(".drag-upload-area").removeClass("file-dragover"),i.find(".progress-bar").fadeIn("fast"),t.$(".js-so-selected-file").text(panelsOptions.loc.prebuilt_loading),e.start()},UploadProgress:function(e,t){i.find(".progress-precent").css("width",t.percent+"%")},FileUploaded:function(e,s,l){var o=JSON.parse(l.response);_.isUndefined(o.widgets)?alert(panelsOptions.plupload.error_message):(t.uploadedLayout=o,i.find(".progress-bar").hide(),t.$(".js-so-selected-file").text(panelsOptions.loc.ready_to_insert.replace("%s",s.name)),t.updateButtonState(!0))},Error:function(){alert(panelsOptions.plupload.error_message)}}});s.init(),/Edge\/\d./i.test(navigator.userAgent)&&setTimeout((function(){s.refresh()}),250),i.find(".drag-upload-area").on("dragover",(function(){l(this).addClass("file-dragover")})).on("dragleave",(function(){l(this).removeClass("file-dragover")})),e.find(".so-export").submit((function(e){var i=l(this),s=t.builder.model.getPanelsData(),o=l('input[name="post_title"], .editor-post-title__input').val();if(o){if(void 0!==wp.data){var n=t.getCurrentBlockPosition();n>=0&&(o+="-"+n)}}else o=l('input[name="post_ID"]').val();s.name=o,i.find('input[name="panels_export_data"]').val(JSON.stringify(s))}))},getCurrentBlockPosition:function(){var e=wp.data.select("core/block-editor").getSelectedBlockClientId();return wp.data.select("core/block-editor").getBlocks().findIndex((function(t){return t.clientId===e}))},displayLayoutDirectory:function(e,t,i){var s=this,o=this.$(".so-content").empty().addClass("so-panels-loading");if(void 0===e&&(e=""),void 0===t&&(t=1),void 0===i&&(i="directory-siteorigin"),i.match("^directory-")&&!panelsOptions.directory_enabled)return o.removeClass("so-panels-loading").html(l("#siteorigin-panels-directory-enable").html()),void o.find(".so-panels-enable-directory").click((function(n){n.preventDefault(),l.get(panelsOptions.ajaxurl,{action:"so_panels_directory_enable"},(function(){})),panelsOptions.directory_enabled=!0,o.addClass("so-panels-loading"),s.displayLayoutDirectory(e,t,i)}));l.get(panelsOptions.ajaxurl,{action:"so_panels_layouts_query",search:e,page:t,type:i,builderType:this.builder.config.builderType},(function(n){if(s.currentTab===i){o.removeClass("so-panels-loading").html(s.directoryTemplate(n));var a=o.find(".so-previous"),r=o.find(".so-next");t<=1?a.addClass("button-disabled"):a.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t-1,s.currentTab)})),t===n.max_num_pages||0===n.max_num_pages?r.addClass("button-disabled"):r.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t+1,s.currentTab)})),o.find(".so-screenshot").each((function(){var e=l(this),t=e.find(".so-screenshot-wrapper");if(t.css("height",t.width()/4*3+"px").addClass("so-loading"),""!==e.data("src"))var i=l("<img/>").attr("src",e.data("src")).load((function(){t.removeClass("so-loading").css("height","auto"),i.appendTo(t).hide().fadeIn("fast")}));else l("<img/>").attr("src",panelsOptions.prebuiltDefaultScreenshot).appendTo(t).hide().fadeIn("fast")})),o.find(".so-directory-browse").html(n.title)}}),"json")},directoryItemClickHandler:function(e){var t=this.$(e.target).closest(".so-directory-item");this.$(".so-directory-items").find(".selected").removeClass("selected"),t.addClass("selected"),this.selectedLayoutItem={lid:t.data("layout-id"),type:t.data("layout-type")},this.updateButtonState(!0)},toolbarButtonClick:function(e){if(!this.canAddLayout())return!1;var t=e.data("value");if(_.isUndefined(t))return!1;if(this.updateButtonState(!1),e.hasClass("so-needs-confirm")&&!e.hasClass("so-confirmed")){if(this.updateButtonState(!0),e.hasClass("so-confirming"))return;e.addClass("so-confirming");var i=e.html();return e.html('<span class="dashicons dashicons-yes"></span>'+e.data("confirm")),setTimeout((function(){e.removeClass("so-confirmed").html(i)}),2500),setTimeout((function(){e.removeClass("so-confirming"),e.addClass("so-confirmed")}),200),!1}this.addingLayout=!0,"import"===this.currentTab?this.addLayoutToBuilder(this.uploadedLayout,t):this.loadSelectedLayout().then(function(e){this.addLayoutToBuilder(e,t)}.bind(this))},canAddLayout:function(){return(this.selectedLayoutItem||this.uploadedLayout)&&!this.addingLayout},loadSelectedLayout:function(){this.setStatusMessage(panelsOptions.loc.prebuilt_loading,!0);var e=_.extend(this.selectedLayoutItem,{action:"so_panels_get_layout",builderType:this.builder.config.builderType}),t=new l.Deferred;return l.get(panelsOptions.ajaxurl,e,function(e){var i="";e.success?t.resolve(e.data):(i=e.data.message,t.reject(e.data)),this.setStatusMessage(i,!1,!e.success),this.updateButtonState(!0)}.bind(this)),t.promise()},searchHandler:function(e){13===e.keyCode&&this.displayLayoutDirectory(l(e.currentTarget).val(),1,this.currentTab)},updateButtonState:function(e){e=e&&(this.selectedLayoutItem||this.uploadedLayout);var t=this.$(".so-import-layout");t.prop("disabled",!e),e?t.removeClass("disabled"):t.addClass("disabled")},addLayoutToBuilder:function(e,t){this.builder.addHistoryEntry("prebuilt_loaded"),this.builder.model.loadPanelsData(e,t),this.addingLayout=!1,this.closeDialog()}})},{}],8:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({cellPreviewTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-row-cell-preview").html())),editableLabel:!0,events:{"click .so-close":"closeDialog","click .so-toolbar .so-save":"saveHandler","click .so-toolbar .so-insert":"insertHandler","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler","change .row-set-form > *":"setCellsFromForm","click .row-set-form button.set-row":"setCellsFromForm"},rowView:null,dialogIcon:"add-row",dialogClass:"so-panels-dialog-row-edit",styleType:"row",dialogType:"edit",row:{cells:null,style:{}},cellStylesCache:[],initializeDialog:function(){this.on("open_dialog",(function(){_.isUndefined(this.model)||_.isEmpty(this.model.get("cells"))?this.setRowModel(null):this.setRowModel(this.model),this.regenerateRowPreview(),this.renderStyles(),this.openSelectedCellStyles()}),this),this.row={cells:new s.collection.cells([{weight:.5},{weight:.5}]),style:{}},this.dialogFormsLoaded=0;var e=this;this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("close_dialog",this.closeHandler),this.on("edit_label",function(e){if(e!==panelsOptions.loc.row.add&&e!==panelsOptions.loc.row.edit||(e=""),this.model.set("label",e),_.isEmpty(e)){var t="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.$(".so-title").text(t)}}.bind(this))},setRowDialogType:function(e){this.dialogType=e},render:function(){var e="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-row").html(),{title:e,dialogType:this.dialogType}));var t=this.$(".so-title");return this.model.has("label")&&!_.isEmpty(this.model.get("label"))&&t.text(this.model.get("label")),this.$(".so-edit-title").val(t.text()),this.builder.supports("addRow")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteRow")||this.$(".so-buttons .so-delete").remove(),_.isUndefined(this.model)||(this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction"))),this.$("input.so-row-field").keyup((function(){l(this).trigger("change")})),this},renderStyles:function(){this.styles&&(this.styles.off("styles_loaded"),this.styles.remove()),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("row",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var e=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(e),this.styles.on("styles_loaded",(function(t){t||(this.styles.remove(),0===e.children().length&&(e.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),e.hide()))}),this)},setRowModel:function(e){return this.model=e,_.isEmpty(this.model)?this:(this.row={cells:this.model.get("cells").clone(),style:{},ratio:this.model.get("ratio"),ratio_direction:this.model.get("ratio_direction")},this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction")),this.clearCellStylesCache(),this)},regenerateRowPreview:function(){var e,t=this,i=this.$(".row-preview"),s=this.getSelectedCellIndex();i.empty(),this.row.cells.each((function(o,n){var a=l(this.cellPreviewTemplate({weight:o.get("weight")}));i.append(a),n==s&&a.find(".preview-cell-in").addClass("cell-selected");var r,d=a.prev();d.length&&((r=l('<div class="resize-handle"></div>')).appendTo(a).dblclick((function(){var e=t.row.cells.at(n-1),i=o.get("weight")+e.get("weight");o.set("weight",i/2),e.set("weight",i/2),t.scaleRowWidths()})),r.draggable({axis:"x",containment:i,start:function(e,t){var i=a.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:a.outerWidth(),left:6,height:a.outerHeight()});i.find(".resize-handle").remove();var s=d.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:d.outerWidth(),right:6,height:d.outerHeight()});s.find(".resize-handle").remove(),l(this).data({newCellClone:i,prevCellClone:s}),a.find("> .preview-cell-in").css("visibility","hidden"),d.find("> .preview-cell-in").css("visibility","hidden")},drag:function(e,s){var o=t.row.cells.at(n).get("weight"),a=t.row.cells.at(n-1).get("weight"),r=o-(s.position.left+6)/i.width(),d=a+(s.position.left+6)/i.width();s.helper.offset().left,i.offset().left;l(this).data("newCellClone").css("width",i.width()*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10),l(this).data("prevCellClone").css("width",i.width()*d).find(".preview-cell-weight").html(Math.round(1e3*d)/10)},stop:function(e,s){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove(),a.find(".preview-cell-in").css("visibility","visible"),d.find(".preview-cell-in").css("visibility","visible");var o=(s.position.left+6)/i.width(),r=t.row.cells.at(n),h=t.row.cells.at(n-1);r.get("weight")-o>.02&&h.get("weight")+o>.02&&(r.set("weight",r.get("weight")-o),h.set("weight",h.get("weight")+o)),t.scaleRowWidths(),s.helper.css("left",-6)}})),a.click(function(e){if(l(e.target).is(".preview-cell")||l(e.target).is(".preview-cell-in")){var t=l(e.target);t.closest(".row-preview").find(".preview-cell .preview-cell-in").removeClass("cell-selected"),t.addClass("cell-selected"),this.openSelectedCellStyles()}}.bind(this)),a.find(".preview-cell-weight").click((function(s){t.$(".resize-handle").css("pointer-event","none").draggable("disable"),i.find(".preview-cell-weight").each((function(){var s=jQuery(this).hide();l('<input type="text" class="preview-cell-weight-input no-user-interacted" />').val(parseFloat(s.html())).insertAfter(s).focus((function(){clearTimeout(e)})).keyup((function(e){9!==e.keyCode&&l(this).removeClass("no-user-interacted"),13===e.keyCode&&(e.preventDefault(),l(this).blur())})).keydown((function(e){if(9===e.keyCode){e.preventDefault();var t=i.find(".preview-cell-weight-input"),s=t.index(l(this));s===t.length-1?t.eq(0).focus().select():t.eq(s+1).focus().select()}})).blur((function(){i.find(".preview-cell-weight-input").each((function(e,i){isNaN(parseFloat(l(i).val()))&&l(i).val(Math.floor(1e3*t.row.cells.at(e).get("weight"))/10)})),e=setTimeout((function(){if(0===i.find(".preview-cell-weight-input").length)return!1;var e=[],s=[],o=0,n=0;if(i.find(".preview-cell-weight-input").each((function(i,a){var r=parseFloat(l(a).val());r=isNaN(r)?1/t.row.cells.length:Math.round(10*r)/1e3;var d=!l(a).hasClass("no-user-interacted");e.push(r),s.push(d),d?o+=r:n+=r})),o>0&&n>0&&1-o>0)for(var a=0;a<e.length;a++)s[a]||(e[a]=e[a]/n*(1-o));var r=_.reduce(e,(function(e,t){return e+t}));e=e.map((function(e){return e/r})),Math.min.apply(Math,e)>.01&&t.row.cells.each((function(t,i){t.set("weight",e[i])})),i.find(".preview-cell").each((function(e,i){var s=t.row.cells.at(e).get("weight");l(i).animate({width:Math.round(1e3*s)/10+"%"},250),l(i).find(".preview-cell-weight-input").val(Math.round(1e3*s)/10)})),i.find(".preview-cell").css("overflow","visible"),setTimeout(t.regenerateRowPreview.bind(t),260)}),100)})).click((function(){l(this).select()}))})),l(this).siblings(".preview-cell-weight-input").select()}))}),this),this.trigger("form_loaded",this)},getSelectedCellIndex:function(){var e=-1;return this.$(".preview-cell .preview-cell-in").each((function(t,i){l(i).is(".cell-selected")&&(e=t)})),e},openSelectedCellStyles:function(){if(!_.isUndefined(this.cellStyles)){if(this.cellStyles.stylesLoaded){var e={};try{e=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",e)}this.cellStyles.detach()}if(this.cellStyles=this.getSelectedCellStyles(),this.cellStyles){var t=this.$(".so-sidebar.so-right-sidebar");this.cellStyles.attach(t),this.cellStyles.on("styles_loaded",(function(e){e&&(t.closest(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"),t.show())}))}},getSelectedCellStyles:function(){var e=this.getSelectedCellIndex();if(e>-1){var t=this.cellStylesCache[e];t||((t=new s.view.styles).model=this.row.cells.at(e),t.render("cell",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this,index:e}),this.cellStylesCache[e]=t)}return t},clearCellStylesCache:function(){this.cellStylesCache.forEach((function(e){e.remove(),e.off("styles_loaded")})),this.cellStylesCache=[]},scaleRowWidths:function(){var e=this;this.$(".row-preview .preview-cell").each((function(t,i){var s=e.row.cells.at(t);l(i).css("width",100*s.get("weight")+"%").find(".preview-cell-weight").html(Math.round(1e3*s.get("weight"))/10)}))},setCellsFromForm:function(){try{var e={cells:parseInt(this.$('.row-set-form input[name="cells"]').val()),ratio:parseFloat(this.$('.row-set-form select[name="ratio"]').val()),direction:this.$('.row-set-form select[name="ratio_direction"]').val()};_.isNaN(e.cells)&&(e.cells=1),isNaN(e.ratio)&&(e.ratio=1),e.cells<1?(e.cells=1,this.$('.row-set-form input[name="cells"]').val(e.cells)):e.cells>12&&(e.cells=12,this.$('.row-set-form input[name="cells"]').val(e.cells)),this.$('.row-set-form select[name="ratio"]').val(e.ratio);for(var t=[],i=this.row.cells.length!==e.cells,o=1,n=0;n<e.cells;n++)t.push(o),o*=e.ratio;var a=_.reduce(t,(function(e,t){return e+t}));if(t=_.map(t,(function(e){return e/a})),t=_.filter(t,(function(e){return e>.01})),"left"===e.direction&&(t=t.reverse()),this.row.cells=new s.collection.cells(this.row.cells.first(t.length)),_.each(t,function(e,t){var i=this.row.cells.at(t);i?i.set("weight",e):(i=new s.model.cell({weight:e,row:this.model}),this.row.cells.add(i))}.bind(this)),this.row.ratio=e.ratio,this.row.ratio_direction=e.direction,i)this.regenerateRowPreview();else{var r=this;this.$(".preview-cell").each((function(e,t){var i=r.row.cells.at(e).get("weight");l(t).animate({width:Math.round(1e3*i)/10+"%"},250),l(t).find(".preview-cell-weight").html(Math.round(1e3*i)/10)})),this.$(".preview-cell").css("overflow","visible"),setTimeout(r.regenerateRowPreview.bind(r),260)}}catch(e){console.log("Error setting cells - "+e.message)}this.$(".row-set-form .so-button-row-set").removeClass("button-primary")},tabClickHandler:function(e){"#row-layout"===e.attr("href")?this.$(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"):this.$(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar")},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),_.isEmpty(this.model)||(this.model.setCells(this.row.cells),this.model.set("ratio",this.row.ratio),this.model.set("ratio_direction",this.row.ratio_direction)),!_.isUndefined(this.styles)&&this.styles.stylesLoaded){var t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-row-styles").style}catch(e){console.log("Error retrieving row styles - "+e.message)}this.model.set("style",t)}if(!_.isUndefined(this.cellStyles)&&this.cellStyles.stylesLoaded){t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",t)}e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},insertHandler:function(){this.builder.addHistoryEntry("row_added"),this.updateModel();var e=this.builder.getActiveCell({createCell:!1}),t={};return null!==e&&(t.at=this.builder.model.get("rows").indexOf(e.row)+1),this.model.collection=this.builder.model.get("rows"),this.builder.model.get("rows").add(this.model,t),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},saveHandler:function(){return this.builder.addHistoryEntry("row_edited"),this.updateModel(),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},deleteHandler:function(){return this.rowView.visualDestroyModel(),this.closeDialog({silent:!0}),!1},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);return this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.closeDialog({silent:!0}),!1},closeHandler:function(){this.clearCellStylesCache(),_.isUndefined(this.cellStyles)||(this.cellStyles=void 0)}})},{}],9:[function(e,t,i){var s=window.panels,l=jQuery,o=e("../view/widgets/js-widget");t.exports=s.view.dialog.extend({builder:null,sidebarWidgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widget-sidebar-widget").html())),dialogClass:"so-panels-dialog-edit-widget",dialogIcon:"add-widget",widgetView:!1,savingWidget:!1,editableLabel:!0,events:{"click .so-close":"saveHandler","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler"},initializeDialog:function(){var e=this;this.listenTo(this.model,"change:values",this.handleChangeValues),this.listenTo(this.model,"destroy",this.remove),this.dialogFormsLoaded=0,this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("edit_label",function(e){e===panelsOptions.widgets[this.model.get("class")].title&&(e=""),this.model.set("label",e),_.isEmpty(e)&&this.$(".so-title").text(this.model.getWidgetField("title"))}.bind(this))},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widget").html(),{})),this.loadForm();var e=this.model.getWidgetField("title");this.$(".so-title .widget-name").html(e),this.$(".so-edit-title").val(e),this.builder.supports("addWidget")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteWidget")||this.$(".so-buttons .so-delete").remove(),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("widget",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var t=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(t),this.styles.on("styles_loaded",(function(e){e||(t.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),t.remove())}),this)},getPrevDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(0===i)return!1;do{if(t=e.eq(--i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t)&&i>0);return!1},getNextDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(i===e.length-1)return!1;do{if(t=e.eq(++i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t));return!1},loadForm:function(){if(this.$("> *").length){this.$(".so-content").addClass("so-panels-loading");var e={action:"so_panels_widget_form",widget:this.model.get("class"),instance:JSON.stringify(this.model.get("values")),raw:this.model.get("raw")},t=this.$(".so-content");l.post(panelsOptions.ajaxurl,e,null,"html").done(function(e){var i=e.replace(/{\$id}/g,this.model.cid);t.removeClass("so-panels-loading").html(i),this.trigger("form_loaded",this),this.$(".panel-dialog").trigger("panelsopen"),this.on("close_dialog",this.updateModel,this),t.find("> .widget-content").length>0&&o.addWidget(t,this.model.widget_id)}.bind(this)).fail((function(e){var i;i=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,t.removeClass("so-panels-loading").html(i)}))}},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),this.savingWidget=!0,!this.model.get("missing")){var t=this.getFormValues();t=_.isUndefined(t.widgets)?{}:(t=t.widgets)[Object.keys(t)[0]],this.model.setValues(t),this.model.set("raw",!0)}if(this.styles.stylesLoaded){var i={};try{i=this.getFormValues(".so-sidebar .so-visual-styles").style}catch(e){}this.model.set("style",i)}this.savingWidget=!1,e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},handleChangeValues:function(){this.savingWidget||this.loadForm()},saveHandler:function(){this.builder.addHistoryEntry("widget_edited"),this.closeDialog()},deleteHandler:function(){return this.widgetView.visualDestroyModel(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1},duplicateHandler:function(){return this.widgetView.duplicateHandler(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1}})},{"../view/widgets/js-widget":32}],10:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({builder:null,widgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widgets-widget").html())),filter:{},dialogClass:"so-panels-dialog-add-widget",dialogIcon:"add-widget",events:{"click .so-close":"closeDialog","click .widget-type":"widgetClickHandler","keyup .so-sidebar-search":"searchHandler"},initializeDialog:function(){this.on("open_dialog",(function(){this.filter.search="",this.filterWidgets(this.filter)}),this),this.on("open_dialog_complete",(function(){this.$(".so-sidebar-search").val("").focus(),this.balanceWidgetHeights()})),this.on("tab_click",this.tabClickHandler,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widgets").html(),{})),_.each(panelsOptions.widgets,(function(e){var t=l(this.widgetTemplate({title:e.title,description:e.description}));_.isUndefined(e.icon)&&(e.icon="dashicons dashicons-admin-generic"),l('<span class="widget-icon" />').addClass(e.icon).prependTo(t.find(".widget-type-wrapper")),t.data("class",e.class).appendTo(this.$(".widget-type-list"))}),this);var e=this.$(".so-sidebar-tabs");_.each(panelsOptions.widget_dialog_tabs,(function(t,i){l(this.dialogTabTemplate({title:t.title,tab:i})).data({message:t.message,filter:t.filter}).appendTo(e)}),this),this.initTabs();var t=this;l(window).resize((function(){t.balanceWidgetHeights()}))},tabClickHandler:function(e){this.filter=e.parent().data("filter"),this.filter.search=this.$(".so-sidebar-search").val();var t=e.parent().data("message");return _.isEmpty(t)&&(t=""),this.$(".so-toolbar .so-status").html(t),this.filterWidgets(this.filter),!1},searchHandler:function(e){if(13===e.which){var t=this.$(".widget-type-list .widget-type:visible");1===t.length&&t.click()}else this.filter.search=l(e.target).val().trim(),this.filterWidgets(this.filter)},filterWidgets:function(e){_.isUndefined(e)&&(e={}),_.isUndefined(e.groups)&&(e.groups=""),this.$(".widget-type-list .widget-type").each((function(){var t,i=l(this),s=i.data("class"),o=_.isUndefined(panelsOptions.widgets[s])?null:panelsOptions.widgets[s];(t=!!_.isEmpty(e.groups)||null!==o&&!_.isEmpty(_.intersection(e.groups,panelsOptions.widgets[s].groups)))&&(_.isUndefined(e.search)||""===e.search||-1===o.title.toLowerCase().indexOf(e.search.toLowerCase())&&(t=!1)),t?i.show():i.hide()})),this.balanceWidgetHeights()},widgetClickHandler:function(e){this.builder.trigger("before_user_adds_widget"),this.builder.addHistoryEntry("widget_added");var t=l(e.currentTarget),i=new s.model.widget({class:t.data("class")});i.cell=this.builder.getActiveCell(),i.cell.get("widgets").add(i),this.closeDialog(),this.builder.model.refreshPanelsData(),this.builder.trigger("after_user_adds_widget",i)},balanceWidgetHeights:function(e){var t=[[]],i=null,s=Math.round(this.$(".widget-type").parent().width()/this.$(".widget-type").width());this.$(".widget-type").css("clear","none").filter(":visible").each((function(e,t){e%s==0&&0!==e&&l(t).css("clear","both")})),this.$(".widget-type-wrapper").css("height","auto").filter(":visible").each((function(e,s){var o=l(s);null!==i&&i.position().top!==o.position().top&&(t[t.length]=[]),i=o,t[t.length-1].push(o)})),_.each(t,(function(e,t){var i=_.max(e.map((function(e){return e.height()})));_.each(e,(function(e){e.height(i)}))}))}})},{}],11:[function(e,t,i){t.exports={canCopyPaste:function(){return"undefined"!=typeof Storage&&panelsOptions.user},setModel:function(e){if(!this.canCopyPaste())return!1;var t=panels.helpers.serialize.serialize(e);return e instanceof panels.model.row?t.thingType="row-model":e instanceof panels.model.widget&&(t.thingType="widget-model"),localStorage["panels_clipboard_"+panelsOptions.user]=JSON.stringify(t),!0},isModel:function(e){if(!this.canCopyPaste())return!1;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&((t=JSON.parse(t)).thingType&&t.thingType===e)},getModel:function(e){if(!this.canCopyPaste())return null;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&(t=JSON.parse(t)).thingType&&t.thingType===e?panels.helpers.serialize.unserialize(t,t.thingType,null):null}}},{}],12:[function(e,t,i){t.exports={isBlockEditor:function(){return void 0!==wp.blocks},isClassicEditor:function(e){return e.attachedToEditor&&e.$el.is(":visible")}}},{}],13:[function(e,t,i){t.exports={lock:function(){if("hidden"!==jQuery("body").css("overflow")){var e=[self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];jQuery("body").data({"scroll-position":e}).css("overflow","hidden"),_.isUndefined(e)||window.scrollTo(e[0],e[1])}},unlock:function(){if("hidden"===jQuery("body").css("overflow")&&!jQuery(".so-panels-dialog-wrapper").is(":visible")&&!jQuery(".so-panels-live-editor").is(":visible")){jQuery("body").css("overflow","visible");var e=jQuery("body").data("scroll-position");_.isUndefined(e)||window.scrollTo(e[0],e[1])}}}},{}],14:[function(e,t,i){t.exports={serialize:function(e){var t;if(e instanceof Backbone.Model){var i={};for(var s in e.attributes)if(e.attributes.hasOwnProperty(s)){if("builder"===s||"collection"===s)continue;(t=e.attributes[s])instanceof Backbone.Model||t instanceof Backbone.Collection?i[s]=this.serialize(t):i[s]=t}return i}if(e instanceof Backbone.Collection){for(var l=[],o=0;o<e.models.length;o++)(t=e.models[o])instanceof Backbone.Model||t instanceof Backbone.Collection?l.push(this.serialize(t)):l.push(t);return l}},unserialize:function(e,t,i){var s;switch(t){case"row-model":(s=new panels.model.row).builder=i;var l={style:e.style};e.hasOwnProperty("label")&&(l.label=e.label),e.hasOwnProperty("color_label")&&(l.color_label=e.color_label),s.set(l),s.setCells(this.unserialize(e.cells,"cell-collection",s));break;case"cell-model":(s=new panels.model.cell).row=i,s.set("weight",e.weight),s.set("style",e.style),s.set("widgets",this.unserialize(e.widgets,"widget-collection",s));break;case"widget-model":for(var o in(s=new panels.model.widget).cell=i,e)e.hasOwnProperty(o)&&s.set(o,e[o]);s.set("widget_id",panels.helpers.utils.generateUUID());break;case"cell-collection":s=new panels.collection.cells;for(var n=0;n<e.length;n++)s.push(this.unserialize(e[n],"cell-model",i));break;case"widget-collection":s=new panels.collection.widgets;for(n=0;n<e.length;n++)s.push(this.unserialize(e[n],"widget-model",i));break;default:console.log("Unknown Thing - "+t)}return s}}},{}],15:[function(e,t,i){t.exports={generateUUID:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))},processTemplate:function(e){return _.isUndefined(e)||_.isNull(e)?"":e=(e=(e=e.replace(/{{%/g,"<%")).replace(/%}}/g,"%>")).trim()},selectElementContents:function(e){var t=document.createRange();t.selectNodeContents(e);var i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}},{}],16:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=function(e,t){return this.each((function(){var i=jQuery(this);if(!i.data("soPanelsBuilderWidgetInitialized")||t){var o=i.closest("form").find(".widget-id").val(),n=l.extend(!0,{builderSupports:i.data("builder-supports")},e);if(_.isUndefined(o)||!(o.indexOf("__i__")>-1)){var a=new s.model.builder,r=new s.view.builder({model:a,config:n}),d=i.closest(".so-panels-dialog-wrapper").data("view");_.isUndefined(d)||(d.on("close_dialog",(function(){a.refreshPanelsData()})),d.on("open_dialog_complete",(function(){r.trigger("builder_resize")})),d.model.on("destroy",(function(){a.emptyRows().destroy()})),r.setDialogParents(panelsOptions.loc.layout_widget,d));var h=Boolean(i.closest(".widget-content").length);r.render().attach({container:i,dialog:h||"dialog"===i.data("mode"),type:i.data("type")}).setDataField(i.find("input.panels-data")),h||"dialog"===i.data("mode")?(r.setDialogParents(panelsOptions.loc.layout_widget,r.dialog),i.find(".siteorigin-panels-display-builder").click((function(e){e.preventDefault(),r.dialog.openDialog()}))):i.find(".siteorigin-panels-display-builder").parent().remove(),l(document).trigger("panels_setup",r),i.data("soPanelsBuilderWidgetInitialized",!0)}}}))}},{}],17:[function(e,t,i){
|
2 |
Â
/**
|
3 |
Â
* Everything we need for SiteOrigin Page Builder.
|
4 |
Â
*
|
5 |
Â
* @copyright Greg Priday 2013 - 2016 - <https://siteorigin.com/>
|
6 |
Â
* @license GPL 3.0 http://www.gnu.org/licenses/gpl.html
|
7 |
Â
*/
|
8 |
+
var s={};window.panels=s,window.siteoriginPanels=s,s.helpers={},s.helpers.clipboard=e("./helpers/clipboard"),s.helpers.utils=e("./helpers/utils"),s.helpers.editor=e("./helpers/editor"),s.helpers.serialize=e("./helpers/serialize"),s.helpers.pageScroll=e("./helpers/page-scroll"),s.model={},s.model.widget=e("./model/widget"),s.model.cell=e("./model/cell"),s.model.row=e("./model/row"),s.model.builder=e("./model/builder"),s.model.historyEntry=e("./model/history-entry"),s.collection={},s.collection.widgets=e("./collection/widgets"),s.collection.cells=e("./collection/cells"),s.collection.rows=e("./collection/rows"),s.collection.historyEntries=e("./collection/history-entries"),s.view={},s.view.widget=e("./view/widget"),s.view.cell=e("./view/cell"),s.view.row=e("./view/row"),s.view.builder=e("./view/builder"),s.view.dialog=e("./view/dialog"),s.view.styles=e("./view/styles"),s.view.liveEditor=e("./view/live-editor"),s.dialog={},s.dialog.builder=e("./dialog/builder"),s.dialog.widgets=e("./dialog/widgets"),s.dialog.widget=e("./dialog/widget"),s.dialog.prebuilt=e("./dialog/prebuilt"),s.dialog.row=e("./dialog/row"),s.dialog.history=e("./dialog/history"),s.utils={},s.utils.menu=e("./utils/menu"),jQuery.fn.soPanelsSetupBuilderWidget=e("./jquery/setup-builder-widget"),jQuery((function(e){var t,i,s,l,o=e("#siteorigin-panels-metabox");if(s=e("form#post"),o.length&&s.length)t=o,i=o.find(".siteorigin-panels-data-field"),l={editorType:"tinyMCE",postId:e("#post_ID").val(),editorId:"#content",builderType:o.data("builder-type"),builderSupports:o.data("builder-supports"),loadOnAttach:panelsOptions.loadOnAttach&&1==e("#auto_draft").val(),loadLiveEditor:1==o.data("live-editor"),liveEditorPreview:t.data("preview-url")};else if(e(".siteorigin-panels-builder-form").length){var n=e(".siteorigin-panels-builder-form");t=n.find(".siteorigin-panels-builder-container"),i=n.find('input[name="panels_data"]'),s=n,l={editorType:"standalone",postId:n.data("post-id"),editorId:"#post_content",builderType:n.data("type"),builderSupports:n.data("builder-supports"),loadLiveEditor:!1,liveEditorPreview:n.data("preview-url")}}if(!_.isUndefined(t)){var a=window.siteoriginPanels,r=new a.model.builder,d=new a.view.builder({model:r,config:l});e(document).trigger("before_panels_setup",d),d.render().attach({container:t}).setDataField(i).attachToEditor(),s.submit((function(){r.refreshPanelsData()})),t.removeClass("so-panels-loading"),e(document).trigger("panels_setup",d,window.panels),window.soPanelsBuilderView=d}e(document).on("widget-added",(function(t,i){e(i).find(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e("body").hasClass("wp-customizer")||e((function(){e(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e(window).on("keyup",(function(t){27===t.which&&e(".so-panels-dialog-wrapper, .so-panels-live-editor").filter(":visible").last().find(".so-title-bar .so-close, .live-editor-close").click()}))}))},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/editor":12,"./helpers/page-scroll":13,"./helpers/serialize":14,"./helpers/utils":15,"./jquery/setup-builder-widget":16,"./model/builder":18,"./model/cell":19,"./model/history-entry":20,"./model/row":21,"./model/widget":22,"./utils/menu":23,"./view/builder":24,"./view/cell":25,"./view/dialog":26,"./view/live-editor":27,"./view/row":28,"./view/styles":29,"./view/widget":30}],18:[function(e,t,i){t.exports=Backbone.Model.extend({layoutPosition:{BEFORE:"before",AFTER:"after",REPLACE:"replace"},rows:{},defaults:{data:{widgets:[],grids:[],grid_cells:[]}},initialize:function(){this.set("rows",new panels.collection.rows)},addRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var s=new panels.collection.cells(t);e=_.extend({collection:this.get("rows"),cells:s},e);var l=new panels.model.row(e);return l.builder=this,this.get("rows").add(l,i),l},loadPanelsData:function(e,t){try{t===this.layoutPosition.BEFORE?e=this.concatPanelsData(e,this.getPanelsData()):t===this.layoutPosition.AFTER&&(e=this.concatPanelsData(this.getPanelsData(),e)),this.emptyRows(),this.set("data",JSON.parse(JSON.stringify(e)),{silent:!0});var i,s=[];if(_.isUndefined(e.grid_cells))return void this.trigger("load_panels_data");for(var l=0;l<e.grid_cells.length;l++)i=parseInt(e.grid_cells[l].grid),_.isUndefined(s[i])&&(s[i]=[]),s[i].push(e.grid_cells[l]);var o=this;if(_.each(s,(function(t,i){var s={};_.isUndefined(e.grids[i].style)||(s.style=e.grids[i].style),_.isUndefined(e.grids[i].ratio)||(s.ratio=e.grids[i].ratio),_.isUndefined(e.grids[i].ratio_direction)||(s.ratio_direction=e.grids[i].ratio_direction),_.isUndefined(e.grids[i].color_label)||(s.color_label=e.grids[i].color_label),_.isUndefined(e.grids[i].label)||(s.label=e.grids[i].label),o.addRow(s,t,{noAnimate:!0})})),_.isUndefined(e.widgets))return;_.each(e.widgets,(function(e){var t=null;_.isUndefined(e.panels_info)?(t=e.info,delete e.info):(t=e.panels_info,delete e.panels_info);var i=o.get("rows").at(parseInt(t.grid)).get("cells").at(parseInt(t.cell)),s=new panels.model.widget({class:t.class,values:e});_.isUndefined(t.style)||s.set("style",t.style),_.isUndefined(t.read_only)||s.set("read_only",t.read_only),_.isUndefined(t.widget_id)?s.set("widget_id",panels.helpers.utils.generateUUID()):s.set("widget_id",t.widget_id),_.isUndefined(t.label)||s.set("label",t.label),s.cell=i,i.get("widgets").add(s,{noAnimate:!0})})),this.trigger("load_panels_data")}catch(e){console.log("Error loading data: "+e.message)}},concatPanelsData:function(e,t){if(_.isUndefined(t)||_.isUndefined(t.grids)||_.isEmpty(t.grids)||_.isUndefined(t.grid_cells)||_.isEmpty(t.grid_cells))return e;if(_.isUndefined(e)||_.isUndefined(e.grids)||_.isEmpty(e.grids))return t;var i,s=e.grids.length,l=_.isUndefined(e.widgets)?0:e.widgets.length,o={grids:[],grid_cells:[],widgets:[]};for(o.grids=e.grids.concat(t.grids),_.isUndefined(e.grid_cells)||(o.grid_cells=e.grid_cells.slice()),_.isUndefined(e.widgets)||(o.widgets=e.widgets.slice()),i=0;i<t.grid_cells.length;i++){var n=t.grid_cells[i];n.grid=parseInt(n.grid)+s,o.grid_cells.push(n)}if(!_.isUndefined(t.widgets))for(i=0;i<t.widgets.length;i++){var a=t.widgets[i];a.panels_info.grid=parseInt(a.panels_info.grid)+s,a.panels_info.id=parseInt(a.panels_info.id)+l,o.widgets.push(a)}return o},getPanelsData:function(){var e={widgets:[],grids:[],grid_cells:[]},t=0;return this.get("rows").each((function(i,s){i.get("cells").each((function(i,l){i.get("widgets").each((function(i,o){var n={class:i.get("class"),raw:i.get("raw"),grid:s,cell:l,id:t++,widget_id:i.get("widget_id"),style:i.get("style"),label:i.get("label")};_.isEmpty(n.widget_id)&&(n.widget_id=panels.helpers.utils.generateUUID());var a=_.extend(_.clone(i.get("values")),{panels_info:n});e.widgets.push(a)})),e.grid_cells.push({grid:s,index:l,weight:i.get("weight"),style:i.get("style")})})),e.grids.push({cells:i.get("cells").length,style:i.get("style"),ratio:i.get("ratio"),ratio_direction:i.get("ratio_direction"),color_label:i.get("color_label"),label:i.get("label")})})),e},refreshPanelsData:function(e){e=_.extend({silent:!1},e);var t=this.get("data"),i=this.getPanelsData();this.set("data",i,{silent:!0}),e.silent||JSON.stringify(i)===JSON.stringify(t)||(this.trigger("change"),this.trigger("change:data"),this.trigger("refresh_panels_data",i,e))},emptyRows:function(){return _.invoke(this.get("rows").toArray(),"destroy"),this.get("rows").reset(),this},isValidLayoutPosition:function(e){return e===this.layoutPosition.BEFORE||e===this.layoutPosition.AFTER||e===this.layoutPosition.REPLACE},getPanelsDataFromHtml:function(e,t){var i,s=this,l=jQuery('<div id="wrapper">'+e+"</div>");if(l.find(".panel-layout .panel-grid").length){var o={grids:[],grid_cells:[],widgets:[]},n=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),a=(i=document.createElement("div"),function(e){return e&&"string"==typeof e&&(e=(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),i.innerHTML=e,e=i.textContent,i.textContent=""),e}),r=function(e){var t,i=e.find("div");if(!i.length)return e.html();for(t=0;t<i.length-1&&jQuery.trim(i.eq(t).text())==jQuery.trim(i.eq(t+1).text());t++);var s=i.eq(t).find(".widget-title:header"),l="";return s.length&&(l=s.html(),s.remove()),{title:l,text:i.eq(t).html()}},d=l.find(".panel-layout").eq(0),h=function(e,t){return jQuery(t).closest(".panel-layout").is(d)};return l.find("> .panel-layout > .panel-grid").filter(h).each((function(e,i){var l=jQuery(i),d=l.find(".panel-grid-cell").filter(h);o.grids.push({cells:d.length,style:l.data("style"),ratio:l.data("ratio"),ratio_direction:l.data("ratio-direction"),color_label:l.data("color-label"),label:l.data("label")}),d.each((function(i,l){var d=jQuery(l),c=d.find(".so-panel").filter(h);o.grid_cells.push({grid:e,weight:_.isUndefined(d.data("weight"))?1:parseFloat(d.data("weight")),style:d.data("style")}),c.each((function(l,d){var h=jQuery(d),c=h.find(".panel-widget-style").length?h.find(".panel-widget-style").html():h.html(),u={grid:e,cell:i,style:h.data("style"),raw:!1,label:h.data("label")};c=c.trim();var p=n.exec(c);if(!_.isNull(p)&&""===c.replace(n,"").trim()){try{var g=/class="(.*?)"/.exec(p[3]),f=jQuery(p[5]),w=JSON.parse(a(f.val())).instance;u.class=g[1].replace(/\\\\+/g,"\\"),u.raw=!1,w.panels_info=u,o.widgets.push(w)}catch(e){u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u}))}return!0}return-1!==c.indexOf("panel-layout")&&jQuery("<div>"+c+"</div>").find(".panel-layout .panel-grid").length?(u.class="SiteOrigin_Panels_Widgets_Layout",o.widgets.push({panels_data:s.getPanelsDataFromHtml(c,t),panels_info:u}),!0):(u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u})),!0)}))}))})),l.find(".panel-layout").remove(),l.find("style[data-panels-style-for-post]").remove(),l.html().replace(/^\s+|\s+$/gm,"").length&&(o.grids.push({cells:1,style:{}}),o.grid_cells.push({grid:o.grids.length-1,weight:1}),o.widgets.push({filter:"1",text:l.html().replace(/^\s+|\s+$/gm,""),title:"",type:"visual",panels_info:{class:t,raw:!1,grid:o.grids.length-1,cell:0}})),o}return{grid_cells:[{grid:0,weight:1}],grids:[{cells:1}],widgets:[{filter:"1",text:e,title:"",type:"visual",panels_info:{class:t,raw:!1,grid:0,cell:0}}]}}})},{}],19:[function(e,t,i){t.exports=Backbone.Model.extend({widgets:{},row:null,defaults:{weight:0,style:{}},indexes:null,initialize:function(){this.set("widgets",new panels.collection.widgets),this.on("destroy",this.onDestroy,this)},onDestroy:function(){_.invoke(this.get("widgets").toArray(),"destroy"),this.get("widgets").reset()},clone:function(e,t){_.isUndefined(e)&&(e=this.row),t=_.extend({cloneWidgets:!0},t);var i=new this.constructor(this.attributes);return i.set("collection",e.get("cells"),{silent:!0}),i.row=e,t.cloneWidgets&&this.get("widgets").each((function(e){i.get("widgets").add(e.clone(i,t),{silent:!0})})),i}})},{}],20:[function(e,t,i){t.exports=Backbone.Model.extend({defaults:{text:"",data:"",time:null,count:1}})},{}],21:[function(e,t,i){t.exports=Backbone.Model.extend({builder:null,defaults:{style:{}},indexes:null,initialize:function(){_.isEmpty(this.get("cells"))?this.set("cells",new panels.collection.cells):this.get("cells").each(function(e){e.row=this}.bind(this)),this.on("destroy",this.onDestroy,this)},setCells:function(e){var t=this.get("cells")||new panels.collection.cells,i=[];t.each((function(s,l){var o=e.at(l);if(o)s.set("weight",o.get("weight"));else{for(var n=t.at(e.length-1),a=s.get("widgets").models.slice(),r=0;r<a.length;r++)a[r].moveToCell(n,{silent:!1});i.push(s)}})),_.each(i,(function(e){t.remove(e)})),e.length>t.length&&_.each(e.slice(t.length,e.length),function(e){e.set({collection:t}),e.row=this,t.add(e)}.bind(this)),this.reweightCells()},reweightCells:function(){var e=0,t=this.get("cells");t.each((function(t){e+=t.get("weight")})),t.each((function(t){t.set("weight",t.get("weight")/e)})),this.trigger("reweight_cells")},onDestroy:function(){_.invoke(this.get("cells").toArray(),"destroy"),this.get("cells").reset()},clone:function(e){_.isUndefined(e)&&(e=this.builder);var t=new this.constructor(this.attributes);t.set("collection",e.get("rows"),{silent:!0}),t.builder=e;var i=new panels.collection.cells;return this.get("cells").each((function(e){i.add(e.clone(t),{silent:!0})})),t.set("cells",i),t}})},{}],22:[function(e,t,i){t.exports=Backbone.Model.extend({cell:null,defaults:{class:null,missing:!1,values:{},raw:!1,style:{},read_only:!1,widget_id:""},indexes:null,initialize:function(){var e=this.get("class");!_.isUndefined(panelsOptions.widgets[e])&&panelsOptions.widgets[e].installed||this.set("missing",!0)},getWidgetField:function(e){return _.isUndefined(panelsOptions.widgets[this.get("class")])?"title"===e||"description"===e?panelsOptions.loc.missing_widget[e]:"":this.has("label")&&!_.isEmpty(this.get("label"))?this.get("label"):panelsOptions.widgets[this.get("class")][e]},moveToCell:function(e,t,i){return t=_.extend({silent:!0},t),this.cell=e,this.collection.remove(this,t),e.get("widgets").add(this,_.extend({at:i},t)),this.trigger("move_to_cell",e,i),this},setValues:function(e){var t=!1;JSON.stringify(e)!==JSON.stringify(this.get("values"))&&(t=!0),this.set("values",e,{silent:!0}),t&&(this.trigger("change",this),this.trigger("change:values"))},clone:function(e,t){_.isUndefined(e)&&(e=this.cell);var i=new this.constructor(this.attributes),s=JSON.parse(JSON.stringify(this.get("values"))),l=function(e){return _.each(e,(function(t,i){_.isString(i)&&"_"===i[0]?delete e[i]:_.isObject(e[i])&&l(e[i])})),e};return s=l(s),"SiteOrigin_Panels_Widgets_Layout"===this.get("class")&&(s.builder_id=Math.random().toString(36).substr(2)),i.set("widget_id",""),i.set("values",s,{silent:!0}),i.set("collection",e.get("widgets"),{silent:!0}),i.cell=e,i.isDuplicate=!0,i},getTitle:function(){var e=panelsOptions.widgets[this.get("class")];if(_.isUndefined(e))return this.get("class").replace(/_/g," ");if(!_.isUndefined(e.panels_title)&&!1===e.panels_title)return panelsOptions.widgets[this.get("class")].description;var t=this.get("values"),i=["title","text"];for(var s in t)"_"!==s.charAt(0)&&"so_sidebar_emulator_id"!==s&&"option_name"!==s&&t.hasOwnProperty(s)&&i.push(s);for(var l in i=_.uniq(i))if(!_.isUndefined(t[i[l]])&&_.isString(t[i[l]])&&""!==t[i[l]]&&"on"!==t[i[l]]&&"true"!==t[i[l]]&&"false"!==t[i[l]]&&"_"!==i[l][0]&&!jQuery.isNumeric(t[i[l]])){var o=t[i[l]],n=(o=o.replace(/<\/?[^>]+(>|$)/g,"")).split(" ");return(n=n.slice(0,20)).join(" ")}return this.getWidgetField("description")}})},{}],23:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({wrapperTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu").html())),sectionTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu-section").html())),contexts:[],active:!1,events:{"keyup .so-search-wrapper input":"searchKeyUp"},initialize:function(){this.listenContextMenu(),this.render(),this.attach()},listenContextMenu:function(){var e=this;l(window).on("contextmenu",(function(t){return e.active&&!e.isOverEl(e.$el,t)?(e.closeMenu(),e.active=!1,t.preventDefault(),!1):!!e.active||(e.active=!1,e.trigger("activate_context",t,e),void(e.active&&(t.preventDefault(),e.openMenu({left:t.pageX,top:t.pageY}))))}))},render:function(){this.setElement(this.wrapperTemplate())},attach:function(){this.$el.appendTo("body")},openMenu:function(e){this.trigger("open_menu"),l(window).on("keyup",{menu:this},this.keyboardListen),l(window).on("click",{menu:this},this.clickOutsideListen),this.$el.css("max-height",l(window).height()-20),e.left+this.$el.outerWidth()+10>=l(window).width()&&(e.left=l(window).width()-this.$el.outerWidth()-10),e.left<=0&&(e.left=10),e.top+this.$el.outerHeight()-l(window).scrollTop()+10>=l(window).height()&&(e.top=l(window).height()+l(window).scrollTop()-this.$el.outerHeight()-10),e.left<=0&&(e.left=10),this.$el.css({left:e.left+1,top:e.top+1}).show(),this.$(".so-search-wrapper input").focus()},closeMenu:function(){this.trigger("close_menu"),l(window).off("keyup",this.keyboardListen),l(window).off("click",this.clickOutsideListen),this.active=!1,this.$el.empty().hide()},keyboardListen:function(e){var t=e.data.menu;switch(e.which){case 27:t.closeMenu()}},clickOutsideListen:function(e){var t=e.data.menu;3!==e.which&&t.$el.is(":visible")&&!t.isOverEl(t.$el,e)&&t.closeMenu()},addSection:function(e,t,i,s){var o=this;t=_.extend({display:5,defaultDisplay:!1,search:!0,sectionTitle:"",searchPlaceholder:"",titleKey:"title"},t);var n=l(this.sectionTemplate({settings:t,items:i})).attr("id","panels-menu-section-"+e);this.$el.append(n),n.find(".so-item:not(.so-confirm)").click((function(){var e=l(this);s(e.data("key")),o.closeMenu()})),n.find(".so-item.so-confirm").click((function(){var e=l(this);if(e.hasClass("so-confirming"))return s(e.data("key")),void o.closeMenu();e.data("original-text",e.html()).addClass("so-confirming").html('<span class="dashicons dashicons-yes"></span> '+panelsOptions.loc.dropdown_confirm),setTimeout((function(){e.removeClass("so-confirming"),e.html(e.data("original-text"))}),2500)})),n.data("settings",t).find(".so-search-wrapper input").trigger("keyup"),this.active=!0},hasSection:function(e){return this.$el.find("#panels-menu-section-"+e).length>0},searchKeyUp:function(e){var t=l(e.currentTarget),i=t.closest(".so-section"),s=i.data("settings");if(38===e.which||40===e.which){var o=i.find("ul li:visible"),n=o.filter(".so-active").eq(0);if(n.length){o.removeClass("so-active");var a=o.index(n);38===e.which?n=a-1<0?o.last():o.eq(a-1):40===e.which&&(n=a+1>=o.length?o.first():o.eq(a+1))}else 38===e.which?n=o.last():40===e.which&&(n=o.first());return n.addClass("so-active"),!1}if(13===e.which)return 1===i.find("ul li:visible").length?(i.find("ul li:visible").trigger("click"),!1):(i.find("ul li.so-active:visible").trigger("click"),!1);if(""===t.val())if(s.defaultDisplay){i.find(".so-item").hide();for(var r=0;r<s.defaultDisplay.length;r++)i.find('.so-item[data-key="'+s.defaultDisplay[r]+'"]').show()}else i.find(".so-item").show();else i.find(".so-item").hide().each((function(){var e=l(this);-1!==e.html().toLowerCase().indexOf(t.val().toLowerCase())&&e.show()}));i.find(".so-item:visible:gt("+(s.display-1)+")").hide(),0===i.find(".so-item:visible").length&&""!==t.val()?i.find(".so-no-results").show():i.find(".so-no-results").hide()},isOverEl:function(e,t){var i=[[e.offset().left,e.offset().top],[e.offset().left+e.outerWidth(),e.offset().top+e.outerHeight()]];return t.pageX>=i[0][0]&&t.pageX<=i[1][0]&&t.pageY>=i[0][1]&&t.pageY<=i[1][1]}})},{}],24:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({config:{},template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder").html())),dialogs:{},rowsSortable:null,dataField:!1,currentData:"",contentPreview:"",attachedToEditor:!1,attachedVisible:!1,liveEditor:void 0,menu:!1,activeCell:null,events:{"click .so-tool-button.so-widget-add":"displayAddWidgetDialog","click .so-tool-button.so-row-add":"displayAddRowDialog","click .so-tool-button.so-prebuilt-add":"displayAddPrebuiltDialog","click .so-tool-button.so-history":"displayHistoryDialog","click .so-tool-button.so-live-editor":"displayLiveEditor"},rows:null,initialize:function(e){var t=this;return this.config=_.extend({loadLiveEditor:!1,builderSupports:{}},e.config),this.config.builderSupports=_.extend({addRow:!0,editRow:!0,deleteRow:!0,moveRow:!0,addWidget:!0,editWidget:!0,deleteWidget:!0,moveWidget:!0,prebuilt:!0,history:!0,liveEditor:!0,revertToEditor:!0},this.config.builderSupports),e.config.loadLiveEditor&&this.on("builder_live_editor_added",(function(){this.displayLiveEditor()})),this.dialogs={widgets:new s.dialog.widgets,row:new s.dialog.row,prebuilt:new s.dialog.prebuilt},_.each(this.dialogs,(function(e,i,s){s[i].setBuilder(t)})),this.dialogs.row.setRowDialogType("create"),this.listenTo(this.model.get("rows"),"add",this.onAddRow),l(window).resize((function(e){e.target===window&&t.trigger("builder_resize")})),this.listenTo(this.model,"change:data load_panels_data",this.storeModelData),this.listenTo(this.model,"change:data load_panels_data",this.toggleWelcomeDisplay),this.on("builder_attached_to_editor",this.handleContentChange,this),this.on("content_change",this.handleContentChange,this),this.on("display_builder",this.handleDisplayBuilder,this),this.on("hide_builder",this.handleHideBuilder,this),this.on("builder_rendered builder_resize",this.handleBuilderSizing,this),this.on("display_builder",this.wrapEditorExpandAdjust,this),this.menu=new s.utils.menu({}),this.listenTo(this.menu,"activate_context",this.activateContextMenu),this.config.loadOnAttach&&this.on("builder_attached_to_editor",(function(){this.displayAttachedBuilder({confirm:!1})}),this),this},render:function(){return this.setElement(this.template()),this.$el.attr("id","siteorigin-panels-builder-"+this.cid).addClass("so-builder-container"),this.trigger("builder_rendered"),this},attach:function(e){(e=_.extend({container:!1,dialog:!1},e)).dialog?(this.dialog=new s.dialog.builder,this.dialog.builder=this):(this.$el.appendTo(e.container),this.metabox=e.container.closest(".postbox"),this.initSortable(),this.trigger("attached_to_container",e.container)),this.trigger("builder_attached"),this.supports("liveEditor")&&this.addLiveEditor(),this.supports("history")&&this.addHistoryBrowser();var t=this.$(".so-builder-toolbar"),i=this.$(".so-panels-welcome-message"),l=panelsOptions.loc.welcomeMessage,o=[];this.supports("addWidget")?o.push(l.addWidgetButton):t.find(".so-widget-add").hide(),this.supports("addRow")?o.push(l.addRowButton):t.find(".so-row-add").hide(),this.supports("prebuilt")?o.push(l.addPrebuiltButton):t.find(".so-prebuilt-add").hide();var n="";3===o.length?n=l.threeEnabled:2===o.length?n=l.twoEnabled:1===o.length?n=l.oneEnabled:0===o.length&&(n=l.addingDisabled);var a=_.template(s.helpers.utils.processTemplate(n))({items:o})+" "+l.docsMessage;return i.find(".so-message-wrapper").html(a),this},attachToEditor:function(){if("tinyMCE"!==this.config.editorType)return this;this.attachedToEditor=!0;var e=this.metabox,t=this;l("#wp-content-wrap .wp-editor-tabs").find(".wp-switch-editor").click((function(e){e.preventDefault(),l("#wp-content-editor-container").show(),l("#wp-content-wrap").removeClass("panels-active"),l("#content-resize-handle").show(),t.trigger("hide_builder")})).end().append(l('<button type="button" id="content-panels" class="hide-if-no-js wp-switch-editor switch-panels">'+e.find("h2.hndle").html()+"</button>").click((function(e){t.displayAttachedBuilder({confirm:!0})&&e.preventDefault()}))),this.supports("revertToEditor")&&e.find(".so-switch-to-standard").click((function(i){i.preventDefault(),confirm(panelsOptions.loc.confirm_stop_builder)&&(t.addHistoryEntry("back_to_editor"),t.model.loadPanelsData(!1),l("#wp-content-wrap").show(),e.hide(),l(window).resize(),t.attachedVisible=!1,t.trigger("hide_builder"))})).show(),e.insertAfter("#wp-content-wrap").hide().addClass("attached-to-editor");var i=this.model.get("data");_.isEmpty(i.widgets)&&_.isEmpty(i.grids)&&this.supports("revertToEditor")||this.displayAttachedBuilder({confirm:!1});var s=function(){var e=t.$(".so-builder-toolbar");if(t.$el.hasClass("so-display-narrow"))return e.css({top:0,left:0,width:"100%",position:"absolute"}),void t.$el.css("padding-top",e.outerHeight());var i=l(window).scrollTop()-t.$el.offset().top;"fixed"===l("#wpadminbar").css("position")&&(i+=l("#wpadminbar").outerHeight());var s=0,o=t.$el.outerHeight()-e.outerHeight()+20;i>s&&i<o?"fixed"!==e.css("position")&&e.css({top:l("#wpadminbar").outerHeight(),left:t.$el.offset().left,width:t.$el.outerWidth(),position:"fixed"}):e.css({top:Math.min(Math.max(i,0),t.$el.outerHeight()-e.outerHeight()+20),left:0,width:"100%",position:"absolute"}),t.$el.css("padding-top",e.outerHeight())};return this.on("builder_resize",s,this),l(document).scroll(s),s(),this.trigger("builder_attached_to_editor"),this},displayAttachedBuilder:function(e){if((e=_.extend({confirm:!0},e)).confirm){var t="undefined"!=typeof tinyMCE&&tinyMCE.get("content");if(""!==(t&&_.isFunction(t.getContent)?t.getContent():l("textarea#content").val())&&!confirm(panelsOptions.loc.confirm_use_builder))return!1}return l("#wp-content-wrap").hide(),l("#editor-expand-toggle").on("change.editor-expand",(function(){l(this).prop("checked")||l("#wp-content-wrap").hide()})),this.metabox.show().find("> .inside").show(),l(window).resize(),l(document).scroll(),this.attachedVisible=!0,this.trigger("display_builder"),!0},initSortable:function(){if(!this.supports("moveRow"))return this;var e=this,t=e.$el.attr("id");return this.rowsSortable=this.$(".so-rows-container").sortable({appendTo:"#wpwrap",items:".so-row-container",handle:".so-row-move",connectWith:"#"+t+".so-rows-container,.block-editor .so-rows-container",axis:"y",tolerance:"pointer",scroll:!1,remove:function(t,i){e.model.get("rows").remove(l(i.item).data("view").model,{silent:!0}),e.model.refreshPanelsData()},receive:function(t,i){e.model.get("rows").add(l(i.item).data("view").model,{silent:!0,at:l(i.item).index()}),e.model.refreshPanelsData()},stop:function(t,i){var s=l(i.item),o=s.data("view"),n=e.model.get("rows");n.get(o.model)&&(e.addHistoryEntry("row_moved"),n.remove(o.model,{silent:!0}),n.add(o.model,{silent:!0,at:s.index()}),o.trigger("move",s.index()),e.model.refreshPanelsData())}}),this},refreshSortable:function(){_.isNull(this.rowsSortable)||this.rowsSortable.sortable("refresh")},setDataField:function(e,t){if(t=_.extend({load:!0},t),this.dataField=e,this.dataField.data("builder",this),t.load&&""!==e.val()){var i=this.dataField.val();try{i=JSON.parse(i)}catch(e){console.log("Failed to parse Page Builder layout data from supplied data field."),i={}}this.setData(i)}return this},setData:function(e){this.model.loadPanelsData(e),this.currentData=e,this.toggleWelcomeDisplay()},getData:function(){return this.model.get("data")},storeModelData:function(){var e=JSON.stringify(this.model.get("data"));l(this.dataField).val()!==e&&(l(this.dataField).val(e),l(this.dataField).trigger("change"),this.trigger("content_change"))},onAddRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.row({model:e});l.builder=this,l.render(),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".so-rows-container")):l.$el.insertAfter(this.$(".so-rows-container .so-row-container").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),l.resize(),this.trigger("row_added")},displayAddWidgetDialog:function(){this.dialogs.widgets.openDialog()},displayAddRowDialog:function(){var e=new s.model.row,t=new s.collection.cells([{weight:.5},{weight:.5}]);t.each((function(t){t.row=e})),e.set("cells",t),e.builder=this.model,this.dialogs.row.setRowModel(e),this.dialogs.row.openDialog()},displayAddPrebuiltDialog:function(){this.dialogs.prebuilt.openDialog()},displayHistoryDialog:function(){this.dialogs.history.openDialog()},pasteRowHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.addHistoryEntry("row_pasted"),e.builder=this.model,this.model.get("rows").add(e,{at:this.model.get("rows").indexOf(this.model)+1}),this.model.refreshPanelsData())},getActiveCell:function(e){if(e=_.extend({createCell:!0},e),!this.model.get("rows").length){if(!e.createCell)return null;this.model.addRow({},[{weight:1}],{noAnimate:!0})}var t=this.activeCell;return _.isEmpty(t)||-1===this.model.get("rows").indexOf(t.model.row)?this.model.get("rows").last().get("cells").first():t.model},addLiveEditor:function(){return _.isEmpty(this.config.liveEditorPreview)?this:(this.liveEditor=new s.view.liveEditor({builder:this,previewUrl:this.config.liveEditorPreview}),this.liveEditor.hasPreviewUrl()&&this.$(".so-builder-toolbar .so-live-editor").show(),this.trigger("builder_live_editor_added"),this)},displayLiveEditor:function(){_.isUndefined(this.liveEditor)||this.liveEditor.open()},addHistoryBrowser:function(){if(_.isEmpty(this.config.liveEditorPreview))return this;this.dialogs.history=new s.dialog.history,this.dialogs.history.builder=this,this.dialogs.history.entries.builder=this.model,this.dialogs.history.setRevertEntry(this.model),this.$(".so-builder-toolbar .so-history").show()},addHistoryEntry:function(e,t){_.isUndefined(t)&&(t=null),_.isUndefined(this.dialogs.history)||this.dialogs.history.entries.addEntry(e,t)},supports:function(e){return"rowAction"===e?this.supports("addRow")||this.supports("editRow")||this.supports("deleteRow"):"widgetAction"===e?this.supports("addWidget")||this.supports("editWidget")||this.supports("deleteWidget"):!_.isUndefined(this.config.builderSupports[e])&&this.config.builderSupports[e]},handleContentChange:function(){if(panelsOptions.copy_content&&(s.helpers.editor.isBlockEditor()||s.helpers.editor.isClassicEditor(this))){var e=this.model.getPanelsData();_.isEmpty(e.widgets)||l.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:this.config.postId},function(e){this.contentPreview&&""!==e.post_content&&this.updateEditorContent(e.post_content),""!==e.preview&&(this.contentPreview=e.preview)}.bind(this))}},updateEditorContent:function(e){if("tinyMCE"!==this.config.editorType||"undefined"==typeof tinyMCE||_.isNull(tinyMCE.get("content"))){l(this.config.editorId).val(e).trigger("change").trigger("keyup")}else{var t=tinyMCE.get("content");t.setContent(e),t.fire("change"),t.fire("keyup")}this.triggerSeoChange()},triggerSeoChange:function(){"undefined"==typeof YoastSEO||_.isNull(YoastSEO)||_.isNull(YoastSEO.app.refresh)||YoastSEO.app.refresh(),"undefined"==typeof rankMathEditor||_.isNull(rankMathEditor)||_.isNull(rankMathEditor.refresh)||rankMathEditor.refresh("content")},handleDisplayBuilder:function(){var e="undefined"!=typeof tinyMCE&&tinyMCE.get("content"),t=e&&_.isFunction(e.getContent)?e.getContent():l("textarea#content").val();if((_.isEmpty(this.model.get("data"))||_.isEmpty(this.model.get("data").widgets)&&_.isEmpty(this.model.get("data").grids))&&""!==t){var i=panelsOptions.text_widget;if(_.isEmpty(i))return;this.model.loadPanelsData(this.model.getPanelsDataFromHtml(t,i)),this.model.trigger("change"),this.model.trigger("change:data")}l("#post-status-info").addClass("for-siteorigin-panels")},handleHideBuilder:function(){l("#post-status-info").show().removeClass("for-siteorigin-panels")},wrapEditorExpandAdjust:function(){try{for(var e,t=(l.hasData(window)&&l._data(window)).events.scroll,i=0;i<t.length;i++)if("editor-expand"===t[i].namespace){e=t[i],l(window).unbind("scroll",e.handler),l(window).bind("scroll",function(t){this.attachedVisible||e.handler(t)}.bind(this));break}}catch(e){return}},handleBuilderSizing:function(){var e=this.$el.width();return e?(e<575?this.$el.addClass("so-display-narrow"):this.$el.removeClass("so-display-narrow"),this):this},setDialogParents:function(e,t){_.each(this.dialogs,(function(i,s,l){l[s].setParent(e,t)})),this.on("add_dialog",(function(i){i.setParent(e,t)}),this)},toggleWelcomeDisplay:function(){this.model.get("rows").isEmpty()?this.$(".so-panels-welcome-message").show():this.$(".so-panels-welcome-message").hide()},activateContextMenu:function(e,t){if(l.contains(this.$el.get(0),e.target)){var i=l([]).add(this.$(".so-panels-welcome-message:visible")).add(this.$(".so-rows-container > .so-row-container")).add(this.$(".so-cells > .cell")).add(this.$(".cell-wrapper > .so-widget")).filter((function(i){return t.isOverEl(l(this),e)})),s=i.last().data("view");void 0!==s&&void 0!==s.buildContextualMenu?s.buildContextualMenu(e,t):i.last().hasClass("so-panels-welcome-message")&&this.buildContextualMenu(e,t)}},buildContextualMenu:function(e,t){var i={};this.supports("addRow")&&(i.add_row={title:panelsOptions.loc.contextual.add_row}),s.helpers.clipboard.canCopyPaste()&&s.helpers.clipboard.isModel("row-model")&&this.supports("addRow")&&(i.paste_row={title:panelsOptions.loc.contextual.row_paste}),_.isEmpty(i)||t.addSection("builder-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},i,function(e){switch(e){case"add_row":this.displayAddRowDialog();break;case"paste_row":this.pasteRowHandler()}}.bind(this))}})},{}],25:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-cell").html())),events:{"click .cell-wrapper":"handleCellClick"},row:null,widgetSortable:null,initialize:function(){this.listenTo(this.model.get("widgets"),"add",this.onAddWidget)},render:function(){var e={weight:this.model.get("weight"),totalWeight:this.row.model.get("cells").totalWeight()};this.setElement(this.template(e)),this.$el.data("view",this);var t=this;return this.model.get("widgets").each((function(e){var i=new s.view.widget({model:e});i.cell=t,i.render(),i.$el.appendTo(t.$(".widgets-container"))})),this.initSortable(),this.initResizable(),this},initSortable:function(){if(!this.row.builder.supports("moveWidget"))return this;var e=this,t=e.row.builder,i=t.$el.attr("id"),s=t.model;return this.widgetSortable=this.$(".widgets-container").sortable({placeholder:"so-widget-sortable-highlight",connectWith:"#"+i+" .so-cells .cell .widgets-container,.block-editor .so-cells .cell .widgets-container",tolerance:"pointer",scroll:!1,over:function(t,i){e.row.builder.trigger("widget_sortable_move")},remove:function(t,i){e.model.get("widgets").remove(l(i.item).data("view").model,{silent:!0}),s.refreshPanelsData()},receive:function(t,i){var o=l(i.item).data("view");o.cell=e;var n=o.model;n.cell=e.model,e.model.get("widgets").add(n,{silent:!0,at:l(i.item).index()}),s.refreshPanelsData()},stop:function(t,i){var o=l(i.item),n=o.data("view"),a=o.closest(".cell").data("view");e.model.get("widgets").get(n.model)&&(e.row.builder.addHistoryEntry("widget_moved"),n.model.moveToCell(a.model,{},o.index()),n.cell=a,s.refreshPanelsData())},helper:function(e,t){var i=t.clone().css({width:t.outerWidth(),"z-index":1e4,position:"fixed"}).addClass("widget-being-dragged").appendTo("body");return t.outerWidth()>720&&i.animate({"margin-left":e.pageX-t.offset().left-240,width:480},"fast"),i}}),this},refreshSortable:function(){_.isNull(this.widgetSortable)||this.widgetSortable.sortable("refresh")},initResizable:function(){if(!this.row.builder.supports("editRow"))return this;var e,t=this.$(".resize-handle").css("position","absolute"),i=this.row.$el,s=this;return t.draggable({axis:"x",containment:i,start:function(t,i){if(e=s.$el.prev().data("view"),!_.isUndefined(e)){var o=s.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:s.$el.outerWidth(),left:5,height:s.$el.outerHeight()});o.find(".resize-handle").remove();var n=e.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:e.$el.outerWidth(),right:5,height:e.$el.outerHeight()});n.find(".resize-handle").remove(),l(this).data({newCellClone:o,prevCellClone:n})}},drag:function(i,o){var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;l(this).data("newCellClone").css("width",n*a).find(".preview-cell-weight").html(Math.round(1e3*a)/10),l(this).data("prevCellClone").css("width",n*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10)},stop:function(i,o){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove();var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;a>.02&&r>.02&&(s.row.builder.addHistoryEntry("cell_resized"),s.model.set("weight",a),e.model.set("weight",r),s.row.resize()),o.helper.css("left",-t.outerWidth()/2),s.row.builder.model.refreshPanelsData()}}),this},onAddWidget:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.widget({model:e});l.cell=this,_.isUndefined(e.isDuplicate)&&(e.isDuplicate=!1),l.render({loadForm:e.isDuplicate}),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".widgets-container")):l.$el.insertAfter(this.$(".widgets-container .so-widget").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),this.row.resize(),this.row.builder.trigger("widget_added",l)},handleCellClick:function(e){this.row.builder.$el.find(".so-cells .cell").removeClass("cell-selected"),this.row.builder.activeCell!==this||this.model.get("widgets").length?(this.$el.addClass("cell-selected"),this.row.builder.activeCell=this):this.row.builder.activeCell=null},pasteHandler:function(){var e=s.helpers.clipboard.getModel("widget-model");!_.isEmpty(e)&&e instanceof s.model.widget&&(this.row.builder.addHistoryEntry("widget_pasted"),e.cell=this.model,this.model.get("widgets").add(e),this.row.builder.model.refreshPanelsData())},buildContextualMenu:function(e,t){var i=this;t.hasSection("add-widget-below")||t.addSection("add-widget-cell",{sectionTitle:panelsOptions.loc.contextual.add_widget_cell,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,(function(e){i.row.builder.trigger("before_user_adds_widget"),i.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=i.model,t.cell.get("widgets").add(t),i.row.builder.model.refreshPanelsData(),i.row.builder.trigger("after_user_adds_widget",t)}));var l={};this.row.builder.supports("addWidget")&&s.helpers.clipboard.isModel("widget-model")&&(l.paste={title:panelsOptions.loc.contextual.cell_paste_widget}),_.isEmpty(l)||t.addSection("cell-actions",{sectionTitle:panelsOptions.loc.contextual.cell_actions,search:!1},l,function(e){switch(e){case"paste":this.pasteHandler()}this.row.builder.model.refreshPanelsData()}.bind(this)),this.row.buildContextualMenu(e,t)}})},{}],26:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({dialogTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog").html())),dialogTabTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-tab").html())),tabbed:!1,rendered:!1,builder:!1,className:"so-panels-dialog-wrapper",dialogClass:"",dialogIcon:"",parentDialog:!1,dialogOpen:!1,editableLabel:!1,events:{"click .so-close":"closeDialog","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext"},initialize:function(){this.once("open_dialog",this.render),this.once("open_dialog",this.attach),this.once("open_dialog",this.setDialogClass),this.trigger("initialize_dialog",this),_.isUndefined(this.initializeDialog)||this.initializeDialog(),_.bindAll(this,"initSidebars","hasSidebar","onResize","toggleLeftSideBar","toggleRightSideBar")},getNextDialog:function(){return null},getPrevDialog:function(){return null},setDialogClass:function(){""!==this.dialogClass&&this.$(".so-panels-dialog").addClass(this.dialogClass)},setBuilder:function(e){return this.builder=e,e.trigger("add_dialog",this,this.builder),this},attach:function(){return this.$el.appendTo("body"),this},parseDialogContent:function(e,t){t=_.extend({cid:this.cid},t);var i=l(_.template(s.helpers.utils.processTemplate(e))(t)),o={title:i.find(".title").html(),buttons:i.find(".buttons").html(),content:i.find(".content").html()};return i.has(".left-sidebar")&&(o.left_sidebar=i.find(".left-sidebar").html()),i.has(".right-sidebar")&&(o.right_sidebar=i.find(".right-sidebar").html()),o},renderDialog:function(e){if(e=_.extend({editableLabel:this.editableLabel,dialogIcon:this.dialogIcon},e),this.$el.html(this.dialogTemplate(e)).hide(),this.$el.data("view",this),this.$el.addClass("so-panels-dialog-wrapper"),!1!==this.parentDialog){var t=l('<h3 class="so-parent-link"></h3>').html(this.parentDialog.text+'<div class="so-separator"></div>');t.click(function(e){e.preventDefault(),this.closeDialog(),this.parentDialog.dialog.openDialog()}.bind(this)),this.$(".so-title-bar .so-title").before(t)}return this.$(".so-title-bar .so-title-editable").length&&this.initEditableLabel(),setTimeout(this.initSidebars,1),this},initSidebars:function(){var e=this.$(".so-show-left-sidebar").hide(),t=this.$(".so-show-right-sidebar").hide(),i=this.hasSidebar("left"),s=this.hasSidebar("right");(i||s)&&(l(window).on("resize",this.onResize),i&&(e.show(),e.on("click",this.toggleLeftSideBar)),s&&(t.show(),t.on("click",this.toggleRightSideBar))),this.onResize()},initTabs:function(){var e=this.$(".so-sidebar-tabs li a");if(0===e.length)return this;var t=this;return e.click((function(e){e.preventDefault();var i=l(this);t.$(".so-sidebar-tabs li").removeClass("tab-active"),t.$(".so-content .so-content-tabs > *").hide(),i.parent().addClass("tab-active");var s=i.attr("href");if(!_.isUndefined(s)&&"#"===s.charAt(0)){var o=s.split("#")[1];t.$(".so-content .so-content-tabs .tab-"+o).show()}t.trigger("tab_click",i)})),this.$(".so-sidebar-tabs li a").first().click(),this},initToolbar:function(){this.$(".so-toolbar .so-buttons .so-toolbar-button").click(function(e){e.preventDefault(),this.trigger("button_click",l(e.currentTarget))}.bind(this)),this.$(".so-toolbar .so-buttons .so-dropdown-button").click(function(e){e.preventDefault();var t=l(e.currentTarget).siblings(".so-dropdown-links-wrapper");t.is(".hidden")?t.removeClass("hidden"):t.addClass("hidden")}.bind(this)),l("html").click(function(e){this.$(".so-dropdown-links-wrapper").not(".hidden").each((function(t,i){var s=l(i),o=l(e.target);0!==o.length&&(o.is(".so-needs-confirm")&&!o.is(".so-confirmed")||o.is(".so-dropdown-button"))||s.addClass("hidden")}))}.bind(this))},initEditableLabel:function(){var e=this.$(".so-title-bar .so-title-editable");e.keypress((function(t){var i="keypress"===t.type&&13===t.keyCode;if(i){var s=l(":tabbable"),o=s.index(e);s.eq(o+1).focus(),window.getSelection().removeAllRanges()}return!i})).blur(function(){var t=e.text().replace(/^\s+|\s+$/gm,"");t!==e.data("original-value").replace(/^\s+|\s+$/gm,"")&&(e.text(t),this.trigger("edit_label",t))}.bind(this)),e.focus((function(){e.data("original-value",e.text()),s.helpers.utils.selectElementContents(this)}))},setupDialog:function(){this.openDialog(),this.closeDialog()},refreshDialogNav:function(){this.$(".so-title-bar .so-nav").show().removeClass("so-disabled");var e=this.getNextDialog(),t=this.$(".so-title-bar .so-next"),i=this.getPrevDialog(),s=this.$(".so-title-bar .so-previous");null===e?t.hide():!1===e&&t.addClass("so-disabled"),null===i?s.hide():!1===i&&s.addClass("so-disabled")},openDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("open_dialog"),this.dialogOpen=!0,this.refreshDialogNav(),s.helpers.pageScroll.lock(),this.onResize(),this.$el.show(),e.silent||(this.trigger("open_dialog_complete"),this.builder.trigger("open_dialog",this),l(document).trigger("open_dialog",this))},closeDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("close_dialog"),this.dialogOpen=!1,this.$el.hide(),s.helpers.pageScroll.unlock(),e.silent||(this.trigger("close_dialog_complete"),this.builder.trigger("close_dialog",this))},navToPrevious:function(){this.closeDialog();var e=this.getPrevDialog();null!==e&&!1!==e&&e.openDialog()},navToNext:function(){this.closeDialog();var e=this.getNextDialog();null!==e&&!1!==e&&e.openDialog()},getFormValues:function(e){_.isUndefined(e)&&(e=".so-content");var t,i=this.$(e),s={};return i.find("[name]").each((function(){var e=l(this);try{var i=/([A-Za-z_]+)\[(.*)\]/.exec(e.attr("name"));if(_.isEmpty(i))return!0;_.isUndefined(i[2])?t=e.attr("name"):(t=i[2].split("][")).unshift(i[1]),t=t.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var o=s,n=null,a=!!_.isString(e.attr("type"))&&e.attr("type").toLowerCase();if("checkbox"===a)n=e.is(":checked")?""===e.val()||e.val():null;else if("radio"===a){if(!e.is(":checked"))return;n=e.val()}else if("SELECT"===e.prop("tagName")){var r=e.find("option:selected");1===r.length?n=e.find("option:selected").val():r.length>1&&(n=_.map(e.find("option:selected"),(function(e,t){return l(e).val()})))}else n=e.val();if(!_.isUndefined(e.data("panels-filter")))switch(e.data("panels-filter")){case"json_parse":try{n=JSON.parse(n)}catch(e){n=""}}if(null!==n)for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?o.push(n):o[t[d]]=n:(_.isUndefined(o[t[d]])&&(""===t[d+1]?o[t[d]]=[]:o[t[d]]={}),o=o[t[d]])}catch(t){console.log("Field ["+e.attr("name")+"] could not be processed and was skipped - "+t.message)}})),s},setStatusMessage:function(e,t,i){var s=i?'<span class="dashicons dashicons-warning"></span>'+e:e;this.$(".so-toolbar .so-status").html(s),!_.isUndefined(t)&&t?this.$(".so-toolbar .so-status").addClass("so-panels-loading"):this.$(".so-toolbar .so-status").removeClass("so-panels-loading")},setParent:function(e,t){this.parentDialog={text:e,dialog:t}},onResize:function(){var e=window.matchMedia("(max-width: 980px)");["left","right"].forEach(function(t){var i=this.$(".so-"+t+"-sidebar"),s=this.$(".so-show-"+t+"-sidebar");this.hasSidebar(t)?(s.hide(),e.matches?(s.show(),s.closest(".so-title-bar").addClass("so-has-"+t+"-button"),i.hide(),i.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-"+t+"-sidebar")):(s.hide(),s.closest(".so-title-bar").removeClass("so-has-"+t+"-button"),i.show(),i.closest(".so-panels-dialog").addClass("so-panels-dialog-has-"+t+"-sidebar"))):(i.hide(),s.hide())}.bind(this))},hasSidebar:function(e){return this.$(".so-"+e+"-sidebar").children().length>0},toggleLeftSideBar:function(){this.toggleSidebar("left")},toggleRightSideBar:function(){this.toggleSidebar("right")},toggleSidebar:function(e){var t=this.$(".so-"+e+"-sidebar");t.is(":visible")?t.hide():t.show()}})},{}],27:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-live-editor").html())),previewScrollTop:0,loadTimes:[],previewFrameId:1,previewUrl:null,previewIframe:null,events:{"click .live-editor-close":"close","click .live-editor-save":"closeAndSave","click .live-editor-collapse":"collapse","click .live-editor-mode":"mobileToggle"},initialize:function(e){e=_.extend({builder:!1,previewUrl:!1},e),_.isEmpty(e.previewUrl)&&(e.previewUrl=panelsOptions.ajaxurl+"&action=so_panels_live_editor_preview"),this.builder=e.builder,this.previewUrl=e.previewUrl,this.listenTo(this.builder.model,"refresh_panels_data",this.handleRefreshData),this.listenTo(this.builder.model,"load_panels_data",this.handleLoadData)},render:function(){if(this.setElement(this.template()),this.$el.hide(),l("#submitdiv #save-post").length>0){var e=this.$el.find(".live-editor-save");e.text(e.data("save"))}var t=!1;l(document).mousedown((function(){t=!0})).mouseup((function(){t=!1}));var i=this;return this.$el.on("mouseenter",".so-widget-wrapper",(function(){var e=l(this).data("live-editor-preview-widget");t||void 0===e||!e.length||i.$(".so-preview-overlay").is(":visible")||(i.highlightElement(e),i.scrollToElement(e))})),this.$el.on("mouseleave",".so-widget-wrapper",function(){this.resetHighlights()}.bind(this)),this.listenTo(this.builder,"open_dialog",(function(){this.resetHighlights()})),this},attach:function(){this.$el.appendTo("body")},open:function(){if(""===this.$el.html()&&this.render(),0===this.$el.closest("body").length&&this.attach(),s.helpers.pageScroll.lock(),this.$el.is(":visible"))return this;if(this.$el.show(),this.refreshPreview(this.builder.model.getPanelsData()),this.originalContainer=this.builder.$el.parent(),this.builder.$el.appendTo(this.$(".so-live-editor-builder")),this.builder.$(".so-tool-button.so-live-editor").hide(),this.builder.trigger("builder_resize"),"auto-draft"===l("#original_post_status").val()&&!this.autoSaved){var e=this;wp.autosave&&(""===l('#title[name="post_title"]').val()&&l('#title[name="post_title"]').val(panelsOptions.loc.draft).trigger("keydown"),l(document).one("heartbeat-tick.autosave",(function(){e.autoSaved=!0,e.refreshPreview(e.builder.model.getPanelsData())})),wp.autosave.server.triggerSave())}},close:function(){if(!this.$el.is(":visible"))return this;this.$el.hide(),s.helpers.pageScroll.unlock(),this.builder.$el.appendTo(this.originalContainer),this.builder.$(".so-tool-button.so-live-editor").show(),this.builder.trigger("builder_resize")},closeAndSave:function(){this.close(),l('#submitdiv input[type="submit"][name="save"]').click()},collapse:function(){this.$el.toggleClass("so-collapsed")},highlightElement:function(e){_.isUndefined(this.resetHighlightTimeout)||clearTimeout(this.resetHighlightTimeout),this.previewIframe.contents().find("body").find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return 0===l(this).parents(".so-panel").length})).not(e).addClass("so-panels-faded"),e.removeClass("so-panels-faded").addClass("so-panels-highlighted")},resetHighlights:function(){var e=this.previewIframe.contents().find("body");this.resetHighlightTimeout=setTimeout((function(){e.find(".panel-grid .panel-grid-cell .so-panel").removeClass("so-panels-faded so-panels-highlighted")}),100)},scrollToElement:function(e){this.$(".so-preview iframe")[0].contentWindow.liveEditorScrollTo(e)},handleRefreshData:function(e){if(!this.$el.is(":visible"))return this;this.refreshPreview(e)},handleLoadData:function(){if(!this.$el.is(":visible"))return this;this.refreshPreview(this.builder.model.getPanelsData())},refreshPreview:function(e){var t=this.loadTimes.length?_.reduce(this.loadTimes,(function(e,t){return e+t}),0)/this.loadTimes.length:1e3;_.isNull(this.previewIframe)||this.$(".so-preview-overlay").is(":visible")||(this.previewScrollTop=this.previewIframe.contents().scrollTop()),this.$(".so-preview-overlay").show(),this.$(".so-preview-overlay .so-loading-bar").clearQueue().css("width","0%").animate({width:"100%"},parseInt(t)+100),this.postToIframe({live_editor_panels_data:JSON.stringify(e),live_editor_post_ID:this.builder.config.postId},this.previewUrl,this.$(".so-preview")),this.previewIframe.data("load-start",(new Date).getTime())},postToIframe:function(e,t,i){_.isNull(this.previewIframe)||this.previewIframe.remove();var s="siteorigin-panels-live-preview-"+this.previewFrameId;this.previewIframe=l('<iframe src="'+t+'" />').attr({id:s,name:s}).appendTo(i),this.setupPreviewFrame(this.previewIframe);var o=l('<form id="soPostToPreviewFrame" method="post" />').attr({id:s,target:this.previewIframe.attr("id"),action:t}).appendTo("body");return l.each(e,(function(e,t){l('<input type="hidden" />').attr({name:e,value:t}).appendTo(o)})),o.submit().remove(),this.previewFrameId++,this.previewIframe},setupPreviewFrame:function(e){var t=this;e.data("iframeready",!1).on("iframeready",(function(){var e=l(this),i=e.contents();if(!e.data("iframeready")){e.data("iframeready",!0),void 0!==e.data("load-start")&&(t.loadTimes.unshift((new Date).getTime()-e.data("load-start")),_.isEmpty(t.loadTimes)||(t.loadTimes=t.loadTimes.slice(0,4))),l(".live-editor-mode.so-active").length&&(l(".so-panels-live-editor .so-preview iframe").css("transition","none"),t.mobileToggle()),setTimeout((function(){i.scrollTop(t.previewScrollTop),t.$(".so-preview-overlay").hide(),l(".so-panels-live-editor .so-preview iframe").css("transition","all .2s ease")}),100);var s=i.find("#pl-"+t.builder.config.postId);s.find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return l(this).closest(".panel-layout").is(s)})).each((function(e,i){var s=l(i),o=t.$(".so-live-editor-builder .so-widget-wrapper").eq(s.data("index"));o.data("live-editor-preview-widget",s),s.css({cursor:"pointer"}).mouseenter((function(){o.parent().addClass("so-hovered"),t.highlightElement(s)})).mouseleave((function(){o.parent().removeClass("so-hovered"),t.resetHighlights()})).click((function(e){e.preventDefault(),o.find(".title h4").click()}))})),i.find("a").css({"pointer-events":"none"}).click((function(e){e.preventDefault()}))}})).on("load",(function(){var e=l(this);e.data("iframeready")||e.trigger("iframeready")}))},hasPreviewUrl:function(){return""!==this.$("form.live-editor-form").attr("action")},mobileToggle:function(e){var t=l(void 0!==e?e.currentTarget:".live-editor-mode.so-active");this.$(".live-editor-mode").not(t).removeClass("so-active"),t.addClass("so-active"),this.$el.removeClass("live-editor-desktop-mode live-editor-tablet-mode live-editor-mobile-mode").addClass("live-editor-"+t.data("mode")+"-mode").find("iframe").css("width",t.data("width"))}})},{}],28:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-row").html())),events:{"click .so-row-settings":"editSettingsHandler","click .so-row-duplicate":"duplicateHandler","click .so-row-delete":"confirmedDeleteHandler","click .so-row-color":"rowColorChangeHandler"},builder:null,dialog:null,initialize:function(){var e=this.model.get("cells");this.listenTo(e,"add",this.handleCellAdd),this.listenTo(e,"remove",this.handleCellRemove),this.listenTo(this.model,"reweight_cells",this.resize),this.listenTo(this.model,"destroy",this.onModelDestroy);var t=this;e.each((function(e){t.listenTo(e.get("widgets"),"add",t.resize)})),e.on("add",(function(e){t.listenTo(e.get("widgets"),"add",t.resize)}),this),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(){var e=this.model.has("color_label")?this.model.get("color_label"):1,t=this.model.has("label")?this.model.get("label"):"";this.setElement(this.template({rowColorLabel:e,rowLabel:t})),this.$el.data("view",this);var i=this;return this.model.get("cells").each((function(e){var t=new s.view.cell({model:e});t.row=i,t.render(),t.$el.appendTo(i.$(".so-cells"))})),this.builder.supports("rowAction")?(this.builder.supports("editRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-settings").parent().remove(),this.$el.addClass("so-row-no-edit")),this.builder.supports("addRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-duplicate").parent().remove(),this.$el.addClass("so-row-no-duplicate")),this.builder.supports("deleteRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-delete").parent().remove(),this.$el.addClass("so-row-no-delete"))):(this.$(".so-row-toolbar .so-dropdown-wrapper").remove(),this.$el.addClass("so-row-no-actions")),this.builder.supports("moveRow")||(this.$(".so-row-toolbar .so-row-move").remove(),this.$el.addClass("so-row-no-move")),l.trim(this.$(".so-row-toolbar").html()).length||this.$(".so-row-toolbar").remove(),this.listenTo(this.builder,"widget_sortable_move",this.resize),this.listenTo(this.builder,"builder_resize",this.resize),this.resize(),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},resize:function(e){if(this.$el.is(":visible")){this.$(".so-cells .cell-wrapper").css("min-height",0),this.$(".so-cells .resize-handle").css("height",0);var t=0;this.$(".so-cells .cell").each((function(){t=Math.max(t,l(this).height()),l(this).css("width",100*l(this).data("view").model.get("weight")+"%")})),this.$(".so-cells .cell-wrapper").css("min-height",Math.max(t,63)),this.$(".so-cells .resize-handle").css("height",this.$(".so-cells .cell-wrapper").outerHeight())}},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){this.builder.addHistoryEntry("row_deleted");var e=this;this.$el.fadeOut("normal",(function(){e.model.destroy(),e.builder.model.refreshPanelsData()}))},onLabelChange:function(e,t){0==this.$(".so-row-label").length?this.$(".so-row-toolbar").prepend('<h3 class="so-row-label">'+t+"</h3>"):this.$(".so-row-label").text(t)},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},pasteHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.builder.addHistoryEntry("row_pasted"),e.builder=this.builder.model,this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData())},confirmedDeleteHandler:function(e){var t=l(e.target);if(t.hasClass("dashicons")&&(t=t.parent()),t.hasClass("so-confirmed"))this.visualDestroyModel();else{var i=t.html();t.addClass("so-confirmed").html('<span class="dashicons dashicons-yes"></span>'+panelsOptions.loc.dropdown_confirm),setTimeout((function(){t.removeClass("so-confirmed").html(i)}),2500)}},editSettingsHandler:function(){if(this.builder.supports("editRow"))return null===this.dialog&&(this.dialog=new s.dialog.row,this.dialog.setBuilder(this.builder).setRowModel(this.model),this.dialog.rowView=this),this.dialog.openDialog(),this},deleteHandler:function(){return this.model.destroy(),this},rowColorChangeHandler:function(e){this.$(".so-row-color").removeClass("so-row-color-selected");var t=l(e.target),i=t.data("color-label"),s=this.model.has("color_label")?this.model.get("color_label"):1;t.addClass("so-row-color-selected"),this.$el.removeClass("so-row-color-"+s),this.$el.addClass("so-row-color-"+i),this.model.set("color_label",i)},handleCellAdd:function(e){var t=new s.view.cell({model:e});t.row=this,t.render(),t.$el.appendTo(this.$(".so-cells"))},handleCellRemove:function(e){this.$(".so-cells > .cell").each((function(){var t=l(this).data("view");_.isUndefined(t)||t.model.cid===e.cid&&t.remove()}))},buildContextualMenu:function(e,t){for(var i=[],l=1;l<5;l++)i.push({title:l+" "+panelsOptions.loc.contextual.column});this.builder.supports("addRow")&&t.addSection("add-row",{sectionTitle:panelsOptions.loc.contextual.add_row,search:!1},i,function(e){this.builder.addHistoryEntry("row_added");for(var t=Number(e)+1,i=[],l=0;l<t;l++)i.push({weight:100/t});var o=new s.model.row({collection:this.collection}),n=new s.collection.cells(i);n.each((function(e){e.row=o})),o.setCells(n),o.builder=this.builder.model,this.builder.model.get("rows").add(o,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()}.bind(this));var o={};this.builder.supports("editRow")&&(o.edit={title:panelsOptions.loc.contextual.row_edit}),s.helpers.clipboard.canCopyPaste()&&(o.copy={title:panelsOptions.loc.contextual.row_copy},this.builder.supports("addRow")&&s.helpers.clipboard.isModel("row-model")&&(o.paste={title:panelsOptions.loc.contextual.row_paste})),this.builder.supports("addRow")&&(o.duplicate={title:panelsOptions.loc.contextual.row_duplicate}),this.builder.supports("deleteRow")&&(o.delete={title:panelsOptions.loc.contextual.row_delete,confirm:!0}),_.isEmpty(o)||t.addSection("row-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},o,function(e){switch(e){case"edit":this.editSettingsHandler();break;case"copy":this.copyHandler();break;case"paste":this.pasteHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this))}})},{}],29:[function(e,t,i){window.panels;var s=jQuery;t.exports=Backbone.View.extend({stylesLoaded:!1,initialize:function(){},render:function(e,t,i){if(!_.isUndefined(e)){i=_.extend({builderType:"",dialog:null},i),this.$el.addClass("so-visual-styles so-"+e+"-styles so-panels-loading");var l={builderType:i.builderType};return"cell"===e&&(l.index=i.index),s.post(panelsOptions.ajaxurl,{action:"so_panels_style_form",type:e,style:this.model.get("style"),args:JSON.stringify(l),postId:t},null,"html").done(function(e){this.$el.html(e),this.setupFields(),this.stylesLoaded=!0,this.trigger("styles_loaded",!_.isEmpty(e)),_.isNull(i.dialog)||i.dialog.trigger("styles_loaded",!_.isEmpty(e))}.bind(this)).fail(function(e){var t;t=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,this.$el.html(t)}.bind(this)).always(function(){this.$el.removeClass("so-panels-loading")}.bind(this)),this}},attach:function(e){e.append(this.$el)},detach:function(){this.$el.detach()},setupFields:function(){this.$(".style-section-wrapper").each((function(){var e=s(this);e.find(".style-section-head").click((function(t){t.preventDefault(),e.find(".style-section-fields").slideToggle("fast")}))})),_.isUndefined(s.fn.wpColorPicker)||(_.isObject(panelsOptions.wpColorPickerOptions.palettes)&&!s.isArray(panelsOptions.wpColorPickerOptions.palettes)&&(panelsOptions.wpColorPickerOptions.palettes=s.map(panelsOptions.wpColorPickerOptions.palettes,(function(e){return e}))),this.$(".so-wp-color-field").wpColorPicker(panelsOptions.wpColorPickerOptions)),this.$(".style-field-image").each((function(){var e=null,t=s(this);t.find(".so-image-selector").click((function(i){i.preventDefault(),null===e&&(e=wp.media({title:"choose",library:{type:"image"},button:{text:"Done",close:!0}})).on("select",(function(){var i=e.state().get("selection").first().attributes,s=i.url;if(!_.isUndefined(i.sizes))try{s=i.sizes.thumbnail.url}catch(e){s=i.sizes.full.url}t.find(".current-image").css("background-image","url("+s+")"),t.find(".so-image-selector > input").val(i.id),t.find(".remove-image").removeClass("hidden")})),e.open()})),t.find(".remove-image").click((function(e){e.preventDefault(),t.find(".current-image").css("background-image","none"),t.find(".so-image-selector > input").val(""),t.find(".remove-image").addClass("hidden")}))})),this.$(".style-field-measurement").each((function(){var e=s(this),t=e.find('input[type="text"]'),i=e.find("select"),l=e.find('input[type="hidden"]');t.focus((function(){s(this).select()}));!function(e){if(""!==e){var o=/(?:([0-9\.,\-]+)(.*))+/,n=l.val().split(" "),a=[];for(var r in n){var d=o.exec(n[r]);_.isNull(d)||_.isUndefined(d[1])||_.isUndefined(d[2])||(a.push(d[1]),i.val(d[2]))}1===t.length?t.val(a.join(" ")):(1===a.length?a=[a[0],a[0],a[0],a[0]]:2===a.length?a=[a[0],a[1],a[0],a[1]]:3===a.length&&(a=[a[0],a[1],a[2],a[1]]),t.each((function(e,t){s(t).val(a[e])})))}}(l.val());var o=function(e){if(1===t.length){var o=t.val().split(" ").filter((function(e){return""!==e})).map((function(e){return e+i.val()})).join(" ");l.val(o)}else{var n=s(e.target),a=[],r=[],d=[];t.each((function(e,t){var i=""!==s(t).val()?parseFloat(s(t).val()):null;a.push(i),null===i?r.push(e):d.push(e)})),3===r.length&&d[0]===t.index(n)&&(t.val(n.val()),a=[n.val(),n.val(),n.val(),n.val()]),JSON.stringify(a)===JSON.stringify([null,null,null,null])?l.val(""):l.val(a.map((function(e){return(null===e?0:e)+i.val()})).join(" "))}};t.change(o),i.change(o)}))}})},{}],30:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-widget").html())),cell:null,dialog:null,events:{"click .widget-edit":"editHandler","touchend .widget-edit":"editHandler","click .title h4":"editHandler","touchend .title h4":"editHandler","click .actions .widget-duplicate":"duplicateHandler","click .actions .widget-delete":"deleteHandler"},initialize:function(){this.listenTo(this.model,"destroy",this.onModelDestroy),this.listenTo(this.model,"change:values",this.onModelChange),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(e){if(e=_.extend({loadForm:!1},e),this.setElement(this.template({title:this.model.getWidgetField("title"),description:this.model.getTitle(),widget_class:this.model.attributes.class})),this.$el.data("view",this),this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")||(this.$(".actions .widget-edit").remove(),this.$el.addClass("so-widget-no-edit")),this.cell.row.builder.supports("addWidget")||(this.$(".actions .widget-duplicate").remove(),this.$el.addClass("so-widget-no-duplicate")),this.cell.row.builder.supports("deleteWidget")||(this.$(".actions .widget-delete").remove(),this.$el.addClass("so-widget-no-delete")),this.cell.row.builder.supports("moveWidget")||this.$el.addClass("so-widget-no-move"),l.trim(this.$(".actions").html()).length||this.$(".actions").remove(),this.model.get("read_only")&&this.$el.addClass("so-widget-read-only"),0===_.size(this.model.get("values"))||e.loadForm){var t=this.getEditDialog();t.once("form_loaded",t.saveWidget,t),t.setupDialog()}return this.listenTo(this.cell.row.builder,"after_user_adds_widget",this.afterUserAddsWidgetHandler),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},getEditDialog:function(){return null===this.dialog&&(this.dialog=new s.dialog.widget({model:this.model}),this.dialog.setBuilder(this.cell.row.builder),this.dialog.widgetView=this),this.dialog},editHandler:function(){return!this.cell.row.builder.supports("editWidget")||this.model.get("read_only")?this:(this.getEditDialog().openDialog(),this)},duplicateHandler:function(){this.cell.row.builder.addHistoryEntry("widget_duplicated");var e=this.model.clone(this.model.cell);return this.cell.model.get("widgets").add(e,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},deleteHandler:function(){return this.visualDestroyModel(),this},onModelChange:function(){this.$(".description").html(this.model.getTitle())},onLabelChange:function(e){this.$(".title > h4").text(e.getWidgetField("title"))},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){return this.cell.row.builder.addHistoryEntry("widget_deleted"),this.$el.fadeOut("fast",function(){this.cell.row.resize(),this.model.destroy(),this.cell.row.builder.model.refreshPanelsData(),this.remove()}.bind(this)),this},buildContextualMenu:function(e,t){this.cell.row.builder.supports("addWidget")&&t.addSection("add-widget-below",{sectionTitle:panelsOptions.loc.contextual.add_widget_below,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,function(e){this.cell.row.builder.trigger("before_user_adds_widget"),this.cell.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=this.cell.model,this.cell.model.get("widgets").add(t,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this.cell.row.builder.trigger("after_user_adds_widget",t)}.bind(this));var i={};this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")&&(i.edit={title:panelsOptions.loc.contextual.widget_edit}),s.helpers.clipboard.canCopyPaste()&&(i.copy={title:panelsOptions.loc.contextual.widget_copy}),this.cell.row.builder.supports("addWidget")&&(i.duplicate={title:panelsOptions.loc.contextual.widget_duplicate}),this.cell.row.builder.supports("deleteWidget")&&(i.delete={title:panelsOptions.loc.contextual.widget_delete,confirm:!0}),_.isEmpty(i)||t.addSection("widget-actions",{sectionTitle:panelsOptions.loc.contextual.widget_actions,search:!1},i,function(e){switch(e){case"edit":this.editHandler();break;case"copy":this.copyHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this)),this.cell.buildContextualMenu(e,t)},afterUserAddsWidgetHandler:function(e){this.model===e&&panelsOptions.instant_open&&setTimeout(this.editHandler.bind(this),350)}})},{}],31:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.customHtmlWidgets,o=s("<div></div>"),n=t.find(".widget-content:first");n.before(o);var a=new l.CustomHtmlWidgetControl({el:o,syncContainer:n});return a.initializeEditor(),a.editor.codemirror.refresh(),a}};t.exports=l},{}],32:[function(e,t,i){var s=e("./custom-html-widget"),l=e("./media-widget"),o=e("./text-widget"),n={CUSTOM_HTML:"custom_html",MEDIA_AUDIO:"media_audio",MEDIA_GALLERY:"media_gallery",MEDIA_IMAGE:"media_image",MEDIA_VIDEO:"media_video",TEXT:"text",addWidget:function(e,t){var i,n=e.find("> .id_base").val();switch(n){case this.CUSTOM_HTML:i=s;break;case this.MEDIA_AUDIO:case this.MEDIA_GALLERY:case this.MEDIA_IMAGE:case this.MEDIA_VIDEO:i=l;break;case this.TEXT:i=o}i.addWidget(n,e,t)}};t.exports=n},{"./custom-html-widget":31,"./media-widget":33,"./text-widget":34}],33:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.mediaWidgets,o=l.controlConstructors[e];if(o){var n=l.modelConstructors[e]||l.MediaWidgetModel,a=t.find("> .widget-content"),r=s('<div class="media-widget-control"></div>');a.before(r);var d={};a.find(".media-widget-instance-property").each((function(){var e=s(this);d[e.data("property")]=e.val()})),d.widget_id=i;var h=new o({el:r,syncContainer:a,model:new n(d)});return h.render(),h}}};t.exports=l},{}],34:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.textWidgets,o={},n=t.find(".visual");if(n.length>0){if(!n.val())return null;var a=s("<div></div>"),r=t.find(".widget-content:first");r.before(a),o={el:a,syncContainer:r}}else o={el:t};var d=new l.TextWidgetControl(o),h=wp.oldEditor?wp.oldEditor:wp.editor;return h&&h.hasOwnProperty("autop")&&(wp.editor.autop=h.autop,wp.editor.removep=h.removep,wp.editor.initialize=h.initialize),d.initializeEditor(),d}};t.exports=l},{}]},{},[17]);
|
js/styling.js
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
Â
|
3 |
Â
jQuery( function ( $ ) {
|
4 |
Â
|
5 |
-
var fullContainer = $( panelsStyles.fullContainer );
|
6 |
-
if ( fullContainer.length === 0 ) {
|
7 |
-
fullContainer = $( 'body' );
|
8 |
-
}
|
9 |
-
|
10 |
Â
// Stretch all the full width rows
|
11 |
Â
var stretchFullWidthRows = function () {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
12 |
Â
var $panelsRow = $( '.siteorigin-panels-stretch.panel-row-style' );
|
13 |
Â
$panelsRow.each( function () {
|
14 |
Â
var $$ = $( this );
|
2 |
Â
|
3 |
Â
jQuery( function ( $ ) {
|
4 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
5 |
Â
// Stretch all the full width rows
|
6 |
Â
var stretchFullWidthRows = function () {
|
7 |
+
var fullContainer = $( panelsStyles.fullContainer );
|
8 |
+
if ( fullContainer.length === 0 ) {
|
9 |
+
fullContainer = $( 'body' );
|
10 |
+
}
|
11 |
+
|
12 |
Â
var $panelsRow = $( '.siteorigin-panels-stretch.panel-row-style' );
|
13 |
Â
$panelsRow.each( function () {
|
14 |
Â
var $$ = $( this );
|
js/styling.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery((function(e){var t=e(panelsStyles.fullContainer);0===t.length&&(t=e("body"));var r=
|
1 |
+
jQuery((function(e){var t=function(){var t=e(panelsStyles.fullContainer);0===t.length&&(t=e("body"));var r=e(".siteorigin-panels-stretch.panel-row-style");r.each((function(){var r=e(this),i=r.data("stretch-type"),n="full-stretched-padded"===i?"":0;r.css({"margin-left":0,"margin-right":0,"padding-left":n,"padding-right":n});var l=r.offset().left-t.offset().left,a=t.outerWidth()-l-r.parent().outerWidth();r.css({"margin-left":-l,"margin-right":-a,"padding-left":"full"===i?l:n,"padding-right":"full"===i?a:n});var d=r.find("> .panel-grid-cell");"full-stretched"===i&&1===d.length&&d.css({"padding-left":0,"padding-right":0}),r.css({"border-left":n,"border-right":n})})),r.length&&e(window).trigger("panelsStretchRows")};e(window).on("resize load",t),t(),e("body").removeClass("siteorigin-panels-before-js")}));
|
lang/siteorigin-panels.pot
CHANGED
@@ -36,19 +36,19 @@ msgstr ""
|
|
36 |
Â
msgid "https://siteorigin.com"
|
37 |
Â
msgstr ""
|
38 |
Â
|
39 |
-
#: siteorigin-panels.php:
|
40 |
Â
msgid "Read More"
|
41 |
Â
msgstr ""
|
42 |
Â
|
43 |
-
#: siteorigin-panels.php:
|
44 |
Â
msgid "Edit Home Page"
|
45 |
Â
msgstr ""
|
46 |
Â
|
47 |
-
#: siteorigin-panels.php:
|
48 |
Â
msgid "Live Editor"
|
49 |
Â
msgstr ""
|
50 |
Â
|
51 |
-
#: compat/layout-block.php:
|
52 |
Â
msgid "You need to add a widget, row, or prebuilt layout before you'll see anything here. :)"
|
53 |
Â
msgstr ""
|
54 |
Â
|
@@ -141,7 +141,7 @@ msgstr ""
|
|
141 |
Â
msgid "WordPress Widgets"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
-
#: inc/admin-widget-dialog.php:185, inc/settings.php:
|
145 |
Â
msgid "Recommended Widgets"
|
146 |
Â
msgstr ""
|
147 |
Â
|
@@ -157,7 +157,7 @@ msgstr ""
|
|
157 |
Â
msgid "Addons"
|
158 |
Â
msgstr ""
|
159 |
Â
|
160 |
-
#: inc/admin.php:179, inc/admin.php:
|
161 |
Â
msgid "Page Builder"
|
162 |
Â
msgstr ""
|
163 |
Â
|
@@ -455,69 +455,69 @@ msgid "Unknown error. Failed to load the form. Please check your internet connec
|
|
455 |
Â
msgstr ""
|
456 |
Â
|
457 |
Â
#. translators: This is the default name given to a user's home page
|
458 |
-
#: inc/admin.php:
|
459 |
Â
msgid "Home Page"
|
460 |
Â
msgstr ""
|
461 |
Â
|
462 |
-
#: inc/admin.php:
|
463 |
Â
msgid "Untitled Widget"
|
464 |
Â
msgstr ""
|
465 |
Â
|
466 |
-
#: inc/admin.php:
|
467 |
Â
msgid "You need to install 1{%1$s} to use the widget 2{%2$s}."
|
468 |
Â
msgstr ""
|
469 |
Â
|
470 |
-
#: inc/admin.php:
|
471 |
Â
msgid "Save and reload this page to start using the widget after you've installed it."
|
472 |
Â
msgstr ""
|
473 |
Â
|
474 |
-
#: inc/admin.php:
|
475 |
Â
msgid "The widget 1{%1$s} is not available. Please try locate and install the missing plugin. Post on the 2{support forums} if you need help."
|
476 |
Â
msgstr ""
|
477 |
Â
|
478 |
-
#: inc/admin.php:
|
479 |
Â
msgid "The supplied nonce is invalid."
|
480 |
Â
msgstr ""
|
481 |
Â
|
482 |
-
#: inc/admin.php:
|
483 |
Â
msgid "Invalid nonce."
|
484 |
Â
msgstr ""
|
485 |
Â
|
486 |
-
#: inc/admin.php:
|
487 |
Â
msgid "Please specify the type of widget form to be rendered."
|
488 |
Â
msgstr ""
|
489 |
Â
|
490 |
-
#: inc/admin.php:
|
491 |
Â
msgid "Missing widget type."
|
492 |
Â
msgstr ""
|
493 |
Â
|
494 |
-
#: inc/admin.php:
|
495 |
Â
msgid "%s Widget"
|
496 |
Â
msgid_plural "%s Widgets"
|
497 |
Â
msgstr[0] ""
|
498 |
Â
msgstr[1] ""
|
499 |
Â
|
500 |
-
#: inc/admin.php:
|
501 |
Â
msgid "Get a lightbox addon for SiteOrigin widgets"
|
502 |
Â
msgstr ""
|
503 |
Â
|
504 |
-
#: inc/admin.php:
|
505 |
Â
msgid "Get the row, cell and widget animations addon"
|
506 |
Â
msgstr ""
|
507 |
Â
|
508 |
-
#: inc/admin.php:
|
509 |
Â
msgid "Get premium email support for SiteOrigin Page Builder"
|
510 |
Â
msgstr ""
|
511 |
Â
|
512 |
-
#: inc/admin.php:
|
513 |
Â
msgid "Toggle editor selection menu"
|
514 |
Â
msgstr ""
|
515 |
Â
|
516 |
-
#: inc/admin.php:
|
517 |
Â
msgid "SiteOrigin Page Builder"
|
518 |
Â
msgstr ""
|
519 |
Â
|
520 |
-
#: inc/admin.php:
|
521 |
Â
msgid "Block Editor"
|
522 |
Â
msgstr ""
|
523 |
Â
|
@@ -529,259 +529,267 @@ msgstr ""
|
|
529 |
Â
msgid "Page Builder Content"
|
530 |
Â
msgstr ""
|
531 |
Â
|
532 |
-
#: inc/settings.php:
|
533 |
Â
msgid "Page Builder Settings"
|
534 |
Â
msgstr ""
|
535 |
Â
|
536 |
-
#: inc/settings.php:
|
537 |
Â
msgid "General"
|
538 |
Â
msgstr ""
|
539 |
Â
|
540 |
-
#: inc/settings.php:
|
541 |
Â
msgid "Post Types"
|
542 |
Â
msgstr ""
|
543 |
Â
|
544 |
-
#: inc/settings.php:
|
545 |
Â
msgid "The post types on which to use Page Builder."
|
546 |
Â
msgstr ""
|
547 |
Â
|
548 |
-
#: inc/settings.php:
|
549 |
-
msgid "Use Classic Editor for
|
550 |
Â
msgstr ""
|
551 |
Â
|
552 |
-
#: inc/settings.php:
|
553 |
Â
msgid "New posts of the above Post Types will be created using the Classic Editor."
|
554 |
Â
msgstr ""
|
555 |
Â
|
556 |
-
#: inc/settings.php:
|
557 |
Â
msgid "Live Editor Quick Link"
|
558 |
Â
msgstr ""
|
559 |
Â
|
560 |
-
#: inc/settings.php:
|
561 |
Â
msgid "Display a Live Editor button in the admin bar."
|
562 |
Â
msgstr ""
|
563 |
Â
|
564 |
-
#: inc/settings.php:
|
565 |
Â
msgid "Display Post State"
|
566 |
Â
msgstr ""
|
567 |
Â
|
568 |
-
#: inc/settings.php:
|
569 |
Â
msgid "Display a %sSiteOrigin Page Builder%s post state in the admin lists of posts/pages to indicate Page Builder is active."
|
570 |
Â
msgstr ""
|
571 |
Â
|
572 |
-
#: inc/settings.php:
|
573 |
Â
msgid "Display Widget Count"
|
574 |
Â
msgstr ""
|
575 |
Â
|
576 |
-
#: inc/settings.php:
|
577 |
Â
msgid "Display a widget count in the admin lists of posts/pages where you're using Page Builder."
|
578 |
Â
msgstr ""
|
579 |
Â
|
580 |
-
#: inc/settings.php:
|
581 |
Â
msgid "Limit Parallax Motion"
|
582 |
Â
msgstr ""
|
583 |
Â
|
584 |
-
#: inc/settings.php:
|
585 |
Â
msgid "How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect."
|
586 |
Â
msgstr ""
|
587 |
Â
|
588 |
-
#: inc/settings.php:
|
589 |
Â
msgid "Disable Parallax On Mobile"
|
590 |
Â
msgstr ""
|
591 |
Â
|
592 |
-
#: inc/settings.php:
|
593 |
Â
msgid "Disable row/widget background parallax when the browser is smaller than the mobile width."
|
594 |
Â
msgstr ""
|
595 |
Â
|
596 |
-
#: inc/settings.php:
|
597 |
Â
msgid "Sidebars Emulator"
|
598 |
Â
msgstr ""
|
599 |
Â
|
600 |
-
#: inc/settings.php:
|
601 |
Â
msgid "Page Builder will create an emulated sidebar, that contains all widgets in the page."
|
602 |
Â
msgstr ""
|
603 |
Â
|
604 |
-
#: inc/settings.php:
|
605 |
Â
msgid "Upgrade Teaser"
|
606 |
Â
msgstr ""
|
607 |
Â
|
608 |
-
#: inc/settings.php:
|
609 |
Â
msgid "Display the %sSiteOrigin Premium%s upgrade teaser in the Page Builder toolbar."
|
610 |
Â
msgstr ""
|
611 |
Â
|
612 |
-
#: inc/settings.php:
|
613 |
Â
msgid "Default To Page Builder Interface"
|
614 |
Â
msgstr ""
|
615 |
Â
|
616 |
-
#: inc/settings.php:
|
617 |
Â
msgid "New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s\"Use Classic Editor for new posts\"%s setting must be enabled."
|
618 |
Â
msgstr ""
|
619 |
Â
|
620 |
-
#: inc/settings.php:
|
621 |
Â
msgid "Layout Block Default Mode"
|
622 |
Â
msgstr ""
|
623 |
Â
|
624 |
-
#: inc/settings.php:
|
625 |
Â
msgid "Edit"
|
626 |
Â
msgstr ""
|
627 |
Â
|
628 |
-
#: inc/settings.php:
|
629 |
Â
msgid "Preview"
|
630 |
Â
msgstr ""
|
631 |
Â
|
632 |
-
#: inc/settings.php:
|
633 |
Â
msgid "Whether to display layout blocks in edit mode or preview mode in the block editor."
|
634 |
Â
msgstr ""
|
635 |
Â
|
636 |
-
#: inc/settings.php:
|
637 |
Â
msgid "Widgets"
|
638 |
Â
msgstr ""
|
639 |
Â
|
640 |
-
#: inc/settings.php:
|
641 |
Â
msgid "Widget Title HTML"
|
642 |
Â
msgstr ""
|
643 |
Â
|
644 |
-
#: inc/settings.php:
|
645 |
Â
msgid "The HTML used for widget titles. {{title}} is replaced with the widget title."
|
646 |
Â
msgstr ""
|
647 |
Â
|
648 |
-
#: inc/settings.php:
|
649 |
Â
msgid "Add Widget Class"
|
650 |
Â
msgstr ""
|
651 |
Â
|
652 |
-
#: inc/settings.php:
|
653 |
Â
msgid "Add the widget class to Page Builder widgets. Disable this if you're experiencing conflicts."
|
654 |
Â
msgstr ""
|
655 |
Â
|
656 |
-
#: inc/settings.php:
|
657 |
Â
msgid "Legacy Bundled Widgets"
|
658 |
Â
msgstr ""
|
659 |
Â
|
660 |
-
#: inc/settings.php:
|
661 |
Â
msgid "Load legacy widgets from Page Builder 1."
|
662 |
Â
msgstr ""
|
663 |
Â
|
664 |
-
#: inc/settings.php:
|
665 |
Â
msgid "Display recommend widgets in Page Builder add widget dialog."
|
666 |
Â
msgstr ""
|
667 |
Â
|
668 |
-
#: inc/settings.php:
|
669 |
Â
msgid "Instant Open Widgets"
|
670 |
Â
msgstr ""
|
671 |
Â
|
672 |
-
#: inc/settings.php:
|
673 |
Â
msgid "Open a widget form as soon as its added to a page."
|
674 |
Â
msgstr ""
|
675 |
Â
|
676 |
-
#: inc/settings.php:
|
677 |
Â
msgid "Layout"
|
678 |
Â
msgstr ""
|
679 |
Â
|
680 |
-
#: inc/settings.php:
|
681 |
Â
msgid "Responsive Layout"
|
682 |
Â
msgstr ""
|
683 |
Â
|
684 |
-
#: inc/settings.php:
|
685 |
Â
msgid "Collapse widgets, rows and columns on mobile devices."
|
686 |
Â
msgstr ""
|
687 |
Â
|
688 |
-
#: inc/settings.php:
|
689 |
Â
msgid "Use Tablet Layout"
|
690 |
Â
msgstr ""
|
691 |
Â
|
692 |
-
#: inc/settings.php:
|
693 |
Â
msgid "Collapses columns differently on tablet devices."
|
694 |
Â
msgstr ""
|
695 |
Â
|
696 |
-
#: inc/settings.php:
|
697 |
Â
msgid "Detect older browsers"
|
698 |
Â
msgstr ""
|
699 |
Â
|
700 |
-
#: inc/settings.php:
|
701 |
Â
msgid "Never"
|
702 |
Â
msgstr ""
|
703 |
Â
|
704 |
-
#: inc/settings.php:
|
705 |
Â
msgid "Always"
|
706 |
Â
msgstr ""
|
707 |
Â
|
708 |
-
#: inc/settings.php:
|
709 |
Â
msgid "Use Legacy Layout Engine"
|
710 |
Â
msgstr ""
|
711 |
Â
|
712 |
-
#: inc/settings.php:
|
713 |
Â
msgid "The CSS and HTML uses floats instead of flexbox for compatibility with very old browsers."
|
714 |
Â
msgstr ""
|
715 |
Â
|
716 |
-
#: inc/settings.php:
|
717 |
Â
msgid "Tablet Width"
|
718 |
Â
msgstr ""
|
719 |
Â
|
720 |
-
#: inc/settings.php:
|
721 |
Â
msgid "Device width, in pixels, to collapse into a tablet view ."
|
722 |
Â
msgstr ""
|
723 |
Â
|
724 |
-
#: inc/settings.php:
|
725 |
Â
msgid "Mobile Width"
|
726 |
Â
msgstr ""
|
727 |
Â
|
728 |
-
#: inc/settings.php:
|
729 |
Â
msgid "Device width, in pixels, to collapse into a mobile view ."
|
730 |
Â
msgstr ""
|
731 |
Â
|
732 |
-
#: inc/settings.php:
|
733 |
Â
msgid "Row/Widget Bottom Margin"
|
734 |
Â
msgstr ""
|
735 |
Â
|
736 |
-
#: inc/settings.php:
|
737 |
Â
msgid "Default margin below rows and widgets."
|
738 |
Â
msgstr ""
|
739 |
Â
|
740 |
-
#: inc/settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
741 |
Â
msgid "Last Row With Margin"
|
742 |
Â
msgstr ""
|
743 |
Â
|
744 |
-
#: inc/settings.php:
|
745 |
Â
msgid "Allow margin in last row."
|
746 |
Â
msgstr ""
|
747 |
Â
|
748 |
-
#: inc/settings.php:
|
749 |
Â
msgid "Row Gutter"
|
750 |
Â
msgstr ""
|
751 |
Â
|
752 |
-
#: inc/settings.php:
|
753 |
Â
msgid "Default spacing between columns in each row."
|
754 |
Â
msgstr ""
|
755 |
Â
|
756 |
-
#: inc/settings.php:
|
757 |
Â
msgid "Full Width Container"
|
758 |
Â
msgstr ""
|
759 |
Â
|
760 |
-
#: inc/settings.php:
|
761 |
Â
msgid "The container used for the full width layout."
|
762 |
Â
msgstr ""
|
763 |
Â
|
764 |
-
#: inc/settings.php:
|
765 |
Â
msgid "Content"
|
766 |
Â
msgstr ""
|
767 |
Â
|
768 |
-
#: inc/settings.php:
|
769 |
Â
msgid "Copy Content"
|
770 |
Â
msgstr ""
|
771 |
Â
|
772 |
-
#: inc/settings.php:
|
773 |
Â
msgid "Copy content from Page Builder to post content."
|
774 |
Â
msgstr ""
|
775 |
Â
|
776 |
-
#: inc/settings.php:
|
777 |
Â
msgid "Copy Styles"
|
778 |
Â
msgstr ""
|
779 |
Â
|
780 |
-
#: inc/settings.php:
|
781 |
Â
msgid "Include styles into your Post Content. This keeps page layouts, even when Page Builder is deactivated."
|
782 |
Â
msgstr ""
|
783 |
Â
|
784 |
-
#: inc/settings.php:
|
785 |
Â
msgid "Enabled"
|
786 |
Â
msgstr ""
|
787 |
Â
|
@@ -1013,7 +1021,7 @@ msgstr ""
|
|
1013 |
Â
msgid "Collapse Order"
|
1014 |
Â
msgstr ""
|
1015 |
Â
|
1016 |
-
#: inc/styles.php:250, widgets/widgets.php:635, widgets/widgets.php:757, inc/widgets/post-loop.php:
|
1017 |
Â
msgid "Default"
|
1018 |
Â
msgstr ""
|
1019 |
Â
|
@@ -1329,83 +1337,83 @@ msgstr ""
|
|
1329 |
Â
msgid "%s Style"
|
1330 |
Â
msgstr ""
|
1331 |
Â
|
1332 |
-
#: widgets/widgets.php:594, inc/widgets/post-loop.php:
|
1333 |
Â
msgid "Post Type"
|
1334 |
Â
msgstr ""
|
1335 |
Â
|
1336 |
-
#: widgets/widgets.php:601, inc/widgets/post-loop.php:
|
1337 |
Â
msgid "Posts Per Page"
|
1338 |
Â
msgstr ""
|
1339 |
Â
|
1340 |
-
#: widgets/widgets.php:606, inc/widgets/post-loop.php:
|
1341 |
Â
msgid "Order By"
|
1342 |
Â
msgstr ""
|
1343 |
Â
|
1344 |
-
#: widgets/widgets.php:608, widgets/widgets.php:783, inc/widgets/post-content.php:60, inc/widgets/post-loop.php:
|
1345 |
Â
msgid "None"
|
1346 |
Â
msgstr ""
|
1347 |
Â
|
1348 |
-
#: widgets/widgets.php:609, inc/widgets/post-loop.php:
|
1349 |
Â
msgid "Post ID"
|
1350 |
Â
msgstr ""
|
1351 |
Â
|
1352 |
-
#: widgets/widgets.php:610, inc/widgets/post-loop.php:
|
1353 |
Â
msgid "Author"
|
1354 |
Â
msgstr ""
|
1355 |
Â
|
1356 |
-
#: widgets/widgets.php:611, widgets/widgets.php:612, inc/widgets/post-loop.php:
|
1357 |
Â
msgid "Name"
|
1358 |
Â
msgstr ""
|
1359 |
Â
|
1360 |
-
#: widgets/widgets.php:613, inc/widgets/post-loop.php:
|
1361 |
Â
msgid "Date"
|
1362 |
Â
msgstr ""
|
1363 |
Â
|
1364 |
-
#: widgets/widgets.php:614, inc/widgets/post-loop.php:
|
1365 |
Â
msgid "Modified"
|
1366 |
Â
msgstr ""
|
1367 |
Â
|
1368 |
-
#: widgets/widgets.php:615, inc/widgets/post-loop.php:
|
1369 |
Â
msgid "Parent"
|
1370 |
Â
msgstr ""
|
1371 |
Â
|
1372 |
-
#: widgets/widgets.php:616, inc/widgets/post-loop.php:
|
1373 |
Â
msgid "Random"
|
1374 |
Â
msgstr ""
|
1375 |
Â
|
1376 |
-
#: widgets/widgets.php:617, inc/widgets/post-loop.php:
|
1377 |
Â
msgid "Comment Count"
|
1378 |
Â
msgstr ""
|
1379 |
Â
|
1380 |
-
#: widgets/widgets.php:618, inc/widgets/post-loop.php:
|
1381 |
Â
msgid "Menu Order"
|
1382 |
Â
msgstr ""
|
1383 |
Â
|
1384 |
-
#: widgets/widgets.php:624, inc/widgets/post-loop.php:
|
1385 |
Â
msgid "Order"
|
1386 |
Â
msgstr ""
|
1387 |
Â
|
1388 |
-
#: widgets/widgets.php:626, inc/widgets/post-loop.php:
|
1389 |
Â
msgid "Ascending"
|
1390 |
Â
msgstr ""
|
1391 |
Â
|
1392 |
-
#: widgets/widgets.php:627, inc/widgets/post-loop.php:
|
1393 |
Â
msgid "Descending"
|
1394 |
Â
msgstr ""
|
1395 |
Â
|
1396 |
-
#: widgets/widgets.php:633, inc/widgets/post-loop.php:
|
1397 |
Â
msgid "Sticky Posts"
|
1398 |
Â
msgstr ""
|
1399 |
Â
|
1400 |
-
#: widgets/widgets.php:636, inc/widgets/post-loop.php:
|
1401 |
Â
msgid "Ignore Sticky"
|
1402 |
Â
msgstr ""
|
1403 |
Â
|
1404 |
-
#: widgets/widgets.php:637, inc/widgets/post-loop.php:
|
1405 |
Â
msgid "Exclude Sticky"
|
1406 |
Â
msgstr ""
|
1407 |
Â
|
1408 |
-
#: widgets/widgets.php:638, inc/widgets/post-loop.php:
|
1409 |
Â
msgid "Only Sticky"
|
1410 |
Â
msgstr ""
|
1411 |
Â
|
@@ -1413,7 +1421,7 @@ msgstr ""
|
|
1413 |
Â
msgid "Additional Arguments"
|
1414 |
Â
msgstr ""
|
1415 |
Â
|
1416 |
-
#: widgets/widgets.php:648, inc/widgets/post-loop.php:
|
1417 |
Â
msgid "Additional query arguments. See 1{query_posts}."
|
1418 |
Â
msgstr ""
|
1419 |
Â
|
@@ -1602,7 +1610,7 @@ msgstr ""
|
|
1602 |
Â
msgid "Displays content from the current post."
|
1603 |
Â
msgstr ""
|
1604 |
Â
|
1605 |
-
#: inc/widgets/post-content.php:61, inc/widgets/post-loop-helper.php:41, inc/widgets/post-loop.php:
|
1606 |
Â
msgid "Title"
|
1607 |
Â
msgstr ""
|
1608 |
Â
|
@@ -1622,27 +1630,27 @@ msgstr ""
|
|
1622 |
Â
msgid "Displays a post loop."
|
1623 |
Â
msgstr ""
|
1624 |
Â
|
1625 |
-
#: inc/widgets/post-loop-helper.php:45, inc/widgets/post-loop.php:
|
1626 |
Â
msgid "Template"
|
1627 |
Â
msgstr ""
|
1628 |
Â
|
1629 |
-
#: inc/widgets/post-loop-helper.php:52, inc/widgets/post-loop.php:
|
1630 |
Â
msgid "If the template supports it, cut posts and display the more link."
|
1631 |
Â
msgstr ""
|
1632 |
Â
|
1633 |
-
#: inc/widgets/post-loop.php:
|
1634 |
Â
msgid "Your theme doesn't have any post loops."
|
1635 |
Â
msgstr ""
|
1636 |
Â
|
1637 |
-
#: inc/widgets/post-loop.php:
|
1638 |
Â
msgid "More Link"
|
1639 |
Â
msgstr ""
|
1640 |
Â
|
1641 |
-
#: inc/widgets/post-loop.php:
|
1642 |
Â
msgid "Post In Order"
|
1643 |
Â
msgstr ""
|
1644 |
Â
|
1645 |
-
#: inc/widgets/post-loop.php:
|
1646 |
Â
msgid "Additional "
|
1647 |
Â
msgstr ""
|
1648 |
Â
|
36 |
Â
msgid "https://siteorigin.com"
|
37 |
Â
msgstr ""
|
38 |
Â
|
39 |
+
#: siteorigin-panels.php:353
|
40 |
Â
msgid "Read More"
|
41 |
Â
msgstr ""
|
42 |
Â
|
43 |
+
#: siteorigin-panels.php:501
|
44 |
Â
msgid "Edit Home Page"
|
45 |
Â
msgstr ""
|
46 |
Â
|
47 |
+
#: siteorigin-panels.php:521, tpl/js-templates.php:34, tpl/js-templates.php:36
|
48 |
Â
msgid "Live Editor"
|
49 |
Â
msgstr ""
|
50 |
Â
|
51 |
+
#: compat/layout-block.php:92
|
52 |
Â
msgid "You need to add a widget, row, or prebuilt layout before you'll see anything here. :)"
|
53 |
Â
msgstr ""
|
54 |
Â
|
141 |
Â
msgid "WordPress Widgets"
|
142 |
Â
msgstr ""
|
143 |
Â
|
144 |
+
#: inc/admin-widget-dialog.php:185, inc/settings.php:358
|
145 |
Â
msgid "Recommended Widgets"
|
146 |
Â
msgstr ""
|
147 |
Â
|
157 |
Â
msgid "Addons"
|
158 |
Â
msgstr ""
|
159 |
Â
|
160 |
+
#: inc/admin.php:179, inc/admin.php:591, inc/admin.php:1246, inc/admin.php:1251, inc/settings.php:201, tpl/js-templates.php:197
|
161 |
Â
msgid "Page Builder"
|
162 |
Â
msgstr ""
|
163 |
Â
|
455 |
Â
msgstr ""
|
456 |
Â
|
457 |
Â
#. translators: This is the default name given to a user's home page
|
458 |
+
#: inc/admin.php:674, inc/home.php:26
|
459 |
Â
msgid "Home Page"
|
460 |
Â
msgstr ""
|
461 |
Â
|
462 |
+
#: inc/admin.php:775
|
463 |
Â
msgid "Untitled Widget"
|
464 |
Â
msgstr ""
|
465 |
Â
|
466 |
+
#: inc/admin.php:955
|
467 |
Â
msgid "You need to install 1{%1$s} to use the widget 2{%2$s}."
|
468 |
Â
msgstr ""
|
469 |
Â
|
470 |
+
#: inc/admin.php:961
|
471 |
Â
msgid "Save and reload this page to start using the widget after you've installed it."
|
472 |
Â
msgstr ""
|
473 |
Â
|
474 |
+
#: inc/admin.php:977
|
475 |
Â
msgid "The widget 1{%1$s} is not available. Please try locate and install the missing plugin. Post on the 2{support forums} if you need help."
|
476 |
Â
msgstr ""
|
477 |
Â
|
478 |
+
#: inc/admin.php:1149, inc/styles-admin.php:23
|
479 |
Â
msgid "The supplied nonce is invalid."
|
480 |
Â
msgstr ""
|
481 |
Â
|
482 |
+
#: inc/admin.php:1150, inc/styles-admin.php:24
|
483 |
Â
msgid "Invalid nonce."
|
484 |
Â
msgstr ""
|
485 |
Â
|
486 |
+
#: inc/admin.php:1156
|
487 |
Â
msgid "Please specify the type of widget form to be rendered."
|
488 |
Â
msgstr ""
|
489 |
Â
|
490 |
+
#: inc/admin.php:1157
|
491 |
Â
msgid "Missing widget type."
|
492 |
Â
msgstr ""
|
493 |
Â
|
494 |
+
#: inc/admin.php:1264
|
495 |
Â
msgid "%s Widget"
|
496 |
Â
msgid_plural "%s Widgets"
|
497 |
Â
msgstr[0] ""
|
498 |
Â
msgstr[1] ""
|
499 |
Â
|
500 |
+
#: inc/admin.php:1307
|
501 |
Â
msgid "Get a lightbox addon for SiteOrigin widgets"
|
502 |
Â
msgstr ""
|
503 |
Â
|
504 |
+
#: inc/admin.php:1311
|
505 |
Â
msgid "Get the row, cell and widget animations addon"
|
506 |
Â
msgstr ""
|
507 |
Â
|
508 |
+
#: inc/admin.php:1315
|
509 |
Â
msgid "Get premium email support for SiteOrigin Page Builder"
|
510 |
Â
msgstr ""
|
511 |
Â
|
512 |
+
#: inc/admin.php:1500
|
513 |
Â
msgid "Toggle editor selection menu"
|
514 |
Â
msgstr ""
|
515 |
Â
|
516 |
+
#: inc/admin.php:1501, inc/admin.php:1548, inc/settings.php:201, settings/tpl/settings.php:9
|
517 |
Â
msgid "SiteOrigin Page Builder"
|
518 |
Â
msgstr ""
|
519 |
Â
|
520 |
+
#: inc/admin.php:1502
|
521 |
Â
msgid "Block Editor"
|
522 |
Â
msgstr ""
|
523 |
Â
|
529 |
Â
msgid "Page Builder Content"
|
530 |
Â
msgstr ""
|
531 |
Â
|
532 |
+
#: inc/settings.php:228
|
533 |
Â
msgid "Page Builder Settings"
|
534 |
Â
msgstr ""
|
535 |
Â
|
536 |
+
#: inc/settings.php:244
|
537 |
Â
msgid "General"
|
538 |
Â
msgstr ""
|
539 |
Â
|
540 |
+
#: inc/settings.php:250
|
541 |
Â
msgid "Post Types"
|
542 |
Â
msgstr ""
|
543 |
Â
|
544 |
+
#: inc/settings.php:252
|
545 |
Â
msgid "The post types on which to use Page Builder."
|
546 |
Â
msgstr ""
|
547 |
Â
|
548 |
+
#: inc/settings.php:257
|
549 |
+
msgid "Use Classic Editor for New Posts"
|
550 |
Â
msgstr ""
|
551 |
Â
|
552 |
+
#: inc/settings.php:258
|
553 |
Â
msgid "New posts of the above Post Types will be created using the Classic Editor."
|
554 |
Â
msgstr ""
|
555 |
Â
|
556 |
+
#: inc/settings.php:263
|
557 |
Â
msgid "Live Editor Quick Link"
|
558 |
Â
msgstr ""
|
559 |
Â
|
560 |
+
#: inc/settings.php:264
|
561 |
Â
msgid "Display a Live Editor button in the admin bar."
|
562 |
Â
msgstr ""
|
563 |
Â
|
564 |
+
#: inc/settings.php:269
|
565 |
Â
msgid "Display Post State"
|
566 |
Â
msgstr ""
|
567 |
Â
|
568 |
+
#: inc/settings.php:271
|
569 |
Â
msgid "Display a %sSiteOrigin Page Builder%s post state in the admin lists of posts/pages to indicate Page Builder is active."
|
570 |
Â
msgstr ""
|
571 |
Â
|
572 |
+
#: inc/settings.php:279
|
573 |
Â
msgid "Display Widget Count"
|
574 |
Â
msgstr ""
|
575 |
Â
|
576 |
+
#: inc/settings.php:280
|
577 |
Â
msgid "Display a widget count in the admin lists of posts/pages where you're using Page Builder."
|
578 |
Â
msgstr ""
|
579 |
Â
|
580 |
+
#: inc/settings.php:285
|
581 |
Â
msgid "Limit Parallax Motion"
|
582 |
Â
msgstr ""
|
583 |
Â
|
584 |
+
#: inc/settings.php:286
|
585 |
Â
msgid "How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect."
|
586 |
Â
msgstr ""
|
587 |
Â
|
588 |
+
#: inc/settings.php:291
|
589 |
Â
msgid "Disable Parallax On Mobile"
|
590 |
Â
msgstr ""
|
591 |
Â
|
592 |
+
#: inc/settings.php:292
|
593 |
Â
msgid "Disable row/widget background parallax when the browser is smaller than the mobile width."
|
594 |
Â
msgstr ""
|
595 |
Â
|
596 |
+
#: inc/settings.php:297
|
597 |
Â
msgid "Sidebars Emulator"
|
598 |
Â
msgstr ""
|
599 |
Â
|
600 |
+
#: inc/settings.php:298
|
601 |
Â
msgid "Page Builder will create an emulated sidebar, that contains all widgets in the page."
|
602 |
Â
msgstr ""
|
603 |
Â
|
604 |
+
#: inc/settings.php:303
|
605 |
Â
msgid "Upgrade Teaser"
|
606 |
Â
msgstr ""
|
607 |
Â
|
608 |
+
#: inc/settings.php:305
|
609 |
Â
msgid "Display the %sSiteOrigin Premium%s upgrade teaser in the Page Builder toolbar."
|
610 |
Â
msgstr ""
|
611 |
Â
|
612 |
+
#: inc/settings.php:313
|
613 |
Â
msgid "Default To Page Builder Interface"
|
614 |
Â
msgstr ""
|
615 |
Â
|
616 |
+
#: inc/settings.php:315
|
617 |
Â
msgid "New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s\"Use Classic Editor for new posts\"%s setting must be enabled."
|
618 |
Â
msgstr ""
|
619 |
Â
|
620 |
+
#: inc/settings.php:322
|
621 |
Â
msgid "Layout Block Default Mode"
|
622 |
Â
msgstr ""
|
623 |
Â
|
624 |
+
#: inc/settings.php:325, tpl/js-templates.php:141
|
625 |
Â
msgid "Edit"
|
626 |
Â
msgstr ""
|
627 |
Â
|
628 |
+
#: inc/settings.php:326
|
629 |
Â
msgid "Preview"
|
630 |
Â
msgstr ""
|
631 |
Â
|
632 |
+
#: inc/settings.php:328
|
633 |
Â
msgid "Whether to display layout blocks in edit mode or preview mode in the block editor."
|
634 |
Â
msgstr ""
|
635 |
Â
|
636 |
+
#: inc/settings.php:334
|
637 |
Â
msgid "Widgets"
|
638 |
Â
msgstr ""
|
639 |
Â
|
640 |
+
#: inc/settings.php:340
|
641 |
Â
msgid "Widget Title HTML"
|
642 |
Â
msgstr ""
|
643 |
Â
|
644 |
+
#: inc/settings.php:341
|
645 |
Â
msgid "The HTML used for widget titles. {{title}} is replaced with the widget title."
|
646 |
Â
msgstr ""
|
647 |
Â
|
648 |
+
#: inc/settings.php:346
|
649 |
Â
msgid "Add Widget Class"
|
650 |
Â
msgstr ""
|
651 |
Â
|
652 |
+
#: inc/settings.php:347
|
653 |
Â
msgid "Add the widget class to Page Builder widgets. Disable this if you're experiencing conflicts."
|
654 |
Â
msgstr ""
|
655 |
Â
|
656 |
+
#: inc/settings.php:352
|
657 |
Â
msgid "Legacy Bundled Widgets"
|
658 |
Â
msgstr ""
|
659 |
Â
|
660 |
+
#: inc/settings.php:353
|
661 |
Â
msgid "Load legacy widgets from Page Builder 1."
|
662 |
Â
msgstr ""
|
663 |
Â
|
664 |
+
#: inc/settings.php:359
|
665 |
Â
msgid "Display recommend widgets in Page Builder add widget dialog."
|
666 |
Â
msgstr ""
|
667 |
Â
|
668 |
+
#: inc/settings.php:364
|
669 |
Â
msgid "Instant Open Widgets"
|
670 |
Â
msgstr ""
|
671 |
Â
|
672 |
+
#: inc/settings.php:365
|
673 |
Â
msgid "Open a widget form as soon as its added to a page."
|
674 |
Â
msgstr ""
|
675 |
Â
|
676 |
+
#: inc/settings.php:371, inc/styles-admin.php:88
|
677 |
Â
msgid "Layout"
|
678 |
Â
msgstr ""
|
679 |
Â
|
680 |
+
#: inc/settings.php:379
|
681 |
Â
msgid "Responsive Layout"
|
682 |
Â
msgstr ""
|
683 |
Â
|
684 |
+
#: inc/settings.php:380
|
685 |
Â
msgid "Collapse widgets, rows and columns on mobile devices."
|
686 |
Â
msgstr ""
|
687 |
Â
|
688 |
+
#: inc/settings.php:385
|
689 |
Â
msgid "Use Tablet Layout"
|
690 |
Â
msgstr ""
|
691 |
Â
|
692 |
+
#: inc/settings.php:386
|
693 |
Â
msgid "Collapses columns differently on tablet devices."
|
694 |
Â
msgstr ""
|
695 |
Â
|
696 |
+
#: inc/settings.php:392
|
697 |
Â
msgid "Detect older browsers"
|
698 |
Â
msgstr ""
|
699 |
Â
|
700 |
+
#: inc/settings.php:393
|
701 |
Â
msgid "Never"
|
702 |
Â
msgstr ""
|
703 |
Â
|
704 |
+
#: inc/settings.php:394
|
705 |
Â
msgid "Always"
|
706 |
Â
msgstr ""
|
707 |
Â
|
708 |
+
#: inc/settings.php:396
|
709 |
Â
msgid "Use Legacy Layout Engine"
|
710 |
Â
msgstr ""
|
711 |
Â
|
712 |
+
#: inc/settings.php:397
|
713 |
Â
msgid "The CSS and HTML uses floats instead of flexbox for compatibility with very old browsers."
|
714 |
Â
msgstr ""
|
715 |
Â
|
716 |
+
#: inc/settings.php:403
|
717 |
Â
msgid "Tablet Width"
|
718 |
Â
msgstr ""
|
719 |
Â
|
720 |
+
#: inc/settings.php:404
|
721 |
Â
msgid "Device width, in pixels, to collapse into a tablet view ."
|
722 |
Â
msgstr ""
|
723 |
Â
|
724 |
+
#: inc/settings.php:410
|
725 |
Â
msgid "Mobile Width"
|
726 |
Â
msgstr ""
|
727 |
Â
|
728 |
+
#: inc/settings.php:411
|
729 |
Â
msgid "Device width, in pixels, to collapse into a mobile view ."
|
730 |
Â
msgstr ""
|
731 |
Â
|
732 |
+
#: inc/settings.php:417
|
733 |
Â
msgid "Row/Widget Bottom Margin"
|
734 |
Â
msgstr ""
|
735 |
Â
|
736 |
+
#: inc/settings.php:418
|
737 |
Â
msgid "Default margin below rows and widgets."
|
738 |
Â
msgstr ""
|
739 |
Â
|
740 |
+
#: inc/settings.php:424
|
741 |
+
msgid "Row Mobile Bottom Margin"
|
742 |
+
msgstr ""
|
743 |
+
|
744 |
+
#: inc/settings.php:425
|
745 |
+
msgid "The default margin below rows on mobile."
|
746 |
+
msgstr ""
|
747 |
+
|
748 |
+
#: inc/settings.php:430
|
749 |
Â
msgid "Last Row With Margin"
|
750 |
Â
msgstr ""
|
751 |
Â
|
752 |
+
#: inc/settings.php:431
|
753 |
Â
msgid "Allow margin in last row."
|
754 |
Â
msgstr ""
|
755 |
Â
|
756 |
+
#: inc/settings.php:437
|
757 |
Â
msgid "Row Gutter"
|
758 |
Â
msgstr ""
|
759 |
Â
|
760 |
+
#: inc/settings.php:438
|
761 |
Â
msgid "Default spacing between columns in each row."
|
762 |
Â
msgstr ""
|
763 |
Â
|
764 |
+
#: inc/settings.php:444
|
765 |
Â
msgid "Full Width Container"
|
766 |
Â
msgstr ""
|
767 |
Â
|
768 |
+
#: inc/settings.php:445
|
769 |
Â
msgid "The container used for the full width layout."
|
770 |
Â
msgstr ""
|
771 |
Â
|
772 |
+
#: inc/settings.php:452
|
773 |
Â
msgid "Content"
|
774 |
Â
msgstr ""
|
775 |
Â
|
776 |
+
#: inc/settings.php:458
|
777 |
Â
msgid "Copy Content"
|
778 |
Â
msgstr ""
|
779 |
Â
|
780 |
+
#: inc/settings.php:459
|
781 |
Â
msgid "Copy content from Page Builder to post content."
|
782 |
Â
msgstr ""
|
783 |
Â
|
784 |
+
#: inc/settings.php:464
|
785 |
Â
msgid "Copy Styles"
|
786 |
Â
msgstr ""
|
787 |
Â
|
788 |
+
#: inc/settings.php:465
|
789 |
Â
msgid "Include styles into your Post Content. This keeps page layouts, even when Page Builder is deactivated."
|
790 |
Â
msgstr ""
|
791 |
Â
|
792 |
+
#: inc/settings.php:518, inc/styles-admin.php:273
|
793 |
Â
msgid "Enabled"
|
794 |
Â
msgstr ""
|
795 |
Â
|
1021 |
Â
msgid "Collapse Order"
|
1022 |
Â
msgstr ""
|
1023 |
Â
|
1024 |
+
#: inc/styles.php:250, widgets/widgets.php:635, widgets/widgets.php:757, inc/widgets/post-loop.php:355
|
1025 |
Â
msgid "Default"
|
1026 |
Â
msgstr ""
|
1027 |
Â
|
1337 |
Â
msgid "%s Style"
|
1338 |
Â
msgstr ""
|
1339 |
Â
|
1340 |
+
#: widgets/widgets.php:594, inc/widgets/post-loop.php:313
|
1341 |
Â
msgid "Post Type"
|
1342 |
Â
msgstr ""
|
1343 |
Â
|
1344 |
+
#: widgets/widgets.php:601, inc/widgets/post-loop.php:322
|
1345 |
Â
msgid "Posts Per Page"
|
1346 |
Â
msgstr ""
|
1347 |
Â
|
1348 |
+
#: widgets/widgets.php:606, inc/widgets/post-loop.php:327
|
1349 |
Â
msgid "Order By"
|
1350 |
Â
msgstr ""
|
1351 |
Â
|
1352 |
+
#: widgets/widgets.php:608, widgets/widgets.php:783, inc/widgets/post-content.php:60, inc/widgets/post-loop.php:329
|
1353 |
Â
msgid "None"
|
1354 |
Â
msgstr ""
|
1355 |
Â
|
1356 |
+
#: widgets/widgets.php:609, inc/widgets/post-loop.php:330
|
1357 |
Â
msgid "Post ID"
|
1358 |
Â
msgstr ""
|
1359 |
Â
|
1360 |
+
#: widgets/widgets.php:610, inc/widgets/post-loop.php:331
|
1361 |
Â
msgid "Author"
|
1362 |
Â
msgstr ""
|
1363 |
Â
|
1364 |
+
#: widgets/widgets.php:611, widgets/widgets.php:612, inc/widgets/post-loop.php:332, inc/widgets/post-loop.php:333, widgets/widgets/testimonial/testimonial.php:15
|
1365 |
Â
msgid "Name"
|
1366 |
Â
msgstr ""
|
1367 |
Â
|
1368 |
+
#: widgets/widgets.php:613, inc/widgets/post-loop.php:334
|
1369 |
Â
msgid "Date"
|
1370 |
Â
msgstr ""
|
1371 |
Â
|
1372 |
+
#: widgets/widgets.php:614, inc/widgets/post-loop.php:335
|
1373 |
Â
msgid "Modified"
|
1374 |
Â
msgstr ""
|
1375 |
Â
|
1376 |
+
#: widgets/widgets.php:615, inc/widgets/post-loop.php:336
|
1377 |
Â
msgid "Parent"
|
1378 |
Â
msgstr ""
|
1379 |
Â
|
1380 |
+
#: widgets/widgets.php:616, inc/widgets/post-loop.php:337
|
1381 |
Â
msgid "Random"
|
1382 |
Â
msgstr ""
|
1383 |
Â
|
1384 |
+
#: widgets/widgets.php:617, inc/widgets/post-loop.php:338
|
1385 |
Â
msgid "Comment Count"
|
1386 |
Â
msgstr ""
|
1387 |
Â
|
1388 |
+
#: widgets/widgets.php:618, inc/widgets/post-loop.php:339
|
1389 |
Â
msgid "Menu Order"
|
1390 |
Â
msgstr ""
|
1391 |
Â
|
1392 |
+
#: widgets/widgets.php:624, inc/widgets/post-loop.php:345
|
1393 |
Â
msgid "Order"
|
1394 |
Â
msgstr ""
|
1395 |
Â
|
1396 |
+
#: widgets/widgets.php:626, inc/widgets/post-loop.php:348
|
1397 |
Â
msgid "Ascending"
|
1398 |
Â
msgstr ""
|
1399 |
Â
|
1400 |
+
#: widgets/widgets.php:627, inc/widgets/post-loop.php:347
|
1401 |
Â
msgid "Descending"
|
1402 |
Â
msgstr ""
|
1403 |
Â
|
1404 |
+
#: widgets/widgets.php:633, inc/widgets/post-loop.php:353
|
1405 |
Â
msgid "Sticky Posts"
|
1406 |
Â
msgstr ""
|
1407 |
Â
|
1408 |
+
#: widgets/widgets.php:636, inc/widgets/post-loop.php:356
|
1409 |
Â
msgid "Ignore Sticky"
|
1410 |
Â
msgstr ""
|
1411 |
Â
|
1412 |
+
#: widgets/widgets.php:637, inc/widgets/post-loop.php:357
|
1413 |
Â
msgid "Exclude Sticky"
|
1414 |
Â
msgstr ""
|
1415 |
Â
|
1416 |
+
#: widgets/widgets.php:638, inc/widgets/post-loop.php:358
|
1417 |
Â
msgid "Only Sticky"
|
1418 |
Â
msgstr ""
|
1419 |
Â
|
1421 |
Â
msgid "Additional Arguments"
|
1422 |
Â
msgstr ""
|
1423 |
Â
|
1424 |
+
#: widgets/widgets.php:648, inc/widgets/post-loop.php:370
|
1425 |
Â
msgid "Additional query arguments. See 1{query_posts}."
|
1426 |
Â
msgstr ""
|
1427 |
Â
|
1610 |
Â
msgid "Displays content from the current post."
|
1611 |
Â
msgstr ""
|
1612 |
Â
|
1613 |
+
#: inc/widgets/post-content.php:61, inc/widgets/post-loop-helper.php:41, inc/widgets/post-loop.php:276, widgets/widgets/call-to-action/call-to-action.php:15, widgets/widgets/list/list.php:15, widgets/widgets/price-box/price-box.php:15
|
1614 |
Â
msgid "Title"
|
1615 |
Â
msgstr ""
|
1616 |
Â
|
1630 |
Â
msgid "Displays a post loop."
|
1631 |
Â
msgstr ""
|
1632 |
Â
|
1633 |
+
#: inc/widgets/post-loop-helper.php:45, inc/widgets/post-loop.php:280
|
1634 |
Â
msgid "Template"
|
1635 |
Â
msgstr ""
|
1636 |
Â
|
1637 |
+
#: inc/widgets/post-loop-helper.php:52, inc/widgets/post-loop.php:298
|
1638 |
Â
msgid "If the template supports it, cut posts and display the more link."
|
1639 |
Â
msgstr ""
|
1640 |
Â
|
1641 |
+
#: inc/widgets/post-loop.php:246
|
1642 |
Â
msgid "Your theme doesn't have any post loops."
|
1643 |
Â
msgstr ""
|
1644 |
Â
|
1645 |
+
#: inc/widgets/post-loop.php:296
|
1646 |
Â
msgid "More Link"
|
1647 |
Â
msgstr ""
|
1648 |
Â
|
1649 |
+
#: inc/widgets/post-loop.php:340
|
1650 |
Â
msgid "Post In Order"
|
1651 |
Â
msgstr ""
|
1652 |
Â
|
1653 |
+
#: inc/widgets/post-loop.php:363
|
1654 |
Â
msgid "Additional "
|
1655 |
Â
msgstr ""
|
1656 |
Â
|
license.txt
CHANGED
File without changes
|
readme.txt
CHANGED
@@ -2,8 +2,9 @@
|
|
2 |
Â
Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
|
3 |
Â
Requires at least: 4.7
|
4 |
Â
Tested up to: 5.5
|
5 |
-
|
6 |
-
|
Â
|
|
7 |
Â
License: GPLv3
|
8 |
Â
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
Â
Donate link: https://siteorigin.com/downloads/premium/
|
@@ -96,6 +97,23 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.
|
|
96 |
Â
|
97 |
Â
== Changelog ==
|
98 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
99 |
Â
= 2.11.2 - 12 August 2020 =
|
100 |
Â
* Updated build scripts.
|
101 |
Â
|
2 |
Â
Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
|
3 |
Â
Requires at least: 4.7
|
4 |
Â
Tested up to: 5.5
|
5 |
+
Requires PHP: 5.6.20
|
6 |
+
Stable tag: 2.11.3
|
7 |
+
Build time: 2020-09-14T15:27:03+02:00
|
8 |
Â
License: GPLv3
|
9 |
Â
License URI: http://www.gnu.org/licenses/gpl.html
|
10 |
Â
Donate link: https://siteorigin.com/downloads/premium/
|
97 |
Â
|
98 |
Â
== Changelog ==
|
99 |
Â
|
100 |
+
= 2.11.3 - 14 September 2020 =
|
101 |
+
* Block Editor: Added SEO support for multiple Layout Block instances.
|
102 |
+
* Yoast SEO Sitemap: Added images added using Page Builder.
|
103 |
+
* Prevented potential `Are you sure you want to navigate away?` notice.
|
104 |
+
* Post Loop: Resolved `Undefined index` notice when used outside of Page Builder.
|
105 |
+
* Android Chrome: Improved edit widget touch detection.
|
106 |
+
* Yoast SEO: Resolved version `14.6` integration issue.
|
107 |
+
* Block Editor: Used new categories for the Layout Block for WP 5.5+.
|
108 |
+
* Block Editor: Resolved potential Layout Block data validation issue by running `wp_targeted_link_rel` on the generated preview content.
|
109 |
+
* Block Editor: Added preview support for the Layout Block.
|
110 |
+
* Block Editor: Updated translation functions to avoid potential conflicts.
|
111 |
+
* Block Editor: Added the page name and block number to Layout Block JSON export files.
|
112 |
+
* Block Editor: Improved SEO plugin support.
|
113 |
+
* Added a global `Row Mobile Bottom Margin` setting at `Settings > Page Builder > Layout`.
|
114 |
+
* Ensured Yoast SEO is ready before running compatibility functionality.
|
115 |
+
* Global Settings: Resolved a jQuery Migrate Helper warning.
|
116 |
+
|
117 |
Â
= 2.11.2 - 12 August 2020 =
|
118 |
Â
* Updated build scripts.
|
119 |
Â
|
settings/admin-settings.css
CHANGED
File without changes
|
settings/admin-settings.js
CHANGED
@@ -16,8 +16,7 @@ jQuery( function($){
|
|
16 |
Â
.animate({'margin-top' : 0, 'opacity': opacity}, 280 + 40*(4 - v) );
|
17 |
Â
}, 150 + 225 * (4 - v) );
|
18 |
Â
});
|
19 |
-
})
|
20 |
-
.each(function() { if(this.complete) { $(this).load(); } });
|
21 |
Â
|
22 |
Â
// Settings page tabbing
|
23 |
Â
|
@@ -224,4 +223,4 @@ jQuery( function($){
|
|
224 |
Â
$.fn.fitVids._count = 0;
|
225 |
Â
|
226 |
Â
// Works with either jQuery or Zepto
|
227 |
-
})( window.jQuery || window.Zepto );
|
16 |
Â
.animate({'margin-top' : 0, 'opacity': opacity}, 280 + 40*(4 - v) );
|
17 |
Â
}, 150 + 225 * (4 - v) );
|
18 |
Â
});
|
19 |
+
});
|
Â
|
|
20 |
Â
|
21 |
Â
// Settings page tabbing
|
22 |
Â
|
223 |
Â
$.fn.fitVids._count = 0;
|
224 |
Â
|
225 |
Â
// Works with either jQuery or Zepto
|
226 |
+
})( window.jQuery || window.Zepto );
|
settings/admin-settings.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery((function(t){t(".settings-banner img").hide().eq(0).one("load",(function(){t.each([1,2,3],(function(e,i){var s=t(".settings-banner img.layer-"+i),n=s.css("opacity");setTimeout((function(){s.show().css({"margin-top":-5,opacity:0}).animate({"margin-top":0,opacity:n},280+40*(4-i))}),150+225*(4-i))}))}))
|
1 |
+
jQuery((function(t){t(".settings-banner img").hide().eq(0).one("load",(function(){t.each([1,2,3],(function(e,i){var s=t(".settings-banner img.layer-"+i),n=s.css("opacity");setTimeout((function(){s.show().css({"margin-top":-5,opacity:0}).animate({"margin-top":0,opacity:n},280+40*(4-i))}),150+225*(4-i))}))})),t(".settings-nav li a").click((function(e){e.preventDefault();var i=t(this);t(".settings-nav li a").not(i).closest("li").removeClass("active"),i.closest("li").addClass("active");var s=i.attr("href").split("#")[1],n=t("#panels-settings-section-"+s);t("#panels-settings-sections .panels-settings-section").not(n).hide(),n.show(),t('#panels-settings-page input[type="submit"]').css({visibility:"welcome"===s?"hidden":"visible"}),setUserSetting("siteorigin_panels_setting_tab",s)})),window.location.hash&&t('.settings-nav li a[href="'+window.location.hash+'"]').click(),t("#panels-settings-section-welcome").fitVids();var e=getUserSetting("siteorigin_panels_setting_tab");""===e?t(".settings-nav li a").first().click():t('.settings-nav li a[href="#'+e+'"]').first().click();var i=function(){var e=t(this),i=t("#panels-settings-search .results"),s=e.val();if(""===s)return i.empty().hide(),!1;var n=[];t("#panels-settings-sections .panels-setting").each((function(){var e=t(this),i=0,a=e.find("label").html().toLowerCase().indexOf(s),r=e.find(".description").data("keywords").toLowerCase().indexOf(s),o=e.find(".description").html().toLowerCase().indexOf(s);0===a?i+=10:-1!==a&&(i+=7),0===r?i+=4:-1!==r&&(i+=3),0===o?i+=2:-1!==o&&(i+=1),i>0&&(n.push(e),e.data("isMatch",i))})),i.empty(),n.length>0?(i.show(),n.sort((function(t,e){return e.data("isMatch")-t.data("isMatch")})),n=n.slice(0,8),t.each(n,(function(e,s){t("#panels-settings-search .results").append(t("<li></li>").html(s.find("label").html()).click((function(){var e;t('.settings-nav li a[href="#'+(e=s).closest(".panels-settings-section").data("section")+'"]').first().click(),e.addClass("highlighted"),e.find("label").css("border-left-width",0).animate({"border-left-width":5},"normal").delay(4e3).animate({"border-left-width":0},"normal",(function(){e.removeClass("highlighted")})),e.find("input,textarea").focus(),i.fadeOut("fast"),t("#panels-settings-search input").blur()})))}))):i.hide()};t("#panels-settings-search input").keyup(i).click(i).blur((function(){t("#panels-settings-search .results").fadeOut("fast")}))})),function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("div");n.innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>',s.appendChild(n.childNodes[1])}return e&&t.extend(i,e),this.each((function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var s=".fitvidsignore";i.ignore&&(s=s+", "+i.ignore);var n=t(this).find(e.join(","));(n=(n=n.not("object object")).not(s)).each((function(){var e=t(this);if(!(e.parents(s).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i=("object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height())/(isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10));if(!e.attr("name")){var n="fitvid"+t.fn.fitVids._count;e.attr("name",n),t.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*i+"%"),e.removeAttr("height").removeAttr("width")}}))}))},t.fn.fitVids._count=0}(window.jQuery||window.Zepto);
|
settings/images/icon-layer.png
CHANGED
File without changes
|
settings/tpl/help.php
CHANGED
File without changes
|
settings/tpl/settings.php
CHANGED
File without changes
|
siteorigin-panels.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Â
Plugin Name: Page Builder by SiteOrigin
|
4 |
Â
Plugin URI: https://siteorigin.com/page-builder/
|
5 |
Â
Description: A drag and drop, responsive page builder that simplifies building your website.
|
6 |
-
Version: 2.11.
|
7 |
Â
Author: SiteOrigin
|
8 |
Â
Author URI: https://siteorigin.com
|
9 |
Â
License: GPL3
|
@@ -11,7 +11,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
|
|
11 |
Â
Donate link: http://siteorigin.com/page-builder/#donate
|
12 |
Â
*/
|
13 |
Â
|
14 |
-
define( 'SITEORIGIN_PANELS_VERSION', '2.11.
|
15 |
Â
if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
|
16 |
Â
define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
|
17 |
Â
}
|
@@ -31,13 +31,13 @@ class SiteOrigin_Panels {
|
|
31 |
Â
add_action( 'plugins_loaded', array( $this, 'init' ) );
|
32 |
Â
add_action( 'plugins_loaded', array( $this, 'init_compat' ), 100 );
|
33 |
Â
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100 );
|
34 |
-
|
35 |
Â
add_action('widgets_init', array( $this, 'widgets_init' ) );
|
36 |
Â
|
37 |
Â
add_filter( 'body_class', array( $this, 'body_class' ) );
|
38 |
Â
add_filter( 'siteorigin_panels_data', array( $this, 'process_panels_data' ), 5 );
|
39 |
Â
add_filter( 'siteorigin_panels_widget_class', array( $this, 'fix_namespace_escaping' ), 5 );
|
40 |
-
|
41 |
Â
add_action( 'activated_plugin', array($this, 'activation_flag_redirect') );
|
42 |
Â
add_action( 'admin_init', array($this, 'activation_do_redirect') );
|
43 |
Â
|
@@ -58,7 +58,7 @@ class SiteOrigin_Panels {
|
|
58 |
Â
if ( self::is_live_editor() ) {
|
59 |
Â
SiteOrigin_Panels_Live_Editor::single();
|
60 |
Â
}
|
61 |
-
|
62 |
Â
SiteOrigin_Panels::renderer();
|
63 |
Â
SiteOrigin_Panels_Styles_Admin::single();
|
64 |
Â
|
@@ -67,22 +67,22 @@ class SiteOrigin_Panels {
|
|
67 |
Â
}
|
68 |
Â
|
69 |
Â
SiteOrigin_Panels_Widget_Shortcode::init();
|
70 |
-
|
71 |
Â
// We need to generate fresh post content
|
72 |
Â
add_filter( 'the_content', array( $this, 'generate_post_content' ) );
|
73 |
Â
add_filter( 'woocommerce_format_content', array( $this, 'generate_woocommerce_content' ) );
|
74 |
Â
add_filter( 'wp_enqueue_scripts', array( $this, 'generate_post_css' ) );
|
75 |
-
|
76 |
Â
// Remove the default excerpt function
|
77 |
Â
add_filter( 'get_the_excerpt', array( $this, 'generate_post_excerpt' ), 9 );
|
78 |
-
|
79 |
Â
// Content cache has been removed. SiteOrigin_Panels_Cache_Renderer just deletes any existing caches.
|
80 |
Â
SiteOrigin_Panels_Cache_Renderer::single();
|
81 |
-
|
82 |
Â
if ( function_exists( 'register_block_type' ) ) {
|
83 |
Â
SiteOrigin_Panels_Compat_Layout_Block::single();
|
84 |
Â
}
|
85 |
-
|
86 |
Â
define( 'SITEORIGIN_PANELS_BASE_FILE', __FILE__ );
|
87 |
Â
}
|
88 |
Â
|
@@ -91,7 +91,7 @@ class SiteOrigin_Panels {
|
|
91 |
Â
static $single;
|
92 |
Â
return empty( $single ) ? $single = new self() : $single;
|
93 |
Â
}
|
94 |
-
|
95 |
Â
/**
|
96 |
Â
* Get an instance of the renderer
|
97 |
Â
*
|
@@ -104,11 +104,11 @@ class SiteOrigin_Panels {
|
|
104 |
Â
case 'always':
|
105 |
Â
$renderer = SiteOrigin_Panels_Renderer_Legacy::single();
|
106 |
Â
break;
|
107 |
-
|
108 |
Â
case 'never':
|
109 |
Â
$renderer = SiteOrigin_Panels_Renderer::single();
|
110 |
Â
break;
|
111 |
-
|
112 |
Â
default :
|
113 |
Â
$renderer = self::is_legacy_browser() ?
|
114 |
Â
SiteOrigin_Panels_Renderer_Legacy::single() :
|
@@ -116,14 +116,14 @@ class SiteOrigin_Panels {
|
|
116 |
Â
break;
|
117 |
Â
}
|
118 |
Â
}
|
119 |
-
|
120 |
Â
return $renderer;
|
121 |
Â
}
|
122 |
-
|
123 |
Â
public static function is_legacy_browser(){
|
124 |
Â
$agent = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
125 |
Â
if( empty( $agent ) ) return false;
|
126 |
-
|
127 |
Â
return
|
128 |
Â
// IE lte 11
|
129 |
Â
( preg_match('/Trident\/(?P<v>\d+)/i', $agent, $B) && $B['v'] <= 7 ) ||
|
@@ -156,7 +156,7 @@ class SiteOrigin_Panels {
|
|
156 |
Â
$filename = str_replace( array( 'SiteOrigin_Panels_', '_' ), array( '', '-' ), $class );
|
157 |
Â
$filename = plugin_dir_path( __FILE__ ) . 'inc/' . strtolower( $filename ) . '.php';
|
158 |
Â
}
|
159 |
-
|
160 |
Â
if ( ! empty( $filename ) && file_exists( $filename ) ) {
|
161 |
Â
include $filename;
|
162 |
Â
}
|
@@ -202,6 +202,11 @@ class SiteOrigin_Panels {
|
|
202 |
Â
require_once plugin_dir_path( __FILE__ ) . 'compat/widget-options.php';
|
203 |
Â
}
|
204 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
205 |
Â
// Compatibility with AMP plugin
|
206 |
Â
if ( is_admin() && function_exists( 'amp_bootstrap_plugin' ) ) {
|
207 |
Â
require_once plugin_dir_path( __FILE__ ) . 'compat/amp.php';
|
@@ -285,7 +290,7 @@ class SiteOrigin_Panels {
|
|
285 |
Â
|
286 |
Â
return $panels_data;
|
287 |
Â
}
|
288 |
-
|
289 |
Â
/**
|
290 |
Â
* Generate post content for WooCommerce shop page if it's using a PB layout.
|
291 |
Â
*
|
@@ -299,7 +304,7 @@ class SiteOrigin_Panels {
|
|
299 |
Â
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
|
300 |
Â
return $this->generate_post_content( $content );
|
301 |
Â
}
|
302 |
-
|
303 |
Â
return $content;
|
304 |
Â
}
|
305 |
Â
|
@@ -321,9 +326,9 @@ class SiteOrigin_Panels {
|
|
321 |
Â
if ( ! apply_filters( 'siteorigin_panels_filter_content_enabled', true ) ) {
|
322 |
Â
return $content;
|
323 |
Â
}
|
324 |
-
|
325 |
Â
$post_id = $this->get_post_id();
|
326 |
-
|
327 |
Â
// Check if this post has panels_data
|
328 |
Â
if ( get_post_meta( $post_id, 'panels_data', true ) ) {
|
329 |
Â
$panel_content = SiteOrigin_Panels::renderer()->render(
|
@@ -357,7 +362,7 @@ class SiteOrigin_Panels {
|
|
357 |
Â
|
358 |
Â
return $content;
|
359 |
Â
}
|
360 |
-
|
361 |
Â
/**
|
362 |
Â
* Generate an excerpt for the current post, if possible.
|
363 |
Â
*
|
@@ -370,9 +375,9 @@ class SiteOrigin_Panels {
|
|
370 |
Â
if ( ( empty( $post ) && ! in_the_loop() ) || $text !== '' ) {
|
371 |
Â
return $text;
|
372 |
Â
}
|
373 |
-
|
374 |
Â
$post_id = $this->get_post_id();
|
375 |
-
|
376 |
Â
// Check if this post has panels_data
|
377 |
Â
$panels_data = get_post_meta( $post_id, 'panels_data', true );
|
378 |
Â
if ( $panels_data && ! empty( $panels_data['widgets'] ) ) {
|
@@ -396,19 +401,19 @@ class SiteOrigin_Panels {
|
|
396 |
Â
}
|
397 |
Â
}
|
398 |
Â
}
|
399 |
-
|
400 |
Â
$text = strip_shortcodes( $raw_excerpt );
|
401 |
Â
$text = str_replace( ']]>', ']]>', $text );
|
402 |
-
|
403 |
Â
$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
|
404 |
Â
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
|
405 |
Â
}
|
406 |
-
|
407 |
Â
return $text;
|
408 |
Â
}
|
409 |
-
|
410 |
Â
private function get_localized_word_count( $text ) {
|
411 |
-
|
412 |
Â
// From the core `wp_trim_words` function to get localized word count.
|
413 |
Â
$text = wp_strip_all_tags( $text );
|
414 |
Â
if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
|
@@ -418,29 +423,29 @@ class SiteOrigin_Panels {
|
|
418 |
Â
} else {
|
419 |
Â
$words_array = preg_split( "/[\n\r\t ]+/", $text, -1, PREG_SPLIT_NO_EMPTY );
|
420 |
Â
}
|
421 |
-
|
422 |
Â
return count( $words_array );
|
423 |
Â
}
|
424 |
-
|
425 |
Â
/**
|
426 |
Â
* Generate CSS for the current post
|
427 |
Â
*/
|
428 |
Â
public function generate_post_css() {
|
429 |
Â
$post_id = $this->get_post_id();
|
430 |
-
|
431 |
Â
if( is_singular() && get_post_meta( $post_id, 'panels_data', true ) ) {
|
432 |
Â
$renderer = SiteOrigin_Panels::renderer();
|
433 |
Â
$renderer->add_inline_css( $post_id, $renderer->generate_css( $post_id ) );
|
434 |
Â
}
|
435 |
Â
}
|
436 |
-
|
437 |
Â
/**
|
438 |
Â
* Get the post id for the current post.
|
439 |
Â
*/
|
440 |
Â
function get_post_id() {
|
441 |
-
|
442 |
Â
$post_id = get_the_ID();
|
443 |
-
|
444 |
Â
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
|
445 |
Â
$post_id = wc_get_page_id( 'shop' );
|
446 |
Â
}
|
@@ -452,7 +457,7 @@ class SiteOrigin_Panels {
|
|
452 |
Â
$post_id = $preview_post->ID;
|
453 |
Â
}
|
454 |
Â
}
|
455 |
-
|
456 |
Â
return $post_id;
|
457 |
Â
}
|
458 |
Â
|
@@ -525,7 +530,7 @@ class SiteOrigin_Panels {
|
|
525 |
Â
|
526 |
Â
return $admin_bar;
|
527 |
Â
}
|
528 |
-
|
529 |
Â
function widgets_init(){
|
530 |
Â
register_widget( 'SiteOrigin_Panels_Widgets_PostContent' );
|
531 |
Â
register_widget( 'SiteOrigin_Panels_Widgets_PostLoop' );
|
@@ -587,7 +592,7 @@ class SiteOrigin_Panels {
|
|
587 |
Â
|
588 |
Â
return $panels_data;
|
589 |
Â
}
|
590 |
-
|
591 |
Â
/**
|
592 |
Â
* Fix class names that have been incorrectly escaped
|
593 |
Â
*
|
@@ -620,7 +625,7 @@ class SiteOrigin_Panels {
|
|
620 |
Â
public function strip_before_js(){
|
621 |
Â
?><script type="text/javascript">document.body.className = document.body.className.replace("siteorigin-panels-before-js","");</script><?php
|
622 |
Â
}
|
623 |
-
|
624 |
Â
/**
|
625 |
Â
* Should we display premium addon messages
|
626 |
Â
*
|
@@ -648,8 +653,8 @@ class SiteOrigin_Panels {
|
|
648 |
Â
}
|
649 |
Â
return $url;
|
650 |
Â
}
|
651 |
-
|
652 |
-
|
653 |
Â
/**
|
654 |
Â
* Get the registered widget instance by it's class name or the hash generated when it was registered.
|
655 |
Â
*
|
@@ -670,7 +675,7 @@ class SiteOrigin_Panels {
|
|
670 |
Â
}
|
671 |
Â
return null;
|
672 |
Â
}
|
673 |
-
|
674 |
Â
/**
|
675 |
Â
* Flag redirect to welcome page after activation
|
676 |
Â
*
|
3 |
Â
Plugin Name: Page Builder by SiteOrigin
|
4 |
Â
Plugin URI: https://siteorigin.com/page-builder/
|
5 |
Â
Description: A drag and drop, responsive page builder that simplifies building your website.
|
6 |
+
Version: 2.11.3
|
7 |
Â
Author: SiteOrigin
|
8 |
Â
Author URI: https://siteorigin.com
|
9 |
Â
License: GPL3
|
11 |
Â
Donate link: http://siteorigin.com/page-builder/#donate
|
12 |
Â
*/
|
13 |
Â
|
14 |
+
define( 'SITEORIGIN_PANELS_VERSION', '2.11.3' );
|
15 |
Â
if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
|
16 |
Â
define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
|
17 |
Â
}
|
31 |
Â
add_action( 'plugins_loaded', array( $this, 'init' ) );
|
32 |
Â
add_action( 'plugins_loaded', array( $this, 'init_compat' ), 100 );
|
33 |
Â
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100 );
|
34 |
+
|
35 |
Â
add_action('widgets_init', array( $this, 'widgets_init' ) );
|
36 |
Â
|
37 |
Â
add_filter( 'body_class', array( $this, 'body_class' ) );
|
38 |
Â
add_filter( 'siteorigin_panels_data', array( $this, 'process_panels_data' ), 5 );
|
39 |
Â
add_filter( 'siteorigin_panels_widget_class', array( $this, 'fix_namespace_escaping' ), 5 );
|
40 |
+
|
41 |
Â
add_action( 'activated_plugin', array($this, 'activation_flag_redirect') );
|
42 |
Â
add_action( 'admin_init', array($this, 'activation_do_redirect') );
|
43 |
Â
|
58 |
Â
if ( self::is_live_editor() ) {
|
59 |
Â
SiteOrigin_Panels_Live_Editor::single();
|
60 |
Â
}
|
61 |
+
|
62 |
Â
SiteOrigin_Panels::renderer();
|
63 |
Â
SiteOrigin_Panels_Styles_Admin::single();
|
64 |
Â
|
67 |
Â
}
|
68 |
Â
|
69 |
Â
SiteOrigin_Panels_Widget_Shortcode::init();
|
70 |
+
|
71 |
Â
// We need to generate fresh post content
|
72 |
Â
add_filter( 'the_content', array( $this, 'generate_post_content' ) );
|
73 |
Â
add_filter( 'woocommerce_format_content', array( $this, 'generate_woocommerce_content' ) );
|
74 |
Â
add_filter( 'wp_enqueue_scripts', array( $this, 'generate_post_css' ) );
|
75 |
+
|
76 |
Â
// Remove the default excerpt function
|
77 |
Â
add_filter( 'get_the_excerpt', array( $this, 'generate_post_excerpt' ), 9 );
|
78 |
+
|
79 |
Â
// Content cache has been removed. SiteOrigin_Panels_Cache_Renderer just deletes any existing caches.
|
80 |
Â
SiteOrigin_Panels_Cache_Renderer::single();
|
81 |
+
|
82 |
Â
if ( function_exists( 'register_block_type' ) ) {
|
83 |
Â
SiteOrigin_Panels_Compat_Layout_Block::single();
|
84 |
Â
}
|
85 |
+
|
86 |
Â
define( 'SITEORIGIN_PANELS_BASE_FILE', __FILE__ );
|
87 |
Â
}
|
88 |
Â
|
91 |
Â
static $single;
|
92 |
Â
return empty( $single ) ? $single = new self() : $single;
|
93 |
Â
}
|
94 |
+
|
95 |
Â
/**
|
96 |
Â
* Get an instance of the renderer
|
97 |
Â
*
|
104 |
Â
case 'always':
|
105 |
Â
$renderer = SiteOrigin_Panels_Renderer_Legacy::single();
|
106 |
Â
break;
|
107 |
+
|
108 |
Â
case 'never':
|
109 |
Â
$renderer = SiteOrigin_Panels_Renderer::single();
|
110 |
Â
break;
|
111 |
+
|
112 |
Â
default :
|
113 |
Â
$renderer = self::is_legacy_browser() ?
|
114 |
Â
SiteOrigin_Panels_Renderer_Legacy::single() :
|
116 |
Â
break;
|
117 |
Â
}
|
118 |
Â
}
|
119 |
+
|
120 |
Â
return $renderer;
|
121 |
Â
}
|
122 |
+
|
123 |
Â
public static function is_legacy_browser(){
|
124 |
Â
$agent = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
125 |
Â
if( empty( $agent ) ) return false;
|
126 |
+
|
127 |
Â
return
|
128 |
Â
// IE lte 11
|
129 |
Â
( preg_match('/Trident\/(?P<v>\d+)/i', $agent, $B) && $B['v'] <= 7 ) ||
|
156 |
Â
$filename = str_replace( array( 'SiteOrigin_Panels_', '_' ), array( '', '-' ), $class );
|
157 |
Â
$filename = plugin_dir_path( __FILE__ ) . 'inc/' . strtolower( $filename ) . '.php';
|
158 |
Â
}
|
159 |
+
|
160 |
Â
if ( ! empty( $filename ) && file_exists( $filename ) ) {
|
161 |
Â
include $filename;
|
162 |
Â
}
|
202 |
Â
require_once plugin_dir_path( __FILE__ ) . 'compat/widget-options.php';
|
203 |
Â
}
|
204 |
Â
|
205 |
+
// Compatibility with Yoast Sitemap.
|
206 |
+
if ( defined( 'WPSEO_FILE' ) ) {
|
207 |
+
require_once plugin_dir_path( __FILE__ ) . 'compat/yoast-sitemap.php';
|
208 |
+
}
|
209 |
+
|
210 |
Â
// Compatibility with AMP plugin
|
211 |
Â
if ( is_admin() && function_exists( 'amp_bootstrap_plugin' ) ) {
|
212 |
Â
require_once plugin_dir_path( __FILE__ ) . 'compat/amp.php';
|
290 |
Â
|
291 |
Â
return $panels_data;
|
292 |
Â
}
|
293 |
+
|
294 |
Â
/**
|
295 |
Â
* Generate post content for WooCommerce shop page if it's using a PB layout.
|
296 |
Â
*
|
304 |
Â
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
|
305 |
Â
return $this->generate_post_content( $content );
|
306 |
Â
}
|
307 |
+
|
308 |
Â
return $content;
|
309 |
Â
}
|
310 |
Â
|
326 |
Â
if ( ! apply_filters( 'siteorigin_panels_filter_content_enabled', true ) ) {
|
327 |
Â
return $content;
|
328 |
Â
}
|
329 |
+
|
330 |
Â
$post_id = $this->get_post_id();
|
331 |
+
|
332 |
Â
// Check if this post has panels_data
|
333 |
Â
if ( get_post_meta( $post_id, 'panels_data', true ) ) {
|
334 |
Â
$panel_content = SiteOrigin_Panels::renderer()->render(
|
362 |
Â
|
363 |
Â
return $content;
|
364 |
Â
}
|
365 |
+
|
366 |
Â
/**
|
367 |
Â
* Generate an excerpt for the current post, if possible.
|
368 |
Â
*
|
375 |
Â
if ( ( empty( $post ) && ! in_the_loop() ) || $text !== '' ) {
|
376 |
Â
return $text;
|
377 |
Â
}
|
378 |
+
|
379 |
Â
$post_id = $this->get_post_id();
|
380 |
+
|
381 |
Â
// Check if this post has panels_data
|
382 |
Â
$panels_data = get_post_meta( $post_id, 'panels_data', true );
|
383 |
Â
if ( $panels_data && ! empty( $panels_data['widgets'] ) ) {
|
401 |
Â
}
|
402 |
Â
}
|
403 |
Â
}
|
404 |
+
|
405 |
Â
$text = strip_shortcodes( $raw_excerpt );
|
406 |
Â
$text = str_replace( ']]>', ']]>', $text );
|
407 |
+
|
408 |
Â
$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
|
409 |
Â
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
|
410 |
Â
}
|
411 |
+
|
412 |
Â
return $text;
|
413 |
Â
}
|
414 |
+
|
415 |
Â
private function get_localized_word_count( $text ) {
|
416 |
+
|
417 |
Â
// From the core `wp_trim_words` function to get localized word count.
|
418 |
Â
$text = wp_strip_all_tags( $text );
|
419 |
Â
if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
|
423 |
Â
} else {
|
424 |
Â
$words_array = preg_split( "/[\n\r\t ]+/", $text, -1, PREG_SPLIT_NO_EMPTY );
|
425 |
Â
}
|
426 |
+
|
427 |
Â
return count( $words_array );
|
428 |
Â
}
|
429 |
+
|
430 |
Â
/**
|
431 |
Â
* Generate CSS for the current post
|
432 |
Â
*/
|
433 |
Â
public function generate_post_css() {
|
434 |
Â
$post_id = $this->get_post_id();
|
435 |
+
|
436 |
Â
if( is_singular() && get_post_meta( $post_id, 'panels_data', true ) ) {
|
437 |
Â
$renderer = SiteOrigin_Panels::renderer();
|
438 |
Â
$renderer->add_inline_css( $post_id, $renderer->generate_css( $post_id ) );
|
439 |
Â
}
|
440 |
Â
}
|
441 |
+
|
442 |
Â
/**
|
443 |
Â
* Get the post id for the current post.
|
444 |
Â
*/
|
445 |
Â
function get_post_id() {
|
446 |
+
|
447 |
Â
$post_id = get_the_ID();
|
448 |
+
|
449 |
Â
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
|
450 |
Â
$post_id = wc_get_page_id( 'shop' );
|
451 |
Â
}
|
457 |
Â
$post_id = $preview_post->ID;
|
458 |
Â
}
|
459 |
Â
}
|
460 |
+
|
461 |
Â
return $post_id;
|
462 |
Â
}
|
463 |
Â
|
530 |
Â
|
531 |
Â
return $admin_bar;
|
532 |
Â
}
|
533 |
+
|
534 |
Â
function widgets_init(){
|
535 |
Â
register_widget( 'SiteOrigin_Panels_Widgets_PostContent' );
|
536 |
Â
register_widget( 'SiteOrigin_Panels_Widgets_PostLoop' );
|
592 |
Â
|
593 |
Â
return $panels_data;
|
594 |
Â
}
|
595 |
+
|
596 |
Â
/**
|
597 |
Â
* Fix class names that have been incorrectly escaped
|
598 |
Â
*
|
625 |
Â
public function strip_before_js(){
|
626 |
Â
?><script type="text/javascript">document.body.className = document.body.className.replace("siteorigin-panels-before-js","");</script><?php
|
627 |
Â
}
|
628 |
+
|
629 |
Â
/**
|
630 |
Â
* Should we display premium addon messages
|
631 |
Â
*
|
653 |
Â
}
|
654 |
Â
return $url;
|
655 |
Â
}
|
656 |
+
|
657 |
+
|
658 |
Â
/**
|
659 |
Â
* Get the registered widget instance by it's class name or the hash generated when it was registered.
|
660 |
Â
*
|
675 |
Â
}
|
676 |
Â
return null;
|
677 |
Â
}
|
678 |
+
|
679 |
Â
/**
|
680 |
Â
* Flag redirect to welcome page after activation
|
681 |
Â
*
|
tpl/admin-home-page.php
CHANGED
File without changes
|
tpl/help.php
CHANGED
File without changes
|
tpl/js-templates.php
CHANGED
File without changes
|
tpl/metabox-panels.php
CHANGED
File without changes
|
widgets/img/checks/black.png
CHANGED
File without changes
|
widgets/img/checks/blue.png
CHANGED
File without changes
|
widgets/img/checks/charcoal.png
CHANGED
File without changes
|
widgets/img/checks/green.png
CHANGED
File without changes
|
widgets/img/checks/light.png
CHANGED
File without changes
|
widgets/img/checks/orange.png
CHANGED
File without changes
|
widgets/img/checks/pink.png
CHANGED
File without changes
|
widgets/img/checks/purple.png
CHANGED
File without changes
|
widgets/img/checks/slate.png
CHANGED
File without changes
|
widgets/img/checks/tirquoise.png
CHANGED
File without changes
|
widgets/img/textures/dark-dashed.png
CHANGED
File without changes
|
widgets/img/textures/light-dashed.png
CHANGED
File without changes
|
widgets/js/admin.js
CHANGED
File without changes
|
widgets/js/embedded-video.js
CHANGED
File without changes
|
widgets/js/jquery.fitvids.min.js
CHANGED
File without changes
|
widgets/less/functions.php
CHANGED
File without changes
|
widgets/lib/color.php
CHANGED
File without changes
|
widgets/lib/lessc.inc.php
CHANGED
File without changes
|
widgets/migration.php
CHANGED
File without changes
|
widgets/widgets.php
CHANGED
File without changes
|
widgets/widgets/animated-image/animated-image.php
CHANGED
File without changes
|
widgets/widgets/animated-image/js/main.js
CHANGED
File without changes
|
widgets/widgets/animated-image/js/onscreen.js
CHANGED
File without changes
|
widgets/widgets/animated-image/tpl/default.php
CHANGED
File without changes
|
widgets/widgets/button/button.php
CHANGED
File without changes
|
widgets/widgets/button/presets/simple.php
CHANGED
File without changes
|
widgets/widgets/button/styles/simple.less
CHANGED
File without changes
|
widgets/widgets/button/tpl/simple.php
CHANGED
File without changes
|
widgets/widgets/call-to-action/call-to-action.php
CHANGED
File without changes
|
widgets/widgets/call-to-action/presets/simple.php
CHANGED
File without changes
|
widgets/widgets/call-to-action/styles/simple.less
CHANGED
File without changes
|
widgets/widgets/call-to-action/tpl/simple.php
CHANGED
File without changes
|
widgets/widgets/list/list.php
CHANGED
File without changes
|
widgets/widgets/list/presets/simple.php
CHANGED
File without changes
|
widgets/widgets/list/styles/simple.less
CHANGED
File without changes
|
widgets/widgets/list/tpl/simple.php
CHANGED
File without changes
|
widgets/widgets/price-box/presets/simple.php
CHANGED
File without changes
|
widgets/widgets/price-box/price-box.php
CHANGED
File without changes
|
widgets/widgets/price-box/styles/simple.less
CHANGED
File without changes
|
widgets/widgets/price-box/tpl/simple.php
CHANGED
File without changes
|
widgets/widgets/testimonial/presets/simple.php
CHANGED
File without changes
|
widgets/widgets/testimonial/styles/simple.less
CHANGED
File without changes
|
widgets/widgets/testimonial/testimonial.php
CHANGED
File without changes
|
widgets/widgets/testimonial/tpl/simple.php
CHANGED
File without changes
|