Skip to content

Commit

Permalink
Merge branch 'release/2.4.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregpriday committed Dec 19, 2016
2 parents bc1dcfb + 9cdebdf commit 1b22379
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 91 deletions.
4 changes: 2 additions & 2 deletions css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
.siteorigin-panels-builder .so-tool-button:hover span {
color: #444444;
}
.siteorigin-panels-builder .so-tool-button.so-course-modal {
.siteorigin-panels-builder .so-tool-button.so-siteorigin-premium {
margin-left: 10px;
background: #FFFFFF;
}
.siteorigin-panels-builder .so-tool-button.so-course-modal:hover span {
.siteorigin-panels-builder .so-tool-button.so-siteorigin-premium:hover span {
color: #333;
}
.siteorigin-panels-builder .so-builder-toolbar {
Expand Down
2 changes: 1 addition & 1 deletion css/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
}
}

&.so-course-modal {
&.so-siteorigin-premium {
margin-left: 10px;
background: #FFFFFF;

Expand Down
59 changes: 0 additions & 59 deletions inc/learn.php

This file was deleted.

8 changes: 4 additions & 4 deletions js/siteorigin-panels.js
Original file line number Diff line number Diff line change
Expand Up @@ -3307,7 +3307,7 @@ module.exports = Backbone.View.extend( {

this.trigger( 'builder_rendered' );

this.$( 'a.so-course-modal' ).click( function( e ){
this.$( '.so-tip-wrapper a' ).click( function( e ){
e.preventDefault();
var $$ = $(this).blur();
var newwindow = window.open(
Expand Down Expand Up @@ -3883,7 +3883,7 @@ module.exports = Backbone.View.extend( {
*/
updateEditorContent: function ( content ) {
// Switch back to the standard editor
if ( this.config.editorType !== 'tinymce' || _.isUndefined( tinyMCE ) || _.isNull( tinyMCE.get( "content" ) ) ) {
if ( this.config.editorType !== 'tinyMCE' || typeof tinyMCE === 'undefined' || _.isNull( tinyMCE.get( "content" ) ) ) {
var $editor = $( this.config.editorId );
$editor.val( content ).trigger( 'change' ).trigger( 'keyup' );
} else {
Expand Down Expand Up @@ -3930,7 +3930,7 @@ module.exports = Backbone.View.extend( {
var editorContent = '';
var editor;

if ( ! _.isUndefined( tinyMCE ) ) {
if ( typeof tinyMCE !== 'undefined' ) {
editor = tinyMCE.get( 'content' );
}
if ( editor && _.isFunction( editor.getContent ) ) {
Expand Down Expand Up @@ -4839,7 +4839,7 @@ module.exports = Backbone.View.extend( {
else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
// This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
var editor = null;
if ( ! _.isUndefined( tinyMCE ) ) {
if ( typeof tinyMCE !== 'undefined' ) {
editor = tinyMCE.get( $$.attr( 'id' ) );
}

Expand Down
6 changes: 3 additions & 3 deletions js/siteorigin-panels/view/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module.exports = Backbone.View.extend( {

this.trigger( 'builder_rendered' );

this.$( 'a.so-course-modal' ).click( function( e ){
this.$( '.so-tip-wrapper a' ).click( function( e ){
e.preventDefault();
var $$ = $(this).blur();
var newwindow = window.open(
Expand Down Expand Up @@ -689,7 +689,7 @@ module.exports = Backbone.View.extend( {
*/
updateEditorContent: function ( content ) {
// Switch back to the standard editor
if ( this.config.editorType !== 'tinymce' || _.isUndefined( tinyMCE ) || _.isNull( tinyMCE.get( "content" ) ) ) {
if ( this.config.editorType !== 'tinyMCE' || typeof tinyMCE === 'undefined' || _.isNull( tinyMCE.get( "content" ) ) ) {
var $editor = $( this.config.editorId );
$editor.val( content ).trigger( 'change' ).trigger( 'keyup' );
} else {
Expand Down Expand Up @@ -736,7 +736,7 @@ module.exports = Backbone.View.extend( {
var editorContent = '';
var editor;

if ( ! _.isUndefined( tinyMCE ) ) {
if ( typeof tinyMCE !== 'undefined' ) {
editor = tinyMCE.get( 'content' );
}
if ( editor && _.isFunction( editor.getContent ) ) {
Expand Down
2 changes: 1 addition & 1 deletion js/siteorigin-panels/view/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ module.exports = Backbone.View.extend( {
else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
// This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
var editor = null;
if ( ! _.isUndefined( tinyMCE ) ) {
if ( typeof tinyMCE !== 'undefined' ) {
editor = tinyMCE.get( $$.attr( 'id' ) );
}

Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.

== Changelog ==

= 2.4.21 - 19 December 2016 =
* Removed course toolbar links.
* Added filter for post loop query.
* Replace TinyMCE _.isUndefined() check with a typeof to prevent JS errors.

= 2.4.20 - 7 December 2016 =
* Removed Premium and contribution links.
* Added course links.
Expand Down
19 changes: 17 additions & 2 deletions siteorigin-panels.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
require_once plugin_dir_path(__FILE__) . 'inc/styles.php';
require_once plugin_dir_path(__FILE__) . 'inc/default-styles.php';
require_once plugin_dir_path(__FILE__) . 'inc/widgets.php';
require_once plugin_dir_path(__FILE__) . 'inc/learn.php';
require_once plugin_dir_path(__FILE__) . 'inc/plugin-activation.php';
require_once plugin_dir_path(__FILE__) . 'inc/admin-actions.php';

Expand Down Expand Up @@ -1474,8 +1473,13 @@ function siteorigin_panels_render_form($widget, $instance = array(), $raw = fals
*/
function siteorigin_panels_plugin_action_links($links) {
unset( $links['edit'] );
$links[] = '<a href="http://siteorigin.com/threads/plugin-page-builder/">' . __('Support Forum', 'siteorigin-panels') . '</a>';
$links[] = '<a href="http://siteorigin.com/threads/plugin-page-builder/">' . __('Support', 'siteorigin-panels') . '</a>';
$links[] = '<a href="http://siteorigin.com/page-builder/#newsletter">' . __('Newsletter', 'siteorigin-panels') . '</a>';

if( siteorigin_panels_display_premium_teaser() ) {
$links[] = '<a href="' . esc_url( siteorigin_panels_premium_url() ) . '" style="color: #3db634" target="_blank">' . __('Addons', 'siteorigin-panels') . '</a>';
}

return $links;
}
add_action('plugin_action_links_' . plugin_basename(__FILE__), 'siteorigin_panels_plugin_action_links');
Expand Down Expand Up @@ -1611,6 +1615,17 @@ function siteorigin_panels_process_panels_data( $panels_data ){
}
add_filter( 'siteorigin_panels_data', 'siteorigin_panels_process_panels_data', 5 );

/**
* Should we display premium addon messages
*
* @return bool
*/
function siteorigin_panels_display_premium_teaser(){
return siteorigin_panels_setting( 'display-teaser' ) &&
apply_filters( 'siteorigin_premium_upgrade_teaser', true ) &&
! defined( 'SITEORIGIN_PREMIUM_VERSION' );
}

function siteorigin_panels_premium_url() {
$ref = apply_filters( 'siteorigin_premium_affiliate_id', '' );
$url = 'https://siteorigin.com/downloads/premium/?featured_plugin=siteorigin-panels';
Expand Down
36 changes: 18 additions & 18 deletions tpl/js-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@

<?php endif; ?>

<?php
$course = SiteOrigin_Panels_Courses::single()->get_course();
if( ! empty( $course ) ) {
?>
<a class="so-tool-button so-course-modal" title="<?php echo esc_attr( $course[ 'title' ] ) ?>" href="<?php echo esc_url( $course[ 'url' ] ) ?>" target="_blank">
<?php if( siteorigin_panels_display_premium_teaser() ) : ?>
<a class="so-tool-button so-siteorigin-premium" title="<?php echo esc_attr_e( 'SiteOrigin Premium Addons' ) ?>" href="<?php echo esc_url( siteorigin_panels_premium_url() ) ?>" target="_blank">
<span class="so-panels-icon so-panels-icon-plus"></span>
<span class="so-button-text"><?php echo esc_html( $course[ 'button' ] ) ?></span>
<span class="so-button-text"><?php echo esc_html_e( 'Get Addons', 'siteorigin-panels' ) ?></span>
</a>
<?php
}
?>
<?php endif ?>

<a class="so-switch-to-standard"><?php _e('Revert to Editor', 'siteorigin-panels') ?></a>

Expand Down Expand Up @@ -79,15 +74,20 @@
);
?>
</div>

<?php if( ! empty( $course ) ) : ?>
<div class="so-tip-wrapper">
<strong><?php _e( 'Learn Page Builder: ', 'siteorigin-panels' ) ?></strong>
<a class="so-course-modal" title="<?php echo esc_attr( $course[ 'title' ] ) ?>" href="<?php echo esc_url( $course[ 'url' ] ) ?>">
<?php echo esc_html( $course[ 'text' ] ) ?>
</a>
</div>
<?php endif; ?>
<div class="so-tip-wrapper">
<strong><?php _e( 'Pro Tip', 'siteorigin-panels' ) ?>: </strong>
<?php
$user = wp_get_current_user();
$user->user_email;
$signup_email = add_query_arg( array(
'email' => $user->user_email,
'name' => $user->first_name,
), 'https://siteorigin.com/wp-admin/admin-ajax.php?action=course_signup_form&course=300cd058f8' );
?>
<a href="<?php echo esc_url( $signup_email ) ?>">
<?php _e( '12 tips every Page Builder user should know.', 'siteorigin-panels' ) ?>
</a>
</div>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion widgets/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function widget( $args, $instance ) {
}

// Create the query
query_posts($query_args);
query_posts( apply_filters( 'siteorigin_panels_postloop_query_args', $query_args ) );
echo $args['before_widget'];

// Filter the title
Expand Down

0 comments on commit 1b22379

Please sign in to comment.