@windward/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Content/Blocks/Accordion.vue +12 -7
- package/components/Content/Blocks/BlockQuote.vue +3 -1
- package/components/Content/Blocks/ClickableIcons.vue +29 -27
- package/components/Content/Blocks/Email.vue +3 -1
- package/components/Content/Blocks/Feedback.vue +3 -12
- package/components/Content/Blocks/Image.vue +1 -1
- package/components/Content/Blocks/Math.vue +3 -1
- package/components/Content/Blocks/ScenarioChoice.vue +3 -1
- package/components/Content/Blocks/Tab.vue +3 -1
- package/components/Content/Blocks/UserUpload.vue +3 -1
- package/components/Settings/AccordionSettings.vue +1 -3
- package/components/Settings/BlockQuoteSettings.vue +1 -1
- package/components/Settings/ClickableIconsSettings.vue +1 -1
- package/components/Settings/EmailSettings.vue +1 -1
- package/components/Settings/FeedbackSettings.vue +3 -1
- package/components/Settings/MathSettings.vue +1 -1
- package/components/Settings/ScenarioChoiceSettings.vue +3 -1
- package/components/Settings/TabSettings.vue +1 -1
- package/components/Settings/UserUploadSettings.vue +1 -1
- package/components/utils/ContentViewer.vue +2 -1
- package/components/utils/FillInBlank/FillInTheBlanksManager.vue +20 -24
- package/components/utils/MathExpressionEditor.vue +82 -85
- package/components/utils/MathLiveWrapper.vue +3 -1
- package/components/utils/TinyMCEWrapper.vue +62 -17
- package/components/utils/glossary/CourseGlossaryForm.vue +1 -0
- package/config/tinymce.config.ts +313 -0
- package/helpers/tinymce/plugin.ts +32 -25
- package/i18n/en-US/components/utils/math_expression_editor.ts +11 -0
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/en-US/pages/index.ts +2 -0
- package/i18n/en-US/pages/plugins/error.ts +9 -0
- package/i18n/en-US/pages/plugins/index.ts +5 -0
- package/i18n/en-US/shared/settings.ts +1 -1
- package/i18n/es-ES/components/utils/math_expression_editor.ts +11 -0
- package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/es-ES/pages/index.ts +2 -0
- package/i18n/es-ES/pages/plugins/error.ts +9 -0
- package/i18n/es-ES/pages/plugins/index.ts +5 -0
- package/i18n/sv-SE/components/utils/math_expression_editor.ts +11 -0
- package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/sv-SE/pages/index.ts +2 -0
- package/i18n/sv-SE/pages/plugins/error.ts +8 -0
- package/i18n/sv-SE/pages/plugins/index.ts +5 -0
- package/package.json +1 -1
- package/pages/plugins/tinymce/_plugin.vue +79 -0
- package/plugin.js +10 -0
- package/test/Pages/Plugins/TinyMce.spec.js +23 -0
- package/test/__mocks__/componentsMock.js +0 -12
- package/test/mocks.js +1 -0
- package/config/tinymce.config.js +0 -136
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
flat
|
|
6
6
|
accordion
|
|
7
7
|
focusable
|
|
8
|
-
|
|
8
|
+
class="expansion-panels-container"
|
|
9
9
|
>
|
|
10
10
|
<v-expansion-panel
|
|
11
11
|
v-for="(item, itemIndex) in block.metadata.config.items"
|
|
12
12
|
:key="itemIndex"
|
|
13
13
|
>
|
|
14
|
-
<v-expansion-panel-header
|
|
14
|
+
<v-expansion-panel-header
|
|
15
|
+
class="expansion-panel-header"
|
|
16
|
+
color="primary"
|
|
17
|
+
>
|
|
15
18
|
{{
|
|
16
19
|
item.header === '' || item.header === null
|
|
17
20
|
? 'Item ' + (itemIndex + 1)
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
}}
|
|
20
23
|
</v-expansion-panel-header>
|
|
21
24
|
<v-expansion-panel-content
|
|
22
|
-
class="body"
|
|
25
|
+
class="expansion-panel-body"
|
|
23
26
|
:key="expansionPanelKey"
|
|
24
27
|
>
|
|
25
28
|
<v-container>
|
|
@@ -77,7 +80,9 @@ export default {
|
|
|
77
80
|
if (_.isEmpty(this.block.metadata.config.currentAccordion)) {
|
|
78
81
|
this.block.metadata.config.currentAccordion = 0
|
|
79
82
|
}
|
|
80
|
-
this.block.body =
|
|
83
|
+
this.block.body = this.$t(
|
|
84
|
+
'windward.core.shared.content_blocks.title.accordion'
|
|
85
|
+
)
|
|
81
86
|
},
|
|
82
87
|
data() {
|
|
83
88
|
return {
|
|
@@ -125,14 +130,14 @@ export default {
|
|
|
125
130
|
</script>
|
|
126
131
|
|
|
127
132
|
<style lang="scss" scoped>
|
|
128
|
-
.header {
|
|
133
|
+
.expansion-panel-header {
|
|
129
134
|
color: white;
|
|
130
135
|
margin-top: 1px;
|
|
131
136
|
}
|
|
132
|
-
.body {
|
|
137
|
+
.expansion-panel-body {
|
|
133
138
|
background: var(--v-surface-base);
|
|
134
139
|
}
|
|
135
|
-
|
|
140
|
+
.expansion-panels-container {
|
|
136
141
|
z-index: 0;
|
|
137
142
|
}
|
|
138
143
|
</style>
|
|
@@ -71,6 +71,35 @@ export default {
|
|
|
71
71
|
TextViewer,
|
|
72
72
|
},
|
|
73
73
|
extends: BaseContentBlock,
|
|
74
|
+
beforeMount() {
|
|
75
|
+
// Apply the default config
|
|
76
|
+
this.block.body = this.$t(
|
|
77
|
+
'windward.core.shared.content_blocks.title.clickable_icons'
|
|
78
|
+
)
|
|
79
|
+
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
80
|
+
this.block.metadata.config.items = []
|
|
81
|
+
}
|
|
82
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
83
|
+
this.block.metadata.config.title = ''
|
|
84
|
+
}
|
|
85
|
+
if (_.isEmpty(this.block.metadata.config.description)) {
|
|
86
|
+
this.block.metadata.config.description = ''
|
|
87
|
+
}
|
|
88
|
+
if (_.isEmpty(this.block.metadata.config.display)) {
|
|
89
|
+
this.block.metadata.config.display = {
|
|
90
|
+
show_title: false,
|
|
91
|
+
show_background: false,
|
|
92
|
+
round_icon: false,
|
|
93
|
+
italic_icon: false,
|
|
94
|
+
autocolor: true,
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (this.block.metadata.config.items.length) {
|
|
98
|
+
for (const index in this.block.metadata.config.items) {
|
|
99
|
+
this.block.metadata.config.items[index].active = false
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
74
103
|
data() {
|
|
75
104
|
return {}
|
|
76
105
|
},
|
|
@@ -146,33 +175,6 @@ export default {
|
|
|
146
175
|
}
|
|
147
176
|
},
|
|
148
177
|
},
|
|
149
|
-
beforeMount() {
|
|
150
|
-
// Apply the default config
|
|
151
|
-
this.block.body = 'clickable icons'
|
|
152
|
-
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
153
|
-
this.block.metadata.config.items = []
|
|
154
|
-
}
|
|
155
|
-
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
156
|
-
this.block.metadata.config.title = ''
|
|
157
|
-
}
|
|
158
|
-
if (_.isEmpty(this.block.metadata.config.description)) {
|
|
159
|
-
this.block.metadata.config.description = ''
|
|
160
|
-
}
|
|
161
|
-
if (_.isEmpty(this.block.metadata.config.display)) {
|
|
162
|
-
this.block.metadata.config.display = {
|
|
163
|
-
show_title: false,
|
|
164
|
-
show_background: false,
|
|
165
|
-
round_icon: false,
|
|
166
|
-
italic_icon: false,
|
|
167
|
-
autocolor: true,
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (this.block.metadata.config.items.length) {
|
|
171
|
-
for (const index in this.block.metadata.config.items) {
|
|
172
|
-
this.block.metadata.config.items[index].active = false
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
178
|
methods: {
|
|
177
179
|
isIcon(str) {
|
|
178
180
|
return str && _.isString(str) && str.indexOf('mdi-') === 0
|
|
@@ -231,7 +231,9 @@ export default {
|
|
|
231
231
|
if (_.isEmpty(this.block.metadata.config.activeEmail)) {
|
|
232
232
|
this.block.metadata.config.activeEmail = 0
|
|
233
233
|
}
|
|
234
|
-
this.block.body =
|
|
234
|
+
this.block.body = this.$t(
|
|
235
|
+
'windward.core.components.content.blocks.email.title'
|
|
236
|
+
)
|
|
235
237
|
},
|
|
236
238
|
data() {
|
|
237
239
|
return {
|
|
@@ -186,7 +186,9 @@ export default {
|
|
|
186
186
|
if (_.isEmpty(this.block.metadata.config.definition)) {
|
|
187
187
|
this.block.metadata.config.definition = {}
|
|
188
188
|
}
|
|
189
|
-
this.block.body =
|
|
189
|
+
this.block.body = this.$t(
|
|
190
|
+
'windward.core.components.content.blocks.feedback.feedback'
|
|
191
|
+
)
|
|
190
192
|
},
|
|
191
193
|
data() {
|
|
192
194
|
return {
|
|
@@ -318,14 +320,3 @@ export default {
|
|
|
318
320
|
},
|
|
319
321
|
}
|
|
320
322
|
</script>
|
|
321
|
-
<style scoped>
|
|
322
|
-
.question {
|
|
323
|
-
font-weight: bold;
|
|
324
|
-
}
|
|
325
|
-
.radio-group {
|
|
326
|
-
width: 100% !important;
|
|
327
|
-
}
|
|
328
|
-
.likert-radio {
|
|
329
|
-
margin-left: 55px;
|
|
330
|
-
}
|
|
331
|
-
</style>
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
<script>
|
|
80
80
|
import _ from 'lodash'
|
|
81
|
-
import DialogBox from '~/components/DialogBox'
|
|
81
|
+
import DialogBox from '~/components/DialogBox.vue'
|
|
82
82
|
import TextViewer from '~/components/Text/TextViewer'
|
|
83
83
|
import Crypto from '~/helpers/Crypto'
|
|
84
84
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
@@ -33,7 +33,9 @@ export default {
|
|
|
33
33
|
this.block = {}
|
|
34
34
|
}
|
|
35
35
|
if (_.isEmpty(this.block.body)) {
|
|
36
|
-
this.block.body =
|
|
36
|
+
this.block.body = this.$t(
|
|
37
|
+
'windward.core.shared.content_blocks.title.math'
|
|
38
|
+
)
|
|
37
39
|
}
|
|
38
40
|
if (_.isEmpty(this.block.metadata)) {
|
|
39
41
|
this.block.metadata = {}
|
|
@@ -202,7 +202,9 @@ export default {
|
|
|
202
202
|
},
|
|
203
203
|
beforeMount() {
|
|
204
204
|
// Apply the default config
|
|
205
|
-
this.block.body =
|
|
205
|
+
this.block.body = this.$t(
|
|
206
|
+
'windward.core.shared.content_blocks.title.scenario_choice'
|
|
207
|
+
)
|
|
206
208
|
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
207
209
|
this.block.metadata.config.items = []
|
|
208
210
|
}
|
|
@@ -49,7 +49,9 @@ export default {
|
|
|
49
49
|
},
|
|
50
50
|
extends: BaseContentBlock,
|
|
51
51
|
beforeMount() {
|
|
52
|
-
this.block.body =
|
|
52
|
+
this.block.body = this.$t(
|
|
53
|
+
'windward.core.shared.content_blocks.title.tab'
|
|
54
|
+
)
|
|
53
55
|
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
54
56
|
const defaultObject = {
|
|
55
57
|
tabHeader: '',
|
|
@@ -119,7 +119,9 @@ export default {
|
|
|
119
119
|
this.block = {}
|
|
120
120
|
}
|
|
121
121
|
if (_.isEmpty(this.block.body)) {
|
|
122
|
-
this.block.body =
|
|
122
|
+
this.block.body = this.$t(
|
|
123
|
+
'windward.core.shared.content_blocks.title.user_upload'
|
|
124
|
+
)
|
|
123
125
|
}
|
|
124
126
|
if (_.isEmpty(this.block.metadata)) {
|
|
125
127
|
this.block.metadata = {}
|
|
@@ -134,9 +134,7 @@ export default {
|
|
|
134
134
|
if (_.isEmpty(this.block.metadata.config.currentAccordion)) {
|
|
135
135
|
this.block.metadata.config.currentAccordion = 0
|
|
136
136
|
}
|
|
137
|
-
this.block.body = this.$t(
|
|
138
|
-
'windward.core.components.settings.accordion.accordion'
|
|
139
|
-
)
|
|
137
|
+
this.block.body = this.$t('windward.core.shared.content_blocks.title.accordion')
|
|
140
138
|
},
|
|
141
139
|
data() {
|
|
142
140
|
return {
|
|
@@ -171,7 +171,7 @@ export default {
|
|
|
171
171
|
this.block = {}
|
|
172
172
|
}
|
|
173
173
|
if (_.isEmpty(this.block.body)) {
|
|
174
|
-
this.block.body = '
|
|
174
|
+
this.block.body = this.$t('windward.core.shared.content_blocks.title.clickable_icons')
|
|
175
175
|
}
|
|
176
176
|
if (_.isEmpty(this.block.metadata)) {
|
|
177
177
|
this.block.metadata = {}
|
|
@@ -53,7 +53,9 @@ export default {
|
|
|
53
53
|
if (_.isEmpty(this.block.metadata.config.definition)) {
|
|
54
54
|
this.block.metadata.config.definition = {}
|
|
55
55
|
}
|
|
56
|
-
this.block.body =
|
|
56
|
+
this.block.body = this.$t(
|
|
57
|
+
'windward.core.components.content.blocks.feedback.feedback'
|
|
58
|
+
)
|
|
57
59
|
},
|
|
58
60
|
data() {
|
|
59
61
|
return {
|
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
this.block = {}
|
|
37
37
|
}
|
|
38
38
|
if (_.isEmpty(this.block.body)) {
|
|
39
|
-
this.block.body = '
|
|
39
|
+
this.block.body = this.$t('windward.core.shared.content_blocks.title.math')
|
|
40
40
|
}
|
|
41
41
|
if (_.isEmpty(this.block.metadata)) {
|
|
42
42
|
this.block.metadata = {}
|
|
@@ -231,7 +231,9 @@ export default {
|
|
|
231
231
|
this.block = {}
|
|
232
232
|
}
|
|
233
233
|
if (_.isEmpty(this.block.body)) {
|
|
234
|
-
this.block.body =
|
|
234
|
+
this.block.body = this.$t(
|
|
235
|
+
'windward.core.shared.content_blocks.title.scenario_choice'
|
|
236
|
+
)
|
|
235
237
|
}
|
|
236
238
|
if (_.isEmpty(this.block.metadata)) {
|
|
237
239
|
this.block.metadata = {}
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
this.block = {}
|
|
63
63
|
}
|
|
64
64
|
if (_.isEmpty(this.block.body)) {
|
|
65
|
-
this.block.body = '
|
|
65
|
+
this.block.body = this.$t('windward.core.shared.content_blocks.title.user_upload')
|
|
66
66
|
}
|
|
67
67
|
if (_.isEmpty(this.block.metadata)) {
|
|
68
68
|
this.block.metadata = {}
|
|
@@ -33,7 +33,8 @@ export default {
|
|
|
33
33
|
content = _.cloneDeep(this.value)
|
|
34
34
|
if (
|
|
35
35
|
MathHelper.containsMathML(content) ||
|
|
36
|
-
MathHelper.containsLatex(content)
|
|
36
|
+
MathHelper.containsLatex(content) ||
|
|
37
|
+
MathHelper.containSREnhancedLatex(content)
|
|
37
38
|
) {
|
|
38
39
|
content = MathHelper.convertMathContentToHtml(content)
|
|
39
40
|
}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-row align="center" justify="center">
|
|
4
|
-
<v-col>
|
|
5
|
-
<v-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
v-model="feedback"
|
|
25
|
-
@input="submit"
|
|
26
|
-
></TextEditor>
|
|
27
|
-
</v-row>
|
|
4
|
+
<v-col cols="12">
|
|
5
|
+
<v-text-field
|
|
6
|
+
:label="
|
|
7
|
+
$t(
|
|
8
|
+
'windward.core.components.utils.fill_in_the_blank.fill_in_the_blank_manager.answer'
|
|
9
|
+
)
|
|
10
|
+
"
|
|
11
|
+
v-model="answer"
|
|
12
|
+
outlined
|
|
13
|
+
@input="submit"
|
|
14
|
+
></v-text-field>
|
|
15
|
+
</v-col>
|
|
16
|
+
</v-row>
|
|
17
|
+
<v-row>
|
|
18
|
+
<v-col cols="12">
|
|
19
|
+
<TextEditor
|
|
20
|
+
:key="key"
|
|
21
|
+
v-model="feedback"
|
|
22
|
+
@input="submit"
|
|
23
|
+
></TextEditor>
|
|
28
24
|
</v-col>
|
|
29
25
|
</v-row>
|
|
30
26
|
</v-container>
|
|
@@ -8,18 +8,7 @@
|
|
|
8
8
|
)
|
|
9
9
|
}}
|
|
10
10
|
</v-card-title>
|
|
11
|
-
|
|
12
|
-
<math-live-wrapper
|
|
13
|
-
ref="mathfield"
|
|
14
|
-
v-model="formula"
|
|
15
|
-
:id="mathElementId"
|
|
16
|
-
:options="options"
|
|
17
|
-
:value="value"
|
|
18
|
-
@change="submit"
|
|
19
|
-
></math-live-wrapper>
|
|
20
|
-
</v-card-text>
|
|
21
|
-
</v-card>
|
|
22
|
-
<v-card>
|
|
11
|
+
|
|
23
12
|
<v-card-text>
|
|
24
13
|
<v-tabs
|
|
25
14
|
v-model="tab"
|
|
@@ -29,9 +18,7 @@
|
|
|
29
18
|
show-arrows
|
|
30
19
|
>
|
|
31
20
|
<v-tabs-slider color="primary"></v-tabs-slider>
|
|
32
|
-
|
|
33
|
-
{{ $t('shared.accessibility.accessibility') }}</v-tab
|
|
34
|
-
>
|
|
21
|
+
|
|
35
22
|
<v-tab
|
|
36
23
|
v-for="(keyboard, index) in config.buttons.groups"
|
|
37
24
|
:key="index"
|
|
@@ -41,80 +28,85 @@
|
|
|
41
28
|
</v-tabs>
|
|
42
29
|
|
|
43
30
|
<v-tabs-items v-model="tab">
|
|
44
|
-
<v-tab-item>
|
|
45
|
-
<v-card-text>
|
|
46
|
-
<v-container>
|
|
47
|
-
<v-row align="center">
|
|
48
|
-
<v-checkbox
|
|
49
|
-
v-model="spokenTextChanged"
|
|
50
|
-
hide-details
|
|
51
|
-
class="shrink mr-2 mt-0"
|
|
52
|
-
></v-checkbox>
|
|
53
|
-
<v-textarea
|
|
54
|
-
v-model="spokenText"
|
|
55
|
-
:disabled="!spokenTextChanged"
|
|
56
|
-
:label="
|
|
57
|
-
$t(
|
|
58
|
-
'shared.accessibility.set_aria_label_text'
|
|
59
|
-
)
|
|
60
|
-
"
|
|
61
|
-
class="col-md-12"
|
|
62
|
-
@input="submit"
|
|
63
|
-
></v-textarea>
|
|
64
|
-
</v-row>
|
|
65
|
-
</v-container>
|
|
66
|
-
|
|
67
|
-
<br />
|
|
68
|
-
<v-btn
|
|
69
|
-
primary
|
|
70
|
-
color="success"
|
|
71
|
-
@click="setSRText"
|
|
72
|
-
:class="fontSize"
|
|
73
|
-
>{{ $t('shared.accessibility.default_text') }}
|
|
74
|
-
</v-btn>
|
|
75
|
-
<v-btn
|
|
76
|
-
:disabled="spokenTextChanged"
|
|
77
|
-
color="primary"
|
|
78
|
-
:class="fontSize"
|
|
79
|
-
@click="readSRText"
|
|
80
|
-
>{{
|
|
81
|
-
$t(
|
|
82
|
-
'shared.accessibility.read_default_aria_label_text'
|
|
83
|
-
)
|
|
84
|
-
}}</v-btn
|
|
85
|
-
>
|
|
86
|
-
</v-card-text>
|
|
87
|
-
</v-tab-item>
|
|
88
31
|
<v-tab-item
|
|
89
32
|
v-for="(keyboard, index) in config.buttons.groups"
|
|
90
33
|
:key="index"
|
|
91
34
|
>
|
|
92
|
-
<v-
|
|
93
|
-
<
|
|
94
|
-
<v-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
button.text
|
|
108
|
-
)
|
|
109
|
-
"
|
|
110
|
-
></div>
|
|
111
|
-
</button>
|
|
112
|
-
</v-btn-toggle>
|
|
113
|
-
</v-container>
|
|
114
|
-
</v-card-text>
|
|
115
|
-
</v-card>
|
|
35
|
+
<v-container>
|
|
36
|
+
<div class="flex-wrap col-12">
|
|
37
|
+
<v-btn
|
|
38
|
+
:min-height="index < 4 ? 40 : 60"
|
|
39
|
+
v-for="(
|
|
40
|
+
button, buttonIndex
|
|
41
|
+
) in keyboard.buttons"
|
|
42
|
+
:key="buttonIndex"
|
|
43
|
+
class="btn"
|
|
44
|
+
@click="insert(button)"
|
|
45
|
+
v-html="convertLatexToMarkup(button.text)"
|
|
46
|
+
>
|
|
47
|
+
</v-btn>
|
|
48
|
+
</div>
|
|
49
|
+
</v-container>
|
|
116
50
|
</v-tab-item>
|
|
117
51
|
</v-tabs-items>
|
|
52
|
+
|
|
53
|
+
<math-live-wrapper
|
|
54
|
+
ref="mathfield"
|
|
55
|
+
v-model="formula"
|
|
56
|
+
:id="mathElementId"
|
|
57
|
+
:options="options"
|
|
58
|
+
:value="value"
|
|
59
|
+
@change="submit"
|
|
60
|
+
></math-live-wrapper>
|
|
61
|
+
<br />
|
|
62
|
+
<v-container>
|
|
63
|
+
<v-row align="center">
|
|
64
|
+
<v-switch
|
|
65
|
+
v-model="spokenTextChanged"
|
|
66
|
+
:label="
|
|
67
|
+
$t(
|
|
68
|
+
'windward.core.components.utils.math_expression_editor.custom_screen_reader_text'
|
|
69
|
+
)
|
|
70
|
+
"
|
|
71
|
+
hide-details
|
|
72
|
+
class="shrink mr-2 mt-0"
|
|
73
|
+
></v-switch>
|
|
74
|
+
<v-textarea
|
|
75
|
+
v-model="spokenText"
|
|
76
|
+
:disabled="!spokenTextChanged"
|
|
77
|
+
:label="
|
|
78
|
+
$t(
|
|
79
|
+
'windward.core.components.utils.math_expression_editor.screen_reader_text'
|
|
80
|
+
)
|
|
81
|
+
"
|
|
82
|
+
class="col-md-12"
|
|
83
|
+
@input="submit"
|
|
84
|
+
></v-textarea>
|
|
85
|
+
</v-row>
|
|
86
|
+
</v-container>
|
|
87
|
+
|
|
88
|
+
<br />
|
|
89
|
+
<v-row class="float-right">
|
|
90
|
+
<v-btn
|
|
91
|
+
primary
|
|
92
|
+
color="success"
|
|
93
|
+
@click="setSRText"
|
|
94
|
+
:class="fontSize"
|
|
95
|
+
>{{
|
|
96
|
+
$t(
|
|
97
|
+
'windward.core.components.utils.math_expression_editor.default_screen_reader_text'
|
|
98
|
+
)
|
|
99
|
+
}}
|
|
100
|
+
</v-btn>
|
|
101
|
+
|
|
102
|
+
<v-btn color="primary" :class="fontSize" @click="readSRText"
|
|
103
|
+
>{{
|
|
104
|
+
$t(
|
|
105
|
+
'windward.core.components.utils.math_expression_editor.read_text_aloud'
|
|
106
|
+
)
|
|
107
|
+
}}
|
|
108
|
+
</v-btn>
|
|
109
|
+
</v-row>
|
|
118
110
|
</v-card-text>
|
|
119
111
|
</v-card>
|
|
120
112
|
</div>
|
|
@@ -142,7 +134,7 @@ export default {
|
|
|
142
134
|
options: {
|
|
143
135
|
smartFence: true,
|
|
144
136
|
smartMode: false,
|
|
145
|
-
virtualKeyboardMode: '
|
|
137
|
+
virtualKeyboardMode: 'auto',
|
|
146
138
|
keypressSound: 'none',
|
|
147
139
|
plonkSound: 'none',
|
|
148
140
|
readOnly: false,
|
|
@@ -268,7 +260,12 @@ export default {
|
|
|
268
260
|
this.spokenText = this.convertLatexToSpeakableText(this.formula)
|
|
269
261
|
},
|
|
270
262
|
readSRText() {
|
|
271
|
-
this
|
|
263
|
+
if (!this.spokenText) {
|
|
264
|
+
this.$refs.mathfield.executeCommand('speak')
|
|
265
|
+
} else {
|
|
266
|
+
const utterance = new SpeechSynthesisUtterance(this.spokenText)
|
|
267
|
+
speechSynthesis.speak(utterance)
|
|
268
|
+
}
|
|
272
269
|
},
|
|
273
270
|
},
|
|
274
271
|
}
|