diff --git a/js/advanced_search.form.js b/js/advanced_search.form.js index 205ca1f..62f5c29 100644 --- a/js/advanced_search.form.js +++ b/js/advanced_search.form.js @@ -4,6 +4,11 @@ * Handles Ajax submission / updating form action on url change, etc. */ (function ($, Drupal, drupalSettings) { + // Replace Results per page html h3 tag with strong tag + jQuery('h3:contains("Results per page")').replaceWith(function(){ + return jQuery("", {html: jQuery(this).html()}); + }); + // Gets current parameters minus ones provided by the form. function getParams(query_parameter, recurse_parameter) { diff --git a/src/Form/AdvancedSearchForm.php b/src/Form/AdvancedSearchForm.php index 5eb2166..d71e140 100644 --- a/src/Form/AdvancedSearchForm.php +++ b/src/Form/AdvancedSearchForm.php @@ -289,6 +289,9 @@ class AdvancedSearchForm extends FormBase { // Only show on terms after the first. self::CONJUNCTION_FORM_FIELD => $first ? NULL : [ '#type' => 'select', + '#attributes' => [ + 'aria-label' => $this->t("Select search condition") + ], '#options' => [ self::AND_OP => $this->t('and'), self::OR_OP => $this->t('or'), @@ -297,11 +300,17 @@ class AdvancedSearchForm extends FormBase { ], self::SEARCH_FORM_FIELD => [ '#type' => 'select', + '#attributes' => [ + 'aria-label' => $this->t("Select search field"), + ], '#options' => $options, '#default_value' => $term_value[self::SEARCH_FORM_FIELD], ], self::INCLUDE_FORM_FIELD => [ '#type' => 'select', + '#attributes' => [ + 'aria-label' => $this->t("Select search operator"), + ], '#options' => [ self::IS_OP => $this->t('is'), self::NOT_OP => $this->t('is not'), @@ -331,6 +340,9 @@ class AdvancedSearchForm extends FormBase { ], self::VALUE_FORM_FIELD => [ '#type' => 'textfield', + '#attributes' => [ + 'aria-label' => $this->t("Enter a search term") + ], '#default_value' => $term_value[self::VALUE_FORM_FIELD], ], 'actions' => [ @@ -357,7 +369,8 @@ class AdvancedSearchForm extends FormBase { '#name' => 'remove-term-' . $i, '#term_index' => $i, '#attributes' => [ - 'class' => [$block_class_prefix . '__remove', 'fa'], + 'class' => [$block_class_prefix . '__remove', 'fa' ], + 'aria-label' => $this->t("Remove"), ], '#ajax' => [ 'callback' => [$this, 'ajaxCallback'], diff --git a/src/Plugin/Block/SearchResultsPagerBlock.php b/src/Plugin/Block/SearchResultsPagerBlock.php index d8f9b6b..06837b2 100644 --- a/src/Plugin/Block/SearchResultsPagerBlock.php +++ b/src/Plugin/Block/SearchResultsPagerBlock.php @@ -245,6 +245,7 @@ class SearchResultsPagerBlock extends BlockBase implements ContainerFactoryPlugi '#title' => Markup::create($text), '#attributes' => [ 'class' => $active ? ['pager__link', 'pager__link--is-active', 'pager__display'] : ['pager__link', 'pager__display'], + 'aria-label' => $this->t("Display as " . Markup::create($text)) ], '#wrapper_attributes' => [ 'class' => $active ? ['pager__item', 'is-active'] : ['pager__item'], @@ -303,7 +304,7 @@ class SearchResultsPagerBlock extends BlockBase implements ContainerFactoryPlugi '#title_display' => 'invisible', '#options' => $options, '#options_attributes' => $options_attributes, - '#attributes' => ['autocomplete' => 'off'], + '#attributes' => ['autocomplete' => 'off', "aria-label"=>"Sort By"], '#wrapper_attributes' => ['class' => ['pager__sort', 'container']], '#name' => 'order', '#value' => $default_value,