Skip to content

Commit ef4c7bb

Browse files
Merge pull request #236 from MachoThemes/master
Update 1.2.1
2 parents 0da3849 + 286ecde commit ef4c7bb

26 files changed

+502
-307
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"Vimeo" : false,
2323
"shapelyWelcomeScreenObject" : false,
2424
"console": false,
25-
"shapelyWelcomeScreenCustomizerObject" : false
25+
"shapelyWelcomeScreenCustomizerObject" : false,
26+
"ShapelyBuilder" : false
2627
}
2728
}

archive-jetpack-portfolio.php

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
<?php
22
get_header();
33

4-
$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
4+
$layout = get_theme_mod( 'projects_layout_view', 'mansonry' );
55
$layout_class = shapely_get_layout_class();
66

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

12+
if ( 'sidebar-left' == $layout_class ) :
13+
get_sidebar();
14+
endif;
1215
?>
13-
<?php
14-
if ( 'sidebar-left' == $layout_class ) :
15-
get_sidebar();
16-
endif;
17-
?>
1816
<div id="primary" class="content-area col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>">
1917
<main id="main" class="site-main" role="main">
2018

@@ -29,7 +27,7 @@
2927
</div>
3028
</div>
3129
<?php endif ?>
32-
30+
3331
<div class="<?php echo 'mansonry' == $layout ? 'masonry masonryFlyIn' : ''; ?>">
3432
<?php
3533
/* Start the Loop */
@@ -41,35 +39,35 @@
4139
$project_types = wp_get_post_terms( $post->ID, 'jetpack-portfolio-type', $projects_args );
4240

4341
$thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
44-
$item_style = '';
42+
$item_style = '';
4543
if ( 'mansonry' != $layout ) {
4644
$item_style = 'background-image: url(' . $thumbnail_url . ')';
4745
}
48-
?>
46+
?>
4947

5048
<article id="post-<?php the_ID(); ?>" <?php post_class( $item_classes ); ?>>
51-
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
52-
<?php
53-
if ( has_post_thumbnail() ) {
54-
?>
55-
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
56-
<?php
57-
if ( 'mansonry' == $layout ) {
58-
the_post_thumbnail( 'medium' );
59-
}
49+
<div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>">
50+
<?php
51+
if ( has_post_thumbnail() ) {
6052
?>
61-
<div class="title">
62-
<?php
63-
the_title( '<h5 class="mb0">', '</h5>' );
64-
if ( ! empty( $project_types ) ) {
65-
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
66-
}
67-
?>
68-
</div>
53+
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
54+
<?php
55+
if ( 'mansonry' == $layout ) {
56+
the_post_thumbnail( 'medium' );
57+
}
58+
?>
59+
<div class="title">
60+
<?php
61+
the_title( '<h5 class="mb0">', '</h5>' );
62+
if ( ! empty( $project_types ) ) {
63+
echo '<span>' . implode( ' / ', $project_types ) . '</span>';
64+
}
65+
?>
66+
</div>
6967
</a>
7068
<?php
71-
}
72-
?>
69+
}
70+
?>
7371
</div>
7472
</article><!-- #post-## -->
7573
<?php
@@ -87,10 +85,9 @@
8785

8886
</main><!-- #main -->
8987
</div><!-- #primary -->
90-
<?php
91-
if ( 'sidebar-right' == $layout_class ) :
92-
get_sidebar();
93-
endif;
94-
?>
9588
<?php
89+
if ( 'sidebar-right' == $layout_class ) :
90+
get_sidebar();
91+
endif;
92+
9693
get_footer();

assets/js/customizer-builder.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
(function( $ ) {// jscs:ignore validateLineBreaks
2+
3+
'use strict';
4+
5+
var api = wp.customize;
6+
7+
api.bind( 'ready', function() {
8+
var currentURL = api.settings.url.preview,
9+
urlBase,
10+
urlParts,
11+
pageSidebarID,
12+
pageSidebarSection;
13+
if ( currentURL !== ShapelyBuilder.siteURL ) {
14+
urlParts = currentURL.split( '/' );
15+
urlParts.pop();
16+
urlBase = urlParts[ urlParts.length - 1 ];
17+
if ( undefined !== ShapelyBuilder.pages[ urlBase ] ) {
18+
pageSidebarID = 'sidebar-widgets-shapely-' + urlBase;
19+
/*
20+
* Defer focus until:
21+
* 1. The section exist.
22+
* 2. The instance is embedded in the document (and so is focusable).
23+
* 3. The preview has finished loading so that the active states have been set.
24+
*/
25+
pageSidebarSection = api.section( pageSidebarID, function( instance ) {
26+
instance.deferred.embedded.done( function() {
27+
api.previewer.deferred.active.done( function() {
28+
instance.focus();
29+
} );
30+
} );
31+
} );
32+
}
33+
}
34+
} );
35+
36+
})( jQuery );

assets/js/customizer-preview.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
(function( $ ) {// jscs:ignore validateLineBreaks
22

3-
if ( 'undefined' !== typeof( wp ) ) {
4-
if ( 'undefined' !== typeof( wp.customize ) ) {
5-
wp.customize.bind( 'preview-ready', function() {
6-
wp.customize.preview.bind( 'update-inline-css', function( object ) {
7-
var data = {
8-
'action': object.action,
9-
'args': object.data,
10-
'id': object.id
11-
};
3+
if ( 'undefined' !== typeof( wp ) ) {
4+
if ( 'undefined' !== typeof( wp.customize ) ) {
5+
wp.customize.bind( 'preview-ready', function() {
6+
wp.customize.preview.bind( 'update-inline-css', function( object ) {
7+
var data = {
8+
'action': object.action,
9+
'args': object.data,
10+
'id': object.id
11+
};
1212

13-
jQuery.ajax({
14-
dataType: 'json',
15-
type: 'POST',
16-
url: WPUrls.ajaxurl,
17-
data: data,
18-
complete: function( json ) {
19-
var sufix = object.action + object.id;
20-
var style = $( '#shapely-style-' + sufix );
13+
jQuery.ajax( {
14+
dataType: 'json',
15+
type: 'POST',
16+
url: WPUrls.ajaxurl,
17+
data: data,
18+
complete: function( json ) {
19+
var sufix = object.action + object.id;
20+
var style = $( '#shapely-style-' + sufix );
2121

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

26-
style.html( json.responseText );
27-
}
28-
});
29-
});
30-
});
31-
}
32-
}
26+
style.html( json.responseText );
27+
}
28+
} );
29+
} );
30+
} );
31+
}
32+
}
3333

3434
})( jQuery );

assets/js/customizer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@
9393

9494
control.setting( {} );
9595
control.setting( values );
96-
96+
control.hasLogo = true;
9797
control.toggle( true );
9898
} else {
99+
control.hasLogo = false;
99100
control.toggle( false );
100101
}
101102
},

assets/js/shapely-scripts.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
//"use strict";
88

9+
jQuery( 'body' ).imagesLoaded( function() {
10+
jQuery( window ).trigger( 'resize' ).trigger( 'scroll' );
11+
} );
12+
913
jQuery( '.shapely-dropdown' ).click( function( evt ) {
1014
evt.preventDefault();
1115
jQuery( this ).parent().find( '> ul' ).toggleClass( 'active' );
@@ -25,6 +29,15 @@
2529
element = $( '#site-navigation #menu a[href=' + window.location.hash + ']' );
2630
if ( element ) {
2731
scrollToID = '#' + element.data( 'scroll' );
32+
33+
if ( jQuery( scrollToID ).length < 1 ) {
34+
scrollToID = window.location.hash;
35+
}
36+
37+
if ( jQuery( scrollToID ).length < 1 ) {
38+
return;
39+
}
40+
2841
$( 'html,body' ).animate( {
2942
scrollTop: $( scrollToID ).offset().top
3043
}, 2000 );
@@ -37,6 +50,15 @@
3750

3851
$( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) {
3952
var scrollToID = '#' + $( this ).data( 'scroll' );
53+
54+
if ( jQuery( scrollToID ).length < 1 ) {
55+
scrollToID = $( this ).attr( 'href' );
56+
}
57+
58+
if ( jQuery( scrollToID ).length < 1 ) {
59+
return;
60+
}
61+
4062
evt.preventDefault();
4163
$( 'html,body' ).animate( {
4264
scrollTop: $( scrollToID ).offset().top

functions.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ function shapely_setup() {
3232
*/
3333
add_theme_support(
3434
'custom-logo', array(
35-
'height' => 55,
36-
'width' => 135,
37-
'flex-width' => true,
35+
'height' => 55,
36+
'width' => 135,
37+
'flex-width' => true,
3838
'flex-height' => true,
3939
)
4040
);
@@ -119,7 +119,7 @@ function shapely_setup() {
119119
global $shapely_required_actions, $shapely_recommended_plugins;
120120

121121
$shapely_recommended_plugins = array(
122-
'contact-form-7' => array(
122+
'contact-form-7' => array(
123123
'recommended' => false,
124124
),
125125
'fancybox-for-wordpress' => array(
@@ -181,7 +181,7 @@ function shapely_setup() {
181181
}// End if().
182182

183183
// Enable Shortcodes in widgets
184-
add_filter( 'widget_text','do_shortcode' );
184+
add_filter( 'widget_text', 'do_shortcode' );
185185

186186
}
187187
endif;
@@ -333,6 +333,7 @@ function shapely_scripts() {
333333
$args = array(
334334
'controls' => array( 'slider', 'toggle' ), // array of controls to load
335335
'sections' => array( 'recommended-actions', 'pro' ), // array of sections to load
336+
'backup' => false,
336337
);
337338

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

381+
/**
382+
* Load the shapely page builder class
383+
*/
384+
require get_template_directory() . '/inc/class-shapely-builder.php';
385+
Shapely_Builder::get_instance();

header.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@
5959
</div>
6060
</header><!-- #masthead -->
6161
<div id="content" class="main-container">
62-
<?php if ( ! is_page_template( 'page-templates/template-home.php' ) && ! is_404() ) : ?>
62+
<?php if ( ! is_page_template( 'page-templates/template-home.php' ) && ! is_404() && ! is_page_template( 'page-templates/template-widget.php' ) ) : ?>
6363
<div class="header-callout">
6464
<?php shapely_top_callout(); ?>
6565
</div>
6666
<?php endif; ?>
6767

6868
<section class="content-area <?php echo ( get_theme_mod( 'top_callout', true ) ) ? '' : ' pt0 '; ?>">
69-
<div id="main" class="<?php echo ( ! is_page_template( 'page-templates/template-home.php' ) ) ? 'container' : ''; ?>"
70-
role="main">
69+
<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">

0 commit comments

Comments
 (0)