Skip to content

Commit

Permalink
Merge pull request #146 from hallme/release/3.2
Browse files Browse the repository at this point in the history
Release/3.2
  • Loading branch information
jlavoie13 authored Oct 15, 2020
2 parents e714a10 + a859ab2 commit 4da4f3b
Show file tree
Hide file tree
Showing 57 changed files with 2,869 additions and 1,830 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Responsive Design Scaffolding for WordPress

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hallme/scaffolding?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Responsive Wordpress Base Theme based off Bones, Foundation, Bootstrap (+ more)
Responsive WordPress Base Theme based off Bones, Foundation, Bootstrap (+ more)

Scaffolding is designed to make the life of developers easier. It is
built using HTML5 & has a strong semantic foundation. It is developed
Expand All @@ -20,7 +20,7 @@ License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Special Thanks to:
Eddie Machado. This started as a fork of bones. http://themble.com/bones
Eddie Machado. This started as a fork of bones. https://themble.com/bones

Submit Bugs & or Fixes:
https://github.com/hallme/scaffolding/issues
18 changes: 18 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## Version 3.2

* Update Bootstrap Grid to version 4.4
* Update Font Awesome to version 5.15.1
* Update SelectWoo to version 1.0.8
* Add missing RetinaJS resources
* Move responsive iframe script into separate file and enqueue and update list of streaming services supported
* Move navigation script into separate file and enqueue separately
* Add Bootstrap spacing utility classes
* Add font-family to form input styles
* Add theme support for navigation widgets added in WP 5.5
* Fix Font Awesome scss variable font path
* Fix main navigation child list styles
* Fix incorrect variables in sitemap page template
* Fix duplicate figure wrap in responsive iframe script
* Fix sticky footer styles
* Fix date function in footer

## Version 3.1

* Update jquery-doubletaptogo library and enqueue it
Expand Down
2 changes: 1 addition & 1 deletion css/editor-styles.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/libs/fontawesome/all.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/libs/fontawesome/brands.css

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

4 changes: 2 additions & 2 deletions css/libs/fontawesome/fontawesome.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions css/libs/fontawesome/regular.css

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

4 changes: 2 additions & 2 deletions css/libs/fontawesome/solid.css

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

4 changes: 2 additions & 2 deletions css/libs/fontawesome/v4-shims.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<?php endif; ?>

<p class="source-org copyright"><?php echo esc_html( '&copy; ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ) ); ?></p>
<p class="source-org copyright"><?php echo esc_html( '&copy; ' . gmdate( 'Y' ) . ' ' . get_bloginfo( 'name' ) ); ?></p>

</div>

Expand Down
53 changes: 35 additions & 18 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,29 @@
function scaffolding_scripts_and_styles() {

/**
* Add to wp_head()
* Fonts
*/

// Font Awesome (icon set) - https://fontawesome.com/.
// this may be updated to include only specific icon sets: brands, solid, regular.
wp_enqueue_style( 'scaffolding-fontawesome-all', get_stylesheet_directory_uri() . '/css/libs/fontawesome/all.css', array(), '5.15.1' );

/**
* Theme Styles
*/

// Main stylesheet.
$theme_css_version = filemtime( get_theme_file_path( '/css/style.css' ) );
wp_enqueue_style( 'scaffolding-stylesheet', get_stylesheet_directory_uri() . '/css/style.css', array(), $theme_css_version );

// Font Awesome (icon set) - https://fontawesome.com/.
// this may be updated to include only specific icon sets: brands, solid, regular.
wp_enqueue_style( 'scaffolding-fontawesome-all', get_stylesheet_directory_uri() . '/css/libs/fontawesome/all.css', array(), '5.10.1' );
/**
* Third-Party Libraries
*/

// Modernizr - http://modernizr.com/.
// update this to include only what you need to test.
wp_enqueue_script( 'scaffolding-modernizr', get_stylesheet_directory_uri() . '/libs/js/custom-modernizr.min.js', array(), '3.6.0', false );

/**
* Add to wp_footer()
*/

// Retina.js - http://imulus.github.io/retinajs/.
wp_enqueue_script( 'scaffolding-retinajs', get_stylesheet_directory_uri() . '/libs/js/retina.min.js', array(), '2.1.2', true );

Expand All @@ -98,17 +102,29 @@ function scaffolding_scripts_and_styles() {
wp_enqueue_script( 'scaffolding-magnific-popup-js', get_stylesheet_directory_uri() . '/libs/js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );

// SelectWoo - https://github.com/woocommerce/selectWoo.
wp_enqueue_script( 'scaffolding-selectwoo', get_stylesheet_directory_uri() . '/libs/js/selectWoo.full.min.js', array( 'jquery' ), '1.0.2', true );
wp_enqueue_script( 'scaffolding-selectwoo', get_stylesheet_directory_uri() . '/libs/js/selectWoo.full.min.js', array( 'jquery' ), '1.0.8', true );

// Comment reply script for threaded comments.
if ( is_singular() && comments_open() && ( 1 === get_option( 'thread_comments' ) ) ) {
wp_enqueue_script( 'comment-reply' );
}

/**
* Theme Scripts
*/

// Add Scaffolding scripts file in the footer.
$theme_js_version = filemtime( get_theme_file_path( '/js/scripts.js' ) );
wp_enqueue_script( 'scaffolding-js', get_stylesheet_directory_uri() . '/js/scripts.js', array( 'jquery' ), $theme_js_version, true );

// Navigation scripts.
$theme_nav_js_version = filemtime( get_theme_file_path( '/js/navigation.js' ) );
wp_enqueue_script( 'scaffolding-nav', get_stylesheet_directory_uri() . '/js/navigation.js', array( 'jquery', 'scaffolding-js' ), $theme_nav_js_version, true );

// Responsive iFrames, Embeds and Objects - http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php.
// Fallback for elements outside the Gutenberg blocks (ie. using the Classic Editor).
wp_enqueue_script( 'scaffolding-responsive-iframes', get_stylesheet_directory_uri() . '/js/responsive-iframes.js', array( 'jquery' ), '1.0.0', true );

} // end scaffolding_scripts_and_styles()


Expand Down Expand Up @@ -170,6 +186,7 @@ function scaffolding_theme_support() {
add_theme_support(
'html5',
array(
'navigation-widgets',
'comment-list',
'comment-form',
'search-form',
Expand Down Expand Up @@ -197,15 +214,15 @@ function scaffolding_theme_support() {
// Feature Currently Disabled
// Support for post formats
add_theme_support( 'post-formats', array(
'aside', // title less blurb
'gallery', // gallery of images
'link', // quick link to other site
'image', // an image
'quote', // a quick quote
'status', // a Facebook like status update
'video', // video
'audio', // audio
'chat', // chat transcript
'aside', // title less blurb
'gallery', // gallery of images
'link', // quick link to other site
'image', // an image
'quote', // a quick quote
'status', // a Facebook like status update
'video', // video
'audio', // audio
'chat', // chat transcript
) );
*/

Expand Down
60 changes: 60 additions & 0 deletions js/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/******************************************************************
Site Name:
Author:
Name: Navigation Scripts
******************************************************************/

// as the page loads, call these scripts
jQuery(document).ready(function($) {

// getting viewport width
var responsive_viewport = $(window).width() + getScrollBarWidth();

/*
Mobile Navigation
*/
$(function() {
$('#mobile-menu-button').on('click', function(e) {
if ( ! $('body').hasClass('menu-open') ) {
$('#main-navigation > ul.main-menu').css('display','block');
$('body').toggleClass('menu-open');
} else {
$('body').toggleClass('menu-open');
setTimeout( function(){
$('#main-navigation > ul.main-menu').css('display','none');
},500);
}
});

$('#main-navigation .menu-item > .menu-button').on('click', function(e) {
$(this).next('.sub-menu').addClass('sub-menu-open');
});

$('#main-navigation .sub-menu .menu-back-button').on('click', function(e) {
$(this).parent('li').parent('ul').removeClass('sub-menu-open');
});

/*
Fixes bug on touch devices
opens ul on first tap
accepts anchor and opens page on second tap
*/
if ($.fn.doubleTapToGo) {
responsive_viewport = $(window).width() + getScrollBarWidth();
if (responsive_viewport >= 768) {
$('#main-navigation').doubleTapToGo();
}
}
});

$(window).resize(function(e) {
responsive_viewport = $(window).width() + getScrollBarWidth();
if (responsive_viewport >= 768) {
$('body').removeClass('menu-open');
$('#main-navigation > ul.main-menu').removeAttr('style');
}
});

});
29 changes: 29 additions & 0 deletions js/responsive-iframes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(function($){

jQuery(document).ready(function($) {

// Responsive iFrames, Embeds and Objects - http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
// Fallback for elements outside the Gutenberg blocks (ie. using the Classic Editor)
var $allVideos = $(":not(.wp-block-embed__wrapper) > iframe[src*='youtube'], :not(.wp-block-embed__wrapper) > iframe[src*='vimeo'], :not(.wp-block-embed__wrapper) > iframe[src*='dailymotion'], :not(.wp-block-embed__wrapper) > iframe[src*='funnyordie'], :not(.wp-block-embed__wrapper) > object, :not(.wp-block-embed__wrapper) > embed").wrap( "<figure></figure>" );

$allVideos.each(function() {
$(this)
// jQuery .data does not work on object/embed elements
.attr('data-aspectRatio', this.height / this.width)
.css({ 'max-width': this.width + 'px', 'max-height': this.height + 'px' })
.removeAttr('height')
.removeAttr('width');
});
$(window).resize(function() {
$allVideos.each(function() {
var $el = $(this);
var newWidth = $el.closest('figure').width();
$el
.width(newWidth)
.height(newWidth * $el.attr('data-aspectRatio'));
});
}).resize();

});

})(jQuery);
81 changes: 2 additions & 79 deletions js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ function getScrollBarWidth () {

// As the page loads, call these scripts
jQuery(document).ready(function($) {

// getting viewport width
var responsive_viewport = $(window).width() + getScrollBarWidth();


// Initialize Retinajs - https://github.com/strues/retinajs
if (jQuery.fn.retinajs) {
retinajs();
}

// SelectWoo - https://github.com/woocommerce/selectWoo
if ($.fn.selectWoo) {
var setup_selectWoo = function() {
Expand Down Expand Up @@ -93,80 +90,6 @@ jQuery(document).ready(function($) {
});
}

// Responsive iFrames, Embeds and Objects - http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
var $allVideos = $("iframe[src*='youtube'], iframe[src*='hulu'], iframe[src*='revision3'], iframe[src*='vimeo'], iframe[src*='blip'], iframe[src*='dailymotion'], iframe[src*='funnyordie'], object, embed").wrap( "<figure></figure>" );

$allVideos.each(function() {
$(this)
// jQuery .data does not work on object/embed elements
.attr('data-aspectRatio', this.height / this.width)
.css({ 'max-width': this.width + 'px', 'max-height': this.height + 'px' })
.removeAttr('height')
.removeAttr('width');
});
$(window).resize(function() {
$allVideos.each(function() {
var $el = $(this);
var newWidth = $el.closest("figure").width();
$el
.width(newWidth)
.height(newWidth * $el.attr('data-aspectRatio'));
});
}).resize();

/*
Responsive jQuery is a tricky thing.
There's a bunch of different ways to handle
it, so be sure to research and find the one
that works for you best.
*/

/*
Mobile Navigation
*/
$(function() {
$('#mobile-menu-button').on('click', function(e) {
if ( ! $('body').hasClass('menu-open') ) {
$('#main-navigation > ul.main-menu').css('display','block');
$('body').toggleClass('menu-open');
} else {
$('body').toggleClass('menu-open');
setTimeout( function(){
$('#main-navigation > ul.main-menu').css('display','none');
},500);
}
});

$('#main-navigation .menu-item > .menu-button').on('click', function(e) {
$(this).next('.sub-menu').addClass('sub-menu-open');
});

$('#main-navigation .sub-menu .menu-back-button').on('click', function(e) {
$(this).parent('li').parent('ul').removeClass('sub-menu-open');
});

/*
Fixes bug on touch devices
opens ul on first tap
accepts anchor and opens page on second tap
*/
if ($.fn.doubleTapToGo) {
responsive_viewport = $(window).width() + getScrollBarWidth();
if (responsive_viewport >= 768) {
$('#main-navigation').doubleTapToGo();
}
}
});

$(window).resize(function(e) {
responsive_viewport = $(window).width() + getScrollBarWidth();
if (responsive_viewport >= 768) {
$('body').removeClass('menu-open');
$('#main-navigation > ul.main-menu').removeAttr('style');
}
});
// end responsive nav

// hide #back-top first
$("#back-top").hide();

Expand Down
Binary file modified libs/fontawesome/webfonts/fa-brands-400.eot
Binary file not shown.
Loading

0 comments on commit 4da4f3b

Please sign in to comment.