@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
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<div class="included">
|
|
4
|
+
<editor
|
|
5
|
+
:key="seed + config.skin"
|
|
6
|
+
v-model="text"
|
|
7
|
+
initial-value=""
|
|
8
|
+
:api-key="api_key"
|
|
9
|
+
:init="config"
|
|
10
|
+
tag-name="div"
|
|
11
|
+
model-events="change keydown blur focus mouseDown paste input submit SetContent"
|
|
12
|
+
@onfocus="onEditorFocus"
|
|
13
|
+
>
|
|
14
|
+
</editor>
|
|
15
|
+
</div>
|
|
16
|
+
<v-btn-toggle dense multiple class="pt-1 d-flex justify-end">
|
|
17
|
+
<v-btn v-if="render" color="primary" @click="onClickCollapse">{{
|
|
18
|
+
$t('windward.core.components.utils.tiny_mce_wrapper.minimize')
|
|
19
|
+
}}</v-btn>
|
|
20
|
+
</v-btn-toggle>
|
|
21
|
+
</div>
|
|
12
22
|
</template>
|
|
13
23
|
|
|
14
24
|
<script>
|
|
@@ -41,13 +51,10 @@ export default {
|
|
|
41
51
|
},
|
|
42
52
|
beforeMount() {
|
|
43
53
|
this.text = this.value
|
|
44
|
-
if (this.height !== null) {
|
|
45
|
-
this.config.height = this.height
|
|
46
|
-
}
|
|
47
54
|
},
|
|
48
55
|
data() {
|
|
49
56
|
return {
|
|
50
|
-
render:
|
|
57
|
+
render: false,
|
|
51
58
|
text: '',
|
|
52
59
|
seed: Crypto.id(),
|
|
53
60
|
}
|
|
@@ -58,14 +65,38 @@ export default {
|
|
|
58
65
|
},
|
|
59
66
|
},
|
|
60
67
|
computed: {
|
|
68
|
+
filteredMenubar() {
|
|
69
|
+
if (this.render) {
|
|
70
|
+
return this.menubar
|
|
71
|
+
} else {
|
|
72
|
+
return ''
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
filteredToolbar() {
|
|
76
|
+
if (this.render) {
|
|
77
|
+
return this.toolbar
|
|
78
|
+
} else {
|
|
79
|
+
return ''
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
filteredHeight() {
|
|
83
|
+
if (!this.render) {
|
|
84
|
+
return 50
|
|
85
|
+
} else if (this.height !== null) {
|
|
86
|
+
return this.height
|
|
87
|
+
} else {
|
|
88
|
+
return 500
|
|
89
|
+
}
|
|
90
|
+
},
|
|
61
91
|
config() {
|
|
62
92
|
return {
|
|
63
|
-
height:
|
|
93
|
+
height: this.filteredHeight,
|
|
64
94
|
visual: false,
|
|
65
95
|
forced_root_block: this.root_block,
|
|
66
|
-
menubar: this.
|
|
96
|
+
menubar: this.filteredMenubar,
|
|
67
97
|
browser_spellcheck: true,
|
|
68
98
|
contextmenu: false,
|
|
99
|
+
statusbar: false,
|
|
69
100
|
menu: {
|
|
70
101
|
insert: {
|
|
71
102
|
title: 'Insert',
|
|
@@ -86,7 +117,7 @@ export default {
|
|
|
86
117
|
'anchor insertdatetime ',
|
|
87
118
|
'paste code wordcount table WindwardToolKit',
|
|
88
119
|
],
|
|
89
|
-
toolbar: this.
|
|
120
|
+
toolbar: this.filteredToolbar,
|
|
90
121
|
table_advtab: false,
|
|
91
122
|
table_cell_advtab: false,
|
|
92
123
|
table_row_advtab: false,
|
|
@@ -254,5 +285,19 @@ export default {
|
|
|
254
285
|
}
|
|
255
286
|
},
|
|
256
287
|
},
|
|
288
|
+
methods: {
|
|
289
|
+
onEditorFocus() {
|
|
290
|
+
if (!this.render) {
|
|
291
|
+
this.seed = Crypto.id()
|
|
292
|
+
this.render = true
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
onClickCollapse() {
|
|
296
|
+
if (this.render) {
|
|
297
|
+
this.seed = Crypto.id()
|
|
298
|
+
this.render = false
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
},
|
|
257
302
|
}
|
|
258
303
|
</script>
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
plugins: [
|
|
3
|
+
{
|
|
4
|
+
name: 'math',
|
|
5
|
+
tag: 'plugin-core-math-expression-editor',
|
|
6
|
+
buttons: {
|
|
7
|
+
groups: [
|
|
8
|
+
{
|
|
9
|
+
name: 'windward.core.components.utils.math_expression_editor.basic',
|
|
10
|
+
buttons: [
|
|
11
|
+
{
|
|
12
|
+
cmd: false,
|
|
13
|
+
text: 'x',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
cmd: false,
|
|
17
|
+
text: 'y',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
cmd: false,
|
|
21
|
+
text: 'e',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
cmd: false,
|
|
25
|
+
text: 'i',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
cmd: false,
|
|
29
|
+
text: '\\pi',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
cmd: true,
|
|
33
|
+
text: '{x}^{2}',
|
|
34
|
+
latex: 'x^2',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
cmd: true,
|
|
38
|
+
text: '{x}^{y}',
|
|
39
|
+
latex: '\\placeholder{x}^\\placeholder{y}',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
cmd: true,
|
|
43
|
+
text: '{x}_{y}',
|
|
44
|
+
latex: '\\placeholder{x}_\\placeholder{y}',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
text: '\\sqrt{x}',
|
|
48
|
+
latex: '\\sqrt{x}',
|
|
49
|
+
cmd: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
latex: '\\sqrt[\\placeholder{n}]{\\placeholder{x}}',
|
|
53
|
+
text: '\\sqrt[n]{x}',
|
|
54
|
+
cmd: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
cmd: false,
|
|
58
|
+
text: '\\frac{x}{y}',
|
|
59
|
+
latex:
|
|
60
|
+
'\\frac\n' +
|
|
61
|
+
' {\\placeholder[numerator]{?}}\n' +
|
|
62
|
+
' {\\placeholder[denominator]{?}}',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
cmd: false,
|
|
66
|
+
text: '\\left|x\\right|',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
cmd: false,
|
|
70
|
+
text: '\\left\\{\\right\\}',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
cmd: false,
|
|
74
|
+
text: '\\infty',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
cmd: false,
|
|
78
|
+
text: '(x,y)',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'windward.core.components.utils.math_expression_editor.operators',
|
|
84
|
+
buttons: [
|
|
85
|
+
{
|
|
86
|
+
cmd: false,
|
|
87
|
+
text: '\\neq',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
cmd: false,
|
|
91
|
+
text: '\\geq',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
cmd: false,
|
|
95
|
+
text: '\\leq',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
cmd: false,
|
|
99
|
+
text: '\\approx',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
cmd: false,
|
|
103
|
+
text: '\\sum_{}',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
cmd: false,
|
|
107
|
+
text: '\\leftarrow',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
cmd: false,
|
|
111
|
+
text: '\\rightarrow',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
cmd: false,
|
|
115
|
+
text: '\\leftrightarrow',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
cmd: false,
|
|
119
|
+
text: '+',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
cmd: false,
|
|
123
|
+
text: '-',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
cmd: false,
|
|
127
|
+
text: '\\times',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
cmd: false,
|
|
131
|
+
text: '\\div',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
cmd: false,
|
|
135
|
+
text: '=',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
cmd: false,
|
|
139
|
+
text: '\\pm',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
cmd: false,
|
|
143
|
+
text: '\\cdot',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
cmd: true,
|
|
147
|
+
latex: '/',
|
|
148
|
+
text: '/',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'windward.core.components.utils.math_expression_editor.trigonometry',
|
|
154
|
+
buttons: [
|
|
155
|
+
{
|
|
156
|
+
cmd: false,
|
|
157
|
+
text: '\\sin',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
cmd: false,
|
|
161
|
+
text: '\\cos',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
cmd: false,
|
|
165
|
+
text: '\\tan',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
cmd: false,
|
|
169
|
+
text: '\\sin^{-1}',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
cmd: false,
|
|
173
|
+
text: '\\cos^{-1}',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
cmd: false,
|
|
177
|
+
text: '\\tan^{-1}',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
cmd: false,
|
|
181
|
+
text: '\\arcsin',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
cmd: false,
|
|
185
|
+
text: '\\arccos',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
cmd: false,
|
|
189
|
+
text: '\\arctan',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'windward.core.components.utils.math_expression_editor.greek',
|
|
195
|
+
buttons: [
|
|
196
|
+
{
|
|
197
|
+
cmd: false,
|
|
198
|
+
text: '\\alpha',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
cmd: false,
|
|
202
|
+
text: '\\beta',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
cmd: false,
|
|
206
|
+
text: '\\gamma',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
cmd: false,
|
|
210
|
+
text: '\\delta',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
cmd: false,
|
|
214
|
+
text: '\\Delta',
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
cmd: false,
|
|
218
|
+
text: '\\epsilon',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
cmd: false,
|
|
222
|
+
text: '\\theta',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
cmd: false,
|
|
226
|
+
text: '\\iota',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
cmd: false,
|
|
230
|
+
text: '\\kappa',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
cmd: false,
|
|
234
|
+
text: '\\lambda',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
cmd: false,
|
|
238
|
+
text: '\\Lambda',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
cmd: false,
|
|
242
|
+
text: '\\mu',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
cmd: false,
|
|
246
|
+
text: '\\sigma',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
cmd: false,
|
|
250
|
+
text: '\\Sigma',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
cmd: false,
|
|
254
|
+
text: '\\phi',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
cmd: false,
|
|
258
|
+
text: '\\omega',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
cmd: false,
|
|
262
|
+
text: '\\Omega',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'windward.core.components.utils.math_expression_editor.probability',
|
|
268
|
+
buttons: [
|
|
269
|
+
{
|
|
270
|
+
cmd: false,
|
|
271
|
+
text: 'C(n,r)=\\binom nr=\\frac{n!}{(r!(n-r)!)}',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
cmd: false,
|
|
275
|
+
text: '\\binom{n}{r}',
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'windward.core.components.utils.math_expression_editor.matrix',
|
|
281
|
+
buttons: [
|
|
282
|
+
{
|
|
283
|
+
cmd: false,
|
|
284
|
+
text: '\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
cmd: false,
|
|
288
|
+
text: '\\begin{bmatrix} a & b & c \\\\ d & e & f \\\\ g & h & i \\end{bmatrix}',
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: 'windward.core.components.utils.math_expression_editor.eq_systems',
|
|
294
|
+
buttons: [
|
|
295
|
+
{
|
|
296
|
+
cmd: false,
|
|
297
|
+
text: '\\begin{cases} x + y \\\\ x + y \\end{cases}',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
cmd: false,
|
|
301
|
+
text: '\\begin{cases} x + y \\\\ x – y \\end{cases}',
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'FIB',
|
|
310
|
+
tag: 'plugin-core-fill-blanks-tool',
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
}
|
|
@@ -2,15 +2,18 @@ const WindwardPlugins = function (editor: any) {
|
|
|
2
2
|
let formula: any
|
|
3
3
|
let fillInBlank: any
|
|
4
4
|
// ----- Events ----- //
|
|
5
|
-
editor.ui.registry.addIcon(
|
|
6
|
-
'
|
|
7
|
-
'
|
|
5
|
+
editor.ui.registry.addIcon(
|
|
6
|
+
'insertMath',
|
|
7
|
+
'<svg x="0px" y="0px"width="20px" height="20px" viewBox="0 0 445.878 445.878" style="enable-background:new 0 0 445.878 445.878;">' +
|
|
8
|
+
'<path d="M426.024,86.447H209.705l-84.911,298.911c-2.568,7.967-9.854,13.482-18.22,13.771c-0.236,0-0.464,0.006-0.688,0.006 c-8.092,0-15.41-4.924-18.436-12.478l-34.714-86.782H19.851C8.884,299.876,0,290.986,0,280.022 c0-10.965,8.893-19.854,19.851-19.854H66.18c8.109,0,15.421,4.941,18.436,12.483l19.237,48.09l72.472-260.218 c2.639-8.213,10.279-13.781,18.903-13.781h230.798c10.97,0,19.854,8.89,19.854,19.851S436.988,86.447,426.024,86.447z M436.723,353.227l-78.259-87.904l74.576-82.783c1.318-1.454,1.638-3.547,0.857-5.341c-0.804-1.791-2.577-2.946-4.54-2.946h-47.18 c-1.442,0-2.802,0.629-3.759,1.72l-50.059,58.047l-49.674-58.029c-0.939-1.103-2.317-1.738-3.771-1.738h-49.334 c-1.956,0-3.729,1.149-4.521,2.929c-0.81,1.785 0.479,3.875,0.824,5.332l73.743,82.81l-77.641,87.923 c-1.297,1.465-1.605,3.552 0.813,5.325c0.813,1.785,2.586,2.92,4.528,2.92h48.9c1.472,0,2.867-0.65,3.807-1.785l51.819-62.181 l53.05,62.229c0.951,1.11,2.328,1.743,3.782,1.743h49.97c1.962,0,3.735-1.141,4.527-2.926 C438.354,356.779,438.035,354.692,436.723,353.227z"/>' +
|
|
9
|
+
'</svg>'
|
|
10
|
+
)
|
|
8
11
|
editor.addCommand('equation-window', function (data: any) {
|
|
9
12
|
return editor.windowManager.openUrl({
|
|
10
13
|
url: '/plugins/tinymce/math',
|
|
11
14
|
title: 'Equation editor',
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
15
|
+
width: 1000,
|
|
16
|
+
height: 900,
|
|
14
17
|
buttons: [
|
|
15
18
|
{
|
|
16
19
|
type: 'cancel',
|
|
@@ -24,7 +27,7 @@ const WindwardPlugins = function (editor: any) {
|
|
|
24
27
|
],
|
|
25
28
|
onAction: () => {
|
|
26
29
|
if (data.currentTarget) {
|
|
27
|
-
editor.selection.select(data.currentTarget)
|
|
30
|
+
editor.selection.select(data.currentTarget)
|
|
28
31
|
}
|
|
29
32
|
editor.selection.setContent(
|
|
30
33
|
` <span class='windward-math-content'>` +
|
|
@@ -93,9 +96,7 @@ const WindwardPlugins = function (editor: any) {
|
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
|
|
97
99
|
editor.addCommand('fib-window', function (data: any) {
|
|
98
|
-
|
|
99
100
|
return editor.windowManager.openUrl({
|
|
100
101
|
url: '/plugins/tinymce/FIB',
|
|
101
102
|
title: 'Fill in the blank',
|
|
@@ -114,42 +115,51 @@ const WindwardPlugins = function (editor: any) {
|
|
|
114
115
|
],
|
|
115
116
|
onAction: () => {
|
|
116
117
|
if (data.currentTarget) {
|
|
117
|
-
editor.selection.select(data.currentTarget)
|
|
118
|
+
editor.selection.select(data.currentTarget)
|
|
118
119
|
}
|
|
119
120
|
editor.selection.setContent(
|
|
120
|
-
`<span class='windward-fill-blank' data-feedback
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
`<span class='windward-fill-blank' data-feedback =` +
|
|
122
|
+
fillInBlank.feedback +
|
|
123
|
+
` >` +
|
|
124
|
+
fillInBlank.answer +
|
|
125
|
+
`</span>`
|
|
123
126
|
)
|
|
124
127
|
|
|
125
128
|
editor.windowManager.close()
|
|
126
|
-
setOnClickFillInBlank(editor)
|
|
129
|
+
setOnClickFillInBlank(editor)
|
|
127
130
|
},
|
|
128
131
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
129
132
|
onMessage: (instance: any, message: any) => {
|
|
130
133
|
switch (message.mceAction) {
|
|
131
134
|
case 'fib-insert':
|
|
132
|
-
fillInBlank = {
|
|
135
|
+
fillInBlank = {
|
|
136
|
+
answer: message.content.answer,
|
|
137
|
+
feedback: message.content.feedback,
|
|
138
|
+
}
|
|
133
139
|
break
|
|
134
140
|
case 'fib-plugin-mounted':
|
|
135
|
-
window.parent.postMessage(
|
|
136
|
-
feedback: data.feedback
|
|
141
|
+
window.parent.postMessage(
|
|
142
|
+
{ answer: data.answer, feedback: data.feedback },
|
|
143
|
+
'*'
|
|
144
|
+
)
|
|
137
145
|
break
|
|
138
146
|
}
|
|
139
147
|
},
|
|
140
148
|
})
|
|
141
149
|
})
|
|
142
150
|
|
|
143
|
-
editor.ui.registry.addIcon(
|
|
151
|
+
editor.ui.registry.addIcon(
|
|
152
|
+
'insertFIB',
|
|
153
|
+
'<svg width="20px" height="20px" viewBox="0 0 24 24"><path d="M17,7H22V17H17V19A1,1 0 0,0 18,20H20V22H17.5C16.95,22 16,21.55 16,21C16,21.55 15.05,22 14.5,22H12V20H14A1,1 0 0,0 15,19V5A1,1 0 0,0 14,4H12V2H14.5C15.05,2 16,2.45 16,3C16,2.45 16.95,2 17.5,2H20V4H18A1,1 0 0,0 17,5V7M2,7H13V9H4V15H13V17H2V7M20,15V9H17V15H20Z" /></svg>'
|
|
154
|
+
)
|
|
144
155
|
/* Add a button that opens a window */
|
|
145
156
|
editor.ui.registry.addButton('fibButton', {
|
|
146
157
|
icon: 'insertFIB',
|
|
147
158
|
onAction: function () {
|
|
148
159
|
/* Open window */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
160
|
+
editor.execCommand('fib-window', true)
|
|
161
|
+
},
|
|
162
|
+
})
|
|
153
163
|
editor.ui.registry.addMenuItem('FIB', {
|
|
154
164
|
text: 'FIll in the blank',
|
|
155
165
|
icon: 'insertFIB',
|
|
@@ -160,9 +170,7 @@ const WindwardPlugins = function (editor: any) {
|
|
|
160
170
|
|
|
161
171
|
function setOnClickFillInBlank(editor: any) {
|
|
162
172
|
const tinymceDoc = editor.getDoc()
|
|
163
|
-
const mqSpan = tinymceDoc.getElementsByClassName(
|
|
164
|
-
'windward-fill-blank'
|
|
165
|
-
)
|
|
173
|
+
const mqSpan = tinymceDoc.getElementsByClassName('windward-fill-blank')
|
|
166
174
|
|
|
167
175
|
// Add onclick listener to all equation content
|
|
168
176
|
for (const fib of mqSpan) {
|
|
@@ -181,7 +189,6 @@ const WindwardPlugins = function (editor: any) {
|
|
|
181
189
|
}
|
|
182
190
|
}
|
|
183
191
|
}
|
|
184
|
-
|
|
185
192
|
}
|
|
186
193
|
|
|
187
194
|
export { WindwardPlugins }
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
title: 'Mathematical Expression editor',
|
|
3
|
+
basic: 'Basic',
|
|
4
|
+
operators: 'Operators',
|
|
5
|
+
trigonometry: 'Trigonometry',
|
|
6
|
+
greek: 'Greek',
|
|
7
|
+
probability: 'Probability',
|
|
8
|
+
matrix: 'Matrix',
|
|
9
|
+
eq_systems: 'Equation Systems',
|
|
10
|
+
screen_reader_text: 'screen Reader Text',
|
|
11
|
+
default_screen_reader_text: 'Default screen Reader Text',
|
|
12
|
+
custom_screen_reader_text: 'Customize screen Reader Text',
|
|
13
|
+
read_text_aloud: 'Read Text aloud',
|
|
3
14
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title_401: 'No access',
|
|
3
|
+
description_401:
|
|
4
|
+
'You are not authorized to use this plugin. Please contact your account administrator',
|
|
5
|
+
not_enabled:
|
|
6
|
+
"'{0}' is not enabled. Please contact your account administrator",
|
|
7
|
+
missing_tag:
|
|
8
|
+
"Something went wrong on our side. '{0}' is enabled but could not be loaded. Please contact your account administrator",
|
|
9
|
+
}
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
math: 'Math Settings',
|
|
16
16
|
feedback: 'Feedback Settings',
|
|
17
17
|
horizontal_line: 'Divider Settings',
|
|
18
|
-
email: '
|
|
18
|
+
email: 'Email Settings',
|
|
19
19
|
click_to_enter: 'Click here to enter text',
|
|
20
20
|
block_quote: 'Block Quote Settings',
|
|
21
21
|
title: 'Title',
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
title: 'Manipulador de expresión matemática',
|
|
3
|
+
basic: 'Basico',
|
|
4
|
+
operators: 'Operadores',
|
|
5
|
+
trigonometry: 'Trigonometría',
|
|
6
|
+
greek: 'Simbolos Griegos',
|
|
7
|
+
probability: 'Probabilidad',
|
|
8
|
+
matrix: 'Matriz',
|
|
9
|
+
eq_systems: 'Sistemas de ecuaciones',
|
|
10
|
+
screen_reader_text: 'Texto del lector de pantalla',
|
|
11
|
+
default_screen_reader_text: 'Texto del lector de pantalla auto generatpr',
|
|
12
|
+
custom_screen_reader_text: 'Personalizar el texto del lector de pantalla/',
|
|
13
|
+
read_text_aloud: 'Leer texto',
|
|
3
14
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title_401: 'Sin acceso',
|
|
3
|
+
description_401:
|
|
4
|
+
'No estás autorizado a utilizar este complemento. Por favor contacte al administrador de su cuenta',
|
|
5
|
+
not_enabled:
|
|
6
|
+
"'{0}' no está habilitado. Por favor contacte al administrador de su cuenta",
|
|
7
|
+
missing_tag:
|
|
8
|
+
"Algo salió mal de nuestro lado. '{0}' está habilitado pero no se pudo cargar. Por favor contacte al administrador de su cuenta",
|
|
9
|
+
}
|