execonvert 0.4.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 (143) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +194 -0
  3. package/THIRD_PARTY_NOTICES.md +42 -0
  4. package/bin/execonvert.js +21 -0
  5. package/dist/cli/app/public/THIRD_PARTY_NOTICES.md +32 -0
  6. package/dist/cli/app/public/base.elpx +0 -0
  7. package/dist/cli/app/public/exe_math_assets.zip +0 -0
  8. package/dist/cli/app/public/exelearning/app/common/common_i18n.js +79 -0
  9. package/dist/cli/app/public/exelearning/app/common/exe_powered_logo/exe_powered_logo.png +0 -0
  10. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.ca.js +79 -0
  11. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.de.js +79 -0
  12. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.en.js +79 -0
  13. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.eo.js +79 -0
  14. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.es.js +79 -0
  15. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.eu.js +79 -0
  16. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.gl.js +79 -0
  17. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.it.js +79 -0
  18. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.pt.js +79 -0
  19. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.ro.js +79 -0
  20. package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.va.js +79 -0
  21. package/dist/cli/app/public/exelearning/bundles/common.zip +0 -0
  22. package/dist/cli/app/public/exelearning/bundles/content-css.zip +0 -0
  23. package/dist/cli/app/public/exelearning/bundles/idevices.zip +0 -0
  24. package/dist/cli/app/public/exelearning/bundles/libs.zip +0 -0
  25. package/dist/cli/app/public/exelearning/bundles/manifest.json +110 -0
  26. package/dist/cli/app/public/exelearning/bundles/themes/base.zip +0 -0
  27. package/dist/cli/app/public/exelearning/bundles/themes/flux.zip +0 -0
  28. package/dist/cli/app/public/exelearning/bundles/themes/neo.zip +0 -0
  29. package/dist/cli/app/public/exelearning/bundles/themes/nova.zip +0 -0
  30. package/dist/cli/app/public/exelearning/bundles/themes/universal.zip +0 -0
  31. package/dist/cli/app/public/exelearning/bundles/themes/zen.zip +0 -0
  32. package/dist/cli/app/public/exelearning/exporters.bundle.js +12638 -0
  33. package/dist/cli/app/public/exelearning/importers.bundle.js +14061 -0
  34. package/dist/cli/app/public/exelearning/runtime-source.json +10 -0
  35. package/dist/cli/app/public/favicon.svg +11 -0
  36. package/dist/cli/app/public/idevices/text/text.css +16 -0
  37. package/dist/cli/app/public/idevices/text/text.html +3 -0
  38. package/dist/cli/app/public/idevices/text/text.js +291 -0
  39. package/dist/cli/app/public/info/cli.html +955 -0
  40. package/dist/cli/app/public/info/docx.svg +7 -0
  41. package/dist/cli/app/public/info/elpx-icon.png +0 -0
  42. package/dist/cli/app/public/info/exe-old.png +0 -0
  43. package/dist/cli/app/public/info/execonvert-cli-icon.svg +16 -0
  44. package/dist/cli/app/public/info/execonvert-icon.svg +11 -0
  45. package/dist/cli/app/public/info/index.html +723 -0
  46. package/dist/cli/app/public/info/markdown.svg +1 -0
  47. package/dist/cli/app/public/info/pdf.svg +14 -0
  48. package/dist/cli/app/public/libs/exe_math/LICENSE +202 -0
  49. package/dist/cli/app/public/libs/exe_math/a11y/assistive-mml.js +1 -0
  50. package/dist/cli/app/public/libs/exe_math/a11y/complexity.js +1 -0
  51. package/dist/cli/app/public/libs/exe_math/a11y/explorer.js +1 -0
  52. package/dist/cli/app/public/libs/exe_math/a11y/semantic-enrich.js +1 -0
  53. package/dist/cli/app/public/libs/exe_math/a11y/speech.js +1 -0
  54. package/dist/cli/app/public/libs/exe_math/a11y/sre.js +1 -0
  55. package/dist/cli/app/public/libs/exe_math/adaptors/jsdom.js +1 -0
  56. package/dist/cli/app/public/libs/exe_math/adaptors/linkedom.js +1 -0
  57. package/dist/cli/app/public/libs/exe_math/adaptors/liteDOM.js +1 -0
  58. package/dist/cli/app/public/libs/exe_math/core.js +1 -0
  59. package/dist/cli/app/public/libs/exe_math/input/asciimath.js +1 -0
  60. package/dist/cli/app/public/libs/exe_math/input/mml/entities.js +1 -0
  61. package/dist/cli/app/public/libs/exe_math/input/mml/extensions/mml3.js +1 -0
  62. package/dist/cli/app/public/libs/exe_math/input/mml/extensions/mml3.sef.json +1 -0
  63. package/dist/cli/app/public/libs/exe_math/input/mml.js +1 -0
  64. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/action.js +1 -0
  65. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/ams.js +1 -0
  66. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/amscd.js +1 -0
  67. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/autoload.js +1 -0
  68. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bbm.js +1 -0
  69. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bboldx.js +1 -0
  70. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bbox.js +1 -0
  71. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/begingroup.js +1 -0
  72. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/boldsymbol.js +1 -0
  73. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/braket.js +1 -0
  74. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bussproofs.js +1 -0
  75. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/cancel.js +1 -0
  76. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/cases.js +1 -0
  77. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/centernot.js +1 -0
  78. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/color.js +1 -0
  79. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/colortbl.js +1 -0
  80. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/colorv2.js +1 -0
  81. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/configmacros.js +1 -0
  82. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/dsfont.js +1 -0
  83. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/empheq.js +1 -0
  84. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/enclose.js +1 -0
  85. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/extpfeil.js +1 -0
  86. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/gensymb.js +1 -0
  87. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/html.js +1 -0
  88. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/mathtools.js +1 -0
  89. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/mhchem.js +34 -0
  90. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/newcommand.js +1 -0
  91. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/noerrors.js +1 -0
  92. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/noundefined.js +1 -0
  93. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/physics.js +1 -0
  94. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/require.js +1 -0
  95. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/setoptions.js +1 -0
  96. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/tagformat.js +1 -0
  97. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/texhtml.js +1 -0
  98. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/textcomp.js +1 -0
  99. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/textmacros.js +1 -0
  100. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/unicode.js +1 -0
  101. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/units.js +1 -0
  102. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/upgreek.js +1 -0
  103. package/dist/cli/app/public/libs/exe_math/input/tex/extensions/verb.js +1 -0
  104. package/dist/cli/app/public/libs/exe_math/input/tex-base.js +1 -0
  105. package/dist/cli/app/public/libs/exe_math/input/tex.js +1 -0
  106. package/dist/cli/app/public/libs/exe_math/loader.js +1 -0
  107. package/dist/cli/app/public/libs/exe_math/output/chtml.js +1 -0
  108. package/dist/cli/app/public/libs/exe_math/output/svg.js +1 -0
  109. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/af.json +146 -0
  110. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/base.json +137 -0
  111. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/ca.json +140 -0
  112. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/da.json +140 -0
  113. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/de.json +146 -0
  114. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/en.json +158 -0
  115. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/es.json +140 -0
  116. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/euro.json +32 -0
  117. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/fr.json +146 -0
  118. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/hi.json +146 -0
  119. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/it.json +146 -0
  120. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/ko.json +146 -0
  121. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nb.json +146 -0
  122. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nemeth.json +125 -0
  123. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nn.json +146 -0
  124. package/dist/cli/app/public/libs/exe_math/sre/mathmaps/sv.json +146 -0
  125. package/dist/cli/app/public/libs/exe_math/sre/require.d.mts +1 -0
  126. package/dist/cli/app/public/libs/exe_math/sre/require.mjs +2 -0
  127. package/dist/cli/app/public/libs/exe_math/sre/speech-worker.js +1 -0
  128. package/dist/cli/app/public/libs/exe_math/startup.js +1 -0
  129. package/dist/cli/app/public/libs/exe_math/tex-mml-svg.js +1 -0
  130. package/dist/cli/app/public/libs/exe_math/ui/lazy.js +1 -0
  131. package/dist/cli/app/public/libs/exe_math/ui/menu.js +1 -0
  132. package/dist/cli/app/public/libs/exe_math/ui/safe.js +1 -0
  133. package/dist/cli/cli/execonvert.js +807 -0
  134. package/dist/cli/cli/runtime.js +237 -0
  135. package/dist/cli/package.json +3 -0
  136. package/dist/cli/src/converter.js +5078 -0
  137. package/dist/cli/src/docx-import.js +1121 -0
  138. package/dist/cli/src/elpx-markdown.js +201 -0
  139. package/dist/cli/src/i18n.js +485 -0
  140. package/dist/cli/src/index.js +1 -0
  141. package/dist/cli/src/legacy-elp.js +846 -0
  142. package/dist/cli/src/markdown-import.js +26 -0
  143. package/package.json +68 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "sourceRepo": "https://github.com/exelearning/exelearning",
3
+ "sourceMode": "release",
4
+ "sourceReleaseTag": "v4.0.1",
5
+ "sourceReleaseAsset": "exelearning-static-v4.0.1.zip",
6
+ "sourceReleasePublishedAt": "2026-06-09T09:20:07Z",
7
+ "sourceCommit": "91d855aa799313aa77fc1f07771eb85ea17ccf94",
8
+ "sourceVersion": "4.0.1",
9
+ "syncedAt": "2026-06-25T06:16:41Z"
10
+ }
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <defs>
3
+ <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#5f9b3d;stop-opacity:1" />
5
+ <stop offset="100%" style="stop-color:#4e8332;stop-opacity:1" />
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="32" height="32" rx="6" fill="url(#grad1)" />
9
+ <path d="M10 12 L14 16 L10 20 M14 12 L18 16 L14 20 M22 16 H14" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
10
+ <path d="M10 16 H8" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" />
11
+ </svg>
@@ -0,0 +1,16 @@
1
+ /* Text iDevice (export CSS) */
2
+ .exe-text-activity div.inline {
3
+ display: flex;
4
+ }
5
+
6
+ .exe-text-activity div.inline dt {
7
+ margin: 0 0 0 auto;
8
+ }
9
+
10
+ .exe-text-activity div.inline dd {
11
+ margin-left: 10px;
12
+ }
13
+
14
+ .idevice_node.text .iDevice_buttons.feedback-button {
15
+ margin-bottom: 1em;
16
+ }
@@ -0,0 +1,3 @@
1
+ <div class="exe-text-template">
2
+ {content}
3
+ </div>
@@ -0,0 +1,291 @@
1
+ /**
2
+ * Form iDevice
3
+ *
4
+ * Released under Attribution-ShareAlike 4.0 International License.
5
+ * Author: SDWEB - Innovative Digital Solutions
6
+ *
7
+ * License: http://creativecommons.org/licenses/by-sa/4.0/
8
+ */
9
+ var $text = {
10
+ ideviceClass: 'textIdeviceContent',
11
+ working: false,
12
+ durationId: 'textInfoDurationInput',
13
+ durationTextId: 'textInfoDurationTextInput',
14
+ participantsId: 'textInfoParticipantsInput',
15
+ participantsTextId: 'textInfoParticipantsTextInput',
16
+ mainContentId: 'textTextarea',
17
+ feedbackTitleId: 'textFeedbackInput',
18
+ feedbackContentId: 'textFeedbackTextarea',
19
+
20
+ defaultBtnFeedbackText: $exe_i18n.showFeedback,
21
+
22
+ /**
23
+ * Engine execution order: 1
24
+ * Get the base html of the idevice view
25
+ */
26
+ renderView(data, accessibility, template) {
27
+ const hmltdata = $text.getHTMLView(data);
28
+ return template.replace('{content}', hmltdata);
29
+ },
30
+
31
+ getHTMLView(data, pathMedia) {
32
+ const isInExe = eXe.app.isInExe();
33
+ const durationText = isInExe
34
+ ? c_(data[this.durationTextId])
35
+ : data[this.durationTextId];
36
+ const participantsText = isInExe
37
+ ? c_(data[this.participantsTextId])
38
+ : data[this.participantsTextId];
39
+
40
+ let infoContentHTML = '';
41
+ if (data[this.durationId] || data[this.participantsId]) {
42
+ infoContentHTML = this.createInfoHTML(
43
+ data[this.durationId] === '' ? '' : durationText,
44
+ data[this.durationId],
45
+ data[this.participantsId] === '' ? '' : participantsText,
46
+ data[this.participantsId]
47
+ );
48
+ }
49
+
50
+ let contentHtml = data[this.mainContentId];
51
+
52
+ const temp = document.createElement('div');
53
+ temp.innerHTML = contentHtml;
54
+
55
+ const btnDiv = temp.querySelector('.feedback-button');
56
+ let buttonFeedBackText = data[this.feedbackTitleId];
57
+ if (btnDiv) {
58
+ const inputEl = btnDiv.querySelector('input.feedbackbutton');
59
+ if (inputEl)
60
+ buttonFeedBackText = isInExe
61
+ ? c_(inputEl.value)
62
+ : inputEl.value;
63
+ btnDiv.remove();
64
+ }
65
+
66
+ let feedBackHtml = data[this.feedbackContentId] || '';
67
+ const fbDiv = temp.querySelector('.feedback.js-feedback');
68
+ if (fbDiv) {
69
+ feedBackHtml = fbDiv.innerHTML;
70
+ fbDiv.remove();
71
+ }
72
+
73
+ contentHtml = temp.innerHTML;
74
+ if (feedBackHtml) {
75
+ buttonFeedBackText =
76
+ buttonFeedBackText === ''
77
+ ? this.defaultBtnFeedbackText
78
+ : buttonFeedBackText;
79
+ if (isInExe) buttonFeedBackText = c_(buttonFeedBackText);
80
+ }
81
+
82
+ data['textInfoParticipantsTextInput'] = participantsText;
83
+ data['textInfoDurationTextInput'] = durationText;
84
+ data['textTextarea'] = contentHtml;
85
+ data['textFeedbackInput'] = buttonFeedBackText;
86
+ data['textFeedbackTextarea'] = feedBackHtml;
87
+
88
+ const feedbackContentHTML =
89
+ feedBackHtml === ''
90
+ ? ''
91
+ : this.createFeedbackHTML(buttonFeedBackText, feedBackHtml);
92
+ const activityContent =
93
+ infoContentHTML +
94
+ contentHtml +
95
+ feedbackContentHTML +
96
+ `<p class="clearfix"></p>`;
97
+
98
+ let htmlContent = `<div class="${this.ideviceClass}">`;
99
+ htmlContent += this.createMainContent(activityContent);
100
+ htmlContent += `</div>`;
101
+
102
+ return htmlContent;
103
+ },
104
+
105
+ renderHtmlOldIdevice(data, $node) {
106
+ // Defensive: ensure $node is a jQuery object
107
+ if (!$node || !$node.length) return;
108
+
109
+ if (
110
+ $node.find('.pbl-task-description').length === 1 &&
111
+ (data[this.durationId] || data[this.participantsId])
112
+ ) {
113
+ const durationText = data[this.durationTextId];
114
+ const participantsText = data[this.participantsTextId];
115
+ const infoContentHTML = this.createInfoHTML(
116
+ data[this.durationId] === '' ? '' : durationText,
117
+ data[this.durationId],
118
+ data[this.participantsId] === '' ? '' : participantsText,
119
+ data[this.participantsId]
120
+ );
121
+
122
+ $node.prepend(infoContentHTML);
123
+ }
124
+
125
+ let buttonFeedBackText = data[this.feedbackTitleId] || '';
126
+ let feedBackHtml = data[this.feedbackContentId] || '';
127
+ const hasFeedbackNode = $node.find('.feedback.js-feedback').length > 0;
128
+ const hasFeedbackData = !!feedBackHtml;
129
+ const hasFeedbackButton = $node.find('.feedback-button').length > 0;
130
+
131
+ if (hasFeedbackData || hasFeedbackNode) {
132
+ const $btnDiv = $node.find('.feedback-button');
133
+ const hasInput =
134
+ $btnDiv.find('input.feedbacktooglebutton, input.feedbackbutton')
135
+ .length > 0;
136
+ if ($btnDiv.length && !hasInput) {
137
+ const btnText = buttonFeedBackText
138
+ ? buttonFeedBackText
139
+ : this.defaultBtnFeedbackText;
140
+ $btnDiv.append(
141
+ `<input type="button" class="feedbacktooglebutton" value="${btnText}" />`
142
+ );
143
+ } else if (!hasFeedbackButton) {
144
+ const feedbackButtonHTML = `
145
+ <div class="iDevice_buttons feedback-button js-required">
146
+ <input type="button" class="feedbacktooglebutton" value="${buttonFeedBackText || this.defaultBtnFeedbackText}" />
147
+ </div>`;
148
+ const $activity = $node.find('.exe-text');
149
+ if ($activity.length) {
150
+ $activity.append(feedbackButtonHTML);
151
+ } else {
152
+ $node.append(feedbackButtonHTML);
153
+ }
154
+ }
155
+ }
156
+
157
+ if (hasFeedbackData && !hasFeedbackNode) {
158
+ const feedbackContentHTML = `<div class="feedback js-feedback js-hidden">${feedBackHtml}</div>`;
159
+ const $activity = $node.find('.exe-text');
160
+ if ($activity.length) {
161
+ $activity.append(feedbackContentHTML);
162
+ } else {
163
+ $node.append(feedbackContentHTML);
164
+ }
165
+ }
166
+
167
+ if ($node.find('.clearfix').length === 0) {
168
+ const $activity = $node.find('.exe-text');
169
+ if ($activity.length) {
170
+ $activity.append('<p class="clearfix"></p>');
171
+ } else {
172
+ $node.append('<p class="clearfix"></p>');
173
+ }
174
+ }
175
+ },
176
+
177
+ /**
178
+ * Engine execution order: 2
179
+ * Add behavior and functionalities
180
+ */
181
+ renderBehaviour(data, accessibility, ideviceId) {
182
+ const $node = $('#' + data.ideviceId);
183
+ const isInExe = eXe.app.isInExe();
184
+
185
+ const $btn = $(
186
+ `#${data.ideviceId} input.feedbackbutton, #${data.ideviceId} input.feedbacktooglebutton`
187
+ );
188
+ if ($btn.length === 1) {
189
+ const [textA, textB = textA] = $btn.val().split('|');
190
+ $btn.val(textA)
191
+ .attr('data-text-a', textA)
192
+ .attr('data-text-b', textB);
193
+ $btn.off('click')
194
+ .closest('.feedback-button')
195
+ .removeClass('clearfix');
196
+
197
+ $btn.on('click', function () {
198
+ if ($text.working) return false;
199
+ $text.working = true;
200
+ const btn = $(this);
201
+ const feedbackEl = btn
202
+ .closest('.feedback-button')
203
+ .next('.feedback');
204
+
205
+ if (feedbackEl.is(':visible')) {
206
+ btn.val(btn.attr('data-text-a'));
207
+ feedbackEl.fadeOut(() => {
208
+ $text.working = false;
209
+ });
210
+ } else {
211
+ btn.val(btn.attr('data-text-b'));
212
+ feedbackEl.fadeIn(() => {
213
+ $text.working = false;
214
+ });
215
+ }
216
+ $exeDevices.iDevice.gamification.math.updateLatex(
217
+ '.exe-text-template'
218
+ );
219
+ });
220
+ }
221
+ const dataString = $node.html() || '';
222
+ const hasLatex =
223
+ $exeDevices.iDevice.gamification.math.hasLatex(dataString);
224
+
225
+ if (!hasLatex) return;
226
+ const mathjaxLoaded = typeof window.MathJax !== 'undefined';
227
+
228
+ if (!mathjaxLoaded) {
229
+ $exeDevices.iDevice.gamification.math.loadMathJax();
230
+ } else {
231
+ $exeDevices.iDevice.gamification.math.updateLatex(
232
+ '.exe-text-template'
233
+ );
234
+ }
235
+ },
236
+
237
+ replaceResourceDirectoryPaths(newDir, htmlString) {
238
+ let dir = newDir.trim();
239
+ if (!dir.endsWith('/')) dir += '/';
240
+ const custom = $('html').is('#exe-index') ? 'custom/' : '../custom/';
241
+
242
+ const parser = new DOMParser();
243
+ const doc = parser.parseFromString(htmlString, 'text/html');
244
+ doc.querySelectorAll(
245
+ 'img[src], video[src], audio[src], a[href]'
246
+ ).forEach((el) => {
247
+ const attr = el.hasAttribute('src') ? 'src' : 'href';
248
+ const val = el.getAttribute(attr).trim();
249
+
250
+ if (/^\/?files\//.test(val)) {
251
+ const filename = val.split('/').pop() || '';
252
+ if (val.indexOf('file_manager') === -1) {
253
+ el.setAttribute(attr, dir + filename);
254
+ } else {
255
+ el.setAttribute(attr, custom + filename);
256
+ }
257
+ }
258
+ });
259
+ return doc.body.innerHTML;
260
+ },
261
+
262
+ init(data, accessibility) {},
263
+
264
+ createMainContent(content) {
265
+ return `
266
+ <div class="exe-text-activity">
267
+ <div>${content}</div>
268
+ </div>`;
269
+ },
270
+
271
+ createInfoHTML(
272
+ durationText,
273
+ durationValue,
274
+ participantsText,
275
+ participantsValue
276
+ ) {
277
+ return `
278
+ <dl>
279
+ <div class="inline"><dt><span title="${durationText}">${durationText}</span></dt><dd>${durationValue}</dd></div>
280
+ <div class="inline"><dt><span title="${participantsText}">${participantsText}</span></dt><dd>${participantsValue}</dd></div>
281
+ </dl>`;
282
+ },
283
+
284
+ createFeedbackHTML(title, content) {
285
+ return `
286
+ <div class="iDevice_buttons feedback-button js-required">
287
+ <input type="button" class="feedbacktooglebutton" value="${title}">
288
+ </div>
289
+ <div class="feedback js-feedback js-hidden">${content}</div>`;
290
+ },
291
+ };