Skip to content

Commit

Permalink
version 1.3 update - see changelog.md for list of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaple committed Apr 20, 2022
1 parent fa96260 commit e2cfdbc
Show file tree
Hide file tree
Showing 27 changed files with 163 additions and 135 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 2021-04-20 - 1.3.0

- feature: added theme option to change default search option
- a11y: various navigation navigation fixes (white bar, quicklinks, audeince menu), including updates to keyboard navigation, arial labels, and JAWS interactivity
- a11y: Added visible focus indicator outline to links and menus
- a11y: Added background colors to headers & jumbotrons
- a11y: fixed contrast errors in masthead, footer, some list items, and search input field
- a11y: various accessibility adjustments to shortcodes
- fix: content css bugfixes
- fix: added check for $post to mitigate error on child theme
- fix: error mitigation for activating audience menu
- cleanup: reorganized assets


## 2021-01-25 - 1.2.0

- Allow youtube embeds in modal shorcodes
Expand Down
2 changes: 1 addition & 1 deletion assets/admin/css/bootstrap-shortcode-admin.css

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

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

Large diffs are not rendered by default.

26 changes: 9 additions & 17 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function uw_wp_theme_setup() {

// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );

// Add theme support for Gallery post format
add_theme_support( 'post-formats', array( 'gallery' ) );

Expand Down Expand Up @@ -267,7 +267,7 @@ function uw_wp_theme_resource_hints( $urls, $relation_type ) {
function uw_wp_theme_gutenberg_styles() {
$template_directory = get_bloginfo( 'template_directory' );
$theme_version = wp_get_theme( get_template( ) )->get( 'Version' );

// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'uw_wp_theme-fonts', uw_wp_theme_fonts_url(), array(), null ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion

Expand All @@ -280,10 +280,10 @@ function uw_wp_theme_gutenberg_styles() {
* Enqueue styles.
*/
function uw_wp_theme_styles() {

$template_directory = get_bloginfo( 'template_directory' );
$theme_version = wp_get_theme( get_template( ) )->get( 'Version' );

// Add custom fonts, used in the main stylesheet.
wp_enqueue_style( 'uw_wp_theme-fonts', uw_wp_theme_fonts_url(), array(), null ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion

Expand All @@ -295,7 +295,7 @@ function uw_wp_theme_styles() {
wp_enqueue_style( 'uw_wp_theme-content', $template_directory . '/css/content.css', array(), $theme_version );
wp_enqueue_style( 'uw_wp_theme-sidebar', $template_directory . '/css/sidebar.css', array(), $theme_version );
wp_enqueue_style( 'uw_wp_theme-widgets', $template_directory . '/css/widgets.css', array(), $theme_version );

}

add_action( 'wp_enqueue_scripts', 'uw_wp_theme_styles' );
Expand All @@ -304,18 +304,10 @@ function uw_wp_theme_styles() {
* Enqueue scripts.
*/
function uw_wp_theme_scripts() {

$template_directory = get_bloginfo( 'template_directory' );
$theme_version = wp_get_theme( get_template( ) )->get( 'Version' );

// Enqueue the navigation script.
wp_enqueue_script( 'uw_wp_theme-navigation', $template_directory . '/js/navigation.js', array(), $theme_version, false );

wp_script_add_data( 'uw_wp_theme-navigation', 'async', true );
wp_localize_script( 'uw_wp_theme-navigation', 'uw_wp_themeScreenReaderText', array(
'expand' => __( 'Expand child menu', 'uw_wp_theme' ),
'collapse' => __( 'Collapse child menu', 'uw_wp_theme' ),
));

// Add jQuery, Bootstrap, and popper.js scripts.
wp_deregister_script( 'jquery' ); // deregister first, just in case.
Expand All @@ -335,10 +327,10 @@ function uw_wp_theme_scripts() {

wp_script_add_data( 'uw_wp_theme-skip-link-focus-fix', 'defer', true );

// Enqueue left-to-right-arrow-nav script.
wp_enqueue_script( 'uw_wp_theme-left-to-right-arrow-nav', $template_directory . '/js/left-to-right-arrow-nav.js', array(), $theme_version, false );
// Enqueue additional navmenu keyboard accessibility script.
wp_enqueue_script( 'uw_wp_theme-keyboard-navmenu', $template_directory . '/js/keyboard-navmenu.js', array(), $theme_version, false );

wp_script_add_data( 'uw_wp_theme-left-to-right-arrow-nav', 'defer', true );
wp_script_add_data( 'uw_wp_theme-keyboard-navmenu', 'defer', true );

}
add_action( 'wp_enqueue_scripts', 'uw_wp_theme_scripts' );
Expand Down
8 changes: 4 additions & 4 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
} ?>
<div id="page-inner">
<header id="masthead" class="site-header">
<nav class="navbar navbar-expand-lg">
<div class="navbar navbar-expand-lg">
<div class="navbar-brand site-branding">
<a href="http://uw.edu" title="University of Washington Home" class="uw-patch">University of Washington</a>
<a href="http://uw.edu" title="University of Washington Home" class="uw-wordmark" tabindex="-1" aria-hidden="true">University of Washington</a>
Expand All @@ -55,9 +55,9 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="15.63px" height="69.13px" viewBox="0 0 15.63 69.13" enable-background="new 0 0 15.63 69.13" xml:space="preserve" focusable="false"><polygon fill="#FFFFFF" points="12.8,7.776 12.803,7.773 5.424,0 3.766,1.573 9.65,7.776 3.766,13.98 5.424,15.553 12.803,7.78"/><polygon fill="#FFFFFF" points="9.037,61.351 9.036,61.351 14.918,55.15 13.26,53.577 7.459,59.689 1.658,53.577 0,55.15 5.882,61.351 5.882,61.351 5.884,61.353 0,67.557 1.658,69.13 7.459,63.019 13.26,69.13 14.918,67.557 9.034,61.353"/></svg>
</button>
<?php } ?>
</div><!-- search-quicklinks -->
</div><!-- #site-navigation -->
</nav><!-- .navbar.navbar-expand-lg -->
</div><!-- search-quicklinks -->
</div><!-- #site-navigation -->
</div><!-- .navbar.navbar-expand-lg -->
</header><!-- #masthead -->

<?php
Expand Down
4 changes: 2 additions & 2 deletions inc/nav/purplebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function install_default_purple_bar_menu()
// then set that ID as the menu-item-parent-id for each child. Then save each child.
foreach ( $this->menu_items as $menu_name => $menu_attributes ) {

$children = $menu_attributes['children'];
$children = isset( $menu_attributes['children'] ) ? $menu_attributes['children'] : NULL;

unset( $menu_attributes['children'] );

Expand Down Expand Up @@ -81,7 +81,7 @@ function add_menu_item( $name, $url, $parent=null )
{
$item['menu-item-title'] = $name;
$item['menu-item-url'] = $url;
$item['menu-item-status'] = self::DEFAULT_STATUS;
$item['menu-item-status'] = self::DEFAULT_STATUS;


if ( $parent )
Expand Down
12 changes: 6 additions & 6 deletions inc/nav/quicklinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function __construct() {
function register_quick_links_menu() {
register_nav_menu( self::LOCATION, __( self::NAME ) );
}

public static function template_menu() {
if ( is_multisite() ) switch_to_blog( self::ALLOWED_BLOG );

Expand All @@ -35,22 +35,22 @@ public static function template_menu() {
}

if ( is_multisite() ) restore_current_blog();

$biglinks = '';
$littlelinks = '';
if ( isset( $items ) && ( is_array( $items ) || is_object($items) ) ) {
foreach ( $items as $index => $item ) {
// Only keep the necessary keys of the $item.
if ( ! empty( $item->classes[0] ) ) {
$biglinks .= '<li><span class="' . $item->classes[0] . '"></span><a href="' . $item->url . '" tabindex="-1">' . $item->title . '</a></li>';
$biglinks .= '<li><span class="' . $item->classes[0] . '"></span><a href="' . $item->url . '" tabindex="0">' . $item->title . '</a></li>';
} else {
$littlelinks .= '<li><a href="' . $item->url . '" tabindex="-1">' . $item->title . '</a></li>';
$littlelinks .= '<li><a href="' . $item->url . '" tabindex="0">' . $item->title . '</a></li>';

}
}
$quicklinks = '<ul id="big-links">' . $biglinks . '</ul>';
$quicklinks .= '<h3>Helpful Links</h3> <ul id="little-links">' . $littlelinks . '</ul>';

return $quicklinks;
} else {
return null;
Expand Down
12 changes: 7 additions & 5 deletions inc/nav/sidebar.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php
if ( ! function_exists('uw_sidebar_menu') ) :

function uw_sidebar_menu()
{
global $post;
if ( get_post_meta( $post->ID, "sidebar_nav", true ) ) return;

echo sprintf( '<nav id="desktop-relative" aria-label="mobile menu that is not visible in the desktop version">%s</nav>', uw_list_pages() ) ;
if ( isset( $post ) && get_post_meta( $post->ID, 'sidebar_nav', true ) ) {
return;
}

echo sprintf( '<nav id="desktop-relative" aria-label="sidebar menu">%s</nav>', uw_list_pages() ) ;
}

endif;
if ( ! function_exists( 'uw_list_pages') ) :

Expand Down
2 changes: 1 addition & 1 deletion inc/shortcodes/class.modal-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function uw_modal_shortcode( $atts, $content = null ) {
<div class="modal-dialog <?php echo esc_attr( $width_class ); ?> <?php echo 'true' === $modal_atts['scroll'] ? esc_attr( 'modal-dialog-scrollable' ) : ''; ?> <?php echo 'center' === $modal_atts['position'] ? esc_attr( 'modal-dialog-centered' ) : ''; ?>" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="<?php echo esc_attr( $modal_id ); ?>Title"><?php echo esc_attr( $modal_atts['title'] ); ?></h5>
<h2 class="h5 modal-title" id="<?php echo esc_attr( $modal_id ); ?>Title"><?php echo esc_attr( $modal_atts['title'] ); ?></h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
Expand Down
8 changes: 4 additions & 4 deletions inc/shortcodes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function uw_wp_theme_shortcodes() {

// If this is the admin page, do nothing.
// if ( is_admin() ) {
// return;
// return;
// }

$parent = get_template_directory() . '/inc/shortcodes/';
Expand Down Expand Up @@ -66,7 +66,7 @@ function uw_wp_theme_shortcodes() {
*/
function uw_wp_theme_enqueue_shortcodes() {
$template_directory = get_bloginfo( 'template_directory' );
$theme_version = wp_get_theme( get_template( ) )->get( 'Version' );
wp_enqueue_script( 'uw_wp_theme-custom-link-script', $template_directory. '/js/shortcodes/custom-link.js', array( 'jquery', 'uw_wp_theme-popper' ), $theme_version, true );
$theme_version = wp_get_theme(get_template( ) )->get( 'Version');

wp_enqueue_script( 'uw_wp_theme-custom-link-script', $template_directory . '/js/shortcodes/custom-link.js', array( 'jquery', 'uw_wp_theme-popper' ), $theme_version, true );
}
Loading

0 comments on commit e2cfdbc

Please sign in to comment.