2323
2424<template >
2525 <section >
26- <NcSettingsSection class =" theming" :title =" t('theming', 'Appearance and accessibility')" >
26+ <NcSettingsSection :title =" t('theming', 'Appearance and accessibility')"
27+ :limit-width =" false"
28+ class =" theming" >
2729 <p v-html =" description" />
2830 <p v-html =" descriptionDetail" />
2931
4850 @change =" changeFont" />
4951 </div >
5052 </NcSettingsSection >
53+
54+ <NcSettingsSection :title =" t('theming', 'Keyboard shortcuts')" >
55+ <p >{{ t('theming', 'In some cases keyboard shortcuts can interfer with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.') }}</p >
56+ <NcCheckboxRadioSwitch class =" theming__preview-toggle"
57+ :checked.sync =" shortcutsDisabled"
58+ name =" shortcuts_disabled"
59+ type =" switch"
60+ @change =" changeShortcutsDisabled" >
61+ {{ t('theming', 'Disable all keyboard shortcuts') }}
62+ </NcCheckboxRadioSwitch >
63+ </NcSettingsSection >
64+
5165 <NcSettingsSection :title =" t('theming', 'Background')"
5266 class =" background" >
5367 <p >{{ t('theming', 'Set a custom background') }}</p >
6377import { generateOcsUrl , imagePath } from ' @nextcloud/router'
6478import { loadState } from ' @nextcloud/initial-state'
6579import axios from ' @nextcloud/axios'
80+ import NcCheckboxRadioSwitch from ' @nextcloud/vue/dist/Components/NcCheckboxRadioSwitch'
6681import NcSettingsSection from ' @nextcloud/vue/dist/Components/NcSettingsSection'
6782
6883import BackgroundSettings from ' ./components/BackgroundSettings.vue'
@@ -72,6 +87,7 @@ import { getBackgroundUrl } from '../src/helpers/getBackgroundUrl.js'
7287
7388const availableThemes = loadState (' theming' , ' themes' , [])
7489const enforceTheme = loadState (' theming' , ' enforceTheme' , ' ' )
90+ const shortcutsDisabled = loadState (' theming' , ' shortcutsDisabled' , false )
7591
7692const background = loadState (' theming' , ' background' )
7793const backgroundVersion = loadState (' theming' , ' backgroundVersion' )
@@ -84,6 +100,7 @@ export default {
84100 name: ' UserThemes' ,
85101 components: {
86102 ItemPreview,
103+ NcCheckboxRadioSwitch,
87104 NcSettingsSection,
88105 BackgroundSettings,
89106 },
@@ -92,6 +109,7 @@ export default {
92109 return {
93110 availableThemes,
94111 enforceTheme,
112+ shortcutsDisabled,
95113 background,
96114 themingDefaultBackground,
97115 }
@@ -151,9 +169,17 @@ export default {
151169 return ' <a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">'
152170 },
153171 },
172+
154173 mounted () {
155174 this .updateGlobalStyles ()
156175 },
176+
177+ watch: {
178+ shortcutsDisabled (newState ) {
179+ this .changeShortcutsDisabled (newState)
180+ },
181+ },
182+
157183 methods: {
158184 updateBackground (data ) {
159185 this .background = (data .type === ' custom' || data .type === ' default' ) ? data .type : data .value
@@ -212,6 +238,29 @@ export default {
212238 this .selectItem (enabled, id)
213239 },
214240
241+ async changeShortcutsDisabled (newState ) {
242+ if (newState) {
243+ await axios ({
244+ url: generateOcsUrl (' apps/provisioning_api/api/v1/config/users/{appId}/{configKey}' , {
245+ appId: ' theming' ,
246+ configKey: ' shortcuts_disabled' ,
247+ }),
248+ data: {
249+ configValue: ' yes' ,
250+ },
251+ method: ' POST' ,
252+ })
253+ } else {
254+ await axios ({
255+ url: generateOcsUrl (' apps/provisioning_api/api/v1/config/users/{appId}/{configKey}' , {
256+ appId: ' theming' ,
257+ configKey: ' shortcuts_disabled' ,
258+ }),
259+ method: ' DELETE' ,
260+ })
261+ }
262+ },
263+
215264 updateBodyAttributes () {
216265 const enabledThemesIDs = this .themes .filter (theme => theme .enabled === true ).map (theme => theme .id )
217266 const enabledFontsIDs = this .fonts .filter (font => font .enabled === true ).map (font => font .id )
0 commit comments