@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,3 +1,14 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
title: 'Redaktör för matematiska uttryck',
|
|
3
|
+
basic: 'Grundläggande',
|
|
4
|
+
operators: 'Operatörer',
|
|
5
|
+
trigonometry: 'Trigonometri',
|
|
6
|
+
greek: 'grekisk',
|
|
7
|
+
probability: 'Sannolikhet',
|
|
8
|
+
matrix: 'Matris',
|
|
9
|
+
eq_systems: 'Ekvationssystem',
|
|
10
|
+
screen_reader_text: 'skärmläsare text',
|
|
11
|
+
default_screen_reader_text: 'Standard skärmläsare text',
|
|
12
|
+
custom_screen_reader_text: 'Anpassa skärmläsartext',
|
|
13
|
+
read_text_aloud: 'Läs texten högt',
|
|
3
14
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title_401: 'Ingen åtkomst',
|
|
3
|
+
description_401:
|
|
4
|
+
'Du har inte behörighet att använda denna plugin. Vänligen kontakta din kontoadministratör',
|
|
5
|
+
not_enabled: "'{0}' är inte aktiverat. Kontakta din kontoadministratör",
|
|
6
|
+
missing_tag:
|
|
7
|
+
"Något gick fel på vår sida. '{0}' är aktiverat men kunde inte laddas. Kontakta din kontoadministratör",
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<component
|
|
4
|
+
:is="plugin.tag"
|
|
5
|
+
v-if="
|
|
6
|
+
isRegistered &&
|
|
7
|
+
$PermissionService.userHasAccessTo(
|
|
8
|
+
'windward.global.course,windward.organization.contentBlock,windward.organization.course.contentBlock',
|
|
9
|
+
'writable'
|
|
10
|
+
)
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
</component>
|
|
14
|
+
<!-- No permissions error condition -->
|
|
15
|
+
<div
|
|
16
|
+
v-if="
|
|
17
|
+
!$PermissionService.userHasAccessTo(
|
|
18
|
+
'windward.global.course,windward.organization.contentBlock,windward.organization.course.contentBlock',
|
|
19
|
+
'writable'
|
|
20
|
+
)
|
|
21
|
+
"
|
|
22
|
+
>
|
|
23
|
+
<h2>
|
|
24
|
+
{{ $t('windward.core.pages.plugins.error.title_401') }}
|
|
25
|
+
</h2>
|
|
26
|
+
<p>
|
|
27
|
+
{{ $t('windward.core.pages.plugins.error.description_401') }}
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
<!-- Plugin doesn't have a tag error condition -->
|
|
31
|
+
<v-alert v-if="!plugin.tag" type="error">
|
|
32
|
+
{{
|
|
33
|
+
$t('windward.core.pages.plugins.error.not_enabled', [
|
|
34
|
+
plugin.name,
|
|
35
|
+
])
|
|
36
|
+
}}
|
|
37
|
+
</v-alert>
|
|
38
|
+
<!-- Plugin tag wasn't autoloaded error condition -->
|
|
39
|
+
<v-alert v-if="plugin.tag && !isRegistered" type="error">
|
|
40
|
+
{{
|
|
41
|
+
$t('windward.core.pages.plugins.error.missing_tag', [
|
|
42
|
+
plugin.name,
|
|
43
|
+
])
|
|
44
|
+
}}
|
|
45
|
+
</v-alert>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
import _ from 'lodash'
|
|
51
|
+
import tinymcePluginConfig from '../../../config/tinymce.config'
|
|
52
|
+
export default {
|
|
53
|
+
layout: 'plugin',
|
|
54
|
+
data() {
|
|
55
|
+
return {}
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
isRegistered() {
|
|
59
|
+
const c = _.get(
|
|
60
|
+
this.$root,
|
|
61
|
+
"$options.components['" + this.plugin.tag + "']",
|
|
62
|
+
null
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
return c !== null
|
|
66
|
+
},
|
|
67
|
+
plugin() {
|
|
68
|
+
const plugin = tinymcePluginConfig.plugins.filter((item) => {
|
|
69
|
+
return (
|
|
70
|
+
item.name.toLowerCase() ===
|
|
71
|
+
this.$route.params.plugin.toLowerCase()
|
|
72
|
+
)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
return plugin[0] || { tag: null, name: this.$route.params.plugin }
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
</script>
|
package/plugin.js
CHANGED
|
@@ -21,6 +21,8 @@ import Image from './components/Content/Blocks/Image'
|
|
|
21
21
|
import UserUpload from './components/Content/Blocks/UserUpload'
|
|
22
22
|
|
|
23
23
|
import GlossaryPage from './pages/glossary.vue'
|
|
24
|
+
import TinymcePlugin from './pages/plugins/tinymce/_plugin.vue'
|
|
25
|
+
|
|
24
26
|
import CourseGlossaryToolNav from './components/Navigation/Items/CourseGlossaryToolNav.vue'
|
|
25
27
|
import GlossaryNav from './components/Navigation/Items/GlossaryNav.vue'
|
|
26
28
|
import AskTheExpert from './components/Navigation/Items/AskTheExpert.vue'
|
|
@@ -78,6 +80,14 @@ export default {
|
|
|
78
80
|
name: 'CourseGlossaryPage',
|
|
79
81
|
template: GlossaryPage,
|
|
80
82
|
},
|
|
83
|
+
{
|
|
84
|
+
page: 'tinymce-plugin',
|
|
85
|
+
path: '/plugins/tinymce/:plugin',
|
|
86
|
+
i18n: 'windward.core.shared.menu.plugin',
|
|
87
|
+
icon: 'mdi-toy-brick',
|
|
88
|
+
name: 'TinymcePlugin',
|
|
89
|
+
template: TinymcePlugin,
|
|
90
|
+
},
|
|
81
91
|
],
|
|
82
92
|
components: {
|
|
83
93
|
utils: [
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
|
|
6
|
+
import TinyMcePlugin from '@/pages/plugins/tinymce/_plugin.vue'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
const mocks = {
|
|
11
|
+
...defaultMocks,
|
|
12
|
+
$route: { params: { plugin: '' } },
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
describe('TinyMcePlugin', () => {
|
|
16
|
+
test('is a Vue instance', () => {
|
|
17
|
+
const wrapper = shallowMount(TinyMcePlugin, {
|
|
18
|
+
vuetify: new Vuetify(),
|
|
19
|
+
mocks,
|
|
20
|
+
})
|
|
21
|
+
expect(wrapper.vm).toBeTruthy()
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -34,18 +34,6 @@ jest.mock(
|
|
|
34
34
|
{ virtual: true }
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
jest.mock(
|
|
38
|
-
'~/components/DialogBox.vue',
|
|
39
|
-
() => {
|
|
40
|
-
return {
|
|
41
|
-
props: {},
|
|
42
|
-
computed: {},
|
|
43
|
-
methods: {},
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{ virtual: true }
|
|
47
|
-
)
|
|
48
|
-
|
|
49
37
|
jest.mock(
|
|
50
38
|
'~/components/Text/TextViewer',
|
|
51
39
|
() => {
|
package/test/mocks.js
CHANGED
package/config/tinymce.config.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
plugins: [
|
|
3
|
-
{
|
|
4
|
-
name: 'math',
|
|
5
|
-
tag: 'plugin-core-math-expression-editor',
|
|
6
|
-
buttons: {
|
|
7
|
-
groups: [
|
|
8
|
-
{
|
|
9
|
-
name: 'shared.math.trigonometry',
|
|
10
|
-
buttons: [
|
|
11
|
-
{
|
|
12
|
-
cmd: false,
|
|
13
|
-
text: '\\sec',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
cmd: false,
|
|
17
|
-
text: '\\sec^{-1}',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
cmd: false,
|
|
21
|
-
text: '\\csc',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
cmd: false,
|
|
25
|
-
text: '\\csc^{-1}',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
cmd: false,
|
|
29
|
-
text: '\\cot',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
cmd: false,
|
|
33
|
-
text: '\\cot^{-1}',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'shared.math.statistic',
|
|
39
|
-
buttons: [
|
|
40
|
-
{
|
|
41
|
-
cmd: false,
|
|
42
|
-
text: '\\mu',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
cmd: false,
|
|
46
|
-
text: '\\overline{x}',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
cmd: false,
|
|
50
|
-
text: '\\overline{y}',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
cmd: false,
|
|
54
|
-
text: 'x^i',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
cmd: false,
|
|
58
|
-
text: 'x_i',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
cmd: false,
|
|
62
|
-
text: 'x!',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
cmd: false,
|
|
66
|
-
text: '\\Sigma',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'shared.math.matrix',
|
|
72
|
-
buttons: [
|
|
73
|
-
{
|
|
74
|
-
cmd: false,
|
|
75
|
-
text: '\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
cmd: false,
|
|
79
|
-
text: '\\begin{bmatrix} a & b & c \\\\ d & e & f \\\\ g & h & i \\end{bmatrix}',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'shared.math.group',
|
|
85
|
-
buttons: [
|
|
86
|
-
{
|
|
87
|
-
cmd: true,
|
|
88
|
-
latex: '(\\placeholder{})',
|
|
89
|
-
text: '(\\cdot)',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
cmd: true,
|
|
93
|
-
latex: '[\\placeholder{}]',
|
|
94
|
-
text: '[\\cdot]',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
cmd: true,
|
|
98
|
-
latex: '|\\placeholder{}|',
|
|
99
|
-
text: '|\\cdot|',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
cmd: false,
|
|
103
|
-
text: '(x,y)',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
cmd: false,
|
|
107
|
-
text: '[x,y]',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
cmd: false,
|
|
111
|
-
text: '(x,y]',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
cmd: false,
|
|
115
|
-
text: '[x,y)',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'shared.math.equation_system',
|
|
121
|
-
buttons: [
|
|
122
|
-
{
|
|
123
|
-
cmd: false,
|
|
124
|
-
text: '\\begin{cases} x + y \\\\ x + y \\end{cases}',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
cmd: false,
|
|
128
|
-
text: '\\begin{cases} x + y \\\\ x – y \\end{cases}',
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
}
|