Skip to content

Commit

Permalink
Merge branch 'release/1.2.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
puro-support committed Jun 29, 2018
2 parents ea6755d + f1e13b0 commit 8de5ca6
Show file tree
Hide file tree
Showing 26 changed files with 672 additions and 288 deletions.
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
== Changelog ==

= 1.2.9 - 28 June 2018 =
* Added a new WooCommerce mini-cart icon.
* Minor mobile menu style fixes.
* Minor WooCommerce style fixes.
* Added galleries to the WooCommerce Quick View modal.
* Improved search results design.

= 1.2.8 - 30 May 2018 =
* Resolved post slider function error when Jetpack not activated.

Expand Down
3 changes: 2 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function polestar_setup() {

// Custom image sizes.
add_image_size( 'polestar-247x164-crop', 247, 163, true );
add_image_size( 'polestar-354x234-crop', 354, 234, true );
add_image_size( 'polestar-354x234-crop', 354, 234, true );
add_image_size( 'polestar-720x480-crop', 720, 480, true );

/*
* Enable support for the custom logo.
Expand Down
2 changes: 1 addition & 1 deletion inc/layouts/home.json

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ function polestar_display_icon( $type ) {
<?php break;

case 'cart' : ?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path d="M31.914 5.4l-2.914 11.6c0 0.139-0.028 0.27-0.078 0.389-0.102 0.24-0.293 0.432-0.532 0.533-0.12 0.051-0.252 0.078-0.39 0.078h-19l0.8 4h17.2c0.553 0 1 0.447 1 1s-0.447 1-1 1h-18c-0.553 0-1-0.447-1-1l-3.8-19h-3.2c-0.552 0-1-0.448-1-1s0.448-1 1-1h4c0.553 0 1 0.448 1 1l0.2 1h24.8c0.553 0 1 0.448 1 1 0 0.143-0.032 0.277-0.086 0.4zM8.6 16h3.4v-10h-5.4l2 10zM18 6h-5v10h5v-10zM24 6h-5v10h5v-10zM25 6v10h2.253l2.533-10h-4.786zM11 26c1.657 0 3 1.344 3 3s-1.343 3-3 3-3-1.344-3-3 1.343-3 3-3zM11 30c0.553 0 1-0.447 1-1s-0.447-1-1-1-1 0.447-1 1 0.447 1 1 1zM25 26c1.657 0 3 1.344 3 3s-1.343 3-3 3-3-1.344-3-3 1.343-3 3-3zM25 30c0.553 0 1-0.447 1-1s-0.447-1-1-1-1 0.447-1 1 0.447 1 1 1z"></path>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M11 21c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M22 21c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
<path d="M23.8 5.4c-0.2-0.3-0.5-0.4-0.8-0.4h-16.2l-0.8-4.2c-0.1-0.5-0.5-0.8-1-0.8h-4c-0.6 0-1 0.4-1 1s0.4 1 1 1h3.2l0.8 4.2c0 0 0 0.1 0 0.1l1.7 8.3c0.3 1.4 1.5 2.4 2.9 2.4 0 0 0 0 0.1 0h9.7c1.5 0 2.7-1 3-2.4l1.6-8.4c0-0.3 0-0.6-0.2-0.8zM20.4 14.2c-0.1 0.5-0.5 0.8-1 0.8h-9.7c-0.5 0-0.9-0.3-1-0.8l-1.5-7.2h14.6l-1.4 7.2z"></path>
</svg>
<?php break;

Expand Down Expand Up @@ -286,12 +288,11 @@ function polestar_get_gallery() {

if ( ! function_exists( 'polestar_get_image' ) ) :
/**
* Gets the first image on the page.
* Gets the first image from the page.
*/
function polestar_get_image() {
$first_image = '';
function polestar_get_image() {

$output = preg_match_all( '/<img[^>]+\>/i', get_the_content(), $images );
preg_match_all( '/<img[^>]+\>/i', get_the_content(), $images );

if ( empty( $images[0] ) ) return false;

Expand Down Expand Up @@ -425,18 +426,14 @@ function polestar_excerpt() {
$excerpt = explode( ' ', get_the_excerpt(), $length );

if ( $length ) {

if ( count( $excerpt ) >= $length ) {
array_pop( $excerpt );
$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>' . $read_more_text;
} else {
$excerpt = '<p>' . implode( " ", $excerpt ) . $ellipsis . '</p>';
}

} else {

$excerpt = get_the_excerpt();

}

$excerpt = preg_replace( '`\[[^\]]*\]`','', $excerpt );
Expand Down Expand Up @@ -487,6 +484,15 @@ function polestar_entry_thumbnail_meta() {
}
endif;

if ( ! function_exists( 'polestar_is_post_loop_widget' ) ) :
/**
* Checks if we're currently rendering a post loop widget
*/
function polestar_is_post_loop_widget() {
return method_exists( 'SiteOrigin_Panels_Widgets_PostLoop', 'is_rendering_loop' ) && SiteOrigin_Panels_Widgets_PostLoop::is_rendering_loop();
}
endif;

if ( ! function_exists( 'polestar_related_posts' ) ) :
/**
* Display related posts on single posts.
Expand Down
79 changes: 42 additions & 37 deletions js/jquery.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*
* Handles the primary JavaScript functions for the theme.
*/

/* globals jQuery, polestar_resp_menu_params */

jQuery( function( $ ) {

// Element viewport visibility.
Expand Down Expand Up @@ -35,14 +38,14 @@ jQuery( function( $ ) {
}

// FlexSlider.
$( window ).on( 'load', function() {
$( document ).ready( function() {
$( '.flexslider' ).each( function() {
$( this ).flexslider( {
animation: 'slide',
controlNav: false,
customDirectionNav: $( this ).find( '.flex-direction-nav a' ),
start: function() {
$( '.flexslider .slides img' ).show();
$( '.flexslider .slides img' ).show();
}
} );
} );
Expand Down Expand Up @@ -78,7 +81,9 @@ jQuery( function( $ ) {

var smSetup = function() {

if ( $( 'body' ).hasClass( 'mobile-header-ns' ) && ( $( window ).width() < polestar_resp_menu_params.collapse ) ) return;
if ( $( 'body' ).hasClass( 'mobile-header-ns' ) && ( $( window ).width() < polestar_resp_menu_params.collapse ) ) {
return;
}

if ( $mhs === false ) {
$mhs = $( '<div class="masthead-sentinel"></div>' ).insertAfter( $mh );
Expand Down Expand Up @@ -191,7 +196,7 @@ jQuery( function( $ ) {

// Close the header search with the escape key.
$( document ).keyup( function( e ) {
if ( e.keyCode == 27 ) { // Escape key maps to keycode 27.
if ( e.keyCode === 27 ) { // Escape key maps to keycode 27.
$( '#close-search.animate-in' ).trigger( 'click' );
}
} );
Expand Down Expand Up @@ -241,20 +246,20 @@ jQuery( function( $ ) {
}
} );
} );

// Smooth scroll from internal page anchors.
var adminBarHeight = $( '#wpadminbar' ).outerHeight(),
isAdminBar = $( 'body' ).hasClass( 'admin-bar' ),
isStickyHeader = $( 'header' ).hasClass( 'sticky' );
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.
var headerHeight = adminBarHeight + $( 'header' ).outerHeight() - 2;
headerHeight = adminBarHeight + $( 'header' ).outerHeight() - 2;
} else if ( isStickyHeader ) {
var headerHeight = $( 'header' ).outerHeight() - 2;
headerHeight = $( 'header' ).outerHeight() - 2;
} else {
var headerHeight = 0;
}
headerHeight = 0;
}

$.fn.polestarSmoothScroll = function() {
$( this ).click( function( e ) {
Expand All @@ -277,7 +282,7 @@ jQuery( function( $ ) {
jQuery( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight
}, 1200 );
return false;
return false;
}
}
} );
Expand All @@ -287,46 +292,46 @@ jQuery( 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() {
// Adjust for sticky header when linking from external anchors.
jQuery( window ).load( function() {

if ( location.pathname.replace( /^\//,'' ) == window.location.pathname.replace( /^\//,'' ) && location.hostname == window.location.hostname ) {
var target = jQuery( window.location.hash );
if ( target.length ) {
jQuery( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight
}, 0 );
return false;
}
}
} );
if ( location.pathname.replace( /^\//,'' ) == window.location.pathname.replace( /^\//,'' ) && location.hostname == window.location.hostname ) {
var target = jQuery( window.location.hash );
if ( target.length ) {
jQuery( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight
}, 0 );
return false;
}
}
} );

// Indicate which section of the page we're viewing with selected menu classes.
function polestarSelected() {
function polestarSelected() {

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

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

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

// Section ID.
var thisID = '#' + jQuery( this ).attr( 'id' );
var thisID = '#' + jQuery( 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 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;

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

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

// Where the section begins.
var thisBegin = offset - headerHeight;
// Where the section ends.
var thisEnd = offset + thisHeight - headerHeight;

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

// If position of the cursor is inside of the this section.
if ( scrollTop >= thisBegin && scrollTop <= thisEnd ) {
Expand Down Expand Up @@ -376,9 +381,9 @@ jQuery( function( $ ) {
$mobileMenu.find( '.has-dropdown' ).click( function( e ) {
if ( typeof $( this ).attr( 'href' ) === "undefined" ) {
e.preventDefault();
$( this ). siblings( '.dropdown-toggle' ).trigger( 'click' );
$( this ).siblings( '.dropdown-toggle' ).trigger( 'click' );
}
} );
} );

var mmOverflow = function() {
if ( $( '#masthead' ).hasClass( 'sticky' ) ) {
Expand Down
6 changes: 1 addition & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,12 @@ Screenshot image "Half Dome Village, Yosemite Valley, United States" sourced fro

The `polestar-icons` font family was created using IcoMoon and contains icons from Font Awesome.

`/inc/template-tags.php` contains SVG icons created using IcoMoon and includes icons from Font Awesome and Material Design Icons by Google.
`/inc/template-tags.php` contains SVG icons created using IcoMoon and includes icons from Font Awesome.

Font Awesome by Dave Gandy
Font released under the SIL OFL 1.1, CSS released under the MIT License
[Source](http://fontawesome.io)

Material Design Icons by Google
Released under the Apache License Version 2.0. license
[Source](https://github.com/google/material-design-icons)

== Bundled Resources ==

Customizer Library, Copyright Devin Price
Expand Down
19 changes: 14 additions & 5 deletions sass/elements/_tables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
table {
border: 1px solid $color__background-hr-dark;
margin: 0 0 26px;
text-align: left;
width: 100%;

a {
Expand All @@ -9,17 +10,25 @@ table {

thead th {
padding: 16px;
text-transform: uppercase;
}

@media (max-width: 768px) {
padding: 2%;
}
}

th {
border: 1px solid $color__background-hr-dark;
color: $color__text-dark;
font-weight: 600;
font-weight: 600;
padding: 8px 16px;
text-transform: uppercase;

@media (max-width: 768px) {
padding: 2%;
}
}

th,
td {
border: 1px solid $color__background-hr-dark;
padding: 8px 16px;

@media (max-width: 768px) {
Expand Down
17 changes: 2 additions & 15 deletions sass/navigation/_menus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

&:not([href]) {
cursor: pointer;
}
}
}

&:first-of-type > a {
Expand Down Expand Up @@ -527,28 +527,15 @@

.search-form {
margin-bottom: 15px;
position: relative;
width: 100%;

&[style] {
margin-top: 0 !important;
}

input[type="search"] {
font-size: 14px;
padding-right: 40px;
width: 100%;
}

button[type="submit"] {
position: absolute;
right: 14px;
top: 12px;

svg {
height: 16px;
width: 16px;
}
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions sass/site/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
}
}

.custom-logo-link {
display: block;
line-height: 0;
}

img {
display: inline-block;
vertical-align: middle;
Expand Down
Loading

0 comments on commit 8de5ca6

Please sign in to comment.