Commit 10856160 authored by David Suissa's avatar David Suissa
Browse files

Issue #3551183 by dydave: Admin Toolbar Search: Clean-up and refactoring of...

Issue #3551183 by dydave: Admin Toolbar Search: Clean-up and refactoring of 'module' and other files.
parent 393fbb21
Loading
Loading
Loading
Loading
Loading
+22 −12
Original line number Diff line number Diff line
@@ -4,29 +4,39 @@ Admin Toolbar Search provides a search field for administration pages.
Use the shortcut `Alt` + `a` for quick access.

For a full description of the module, visit the
[project page](https://www.drupal.org/project/admin_toolbar).
[project page][1].

Submit bug reports and feature suggestions, or track changes in the
[issue queue](https://www.drupal.org/project/issues/search/admin_toolbar).
[issue queue][2].

## Table of contents

- Requirements
- Installation
- Configuration
[[_TOC_]]

## Requirements

This module requires the following modules:

- [Admin Toolbar](https://www.drupal.org/project/admin_toolbar)
This module requires no module other than [Drupal core toolbar][3].

## Installation

Install as you would normally install a contributed Drupal module. For further
information, see
[Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules).
Install as you would normally install a contributed Drupal module.\
For further information, see [Installing Drupal Modules][4].

## Configuration

No configuration is needed.
### Display the search input in the tray of a toolbar item tab:

If enabled, instead of displaying the search text field directly in the toolbar, it displays a menu item in the toolbar so the user has to click on it to toggle the display of the tray containing the search field.

### Search focus keyboard shortcut: Alt + a

It is possible to immediately focus (jump to) the Admin Toolbar Search input field by pressing the keyboard combination of keys: Alt + a

If the keyboard shortcut `Alt + a` (enabled by default) enters in conflict with any existing shortcut combinations, then __it is recommended to disable this setting for now__, until it could be made configurable, see [Feature request #3087173: Allow shortcut keys to be configurable][5].


[1]: https://www.drupal.org/project/admin_toolbar
[2]: https://www.drupal.org/project/issues/search/admin_toolbar
[3]: https://www.drupal.org/docs/8/core/modules/toolbar/working-with-the-toolbar
[4]: https://www.drupal.org/docs/extending-drupal/installing-modules
[5]: https://www.drupal.org/project/admin_toolbar/issues/3087173
+4 −1
Original line number Diff line number Diff line
# Admin Toolbar Search module info file.
name: Admin Toolbar Search
description: Provides search of Admin Toolbar items.
description: Allows searching and filtering links in the Admin menu in the Toolbar.
package: Administration
type: module
# Provide support for three major Drupal core versions.
core_version_requirement: ^9.5 || ^10 || ^11
# Link to the module's configuration form.
configure: admin_toolbar_search.settings
dependencies:
  - drupal:toolbar
+7 −0
Original line number Diff line number Diff line
@@ -25,3 +25,10 @@ function admin_toolbar_search_update_8001() {
    ->set('enable_keyboard_shortcut', TRUE)
    ->save(TRUE);
}

/**
 * Module CSS and '.module' files refactoring requires cache rebuild.
 */
function admin_toolbar_search_update_8002() {
  drupal_flush_all_caches();
}
+8 −1
Original line number Diff line number Diff line
# Libraries for the Admin Toolbar Search module.

# The main library that provides the search functionality and styling.
search:
  css:
    theme:
      css/admin.toolbar_search.css: {}
      # Styles for the search tab, field, and autocomplete dropdown.
      css/admin_toolbar_search.css: {}
  js:
    # JavaScript to handle the autocomplete search functionality of menu links.
    js/admin_toolbar_search.js: {}
  dependencies:
    # Based on the JQuery autocomplete functionality used in core.
    - core/drupal.autocomplete

# A separate library to handle keyboard shortcuts for the search field.
search.keyboard_shortcut:
  js:
    js/admin_toolbar_search.keyboard_shortcut.js: {}
+3 −0
Original line number Diff line number Diff line
# Menu links for the Admin Toolbar Search module.

# Add Admin Toolbar Search settings page to the configuration menu.
admin_toolbar_search.settings:
  title: 'Admin Toolbar Search'
  description: 'Configure the Admin Toolbar Search module.'
Loading