Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion web/app/themes/mitlib-parent/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ function setup_scripts_styles() {
// Hours bundle.
wp_register_script( 'hours-scrollStick', get_template_directory_uri() . '/js/hours.scrollStick.js', array( 'jquery-cookie' ), $theme_version, true );
wp_register_script( 'hours-stickyMenu', get_template_directory_uri() . '/js/sticky-hours.menu.js', array( 'jquery-sticky' ), $theme_version, true );
wp_register_script( 'parent-hours', get_template_directory_uri() . '/js/make.datepicker.js', array( 'jquery', 'gldatepickerJS', 'hours-scrollStick', 'hours-stickyMenu' ), $theme_version, true );
wp_register_script( 'moment', get_template_directory_uri() . '/js/libs/moment.min.js', array(), $theme_version, true );
wp_register_script( 'underscore', get_template_directory_uri() . '/js/libs/underscore.min.js', array(), $theme_version, true );
wp_register_script( 'hours-loader', get_template_directory_uri() . '../../../plugins/mitlib-pull-hours/js/hours-loader.js', array(), $theme_version, true );
wp_register_script( 'parent-hours', get_template_directory_uri() . '/js/make.datepicker.js', array( 'jquery', 'gldatepickerJS', 'hours-scrollStick', 'hours-stickyMenu', 'underscore', 'moment', 'hours-loader' ), $theme_version, true );

// Search bundle.
wp_register_script( 'search-discovery', get_template_directory_uri() . '/js/ga_discovery.js', array(), $theme_version, false );
Expand Down Expand Up @@ -209,6 +212,7 @@ function setup_scripts_styles() {
wp_enqueue_script( 'parent-guides-home' );
wp_enqueue_script( 'parent-hours-home' );
wp_enqueue_script( 'parent-search' );
wp_enqueue_script( 'parent-hours' );
}

/**
Expand Down Expand Up @@ -237,6 +241,10 @@ function setup_scripts_styles() {
wp_enqueue_script( 'parent-hours' );
}

if ( is_page_template( 'templates/page-location-2021.php' ) || is_page_template( 'templates/page-location.php' ) ) {
wp_enqueue_script( 'parent-hours' );
}

if ( is_page( 'locations' ) ) {
wp_enqueue_script( 'parent-map' );
}
Expand Down Expand Up @@ -377,6 +385,26 @@ function mitlib_sidebars_init() {
)
);

register_sidebar( array(
'name' => __( 'Location Hours Area', 'twentytwelve' ),
'id' => 'sidebar-location-hours',
'description' => __( 'Appears on library location pages, displaying a widget which displays the current hours for arbitrary locations. This enables a single location to display multiple sets of hours.', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s" role="complementary">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );

register_sidebar( array(
'name' => __( 'Below Hours Grid Area', 'twentytwelve' ),
'id' => 'sidebar-below-hours-grid',
'description' => __( 'Appears below the grid of library hours, allowing for widgets to describe locations that do not appear on the grid.', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s locations-more" role="complementary">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );

}
add_action( 'widgets_init', 'Mitlib\Parent\mitlib_sidebars_init' );

Expand Down