Version Description
- 4 July 2016 =
- Made Live Editor quick link optional from Page Builder settings page.
- Added option to specify parallax motion.
- Fixed settings help link.
- Renamed Prebuilt to Layouts
- Reverted sidebars emulator change.
- Skip empty attributes in CSS generator class.
Download this release
Release Info
Developer | gpriday |
Plugin | Page Builder by SiteOrigin |
Version | 2.4.10 |
Comparing to | |
See all releases |
Code changes from version 2.4.9 to 2.4.10
- inc/css.php +2 -1
- inc/default-styles.php +1 -0
- inc/sidebars-emulator.php +2 -2
- js/siteorigin-parallax.js +1 -1
- js/siteorigin-parallax.min.js +1 -1
- readme.txt +10 -2
- settings/settings.php +30 -3
- settings/tpl/help.php +1 -1
- siteorigin-panels.php +12 -4
- tpl/js-templates.php +2 -2
inc/css.php
CHANGED
@@ -22,8 +22,9 @@ class SiteOrigin_Panels_Css_Builder {
|
|
22 |
* @param int $resolution The pixel resolution that this applies to
|
23 |
*/
|
24 |
function add_css($selector, $attributes, $resolution = 1920) {
|
25 |
-
$attribute_string =
|
26 |
foreach( $attributes as $k => $v ) {
|
|
|
27 |
$attribute_string[] = $k.':'.$v;
|
28 |
}
|
29 |
$attribute_string = implode(';', $attribute_string);
|
22 |
* @param int $resolution The pixel resolution that this applies to
|
23 |
*/
|
24 |
function add_css($selector, $attributes, $resolution = 1920) {
|
25 |
+
$attribute_string = array();
|
26 |
foreach( $attributes as $k => $v ) {
|
27 |
+
if( empty( $v ) ) continue;
|
28 |
$attribute_string[] = $k.':'.$v;
|
29 |
}
|
30 |
$attribute_string = implode(';', $attribute_string);
|
inc/default-styles.php
CHANGED
@@ -298,6 +298,7 @@ class SiteOrigin_Panels_Default_Styling {
|
|
298 |
'backgroundUrl' => $url[0],
|
299 |
'backgroundSize' => array( $url[1], $url[2] ),
|
300 |
'backgroundSizing' => $args['background_display'] == 'parallax-original' ? 'original' : 'scaled',
|
|
|
301 |
);
|
302 |
$attributes['data-siteorigin-parallax'] = json_encode( $parallax_args );
|
303 |
$attributes['style'] .= 'background-image: url(' . $url[0] . '); background-position: center center; background-repeat: no-repeat;';
|
298 |
'backgroundUrl' => $url[0],
|
299 |
'backgroundSize' => array( $url[1], $url[2] ),
|
300 |
'backgroundSizing' => $args['background_display'] == 'parallax-original' ? 'original' : 'scaled',
|
301 |
+
'limitMotion' => siteorigin_panels_setting( 'parallax-motion' ) ? floatval( siteorigin_panels_setting( 'parallax-motion' ) ) : 'auto',
|
302 |
);
|
303 |
$attributes['data-siteorigin-parallax'] = json_encode( $parallax_args );
|
304 |
$attributes['style'] .= 'background-image: url(' . $url[0] . '); background-position: center center; background-repeat: no-repeat;';
|
inc/sidebars-emulator.php
CHANGED
@@ -6,7 +6,7 @@ class SiteOrigin_Panels_Sidebars_Emulator {
|
|
6 |
|
7 |
function __construct() {
|
8 |
$this->all_posts_widgets = array();
|
9 |
-
add_action( '
|
10 |
add_filter( 'sidebars_widgets', array( $this, 'add_widgets_to_sidebars' ) );
|
11 |
}
|
12 |
|
@@ -125,4 +125,4 @@ class SiteOrigin_Panels_Sidebars_Emulator {
|
|
125 |
}
|
126 |
}
|
127 |
|
128 |
-
SiteOrigin_Panels_Sidebars_Emulator::single();
|
6 |
|
7 |
function __construct() {
|
8 |
$this->all_posts_widgets = array();
|
9 |
+
add_action( 'widgets_init', array( $this, 'register_widgets' ), 99 );
|
10 |
add_filter( 'sidebars_widgets', array( $this, 'add_widgets_to_sidebars' ) );
|
11 |
}
|
12 |
|
125 |
}
|
126 |
}
|
127 |
|
128 |
+
SiteOrigin_Panels_Sidebars_Emulator::single();
|
js/siteorigin-parallax.js
CHANGED
@@ -58,7 +58,7 @@
|
|
58 |
limitMotion = (-0.00017 * ( windowHeight - 720 ) ) + 0.55;
|
59 |
}
|
60 |
} else {
|
61 |
-
limitMotion = options.limitMotion;
|
62 |
}
|
63 |
|
64 |
// What percent is this through a screen cycle
|
58 |
limitMotion = (-0.00017 * ( windowHeight - 720 ) ) + 0.55;
|
59 |
}
|
60 |
} else {
|
61 |
+
limitMotion = parseFloat( options.limitMotion );
|
62 |
}
|
63 |
|
64 |
// What percent is this through a screen cycle
|
js/siteorigin-parallax.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(i){i.fn.siteOriginParallax=function(a){var o=i(this);if("refreshParallax"===a)return o.trigger("refreshParallax");a=i.extend({backgroundUrl:null,backgroundSize:null,backgroundAspectRatio:null,backgroundSizing:"scaled",limitMotion:"auto"},a),null===a.backgroundAspectRatio&&(a.backgroundAspectRatio=a.backgroundSize[0]/a.backgroundSize[1]);var n=function(){try{var n=[o.outerWidth(),o.outerHeight()],r=o[0].getBoundingClientRect(),t=i(window).outerHeight();void 0===o.data("siteorigin-parallax-init")&&o.css({"background-image":"url("+a.backgroundUrl+")"});var e;e="auto"===a.limitMotion?720>t?.55:t>1300?.45:-17e-5*(t-720)+.55:a.limitMotion;var c=(r.bottom+(r.top-t))/(t+r.height),s=(c-1)/-2,l=0,u=1,g=a.backgroundSize;if("scaled"===a.backgroundSizing){var d=n[1]/(e?e:1),b=n[0]/g[0];if(d>g[1]*b&&(b=d/g[1],e=!1),o.css("background-size",g[0]*b+"px "+g[1]*b+"px"),r.top>-n[1]&&r.bottom-t<n[1]){var k=g[1]*b;e&&k>t*e&&(u=t*e/k,s=s*u+(1-u)/2),l=-(k-n[1])*s}o.css("background-position","50% "+l+"px")}else"original"===a.backgroundSizing&&(e&&g[1]>t*e&&(u=t*e/g[1],s=s*u+(1-u)/2),l=-(g[1]-n[1])*s,o.css("background-size","auto"),o.css("background-position","50% "+l+"px"))}catch(p){console.log(p.message),o.css({"background-size":"scaled"===a.backgroundSizing?"cover":"auto","background-position":"50% 50%"})}};n(),i(window).on("scroll",n),i(window).on("resize",n),i(window).on("panelsStretchRows",n),o.on("refreshParallax",n)}}(jQuery),jQuery(function(i){i("[data-siteorigin-parallax]").each(function(){i(this).siteOriginParallax(i(this).data("siteorigin-parallax"))})});
|
1 |
+
!function(i){i.fn.siteOriginParallax=function(a){var o=i(this);if("refreshParallax"===a)return o.trigger("refreshParallax");a=i.extend({backgroundUrl:null,backgroundSize:null,backgroundAspectRatio:null,backgroundSizing:"scaled",limitMotion:"auto"},a),null===a.backgroundAspectRatio&&(a.backgroundAspectRatio=a.backgroundSize[0]/a.backgroundSize[1]);var n=function(){try{var n=[o.outerWidth(),o.outerHeight()],r=o[0].getBoundingClientRect(),t=i(window).outerHeight();void 0===o.data("siteorigin-parallax-init")&&o.css({"background-image":"url("+a.backgroundUrl+")"});var e;e="auto"===a.limitMotion?720>t?.55:t>1300?.45:-17e-5*(t-720)+.55:parseFloat(a.limitMotion);var c=(r.bottom+(r.top-t))/(t+r.height),s=(c-1)/-2,l=0,u=1,g=a.backgroundSize;if("scaled"===a.backgroundSizing){var d=n[1]/(e?e:1),b=n[0]/g[0];if(d>g[1]*b&&(b=d/g[1],e=!1),o.css("background-size",g[0]*b+"px "+g[1]*b+"px"),r.top>-n[1]&&r.bottom-t<n[1]){var k=g[1]*b;e&&k>t*e&&(u=t*e/k,s=s*u+(1-u)/2),l=-(k-n[1])*s}o.css("background-position","50% "+l+"px")}else"original"===a.backgroundSizing&&(e&&g[1]>t*e&&(u=t*e/g[1],s=s*u+(1-u)/2),l=-(g[1]-n[1])*s,o.css("background-size","auto"),o.css("background-position","50% "+l+"px"))}catch(p){console.log(p.message),o.css({"background-size":"scaled"===a.backgroundSizing?"cover":"auto","background-position":"50% 50%"})}};n(),i(window).on("scroll",n),i(window).on("resize",n),i(window).on("panelsStretchRows",n),o.on("refreshParallax",n)}}(jQuery),jQuery(function(i){i("[data-siteorigin-parallax]").each(function(){i(this).siteOriginParallax(i(this).data("siteorigin-parallax"))})});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
|
3 |
Requires at least: 4.0
|
4 |
Tested up to: 4.5.2
|
5 |
-
Stable tag: 2.4.
|
6 |
-
Build time: 2016-
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
Donate link: http://siteorigin.com/page-builder/#donate
|
@@ -96,6 +96,14 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.
|
|
96 |
|
97 |
== Changelog ==
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
= 2.4.9 - May 26 2016 =
|
100 |
* Improved parallax library to upscale images to ensure enough of a parallax.
|
101 |
* Allow negative values in measurement fields.
|
2 |
Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
|
3 |
Requires at least: 4.0
|
4 |
Tested up to: 4.5.2
|
5 |
+
Stable tag: 2.4.10
|
6 |
+
Build time: 2016-07-04T11:29:25+02:00
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
Donate link: http://siteorigin.com/page-builder/#donate
|
96 |
|
97 |
== Changelog ==
|
98 |
|
99 |
+
= 2.4.10 - 4 July 2016 =
|
100 |
+
* Made Live Editor quick link optional from Page Builder settings page.
|
101 |
+
* Added option to specify parallax motion.
|
102 |
+
* Fixed settings help link.
|
103 |
+
* Renamed Prebuilt to Layouts
|
104 |
+
* Reverted sidebars emulator change.
|
105 |
+
* Skip empty attributes in CSS generator class.
|
106 |
+
|
107 |
= 2.4.9 - May 26 2016 =
|
108 |
* Improved parallax library to upscale images to ensure enough of a parallax.
|
109 |
* Allow negative values in measurement fields.
|
settings/settings.php
CHANGED
@@ -108,15 +108,17 @@ class SiteOrigin_Panels_Settings {
|
|
108 |
$defaults['home-template'] = 'home-panels.php';
|
109 |
$defaults['affiliate-id'] = apply_filters( 'siteorigin_panels_affiliate_id', false );
|
110 |
|
|
|
|
|
|
|
|
|
|
|
111 |
// Widgets fields
|
112 |
$defaults['title-html'] = '<h3 class="widget-title">{{title}}</h3>';
|
113 |
$defaults['add-widget-class'] = apply_filters( 'siteorigin_panels_default_add_widget_class', true );
|
114 |
$defaults['bundled-widgets'] = get_option( 'siteorigin_panels_is_using_bundled', false );
|
115 |
$defaults['recommended-widgets'] = true;
|
116 |
|
117 |
-
// Post types
|
118 |
-
$defaults['post-types'] = array('page', 'post');
|
119 |
-
|
120 |
// The layout fields
|
121 |
$defaults['responsive'] = true;
|
122 |
$defaults['tablet-layout'] = false;
|
@@ -218,6 +220,18 @@ class SiteOrigin_Panels_Settings {
|
|
218 |
'description' => __('The post types to use Page Builder on.', 'siteorigin-panels'),
|
219 |
);
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
// The widgets fields
|
222 |
|
223 |
$fields['widgets'] = array(
|
@@ -341,6 +355,7 @@ class SiteOrigin_Panels_Settings {
|
|
341 |
|
342 |
switch ($field['type'] ) {
|
343 |
case 'text':
|
|
|
344 |
?><input name="<?php echo esc_attr($field_name) ?>" class="panels-setting-<?php echo esc_attr($field['type']) ?>" type="text" value="<?php echo esc_attr($value) ?>" /> <?php
|
345 |
break;
|
346 |
|
@@ -419,6 +434,18 @@ class SiteOrigin_Panels_Settings {
|
|
419 |
if( $post[$field_id] != '' ) {
|
420 |
$values[$field_id] = !empty($post[$field_id]) ? intval( $post[$field_id] ) : 0;
|
421 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
break;
|
423 |
|
424 |
case 'html':
|
108 |
$defaults['home-template'] = 'home-panels.php';
|
109 |
$defaults['affiliate-id'] = apply_filters( 'siteorigin_panels_affiliate_id', false );
|
110 |
|
111 |
+
// The general fields
|
112 |
+
$defaults['post-types'] = array('page', 'post');
|
113 |
+
$defaults['live-editor-quick-link'] = true;
|
114 |
+
$defaults['parallax-motion'] = '';
|
115 |
+
|
116 |
// Widgets fields
|
117 |
$defaults['title-html'] = '<h3 class="widget-title">{{title}}</h3>';
|
118 |
$defaults['add-widget-class'] = apply_filters( 'siteorigin_panels_default_add_widget_class', true );
|
119 |
$defaults['bundled-widgets'] = get_option( 'siteorigin_panels_is_using_bundled', false );
|
120 |
$defaults['recommended-widgets'] = true;
|
121 |
|
|
|
|
|
|
|
122 |
// The layout fields
|
123 |
$defaults['responsive'] = true;
|
124 |
$defaults['tablet-layout'] = false;
|
220 |
'description' => __('The post types to use Page Builder on.', 'siteorigin-panels'),
|
221 |
);
|
222 |
|
223 |
+
$fields['general']['fields']['live-editor-quick-link'] = array(
|
224 |
+
'type' => 'checkbox',
|
225 |
+
'label' => __('Live Editor Quick Link', 'siteorigin-panels'),
|
226 |
+
'description' => __('Display a Live Editor button in the admin bar.', 'siteorigin-panels'),
|
227 |
+
);
|
228 |
+
|
229 |
+
$fields['general']['fields']['parallax-motion'] = array(
|
230 |
+
'type' => 'float',
|
231 |
+
'label' => __('Limit Parallax Motion', 'siteorigin-panels'),
|
232 |
+
'description' => __('How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect.', 'siteorigin-panels'),
|
233 |
+
);
|
234 |
+
|
235 |
// The widgets fields
|
236 |
|
237 |
$fields['widgets'] = array(
|
355 |
|
356 |
switch ($field['type'] ) {
|
357 |
case 'text':
|
358 |
+
case 'float':
|
359 |
?><input name="<?php echo esc_attr($field_name) ?>" class="panels-setting-<?php echo esc_attr($field['type']) ?>" type="text" value="<?php echo esc_attr($value) ?>" /> <?php
|
360 |
break;
|
361 |
|
434 |
if( $post[$field_id] != '' ) {
|
435 |
$values[$field_id] = !empty($post[$field_id]) ? intval( $post[$field_id] ) : 0;
|
436 |
}
|
437 |
+
else {
|
438 |
+
$values[$field_id] = '';
|
439 |
+
}
|
440 |
+
break;
|
441 |
+
|
442 |
+
case 'float':
|
443 |
+
if( $post[$field_id] != '' ) {
|
444 |
+
$values[$field_id] = !empty($post[$field_id]) ? floatval( $post[$field_id] ) : 0;
|
445 |
+
}
|
446 |
+
else {
|
447 |
+
$values[$field_id] = '';
|
448 |
+
}
|
449 |
break;
|
450 |
|
451 |
case 'html':
|
settings/tpl/help.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<?php
|
3 |
echo preg_replace(
|
4 |
'/1\{ *(.*?) *\}/',
|
5 |
-
'<a href="https://siteorigin.com/page-builder/
|
6 |
__( 'Please read the 1{settings guide} of the Page Builder documentation for help.', 'siteorigin-panels' )
|
7 |
);
|
8 |
?>
|
2 |
<?php
|
3 |
echo preg_replace(
|
4 |
'/1\{ *(.*?) *\}/',
|
5 |
+
'<a href="https://siteorigin.com/page-builder/settings/" target="_blank">$1</a>',
|
6 |
__( 'Please read the 1{settings guide} of the Page Builder documentation for help.', 'siteorigin-panels' )
|
7 |
);
|
8 |
?>
|
siteorigin-panels.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Page Builder by SiteOrigin
|
4 |
Plugin URI: https://siteorigin.com/page-builder/
|
5 |
Description: A drag and drop, responsive page builder that simplifies building your website.
|
6 |
-
Version: 2.4.
|
7 |
Author: SiteOrigin
|
8 |
Author URI: https://siteorigin.com
|
9 |
License: GPL3
|
@@ -11,7 +11,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
|
|
11 |
Donate link: http://siteorigin.com/page-builder/#donate
|
12 |
*/
|
13 |
|
14 |
-
define('SITEORIGIN_PANELS_VERSION', '2.4.
|
15 |
if ( ! defined('SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
|
16 |
define('SITEORIGIN_PANELS_JS_SUFFIX', '.min');
|
17 |
}
|
@@ -645,7 +645,10 @@ function siteorigin_panels_process_raw_widgets($widgets) {
|
|
645 |
if( !empty($info['raw']) ) {
|
646 |
if ( isset( $wp_widget_factory->widgets[ $info['class'] ] ) && method_exists( $info['class'], 'update' ) ) {
|
647 |
$the_widget = $wp_widget_factory->widgets[ $info['class'] ];
|
648 |
-
$
|
|
|
|
|
|
|
649 |
unset($info['raw']);
|
650 |
}
|
651 |
}
|
@@ -1453,7 +1456,12 @@ add_action('plugin_action_links_' . plugin_basename(__FILE__), 'siteorigin_panel
|
|
1453 |
|
1454 |
function siteorigin_panels_live_edit_link( $wp_admin_bar ){
|
1455 |
// Add a Live Edit link if this is a Page Builder page that the user can edit
|
1456 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
1457 |
$wp_admin_bar->add_node( array(
|
1458 |
'id' => 'so_live_editor',
|
1459 |
'title' => __( 'Live Editor', 'siteorigin-panels' ),
|
3 |
Plugin Name: Page Builder by SiteOrigin
|
4 |
Plugin URI: https://siteorigin.com/page-builder/
|
5 |
Description: A drag and drop, responsive page builder that simplifies building your website.
|
6 |
+
Version: 2.4.10
|
7 |
Author: SiteOrigin
|
8 |
Author URI: https://siteorigin.com
|
9 |
License: GPL3
|
11 |
Donate link: http://siteorigin.com/page-builder/#donate
|
12 |
*/
|
13 |
|
14 |
+
define('SITEORIGIN_PANELS_VERSION', '2.4.10');
|
15 |
if ( ! defined('SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
|
16 |
define('SITEORIGIN_PANELS_JS_SUFFIX', '.min');
|
17 |
}
|
645 |
if( !empty($info['raw']) ) {
|
646 |
if ( isset( $wp_widget_factory->widgets[ $info['class'] ] ) && method_exists( $info['class'], 'update' ) ) {
|
647 |
$the_widget = $wp_widget_factory->widgets[ $info['class'] ];
|
648 |
+
$instance = $the_widget->update( $widgets[$i], $widgets[$i] );
|
649 |
+
$instance = apply_filters ( 'widget_update_callback', $instance, $widgets[$i], $widgets[$i], $the_widget );
|
650 |
+
|
651 |
+
$widgets[$i] = $instance;
|
652 |
unset($info['raw']);
|
653 |
}
|
654 |
}
|
1456 |
|
1457 |
function siteorigin_panels_live_edit_link( $wp_admin_bar ){
|
1458 |
// Add a Live Edit link if this is a Page Builder page that the user can edit
|
1459 |
+
if(
|
1460 |
+
siteorigin_panels_setting( 'live-editor-quick-link' ) &&
|
1461 |
+
is_singular() &&
|
1462 |
+
current_user_can( 'edit_post', get_the_ID() ) &&
|
1463 |
+
get_post_meta( get_the_ID(), 'panels_data', true )
|
1464 |
+
) {
|
1465 |
$wp_admin_bar->add_node( array(
|
1466 |
'id' => 'so_live_editor',
|
1467 |
'title' => __( 'Live Editor', 'siteorigin-panels' ),
|
tpl/js-templates.php
CHANGED
@@ -21,7 +21,7 @@ $layouts = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() );
|
|
21 |
|
22 |
<a class="so-tool-button so-prebuilt-add" title="<?php esc_attr_e( 'Prebuilt Layouts', 'siteorigin-panels' ) ?>">
|
23 |
<span class="so-panels-icon so-panels-icon-cubes"></span>
|
24 |
-
<span class="so-button-text"><?php esc_html_e('
|
25 |
</a>
|
26 |
|
27 |
<?php if( !empty($post) ) : ?>
|
@@ -348,7 +348,7 @@ $layouts = apply_filters( 'siteorigin_panels_prebuilt_layouts', array() );
|
|
348 |
<script type="text/template" id="siteorigin-panels-dialog-prebuilt">
|
349 |
<div class="dialog-data">
|
350 |
|
351 |
-
<h3 class="title"><?php _e('
|
352 |
|
353 |
<div class="left-sidebar">
|
354 |
|
21 |
|
22 |
<a class="so-tool-button so-prebuilt-add" title="<?php esc_attr_e( 'Prebuilt Layouts', 'siteorigin-panels' ) ?>">
|
23 |
<span class="so-panels-icon so-panels-icon-cubes"></span>
|
24 |
+
<span class="so-button-text"><?php esc_html_e('Layouts', 'siteorigin-panels') ?></span>
|
25 |
</a>
|
26 |
|
27 |
<?php if( !empty($post) ) : ?>
|
348 |
<script type="text/template" id="siteorigin-panels-dialog-prebuilt">
|
349 |
<div class="dialog-data">
|
350 |
|
351 |
+
<h3 class="title"><?php _e('Page Builder Layouts', 'siteorigin-panels') ?></h3>
|
352 |
|
353 |
<div class="left-sidebar">
|
354 |
|