@windward/core 0.6.0 → 0.8.0

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.
Files changed (176) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/components/Content/Blocks/Accordion.vue +22 -0
  3. package/components/Content/Blocks/BlockQuote.vue +6 -2
  4. package/components/Content/Blocks/ClickableIcons.vue +19 -4
  5. package/components/Content/Blocks/Email.vue +12 -3
  6. package/components/Content/Blocks/GenerateAIQuestionButton.vue +14 -6
  7. package/components/Content/Blocks/HorizontalRule.vue +3 -4
  8. package/components/Content/Blocks/OpenResponse.vue +25 -0
  9. package/components/Content/Blocks/OpenResponseCollate.vue +13 -12
  10. package/components/Content/Blocks/ScenarioChoice.vue +66 -33
  11. package/components/Content/Blocks/Tab.vue +19 -0
  12. package/components/Content/Blocks/UserUpload.vue +5 -10
  13. package/components/Content/Blocks/Video.vue +129 -15
  14. package/components/Settings/AccordionSettings.vue +52 -13
  15. package/components/Settings/BlockQuoteSettings.vue +17 -33
  16. package/components/Settings/ClickableIconsSettings.vue +37 -23
  17. package/components/Settings/EmailSettings.vue +12 -30
  18. package/components/Settings/FileDownloadSettings.vue +12 -31
  19. package/components/Settings/HorizontalRuleSettings.vue +0 -3
  20. package/components/Settings/ImageSettings.vue +3 -9
  21. package/components/Settings/OpenResponseCollateSettings.vue +47 -55
  22. package/components/Settings/OpenResponseSettings.vue +62 -36
  23. package/components/Settings/ScenarioChoiceSettings.vue +22 -29
  24. package/components/Settings/TabSettings.vue +99 -81
  25. package/components/Settings/UserUploadSettings.vue +16 -42
  26. package/components/Settings/VideoSettings/SourcePicker.vue +223 -0
  27. package/components/Settings/VideoSettings.vue +115 -195
  28. package/components/utils/TinyMCEWrapper.vue +9 -5
  29. package/components/utils/assets/tinymce/content/global.scss +14 -0
  30. package/components/utils/glossary/CourseGlossary.vue +52 -27
  31. package/helpers/GlossaryHelper.ts +12 -2
  32. package/helpers/tinymce/WindwardPlugins.ts +59 -10
  33. package/i18n/en-US/components/content/blocks/generate_questions.ts +2 -1
  34. package/i18n/en-US/components/content/blocks/video.ts +2 -51
  35. package/i18n/en-US/components/settings/accordion.ts +1 -0
  36. package/i18n/en-US/components/settings/open_response_collate.ts +1 -1
  37. package/i18n/en-US/components/settings/scenario_choice.ts +3 -2
  38. package/i18n/en-US/components/settings/tab.ts +1 -0
  39. package/i18n/en-US/components/settings/user_upload.ts +1 -0
  40. package/i18n/en-US/components/settings/video.ts +51 -0
  41. package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +9 -1
  42. package/i18n/en-US/shared/settings.ts +1 -1
  43. package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
  44. package/i18n/es-ES/components/content/blocks/video.ts +3 -53
  45. package/i18n/es-ES/components/settings/accordion.ts +1 -0
  46. package/i18n/es-ES/components/settings/open_response_collate.ts +1 -1
  47. package/i18n/es-ES/components/settings/scenario_choice.ts +3 -2
  48. package/i18n/es-ES/components/settings/tab.ts +2 -0
  49. package/i18n/es-ES/components/settings/user_upload.ts +1 -0
  50. package/i18n/es-ES/components/settings/video.ts +53 -0
  51. package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +9 -0
  52. package/i18n/es-ES/shared/settings.ts +1 -1
  53. package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
  54. package/i18n/sv-SE/components/content/blocks/video.ts +2 -51
  55. package/i18n/sv-SE/components/settings/accordion.ts +2 -0
  56. package/i18n/sv-SE/components/settings/open_response_collate.ts +1 -1
  57. package/i18n/sv-SE/components/settings/scenario_choice.ts +3 -2
  58. package/i18n/sv-SE/components/settings/tab.ts +1 -0
  59. package/i18n/sv-SE/components/settings/user_upload.ts +1 -0
  60. package/i18n/sv-SE/components/settings/video.ts +51 -0
  61. package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +8 -0
  62. package/package.json +3 -2
  63. package/plugin.js +1 -1
  64. package/test/__mocks__/modelMock.js +1 -1
  65. package/test/helpers/GlossaryHelper.spec.js +22 -3
  66. package/test/mocks.js +8 -0
  67. package/.idea/codeStyles/Project.xml +0 -58
  68. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  69. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  70. package/.idea/modules.xml +0 -8
  71. package/.idea/php-docker-settings.xml +0 -24
  72. package/.idea/php.xml +0 -19
  73. package/.idea/vcs.xml +0 -6
  74. package/.idea/watcherTasks.xml +0 -4
  75. package/.idea/windward-ui-plugin-core.iml +0 -8
  76. package/config/menu.config.json +0 -475
  77. package/coverage/clover.xml +0 -223
  78. package/coverage/coverage-final.json +0 -16
  79. package/coverage/lcov-report/base.css +0 -224
  80. package/coverage/lcov-report/block-navigation.js +0 -87
  81. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +0 -430
  82. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +0 -394
  83. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +0 -262
  84. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +0 -295
  85. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +0 -415
  86. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +0 -667
  87. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +0 -2275
  88. package/coverage/lcov-report/components/Content/Blocks/index.html +0 -206
  89. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +0 -199
  90. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +0 -919
  91. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +0 -343
  92. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +0 -271
  93. package/coverage/lcov-report/components/utils/index.html +0 -161
  94. package/coverage/lcov-report/config/index.html +0 -116
  95. package/coverage/lcov-report/config/tinymce.config.js.html +0 -493
  96. package/coverage/lcov-report/favicon.png +0 -0
  97. package/coverage/lcov-report/helpers/MathHelper.ts.html +0 -793
  98. package/coverage/lcov-report/helpers/index.html +0 -116
  99. package/coverage/lcov-report/helpers/tinymce/index.html +0 -116
  100. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +0 -334
  101. package/coverage/lcov-report/index.html +0 -191
  102. package/coverage/lcov-report/prettify.css +0 -1
  103. package/coverage/lcov-report/prettify.js +0 -2
  104. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  105. package/coverage/lcov-report/sorter.js +0 -196
  106. package/coverage/lcov-report/test/index.html +0 -116
  107. package/coverage/lcov-report/test/mocks.js.html +0 -457
  108. package/coverage/lcov.info +0 -403
  109. package/lib/helpers/GlossaryHelper.d.ts +0 -9
  110. package/lib/helpers/GlossaryHelper.js +0 -118
  111. package/lib/helpers/GlossaryTerm.d.ts +0 -10
  112. package/lib/helpers/GlossaryTerm.js +0 -22
  113. package/lib/helpers/MathHelper.d.ts +0 -99
  114. package/lib/helpers/MathHelper.js +0 -194
  115. package/lib/helpers/tinymce/plugin.d.ts +0 -2
  116. package/lib/helpers/tinymce/plugin.js +0 -86
  117. package/lib/i18n/en-US/components/content/blocks/image.d.ts +0 -6
  118. package/lib/i18n/en-US/components/content/blocks/image.js +0 -7
  119. package/lib/i18n/en-US/components/content/blocks/index.d.ts +0 -75
  120. package/lib/i18n/en-US/components/content/blocks/index.js +0 -14
  121. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +0 -5
  122. package/lib/i18n/en-US/components/content/blocks/tab.js +0 -6
  123. package/lib/i18n/en-US/components/content/blocks/table.d.ts +0 -5
  124. package/lib/i18n/en-US/components/content/blocks/table.js +0 -6
  125. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +0 -13
  126. package/lib/i18n/en-US/components/content/blocks/user_upload.js +0 -14
  127. package/lib/i18n/en-US/components/content/blocks/video.d.ts +0 -48
  128. package/lib/i18n/en-US/components/content/blocks/video.js +0 -49
  129. package/lib/i18n/en-US/components/content/index.d.ts +0 -77
  130. package/lib/i18n/en-US/components/content/index.js +0 -6
  131. package/lib/i18n/en-US/components/index.d.ts +0 -140
  132. package/lib/i18n/en-US/components/index.js +0 -12
  133. package/lib/i18n/en-US/components/navigation/image.d.ts +0 -5
  134. package/lib/i18n/en-US/components/navigation/image.js +0 -6
  135. package/lib/i18n/en-US/components/navigation/index.d.ts +0 -10
  136. package/lib/i18n/en-US/components/navigation/index.js +0 -8
  137. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +0 -4
  138. package/lib/i18n/en-US/components/navigation/user_upload.js +0 -5
  139. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +0 -6
  140. package/lib/i18n/en-US/components/settings/clickable_icon.js +0 -7
  141. package/lib/i18n/en-US/components/settings/image.d.ts +0 -2
  142. package/lib/i18n/en-US/components/settings/image.js +0 -3
  143. package/lib/i18n/en-US/components/settings/index.d.ts +0 -39
  144. package/lib/i18n/en-US/components/settings/index.js +0 -14
  145. package/lib/i18n/en-US/components/settings/text_editor.d.ts +0 -8
  146. package/lib/i18n/en-US/components/settings/text_editor.js +0 -9
  147. package/lib/i18n/en-US/components/settings/user_upload.d.ts +0 -12
  148. package/lib/i18n/en-US/components/settings/user_upload.js +0 -13
  149. package/lib/i18n/en-US/components/settings/video.d.ts +0 -13
  150. package/lib/i18n/en-US/components/settings/video.js +0 -14
  151. package/lib/i18n/en-US/components/utils/index.d.ts +0 -15
  152. package/lib/i18n/en-US/components/utils/index.js +0 -6
  153. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +0 -13
  154. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +0 -14
  155. package/lib/i18n/en-US/index.d.ts +0 -197
  156. package/lib/i18n/en-US/index.js +0 -16
  157. package/lib/i18n/en-US/modules/index.d.ts +0 -2
  158. package/lib/i18n/en-US/modules/index.js +0 -6
  159. package/lib/i18n/en-US/pages/glossary.d.ts +0 -8
  160. package/lib/i18n/en-US/pages/glossary.js +0 -9
  161. package/lib/i18n/en-US/pages/index.d.ts +0 -13
  162. package/lib/i18n/en-US/pages/index.js +0 -8
  163. package/lib/i18n/en-US/pages/user_upload.d.ts +0 -4
  164. package/lib/i18n/en-US/pages/user_upload.js +0 -5
  165. package/lib/i18n/en-US/shared/content_blocks.d.ts +0 -20
  166. package/lib/i18n/en-US/shared/content_blocks.js +0 -21
  167. package/lib/i18n/en-US/shared/index.d.ts +0 -39
  168. package/lib/i18n/en-US/shared/index.js +0 -10
  169. package/lib/i18n/en-US/shared/menu.d.ts +0 -4
  170. package/lib/i18n/en-US/shared/menu.js +0 -5
  171. package/lib/i18n/en-US/shared/settings.d.ts +0 -15
  172. package/lib/i18n/en-US/shared/settings.js +0 -16
  173. package/lib/i18n/en-US.d.ts +0 -197
  174. package/lib/i18n/en-US.js +0 -15
  175. package/lib/models/UserFileAsset.d.ts +0 -5
  176. package/lib/models/UserFileAsset.js +0 -37
@@ -93,7 +93,18 @@
93
93
  </td>
94
94
  <td>{{ item.related_term }}</td>
95
95
 
96
- <td>
96
+ <td
97
+ v-if="
98
+ $PermissionService.userHasAccessTo(
99
+ 'windward.global.course,windward.organization.contentBlock,windward.organization.course.contentBlock',
100
+ 'writable'
101
+ ) &&
102
+ $PermissionService.userHasAccessTo(
103
+ 'windward.organization.current,windward.organization.section,windward.organization.course',
104
+ 'deletable'
105
+ )
106
+ "
107
+ >
97
108
  <SpeedDial
98
109
  direction="left"
99
110
  transition="slide-x-reverse-transition"
@@ -162,7 +173,30 @@ export default {
162
173
 
163
174
  data() {
164
175
  return {
165
- headers: [
176
+ dialog: false,
177
+ editMode: false,
178
+ glossaryTerms: [],
179
+ selectedTerm: {},
180
+ search: '',
181
+ tableKey: Crypto.id(),
182
+ defaultTerm: {
183
+ term: '',
184
+ definition: '',
185
+ alternate_forms: '',
186
+ related_term: '',
187
+ },
188
+ }
189
+ },
190
+
191
+ computed: {
192
+ ...mapGetters({
193
+ course: 'course/get',
194
+ }),
195
+ ...mapMutations({
196
+ saveCourse: 'course/set',
197
+ }),
198
+ headers() {
199
+ const headers = [
166
200
  {
167
201
  text: this.$t('windward.core.pages.glossary.term'),
168
202
  align: 'start',
@@ -189,34 +223,25 @@ export default {
189
223
  sortable: true,
190
224
  value: 'related_term',
191
225
  },
192
- {
226
+ ]
227
+ if (
228
+ this.$PermissionService.userHasAccessTo(
229
+ 'windward.global.course,windward.organization.contentBlock,windward.organization.course.contentBlock',
230
+ 'writable'
231
+ ) &&
232
+ this.$PermissionService.userHasAccessTo(
233
+ 'windward.organization.current,windward.organization.section,windward.organization.course',
234
+ 'deletable'
235
+ )
236
+ ) {
237
+ headers.push({
193
238
  text: this.$t('shared.forms.actions'),
194
239
  value: 'actions',
195
240
  sortable: false,
196
- },
197
- ],
198
- dialog: false,
199
- editMode: false,
200
- glossaryTerms: [],
201
- selectedTerm: {},
202
- search: '',
203
- tableKey: Crypto.id(),
204
- defaultTerm: {
205
- term: '',
206
- definition: '',
207
- alternate_forms: '',
208
- related_term: '',
209
- },
210
- }
211
- },
212
-
213
- computed: {
214
- ...mapGetters({
215
- course: 'course/get',
216
- }),
217
- ...mapMutations({
218
- saveCourse: 'course/set',
219
- }),
241
+ })
242
+ }
243
+ return headers
244
+ },
220
245
  },
221
246
 
222
247
  beforeMount() {
@@ -62,9 +62,14 @@ export default class GlossaryHelper {
62
62
  addTerm = false
63
63
  }
64
64
  })
65
+
65
66
  if (
66
- _.trim(_.toLower(match[1])) ===
67
- _.trim(_.toLower(term.term)) &&
67
+ ( _.trim(_.toLower(match[1])) ===
68
+ _.trim(_.toLower(term.term)) ||
69
+ term.alternate_forms && _.some(term.alternate_forms, alt => _.trim(_.toLower(alt)) === _.trim(_.toLower(match[1])))
70
+
71
+ )
72
+ &&
68
73
  addTerm
69
74
  ) {
70
75
  verifiedTerms.push(new GlossaryTerm(term))
@@ -98,6 +103,8 @@ export default class GlossaryHelper {
98
103
  inGlossary = glossary.filter((item: any) => {
99
104
  if (
100
105
  _.trim(_.toLower(item.term)) === _.trim(_.toLower(match[1]))
106
+ ||
107
+ item.alternate_forms && _.some(item.alternate_forms, alt => _.trim(_.toLower(alt)) === _.trim(_.toLower(match[1])))
101
108
  ) {
102
109
  return item
103
110
  }
@@ -140,6 +147,9 @@ export default class GlossaryHelper {
140
147
  currentGlossary.forEach((term: any) => {
141
148
  if (
142
149
  _.trim(_.toLower(match[1])) === _.trim(_.toLower(term.term))
150
+ ||
151
+ ( term.alternate_forms &&
152
+ _.some(term.alternate_forms, alt => _.trim(_.toLower(alt)) === _.trim(_.toLower(match[1]))))
143
153
  ) {
144
154
  content = content.replace(
145
155
  match[0],
@@ -1,4 +1,6 @@
1
-
1
+ import { Scanner } from 'accessibility-scanner'
2
+ import local from '../../i18n/index'
3
+ import _ from 'lodash'
2
4
 
3
5
  /**
4
6
  * Class representing the WindwardPlugins.
@@ -9,6 +11,7 @@ export class WindwardPlugins {
9
11
  fillInBlank: any
10
12
  private window: any;
11
13
 
14
+
12
15
  constructor(editor: any) {
13
16
 
14
17
  this.editor = editor
@@ -18,6 +21,15 @@ export class WindwardPlugins {
18
21
  this.register()
19
22
  }
20
23
 
24
+ public $t(key: string, replacements: string[]=[]): string {
25
+ const lang = local.messages[navigator.languages[0]]; // Get the browser language
26
+ let str = _.get(lang, key); // Get the message string using lodash's get function
27
+
28
+ str = str.replace(/{(\d+)}/g, (match, number) => replacements[number] ?? match);
29
+
30
+ return str;
31
+ }
32
+
21
33
 
22
34
  /**
23
35
  * registers an icon with the given icon name and SVG path.
@@ -37,8 +49,8 @@ export class WindwardPlugins {
37
49
  * Adds icons to the editor's UI registry.
38
50
  */
39
51
  private addIcons() {
40
- this.registerIcon('insertMath', '<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;"><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"/></svg>');
41
- this.registerIcon('insertFIB', '<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>');
52
+ this.registerIcon('mathIcon', '<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;"><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"/></svg>');
53
+ this.registerIcon('fibIcon', '<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>');
42
54
  this.registerIcon('glossaryIcon', '<svg viewBox="0 0 24 24" width="20px" height="20px" ><path d="M3,15H1V3A2,2 0 0,1 3,1H19V3H3V15M12,23A1,1 0 0,1 11,22V19H7A2,2 0 0,1 5,17V7A2,2 0 0,1 7,5H21A2,2 0 0,1 23,7V17A2,2 0 0,1 21,19H16.9L13.2,22.71C13,22.89 12.76,23 12.5,23H12M9,9V11H19V9H9M9,13V15H17V13H9Z"></path></svg>');
43
55
  }
44
56
  /**
@@ -98,7 +110,8 @@ export class WindwardPlugins {
98
110
 
99
111
  this.addButtonToEditor(
100
112
  "mathButton",
101
- "insertMath",
113
+ "mathIcon",
114
+ this.$t('windward.core.components.utils.tiny_mce_wrapper.math'),
102
115
  () => {
103
116
  this.editor.execCommand("equation-window", true);
104
117
  }
@@ -106,24 +119,36 @@ export class WindwardPlugins {
106
119
  this.addButtonToEditor(
107
120
  "glossaryButton",
108
121
  "glossaryIcon",
122
+ this.$t('windward.core.components.utils.tiny_mce_wrapper.glossary'),
109
123
  () => {
110
124
  this.editor.formatter.apply("glossary");
111
125
  }
112
126
  );
113
127
  this.addButtonToEditor(
114
128
  "fibInsertButton",
115
- "insertFIB",
129
+ "fibIcon",
130
+ this.$t('windward.core.components.utils.tiny_mce_wrapper.fill_blank'),
116
131
  () => {
117
132
  this.editor.execCommand("fib-window", true);
118
133
  }
119
134
  );
120
135
  this.addButtonToEditor(
121
136
  "fibFormatButton",
122
- "insertFIB",
137
+ "fibIcon",
138
+ this.$t('windward.core.components.utils.tiny_mce_wrapper.fill_blank'),
123
139
  () => {
124
140
  this.editor.formatter.apply("fib");
125
141
  }
126
142
  );
143
+
144
+ this.addButtonToEditor(
145
+ "a11yButton",
146
+ "accessibility-check",
147
+ this.$t('windward.core.components.utils.tiny_mce_wrapper.accessibility'),
148
+ () => {
149
+ this.setAccessibilityIssues(this.editor)
150
+ }
151
+ );
127
152
  }
128
153
 
129
154
  /**
@@ -132,9 +157,10 @@ export class WindwardPlugins {
132
157
  * @param {string} icon Icon name of the button
133
158
  * @param {() => void} onAction Callback function for the action to be done when the button is clicked
134
159
  */
135
- private addButtonToEditor(name: string, icon: string, onAction: () => void) {
160
+ private addButtonToEditor(name: string, icon: string, tooltip: string, onAction: () => void) {
136
161
  this.editor.ui.registry.addButton(name, {
137
162
  icon: icon,
163
+ tooltip: tooltip,
138
164
  onAction: onAction
139
165
  });
140
166
  }
@@ -162,8 +188,8 @@ export class WindwardPlugins {
162
188
  * @returns {void}
163
189
  */
164
190
  private addMenuItems() {
165
- this.addEditorMenuItem('math', 'Math', 'equation-window','insertMath');
166
- this.addEditorMenuItem('FIB', 'Fill in the blank', 'fib-window','insertFIB');
191
+ this.addEditorMenuItem('math', 'Math', 'equation-window','mathIcon');
192
+ this.addEditorMenuItem('FIB', 'Fill in the blank', 'fib-window','fibIcon');
167
193
  }
168
194
 
169
195
  /**
@@ -190,6 +216,7 @@ export class WindwardPlugins {
190
216
  this.editor.on('SetContent', () => {
191
217
  this.setOnDoubleClickEquationContent(this.editor)
192
218
  this.setOnClickFillInBlank(this.editor)
219
+
193
220
  })
194
221
  }
195
222
 
@@ -239,7 +266,7 @@ export class WindwardPlugins {
239
266
  this.editor.addCommand('fib-window', (data: any) => {
240
267
  return this.editor.windowManager.openUrl({
241
268
  url: '/plugins/tinymce/FIB',
242
- title: 'Fill in the blank',
269
+ title: this.$t('windward.core.components.utils.tiny_mce_wrapper.fill_blank'),
243
270
  buttons: [
244
271
  {
245
272
  type: 'cancel',
@@ -316,6 +343,28 @@ export class WindwardPlugins {
316
343
  }
317
344
  }
318
345
 
346
+
347
+ setAccessibilityIssues(editor: any) {
348
+ const tinymceDoc = editor.getDoc();
349
+ tinymceDoc.querySelectorAll("p.a11y-error").forEach(el => el.remove());
350
+ tinymceDoc.querySelectorAll(".a11y-error--highlight").forEach(el => el.classList.remove("a11y-error--highlight"));
351
+ const scanner = Scanner.fromHtmlText(editor.getContent());
352
+ const report = scanner.runScan();
353
+ report.forEach((lineItem: any) => {
354
+ lineItem.issues.forEach((item) => {
355
+ let elements = Array.prototype
356
+ .slice.call(tinymceDoc.getElementsByTagName(item.tagName));
357
+ elements = elements.filter((res) => res.outerHTML === item.outerHTML) //only get the element that are on report
358
+ elements.forEach(element => {
359
+ element.classList.add("a11y-error--highlight");
360
+ element.outerHTML = element.outerHTML + "<p class=\"a11y-error\" ><em>" + this.$t("windward.core.components.utils.tiny_mce_wrapper." + lineItem.key) +" "+ this.$t("windward.core.components.utils.tiny_mce_wrapper.wcag_guidelines",[lineItem.success_criterion]) +".</em></p>";
361
+
362
+ });
363
+ });
364
+ });
365
+ }
366
+
367
+
319
368
  /**
320
369
  * Registers the application, initializing necessary components and setting up the user interface.
321
370
  *
@@ -1,3 +1,4 @@
1
1
  export default {
2
- error: "Could not generate question from provided content."
2
+ error: "Could not generate question from provided content.",
3
+ button_label: 'Generate Question'
3
4
  }
@@ -1,53 +1,4 @@
1
1
  export default {
2
- tabs: {
3
- video: 'Video',
4
- poster: 'Poster',
5
- preroll: 'Preroll',
6
- postroll: 'Postroll',
7
- },
8
- forms: {
9
- unsaved: 'You have unsaved changes. Would you like to save them?',
10
- cancel: 'Cancel',
11
- confirm: 'Confirm',
12
- },
13
- video: {
14
- title: 'Video File',
15
- configure_blurb:
16
- 'Upload a video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
17
- not_configured_title: 'Video not configured',
18
- edit_prompt: 'Edit this block to get started',
19
- autoplay: 'Autoplay on load',
20
- controls: 'Show Controls',
21
- loop: 'Loop video',
22
- muted: 'Start muted',
23
- disablepictureinpicture: 'Disable picture-in-picture button',
24
- poster: 'Video poster',
25
- playback_rates: 'Playback Rates',
26
- rewind: 'Allow 10 Second Rewind',
27
- playsinline: 'Disable fullscreen and force inline viewing',
28
- captionsmenu: 'Show the interactive captions menu',
29
- playlistmenu:
30
- 'Show playlist menu (Requires more than 1 video selected to show)',
31
- playlistautoadvance: 'Auto-advance the playlist on media end',
32
- },
33
- caption: {
34
- title: 'Captions File',
35
- configure_blurb:
36
- 'Upload a captions file (.vtt or .xml), pick one from the file manager, or add via the public URL',
37
- },
38
- poster: {
39
- title: 'Poster Image File',
40
- configure_blurb:
41
- 'Upload a poster file (.png or .jpg), pick one from the file manager, or add via the public URL. This is the image that appears before the video is played.',
42
- },
43
- preroll: {
44
- title: 'Preroll Video File',
45
- configure_blurb:
46
- 'Upload a preroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
47
- },
48
- postroll: {
49
- title: 'Postroll Video File',
50
- configure_blurb:
51
- 'Upload a postroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
52
- },
2
+ not_configured_title: 'Video not configured',
3
+ edit_prompt: 'Edit this block to get started',
53
4
  }
@@ -3,4 +3,5 @@ export default {
3
3
  add: 'Add Accordion Item',
4
4
  accordion: 'Accordion',
5
5
  label: 'Accordion body text',
6
+ instructions: 'Click on each of the headings below for more information.',
6
7
  }
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  instructions:
3
- 'Check off open responses to collate. Drag the prompts to set the order you want the responses collated',
3
+ 'Check off open response items to collate into a document.',
4
4
  include_prompts: 'Include Prompts',
5
5
  filename: 'Filename (Blank for current page name)',
6
6
  }
@@ -3,8 +3,8 @@ export default {
3
3
  description: 'Description',
4
4
  over_item_limit: 'Cannot add more items',
5
5
  no_title: 'No Title',
6
- item_title: 'Item Title',
7
- item_text: 'Item Text',
6
+ item_title: 'Choice Text',
7
+ item_text: 'Explanation of This Choice',
8
8
  correct_choice: 'Is Correct Choice',
9
9
  show_reset: 'Allow Retries',
10
10
  display_style: 'Display Style',
@@ -16,4 +16,5 @@ export default {
16
16
  letter: 'Letters',
17
17
  number: 'Numbers',
18
18
  },
19
+ add_choice: 'Add Choice',
19
20
  }
@@ -4,4 +4,5 @@ export default {
4
4
  header: 'Tab Header',
5
5
  add_tab: 'Add Tab',
6
6
  delete_tab: 'Delete Tab',
7
+ instructions: 'Click on each of the headings below for more information.'
7
8
  }
@@ -8,4 +8,5 @@ export default {
8
8
  all_excel: 'Spreadsheets - .xls and .xlsx',
9
9
  all_zip: 'Compressed - .zip',
10
10
  },
11
+ instructions: 'Drag or click here to upload files.',
11
12
  }
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  title: 'Video Title',
3
3
  sources: 'Sources',
4
+ place_source: 'Place Video or Audio',
4
5
  playback: 'Playback',
5
6
  no_sources: 'No Sources Configured',
6
7
  default_filename: 'Video',
@@ -10,4 +11,54 @@ export default {
10
11
  'Select a source before naming this playlist item',
11
12
  playlist_add: 'Add a playlist item',
12
13
  playlist_remove: 'Remove this playlist item',
14
+ inherit_captions: 'Inherit global captions',
15
+ inherit_global_toggle_description:
16
+ 'When enabled, the selected media will use captions linked on the file, managed in the file manager. When disabled, the selected media will have its own unique captions that is not shared globally on the file.',
17
+ inherit_missing_captions:
18
+ 'No global captions are available for this source. Please set them in the file settings',
19
+ video: {
20
+ title: 'Video File',
21
+ configure_blurb:
22
+ 'Upload a video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
23
+ autoplay: 'Autoplay on load',
24
+ controls: 'Show Controls',
25
+ loop: 'Loop video',
26
+ muted: 'Start muted',
27
+ disablepictureinpicture: 'Disable picture-in-picture button',
28
+ poster: 'Video poster',
29
+ playback_rates: 'Playback Rates',
30
+ rewind: 'Allow 10 Second Rewind',
31
+ playsinline: 'Disable fullscreen and force inline viewing',
32
+ captionsmenu: 'Show the interactive captions menu',
33
+ playlistmenu:
34
+ 'Show playlist menu (Requires more than 1 video selected to show)',
35
+ playlistautoadvance: 'Auto-advance the playlist on media end',
36
+ },
37
+ tabs: {
38
+ source: 'Source',
39
+ video: 'Video',
40
+ poster: 'Poster',
41
+ preroll: 'Preroll',
42
+ postroll: 'Postroll',
43
+ },
44
+ caption: {
45
+ title: 'Place Local Captions File',
46
+ configure_blurb:
47
+ 'Upload a captions file (.vtt or .xml), pick one from the file manager, or add via the public URL',
48
+ },
49
+ poster: {
50
+ title: 'Poster Image File',
51
+ configure_blurb:
52
+ 'Upload a poster file (.png or .jpg), pick one from the file manager, or add via the public URL. This is the image that appears before the video is played.',
53
+ },
54
+ preroll: {
55
+ title: 'Preroll Video File',
56
+ configure_blurb:
57
+ 'Upload a preroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
58
+ },
59
+ postroll: {
60
+ title: 'Postroll Video File',
61
+ configure_blurb:
62
+ 'Upload a postroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
63
+ },
13
64
  }
@@ -1,4 +1,5 @@
1
1
  export default {
2
+ accessibility: 'Accessibility',
2
3
  glossary: 'Glossary',
3
4
  term: 'Glossary Term',
4
5
  alternate_forms: 'Alternate Forms',
@@ -16,6 +17,13 @@ export default {
16
17
  t_chart: 'T Chart',
17
18
  subject_report: 'Subject Report',
18
19
  },
20
+ math: 'Math',
19
21
  minimize: 'Minimize',
20
- read_text_aloud: 'Read Text aloud'
22
+ read_text_aloud: 'Read Text aloud',
23
+ heading_order_incorrect:
24
+ 'Headings must be applied in sequential order: H2 should be followed by H3, H4, and so on',
25
+ wcag_guidelines: '(WCAG {0} guidelines)',
26
+ link_href_missing: 'a (anchor) element must contain an href attribute.',
27
+ link_text_missing:
28
+ 'a (anchor) element must contain text. The text may occur in the anchor text or in the title attribute of the anchor or in the Alt text of an image used within the anchor',
21
29
  }
@@ -21,7 +21,7 @@ export default {
21
21
  block_quote: 'Block Quote Settings',
22
22
  },
23
23
  errors: {
24
- input_limitations: 'Must be less than {0} characters.'
24
+ input_limitations: 'Must be less than {0} characters.',
25
25
  },
26
26
  upload_file: 'Upload File',
27
27
  alt_image: 'Alternate text for image',
@@ -1,3 +1,4 @@
1
1
  export default {
2
- error: "No se pudo generar una pregunta a partir del contenido proporcionado."
2
+ error: "No se pudo generar una pregunta a partir del contenido proporcionado.",
3
+ button_label: 'Generar pregunta'
3
4
  }
@@ -1,55 +1,5 @@
1
1
  export default {
2
- tabs: {
3
- video: 'Vídeo',
4
- poster: 'Póster',
5
- preroll: 'Preroll',
6
- postroll: 'Desplazamiento posterior',
7
- },
8
- forms: {
9
- unsaved: 'Tiene cambios sin guardar. ¿Te gustaría salvarlos?',
10
- cancel: 'Cancelar',
11
- confirm: 'Confirmar',
12
- },
13
- video: {
14
- title: 'Archivo de vídeo',
15
- configure_blurb:
16
- 'Cargue un archivo de video (.mp4 o .webm), elija uno del administrador de archivos o agréguelo a través de la URL pública',
17
- not_configured_title: 'Video no configurado',
18
- edit_prompt: 'Editar este bloque para empezar',
19
- autoplay: 'Reproducción automática al cargar',
20
- controls: 'Mostrar controles',
21
- loop: 'Vídeo en bucle',
22
- muted: 'Empezar silenciado',
23
- disablepictureinpicture: 'Desactivar botón de imagen en imagen',
24
- poster: 'Póster de vídeo',
25
- playback_rates: 'Tasas de reproducción',
26
- rewind: 'Permitir rebobinado de 10 segundos',
27
- playsinline:
28
- 'Deshabilitar pantalla completa y forzar visualización en línea',
29
- captionsmenu: 'Mostrar el interactivo menú de subtítulos',
30
- playlistmenu:
31
- 'Mostrar menú de lista de reproducción (requiere más de 1 video seleccionado para mostrar)',
32
- playlistautoadvance:
33
- 'Avanzar automáticamente la lista de reproducción al final de los medios',
34
- },
35
- caption: {
36
- title: 'Archivo de subtítulos',
37
- configure_blurb:
38
- 'Cargue un archivo de subtítulos (.vtt o .xml), elija uno del administrador de archivos o agréguelo a través de la URL pública',
39
- },
40
- poster: {
41
- title: 'Archivo de imagen de póster',
42
- configure_blurb:
43
- 'Cargue un archivo de póster (.png o .jpg), elija uno del administrador de archivos o agréguelo a través de la URL pública. Esta es la imagen que aparece antes de reproducir el video.',
44
- },
45
- preroll: {
46
- title: 'Archivo de vídeo predesplazamiento',
47
- configure_blurb:
48
- 'Cargue un archivo de video pre-roll (.mp4 o .webm), elija uno del administrador de archivos o agréguelo a través de la URL pública',
49
- },
50
- postroll: {
51
- title: 'Archivo de vídeo Post-roll',
52
- configure_blurb:
53
- 'Cargue un archivo de video post-roll (.mp4 o .webm), elija uno del administrador de archivos o agréguelo a través de la URL pública',
54
- },
2
+ not_configured_title: 'Video no configurado',
3
+ edit_prompt:
4
+ "Para comenzar a manipular el bloque,haga clic en el botón 'Editar'.",
55
5
  }
@@ -3,4 +3,5 @@ export default {
3
3
  add: 'Añadir acordeón',
4
4
  accordion: 'Acordeón',
5
5
  label: 'Texto del cuerpo del acordeón',
6
+ instructions: 'Haga clic en cada uno de los títulos a continuación para obtener más información.',
6
7
  }
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  instructions:
3
- 'Marque las respuestas abiertas para cotejar. Arrastra las indicaciones para establecer el orden en el que deseas que se cotejen las respuestas',
3
+ 'Marque los elementos de respuesta abiertos para recopilarlos en un documento.',
4
4
  include_prompts: 'Incluir mensajes',
5
5
  filename:
6
6
  'Nombre de archivo (en blanco para el nombre de la página actual)',
@@ -3,8 +3,8 @@ export default {
3
3
  description: 'Descripción',
4
4
  over_item_limit: 'No se pueden agregar más elementos',
5
5
  no_title: 'Sin título',
6
- item_title: 'Título del artículo',
7
- item_text: 'Texto del elemento',
6
+ item_title: 'Texto de elección',
7
+ item_text: 'Explicación de esta elección',
8
8
  correct_choice: 'Es la elección correcta',
9
9
  show_reset: 'Permitir reintentos',
10
10
  display_style: 'Estilo de visualización',
@@ -16,4 +16,5 @@ export default {
16
16
  letter: 'Letras',
17
17
  number: 'Números',
18
18
  },
19
+ add_choice: 'Agregar opción',
19
20
  }
@@ -4,4 +4,6 @@ export default {
4
4
  header: 'Encabezado de Pestaña',
5
5
  add_tab: 'Añadir pestaña',
6
6
  delete_tab: 'Borrar pestaña',
7
+ instructions:
8
+ 'Haga clic en cada uno de los títulos a continuación para obtener más información.',
7
9
  }
@@ -8,4 +8,5 @@ export default {
8
8
  all_excel: 'Hojas de cálculo - .xls y .xlsx',
9
9
  all_zip: 'Comprimido - .zip',
10
10
  },
11
+ instructions: 'Arrastre o haga clic aquí para cargar archivos.',
11
12
  }