Skip to content

Commit afa1361

Browse files
committed
text-editor: adapt to latest upstream
1 parent 38ec5c4 commit afa1361

File tree

5 files changed

+17
-46
lines changed

5 files changed

+17
-46
lines changed

text-editor/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@
6161
"vue-template-compiler": "^2.6.12",
6262
"vuex": "^3.6.2"
6363
},
64-
"engines": {
65-
"node": ">=14 <=16"
66-
},
6764
"dependencies": {}
6865
}

text-editor/src/App.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
@close="clearLastError"
1010
/>
1111
</oc-notifications>
12-
<div class="uk-flex">
13-
<div class="uk-container uk-width-1-1">
12+
<div class="oc-flex">
13+
<div class="oc-container oc-width-1-1">
1414
<oc-textarea
1515
id="text-editor-input"
1616
label=""
1717
name="input"
1818
full-width
1919
:value="currentContent"
20-
class="uk-height-1-1"
20+
class="oc-height-1-1"
2121
:rows="20"
2222
:disabled="isReadOnly"
2323
@input="onType"
@@ -68,14 +68,14 @@ export default {
6868
const filePath = `/${this.$route.params.filePath.split('/').filter(Boolean).join('/')}`
6969
if (filePath === '') {
7070
this.$router.push({
71-
path: '/files'
71+
path: '/'
7272
})
7373
return
7474
}
7575
this.loadFile({
7676
filePath: filePath,
7777
client: this.$client,
78-
public: this.$route.name === 'text-editor-public',
78+
public: this.$route.params.contextRouteName === 'files-public-files',
7979
publicLinkPassword: this.publicLinkPassword
8080
8181
})

text-editor/src/TextEditorAppBar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
2-
<div id="text-editor-app-bar" class="uk-container oc-app-bar uk-width-1-1">
2+
<div id="text-editor-app-bar" class="oc-container oc-app-bar oc-width-1-1">
33
<oc-grid flex gutter="small">
4-
<div class="uk-width-auto">
4+
<div class="oc-width-auto">
55
<oc-button
66
id="text-editor-controls-save"
77
:disabled="!isTouched || isReadOnly"
@@ -11,10 +11,10 @@
1111
</oc-button>
1212
<oc-spinner v-if="isLoading" :aria-label="$gettext('Loading editor content')" />
1313
</div>
14-
<div class="uk-width-expand uk-text-center">
14+
<div class="oc-width-expand oc-text-center">
1515
<span id="text-editor-file-path">{{ currentFile }}</span>
1616
</div>
17-
<div class="uk-width-auto uk-text-right">
17+
<div class="oc-width-auto oc-text-right">
1818
<oc-button id="text-editor-controls-close" @click="closeApp">
1919
<oc-icon name="close" />
2020
</oc-button>

text-editor/src/index.js

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,11 @@ const name = 'Text Editor'
1111

1212
const routes = [
1313
{
14-
path: '/edit/:filePath*',
14+
path: '/:contextRouteName/:filePath*',
1515
components: {
1616
app: App
1717
},
18-
name: 'edit',
19-
meta: {
20-
title: name,
21-
patchCleanPath: true
22-
}
23-
},
24-
{
25-
path: '/public/:filePath*',
26-
components: {
27-
app: App
28-
},
29-
name: 'public',
18+
name: 'editor',
3019
meta: {
3120
title: name,
3221
patchCleanPath: true,
@@ -38,35 +27,19 @@ const routes = [
3827
const appInfo = {
3928
name: name,
4029
id: 'text-editor',
41-
icon: 'text',
30+
icon: 'file-text',
4231
isFileEditor: true,
4332
extensions: [
4433
{
4534
extension: 'txt',
46-
routeName: 'text-editor-edit',
47-
canBeDefault: true,
48-
newFileMenu: {
49-
menuTitle($gettext) {
50-
return $gettext('New plain text file')
51-
}
52-
},
53-
routes: [
54-
'files-personal',
55-
'files-favorites',
56-
'files-shared-with-others',
57-
'files-shared-with-me'
58-
]
59-
},
60-
{
61-
extension: 'txt',
62-
routeName: 'text-editor-public',
35+
routeName: 'text-editor-editor',
6336
canBeDefault: true,
37+
// newTab: true,
6438
newFileMenu: {
6539
menuTitle($gettext) {
66-
return $gettext('New plain text file')
40+
return $gettext('Plain text file')
6741
}
68-
},
69-
routes: ['files-public-list']
42+
}
7043
}
7144
]
7245
}

text-editor/src/store.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const actions = {
9393
commit('CURRENT_ETAG', null)
9494
commit('UPDATE_TEXT', null)
9595
commit('CURRENT_FILE', '')
96+
commit('ERROR', '')
9697
}
9798
}
9899

0 commit comments

Comments
 (0)