Files
nextcloud-server-mirror/core/src/OCP/accessibility.js
Andy Scherzinger 1f7e2ba599 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +02:00

29 lines
698 B
JavaScript

/**
* 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,
}