diff --git a/package-lock.json b/package-lock.json index fb41542bce0..bd56b64dd21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,6 +67,7 @@ "@nextcloud/stylelint-config": "^3.0.1", "@nextcloud/webpack-vue-config": "^6.2.0", "@types/jest": "^29.5.14", + "@types/ua-parser-js": "^0.7.39", "@vue/test-utils": "^1.3.6", "@vue/tsconfig": "^0.5.1", "@vue/vue2-jest": "^29.2.6", @@ -4775,6 +4776,13 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/ua-parser-js": { + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", @@ -24716,6 +24724,12 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "@types/ua-parser-js": { + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==", + "dev": true + }, "@types/unist": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", diff --git a/package.json b/package.json index 927fcd996b5..a13f7284dfe 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "@nextcloud/stylelint-config": "^3.0.1", "@nextcloud/webpack-vue-config": "^6.2.0", "@types/jest": "^29.5.14", + "@types/ua-parser-js": "^0.7.39", "@vue/test-utils": "^1.3.6", "@vue/tsconfig": "^0.5.1", "@vue/vue2-jest": "^29.2.6", diff --git a/src/App.vue b/src/App.vue index 392f32b3e0b..d9faad79f8c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -50,7 +50,7 @@ import { leaveConversationSync } from './services/participantsService.js' import { useCallViewStore } from './stores/callView.js' import { useFederationStore } from './stores/federation.ts' import { useSidebarStore } from './stores/sidebar.js' -import { checkBrowser } from './utils/browserCheck.js' +import { checkBrowser } from './utils/browserCheck.ts' import { signalingKill } from './utils/webrtc/index.js' export default { diff --git a/src/FilesSidebarTabApp.vue b/src/FilesSidebarTabApp.vue index 69f8f36ffea..7b477a17632 100644 --- a/src/FilesSidebarTabApp.vue +++ b/src/FilesSidebarTabApp.vue @@ -43,7 +43,7 @@ import { getFileConversation } from './services/filesIntegrationServices.js' import { leaveConversationSync, } from './services/participantsService.js' -import { checkBrowser } from './utils/browserCheck.js' +import { checkBrowser } from './utils/browserCheck.ts' import CancelableRequest from './utils/cancelableRequest.js' import { signalingKill } from './utils/webrtc/index.js' diff --git a/src/PublicShareAuthRequestPasswordButton.vue b/src/PublicShareAuthRequestPasswordButton.vue index 10fd993e50f..3cd559b1f06 100644 --- a/src/PublicShareAuthRequestPasswordButton.vue +++ b/src/PublicShareAuthRequestPasswordButton.vue @@ -30,7 +30,7 @@ import { t } from '@nextcloud/l10n' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import { getPublicShareAuthConversationToken } from './services/publicShareAuthService.js' -import { checkBrowser } from './utils/browserCheck.js' +import { checkBrowser } from './utils/browserCheck.ts' export default { diff --git a/src/PublicShareSidebar.vue b/src/PublicShareSidebar.vue index 3997dc321f1..828c581348d 100644 --- a/src/PublicShareSidebar.vue +++ b/src/PublicShareSidebar.vue @@ -55,7 +55,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi import { leaveConversationSync, } from './services/participantsService.js' -import { checkBrowser } from './utils/browserCheck.js' +import { checkBrowser } from './utils/browserCheck.ts' import { signalingKill } from './utils/webrtc/index.js' export default { diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index e704f34e12f..bf753bf9a02 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -82,6 +82,7 @@ dir="auto" @keydown.esc="handleInputEsc" @keydown.ctrl.up="handleEditLastMessage" + @keydown.meta.up="handleEditLastMessage" @input="handleTyping" @paste="handlePastedFiles" @submit="handleSubmit" /> diff --git a/src/components/SettingsDialog/SettingsDialog.vue b/src/components/SettingsDialog/SettingsDialog.vue index 72b54222923..135d71453e2 100644 --- a/src/components/SettingsDialog/SettingsDialog.vue +++ b/src/components/SettingsDialog/SettingsDialog.vue @@ -144,7 +144,7 @@
-
Ctrl +
+
{{ CmdOrCtrl }} +
{{ t('spreed', 'Edit your last message') }}
@@ -156,7 +156,7 @@
-
Ctrl + F
+
{{ CmdOrCtrl }} + F
{{ t('spreed', 'Search') }}
@@ -219,6 +219,7 @@ import { useCustomSettings } from '../../services/SettingsAPI.ts' import { setUserConfig } from '../../services/settingsService.js' import { useSettingsStore } from '../../stores/settings.js' import { useSoundsStore } from '../../stores/sounds.js' +import { isMac } from '../../utils/browserCheck.ts' import { satisfyVersion } from '../../utils/satisfyVersion.ts' const serverVersion = loadState('core', 'config', {}).version ?? '29.0.0.0' @@ -246,8 +247,10 @@ export default { const soundsStore = useSoundsStore() const { customSettingsSections } = useCustomSettings() const isBackgroundBlurred = ref(isBackgroundBlurredState) + const CmdOrCtrl = isMac ? 'Cmd' : 'Ctrl' return { + CmdOrCtrl, settingsStore, soundsStore, supportTypingStatus, diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index 594dbbac5f5..70190388d70 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -108,7 +108,7 @@ import { useCallViewStore } from '../../stores/callView.js' import { useSettingsStore } from '../../stores/settings.js' import { useSoundsStore } from '../../stores/sounds.js' import { useTalkHashStore } from '../../stores/talkHash.js' -import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.js' +import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.ts' export default { name: 'CallButton', diff --git a/src/utils/browserCheck.js b/src/utils/browserCheck.ts similarity index 95% rename from src/utils/browserCheck.js rename to src/utils/browserCheck.ts index 2d1cf157d1b..3d98fa98395 100644 --- a/src/utils/browserCheck.js +++ b/src/utils/browserCheck.ts @@ -10,6 +10,13 @@ import { t } from '@nextcloud/l10n' const parser = new UAParser() const browser = parser.getBrowser() +const os = parser.getOS() + +/** + * Per-OS flags + */ + +export const isMac = os.name === 'Mac OS' /** * Per-browser flags and a major version diff --git a/src/utils/media/pipeline/MediaDevicesSource.js b/src/utils/media/pipeline/MediaDevicesSource.js index 572f532f1bd..105d11b5054 100644 --- a/src/utils/media/pipeline/MediaDevicesSource.js +++ b/src/utils/media/pipeline/MediaDevicesSource.js @@ -4,7 +4,7 @@ */ import TrackSource from './TrackSource.js' -import { isChromium } from '../../browserCheck.js' +import { isChromium } from '../../browserCheck.ts' import { mediaDevicesManager } from '../../webrtc/index.js' /** diff --git a/src/utils/webrtc/index.js b/src/utils/webrtc/index.js index 6ec7275d5ec..cb9436daac3 100644 --- a/src/utils/webrtc/index.js +++ b/src/utils/webrtc/index.js @@ -21,7 +21,7 @@ import BrowserStorage from '../../services/BrowserStorage.js' import { getTalkConfig } from '../../services/CapabilitiesManager.ts' import { fetchSignalingSettings } from '../../services/signalingService.js' import store from '../../store/index.js' -import { isSafari } from '../browserCheck.js' +import { isSafari } from '../browserCheck.ts' import CancelableRequest from '../cancelableRequest.js' import Signaling from '../signaling.js' import SignalingTypingHandler from '../SignalingTypingHandler.js' diff --git a/src/utils/webrtc/simplewebrtc/peer.js b/src/utils/webrtc/simplewebrtc/peer.js index 6c6626131cc..95ab36adf47 100644 --- a/src/utils/webrtc/simplewebrtc/peer.js +++ b/src/utils/webrtc/simplewebrtc/peer.js @@ -9,7 +9,7 @@ import adapter from 'webrtc-adapter' import webrtcSupport from 'webrtcsupport' import WildEmitter from 'wildemitter' -import { isSafari } from '../../../utils/browserCheck.js' +import { isSafari } from '../../browserCheck.ts' /** * @param {object} stream the stream object.