@afeefa/vue-app 0.0.97 → 0.0.99
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.99
|
package/package.json
CHANGED
@@ -32,24 +32,6 @@
|
|
32
32
|
<v-icon>{{ strikeIcon }}</v-icon>
|
33
33
|
</v-btn>
|
34
34
|
|
35
|
-
<v-btn
|
36
|
-
small
|
37
|
-
:class="['menu-button', {'is-active': editorFocus && editor.isActive('heading', {level: 1})}]"
|
38
|
-
title="überschrift 1"
|
39
|
-
@click="editor.chain().focus().toggleHeading({level: 1}).run()"
|
40
|
-
>
|
41
|
-
<v-icon>{{ h1Icon }}</v-icon>
|
42
|
-
</v-btn>
|
43
|
-
|
44
|
-
<v-btn
|
45
|
-
small
|
46
|
-
:class="['menu-button', {'is-active': editorFocus && editor.isActive('heading', {level: 2})}]"
|
47
|
-
title="pberschrift 2"
|
48
|
-
@click="editor.chain().focus().toggleHeading({level: 2}).run()"
|
49
|
-
>
|
50
|
-
<v-icon>{{ h2Icon }}</v-icon>
|
51
|
-
</v-btn>
|
52
|
-
|
53
35
|
<v-btn
|
54
36
|
small
|
55
37
|
:class="['menu-button', {'is-active': editorFocus && editor.isActive('bulletList')}]"
|
@@ -80,10 +62,10 @@
|
|
80
62
|
<v-btn
|
81
63
|
small
|
82
64
|
class="menu-button"
|
83
|
-
:class="{ 'is-active': editorFocus &&
|
84
|
-
title="
|
85
|
-
color="
|
86
|
-
@click="
|
65
|
+
:class="{ 'is-active': editorFocus && editor.isActive('highlight', { color: '#00FF00' })}"
|
66
|
+
title="grün"
|
67
|
+
color="green--text"
|
68
|
+
@click="editor.chain().focus().toggleHighlight({ color: '#00FF00' }).run()"
|
87
69
|
>
|
88
70
|
<v-icon>$paletteIcon</v-icon>
|
89
71
|
</v-btn>
|
@@ -91,10 +73,21 @@
|
|
91
73
|
<v-btn
|
92
74
|
small
|
93
75
|
class="menu-button"
|
94
|
-
:class="{ 'is-active': editorFocus &&
|
76
|
+
:class="{ 'is-active': editorFocus && editor.isActive('highlight', { color: '#FF0000' })}"
|
95
77
|
title="rot"
|
96
78
|
color="red--text"
|
97
|
-
@click="
|
79
|
+
@click="editor.chain().focus().toggleHighlight({ color: '#FF0000' }).run()"
|
80
|
+
>
|
81
|
+
<v-icon>$paletteIcon</v-icon>
|
82
|
+
</v-btn>
|
83
|
+
|
84
|
+
<v-btn
|
85
|
+
small
|
86
|
+
class="menu-button"
|
87
|
+
:class="{ 'is-active': editorFocus && editor.isActive('highlight', { color: '#FFFF00' })}"
|
88
|
+
title="gelb"
|
89
|
+
color="yellow--text"
|
90
|
+
@click="editor.chain().focus().toggleHighlight({ color: '#FFFF00' }).run()"
|
98
91
|
>
|
99
92
|
<v-icon>$paletteIcon</v-icon>
|
100
93
|
</v-btn>
|
@@ -141,7 +134,7 @@ import {
|
|
141
134
|
mdiRotateRight
|
142
135
|
} from '@mdi/js'
|
143
136
|
import { Color } from '@tiptap/extension-color'
|
144
|
-
import
|
137
|
+
import Highlight from '@tiptap/extension-highlight'
|
145
138
|
|
146
139
|
@Component({
|
147
140
|
props: ['value', 'validator', 'focus'],
|
@@ -183,7 +176,7 @@ export default class ARichTextArea extends Vue {
|
|
183
176
|
autofocus: this.focus ? 'end' : false,
|
184
177
|
extensions: [
|
185
178
|
StarterKit,
|
186
|
-
|
179
|
+
Highlight.configure({ multicolor: true }),
|
187
180
|
Color
|
188
181
|
],
|
189
182
|
onUpdate: () => {
|
@@ -204,10 +197,6 @@ export default class ARichTextArea extends Vue {
|
|
204
197
|
this.editor.destroy()
|
205
198
|
}
|
206
199
|
|
207
|
-
editorSelectionIs (color) {
|
208
|
-
return this.editor.isActive('textStyle', { color: color })
|
209
|
-
}
|
210
|
-
|
211
200
|
/**
|
212
201
|
* reset the text area to disable the undo button
|
213
202
|
* e.g. after saving the form while keeping it open
|
@@ -5,6 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
|
7
7
|
class CascadingWindowEventDispatcher {
|
8
|
+
windowListeners = {}
|
8
9
|
listeners = {}
|
9
10
|
|
10
11
|
addEventListener (event, listener) {
|
@@ -12,9 +13,7 @@ class CascadingWindowEventDispatcher {
|
|
12
13
|
this.listeners[event] = []
|
13
14
|
}
|
14
15
|
|
15
|
-
if (!this.
|
16
|
-
this.listeners[event] = []
|
17
|
-
|
16
|
+
if (!this.windowListeners[event]) {
|
18
17
|
window.addEventListener(event, e => {
|
19
18
|
for (const listener of this.listeners[event]) {
|
20
19
|
const result = listener(e)
|
@@ -23,6 +22,8 @@ class CascadingWindowEventDispatcher {
|
|
23
22
|
}
|
24
23
|
}
|
25
24
|
})
|
25
|
+
|
26
|
+
this.windowListeners[event] = true
|
26
27
|
}
|
27
28
|
|
28
29
|
this.listeners[event].unshift(listener)
|