|
3 | 3 | * SPDX-License-Identifier: AGPL-3.0-or-later |
4 | 4 | */ |
5 | 5 | import { loadState } from '@nextcloud/initial-state' |
| 6 | +import { initialize } from './oca.text' |
6 | 7 |
|
7 | 8 | // eslint-disable-next-line import/no-unresolved, n/no-missing-import |
8 | 9 | import 'vite/modulepreload-polyfill' |
9 | 10 |
|
| 11 | +initialize() |
| 12 | + |
10 | 13 | const workspaceAvailable = loadState('text', 'workspace_available') |
11 | | -const workspaceEnabled = loadState('text', 'workspace_enabled') |
12 | | -const openReadOnlyEnabled = loadState('text', 'open_read_only_enabled') |
13 | 14 |
|
14 | 15 | document.addEventListener('DOMContentLoaded', async () => { |
15 | | - if (workspaceAvailable && OCA && OCA?.Files?.Settings) { |
| 16 | + if (workspaceAvailable && window.OCA && window.OCA.Files?.Settings) { |
16 | 17 | const { default: Vue } = await import('vue') |
17 | 18 | const { default: FilesSettings } = await import('./views/FilesSettings.vue') |
18 | 19 |
|
19 | 20 | const vm = new Vue({ |
20 | 21 | render: (h) => h(FilesSettings, {}), |
21 | 22 | }) |
22 | 23 | const el = vm.$mount().$el |
23 | | - OCA.Files.Settings.register( |
24 | | - new OCA.Files.Settings.Setting('text', { |
| 24 | + window.OCA.Files.Settings.register( |
| 25 | + new window.OCA.Files.Settings.Setting('text', { |
25 | 26 | el: () => { |
26 | 27 | return el |
27 | 28 | }, |
28 | 29 | }), |
29 | 30 | ) |
30 | 31 | } |
31 | 32 | }) |
32 | | - |
33 | | -OCA.Text = { |
34 | | - RichWorkspaceEnabled: workspaceEnabled, |
35 | | - OpenReadOnlyEnabled: openReadOnlyEnabled, |
36 | | -} |
0 commit comments