diff options
Diffstat (limited to 'core/src/OCP/accessibility.js')
-rw-r--r-- | core/src/OCP/accessibility.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/src/OCP/accessibility.js b/core/src/OCP/accessibility.js new file mode 100644 index 00000000000..4a1399f3f96 --- /dev/null +++ b/core/src/OCP/accessibility.js @@ -0,0 +1,28 @@ +/** + * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import { loadState } from '@nextcloud/initial-state' + +/** + * Set the page heading + * + * @param {string} heading page title from the history api + * @since 27.0.0 + */ +export function setPageHeading(heading) { + const headingEl = document.getElementById('page-heading-level-1') + if (headingEl) { + headingEl.textContent = heading + } +} +export default { + /** + * @return {boolean} Whether the user opted-out of shortcuts so that they should not be registered + */ + disableKeyboardShortcuts() { + return loadState('theming', 'shortcutsDisabled', false) + }, + setPageHeading, +} |