Skip to content

Commit

Permalink
Merge branch 'release-1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
thingsym committed Mar 24, 2020
2 parents 8489237 + 3ebb8bc commit e731629
Show file tree
Hide file tree
Showing 27 changed files with 3,948 additions and 3,002 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
vendor
.sass-cache
composer.lock
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ npm install
|
|- templates/ # template files and partial files
| |- content/ # content part files
| |- page-header/ # page header part files
| |- parts/ # partial files
| |- sidebar/ # sidebar part files
|
Expand Down Expand Up @@ -248,7 +249,7 @@ npm run <task>
* lint:css
* lint:scss
* lint:es
* lint:es:fix
* lint\:es\:fix
* lint
* stats:css
* bs:server
Expand Down Expand Up @@ -307,6 +308,15 @@ Small patches and bug reports can be submitted a issue tracker in Github. Forkin

## Changelog

### [1.5.0] - 2020.03.24

- move template parts files to page-header dir
- add non minified javascript files for theme review
- change javascript files bundle from webpack to minify
- move javascript files to src/javascript/main directory
- exclude node_modules in test scope
- remove README.md in zip archive

### [1.4.0] - 2019.11.19

- fix Theme Starter script
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"phpcs": "phpcs -p -s -v -n ./ --standard=./phpcs.ruleset.xml --extensions=php",
"phpcs:warning": "phpcs -p -s -v ./ --standard=./phpcs.ruleset.xml --extensions=php",
"phpcbf": "phpcbf -p -s -v ./ --standard=./phpcs.ruleset.xml --extensions=php",
"phpmd": "phpmd ./ text ./phpmd.ruleset.xml --suffixes php --exclude /tests,/vendor",
"phpmd": "phpmd ./ text ./phpmd.ruleset.xml --suffixes php --exclude /tests,/vendor,/node_modules",
"phpstan": "phpstan analyse",
"phpunit": "phpunit",
"ci": [
"phpcs -p -s -v -n ./ --standard=./phpcs.ruleset.xml --extensions=php",
"phpmd ./ text ./phpmd.ruleset.xml --suffixes php --exclude /tests,/vendor",
"phpmd ./ text ./phpmd.ruleset.xml --suffixes php --exclude /tests,/vendor,/node_modules",
"phpunit"
]
}
Expand Down
4 changes: 2 additions & 2 deletions functions/customizer/class-customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function render_partial_blogdescription() {
public function control_enqueue_scripts() {
wp_enqueue_script(
'wp-theme-boilerplate-customizer-control',
get_template_directory_uri() . '/js/customize-control.bundle.js',
get_template_directory_uri() . '/js/customize-control.min.js',
array(),
'20191008',
true
Expand All @@ -75,7 +75,7 @@ public function control_enqueue_scripts() {
public function preview_enqueue_scripts() {
wp_enqueue_script(
'wp-theme-boilerplate-customizer-preview',
get_template_directory_uri() . '/js/customize-preview.bundle.js',
get_template_directory_uri() . '/js/customize-preview.min.js',
array( 'customize-preview' ),
'20151215',
true
Expand Down
2 changes: 1 addition & 1 deletion functions/setup/class-style-script.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function enqueue_styles() {
public function enqueue_scripts() {
wp_enqueue_script(
'wp-theme-boilerplate-bundle',
get_template_directory_uri() . '/js/main.bundle.js',
get_template_directory_uri() . '/js/main.min.js',
array( 'jquery' ),
'20151215',
true
Expand Down
6 changes: 3 additions & 3 deletions functions/theme-hook/class-theme-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public function entry_meta_footer() {

public function add_page_header() {
if ( is_home() && ! is_front_page() ) {
get_template_part( 'templates/parts/page-header-single-post' );
get_template_part( 'templates/page-header/single-post' );
}
elseif ( is_archive() ) {
get_template_part( 'templates/parts/page-header-archive' );
get_template_part( 'templates/page-header/archive' );
}
elseif ( is_search() ) {
get_template_part( 'templates/parts/page-header-search' );
get_template_part( 'templates/page-header/search' );
}
}

Expand Down
1 change: 0 additions & 1 deletion js/customize-control.bundle.js

This file was deleted.

Empty file added js/customize-control.js
Empty file.
Empty file added js/customize-control.min.js
Empty file.
1 change: 0 additions & 1 deletion js/customize-preview.bundle.js

This file was deleted.

42 changes: 42 additions & 0 deletions js/customize-preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* File customize-preview.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/

( function( $ ) {

// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );

// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'position': 'relative'
} );
$( '.site-title a, .site-description' ).css( {
'color': to
} );
}
} );
} );
} )( jQuery );
1 change: 1 addition & 0 deletions js/customize-preview.min.js

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

1 change: 0 additions & 1 deletion js/main.bundle.js

This file was deleted.

138 changes: 138 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/**
* File navigation.js.
*
* Handles toggling the navigation menu for small screens and enables TAB key
* navigation support for dropdown menus.
*/
( function() {
var container, button, menu, links, i, len;

container = document.getElementById( 'site-navigation' );
if ( ! container ) {
return;
}

button = container.getElementsByTagName( 'button' )[0];
if ( 'undefined' === typeof button ) {
return;
}

menu = container.getElementsByTagName( 'ul' )[0];

// Hide menu toggle button if menu is empty and return early.
if ( 'undefined' === typeof menu ) {
button.style.display = 'none';
return;
}

menu.setAttribute( 'aria-expanded', 'false' );
if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
menu.className += ' nav-menu';
}

button.onclick = function() {
if ( -1 !== container.className.indexOf( 'toggled' ) ) {
container.className = container.className.replace( ' toggled', '' );
button.setAttribute( 'aria-expanded', 'false' );
menu.setAttribute( 'aria-expanded', 'false' );
} else {
container.className += ' toggled';
button.setAttribute( 'aria-expanded', 'true' );
menu.setAttribute( 'aria-expanded', 'true' );
}
};

// Get all the link elements within the menu.
links = menu.getElementsByTagName( 'a' );

// Each time a menu link is focused or blurred, toggle focus.
for ( i = 0, len = links.length; i < len; i++ ) {
links[i].addEventListener( 'focus', toggleFocus, true );
links[i].addEventListener( 'blur', toggleFocus, true );
}

/**
* Sets or removes .focus class on an element.
*/
function toggleFocus() {
var self = this;

// Move up through the ancestors of the current link until we hit .nav-menu.
while ( -1 === self.className.indexOf( 'nav-menu' ) ) {

// On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) {
if ( -1 !== self.className.indexOf( 'focus' ) ) {
self.className = self.className.replace( ' focus', '' );
} else {
self.className += ' focus';
}
}

self = self.parentElement;
}
}

/**
* Toggles `focus` class to allow submenu access on tablets.
*/
( function( container ) {
var touchStartFn, i,
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );

if ( 'ontouchstart' in window ) {
touchStartFn = function( e ) {
var menuItem = this.parentNode, i;

if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault();
for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
if ( menuItem === menuItem.parentNode.children[i] ) {
continue;
}
menuItem.parentNode.children[i].classList.remove( 'focus' );
}
menuItem.classList.add( 'focus' );
} else {
menuItem.classList.remove( 'focus' );
}
};

for ( i = 0; i < parentLink.length; ++i ) {
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
}
}
}( container ) );
} )();

/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );

if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;

if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}

element = document.getElementById( id );

if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}

element.focus();
}
}, false );
}
} )();
1 change: 1 addition & 0 deletions js/main.min.js

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

16 changes: 8 additions & 8 deletions languages/wp-theme-boilerplate.pot
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (C) 2019 thingsym
# Copyright (C) 2020 thingsym
# This file is distributed under the GPL2 or later.
msgid ""
msgstr ""
"Project-Id-Version: WP Theme Boilerplate 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/wp-theme-"
"boilerplate\n"
"POT-Creation-Date: 2019-11-19 03:15:32+00:00\n"
"POT-Creation-Date: 2020-03-24 06:07:40+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"

Expand Down Expand Up @@ -120,6 +120,11 @@ msgstr ""
msgid "Pages:"
msgstr ""

#. translators: %s: search query.
#: templates/page-header/search.php:15
msgid "Search Results for: %s"
msgstr ""

#. translators: 1: title.
#: templates/parts/comments.php:35
msgid "One thought on &ldquo;%1$s&rdquo;"
Expand All @@ -137,11 +142,6 @@ msgstr[1] ""
msgid "Comments are closed."
msgstr ""

#. translators: %s: search query.
#: templates/parts/page-header-search.php:15
msgid "Search Results for: %s"
msgstr ""

#: templates/parts/theme-info.php:14
msgid "Proudly powered by "
msgstr ""
Expand Down
Loading

0 comments on commit e731629

Please sign in to comment.