diff --git a/src/assets/markdown.scss b/src/assets/markdown.scss index 39eefd2f4c6..799561062b4 100644 --- a/src/assets/markdown.scss +++ b/src/assets/markdown.scss @@ -33,12 +33,10 @@ } pre { - width: calc(100% - var(--default-clickable-area)); padding: 4px; - margin: 2px 0; + margin: 0; border-radius: var(--border-radius); background-color: var(--color-background-dark); - overflow-x: auto; & code { margin: 0; diff --git a/src/components/ConversationSettings/ConversationSettingsDialog.vue b/src/components/ConversationSettings/ConversationSettingsDialog.vue index a7b8b3985ee..90f5eb96bc9 100644 --- a/src/components/ConversationSettings/ConversationSettingsDialog.vue +++ b/src/components/ConversationSettings/ConversationSettingsDialog.vue @@ -11,6 +11,7 @@ :open="showSettings" show-navigation legacy + no-version @update:open="handleHideSettings"> + :class="{ 'message-highlighted': isNewPollMessage }"> @@ -67,22 +65,6 @@ :reference-limit="1" reference-interactive-opt-in @interact-todo="handleInteraction" /> - - - - - @@ -170,7 +152,6 @@ import IconBellOffOutline from 'vue-material-design-icons/BellOffOutline.vue' import IconCancel from 'vue-material-design-icons/Cancel.vue' import IconCheck from 'vue-material-design-icons/Check.vue' import IconCheckAll from 'vue-material-design-icons/CheckAll.vue' -import IconContentCopy from 'vue-material-design-icons/ContentCopy.vue' import IconForumOutline from 'vue-material-design-icons/ForumOutline.vue' import IconReload from 'vue-material-design-icons/Reload.vue' import MessageQuote from '../../../../MessageQuote.vue' @@ -211,7 +192,6 @@ export default { IconCancel, IconCheck, IconCheckAll, - IconContentCopy, IconForumOutline, IconReload, }, @@ -267,8 +247,6 @@ export default { return { isEditing: false, showReloadButton: false, - currentCodeBlock: null, - copyButtonOffset: 0, } }, @@ -422,10 +400,6 @@ export default { } return t('spreed', 'You cannot send messages to this conversation at the moment') }, - - containsCodeBlocks() { - return this.message.message.includes('```') - }, }, watch: { @@ -447,42 +421,6 @@ export default { methods: { t, - getCodeBlocks() { - if (!this.containsCodeBlocks) { - return null - } - - return Array.from(this.$refs.messageMain?.querySelectorAll('pre')) - }, - - handleMarkdownMouseOver(event) { - const codeBlocks = this.getCodeBlocks() - if (!codeBlocks) { - return - } - const index = codeBlocks.findIndex((item) => item.contains(event.target)) - if (index !== -1) { - this.currentCodeBlock = index - const el = codeBlocks[index] - this.copyButtonOffset = `${el.offsetTop}px` - } - }, - - handleMarkdownMouseLeave() { - this.currentCodeBlock = null - this.copyButtonOffset = 0 - }, - - async copyCodeBlock() { - try { - const code = this.getCodeBlocks()[this.currentCodeBlock].textContent - await navigator.clipboard.writeText(code) - showSuccess(t('spreed', 'Code block copied to clipboard')) - } catch (error) { - showError(t('spreed', 'Code block could not be copied')) - } - }, - handleRetry() { if (this.sendingErrorCanRetry) { if (this.message.sendingFailure === 'failed-upload') { @@ -601,14 +539,6 @@ export default { &.markdown-message { position: relative; - .message-copy-code { - position: absolute; - top: 0; - inset-inline-end: calc(4px + var(--default-clickable-area)); - margin-top: 4px; - background-color: var(--color-background-dark); - } - :deep(.rich-text--wrapper) { // NcRichText is used with dir="auto", so internal text direction may vary // But we want to keep the alignment consistent with the rest of the UI diff --git a/src/components/SettingsDialog/SettingsDialog.vue b/src/components/SettingsDialog/SettingsDialog.vue index df32ec59a2a..033a8a0bbc4 100644 --- a/src/components/SettingsDialog/SettingsDialog.vue +++ b/src/components/SettingsDialog/SettingsDialog.vue @@ -147,13 +147,6 @@ - - -

- {{ t('spreed', 'Talk version: {version}', { version: talkVersion }) }} -

@@ -177,7 +170,7 @@ import NcKbd from '@nextcloud/vue/components/NcKbd' import IconFolderOpenOutline from 'vue-material-design-icons/FolderOpenOutline.vue' import IconMicrophoneOutline from 'vue-material-design-icons/MicrophoneOutline.vue' import { CHAT_STYLE, CONVERSATION, PRIVACY } from '../../constants.ts' -import { getTalkConfig, getTalkVersion } from '../../services/CapabilitiesManager.ts' +import { getTalkConfig } from '../../services/CapabilitiesManager.ts' import { useCustomSettings } from '../../services/SettingsAPI.ts' import { useActorStore } from '../../stores/actor.ts' import { useSettingsStore } from '../../stores/settings.ts' @@ -186,8 +179,6 @@ import { useSoundsStore } from '../../stores/sounds.js' const disableKeyboardShortcuts = OCP.Accessibility.disableKeyboardShortcuts() const settingsUrl = generateUrl('/settings/user/notifications') -const talkVersion = getTalkVersion() - const supportTypingStatus = getTalkConfig('local', 'chat', 'typing-privacy') !== undefined const supportStartWithoutMedia = getTalkConfig('local', 'call', 'start-without-media') !== undefined const supportConversationsListStyle = getTalkConfig('local', 'conversations', 'list-style') !== undefined @@ -218,10 +209,8 @@ export default { const { customSettingsSections } = useCustomSettings() return { - IS_DESKTOP, disableKeyboardShortcuts, settingsUrl, - talkVersion, settingsStore, soundsStore, supportTypingStatus, @@ -424,12 +413,3 @@ export default { }, } - -