Skip to content

Commit

Permalink
Merge pull request #236 from MachoThemes/master
Browse files Browse the repository at this point in the history
Update 1.2.1
  • Loading branch information
cristianraiber authored Jan 24, 2018
2 parents 0da3849 + 286ecde commit ef4c7bb
Show file tree
Hide file tree
Showing 26 changed files with 502 additions and 307 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"Vimeo" : false,
"shapelyWelcomeScreenObject" : false,
"console": false,
"shapelyWelcomeScreenCustomizerObject" : false
"shapelyWelcomeScreenCustomizerObject" : false,
"ShapelyBuilder" : false
}
}
63 changes: 30 additions & 33 deletions archive-jetpack-portfolio.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?php
get_header();

$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
$layout_class = shapely_get_layout_class();

$item_classes = 'post-snippet col-md-3 col-sm-6 project';
if ( 'mansonry' == $layout ) {
$item_classes .= ' masonry-item';
}

if ( 'sidebar-left' == $layout_class ) :
get_sidebar();
endif;
?>
<?php
if ( 'sidebar-left' == $layout_class ) :
get_sidebar();
endif;
?>
<div id="primary" class="content-area col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>">
<main id="main" class="site-main" role="main">

Expand All @@ -29,7 +27,7 @@
</div>
</div>
<?php endif ?>

<div class="<?php echo 'mansonry' == $layout ? 'masonry masonryFlyIn' : ''; ?>">
<?php
/* Start the Loop */
Expand All @@ -41,35 +39,35 @@
$project_types = wp_get_post_terms( $post->ID, 'jetpack-portfolio-type', $projects_args );

$thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
$item_style = '';
$item_style = '';
if ( 'mansonry' != $layout ) {
$item_style = 'background-image: url(' . $thumbnail_url . ')';
}
?>
?>

<article id="post-<?php the_ID(); ?>" <?php post_class( $item_classes ); ?>>
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
<?php
if ( has_post_thumbnail() ) {
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php
if ( 'mansonry' == $layout ) {
the_post_thumbnail( 'medium' );
}
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
<?php
if ( has_post_thumbnail() ) {
?>
<div class="title">
<?php
the_title( '<h5 class="mb0">', '</h5>' );
if ( ! empty( $project_types ) ) {
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
}
?>
</div>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php
if ( 'mansonry' == $layout ) {
the_post_thumbnail( 'medium' );
}
?>
<div class="title">
<?php
the_title( '<h5 class="mb0">', '</h5>' );
if ( ! empty( $project_types ) ) {
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
}
?>
</div>
</a>
<?php
}
?>
}
?>
</div>
</article><!-- #post-## -->
<?php
Expand All @@ -87,10 +85,9 @@

</main><!-- #main -->
</div><!-- #primary -->
<?php
if ( 'sidebar-right' == $layout_class ) :
get_sidebar();
endif;
?>
<?php
if ( 'sidebar-right' == $layout_class ) :
get_sidebar();
endif;

get_footer();
36 changes: 36 additions & 0 deletions assets/js/customizer-builder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(function( $ ) {// jscs:ignore validateLineBreaks

'use strict';

var api = wp.customize;

api.bind( 'ready', function() {
var currentURL = api.settings.url.preview,
urlBase,
urlParts,
pageSidebarID,
pageSidebarSection;
if ( currentURL !== ShapelyBuilder.siteURL ) {
urlParts = currentURL.split( '/' );
urlParts.pop();
urlBase = urlParts[ urlParts.length - 1 ];
if ( undefined !== ShapelyBuilder.pages[ urlBase ] ) {
pageSidebarID = 'sidebar-widgets-shapely-' + urlBase;
/*
* Defer focus until:
* 1. The section exist.
* 2. The instance is embedded in the document (and so is focusable).
* 3. The preview has finished loading so that the active states have been set.
*/
pageSidebarSection = api.section( pageSidebarID, function( instance ) {
instance.deferred.embedded.done( function() {
api.previewer.deferred.active.done( function() {
instance.focus();
} );
} );
} );
}
}
} );

})( jQuery );
54 changes: 27 additions & 27 deletions assets/js/customizer-preview.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
(function( $ ) {// jscs:ignore validateLineBreaks

if ( 'undefined' !== typeof( wp ) ) {
if ( 'undefined' !== typeof( wp.customize ) ) {
wp.customize.bind( 'preview-ready', function() {
wp.customize.preview.bind( 'update-inline-css', function( object ) {
var data = {
'action': object.action,
'args': object.data,
'id': object.id
};
if ( 'undefined' !== typeof( wp ) ) {
if ( 'undefined' !== typeof( wp.customize ) ) {
wp.customize.bind( 'preview-ready', function() {
wp.customize.preview.bind( 'update-inline-css', function( object ) {
var data = {
'action': object.action,
'args': object.data,
'id': object.id
};

jQuery.ajax({
dataType: 'json',
type: 'POST',
url: WPUrls.ajaxurl,
data: data,
complete: function( json ) {
var sufix = object.action + object.id;
var style = $( '#shapely-style-' + sufix );
jQuery.ajax( {
dataType: 'json',
type: 'POST',
url: WPUrls.ajaxurl,
data: data,
complete: function( json ) {
var sufix = object.action + object.id;
var style = $( '#shapely-style-' + sufix );

if ( ! style.length ) {
style = $( 'head' ).append( '<style type="text/css" id="shapely-style-' + sufix + '" />' ).find( '#shapely-style-' + sufix );
}
if ( ! style.length ) {
style = $( 'head' ).append( '<style type="text/css" id="shapely-style-' + sufix + '" />' ).find( '#shapely-style-' + sufix );
}

style.html( json.responseText );
}
});
});
});
}
}
style.html( json.responseText );
}
} );
} );
} );
}
}

})( jQuery );
3 changes: 2 additions & 1 deletion assets/js/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@

control.setting( {} );
control.setting( values );

control.hasLogo = true;
control.toggle( true );
} else {
control.hasLogo = false;
control.toggle( false );
}
},
Expand Down
22 changes: 22 additions & 0 deletions assets/js/shapely-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

//"use strict";

jQuery( 'body' ).imagesLoaded( function() {
jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
} );

jQuery( '.shapely-dropdown' ).click( function( evt ) {
evt.preventDefault();
jQuery( this ).parent().find( '> ul' ).toggleClass( 'active' );
Expand All @@ -25,6 +29,15 @@
element = $( '#site-navigation #menu a[href=' + window.location.hash + ']' );
if ( element ) {
scrollToID = '#' + element.data( 'scroll' );

if ( jQuery( scrollToID ).length < 1 ) {
scrollToID = window.location.hash;
}

if ( jQuery( scrollToID ).length < 1 ) {
return;
}

$( 'html,body' ).animate( {
scrollTop: $( scrollToID ).offset().top
}, 2000 );
Expand All @@ -37,6 +50,15 @@

$( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) {
var scrollToID = '#' + $( this ).data( 'scroll' );

if ( jQuery( scrollToID ).length < 1 ) {
scrollToID = $( this ).attr( 'href' );
}

if ( jQuery( scrollToID ).length < 1 ) {
return;
}

evt.preventDefault();
$( 'html,body' ).animate( {
scrollTop: $( scrollToID ).offset().top
Expand Down
16 changes: 11 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function shapely_setup() {
*/
add_theme_support(
'custom-logo', array(
'height' => 55,
'width' => 135,
'flex-width' => true,
'height' => 55,
'width' => 135,
'flex-width' => true,
'flex-height' => true,
)
);
Expand Down Expand Up @@ -119,7 +119,7 @@ function shapely_setup() {
global $shapely_required_actions, $shapely_recommended_plugins;

$shapely_recommended_plugins = array(
'contact-form-7' => array(
'contact-form-7' => array(
'recommended' => false,
),
'fancybox-for-wordpress' => array(
Expand Down Expand Up @@ -181,7 +181,7 @@ function shapely_setup() {
}// End if().

// Enable Shortcodes in widgets
add_filter( 'widget_text','do_shortcode' );
add_filter( 'widget_text', 'do_shortcode' );

}
endif;
Expand Down Expand Up @@ -333,6 +333,7 @@ function shapely_scripts() {
$args = array(
'controls' => array( 'slider', 'toggle' ), // array of controls to load
'sections' => array( 'recommended-actions', 'pro' ), // array of sections to load
'backup' => false,
);

new Epsilon_Framework( $args );
Expand Down Expand Up @@ -377,3 +378,8 @@ function shapely_scripts() {
*/
require get_template_directory() . '/inc/admin/welcome-screen/class-shapely-notify-system.php';

/**
* Load the shapely page builder class
*/
require get_template_directory() . '/inc/class-shapely-builder.php';
Shapely_Builder::get_instance();
5 changes: 2 additions & 3 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@
</div>
</header><!-- #masthead -->
<div id="content" class="main-container">
<?php if ( ! is_page_template( 'page-templates/template-home.php' ) && ! is_404() ) : ?>
<?php if ( ! is_page_template( 'page-templates/template-home.php' ) && ! is_404() && ! is_page_template( 'page-templates/template-widget.php' ) ) : ?>
<div class="header-callout">
<?php shapely_top_callout(); ?>
</div>
<?php endif; ?>

<section class="content-area <?php echo ( get_theme_mod( 'top_callout', true ) ) ? '' : ' pt0 '; ?>">
<div id="main" class="<?php echo ( ! is_page_template( 'page-templates/template-home.php' ) ) ? 'container' : ''; ?>"
role="main">
<div id="main" class="<?php echo ( ! is_page_template( 'page-templates/template-home.php' ) && ! is_page_template( 'page-templates/template-widget.php' ) ) ? 'container' : ''; ?>" role="main">
Loading

0 comments on commit ef4c7bb

Please sign in to comment.