Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->

<template>
<NcContent v-shortkey.once="['ctrl', 'f']"
<NcContent v-shortkey.once="disableKeyboardShortcuts ? null : ['ctrl', 'f']"
:class="{ 'icon-loading': loading, 'in-call': isInCall }"
app-name="talk"
@shortkey.native="handleAppSearch">
Expand Down Expand Up @@ -196,6 +196,10 @@ export default {
isOneToOne() {
return this.currentConversation?.type === CONVERSATION.TYPE.ONE_TO_ONE
},

disableKeyboardShortcuts() {
return OCP.Accessibility.disableKeyboardShortcuts()
},
},

watch: {
Expand Down
50 changes: 43 additions & 7 deletions src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-
-->
<template>
<div v-shortkey.push="['space']"
<div v-shortkey.push="disableKeyboardShortcuts ? null : ['space']"
@shortkey="handleShortkey">
<div class="buttons-bar">
<div class="network-connection-state">
Expand Down Expand Up @@ -59,7 +59,7 @@
</NcPopover>
</div>
<div id="muteWrapper">
<NcButton v-shortkey.once="['m']"
<NcButton v-shortkey.once="disableKeyboardShortcuts ? null : ['m']"
v-tooltip="audioButtonTooltip"
type="tertiary-no-background"
:aria-label="audioButtonAriaLabel"
Expand All @@ -80,7 +80,7 @@
class="volume-indicator"
:class="{'microphone-off': !showMicrophoneOn}" />
</div>
<NcButton v-shortkey.once="['v']"
<NcButton v-shortkey.once="disableKeyboardShortcuts ? null : ['v']"
v-tooltip="videoButtonTooltip"
type="tertiary-no-background"
:aria-label="videoButtonAriaLabel"
Expand Down Expand Up @@ -156,13 +156,13 @@
{{ t('spreed', 'Stop screensharing') }}
</NcActionButton>
</NcActions>
<NcButton v-shortkey.once="['r']"
v-tooltip="t('spreed', 'Lower hand (R)')"
<NcButton v-shortkey.once="disableKeyboardShortcuts ? null : ['r']"
v-tooltip="disableKeyboardShortcuts ? t('spreed', 'Lower hand') : t('spreed', 'Lower hand (R)')"
type="tertiary-no-background"
class="lower-hand"
:class="model.attributes.raisedHand.state ? '' : 'hidden-visually'"
:tabindex="model.attributes.raisedHand.state ? 0 : -1"
:aria-label="t('spreed', 'Lower hand (R)')"
:aria-label="disableKeyboardShortcuts ? t('spreed', 'Lower hand') : t('spreed', 'Lower hand (R)')"
@shortkey="toggleHandRaised"
@click.stop="toggleHandRaised">
<template #icon>
Expand Down Expand Up @@ -339,8 +339,14 @@ export default {
computed: {
raiseHandButtonLabel() {
if (!this.model.attributes.raisedHand.state) {
if (this.disableKeyboardShortcuts) {
return t('spreed', 'Raise hand')
}
return t('spreed', 'Raise hand (R)')
}
if (this.disableKeyboardShortcuts) {
return t('spreed', 'Lower hand')
}
return t('spreed', 'Lower hand (R)')
},

Expand Down Expand Up @@ -405,8 +411,23 @@ export default {
}
}

let content = ''
if (this.model.attributes.audioEnabled) {
if (this.disableKeyboardShortcuts) {
content = t('spreed', 'Mute audio')
} else {
content = t('spreed', 'Mute audio (M)')
}
} else {
if (this.disableKeyboardShortcuts) {
content = t('spreed', 'Unmute audio')
} else {
content = t('spreed', 'Unmute audio (M)')
}
}

return {
content: this.model.attributes.audioEnabled ? t('spreed', 'Mute audio (M)') : t('spreed', 'Unmute audio (M)'),
content,
show: false,
}
},
Expand Down Expand Up @@ -463,13 +484,25 @@ export default {
}

if (this.model.attributes.videoEnabled) {
if (this.disableKeyboardShortcuts) {
return t('spreed', 'Disable video')
}

return t('spreed', 'Disable video (V)')
}

if (!this.model.getWebRtc() || !this.model.getWebRtc().connection || this.model.getWebRtc().connection.getSendVideoIfAvailable()) {
if (this.disableKeyboardShortcuts) {
return t('spreed', 'Enable video')
}

return t('spreed', 'Enable video (V)')
}

if (this.disableKeyboardShortcuts) {
return t('spreed', 'Enable video - Your connection will be briefly interrupted when enabling the video for the first time')
}

return t('spreed', 'Enable video (V) - Your connection will be briefly interrupted when enabling the video for the first time')
},

Expand Down Expand Up @@ -646,6 +679,9 @@ export default {
return this.$store.getters.isGrid
},

disableKeyboardShortcuts() {
return OCP.Accessibility.disableKeyboardShortcuts()
},
},

watch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</span>
</template>
<div ref="contentEditable"
v-shortkey.once="['c']"
v-shortkey.once="disableKeyboardShortcuts ? null : ['c']"
:contenteditable="activeInput"
:placeHolder="placeholderText"
role="textbox"
Expand Down Expand Up @@ -208,6 +208,13 @@ export default {
required: true,
},
},

computed: {
disableKeyboardShortcuts() {
return OCP.Accessibility.disableKeyboardShortcuts()
},
},

data() {
return {
text: '',
Expand Down
7 changes: 6 additions & 1 deletion src/components/SettingsDialog/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
{{ t('spreed', 'Sounds for chat and call notifications can be adjusted in the personal settings.') }} ↗
</a>
</NcAppSettingsSection>
<NcAppSettingsSection id="shortcuts"
<NcAppSettingsSection v-if="!disableKeyboardShortcuts"
id="shortcuts"
:title="t('spreed', 'Keyboard shortcuts')">
<em>{{ t('spreed', 'Speed up your Talk experience with these quick shortcuts.') }}</em>

Expand Down Expand Up @@ -199,6 +200,10 @@ export default {
settingsUrl() {
return generateUrl('/settings/user/notifications')
},

disableKeyboardShortcuts() {
return OCP.Accessibility.disableKeyboardShortcuts()
},
},

mounted() {
Expand Down
6 changes: 5 additions & 1 deletion src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

<!-- sidebar toggle -->
<NcActions v-if="!isSidebar"
v-shortkey.once="['f']"
v-shortkey.once="disableKeyboardShortcuts ? null : ['f']"
class="top-bar__button"
:aria-label="t('spreed', 'Conversation actions')"
:container="container"
Expand Down Expand Up @@ -361,6 +361,10 @@ export default {
return !peer.sessionIds.length
} else return false
},

disableKeyboardShortcuts() {
return OCP.Accessibility.disableKeyboardShortcuts()
},
},

watch: {
Expand Down