Plugin Directory

Changeset 2104964


Ignore:
Timestamp:
06/12/2019 06:10:08 PM (7 years ago)
Author:
gpriday
Message:

2.10.6 release

Location:
siteorigin-panels
Files:
8 added
8 deleted
21 edited
2 copied

Legend:

Unmodified
Added
Removed
  • siteorigin-panels/tags/2.10.6/compat/js/siteorigin-panels-layout-block.js

    r2061744 r2104964  
    9393        this.fetchPreview(this.props);
    9494      } else if (!this.previewInitialized && this.previewContainer.current) {
    95         $(document).trigger('panels_setup_preview');
     95        jQuery(document).trigger('panels_setup_preview');
    9696        this.previewInitialized = true;
    9797      }
     
    112112      }); // Make sure panelsData is defined and clone so that we don't alter the underlying attribute.
    113113
    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.
    115115
    116116      var rowOrWidgetMouseDown = function rowOrWidgetMouseDown() {
     
    120120
    121121        var rowOrWidgetMouseUp = function rowOrWidgetMouseUp() {
    122           $(document).off('mouseup', rowOrWidgetMouseUp);
     122          jQuery(document).off('mouseup', rowOrWidgetMouseUp);
    123123
    124124          if (isFunction(_this2.props.onRowOrWidgetMouseUp)) {
     
    127127        };
    128128
    129         $(document).on('mouseup', rowOrWidgetMouseUp);
     129        jQuery(document).on('mouseup', rowOrWidgetMouseUp);
    130130      };
    131131
     
    164164        }
    165165      });
    166       $(document).trigger('panels_setup', this.builderView);
     166      jQuery(document).trigger('panels_setup', this.builderView);
    167167      this.panelsInitialized = true;
    168168    }
     
    177177
    178178      this.previewInitialized = false;
    179       var fetchRequest = this.currentFetchRequest = $.post({
     179      var fetchRequest = this.currentFetchRequest = jQuery.post({
    180180        url: soPanelsBlockEditorAdmin.previewUrl,
    181181        data: {
     
    276276      if (!_.isEmpty(newPanelsData.widgets)) {
    277277        // Send panelsData to server for sanitization.
    278         $.post(soPanelsBlockEditorAdmin.sanitizeUrl, {
     278        jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl, {
    279279          action: 'so_panels_layout_block_sanitize',
    280280          panelsData: JSON.stringify(newPanelsData)
     
    310310});
    311311
    312 (function ($) {
     312(function (jQuery) {
    313313  if (soPanelsBlockEditorAdmin.showAddButton) {
    314     $(function () {
     314    jQuery(function () {
    315315      setTimeout(function () {
    316316        var editorDispatch = wp.data.dispatch('core/editor');
    317317        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');
    320320        $addButton.on('click', function () {
    321321          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  
    9191        $panels_data = $this->sanitize_panels_data( $panels_data );
    9292        $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 );
    93102        $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, true, $panels_data );
     103        remove_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name );
    94104        return $rendered_layout;
    95105    }
  • siteorigin-panels/tags/2.10.6/inc/admin.php

    r2061744 r2104964  
    12581258        $is_panels_type = in_array( $typenow, $post_types );
    12591259        $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 ) {
    12621263            $settings_url = self_admin_url( 'options-general.php?page=siteorigin_panels' );
    12631264            $notice = sprintf(
     
    12881289        }
    12891290       
    1290         // If the `$post_type` is set to be used by Page Builder.
    12911291        $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 );
    12931295        $use_classic = siteorigin_panels_setting( 'use-classic' );
    12941296        // For existing posts.
     
    12981300            if ( ! has_blocks( $post ) ) {
    12991301                $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 ) ) {
    13031303                    $use_block_editor = false;
    13041304                }
    13051305            }
    1306         } else if ( $is_panels_type ) {
     1306        } else if ( $is_new_panels_type ) {
    13071307            $use_block_editor = false;
    13081308        }
     
    14711471        }
    14721472       
    1473         return $show;
     1473        return apply_filters( 'so_panels_show_add_new_dropdown_for_type', $show, $post_type );
    14741474    }
    14751475   
  • siteorigin-panels/tags/2.10.6/inc/styles.php

    r1912037 r2104964  
    154154                'cover'             => __( 'Cover', 'siteorigin-panels' ),
    155155                'center'            => __( 'Centered, with original size', 'siteorigin-panels' ),
     156                'contain'           => __( 'Contain', 'siteorigin-panels' ),
    156157                'fixed'             => __( 'Fixed', 'siteorigin-panels' ),
    157158                'parallax'          => __( 'Parallax', 'siteorigin-panels' ),
     
    448449                        $css[ 'background-position' ] = 'center center';
    449450                        $css[ 'background-size' ] = 'cover';
     451                        break;
     452                    case 'contain':
     453                        $css[ 'background-size' ] = 'contain';
    450454                        break;
    451455                    case 'center':
  • siteorigin-panels/tags/2.10.6/inc/widgets/layout.php

    r2061744 r2104964  
    3838       
    3939        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        );
    5051        echo $args['after_widget'];
    5152    }
  • siteorigin-panels/tags/2.10.6/js/yoast-compat.js

    r1986233 r2104964  
    5353            try{
    5454                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())),
    5858                        widgetInstance = data.instance,
    5959                        newHTML = '';
     
    8585                                break;
    8686
     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
    87105                            case 'SiteOrigin_Widget_Accordion_Widget':
    88106                            case 'SiteOrigin_Widget_Tabs_Widget':
    89107                                var contentItems = widgetClass === 'SiteOrigin_Widget_Accordion_Widget' ? widgetInstance.panels : widgetInstance.tabs;
    90108                                newHTML = $( '<div/>' );
    91                                 for( var i = 0; i < contentItems.length; i++ ) {
     109                                for ( var i = 0; i < contentItems.length; i++ ) {
    92110                                    var item = contentItems[ i ];
    93111                                    if ( item.content_type !== 'text' ) {
     
    99117                                }
    100118                                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');
    101125                                break;
    102126                        }
  • 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}});
     1jQuery(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  
    375375msgstr ""
    376376
    377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:184, tpl/js-templates.php:62
     377#: inc/admin.php:460, inc/admin.php:468, inc/styles.php:185, tpl/js-templates.php:62
    378378msgid "Row"
    379379msgstr ""
     
    395395msgstr ""
    396396
    397 #: inc/admin.php:467, inc/styles.php:318, tpl/js-templates.php:61
     397#: inc/admin.php:467, inc/styles.php:319, tpl/js-templates.php:61
    398398msgid "Widget"
    399399msgstr ""
     
    826826msgstr ""
    827827
    828 #: inc/styles-admin.php:187, inc/styles.php:254, inc/styles.php:283
     828#: inc/styles-admin.php:187, inc/styles.php:255, inc/styles.php:284
    829829msgid "Top"
    830830msgstr ""
     
    834834msgstr ""
    835835
    836 #: inc/styles-admin.php:195, inc/styles.php:256, inc/styles.php:285
     836#: inc/styles-admin.php:195, inc/styles.php:257, inc/styles.php:286
    837837msgid "Bottom"
    838838msgstr ""
     
    935935
    936936#: inc/styles.php:156
     937msgid "Contain"
     938msgstr ""
     939
     940#: inc/styles.php:157
    937941msgid "Fixed"
    938942msgstr ""
    939943
    940 #: inc/styles.php:157
     944#: inc/styles.php:158
    941945msgid "Parallax"
    942946msgstr ""
    943947
    944 #: inc/styles.php:158
     948#: inc/styles.php:159
    945949msgid "Parallax (Original Size)"
    946950msgstr ""
    947951
    948 #: inc/styles.php:160
     952#: inc/styles.php:161
    949953msgid "How the background image is displayed."
    950954msgstr ""
    951955
    952 #: inc/styles.php:165
     956#: inc/styles.php:166
    953957msgid "Border Color"
    954958msgstr ""
    955959
    956 #: inc/styles.php:168
     960#: inc/styles.php:169
    957961msgid "Border color of the %s."
    958962msgstr ""
    959963
    960 #: inc/styles.php:187
     964#: inc/styles.php:188
    961965msgid "Cell Class"
    962966msgstr ""
    963967
    964 #: inc/styles.php:190
     968#: inc/styles.php:191
    965969msgid "Class added to all cells in this row."
    966970msgstr ""
    967971
    968 #: inc/styles.php:197
     972#: inc/styles.php:198
    969973msgid "Bottom Margin"
    970974msgstr ""
    971975
    972 #: inc/styles.php:200
     976#: inc/styles.php:201
    973977msgid "Space below the row. Default is %spx."
    974978msgstr ""
    975979
    976 #: inc/styles.php:205
     980#: inc/styles.php:206
    977981msgid "Gutter"
    978982msgstr ""
    979983
    980 #: inc/styles.php:208
     984#: inc/styles.php:209
    981985msgid "Amount of space between cells. Default is %spx."
    982986msgstr ""
    983987
    984 #: inc/styles.php:213
     988#: inc/styles.php:214
    985989msgid "Row Layout"
    986990msgstr ""
    987991
    988 #: inc/styles.php:217, inc/styles.php:230
     992#: inc/styles.php:218, inc/styles.php:231
    989993msgid "Standard"
    990994msgstr ""
    991995
    992 #: inc/styles.php:218
     996#: inc/styles.php:219
    993997msgid "Full Width"
    994998msgstr ""
    995999
    996 #: inc/styles.php:219
     1000#: inc/styles.php:220
    9971001msgid "Full Width Stretched"
    9981002msgstr ""
    9991003
    1000 #: inc/styles.php:220
     1004#: inc/styles.php:221
    10011005msgid "Full Width Stretched Padded"
    10021006msgstr ""
    10031007
    1004 #: inc/styles.php:226
     1008#: inc/styles.php:227
    10051009msgid "Collapse Behaviour"
    10061010msgstr ""
    10071011
    1008 #: inc/styles.php:231
     1012#: inc/styles.php:232
    10091013msgid "No Collapse"
    10101014msgstr ""
    10111015
    1012 #: inc/styles.php:237
     1016#: inc/styles.php:238
    10131017msgid "Collapse Order"
    10141018msgstr ""
    10151019
    1016 #: inc/styles.php:241, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757
     1020#: inc/styles.php:242, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757
    10171021msgid "Default"
    10181022msgstr ""
    10191023
    1020 #: inc/styles.php:242
     1024#: inc/styles.php:243
    10211025msgid "Left on Top"
    10221026msgstr ""
    10231027
    1024 #: inc/styles.php:243
     1028#: inc/styles.php:244
    10251029msgid "Right on Top"
    10261030msgstr ""
    10271031
    1028 #: inc/styles.php:250
     1032#: inc/styles.php:251
    10291033msgid "Cell Vertical Alignment"
    10301034msgstr ""
    10311035
    1032 #: inc/styles.php:255, inc/styles.php:284, widgets/widgets/button/button.php:31
     1036#: inc/styles.php:256, inc/styles.php:285, widgets/widgets/button/button.php:31
    10331037msgid "Center"
    10341038msgstr ""
    10351039
    1036 #: inc/styles.php:257, inc/styles.php:286
     1040#: inc/styles.php:258, inc/styles.php:287
    10371041msgid "Stretch"
    10381042msgstr ""
    10391043
    1040 #: inc/styles.php:275
     1044#: inc/styles.php:276
    10411045msgid "Cell"
    10421046msgstr ""
    10431047
    1044 #: inc/styles.php:278
     1048#: inc/styles.php:279
    10451049msgid "Vertical Alignment"
    10461050msgstr ""
    10471051
    1048 #: inc/styles.php:282
     1052#: inc/styles.php:283
    10491053msgid "Use row setting"
    10501054msgstr ""
    10511055
    1052 #: inc/styles.php:292, inc/styles.php:332
     1056#: inc/styles.php:293, inc/styles.php:333
    10531057msgid "Font Color"
    10541058msgstr ""
    10551059
    1056 #: inc/styles.php:295
     1060#: inc/styles.php:296
    10571061msgid "Color of text inside this cell."
    10581062msgstr ""
    10591063
    1060 #: inc/styles.php:300, inc/styles.php:340
     1064#: inc/styles.php:301, inc/styles.php:341
    10611065msgid "Links Color"
    10621066msgstr ""
    10631067
    1064 #: inc/styles.php:303
     1068#: inc/styles.php:304
    10651069msgid "Color of links inside this cell."
    10661070msgstr ""
    10671071
    1068 #: inc/styles.php:321
     1072#: inc/styles.php:322
    10691073msgid "Margin"
    10701074msgstr ""
    10711075
    1072 #: inc/styles.php:324
     1076#: inc/styles.php:325
    10731077msgid "Margins around the widget."
    10741078msgstr ""
    10751079
    1076 #: inc/styles.php:335
     1080#: inc/styles.php:336
    10771081msgid "Color of text inside this widget."
    10781082msgstr ""
    10791083
    1080 #: inc/styles.php:343
     1084#: inc/styles.php:344
    10811085msgid "Color of links inside this widget."
    10821086msgstr ""
     
    10911095msgstr ""
    10921096
    1093 #: inc/widgets/layout.php:83
     1097#: inc/widgets/layout.php:84
    10941098msgid "This widget can currently only be used in the WordPress admin interface."
    10951099msgstr ""
    10961100
    1097 #: inc/widgets/layout.php:108
     1101#: inc/widgets/layout.php:109
    10981102msgid "Open Builder"
    10991103msgstr ""
  • siteorigin-panels/tags/2.10.6/readme.txt

    r2083868 r2104964  
    33Requires at least: 4.4
    44Tested up to: 5.2
    5 Stable tag: 2.10.5
    6 Build time: 2019-04-05T17:48:13-07:00
     5Stable tag: 2.10.6
     6Build time: 2019-06-12T11:06:03-07:00
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    9696
    9797== 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.
    98109
    99110= 2.10.5 - 5 April 2019 =
  • siteorigin-panels/tags/2.10.6/siteorigin-panels.php

    r2064086 r2104964  
    44Plugin URI: https://siteorigin.com/page-builder/
    55Description: A drag and drop, responsive page builder that simplifies building your website.
    6 Version: 2.10.5
     6Version: 2.10.6
    77Author: SiteOrigin
    88Author URI: https://siteorigin.com
     
    1212*/
    1313
    14 define( 'SITEORIGIN_PANELS_VERSION', '2.10.5' );
     14define( 'SITEORIGIN_PANELS_VERSION', '2.10.6' );
    1515if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
    1616    define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
    1717}
    1818define( 'SITEORIGIN_PANELS_CSS_SUFFIX', '.min' );
    19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2105' );
     19define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2106' );
    2020
    2121require_once plugin_dir_path( __FILE__ ) . 'inc/functions.php';
  • siteorigin-panels/trunk/compat/js/siteorigin-panels-layout-block.js

    r2061744 r2104964  
    9393        this.fetchPreview(this.props);
    9494      } else if (!this.previewInitialized && this.previewContainer.current) {
    95         $(document).trigger('panels_setup_preview');
     95        jQuery(document).trigger('panels_setup_preview');
    9696        this.previewInitialized = true;
    9797      }
     
    112112      }); // Make sure panelsData is defined and clone so that we don't alter the underlying attribute.
    113113
    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.
    115115
    116116      var rowOrWidgetMouseDown = function rowOrWidgetMouseDown() {
     
    120120
    121121        var rowOrWidgetMouseUp = function rowOrWidgetMouseUp() {
    122           $(document).off('mouseup', rowOrWidgetMouseUp);
     122          jQuery(document).off('mouseup', rowOrWidgetMouseUp);
    123123
    124124          if (isFunction(_this2.props.onRowOrWidgetMouseUp)) {
     
    127127        };
    128128
    129         $(document).on('mouseup', rowOrWidgetMouseUp);
     129        jQuery(document).on('mouseup', rowOrWidgetMouseUp);
    130130      };
    131131
     
    164164        }
    165165      });
    166       $(document).trigger('panels_setup', this.builderView);
     166      jQuery(document).trigger('panels_setup', this.builderView);
    167167      this.panelsInitialized = true;
    168168    }
     
    177177
    178178      this.previewInitialized = false;
    179       var fetchRequest = this.currentFetchRequest = $.post({
     179      var fetchRequest = this.currentFetchRequest = jQuery.post({
    180180        url: soPanelsBlockEditorAdmin.previewUrl,
    181181        data: {
     
    276276      if (!_.isEmpty(newPanelsData.widgets)) {
    277277        // Send panelsData to server for sanitization.
    278         $.post(soPanelsBlockEditorAdmin.sanitizeUrl, {
     278        jQuery.post(soPanelsBlockEditorAdmin.sanitizeUrl, {
    279279          action: 'so_panels_layout_block_sanitize',
    280280          panelsData: JSON.stringify(newPanelsData)
     
    310310});
    311311
    312 (function ($) {
     312(function (jQuery) {
    313313  if (soPanelsBlockEditorAdmin.showAddButton) {
    314     $(function () {
     314    jQuery(function () {
    315315      setTimeout(function () {
    316316        var editorDispatch = wp.data.dispatch('core/editor');
    317317        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');
    320320        $addButton.on('click', function () {
    321321          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  
    9191        $panels_data = $this->sanitize_panels_data( $panels_data );
    9292        $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 );
    93102        $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, true, $panels_data );
     103        remove_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name );
    94104        return $rendered_layout;
    95105    }
  • siteorigin-panels/trunk/inc/admin.php

    r2061744 r2104964  
    12581258        $is_panels_type = in_array( $typenow, $post_types );
    12591259        $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 ) {
    12621263            $settings_url = self_admin_url( 'options-general.php?page=siteorigin_panels' );
    12631264            $notice = sprintf(
     
    12881289        }
    12891290       
    1290         // If the `$post_type` is set to be used by Page Builder.
    12911291        $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 );
    12931295        $use_classic = siteorigin_panels_setting( 'use-classic' );
    12941296        // For existing posts.
     
    12981300            if ( ! has_blocks( $post ) ) {
    12991301                $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 ) ) {
    13031303                    $use_block_editor = false;
    13041304                }
    13051305            }
    1306         } else if ( $is_panels_type ) {
     1306        } else if ( $is_new_panels_type ) {
    13071307            $use_block_editor = false;
    13081308        }
     
    14711471        }
    14721472       
    1473         return $show;
     1473        return apply_filters( 'so_panels_show_add_new_dropdown_for_type', $show, $post_type );
    14741474    }
    14751475   
  • siteorigin-panels/trunk/inc/styles.php

    r1912037 r2104964  
    154154                'cover'             => __( 'Cover', 'siteorigin-panels' ),
    155155                'center'            => __( 'Centered, with original size', 'siteorigin-panels' ),
     156                'contain'           => __( 'Contain', 'siteorigin-panels' ),
    156157                'fixed'             => __( 'Fixed', 'siteorigin-panels' ),
    157158                'parallax'          => __( 'Parallax', 'siteorigin-panels' ),
     
    448449                        $css[ 'background-position' ] = 'center center';
    449450                        $css[ 'background-size' ] = 'cover';
     451                        break;
     452                    case 'contain':
     453                        $css[ 'background-size' ] = 'contain';
    450454                        break;
    451455                    case 'center':
  • siteorigin-panels/trunk/inc/widgets/layout.php

    r2061744 r2104964  
    3838       
    3939        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        );
    5051        echo $args['after_widget'];
    5152    }
  • siteorigin-panels/trunk/js/yoast-compat.js

    r1986233 r2104964  
    5353            try{
    5454                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())),
    5858                        widgetInstance = data.instance,
    5959                        newHTML = '';
     
    8585                                break;
    8686
     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
    87105                            case 'SiteOrigin_Widget_Accordion_Widget':
    88106                            case 'SiteOrigin_Widget_Tabs_Widget':
    89107                                var contentItems = widgetClass === 'SiteOrigin_Widget_Accordion_Widget' ? widgetInstance.panels : widgetInstance.tabs;
    90108                                newHTML = $( '<div/>' );
    91                                 for( var i = 0; i < contentItems.length; i++ ) {
     109                                for ( var i = 0; i < contentItems.length; i++ ) {
    92110                                    var item = contentItems[ i ];
    93111                                    if ( item.content_type !== 'text' ) {
     
    99117                                }
    100118                                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');
    101125                                break;
    102126                        }
  • 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}});
     1jQuery(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  
    375375msgstr ""
    376376
    377 #: inc/admin.php:460, inc/admin.php:468, inc/styles.php:184, tpl/js-templates.php:62
     377#: inc/admin.php:460, inc/admin.php:468, inc/styles.php:185, tpl/js-templates.php:62
    378378msgid "Row"
    379379msgstr ""
     
    395395msgstr ""
    396396
    397 #: inc/admin.php:467, inc/styles.php:318, tpl/js-templates.php:61
     397#: inc/admin.php:467, inc/styles.php:319, tpl/js-templates.php:61
    398398msgid "Widget"
    399399msgstr ""
     
    826826msgstr ""
    827827
    828 #: inc/styles-admin.php:187, inc/styles.php:254, inc/styles.php:283
     828#: inc/styles-admin.php:187, inc/styles.php:255, inc/styles.php:284
    829829msgid "Top"
    830830msgstr ""
     
    834834msgstr ""
    835835
    836 #: inc/styles-admin.php:195, inc/styles.php:256, inc/styles.php:285
     836#: inc/styles-admin.php:195, inc/styles.php:257, inc/styles.php:286
    837837msgid "Bottom"
    838838msgstr ""
     
    935935
    936936#: inc/styles.php:156
     937msgid "Contain"
     938msgstr ""
     939
     940#: inc/styles.php:157
    937941msgid "Fixed"
    938942msgstr ""
    939943
    940 #: inc/styles.php:157
     944#: inc/styles.php:158
    941945msgid "Parallax"
    942946msgstr ""
    943947
    944 #: inc/styles.php:158
     948#: inc/styles.php:159
    945949msgid "Parallax (Original Size)"
    946950msgstr ""
    947951
    948 #: inc/styles.php:160
     952#: inc/styles.php:161
    949953msgid "How the background image is displayed."
    950954msgstr ""
    951955
    952 #: inc/styles.php:165
     956#: inc/styles.php:166
    953957msgid "Border Color"
    954958msgstr ""
    955959
    956 #: inc/styles.php:168
     960#: inc/styles.php:169
    957961msgid "Border color of the %s."
    958962msgstr ""
    959963
    960 #: inc/styles.php:187
     964#: inc/styles.php:188
    961965msgid "Cell Class"
    962966msgstr ""
    963967
    964 #: inc/styles.php:190
     968#: inc/styles.php:191
    965969msgid "Class added to all cells in this row."
    966970msgstr ""
    967971
    968 #: inc/styles.php:197
     972#: inc/styles.php:198
    969973msgid "Bottom Margin"
    970974msgstr ""
    971975
    972 #: inc/styles.php:200
     976#: inc/styles.php:201
    973977msgid "Space below the row. Default is %spx."
    974978msgstr ""
    975979
    976 #: inc/styles.php:205
     980#: inc/styles.php:206
    977981msgid "Gutter"
    978982msgstr ""
    979983
    980 #: inc/styles.php:208
     984#: inc/styles.php:209
    981985msgid "Amount of space between cells. Default is %spx."
    982986msgstr ""
    983987
    984 #: inc/styles.php:213
     988#: inc/styles.php:214
    985989msgid "Row Layout"
    986990msgstr ""
    987991
    988 #: inc/styles.php:217, inc/styles.php:230
     992#: inc/styles.php:218, inc/styles.php:231
    989993msgid "Standard"
    990994msgstr ""
    991995
    992 #: inc/styles.php:218
     996#: inc/styles.php:219
    993997msgid "Full Width"
    994998msgstr ""
    995999
    996 #: inc/styles.php:219
     1000#: inc/styles.php:220
    9971001msgid "Full Width Stretched"
    9981002msgstr ""
    9991003
    1000 #: inc/styles.php:220
     1004#: inc/styles.php:221
    10011005msgid "Full Width Stretched Padded"
    10021006msgstr ""
    10031007
    1004 #: inc/styles.php:226
     1008#: inc/styles.php:227
    10051009msgid "Collapse Behaviour"
    10061010msgstr ""
    10071011
    1008 #: inc/styles.php:231
     1012#: inc/styles.php:232
    10091013msgid "No Collapse"
    10101014msgstr ""
    10111015
    1012 #: inc/styles.php:237
     1016#: inc/styles.php:238
    10131017msgid "Collapse Order"
    10141018msgstr ""
    10151019
    1016 #: inc/styles.php:241, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757
     1020#: inc/styles.php:242, inc/widgets/post-loop.php:325, widgets/widgets.php:635, widgets/widgets.php:757
    10171021msgid "Default"
    10181022msgstr ""
    10191023
    1020 #: inc/styles.php:242
     1024#: inc/styles.php:243
    10211025msgid "Left on Top"
    10221026msgstr ""
    10231027
    1024 #: inc/styles.php:243
     1028#: inc/styles.php:244
    10251029msgid "Right on Top"
    10261030msgstr ""
    10271031
    1028 #: inc/styles.php:250
     1032#: inc/styles.php:251
    10291033msgid "Cell Vertical Alignment"
    10301034msgstr ""
    10311035
    1032 #: inc/styles.php:255, inc/styles.php:284, widgets/widgets/button/button.php:31
     1036#: inc/styles.php:256, inc/styles.php:285, widgets/widgets/button/button.php:31
    10331037msgid "Center"
    10341038msgstr ""
    10351039
    1036 #: inc/styles.php:257, inc/styles.php:286
     1040#: inc/styles.php:258, inc/styles.php:287
    10371041msgid "Stretch"
    10381042msgstr ""
    10391043
    1040 #: inc/styles.php:275
     1044#: inc/styles.php:276
    10411045msgid "Cell"
    10421046msgstr ""
    10431047
    1044 #: inc/styles.php:278
     1048#: inc/styles.php:279
    10451049msgid "Vertical Alignment"
    10461050msgstr ""
    10471051
    1048 #: inc/styles.php:282
     1052#: inc/styles.php:283
    10491053msgid "Use row setting"
    10501054msgstr ""
    10511055
    1052 #: inc/styles.php:292, inc/styles.php:332
     1056#: inc/styles.php:293, inc/styles.php:333
    10531057msgid "Font Color"
    10541058msgstr ""
    10551059
    1056 #: inc/styles.php:295
     1060#: inc/styles.php:296
    10571061msgid "Color of text inside this cell."
    10581062msgstr ""
    10591063
    1060 #: inc/styles.php:300, inc/styles.php:340
     1064#: inc/styles.php:301, inc/styles.php:341
    10611065msgid "Links Color"
    10621066msgstr ""
    10631067
    1064 #: inc/styles.php:303
     1068#: inc/styles.php:304
    10651069msgid "Color of links inside this cell."
    10661070msgstr ""
    10671071
    1068 #: inc/styles.php:321
     1072#: inc/styles.php:322
    10691073msgid "Margin"
    10701074msgstr ""
    10711075
    1072 #: inc/styles.php:324
     1076#: inc/styles.php:325
    10731077msgid "Margins around the widget."
    10741078msgstr ""
    10751079
    1076 #: inc/styles.php:335
     1080#: inc/styles.php:336
    10771081msgid "Color of text inside this widget."
    10781082msgstr ""
    10791083
    1080 #: inc/styles.php:343
     1084#: inc/styles.php:344
    10811085msgid "Color of links inside this widget."
    10821086msgstr ""
     
    10911095msgstr ""
    10921096
    1093 #: inc/widgets/layout.php:83
     1097#: inc/widgets/layout.php:84
    10941098msgid "This widget can currently only be used in the WordPress admin interface."
    10951099msgstr ""
    10961100
    1097 #: inc/widgets/layout.php:108
     1101#: inc/widgets/layout.php:109
    10981102msgid "Open Builder"
    10991103msgstr ""
  • siteorigin-panels/trunk/readme.txt

    r2083868 r2104964  
    33Requires at least: 4.4
    44Tested up to: 5.2
    5 Stable tag: 2.10.5
    6 Build time: 2019-04-05T17:48:13-07:00
     5Stable tag: 2.10.6
     6Build time: 2019-06-12T11:06:03-07:00
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    9696
    9797== 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.
    98109
    99110= 2.10.5 - 5 April 2019 =
  • siteorigin-panels/trunk/siteorigin-panels.php

    r2064086 r2104964  
    44Plugin URI: https://siteorigin.com/page-builder/
    55Description: A drag and drop, responsive page builder that simplifies building your website.
    6 Version: 2.10.5
     6Version: 2.10.6
    77Author: SiteOrigin
    88Author URI: https://siteorigin.com
     
    1212*/
    1313
    14 define( 'SITEORIGIN_PANELS_VERSION', '2.10.5' );
     14define( 'SITEORIGIN_PANELS_VERSION', '2.10.6' );
    1515if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
    1616    define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
    1717}
    1818define( 'SITEORIGIN_PANELS_CSS_SUFFIX', '.min' );
    19 define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2105' );
     19define( 'SITEORIGIN_PANELS_VERSION_SUFFIX', '-2106' );
    2020
    2121require_once plugin_dir_path( __FILE__ ) . 'inc/functions.php';
Note: See TracChangeset for help on using the changeset viewer.