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
2 changes: 2 additions & 0 deletions src/components/Assistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ import { FloatingMenu } from '@tiptap/vue-2'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import markdownit from '../markdownit/index.js'
import shouldInterpretAsMarkdown from '../markdownit/shouldInterpretAsMarkdown.js'
import { t } from '@nextcloud/l10n'

const limitInRange = (num, min, max) => {
return Math.min(Math.max(parseInt(num), parseInt(min)), parseInt(max))
Expand Down Expand Up @@ -436,6 +437,7 @@ export default {
floatingShow() {
return true
},
t,
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/CollisionResolveDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
import { useEditorMethods } from '../composables/useEditorMethods.ts'
import { useSyncService } from '../composables/useSyncService.ts'
import { useSaveService } from '../composables/useSaveService.ts'
import { t } from '@nextcloud/l10n'
export default {
name: 'CollisionResolveDialog',
components: {
Expand All @@ -55,6 +56,7 @@ export default {
setEditable,
saveService,
syncService,
t,
}
},
data() {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Editor.singleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export default async function getEditorInstance() {
}
const Editor = await import(/* webpackChunkName: "editor" */ './Editor.vue')
const { default: Vue } = await import('vue')
Vue.prototype.t = window.t
Vue.prototype.OCA = window.OCA
const EditorConstructor = Vue.extend(Editor.default)
window._nc_text_editor_instance = EditorConstructor
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ import { provideConnection } from '../composables/useConnection.ts'
import { Awareness } from 'y-protocols/awareness.js'
import { provideSyncService } from '../composables/useSyncService.ts'
import { provideSaveService } from '../composables/useSaveService.ts'
import { t } from '@nextcloud/l10n'

export default defineComponent({
name: 'Editor',
Expand Down
1 change: 1 addition & 0 deletions src/components/Editor/DocumentStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
import Lock from 'vue-material-design-icons/Lock.vue'
import isMobile from '../../mixins/isMobile.js'
import SyncStatus from './DocumentStatus/SyncStatus.vue'
import { t } from '@nextcloud/l10n'

export default {
name: 'DocumentStatus',
Expand Down
1 change: 1 addition & 0 deletions src/components/Editor/DocumentStatus/SyncStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { ERROR_TYPE } from '../../../services/SyncService.ts'
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
import { t } from '@nextcloud/l10n'

export default {
name: 'SyncStatus',
Expand Down
4 changes: 4 additions & 0 deletions src/components/Editor/EditorOutline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import TableOfContents from './TableOfContents.vue'
import { useOutlineStateMixin, useOutlineActions } from './Wrapper.provider.js'
import { Close } from './../icons.js'
import { useIsMobileMixin } from '../Editor.provider.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'EditorOutline',
Expand All @@ -39,6 +40,9 @@ export default {
useOutlineStateMixin,
useOutlineActions,
],
methods: {
t,
},
}
</script>

Expand Down
2 changes: 2 additions & 0 deletions src/components/Editor/GuestNameDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import { generateUrl } from '@nextcloud/router'
import AvatarWrapper from './AvatarWrapper.vue'
import { useSyncService } from '../../composables/useSyncService.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'GuestNameDialog',
Expand Down Expand Up @@ -72,6 +73,7 @@ export default {
updateBufferedGuestName() {
this.guestNameBuffered = this.guestName
},
t,
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Editor/PreviewOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'
import DotsVerticalIcon from 'vue-material-design-icons/DotsVertical.vue'
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
import OpenIcon from 'vue-material-design-icons/OpenInNew.vue'
import { t } from '@nextcloud/l10n'

export default {
name: 'PreviewOptions',
Expand Down Expand Up @@ -102,6 +103,7 @@ export default {
if (!this.href) return
window.open(this.href, '_blank').focus()
},
t,
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Editor/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { COLLABORATOR_DISCONNECT_TIME, COLLABORATOR_IDLE_TIME } from '../../serv
import { loadState } from '@nextcloud/initial-state'
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import { t } from '@nextcloud/l10n'

export default {
name: 'SessionList',
Expand Down Expand Up @@ -127,6 +128,7 @@ export default {
value: checked ? '1' : '0',
})
},
t,
},
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Editor/SmartPickerMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
<script>
import PlusIcon from 'vue-material-design-icons/Plus.vue'
import NcButton from '@nextcloud/vue/components/NcButton'
import { t } from '@nextcloud/l10n'

export default {
name: 'SmartPickerMenu',
components: {
PlusIcon,
NcButton,
},
methods: {
t,
}
}

</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Editor/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
import { useEditorFlags } from '../../composables/useEditorFlags.ts'
import refreshMoment from '../../mixins/refreshMoment.js'
import { useSaveService } from '../../composables/useSaveService.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'Status',
Expand Down Expand Up @@ -136,6 +137,7 @@ export default {
onEditorWidthChange(newWidth) {
this.$emit('editor-width-change', newWidth)
},
t,
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/HelpModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
import NcDialog from '@nextcloud/vue/components/NcDialog'
import { isMobilePlatform } from '../helpers/platform.js'
import { TRANSLATIONS, MODIFIERS } from './Menu/keys.js'
import { t } from '@nextcloud/l10n'

export default {
name: 'HelpModal',
Expand Down Expand Up @@ -304,6 +305,7 @@ export default {
},
},
methods: {
t,
toggleFormatted(style) {
this.formatted[style] = !this.formatted[style]
},
Expand Down
5 changes: 2 additions & 3 deletions src/components/Link/LinkBubbleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ import NcButton from '@nextcloud/vue/components/NcButton'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import NcTextField from '@nextcloud/vue/components/NcTextField'
import { NcReferenceList } from '@nextcloud/vue/dist/Components/NcRichText.js'
import { translate as t } from '@nextcloud/l10n'
import CheckIcon from 'vue-material-design-icons/Check.vue'
import CloseIcon from 'vue-material-design-icons/Close.vue'
import ContentCopyIcon from 'vue-material-design-icons/ContentCopy.vue'
import LinkOffIcon from 'vue-material-design-icons/LinkOff.vue'
import PencilIcon from 'vue-material-design-icons/Pencil.vue'
import { t } from '@nextcloud/l10n'

import CopyToClipboardMixin from '../../mixins/CopyToClipboardMixin.js'

Expand Down Expand Up @@ -193,8 +193,6 @@ export default {
},

methods: {
t,

resetBubble() {
this.edit = false
this.newHref = null
Expand Down Expand Up @@ -260,6 +258,7 @@ export default {
.run()
this.stopEdit()
},
t,
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/ActionAttachmentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import {
useActionCreateAttachmentMixin,
} from '../Editor/MediaHandler.provider.js'
import { useSyncService } from '../../composables/useSyncService.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'ActionAttachmentUpload',
Expand Down Expand Up @@ -126,6 +127,7 @@ export default {
createAttachment(template) {
this.$callCreateAttachment(template)
},
t,
},
}
</script>
4 changes: 4 additions & 0 deletions src/components/Menu/ActionFormattingHelp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { defineComponent } from 'vue'
import NextcloudVueNcActionButton from '@nextcloud/vue/components/NcActionButton'
import { Help } from '../icons.js'
import { t } from '@nextcloud/l10n'

export default defineComponent({
// This component is used as a direct child of NcActions.
Expand All @@ -29,5 +30,8 @@ export default defineComponent({
NextcloudVueNcActionButton,
Help,
},
methods: {
t,
}
})
</script>
2 changes: 2 additions & 0 deletions src/components/Menu/ActionInsertLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import { BaseActionEntry } from './BaseActionEntry.js'
import { useFileMixin } from '../Editor.provider.ts'
import { useMenuIDMixin } from './MenuBar.provider.js'
import { buildFilePicker } from '../../helpers/filePicker.js'
import { t } from '@nextcloud/l10n'

export default {
name: 'ActionInsertLink',
Expand Down Expand Up @@ -211,6 +212,7 @@ export default {
console.error('Smart picker promise rejected', error)
})
},
t,
},
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { getActionState, getIsActive } from './utils.js'
import { useOutlineStateMixin } from '../Editor/Wrapper.provider.js'
import { useMenuIDMixin } from './MenuBar.provider.js'
import debounce from 'debounce'
import { t } from '@nextcloud/l10n'

export default {
name: 'ActionList',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import {
} from '../Editor.provider.ts'
import { useEditorFlags } from '../../composables/useEditorFlags.ts'
import { useEditor } from '../../composables/useEditor.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'MenuBar',
Expand Down Expand Up @@ -219,6 +220,7 @@ export default {
console.debug('translation click', state.selection, selectedText)
emit('text:translate-modal:show', { content: selectedText })
},
t,
},
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Menu/ReadonlyBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { ReadOnlyEditEntries, OutlineEntries } from './entries.js'
import ActionList from './ActionList.vue'
import ActionSingle from './ActionSingle.vue'
import ToolBarLogic from './ToolBarLogic.js'
import { t } from '@nextcloud/l10n'

export default defineComponent({
name: 'ReadonlyBar',
Expand All @@ -49,6 +50,9 @@ export default defineComponent({
entries: this.openReadOnly ? [...ReadOnlyEditEntries, ...OutlineEntries] : [...OutlineEntries],
}
},
methods: {
t,
}
})
</script>

Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import ActionInsertLink from './ActionInsertLink.vue'

import { MODIFIERS } from './keys.js'
import { isMobileDevice } from '../../helpers/isMobileDevice.js'
import { t } from '@nextcloud/l10n'

export const OutlineEntries = [{
key: 'outline',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

const t = window.t
import { t } from '@nextcloud/l10n'
const isMac = (navigator.userAgent.includes('Mac'))

const MODIFIERS = {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Modal/Translate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import NcSelect from '@nextcloud/vue/components/NcSelect'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import NcTextArea from '@nextcloud/vue/components/NcTextArea'
import { useIsMobileMixin } from '../Editor.provider.ts'
import { t } from '@nextcloud/l10n'

export default {
name: 'Translate',
Expand Down Expand Up @@ -220,6 +221,7 @@ export default {
this.disableFromLanguageSelect = false
this.autosize()
},
t,
},
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Suggestion/Emoji/EmojiList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</template>

<script>
import { translate as t } from '@nextcloud/l10n'
import { t } from '@nextcloud/l10n'
import { emojiAddRecent } from '@nextcloud/vue/functions/emoji'

export default {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Suggestion/LinkPicker/LinkPickerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<script>
import SuggestionListWrapper from '../SuggestionListWrapper.vue'
import { t } from '@nextcloud/l10n';

export default {
components: {
Expand All @@ -38,6 +39,7 @@ export default {
},
},
methods: {
t,
onKeyDown({ event }) {
// Ignore any key modifier combinations
return this.$refs.suggestionList?.onKeyDown({ event })
Expand Down
1 change: 1 addition & 0 deletions src/components/Suggestion/LinkPicker/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MenuEntries } from './../../Menu/entries.js'
import { getIsActive } from '../../Menu/utils.js'
import markdownit from '../../../markdownit/index.js'
import shouldInterpretAsMarkdown from '../../../markdownit/shouldInterpretAsMarkdown.js'
import { t } from '@nextcloud/l10n'

const suggestGroupFormat = t('text', 'Formatting')
const suggestGroupPicker = t('text', 'Smart picker')
Expand Down
2 changes: 2 additions & 0 deletions src/components/Suggestion/Mention/MentionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import { NcAutoCompleteResult } from '@nextcloud/vue'

import SuggestionListWrapper from '../SuggestionListWrapper.vue'
import { t } from '@nextcloud/l10n'

export default {
components: {
Expand All @@ -39,6 +40,7 @@ export default {
},
},
methods: {
t,
onKeyDown({ event }) {
// Ignore any key modifier combinations
return this.$refs.suggestionList?.onKeyDown({ event })
Expand Down
2 changes: 1 addition & 1 deletion src/components/Suggestion/SuggestionListWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</template>
<script>
import { translate as t } from '@nextcloud/l10n'
import { t } from '@nextcloud/l10n'

export default {
name: 'SuggestionListWrapper',
Expand Down
Loading
Loading