Skip to content

Commit

Permalink
Merge branch 'release/1.3.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Sep 30, 2019
2 parents 6961d8a + 31b2cd2 commit 5e4f530
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 112 deletions.
2 changes: 1 addition & 1 deletion admin/about/page-github.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3><?php esc_html_e( 'Actively Developed on Github', 'polestar' ); ?></h3>
<img src="<?php echo get_template_directory_uri() ?>/admin/about/github.png" class="about-image-right about-image-no-text-below" />
<p>
<?php printf( esc_html__( "Polestar is actively %sdeveloped on Github%s.", 'polestar' ), '<a href="https://github.com/purothemes/polestar">', '</a>' ); ?>
<?php printf( esc_html__( "Polestar is actively %sdeveloped on Github%s.", 'polestar' ), '<a href="https://github.com/purothemes/polestar" target="_blank">', '</a>' ); ?>
<?php esc_html_e( "You can follow commits, open issues and make contributions yourself.", 'polestar' ); ?>
</p>
2 changes: 1 addition & 1 deletion admin/about/page-page-builder.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3><?php esc_html_e( 'Enhanced by Page Builder', 'polestar' ); ?></h3>
<p>
<?php printf( esc_html__( "Polestar integrates, beautifully, with %sPage Builder by SiteOrigin%s.", 'polestar' ), '<a href="https://siteorigin.com/page-builder/">', '</a>' ); ?>
<?php printf( esc_html__( "Polestar integrates, beautifully, with %sPage Builder by SiteOrigin%s.", 'polestar' ), '<a href="https://siteorigin.com/page-builder/" target="_blank">', '</a>' ); ?>
<?php esc_html_e( 'This powerful plugin gives you full drag and drop capabilities right inside Polestar.', 'polestar' ); ?>
</p>
2 changes: 1 addition & 1 deletion admin/about/page-support.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h3><?php esc_html_e( 'Professional Support', 'polestar' ); ?></h3>
<p>
<?php printf( esc_html__( "Keep your project moving forward with quick support on our %sfree support forums%s. Beginner or advanced user, we're here to help.", 'polestar' ), '<a href="https://purothemes.com/support/forum/polestar-theme/">', '</a>' ); ?>
<?php printf( esc_html__( "Keep your project moving forward with quick support on our %sfree support forums%s. Beginner or advanced user, we're here to help.", 'polestar' ), '<a href="https://purothemes.com/support/forum/polestar-theme/" target="_blank">', '</a>' ); ?>
</p>
2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
);
}
?>
</h2><!--. comments-title -->
</h2><!-- .comments-title -->

<?php
$args = array(
Expand Down
2 changes: 1 addition & 1 deletion inc/extras
Submodule extras updated 1 files
+1 −1 about-page.php
2 changes: 1 addition & 1 deletion inc/extras-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function polestar_about_page( $about ) {
$about['review'] = true;

$about['no_video'] = true;

$about['video_url'] = 'https://purothemes.com/themes/polestar/';

$about['description'] = esc_html__( 'Lead the way with Polestar. It\'s fast loading, responsive, lightweight and flexible design is perfectly suited for building dynamic pages with SiteOrigin\'s Page Builder and selling with WooCommerce.', 'polestar' );
Expand Down
18 changes: 0 additions & 18 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,6 @@ function polestar_post_class_filter( $classes ) {
endif;
add_filter( 'post_class', 'polestar_post_class_filter' );

if ( ! function_exists( 'polestar_premium_setup' ) ) :
/**
* Polestar upsell notice.
*/
function polestar_upsell_notice() {
wp_enqueue_script( 'polestar-customizer-upsell', get_template_directory_uri() . '/js/polestar-upsell.js', array(), '1.0.0', true );
wp_localize_script(
'polestar-customizer-upsell',
'polestar10n',
array(
'polestarURL' => esc_html__( 'https://purothemes.com/themes/polestar/', 'polestar' ),
'polestarLabel' => esc_html__( 'Buy Premium Version', 'polestar' ),
)
);
}
add_action( 'customize_controls_enqueue_scripts', 'polestar_upsell_notice' );
endif;

/**
* Add our SiteOrigin Premium affiliate ID.
*/
Expand Down
Binary file added inc/layouts/one-pager.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions inc/layouts/one-pager.json

Large diffs are not rendered by default.

102 changes: 58 additions & 44 deletions js/jquery.theme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* File jquery.theme.js.
*
* Handles the primary JavaScript functions for the theme.
* Handles the primary JavaScript functions for the theme - (c) Puro, freely distributable under the terms of the GPL 2.0 license.
*/

/* globals jQuery, polestar */
Expand Down Expand Up @@ -32,9 +32,9 @@ jQuery( function( $ ) {
} );
} );

// Setup FitVids for entry content, Page Builder by SiteOrigin and WooCommerce. Ignore Tableau.
// Setup FitVids for entry content, video post formats, SiteOrigin panels and WooCommerce pages. Ignore Tableau.
if ( typeof $.fn.fitVids !== 'undefined' ) {
$( '.entry-content, .entry-content .panel, .woocommerce #main' ).fitVids( { ignore: '.tableauViz' } );
$( '.entry-content, .entry-content .panel, .entry-video, .woocommerce #main' ).fitVids( { ignore: '.tableauViz' } );
}

// FlexSlider.
Expand Down Expand Up @@ -126,7 +126,7 @@ jQuery( function( $ ) {
} );

// Main menu current menu item indication.
jQuery( document ).ready( function( $ ) {
$( document ).ready( function( $ ) {
if ( window.location.hash ) {
return;
} else {
Expand Down Expand Up @@ -172,19 +172,22 @@ jQuery( function( $ ) {
}

// Smooth scroll from internal page anchors.
var adminBarHeight = $( '#wpadminbar' ).outerHeight(),
isAdminBar = $( 'body' ).hasClass( 'admin-bar' ),
isStickyHeader = $( 'header' ).hasClass( 'sticky' ),
headerHeight;

// Header height. 2px to account for header shadow.
if ( isStickyHeader && isAdminBar && jQuery( window ).width() > 600 ) { // From 600px the admin bar isn't sticky so we shouldn't take its height into account.
headerHeight = adminBarHeight + $( 'header' ).outerHeight() - 2;
} else if ( isStickyHeader ) {
headerHeight = $( 'header' ).outerHeight() - 2;
} else {
headerHeight = 0;
}
headerHeight = function() {
var adminBarHeight = $( '#wpadminbar' ).outerHeight(),
isAdminBar = $( 'body' ).hasClass( 'admin-bar' ),
isStickyHeader = $( 'header' ).hasClass( 'sticky' ),
headerHeight;

// Header height. 1px to account for header shadow.
if ( isStickyHeader && isAdminBar && $( window ).width() > 600 ) { // From 600px the admin bar isn't sticky so we shouldn't take its height into account.
headerHeight = adminBarHeight + $( 'header' ).outerHeight() - 1;
} else if ( isStickyHeader ) {
headerHeight = $( 'header' ).outerHeight() - 1;
} else {
headerHeight = 0;
}
return headerHeight;
};

$.fn.polestarSmoothScroll = function() {

Expand All @@ -199,37 +202,48 @@ jQuery( function( $ ) {
var alink = this; // This button pressed.

// Check if there is a section that had same id as the button pressed.
if ( jQuery( '.panel-grid [id*=' + idName + ']' ).length > 0 ) {
jQuery( '#site-navigation .current' ).removeClass('current');
jQuery( alink).parent( 'li' ).addClass( 'current' );
if ( $( '.panel-grid [id*=' + idName + ']' ).length > 0 ) {
$( '#site-navigation .current' ).removeClass( 'current' );
$( alink ).parent( 'li' ).addClass( 'current' );
} else {
jQuery( '#site-navigation .current' ).removeClass( 'current' );
$( '#site-navigation .current' ).removeClass( 'current' );
}
if ( location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname ) {
var target = jQuery( this.hash );
target = target.length ? target : jQuery( '[name=' + this.hash.slice( 1 ) +']' );
var target = $( this.hash );
target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) +']' );
if ( target.length ) {
jQuery( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight
}, 1200 );
$( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight()
},
{
duration: 1200,
start: function() {
$( 'html, body' ).on( 'wheel touchmove', function() {
$( 'html, body' ).stop().off( 'wheel touchmove' );
} );
},
complete: function() {
$( 'html, body' ).finish().off( 'wheel touchmove' );
},
} );
return false;
}
}
} );
};

jQuery( window ).load( function() {
$( window ).load( function() {
$( '#site-navigation a[href*="#"]:not([href="#"]), .comments-link a[href*="#"]:not([href="#"]), .puro-scroll[href*="#"]:not([href="#"])' ).polestarSmoothScroll();
} );

// Adjust for sticky header when linking from external anchors.
jQuery( window ).load( function() {
$( window ).load( function() {

if ( location.pathname.replace( /^\//,'' ) == window.location.pathname.replace( /^\//,'' ) && location.hostname == window.location.hostname ) {
var target = jQuery( window.location.hash );
var target = $( window.location.hash );
if ( target.length ) {
jQuery( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight
$( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight()
}, 0 );
return false;
}
Expand All @@ -240,44 +254,44 @@ jQuery( function( $ ) {
function polestarSelected() {

// Cursor position.
var scrollTop = jQuery( window ).scrollTop();
var scrollTop = $( window ).scrollTop();

// Used for checking if the cursor is in one section or not.
var isInOneSection = 'no';

// For all sections check if the cursor is inside a section.
jQuery( '.panel-row-style' ).each( function() {
$( '.panel-row-style' ).each( function() {

// Section ID.
var thisID = '#' + jQuery( this ).attr( 'id' );
var thisID = '#' + $( this ).attr( 'id' );

// Distance between top and our section. Minus 2px to compensate for an extra pixel produced when a Page Builder row bottom margin is set to 0.
var offset = jQuery( this ).offset().top - 2;
// Distance between top and our section. Minus 1px to compensate for an extra pixel produced when a Page Builder row bottom margin is set to 0.
var offset = $( this ).offset().top - 1;

// Section height.
var thisHeight = jQuery( this ).outerHeight();
var thisHeight = $( this ).outerHeight();

// Where the section begins.
var thisBegin = offset - headerHeight;
var thisBegin = offset - headerHeight();

// Where the section ends.
var thisEnd = offset + thisHeight - headerHeight;
var thisEnd = offset + thisHeight - headerHeight();

// If position of the cursor is inside of the this section.
if ( scrollTop >= thisBegin && scrollTop <= thisEnd ) {
isInOneSection = 'yes';
jQuery( '#site-navigation .current' ).removeClass( 'current' );
$( '#site-navigation .current' ).removeClass( 'current' );
// Find the menu button with the same ID section.
jQuery( '#site-navigation a[href$="' + thisID + '"]' ).parent( 'li' ).addClass( 'current' ); // Find the menu button with the same ID section.
$( '#site-navigation a[href$="' + thisID + '"]' ).parent( 'li' ).addClass( 'current' ); // Find the menu button with the same ID section.
return false;
}
if ( isInOneSection === 'no' ) {
jQuery( '#site-navigation .current' ).removeClass( 'current' );
$( '#site-navigation .current' ).removeClass( 'current' );
}
} );
}

jQuery( window ).on( 'scroll', polestarSelected );
$( window ).on( 'scroll', polestarSelected );

// Mobile menu.
var $mobileMenu = false;
Expand All @@ -299,7 +313,7 @@ jQuery( function( $ ) {
if ( $( '.main-navigation .shopping-cart' ).length ) {
$mobileMenu.append( $( '.main-navigation .shopping-cart .shopping-cart-link' ).clone() );
}

$mobileMenu.find( '#primary-menu' ).show().css( 'opacity', 1 );
$mobileMenu.find( '.menu-item-has-children > a' ).addClass( 'has-dropdown' );
$mobileMenu.find( '.page_item_has_children > a' ).addClass( 'has-dropdown' );
Expand Down
39 changes: 0 additions & 39 deletions js/polestar-upsell.js

This file was deleted.

4 changes: 2 additions & 2 deletions loops/loop-blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
endwhile;

the_posts_pagination( array(
'prev_text' => '<span class="icon-long-arrow-left"></span>',
'next_text' => '<span class="icon-long-arrow-right"></span>'
'prev_text' => '<span class="icon-long-arrow-left"></span>',
'next_text' => '<span class="icon-long-arrow-right"></span>'
) );

else :
Expand Down
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ Released under [GPL version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0

== Changelog ==

= 1.3.10 - 30 September 2019 =
* Ensured FitVids targets `entry-video` for video post format.
* Changed sticky header height calculation to allow for re-calculation.
* Fixed smooth scroll sticky anchor when mobile menu in use.
* Minor about page and code formatting fixes.

= 1.3.9 - 02 September 2019 =
* Added new core `wp_body_open` hook.
* Minor WC product data tab styling adjustments.
Expand Down
4 changes: 2 additions & 2 deletions sass/site/primary/_comments.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

.avatar-container {
float: left;

@media (max-width: 480px) {
display: none;
}
Expand Down Expand Up @@ -229,7 +229,7 @@
clear: both;
margin: 0 0 8px;
overflow: auto;

&:last-of-type {
margin-bottom: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion template-parts/content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<?php endif; ?>

<?php if ( puro_page_setting( 'page_title' ) ) : ?>
<header class="entry-header">
Expand Down

0 comments on commit 5e4f530

Please sign in to comment.