Changeset 2104964
- Timestamp:
- 06/12/2019 06:10:08 PM (7 years ago)
- Location:
- siteorigin-panels
- Files:
-
- 8 added
- 8 deleted
- 21 edited
- 2 copied
-
tags/2.10.6 (copied) (copied from siteorigin-panels/trunk)
-
tags/2.10.6/compat/js/siteorigin-panels-layout-block.js (modified) (8 diffs)
-
tags/2.10.6/compat/js/siteorigin-panels-layout-block.min.js (modified) (1 diff)
-
tags/2.10.6/compat/layout-block.php (modified) (1 diff)
-
tags/2.10.6/inc/admin.php (modified) (4 diffs)
-
tags/2.10.6/inc/styles.php (modified) (2 diffs)
-
tags/2.10.6/inc/widgets/layout.php (modified) (1 diff)
-
tags/2.10.6/js/siteorigin-panels-2105.js (deleted)
-
tags/2.10.6/js/siteorigin-panels-2105.min.js (deleted)
-
tags/2.10.6/js/siteorigin-panels-2106.js (added)
-
tags/2.10.6/js/siteorigin-panels-2106.min.js (added)
-
tags/2.10.6/js/styling-2105.js (deleted)
-
tags/2.10.6/js/styling-2105.min.js (deleted)
-
tags/2.10.6/js/styling-2106.js (added)
-
tags/2.10.6/js/styling-2106.min.js (added)
-
tags/2.10.6/js/yoast-compat.js (modified) (3 diffs)
-
tags/2.10.6/js/yoast-compat.min.js (modified) (1 diff)
-
tags/2.10.6/lang/siteorigin-panels.pot (modified) (6 diffs)
-
tags/2.10.6/readme.txt (copied) (copied from siteorigin-panels/trunk/readme.txt) (2 diffs)
-
tags/2.10.6/siteorigin-panels.php (modified) (2 diffs)
-
trunk/compat/js/siteorigin-panels-layout-block.js (modified) (8 diffs)
-
trunk/compat/js/siteorigin-panels-layout-block.min.js (modified) (1 diff)
-
trunk/compat/layout-block.php (modified) (1 diff)
-
trunk/inc/admin.php (modified) (4 diffs)
-
trunk/inc/styles.php (modified) (2 diffs)
-
trunk/inc/widgets/layout.php (modified) (1 diff)
-
trunk/js/siteorigin-panels-2105.js (deleted)
-
trunk/js/siteorigin-panels-2105.min.js (deleted)
-
trunk/js/siteorigin-panels-2106.js (added)
-
trunk/js/siteorigin-panels-2106.min.js (added)
-
trunk/js/styling-2105.js (deleted)
-
trunk/js/styling-2105.min.js (deleted)
-
trunk/js/styling-2106.js (added)
-
trunk/js/styling-2106.min.js (added)
-
trunk/js/yoast-compat.js (modified) (3 diffs)
-
trunk/js/yoast-compat.min.js (modified) (1 diff)
-
trunk/lang/siteorigin-panels.pot (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/siteorigin-panels.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
siteorigin-panels/tags/2.10.6/compat/js/siteorigin-panels-layout-block.js
r2061744 r2104964 93 93 this.fetchPreview(this.props); 94 94 } else if (!this.previewInitialized && this.previewContainer.current) { 95 $(document).trigger('panels_setup_preview');95 jQuery(document).trigger('panels_setup_preview'); 96 96 this.previewInitialized = true; 97 97 } … … 112 112 }); // Make sure panelsData is defined and clone so that we don't alter the underlying attribute. 113 113 114 var panelsData = JSON.parse(JSON.stringify( $.extend({}, this.props.panelsData))); // Disable block selection while dragging rows or widgets.114 var panelsData = JSON.parse(JSON.stringify(jQuery.extend({}, this.props.panelsData))); // Disable block selection while dragging rows or widgets. 115 115 116 116 var rowOrWidgetMouseDown = function rowOrWidgetMouseDown() { … … 120 120 121 121 var rowOrWidgetMouseUp = function rowOrWidgetMouseUp() { 122 $(document).off('mouseup', rowOrWidgetMouseUp);122 jQuery(document).off('mouseup', rowOrWidgetMouseUp); 123 123 124 124 if (isFunction(_this2.props.onRowOrWidgetMouseUp)) { … … 127 127 }; 128 128 129 $(document).on('mouseup', rowOrWidgetMouseUp);129 jQuery(document).on('mouseup', rowOrWidgetMouseUp); 130 130 }; 131 131 … … 164 164 } 165 165 }); 166 $(document).trigger('panels_setup', this.builderView);166 jQuery(document).trigger('panels_setup', this.builderView); 167 167 this.panelsInitialized = true; 168 168 } … … 177 177 178 178 this.previewInitialized = false; 179 var fetchRequest = this.currentFetchRequest = $.post({179 var fetchRequest = this.currentFetchRequest = jQuery.post({ 180 180 url: soPanelsBlockEditorAdmin.previewUrl, 181 181 data: { … … 276 276 if (!_.isEmpty(newPanelsData.widgets)) { 277 277 // Send panelsData to server for sanitization. 278 $.post(soPanelsBlockEditorAdmin.sanitizeUrl, {278 jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl, { 279 279 action: 'so_panels_layout_block_sanitize', 280 280 panelsData: JSON.stringify(newPanelsData) … … 310 310 }); 311 311 312 (function ( $) {312 (function (jQuery) { 313 313 if (soPanelsBlockEditorAdmin.showAddButton) { 314 $(function () {314 jQuery(function () { 315 315 setTimeout(function () { 316 316 var editorDispatch = wp.data.dispatch('core/editor'); 317 317 var editorSelect = wp.data.select('core/editor'); 318 var tmpl = $('#siteorigin-panels-add-layout-block-button').html();319 var $addButton = $(tmpl).insertAfter('.editor-writing-flow > div:first');318 var tmpl = jQuery('#siteorigin-panels-add-layout-block-button').html(); 319 var $addButton = jQuery(tmpl).insertAfter('.editor-writing-flow > div:first'); 320 320 $addButton.on('click', function () { 321 321 var layoutBlock = wp.blocks.createBlock('siteorigin-panels/layout-block', {}); -
siteorigin-panels/tags/2.10.6/compat/js/siteorigin-panels-layout-block.min.js
r2041714 r2104964 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 _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)}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)}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,__=wp.i18n.__,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){function i(e){var t;_classCallCheck(this,i),t=_possibleConstructorReturn(this,_getPrototypeOf(i).call(this,e));var n="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return t.state={editing:n,loadingPreview:!n,previewHtml:""},t.panelsContainer=createRef(),t.previewContainer=createRef(),t.panelsInitialized=!1,t.previewInitialized=!1,t}return _inherits(i,Component),_createClass(i,[{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&&( $(document).trigger("panels_setup_preview"),this.previewInitialized=!0)}},{key:"setupPanels",value:function(){var t=this,e=jQuery(this.panelsContainer.current),n=new panels.model.builder;this.builderView=new panels.view.builder({model:n,config:{editorType:"standalone"}});var i=JSON.parse(JSON.stringify($.extend({},this.props.panelsData))),o=function(){isFunction(t.props.onRowOrWidgetMouseDown)&&t.props.onRowOrWidgetMouseDown();$(document).on("mouseup",function e(){$(document).off("mouseup",e),isFunction(t.props.onRowOrWidgetMouseUp)&&t.props.onRowOrWidgetMouseUp()})};this.builderView.on("row_added",function(){t.builderView.$(".so-row-move").off("mousedown",o),t.builderView.$(".so-row-move").on("mousedown",o),t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.on("widget_added",function(){t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.render().attach({container:e}).setData(i),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",function(){var e=t.builderView.getData();t.panelsDataChanged=!isEqual(i,e),t.panelsDataChanged&&(t.props.onContentChange&&isFunction(t.props.onContentChange)&&t.props.onContentChange(e),t.setState({loadingPreview:!0,previewHtml:""}))}),$(document).trigger("panels_setup",this.builderView),this.panelsInitialized=!0}},{key:"fetchPreview",value:function(e){var t=this;if(this.isStillMounted){this.previewInitialized=!1;var n=this.currentFetchRequest=$.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:__("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:__("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))))}}]),i}();registerBlockType("siteorigin-panels/layout-block",{title:__("SiteOrigin Layout","siteorigin-panels"),description:__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:"layout",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"}},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)||$.post(soPanelsBlockEditorAdmin.sanitizeUrl,{action:"so_panels_layout_block_sanitize",panelsData:JSON.stringify(e)},function(e){""!==e&&n({panelsData:e})})},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(){return null}}),function(r){soPanelsBlockEditorAdmin.showAddButton&&r(function(){setTimeout(function(){var n=wp.data.dispatch("core/editor"),i=wp.data.select("core/editor"),e=r("#siteorigin-panels-add-layout-block-button").html(),t=r(e).insertAfter(".editor-writing-flow > div:first");t.on("click",function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(i.isEditedPostEmpty()){var t=i.getBlocks();t.length?n.replaceBlock(t[0].clientId,e):n.insertBlock(e)}else n.insertBlock(e)});var o=function(){wp.data.select("core/editor").isEditedPostEmpty()?t.show():t.hide()};wp.data.subscribe(o),o()},100)})}(jQuery);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 _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)}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)}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,__=wp.i18n.__,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){function i(e){var t;_classCallCheck(this,i),t=_possibleConstructorReturn(this,_getPrototypeOf(i).call(this,e));var n="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return t.state={editing:n,loadingPreview:!n,previewHtml:""},t.panelsContainer=createRef(),t.previewContainer=createRef(),t.panelsInitialized=!1,t.previewInitialized=!1,t}return _inherits(i,Component),_createClass(i,[{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 t=this,e=jQuery(this.panelsContainer.current),n=new panels.model.builder;this.builderView=new panels.view.builder({model:n,config:{editorType:"standalone"}});var i=JSON.parse(JSON.stringify(jQuery.extend({},this.props.panelsData))),o=function(){isFunction(t.props.onRowOrWidgetMouseDown)&&t.props.onRowOrWidgetMouseDown();jQuery(document).on("mouseup",function e(){jQuery(document).off("mouseup",e),isFunction(t.props.onRowOrWidgetMouseUp)&&t.props.onRowOrWidgetMouseUp()})};this.builderView.on("row_added",function(){t.builderView.$(".so-row-move").off("mousedown",o),t.builderView.$(".so-row-move").on("mousedown",o),t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.on("widget_added",function(){t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.render().attach({container:e}).setData(i),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",function(){var e=t.builderView.getData();t.panelsDataChanged=!isEqual(i,e),t.panelsDataChanged&&(t.props.onContentChange&&isFunction(t.props.onContentChange)&&t.props.onContentChange(e),t.setState({loadingPreview:!0,previewHtml:""}))}),jQuery(document).trigger("panels_setup",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:__("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:__("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))))}}]),i}();registerBlockType("siteorigin-panels/layout-block",{title:__("SiteOrigin Layout","siteorigin-panels"),description:__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:"layout",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"}},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)||jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl,{action:"so_panels_layout_block_sanitize",panelsData:JSON.stringify(e)},function(e){""!==e&&n({panelsData:e})})},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(){return null}}),function(r){soPanelsBlockEditorAdmin.showAddButton&&r(function(){setTimeout(function(){var n=wp.data.dispatch("core/editor"),i=wp.data.select("core/editor"),e=r("#siteorigin-panels-add-layout-block-button").html(),t=r(e).insertAfter(".editor-writing-flow > div:first");t.on("click",function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(i.isEditedPostEmpty()){var t=i.getBlocks();t.length?n.replaceBlock(t[0].clientId,e):n.insertBlock(e)}else n.insertBlock(e)});var o=function(){wp.data.select("core/editor").isEditedPostEmpty()?t.show():t.hide()};wp.data.subscribe(o),o()},100)})}(jQuery); -
siteorigin-panels/tags/2.10.6/compat/layout-block.php
r2041714 r2104964 91 91 $panels_data = $this->sanitize_panels_data( $panels_data ); 92 92 $builder_id = isset( $attributes['builder_id'] ) ? $attributes['builder_id'] : uniqid( 'gb' . get_the_ID() . '-' ); 93 94 // Support for custom CSS classes 95 $add_custom_class_name = function( $class_names ) use ($attributes) { 96 if ( ! empty( $attributes['className'] ) ) { 97 $class_names[] = $attributes['className']; 98 } 99 return $class_names; 100 }; 101 add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); 93 102 $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, true, $panels_data ); 103 remove_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); 94 104 return $rendered_layout; 95 105 } -
siteorigin-panels/tags/2.10.6/inc/admin.php
r2061744 r2104964 1258 1258 $is_panels_type = in_array( $typenow, $post_types ); 1259 1259 $use_classic = siteorigin_panels_setting( 'use-classic' ); 1260 1261 if ( $is_new && $is_panels_type && $use_classic ) { 1260 $show_classic_admin_notice = $is_new && $is_panels_type && $use_classic; 1261 $show_classic_admin_notice = apply_filters( 'so_panels_show_classic_admin_notice', $show_classic_admin_notice ); 1262 if ( $show_classic_admin_notice ) { 1262 1263 $settings_url = self_admin_url( 'options-general.php?page=siteorigin_panels' ); 1263 1264 $notice = sprintf( … … 1288 1289 } 1289 1290 1290 // If the `$post_type` is set to be used by Page Builder.1291 1291 $post_types = siteorigin_panels_setting( 'post-types' ); 1292 $is_panels_type = in_array( $post_type, $post_types ); 1292 global $pagenow; 1293 // If the `$post_type` is set to be used by Page Builder for new posts. 1294 $is_new_panels_type = $pagenow == 'post-new.php' && in_array( $post_type, $post_types ); 1293 1295 $use_classic = siteorigin_panels_setting( 'use-classic' ); 1294 1296 // For existing posts. … … 1298 1300 if ( ! has_blocks( $post ) ) { 1299 1301 $panels_data = get_post_meta( $post->ID, 'panels_data', true ); 1300 global $pagenow; 1301 $is_new = $pagenow == 'post-new.php'; 1302 if ( ! empty( $panels_data ) || ( $use_classic && $is_new && $is_panels_type ) ) { 1302 if ( ! empty( $panels_data ) || ( $use_classic && $is_new_panels_type ) ) { 1303 1303 $use_block_editor = false; 1304 1304 } 1305 1305 } 1306 } else if ( $is_ panels_type ) {1306 } else if ( $is_new_panels_type ) { 1307 1307 $use_block_editor = false; 1308 1308 } … … 1471 1471 } 1472 1472 1473 return $show;1473 return apply_filters( 'so_panels_show_add_new_dropdown_for_type', $show, $post_type ); 1474 1474 } 1475 1475 -
siteorigin-panels/tags/2.10.6/inc/styles.php
r1912037 r2104964 154 154 'cover' => __( 'Cover', 'siteorigin-panels' ), 155 155 'center' => __( 'Centered, with original size', 'siteorigin-panels' ), 156 'contain' => __( 'Contain', 'siteorigin-panels' ), 156 157 'fixed' => __( 'Fixed', 'siteorigin-panels' ), 157 158 'parallax' => __( 'Parallax', 'siteorigin-panels' ), … … 448 449 $css[ 'background-position' ] = 'center center'; 449 450 $css[ 'background-size' ] = 'cover'; 451 break; 452 case 'contain': 453 $css[ 'background-size' ] = 'contain'; 450 454 break; 451 455 case 'center': -
siteorigin-panels/tags/2.10.6/inc/widgets/layout.php
r2061744 r2104964 38 38 39 39 echo $args['before_widget']; 40 echo SiteOrigin_Panels::renderer()->render( 'w'.$instance['builder_id'], true, $instance['panels_data'], $layout_data ); 41 if( ! empty( $GLOBALS[ 'SITEORIGIN_PANELS_POST_CONTENT_RENDER' ] ) && siteorigin_panels_setting( 'copy-styles' ) ) { 42 $widget_css = '@import url(' . SiteOrigin_Panels::front_css_url() . '); '; 43 $widget_css .= SiteOrigin_Panels::renderer()->generate_css( 'w'.$instance['builder_id'], $instance['panels_data'], $layout_data ); 44 $widget_css = preg_replace( '/\s+/', ' ', $widget_css ); 45 echo "\n\n" . 46 '<style type="text/css" class="panels-style" data-panels-style-for-post="' . esc_attr( 'w'.$instance['builder_id'] ) . '">' . 47 $widget_css . 48 '</style>'; 49 } 40 $is_content_render = ! empty( $GLOBALS['SITEORIGIN_PANELS_POST_CONTENT_RENDER'] ) && 41 siteorigin_panels_setting( 'copy-styles' ); 42 $is_preview_render = ! empty( $GLOBALS['SITEORIGIN_PANELS_PREVIEW_RENDER'] ); 43 44 echo SiteOrigin_Panels::renderer()->render( 45 'w'.$instance['builder_id'], 46 true, 47 $instance['panels_data'], 48 $layout_data, 49 $is_content_render || $is_preview_render 50 ); 50 51 echo $args['after_widget']; 51 52 } -
siteorigin-panels/tags/2.10.6/js/yoast-compat.js
r1986233 r2104964 53 53 try{ 54 54 if( ! _.isNull( match ) && $widget.html().replace( re, '' ).trim() === '' ) { 55 var classMatch = /class="(.*?)"/.exec( match[3]),56 dataInput = jQuery( match[5]),57 data = JSON.parse( decodeEntities( dataInput.val( ) )),55 var classMatch = /class="(.*?)"/.exec(match[3]), 56 dataInput = jQuery(match[5]), 57 data = JSON.parse(decodeEntities(dataInput.val())), 58 58 widgetInstance = data.instance, 59 59 newHTML = ''; … … 85 85 break; 86 86 87 case 'SiteOrigin_Widgets_ImageGrid_Widget': 88 case 'SiteOrigin_Widget_Simple_Masonry_Widget': 89 newHTML = $( '<div/>' ); 90 var imgItems = widgetClass === 'SiteOrigin_Widgets_ImageGrid_Widget' ? widgetInstance.images : widgetInstance.items; 91 for ( var i = 0; i < imgItems.length; i++ ) { 92 var imgItem = imgItems[ i ]; 93 var itemHTML = $('<img/>').attr({ 94 'src': '#' + imgItem.image, 95 'srcset': '', 96 'alt': ( imgItem.hasOwnProperty( 'alt' ) ? imgItem.alt : imgItem.title ), 97 'title': imgItem.title, 98 }); 99 100 newHTML.append( itemHTML ) 101 } 102 newHTML = newHTML.prop( 'outerHTML' ); 103 break; 104 87 105 case 'SiteOrigin_Widget_Accordion_Widget': 88 106 case 'SiteOrigin_Widget_Tabs_Widget': 89 107 var contentItems = widgetClass === 'SiteOrigin_Widget_Accordion_Widget' ? widgetInstance.panels : widgetInstance.tabs; 90 108 newHTML = $( '<div/>' ); 91 for ( var i = 0; i < contentItems.length; i++ ) {109 for ( var i = 0; i < contentItems.length; i++ ) { 92 110 var item = contentItems[ i ]; 93 111 if ( item.content_type !== 'text' ) { … … 99 117 } 100 118 newHTML = newHTML.prop( 'outerHTML' ); 119 break; 120 case 'SiteOrigin_Widget_Button_Widget': 121 var hrefSeparator = widgetInstance.url.includes('://') ? '' : '#'; 122 newHTML = $( '<a>' + widgetInstance.text + '</a>' ).attr({ 123 'href': hrefSeparator + widgetInstance.url, 124 }).prop('outerHTML'); 101 125 break; 102 126 } -
siteorigin-panels/tags/2.10.6/js/yoast-compat.min.js
r1986233 r2104964 1 jQuery(function( p){if(void 0!==YoastSEO.app){var e,m=(e=document.createElement("div"),function(t){return t&&"string"==typeof t&&(t=(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),e.innerHTML=t,t=e.textContent,e.textContent=""),t}),t=function(){YoastSEO.app.registerPlugin("siteOriginYoastCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"siteOriginYoastCompat",5)};t.prototype.contentModification=function(t){var d=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),e=p("<div>"+t+"</div>");return 0===e.find(".so-panel.widget").length?t:(e.find(".so-panel.widget").each(function(t,e){var i=p(e);0<i.find("> .panel-widget-style").length&&(i=i.find("> .panel-widget-style"));var n=d.exec(i.html());try{if(!_.isNull(n)&&""===i.html().replace(d,"").trim()){var a=/class="(.*?)"/.exec(n[3]),r=jQuery(n[5]),o=JSON.parse(m(r.val())).instance,s="";if(_.isNull(o.title)||(s+="<h3>"+o.title+"</h3>"),!_.isNull(a)){var c=a[1];switch(c){case"SiteOrigin_Widget_Image_Widget":s=p("<img/>").attr({src:"#"+o.image,srcset:"",alt:o.alt,title:o.title}).prop("outerHTML");break;case"WP_Widget_Media_Image":s=p("<img/>").attr({src:"#"+o.attachment_id,srcset:"",alt:o.alt,title:o.image_title}).prop("outerHTML");break;case"SiteOrigin_Widget_Accordion_Widget":case"SiteOrigin_Widget_Tabs_Widget":var l="SiteOrigin_Widget_Accordion_Widget"===c?o.panels:o.tabs;s=p("<div/>");for(t=0;t<l.length;t++){var g=l[t];"text"===g.content_type&&(s.append("<h3>"+g.title+"</h3>"),s.append("<div>"+g.content_text+"</div>"))}s=s.prop("outerHTML")}}i.html(s)}}catch(t){i.html("")}}),e.html())},new t}});1 jQuery(function(v){if(void 0!==YoastSEO.app){var e,f=(e=document.createElement("div"),function(t){return t&&"string"==typeof t&&(t=(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),e.innerHTML=t,t=e.textContent,e.textContent=""),t}),t=function(){YoastSEO.app.registerPlugin("siteOriginYoastCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"siteOriginYoastCompat",5)};t.prototype.contentModification=function(t){var h=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),e=v("<div>"+t+"</div>");return 0===e.find(".so-panel.widget").length?t:(e.find(".so-panel.widget").each(function(t,e){var i=v(e);0<i.find("> .panel-widget-style").length&&(i=i.find("> .panel-widget-style"));var a=h.exec(i.html());try{if(!_.isNull(a)&&""===i.html().replace(h,"").trim()){var r=/class="(.*?)"/.exec(a[3]),n=jQuery(a[5]),s=JSON.parse(f(n.val())).instance,g="";if(_.isNull(s.title)||(g+="<h3>"+s.title+"</h3>"),!_.isNull(r)){var o=r[1];switch(o){case"SiteOrigin_Widget_Image_Widget":g=v("<img/>").attr({src:"#"+s.image,srcset:"",alt:s.alt,title:s.title}).prop("outerHTML");break;case"WP_Widget_Media_Image":g=v("<img/>").attr({src:"#"+s.attachment_id,srcset:"",alt:s.alt,title:s.image_title}).prop("outerHTML");break;case"SiteOrigin_Widgets_ImageGrid_Widget":case"SiteOrigin_Widget_Simple_Masonry_Widget":g=v("<div/>");var l="SiteOrigin_Widgets_ImageGrid_Widget"===o?s.images:s.items;for(t=0;t<l.length;t++){var d=l[t],c=v("<img/>").attr({src:"#"+d.image,srcset:"",alt:d.hasOwnProperty("alt")?d.alt:d.title,title:d.title});g.append(c)}g=g.prop("outerHTML");break;case"SiteOrigin_Widget_Accordion_Widget":case"SiteOrigin_Widget_Tabs_Widget":var p="SiteOrigin_Widget_Accordion_Widget"===o?s.panels:s.tabs;g=v("<div/>");for(t=0;t<p.length;t++){var m=p[t];"text"===m.content_type&&(g.append("<h3>"+m.title+"</h3>"),g.append("<div>"+m.content_text+"</div>"))}g=g.prop("outerHTML");break;case"SiteOrigin_Widget_Button_Widget":var u=s.url.includes("://")?"":"#";g=v("<a>"+s.text+"</a>").attr({href:u+s.url}).prop("outerHTML")}}i.html(g)}}catch(t){i.html("")}}),e.html())},new t}}); -
siteorigin-panels/tags/2.10.6/lang/siteorigin-panels.pot
r2062540 r2104964 375 375 msgstr "" 376 376 377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:18 4, tpl/js-templates.php:62377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:185, tpl/js-templates.php:62 378 378 msgid "Row" 379 379 msgstr "" … … 395 395 msgstr "" 396 396 397 #: inc/admin.php:467, inc/styles.php:31 8, tpl/js-templates.php:61397 #: inc/admin.php:467, inc/styles.php:319, tpl/js-templates.php:61 398 398 msgid "Widget" 399 399 msgstr "" … … 826 826 msgstr "" 827 827 828 #: inc/styles-admin.php:187, inc/styles.php:25 4, inc/styles.php:283828 #: inc/styles-admin.php:187, inc/styles.php:255, inc/styles.php:284 829 829 msgid "Top" 830 830 msgstr "" … … 834 834 msgstr "" 835 835 836 #: inc/styles-admin.php:195, inc/styles.php:25 6, inc/styles.php:285836 #: inc/styles-admin.php:195, inc/styles.php:257, inc/styles.php:286 837 837 msgid "Bottom" 838 838 msgstr "" … … 935 935 936 936 #: inc/styles.php:156 937 msgid "Contain" 938 msgstr "" 939 940 #: inc/styles.php:157 937 941 msgid "Fixed" 938 942 msgstr "" 939 943 940 #: inc/styles.php:15 7944 #: inc/styles.php:158 941 945 msgid "Parallax" 942 946 msgstr "" 943 947 944 #: inc/styles.php:15 8948 #: inc/styles.php:159 945 949 msgid "Parallax (Original Size)" 946 950 msgstr "" 947 951 948 #: inc/styles.php:16 0952 #: inc/styles.php:161 949 953 msgid "How the background image is displayed." 950 954 msgstr "" 951 955 952 #: inc/styles.php:16 5956 #: inc/styles.php:166 953 957 msgid "Border Color" 954 958 msgstr "" 955 959 956 #: inc/styles.php:16 8960 #: inc/styles.php:169 957 961 msgid "Border color of the %s." 958 962 msgstr "" 959 963 960 #: inc/styles.php:18 7964 #: inc/styles.php:188 961 965 msgid "Cell Class" 962 966 msgstr "" 963 967 964 #: inc/styles.php:19 0968 #: inc/styles.php:191 965 969 msgid "Class added to all cells in this row." 966 970 msgstr "" 967 971 968 #: inc/styles.php:19 7972 #: inc/styles.php:198 969 973 msgid "Bottom Margin" 970 974 msgstr "" 971 975 972 #: inc/styles.php:20 0976 #: inc/styles.php:201 973 977 msgid "Space below the row. Default is %spx." 974 978 msgstr "" 975 979 976 #: inc/styles.php:20 5980 #: inc/styles.php:206 977 981 msgid "Gutter" 978 982 msgstr "" 979 983 980 #: inc/styles.php:20 8984 #: inc/styles.php:209 981 985 msgid "Amount of space between cells. Default is %spx." 982 986 msgstr "" 983 987 984 #: inc/styles.php:21 3988 #: inc/styles.php:214 985 989 msgid "Row Layout" 986 990 msgstr "" 987 991 988 #: inc/styles.php:21 7, inc/styles.php:230992 #: inc/styles.php:218, inc/styles.php:231 989 993 msgid "Standard" 990 994 msgstr "" 991 995 992 #: inc/styles.php:21 8996 #: inc/styles.php:219 993 997 msgid "Full Width" 994 998 msgstr "" 995 999 996 #: inc/styles.php:2 191000 #: inc/styles.php:220 997 1001 msgid "Full Width Stretched" 998 1002 msgstr "" 999 1003 1000 #: inc/styles.php:22 01004 #: inc/styles.php:221 1001 1005 msgid "Full Width Stretched Padded" 1002 1006 msgstr "" 1003 1007 1004 #: inc/styles.php:22 61008 #: inc/styles.php:227 1005 1009 msgid "Collapse Behaviour" 1006 1010 msgstr "" 1007 1011 1008 #: inc/styles.php:23 11012 #: inc/styles.php:232 1009 1013 msgid "No Collapse" 1010 1014 msgstr "" 1011 1015 1012 #: inc/styles.php:23 71016 #: inc/styles.php:238 1013 1017 msgid "Collapse Order" 1014 1018 msgstr "" 1015 1019 1016 #: inc/styles.php:24 1, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:7571020 #: inc/styles.php:242, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757 1017 1021 msgid "Default" 1018 1022 msgstr "" 1019 1023 1020 #: inc/styles.php:24 21024 #: inc/styles.php:243 1021 1025 msgid "Left on Top" 1022 1026 msgstr "" 1023 1027 1024 #: inc/styles.php:24 31028 #: inc/styles.php:244 1025 1029 msgid "Right on Top" 1026 1030 msgstr "" 1027 1031 1028 #: inc/styles.php:25 01032 #: inc/styles.php:251 1029 1033 msgid "Cell Vertical Alignment" 1030 1034 msgstr "" 1031 1035 1032 #: inc/styles.php:25 5, inc/styles.php:284, widgets/widgets/button/button.php:311036 #: inc/styles.php:256, inc/styles.php:285, widgets/widgets/button/button.php:31 1033 1037 msgid "Center" 1034 1038 msgstr "" 1035 1039 1036 #: inc/styles.php:25 7, inc/styles.php:2861040 #: inc/styles.php:258, inc/styles.php:287 1037 1041 msgid "Stretch" 1038 1042 msgstr "" 1039 1043 1040 #: inc/styles.php:27 51044 #: inc/styles.php:276 1041 1045 msgid "Cell" 1042 1046 msgstr "" 1043 1047 1044 #: inc/styles.php:27 81048 #: inc/styles.php:279 1045 1049 msgid "Vertical Alignment" 1046 1050 msgstr "" 1047 1051 1048 #: inc/styles.php:28 21052 #: inc/styles.php:283 1049 1053 msgid "Use row setting" 1050 1054 msgstr "" 1051 1055 1052 #: inc/styles.php:29 2, inc/styles.php:3321056 #: inc/styles.php:293, inc/styles.php:333 1053 1057 msgid "Font Color" 1054 1058 msgstr "" 1055 1059 1056 #: inc/styles.php:29 51060 #: inc/styles.php:296 1057 1061 msgid "Color of text inside this cell." 1058 1062 msgstr "" 1059 1063 1060 #: inc/styles.php:30 0, inc/styles.php:3401064 #: inc/styles.php:301, inc/styles.php:341 1061 1065 msgid "Links Color" 1062 1066 msgstr "" 1063 1067 1064 #: inc/styles.php:30 31068 #: inc/styles.php:304 1065 1069 msgid "Color of links inside this cell." 1066 1070 msgstr "" 1067 1071 1068 #: inc/styles.php:32 11072 #: inc/styles.php:322 1069 1073 msgid "Margin" 1070 1074 msgstr "" 1071 1075 1072 #: inc/styles.php:32 41076 #: inc/styles.php:325 1073 1077 msgid "Margins around the widget." 1074 1078 msgstr "" 1075 1079 1076 #: inc/styles.php:33 51080 #: inc/styles.php:336 1077 1081 msgid "Color of text inside this widget." 1078 1082 msgstr "" 1079 1083 1080 #: inc/styles.php:34 31084 #: inc/styles.php:344 1081 1085 msgid "Color of links inside this widget." 1082 1086 msgstr "" … … 1091 1095 msgstr "" 1092 1096 1093 #: inc/widgets/layout.php:8 31097 #: inc/widgets/layout.php:84 1094 1098 msgid "This widget can currently only be used in the WordPress admin interface." 1095 1099 msgstr "" 1096 1100 1097 #: inc/widgets/layout.php:10 81101 #: inc/widgets/layout.php:109 1098 1102 msgid "Open Builder" 1099 1103 msgstr "" -
siteorigin-panels/tags/2.10.6/readme.txt
r2083868 r2104964 3 3 Requires at least: 4.4 4 4 Tested up to: 5.2 5 Stable tag: 2.10. 56 Build time: 2019-0 4-05T17:48:13-07:005 Stable tag: 2.10.6 6 Build time: 2019-06-12T11:06:03-07:00 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl.html … … 96 96 97 97 == Changelog == 98 99 = 2.10.6 - 12 June 2019 = 100 * Add admin filter for whether to show the 'add new' dropdown and classic editor admin notice. 101 * Trigger new event before initial panels setup. 102 * Yoast compat. 103 * Pass new widget view as parameter in 'widget_added' event. 104 * Layout Builder widget: Use preview parameter and remove redundant style rendering for Post Content and Preview rendering. 105 * Layout Block: Support for custom class names. 106 * Layout styles: Add contain as option for background image display. 107 * Block editor: Only go to PB interface for _new_ PB post types. 108 * Layout block: Use `jQuery` instead of alias `$` for odd cases where `$` is undefined. 98 109 99 110 = 2.10.5 - 5 April 2019 = -
siteorigin-panels/tags/2.10.6/siteorigin-panels.php
r2064086 r2104964 4 4 Plugin URI: https://siteorigin.com/page-builder/ 5 5 Description: A drag and drop, responsive page builder that simplifies building your website. 6 Version: 2.10. 56 Version: 2.10.6 7 7 Author: SiteOrigin 8 8 Author URI: https://siteorigin.com … … 12 12 */ 13 13 14 define( 'SITEORIGIN_PANELS_VERSION', '2.10. 5' );14 define( 'SITEORIGIN_PANELS_VERSION', '2.10.6' ); 15 15 if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) { 16 16 define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' ); 17 17 } 18 18 define( 'SITEORIGIN_PANELS_CSS_SUFFIX', '.min' ); 19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-210 5' );19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2106' ); 20 20 21 21 require_once plugin_dir_path( __FILE__ ) . 'inc/functions.php'; -
siteorigin-panels/trunk/compat/js/siteorigin-panels-layout-block.js
r2061744 r2104964 93 93 this.fetchPreview(this.props); 94 94 } else if (!this.previewInitialized && this.previewContainer.current) { 95 $(document).trigger('panels_setup_preview');95 jQuery(document).trigger('panels_setup_preview'); 96 96 this.previewInitialized = true; 97 97 } … … 112 112 }); // Make sure panelsData is defined and clone so that we don't alter the underlying attribute. 113 113 114 var panelsData = JSON.parse(JSON.stringify( $.extend({}, this.props.panelsData))); // Disable block selection while dragging rows or widgets.114 var panelsData = JSON.parse(JSON.stringify(jQuery.extend({}, this.props.panelsData))); // Disable block selection while dragging rows or widgets. 115 115 116 116 var rowOrWidgetMouseDown = function rowOrWidgetMouseDown() { … … 120 120 121 121 var rowOrWidgetMouseUp = function rowOrWidgetMouseUp() { 122 $(document).off('mouseup', rowOrWidgetMouseUp);122 jQuery(document).off('mouseup', rowOrWidgetMouseUp); 123 123 124 124 if (isFunction(_this2.props.onRowOrWidgetMouseUp)) { … … 127 127 }; 128 128 129 $(document).on('mouseup', rowOrWidgetMouseUp);129 jQuery(document).on('mouseup', rowOrWidgetMouseUp); 130 130 }; 131 131 … … 164 164 } 165 165 }); 166 $(document).trigger('panels_setup', this.builderView);166 jQuery(document).trigger('panels_setup', this.builderView); 167 167 this.panelsInitialized = true; 168 168 } … … 177 177 178 178 this.previewInitialized = false; 179 var fetchRequest = this.currentFetchRequest = $.post({179 var fetchRequest = this.currentFetchRequest = jQuery.post({ 180 180 url: soPanelsBlockEditorAdmin.previewUrl, 181 181 data: { … … 276 276 if (!_.isEmpty(newPanelsData.widgets)) { 277 277 // Send panelsData to server for sanitization. 278 $.post(soPanelsBlockEditorAdmin.sanitizeUrl, {278 jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl, { 279 279 action: 'so_panels_layout_block_sanitize', 280 280 panelsData: JSON.stringify(newPanelsData) … … 310 310 }); 311 311 312 (function ( $) {312 (function (jQuery) { 313 313 if (soPanelsBlockEditorAdmin.showAddButton) { 314 $(function () {314 jQuery(function () { 315 315 setTimeout(function () { 316 316 var editorDispatch = wp.data.dispatch('core/editor'); 317 317 var editorSelect = wp.data.select('core/editor'); 318 var tmpl = $('#siteorigin-panels-add-layout-block-button').html();319 var $addButton = $(tmpl).insertAfter('.editor-writing-flow > div:first');318 var tmpl = jQuery('#siteorigin-panels-add-layout-block-button').html(); 319 var $addButton = jQuery(tmpl).insertAfter('.editor-writing-flow > div:first'); 320 320 $addButton.on('click', function () { 321 321 var layoutBlock = wp.blocks.createBlock('siteorigin-panels/layout-block', {}); -
siteorigin-panels/trunk/compat/js/siteorigin-panels-layout-block.min.js
r2041714 r2104964 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 _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)}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)}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,__=wp.i18n.__,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){function i(e){var t;_classCallCheck(this,i),t=_possibleConstructorReturn(this,_getPrototypeOf(i).call(this,e));var n="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return t.state={editing:n,loadingPreview:!n,previewHtml:""},t.panelsContainer=createRef(),t.previewContainer=createRef(),t.panelsInitialized=!1,t.previewInitialized=!1,t}return _inherits(i,Component),_createClass(i,[{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&&( $(document).trigger("panels_setup_preview"),this.previewInitialized=!0)}},{key:"setupPanels",value:function(){var t=this,e=jQuery(this.panelsContainer.current),n=new panels.model.builder;this.builderView=new panels.view.builder({model:n,config:{editorType:"standalone"}});var i=JSON.parse(JSON.stringify($.extend({},this.props.panelsData))),o=function(){isFunction(t.props.onRowOrWidgetMouseDown)&&t.props.onRowOrWidgetMouseDown();$(document).on("mouseup",function e(){$(document).off("mouseup",e),isFunction(t.props.onRowOrWidgetMouseUp)&&t.props.onRowOrWidgetMouseUp()})};this.builderView.on("row_added",function(){t.builderView.$(".so-row-move").off("mousedown",o),t.builderView.$(".so-row-move").on("mousedown",o),t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.on("widget_added",function(){t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.render().attach({container:e}).setData(i),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",function(){var e=t.builderView.getData();t.panelsDataChanged=!isEqual(i,e),t.panelsDataChanged&&(t.props.onContentChange&&isFunction(t.props.onContentChange)&&t.props.onContentChange(e),t.setState({loadingPreview:!0,previewHtml:""}))}),$(document).trigger("panels_setup",this.builderView),this.panelsInitialized=!0}},{key:"fetchPreview",value:function(e){var t=this;if(this.isStillMounted){this.previewInitialized=!1;var n=this.currentFetchRequest=$.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:__("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:__("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))))}}]),i}();registerBlockType("siteorigin-panels/layout-block",{title:__("SiteOrigin Layout","siteorigin-panels"),description:__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:"layout",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"}},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)||$.post(soPanelsBlockEditorAdmin.sanitizeUrl,{action:"so_panels_layout_block_sanitize",panelsData:JSON.stringify(e)},function(e){""!==e&&n({panelsData:e})})},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(){return null}}),function(r){soPanelsBlockEditorAdmin.showAddButton&&r(function(){setTimeout(function(){var n=wp.data.dispatch("core/editor"),i=wp.data.select("core/editor"),e=r("#siteorigin-panels-add-layout-block-button").html(),t=r(e).insertAfter(".editor-writing-flow > div:first");t.on("click",function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(i.isEditedPostEmpty()){var t=i.getBlocks();t.length?n.replaceBlock(t[0].clientId,e):n.insertBlock(e)}else n.insertBlock(e)});var o=function(){wp.data.select("core/editor").isEditedPostEmpty()?t.show():t.hide()};wp.data.subscribe(o),o()},100)})}(jQuery);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 _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)}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)}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,__=wp.i18n.__,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){function i(e){var t;_classCallCheck(this,i),t=_possibleConstructorReturn(this,_getPrototypeOf(i).call(this,e));var n="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return t.state={editing:n,loadingPreview:!n,previewHtml:""},t.panelsContainer=createRef(),t.previewContainer=createRef(),t.panelsInitialized=!1,t.previewInitialized=!1,t}return _inherits(i,Component),_createClass(i,[{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 t=this,e=jQuery(this.panelsContainer.current),n=new panels.model.builder;this.builderView=new panels.view.builder({model:n,config:{editorType:"standalone"}});var i=JSON.parse(JSON.stringify(jQuery.extend({},this.props.panelsData))),o=function(){isFunction(t.props.onRowOrWidgetMouseDown)&&t.props.onRowOrWidgetMouseDown();jQuery(document).on("mouseup",function e(){jQuery(document).off("mouseup",e),isFunction(t.props.onRowOrWidgetMouseUp)&&t.props.onRowOrWidgetMouseUp()})};this.builderView.on("row_added",function(){t.builderView.$(".so-row-move").off("mousedown",o),t.builderView.$(".so-row-move").on("mousedown",o),t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.on("widget_added",function(){t.builderView.$(".so-widget").off("mousedown",o),t.builderView.$(".so-widget").on("mousedown",o)}),this.builderView.render().attach({container:e}).setData(i),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",function(){var e=t.builderView.getData();t.panelsDataChanged=!isEqual(i,e),t.panelsDataChanged&&(t.props.onContentChange&&isFunction(t.props.onContentChange)&&t.props.onContentChange(e),t.setState({loadingPreview:!0,previewHtml:""}))}),jQuery(document).trigger("panels_setup",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:__("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:__("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))))}}]),i}();registerBlockType("siteorigin-panels/layout-block",{title:__("SiteOrigin Layout","siteorigin-panels"),description:__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:"layout",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"}},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)||jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl,{action:"so_panels_layout_block_sanitize",panelsData:JSON.stringify(e)},function(e){""!==e&&n({panelsData:e})})},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(){return null}}),function(r){soPanelsBlockEditorAdmin.showAddButton&&r(function(){setTimeout(function(){var n=wp.data.dispatch("core/editor"),i=wp.data.select("core/editor"),e=r("#siteorigin-panels-add-layout-block-button").html(),t=r(e).insertAfter(".editor-writing-flow > div:first");t.on("click",function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(i.isEditedPostEmpty()){var t=i.getBlocks();t.length?n.replaceBlock(t[0].clientId,e):n.insertBlock(e)}else n.insertBlock(e)});var o=function(){wp.data.select("core/editor").isEditedPostEmpty()?t.show():t.hide()};wp.data.subscribe(o),o()},100)})}(jQuery); -
siteorigin-panels/trunk/compat/layout-block.php
r2041714 r2104964 91 91 $panels_data = $this->sanitize_panels_data( $panels_data ); 92 92 $builder_id = isset( $attributes['builder_id'] ) ? $attributes['builder_id'] : uniqid( 'gb' . get_the_ID() . '-' ); 93 94 // Support for custom CSS classes 95 $add_custom_class_name = function( $class_names ) use ($attributes) { 96 if ( ! empty( $attributes['className'] ) ) { 97 $class_names[] = $attributes['className']; 98 } 99 return $class_names; 100 }; 101 add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); 93 102 $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, true, $panels_data ); 103 remove_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); 94 104 return $rendered_layout; 95 105 } -
siteorigin-panels/trunk/inc/admin.php
r2061744 r2104964 1258 1258 $is_panels_type = in_array( $typenow, $post_types ); 1259 1259 $use_classic = siteorigin_panels_setting( 'use-classic' ); 1260 1261 if ( $is_new && $is_panels_type && $use_classic ) { 1260 $show_classic_admin_notice = $is_new && $is_panels_type && $use_classic; 1261 $show_classic_admin_notice = apply_filters( 'so_panels_show_classic_admin_notice', $show_classic_admin_notice ); 1262 if ( $show_classic_admin_notice ) { 1262 1263 $settings_url = self_admin_url( 'options-general.php?page=siteorigin_panels' ); 1263 1264 $notice = sprintf( … … 1288 1289 } 1289 1290 1290 // If the `$post_type` is set to be used by Page Builder.1291 1291 $post_types = siteorigin_panels_setting( 'post-types' ); 1292 $is_panels_type = in_array( $post_type, $post_types ); 1292 global $pagenow; 1293 // If the `$post_type` is set to be used by Page Builder for new posts. 1294 $is_new_panels_type = $pagenow == 'post-new.php' && in_array( $post_type, $post_types ); 1293 1295 $use_classic = siteorigin_panels_setting( 'use-classic' ); 1294 1296 // For existing posts. … … 1298 1300 if ( ! has_blocks( $post ) ) { 1299 1301 $panels_data = get_post_meta( $post->ID, 'panels_data', true ); 1300 global $pagenow; 1301 $is_new = $pagenow == 'post-new.php'; 1302 if ( ! empty( $panels_data ) || ( $use_classic && $is_new && $is_panels_type ) ) { 1302 if ( ! empty( $panels_data ) || ( $use_classic && $is_new_panels_type ) ) { 1303 1303 $use_block_editor = false; 1304 1304 } 1305 1305 } 1306 } else if ( $is_ panels_type ) {1306 } else if ( $is_new_panels_type ) { 1307 1307 $use_block_editor = false; 1308 1308 } … … 1471 1471 } 1472 1472 1473 return $show;1473 return apply_filters( 'so_panels_show_add_new_dropdown_for_type', $show, $post_type ); 1474 1474 } 1475 1475 -
siteorigin-panels/trunk/inc/styles.php
r1912037 r2104964 154 154 'cover' => __( 'Cover', 'siteorigin-panels' ), 155 155 'center' => __( 'Centered, with original size', 'siteorigin-panels' ), 156 'contain' => __( 'Contain', 'siteorigin-panels' ), 156 157 'fixed' => __( 'Fixed', 'siteorigin-panels' ), 157 158 'parallax' => __( 'Parallax', 'siteorigin-panels' ), … … 448 449 $css[ 'background-position' ] = 'center center'; 449 450 $css[ 'background-size' ] = 'cover'; 451 break; 452 case 'contain': 453 $css[ 'background-size' ] = 'contain'; 450 454 break; 451 455 case 'center': -
siteorigin-panels/trunk/inc/widgets/layout.php
r2061744 r2104964 38 38 39 39 echo $args['before_widget']; 40 echo SiteOrigin_Panels::renderer()->render( 'w'.$instance['builder_id'], true, $instance['panels_data'], $layout_data ); 41 if( ! empty( $GLOBALS[ 'SITEORIGIN_PANELS_POST_CONTENT_RENDER' ] ) && siteorigin_panels_setting( 'copy-styles' ) ) { 42 $widget_css = '@import url(' . SiteOrigin_Panels::front_css_url() . '); '; 43 $widget_css .= SiteOrigin_Panels::renderer()->generate_css( 'w'.$instance['builder_id'], $instance['panels_data'], $layout_data ); 44 $widget_css = preg_replace( '/\s+/', ' ', $widget_css ); 45 echo "\n\n" . 46 '<style type="text/css" class="panels-style" data-panels-style-for-post="' . esc_attr( 'w'.$instance['builder_id'] ) . '">' . 47 $widget_css . 48 '</style>'; 49 } 40 $is_content_render = ! empty( $GLOBALS['SITEORIGIN_PANELS_POST_CONTENT_RENDER'] ) && 41 siteorigin_panels_setting( 'copy-styles' ); 42 $is_preview_render = ! empty( $GLOBALS['SITEORIGIN_PANELS_PREVIEW_RENDER'] ); 43 44 echo SiteOrigin_Panels::renderer()->render( 45 'w'.$instance['builder_id'], 46 true, 47 $instance['panels_data'], 48 $layout_data, 49 $is_content_render || $is_preview_render 50 ); 50 51 echo $args['after_widget']; 51 52 } -
siteorigin-panels/trunk/js/yoast-compat.js
r1986233 r2104964 53 53 try{ 54 54 if( ! _.isNull( match ) && $widget.html().replace( re, '' ).trim() === '' ) { 55 var classMatch = /class="(.*?)"/.exec( match[3]),56 dataInput = jQuery( match[5]),57 data = JSON.parse( decodeEntities( dataInput.val( ) )),55 var classMatch = /class="(.*?)"/.exec(match[3]), 56 dataInput = jQuery(match[5]), 57 data = JSON.parse(decodeEntities(dataInput.val())), 58 58 widgetInstance = data.instance, 59 59 newHTML = ''; … … 85 85 break; 86 86 87 case 'SiteOrigin_Widgets_ImageGrid_Widget': 88 case 'SiteOrigin_Widget_Simple_Masonry_Widget': 89 newHTML = $( '<div/>' ); 90 var imgItems = widgetClass === 'SiteOrigin_Widgets_ImageGrid_Widget' ? widgetInstance.images : widgetInstance.items; 91 for ( var i = 0; i < imgItems.length; i++ ) { 92 var imgItem = imgItems[ i ]; 93 var itemHTML = $('<img/>').attr({ 94 'src': '#' + imgItem.image, 95 'srcset': '', 96 'alt': ( imgItem.hasOwnProperty( 'alt' ) ? imgItem.alt : imgItem.title ), 97 'title': imgItem.title, 98 }); 99 100 newHTML.append( itemHTML ) 101 } 102 newHTML = newHTML.prop( 'outerHTML' ); 103 break; 104 87 105 case 'SiteOrigin_Widget_Accordion_Widget': 88 106 case 'SiteOrigin_Widget_Tabs_Widget': 89 107 var contentItems = widgetClass === 'SiteOrigin_Widget_Accordion_Widget' ? widgetInstance.panels : widgetInstance.tabs; 90 108 newHTML = $( '<div/>' ); 91 for ( var i = 0; i < contentItems.length; i++ ) {109 for ( var i = 0; i < contentItems.length; i++ ) { 92 110 var item = contentItems[ i ]; 93 111 if ( item.content_type !== 'text' ) { … … 99 117 } 100 118 newHTML = newHTML.prop( 'outerHTML' ); 119 break; 120 case 'SiteOrigin_Widget_Button_Widget': 121 var hrefSeparator = widgetInstance.url.includes('://') ? '' : '#'; 122 newHTML = $( '<a>' + widgetInstance.text + '</a>' ).attr({ 123 'href': hrefSeparator + widgetInstance.url, 124 }).prop('outerHTML'); 101 125 break; 102 126 } -
siteorigin-panels/trunk/js/yoast-compat.min.js
r1986233 r2104964 1 jQuery(function( p){if(void 0!==YoastSEO.app){var e,m=(e=document.createElement("div"),function(t){return t&&"string"==typeof t&&(t=(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),e.innerHTML=t,t=e.textContent,e.textContent=""),t}),t=function(){YoastSEO.app.registerPlugin("siteOriginYoastCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"siteOriginYoastCompat",5)};t.prototype.contentModification=function(t){var d=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),e=p("<div>"+t+"</div>");return 0===e.find(".so-panel.widget").length?t:(e.find(".so-panel.widget").each(function(t,e){var i=p(e);0<i.find("> .panel-widget-style").length&&(i=i.find("> .panel-widget-style"));var n=d.exec(i.html());try{if(!_.isNull(n)&&""===i.html().replace(d,"").trim()){var a=/class="(.*?)"/.exec(n[3]),r=jQuery(n[5]),o=JSON.parse(m(r.val())).instance,s="";if(_.isNull(o.title)||(s+="<h3>"+o.title+"</h3>"),!_.isNull(a)){var c=a[1];switch(c){case"SiteOrigin_Widget_Image_Widget":s=p("<img/>").attr({src:"#"+o.image,srcset:"",alt:o.alt,title:o.title}).prop("outerHTML");break;case"WP_Widget_Media_Image":s=p("<img/>").attr({src:"#"+o.attachment_id,srcset:"",alt:o.alt,title:o.image_title}).prop("outerHTML");break;case"SiteOrigin_Widget_Accordion_Widget":case"SiteOrigin_Widget_Tabs_Widget":var l="SiteOrigin_Widget_Accordion_Widget"===c?o.panels:o.tabs;s=p("<div/>");for(t=0;t<l.length;t++){var g=l[t];"text"===g.content_type&&(s.append("<h3>"+g.title+"</h3>"),s.append("<div>"+g.content_text+"</div>"))}s=s.prop("outerHTML")}}i.html(s)}}catch(t){i.html("")}}),e.html())},new t}});1 jQuery(function(v){if(void 0!==YoastSEO.app){var e,f=(e=document.createElement("div"),function(t){return t&&"string"==typeof t&&(t=(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),e.innerHTML=t,t=e.textContent,e.textContent=""),t}),t=function(){YoastSEO.app.registerPlugin("siteOriginYoastCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"siteOriginYoastCompat",5)};t.prototype.contentModification=function(t){var h=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),e=v("<div>"+t+"</div>");return 0===e.find(".so-panel.widget").length?t:(e.find(".so-panel.widget").each(function(t,e){var i=v(e);0<i.find("> .panel-widget-style").length&&(i=i.find("> .panel-widget-style"));var a=h.exec(i.html());try{if(!_.isNull(a)&&""===i.html().replace(h,"").trim()){var r=/class="(.*?)"/.exec(a[3]),n=jQuery(a[5]),s=JSON.parse(f(n.val())).instance,g="";if(_.isNull(s.title)||(g+="<h3>"+s.title+"</h3>"),!_.isNull(r)){var o=r[1];switch(o){case"SiteOrigin_Widget_Image_Widget":g=v("<img/>").attr({src:"#"+s.image,srcset:"",alt:s.alt,title:s.title}).prop("outerHTML");break;case"WP_Widget_Media_Image":g=v("<img/>").attr({src:"#"+s.attachment_id,srcset:"",alt:s.alt,title:s.image_title}).prop("outerHTML");break;case"SiteOrigin_Widgets_ImageGrid_Widget":case"SiteOrigin_Widget_Simple_Masonry_Widget":g=v("<div/>");var l="SiteOrigin_Widgets_ImageGrid_Widget"===o?s.images:s.items;for(t=0;t<l.length;t++){var d=l[t],c=v("<img/>").attr({src:"#"+d.image,srcset:"",alt:d.hasOwnProperty("alt")?d.alt:d.title,title:d.title});g.append(c)}g=g.prop("outerHTML");break;case"SiteOrigin_Widget_Accordion_Widget":case"SiteOrigin_Widget_Tabs_Widget":var p="SiteOrigin_Widget_Accordion_Widget"===o?s.panels:s.tabs;g=v("<div/>");for(t=0;t<p.length;t++){var m=p[t];"text"===m.content_type&&(g.append("<h3>"+m.title+"</h3>"),g.append("<div>"+m.content_text+"</div>"))}g=g.prop("outerHTML");break;case"SiteOrigin_Widget_Button_Widget":var u=s.url.includes("://")?"":"#";g=v("<a>"+s.text+"</a>").attr({href:u+s.url}).prop("outerHTML")}}i.html(g)}}catch(t){i.html("")}}),e.html())},new t}}); -
siteorigin-panels/trunk/lang/siteorigin-panels.pot
r2062540 r2104964 375 375 msgstr "" 376 376 377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:18 4, tpl/js-templates.php:62377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:185, tpl/js-templates.php:62 378 378 msgid "Row" 379 379 msgstr "" … … 395 395 msgstr "" 396 396 397 #: inc/admin.php:467, inc/styles.php:31 8, tpl/js-templates.php:61397 #: inc/admin.php:467, inc/styles.php:319, tpl/js-templates.php:61 398 398 msgid "Widget" 399 399 msgstr "" … … 826 826 msgstr "" 827 827 828 #: inc/styles-admin.php:187, inc/styles.php:25 4, inc/styles.php:283828 #: inc/styles-admin.php:187, inc/styles.php:255, inc/styles.php:284 829 829 msgid "Top" 830 830 msgstr "" … … 834 834 msgstr "" 835 835 836 #: inc/styles-admin.php:195, inc/styles.php:25 6, inc/styles.php:285836 #: inc/styles-admin.php:195, inc/styles.php:257, inc/styles.php:286 837 837 msgid "Bottom" 838 838 msgstr "" … … 935 935 936 936 #: inc/styles.php:156 937 msgid "Contain" 938 msgstr "" 939 940 #: inc/styles.php:157 937 941 msgid "Fixed" 938 942 msgstr "" 939 943 940 #: inc/styles.php:15 7944 #: inc/styles.php:158 941 945 msgid "Parallax" 942 946 msgstr "" 943 947 944 #: inc/styles.php:15 8948 #: inc/styles.php:159 945 949 msgid "Parallax (Original Size)" 946 950 msgstr "" 947 951 948 #: inc/styles.php:16 0952 #: inc/styles.php:161 949 953 msgid "How the background image is displayed." 950 954 msgstr "" 951 955 952 #: inc/styles.php:16 5956 #: inc/styles.php:166 953 957 msgid "Border Color" 954 958 msgstr "" 955 959 956 #: inc/styles.php:16 8960 #: inc/styles.php:169 957 961 msgid "Border color of the %s." 958 962 msgstr "" 959 963 960 #: inc/styles.php:18 7964 #: inc/styles.php:188 961 965 msgid "Cell Class" 962 966 msgstr "" 963 967 964 #: inc/styles.php:19 0968 #: inc/styles.php:191 965 969 msgid "Class added to all cells in this row." 966 970 msgstr "" 967 971 968 #: inc/styles.php:19 7972 #: inc/styles.php:198 969 973 msgid "Bottom Margin" 970 974 msgstr "" 971 975 972 #: inc/styles.php:20 0976 #: inc/styles.php:201 973 977 msgid "Space below the row. Default is %spx." 974 978 msgstr "" 975 979 976 #: inc/styles.php:20 5980 #: inc/styles.php:206 977 981 msgid "Gutter" 978 982 msgstr "" 979 983 980 #: inc/styles.php:20 8984 #: inc/styles.php:209 981 985 msgid "Amount of space between cells. Default is %spx." 982 986 msgstr "" 983 987 984 #: inc/styles.php:21 3988 #: inc/styles.php:214 985 989 msgid "Row Layout" 986 990 msgstr "" 987 991 988 #: inc/styles.php:21 7, inc/styles.php:230992 #: inc/styles.php:218, inc/styles.php:231 989 993 msgid "Standard" 990 994 msgstr "" 991 995 992 #: inc/styles.php:21 8996 #: inc/styles.php:219 993 997 msgid "Full Width" 994 998 msgstr "" 995 999 996 #: inc/styles.php:2 191000 #: inc/styles.php:220 997 1001 msgid "Full Width Stretched" 998 1002 msgstr "" 999 1003 1000 #: inc/styles.php:22 01004 #: inc/styles.php:221 1001 1005 msgid "Full Width Stretched Padded" 1002 1006 msgstr "" 1003 1007 1004 #: inc/styles.php:22 61008 #: inc/styles.php:227 1005 1009 msgid "Collapse Behaviour" 1006 1010 msgstr "" 1007 1011 1008 #: inc/styles.php:23 11012 #: inc/styles.php:232 1009 1013 msgid "No Collapse" 1010 1014 msgstr "" 1011 1015 1012 #: inc/styles.php:23 71016 #: inc/styles.php:238 1013 1017 msgid "Collapse Order" 1014 1018 msgstr "" 1015 1019 1016 #: inc/styles.php:24 1, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:7571020 #: inc/styles.php:242, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757 1017 1021 msgid "Default" 1018 1022 msgstr "" 1019 1023 1020 #: inc/styles.php:24 21024 #: inc/styles.php:243 1021 1025 msgid "Left on Top" 1022 1026 msgstr "" 1023 1027 1024 #: inc/styles.php:24 31028 #: inc/styles.php:244 1025 1029 msgid "Right on Top" 1026 1030 msgstr "" 1027 1031 1028 #: inc/styles.php:25 01032 #: inc/styles.php:251 1029 1033 msgid "Cell Vertical Alignment" 1030 1034 msgstr "" 1031 1035 1032 #: inc/styles.php:25 5, inc/styles.php:284, widgets/widgets/button/button.php:311036 #: inc/styles.php:256, inc/styles.php:285, widgets/widgets/button/button.php:31 1033 1037 msgid "Center" 1034 1038 msgstr "" 1035 1039 1036 #: inc/styles.php:25 7, inc/styles.php:2861040 #: inc/styles.php:258, inc/styles.php:287 1037 1041 msgid "Stretch" 1038 1042 msgstr "" 1039 1043 1040 #: inc/styles.php:27 51044 #: inc/styles.php:276 1041 1045 msgid "Cell" 1042 1046 msgstr "" 1043 1047 1044 #: inc/styles.php:27 81048 #: inc/styles.php:279 1045 1049 msgid "Vertical Alignment" 1046 1050 msgstr "" 1047 1051 1048 #: inc/styles.php:28 21052 #: inc/styles.php:283 1049 1053 msgid "Use row setting" 1050 1054 msgstr "" 1051 1055 1052 #: inc/styles.php:29 2, inc/styles.php:3321056 #: inc/styles.php:293, inc/styles.php:333 1053 1057 msgid "Font Color" 1054 1058 msgstr "" 1055 1059 1056 #: inc/styles.php:29 51060 #: inc/styles.php:296 1057 1061 msgid "Color of text inside this cell." 1058 1062 msgstr "" 1059 1063 1060 #: inc/styles.php:30 0, inc/styles.php:3401064 #: inc/styles.php:301, inc/styles.php:341 1061 1065 msgid "Links Color" 1062 1066 msgstr "" 1063 1067 1064 #: inc/styles.php:30 31068 #: inc/styles.php:304 1065 1069 msgid "Color of links inside this cell." 1066 1070 msgstr "" 1067 1071 1068 #: inc/styles.php:32 11072 #: inc/styles.php:322 1069 1073 msgid "Margin" 1070 1074 msgstr "" 1071 1075 1072 #: inc/styles.php:32 41076 #: inc/styles.php:325 1073 1077 msgid "Margins around the widget." 1074 1078 msgstr "" 1075 1079 1076 #: inc/styles.php:33 51080 #: inc/styles.php:336 1077 1081 msgid "Color of text inside this widget." 1078 1082 msgstr "" 1079 1083 1080 #: inc/styles.php:34 31084 #: inc/styles.php:344 1081 1085 msgid "Color of links inside this widget." 1082 1086 msgstr "" … … 1091 1095 msgstr "" 1092 1096 1093 #: inc/widgets/layout.php:8 31097 #: inc/widgets/layout.php:84 1094 1098 msgid "This widget can currently only be used in the WordPress admin interface." 1095 1099 msgstr "" 1096 1100 1097 #: inc/widgets/layout.php:10 81101 #: inc/widgets/layout.php:109 1098 1102 msgid "Open Builder" 1099 1103 msgstr "" -
siteorigin-panels/trunk/readme.txt
r2083868 r2104964 3 3 Requires at least: 4.4 4 4 Tested up to: 5.2 5 Stable tag: 2.10. 56 Build time: 2019-0 4-05T17:48:13-07:005 Stable tag: 2.10.6 6 Build time: 2019-06-12T11:06:03-07:00 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl.html … … 96 96 97 97 == Changelog == 98 99 = 2.10.6 - 12 June 2019 = 100 * Add admin filter for whether to show the 'add new' dropdown and classic editor admin notice. 101 * Trigger new event before initial panels setup. 102 * Yoast compat. 103 * Pass new widget view as parameter in 'widget_added' event. 104 * Layout Builder widget: Use preview parameter and remove redundant style rendering for Post Content and Preview rendering. 105 * Layout Block: Support for custom class names. 106 * Layout styles: Add contain as option for background image display. 107 * Block editor: Only go to PB interface for _new_ PB post types. 108 * Layout block: Use `jQuery` instead of alias `$` for odd cases where `$` is undefined. 98 109 99 110 = 2.10.5 - 5 April 2019 = -
siteorigin-panels/trunk/siteorigin-panels.php
r2064086 r2104964 4 4 Plugin URI: https://siteorigin.com/page-builder/ 5 5 Description: A drag and drop, responsive page builder that simplifies building your website. 6 Version: 2.10. 56 Version: 2.10.6 7 7 Author: SiteOrigin 8 8 Author URI: https://siteorigin.com … … 12 12 */ 13 13 14 define( 'SITEORIGIN_PANELS_VERSION', '2.10. 5' );14 define( 'SITEORIGIN_PANELS_VERSION', '2.10.6' ); 15 15 if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) { 16 16 define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' ); 17 17 } 18 18 define( 'SITEORIGIN_PANELS_CSS_SUFFIX', '.min' ); 19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-210 5' );19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2106' ); 20 20 21 21 require_once plugin_dir_path( __FILE__ ) . 'inc/functions.php';
Note: See TracChangeset
for help on using the changeset viewer.