Skip to content

Commit

Permalink
Merge d1e0355 into 2c49938
Browse files Browse the repository at this point in the history
  • Loading branch information
valendesigns authored Jun 27, 2016
2 parents 2c49938 + d1e0355 commit bc38f42
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ language: php

php:
- 5.2
- 5.5
- 7.0

env:
- WP_VERSION=latest WP_MULTISITE=0
Expand Down
12 changes: 11 additions & 1 deletion inc/customizer/js/customizer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion inc/functions/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function archetype_body_classes( $classes ) {
}

// Adds a class of no-wc-breadcrumb when WooCommerce isn't activated or has been filtered off.
if ( ! function_exists( 'woocommerce_breadcrumb' ) || false === archetype_sanitize_checkbox( get_theme_mod( 'archetype_breadcrumb_toggle', true ) ) ) {
if ( ! function_exists( 'woocommerce_breadcrumb' ) || false === archetype_sanitize_checkbox( get_theme_mod( 'archetype_breadcrumb_toggle', false ) ) ) {
$classes[] = 'no-wc-breadcrumb';
}

Expand Down
2 changes: 1 addition & 1 deletion inc/woocommerce/controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function archetype_woocommerce_customize_register( $wp_customize ) {
* Toggle breadcrumbs
*/
$wp_customize->add_setting( 'archetype_breadcrumb_toggle', array(
'default' => true,
'default' => false,
'sanitize_callback' => 'archetype_sanitize_checkbox',
) );

Expand Down
2 changes: 1 addition & 1 deletion inc/woocommerce/css/woocommerce-rtl.css

Large diffs are not rendered by default.

11 changes: 1 addition & 10 deletions inc/woocommerce/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function archetype_is_woocommerce() {
* @since 1.0.0
*/
function archetype_breadcrumb() {
if ( true === archetype_sanitize_checkbox( get_theme_mod( 'archetype_breadcrumb_toggle', true ) ) ) {
if ( true === archetype_sanitize_checkbox( get_theme_mod( 'archetype_breadcrumb_toggle', false ) ) ) {
ob_start();
woocommerce_breadcrumb();
$contents = ob_get_clean();
Expand Down Expand Up @@ -378,15 +378,6 @@ function archetype_woocommerce_post_class( $classes ) {
return $classes;
}

/**
* Replaces the placeholder image.
*
* @since 1.0.0
*/
function archetype_fix_thumbnail() {
add_filter( 'woocommerce_placeholder_img_src', 'archetype_woocommerce_placeholder_img_src', 0 );
}

if ( ! function_exists( 'archetype_woocommerce_placeholder_img_src' ) ) :
/**
* Returns the category placeholder image path.
Expand Down
6 changes: 3 additions & 3 deletions inc/woocommerce/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
add_action( 'woocommerce_after_main_content', 'archetype_after_content', 10 );
add_action( 'archetype_content_top', 'archetype_shop_messages', 1 );
add_action( 'woocommerce_before_shop_loop_item_title', 'archetype_before_product_thumbnail', 9 );
add_action( 'woocommerce_before_shop_loop_item_title', 'archetype_after_product_thumbnail', 11 );
add_action( 'woocommerce_before_shop_loop_item_title', 'archetype_after_product_thumbnail', 11 );


/**
Expand Down Expand Up @@ -120,7 +120,7 @@
*
* @see archetype_woocommerce_body_class()
* @see archetype_woocommerce_post_class()
* @see archetype_fix_thumbnail()
* @see archetype_woocommerce_placeholder_img_src()
* @see archetype_product_search_form()
* @see archetype_thumbnail_columns()
* @see archetype_related_products_args()
Expand All @@ -131,7 +131,7 @@
*/
add_filter( 'body_class', 'archetype_woocommerce_body_class' );
add_filter( 'post_class', 'archetype_woocommerce_post_class' );
add_action( 'init', 'archetype_fix_thumbnail' );
add_filter( 'woocommerce_placeholder_img_src', 'archetype_woocommerce_placeholder_img_src' );
add_filter( 'get_search_form', 'archetype_product_search_form' );
add_filter( 'woocommerce_product_thumbnails_columns', 'archetype_thumbnail_columns' );
add_filter( 'woocommerce_output_related_products_args', 'archetype_related_products_args' );
Expand Down
28 changes: 25 additions & 3 deletions js/archetype.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,34 @@ b.$header=a(".header-pin"),b.$headerInner=a("#masthead > .col-full"),0!==b.$head
// Event listeners.
b.cache.$window.on("scroll",a.proxy(b.pinHeader,this)).on("resize",a.proxy(b.pinHeader,this)))},pinHeader:function(){var b,c,d,e=this;
// There is no header.
0!==e.$header.length&&(b=e.$headerInner.offset().top,c=e.cache.$window.scrollTop(),d=e.cache.$window.width(),a("body").hasClass("admin-bar")&&(b-=600>=d?0:46),c>0&&c>=b&&768>d&&d>=600?0===a("#masthead-clone").length&&(e.$headerClone.insertAfter("#masthead").addClass("pinned"),e.$header.addClass("was-pinned"),a("#masthead-clone #navigation").not(".moved-to-end")&&a("#masthead-clone #navigation").insertAfter(a("#masthead-clone > div.col-full")).addClass("moved-to-end"),e.$headerCloneMenu.attr("aria-expanded","false"),e.$headerClone.find("button.menu-toggle").appendTo("#masthead-clone .secondary-navigation").css("display","block"),e.$headerClone.find("a.cart-contents").css("display","block"),e.$headerClone.find("button.menu-toggle").on("click",function(){e.$headerCloneContainer.is(".toggled")?(e.$headerCloneContainer.removeClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","false"),a(this).attr("aria-expanded","false")):(e.$headerCloneContainer.addClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","true"),a(this).attr("aria-expanded","true"))}),a("#masthead #site-navigation").is(".toggled")?(a("#masthead #site-navigation").removeClass("toggled"),a("#masthead .handheld-navigation ul").attr("aria-expanded","false"),a("#masthead button.menu-toggle").attr("aria-expanded","false"),e.$headerCloneContainer.addClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","true"),e.$headerClone.find("button.menu-toggle").attr("aria-expanded","true")):(e.$headerCloneContainer.removeClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","false"),e.$headerClone.find("button.menu-toggle").attr("aria-expanded","false"))):(e.$headerClone.remove(),e.$header.removeClass("was-pinned header-pin"),e.$header.find("a.cart-contents").css("display","block")))},pinMenuInit:function(){var b=this;
0!==e.$header.length&&(
// Get the values.
b=e.$headerInner.offset().top,c=e.cache.$window.scrollTop(),d=e.cache.$window.width(),
// The admin bar needs to be accounted for.
a("body").hasClass("admin-bar")&&(b-=600>=d?0:46),
// Pin the menu.
0<c&&b<=c&&768>d&&600<=d?0===a("#masthead-clone").length&&(e.$headerClone.insertAfter("#masthead").addClass("pinned"),e.$header.addClass("was-pinned"),
// Mobile menu vars.
a("#masthead-clone #navigation").not(".moved-to-end")&&a("#masthead-clone #navigation").insertAfter(a("#masthead-clone > div.col-full")).addClass("moved-to-end"),e.$headerCloneMenu.attr("aria-expanded","false"),e.$headerClone.find("button.menu-toggle").appendTo("#masthead-clone .secondary-navigation").css("display","block"),e.$headerClone.find("a.cart-contents").css("display","block"),
// Listen for button click.
e.$headerClone.find("button.menu-toggle").on("click",function(){e.$headerCloneContainer.is(".toggled")?(e.$headerCloneContainer.removeClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","false"),a(this).attr("aria-expanded","false")):(e.$headerCloneContainer.addClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","true"),a(this).attr("aria-expanded","true"))}),
// Need to do some visual trickery
a("#masthead #site-navigation").is(".toggled")?(a("#masthead #site-navigation").removeClass("toggled"),a("#masthead .handheld-navigation ul").attr("aria-expanded","false"),a("#masthead button.menu-toggle").attr("aria-expanded","false"),e.$headerCloneContainer.addClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","true"),e.$headerClone.find("button.menu-toggle").attr("aria-expanded","true")):(e.$headerCloneContainer.removeClass("toggled"),e.$headerCloneMenu.attr("aria-expanded","false"),e.$headerClone.find("button.menu-toggle").attr("aria-expanded","false"))):(e.$headerClone.remove(),e.$header.removeClass("was-pinned header-pin"),e.$header.find("a.cart-contents").css("display","block")))},pinMenuInit:function(){var b=this;
// Global menu vars.
b.$menu=a(".navigation-pin"),b.$menuClone=b.$menu.clone(),
// Event listeners.
b.cache.$window.on("scroll",a.proxy(b.pinMenu,this)).on("resize",a.proxy(b.pinMenu,this))},pinMenu:function(){var b,c,d,e;
// There is no menu.
0!==this.$menu.length&&(b=this.$menu.offset().top,c=this.cache.$window.scrollTop(),d=this.cache.$window.width(),a("body").hasClass("admin-bar")&&(e=32,600>=d&&(e=0),782>=d&&(e=46),b-=e),c>0&&c>=b&&d>767?0===a("#masthead + .navigation-pin").length&&(this.$menuClone.insertAfter("#masthead").addClass("pinned"),this.$menu.addClass("was-pinned")):(this.$menuClone.remove(),this.$menu.removeClass("was-pinned")))},heroInit:function(){var b=this,c=!1;
0!==this.$menu.length&&(
// Get the values.
b=this.$menu.offset().top,c=this.cache.$window.scrollTop(),d=this.cache.$window.width(),
// The admin bar needs to be accounted for.
a("body").hasClass("admin-bar")&&(e=32,600>=d&&(e=0),782>=d&&(e=46),b-=e),
// Pin the menu.
0<c&&b<=c&&767<d?0===a("#masthead + .navigation-pin").length&&(this.$menuClone.insertAfter("#masthead").addClass("pinned"),this.$menu.addClass("was-pinned")):(this.$menuClone.remove(),this.$menu.removeClass("was-pinned")))},heroInit:function(){var b=this,c=!1;
// Global hero vars.
b.$hero=a(".archetype-hero"),b.$heroCol=b.$hero.find(".col-full"),b.$heroContent=b.$hero.find(".archetype-hero-content"),b.$heroMedia=b.$hero.find(".archetype-hero-media"),c=b.$hero.hasClass("archetype-hero-transition-reverse"),b.$hero.hasClass("archetype-hero-add-transition")?(b.slideShake(b.$heroContent,{shakes:1,distance:c?3:4,duration:c?300:400,slidePosition:c?3e3:-3e3,slideDuration:150}),b.slideShake(b.$heroMedia,{distance:2,slidePosition:c?-3e3:3e3})):(b.makeVisible(b.$heroContent),b.makeVisible(b.$heroMedia)),b.$hero.hasClass("archetype-hero-has-grid")&&b.$hero.hasClass("archetype-hero-position-media")&&b.cache.$window.on("resize",a.proxy(b.pinHeroMedia,this))},pinHeroMedia:function(){var b=this.$heroCol.outerHeight(!0),c=this.$heroMedia.height(),d=this.$heroContent.height(),e=Math.abs(parseFloat(this.$heroMedia.css("margin-bottom")))/2,f=c+e,g=a(window).width();g>767&&(b>f||d>c)?this.$heroMedia.css({top:b-f}):this.$heroMedia.css({top:"auto"})},makeVisible:function(b){return b.each(function(){a(this).css({opacity:0,visibility:"visible"}).animate({opacity:1},0)})},slideShake:function(b,c){var d,e={shakes:2,distance:5,duration:500,slidePosition:3e3,slideDelay:150,slideDuration:250};return c&&a.extend(e,c),b.each(function(){var b,c,f=a(this);for(d=f.css("position"),d&&"static"!==d||f.css("position","relative"),f.css({opacity:0,visibility:"visible",left:e.slidePosition}).animate({opacity:1},0).delay(e.slideDelay).animate({left:0},e.slideDuration),b=1;b<=e.shakes;b++)c=e.shakes/2<=b?2:1,f.animate({left:e.distance*-c},e.duration/e.shakes/4).animate({left:e.distance*c},e.duration/e.shakes/2).animate({left:0},e.duration/e.shakes/4)})}};b.init()}(jQuery);
b.$hero=a(".archetype-hero"),b.$heroCol=b.$hero.find(".col-full"),b.$heroContent=b.$hero.find(".archetype-hero-content"),b.$heroMedia=b.$hero.find(".archetype-hero-media"),
// Transition is reversed.
c=b.$hero.hasClass("archetype-hero-transition-reverse"),b.$hero.hasClass("archetype-hero-add-transition")?(b.slideShake(b.$heroContent,{shakes:1,distance:c?3:4,duration:c?300:400,slidePosition:c?3e3:-3e3,slideDuration:150}),b.slideShake(b.$heroMedia,{distance:2,slidePosition:c?-3e3:3e3})):(b.makeVisible(b.$heroContent),b.makeVisible(b.$heroMedia)),
// Event listeners.
b.$hero.hasClass("archetype-hero-has-grid")&&b.$hero.hasClass("archetype-hero-position-media")&&b.cache.$window.on("resize",a.proxy(b.pinHeroMedia,this))},pinHeroMedia:function(){var b=this.$heroCol.outerHeight(!0),c=this.$heroMedia.height(),d=this.$heroContent.height(),e=Math.abs(parseFloat(this.$heroMedia.css("margin-bottom")))/2,f=c+e,g=a(window).width();767<g&&(f<b||c<d)?this.$heroMedia.css({top:b-f}):this.$heroMedia.css({top:"auto"})},makeVisible:function(b){return b.each(function(){a(this).css({opacity:0,visibility:"visible"}).animate({opacity:1},0)})},slideShake:function(b,c){var d,e={shakes:2,distance:5,duration:500,slidePosition:3e3,slideDelay:150,slideDuration:250};return c&&a.extend(e,c),b.each(function(){var b,c,f=a(this);for(d=f.css("position"),d&&"static"!==d||f.css("position","relative"),f.css({opacity:0,visibility:"visible",left:e.slidePosition}).animate({opacity:1},0).delay(e.slideDelay).animate({left:0},e.slideDuration),b=1;b<=e.shakes;b++)c=e.shakes/2<=b?2:1,f.animate({left:e.distance*-c},e.duration/e.shakes/4).animate({left:e.distance*c},e.duration/e.shakes/2).animate({left:0},e.duration/e.shakes/4)})}};b.init()}(jQuery);
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
"license": "GPL-2.0 OR GPL-3.0",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-checktextdomain": "~1.0.0",
"grunt-contrib-clean": "~1.0.0",
"grunt-contrib-compress": "~1.3.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-cssmin": "~1.0.0",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~1.0.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-rtlcss": "~2.0.1",
"grunt-contrib-cssmin": "~1.0.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-sass": "~1.2.0",
"grunt-wp-i18n": "~0.5.4",
"grunt-checktextdomain": "~1.0.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-compress": "~1.1.0",
"grunt-contrib-clean": "~1.0.0",
"grunt-sass": "~1.1.0",
"node-sass": "~3.4.2",
"susy": "^2.2.12",
"node-bourbon": "~4.2.3"
"node-bourbon": "~4.2.3",
"node-sass": "~3.8.0",
"susy": "^2.2.12"
},
"engines": {
"node": ">=0.8.0",
Expand Down
4 changes: 4 additions & 0 deletions sass/module/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ label {
.search-form & {
margin-bottom: 0;
}

.content-area .search-form & {
display: inline-block;
}
}

input + label,
Expand Down
2 changes: 1 addition & 1 deletion style-rtl.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,8 @@ label {
margin-bottom: .875em; }
.search-form label {
margin-bottom: 0; }
.content-area .search-form label {
display: inline-block; }

input + label,
.post-password-form label,
Expand Down
2 changes: 1 addition & 1 deletion style.min.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* @package Archetype
*/

$_tests_dir = getenv( 'WP_TESTS_DIR' );

// Custom local VVV site.
if ( strpos( __FILE__, 'www/archetype' ) !== false ) {
$_tests_dir = str_replace( 'wordpress-develop', 'archetype', $_tests_dir );
if ( strpos( __FILE__, '/srv/www/archetype.com/docroot' ) !== false ) {
define( 'WP_CONTENT_DIR', dirname( __DIR__ ) . '/../../' );
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . 'plugins/' );
}

$_tests_dir = getenv( 'WP_TESTS_DIR' );

// Travis CI & Vagrant SSH tests directory.
if ( empty( $_tests_dir ) ) {
$_tests_dir = '/tmp/wordpress-tests';
Expand Down
6 changes: 3 additions & 3 deletions tests/inc/functions/test-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ function test_archetype_body_classes_is_multi_author() {
*/
function test_archetype_body_classes_wc_breadcrumb() {

$this->assertFalse( in_array( 'no-wc-breadcrumb', get_body_class() ) );

set_theme_mod( 'archetype_breadcrumb_toggle', false );
$this->assertTrue( in_array( 'no-wc-breadcrumb', get_body_class() ) );

set_theme_mod( 'archetype_breadcrumb_toggle', true );
$this->assertFalse( in_array( 'no-wc-breadcrumb', get_body_class() ) );

}

/**
Expand Down
9 changes: 0 additions & 9 deletions tests/inc/woocommerce/test-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ function test_archetype_woocommerce_post_class() {

}

/**
* Replaces the placeholder image.
*/
function test_archetype_fix_thumbnail() {

$this->markTestIncomplete( 'This test has not been implemented.' );

}

/**
* Returns the category placeholder image path.
*/
Expand Down

0 comments on commit bc38f42

Please sign in to comment.