fcad-core-dragon 2.1.0 → 2.1.2
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/.editorconfig +7 -7
- package/.gitlab-ci.yml +124 -0
- package/.prettierrc +11 -11
- package/.vscode/extensions.json +8 -8
- package/.vscode/settings.json +46 -16
- package/CHANGELOG +520 -520
- package/README.md +57 -57
- package/documentation/.vitepress/config.js +114 -114
- package/documentation/api-examples.md +49 -49
- package/documentation/composants/app-base-button.md +58 -58
- package/documentation/composants/app-base-error-display.md +59 -59
- package/documentation/composants/app-base-popover.md +68 -68
- package/documentation/composants/app-comp-audio.md +75 -75
- package/documentation/composants/app-comp-branch-buttons.md +111 -111
- package/documentation/composants/app-comp-button-progress.md +53 -53
- package/documentation/composants/app-comp-carousel.md +53 -53
- package/documentation/composants/app-comp-container.md +53 -53
- package/documentation/composants/app-comp-input-checkbox-next.md +42 -42
- package/documentation/composants/app-comp-input-dropdown-next.md +34 -34
- package/documentation/composants/app-comp-input-radio-next.md +39 -39
- package/documentation/composants/app-comp-input-text-next.md +35 -35
- package/documentation/composants/app-comp-input-text-table-next.md +34 -34
- package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -53
- package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -31
- package/documentation/composants/app-comp-jauge.md +31 -31
- package/documentation/composants/app-comp-menu-item.md +55 -55
- package/documentation/composants/app-comp-menu.md +29 -29
- package/documentation/composants/app-comp-navigation.md +41 -41
- package/documentation/composants/app-comp-note-call.md +53 -53
- package/documentation/composants/app-comp-note-credit.md +53 -53
- package/documentation/composants/app-comp-play-bar-next.md +53 -53
- package/documentation/composants/app-comp-pop-up-next.md +93 -93
- package/documentation/composants/app-comp-quiz-next.md +235 -235
- package/documentation/composants/app-comp-quiz-recall.md +53 -53
- package/documentation/composants/app-comp-svg-next.md +53 -53
- package/documentation/composants/app-comp-table-of-content.md +50 -50
- package/documentation/composants/app-comp-video-player.md +82 -82
- package/documentation/composants.md +46 -46
- package/documentation/composants_critiques/ModelPageComposant.md +53 -53
- package/documentation/composants_critiques/app-base-module.md +43 -43
- package/documentation/composants_critiques/app-base-page.md +48 -48
- package/documentation/composants_critiques/app-base.md +311 -311
- package/documentation/composants_critiques/main.md +15 -15
- package/documentation/demarrage.md +50 -50
- package/documentation/deploiement.md +57 -57
- package/documentation/index.md +33 -33
- package/documentation/markdown-examples.md +85 -85
- package/documentation/public/vite.svg +14 -14
- package/documentation/public/vuejs.svg +1 -1
- package/documentation/public/vuetify.svg +5 -5
- package/eslint.config.js +60 -60
- package/junit-report.xml +182 -0
- package/package.json +66 -59
- package/playwright/index.html +12 -0
- package/playwright/index.js +21 -0
- package/playwright-ct.config.js +95 -0
- package/src/$locales/en.json +157 -157
- package/src/$locales/fr.json +120 -120
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +1171 -1169
- package/src/components/AppBaseButton.vue +90 -95
- package/src/components/AppBaseErrorDisplay.vue +438 -438
- package/src/components/AppBaseFlipCard.vue +84 -84
- package/src/components/AppBaseModule.vue +1639 -1634
- package/src/components/AppBasePage.vue +3 -2
- package/src/components/AppBasePopover.vue +41 -41
- package/src/components/AppBaseSkeleton.vue +66 -66
- package/src/components/AppCompAudio.vue +261 -256
- package/src/components/AppCompBranchButtons.vue +508 -508
- package/src/components/AppCompButtonProgress.vue +137 -132
- package/src/components/AppCompCarousel.vue +342 -336
- package/src/components/AppCompContainer.vue +29 -29
- package/src/components/AppCompInputCheckBoxNx.vue +325 -323
- package/src/components/AppCompInputDropdownNx.vue +302 -299
- package/src/components/AppCompInputRadioNx.vue +287 -284
- package/src/components/AppCompInputTextNx.vue +156 -153
- package/src/components/AppCompInputTextTableNx.vue +205 -202
- package/src/components/AppCompInputTextToFillDropdownNx.vue +343 -340
- package/src/components/AppCompInputTextToFillNx.vue +316 -313
- package/src/components/AppCompJauge.vue +81 -81
- package/src/components/AppCompMenu.vue +6 -2
- package/src/components/AppCompMenuItem.vue +246 -240
- package/src/components/AppCompNavigation.vue +977 -972
- package/src/components/AppCompNoteCall.vue +167 -161
- package/src/components/AppCompNoteCredit.vue +496 -491
- package/src/components/AppCompPlayBarNext.vue +2290 -2288
- package/src/components/AppCompPopUpNext.vue +508 -504
- package/src/components/AppCompQuizNext.vue +515 -510
- package/src/components/AppCompQuizRecall.vue +355 -350
- package/src/components/AppCompSVGNext.vue +346 -346
- package/src/components/AppCompSettingsMenu.vue +177 -172
- package/src/components/AppCompTableOfContent.vue +433 -427
- package/src/components/AppCompVideoPlayer.vue +377 -377
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/BaseModule.vue +55 -55
- package/src/composables/useIdleDetector.js +56 -56
- package/src/composables/useQuiz.js +89 -89
- package/src/composables/useTimer.js +172 -172
- package/src/directives/nvdaFix.js +53 -53
- package/src/externalComps/ModuleView.vue +22 -22
- package/src/externalComps/SummaryView.vue +91 -91
- package/src/main.js +493 -476
- package/src/module/stores/appStore.js +960 -947
- package/src/module/xapi/ADL.js +520 -520
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/launch.js +157 -157
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/wrapper.js +1895 -1895
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/analytics.js +34 -34
- package/src/plugins/bus.js +12 -8
- package/src/plugins/gsap.js +17 -15
- package/src/plugins/helper.js +355 -358
- package/src/plugins/i18n.js +27 -26
- package/src/plugins/idb.js +227 -227
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -33
- package/src/router/index.js +57 -57
- package/src/router/routes.js +312 -312
- package/src/shared/generalfuncs.js +344 -344
- package/src/shared/validators.js +1018 -1018
- package/tests/component/AppBaseButton.spec.js +53 -0
- package/tests/component/pinia.spec.js +24 -0
- package/{src/components/tests__ → tests/unit}/AppBaseButton.spec.js +53 -53
- package/tests/unit/AppCompInputCheckBoxNx.spec.js +59 -0
- package/tests/unit/AppCompInputDropdownNx.spec.js +51 -0
- package/tests/unit/AppCompInputRadioNx.spec.js +59 -0
- package/tests/unit/AppCompInputTextNx.spec.js +44 -0
- package/tests/unit/AppCompInputTextTableNx.spec.js +77 -0
- package/tests/unit/AppCompInputTextToFillDropdownNx.spec.js +60 -0
- package/tests/unit/AppCompInputTextToFillNx.spec.js +45 -0
- package/tests/unit/AppCompQuizNext.spec.js +114 -0
- package/tests/unit/AppCompVideoPlayer.spec.js +177 -0
- package/{src/components/tests__ → tests/unit}/useTimer.spec.js +91 -91
- package/vitest.config.js +28 -19
- package/vitest.setup.js +28 -0
- package/src/components/AppBaseButton.test.js +0 -21
package/src/main.js
CHANGED
|
@@ -1,476 +1,493 @@
|
|
|
1
|
-
import AppBase from './components/AppBase.vue'
|
|
2
|
-
import AppBaseButton from './components/AppBaseButton.vue'
|
|
3
|
-
import AppBaseModule from './components/AppBaseModule.vue'
|
|
4
|
-
import AppBasePage from './components/AppBasePage.vue'
|
|
5
|
-
import AppBaseFlipCard from './components/AppBaseFlipCard.vue'
|
|
6
|
-
import AppBasePopover from './components/AppBasePopover.vue'
|
|
7
|
-
import AppCompJauge from './components/AppCompJauge.vue'
|
|
8
|
-
import AppBaseErrorDisplay from './components/AppBaseErrorDisplay.vue'
|
|
9
|
-
//import AppCompBif from './components/AppCompBif.vue'
|
|
10
|
-
import AppCompAudio from './components/AppCompAudio.vue'
|
|
11
|
-
import AppCompBranchButtons from './components/AppCompBranchButtons.vue'
|
|
12
|
-
import AppCompCarousel from './components/AppCompCarousel.vue'
|
|
13
|
-
import AppCompViewDisplay from './components/AppCompViewDisplay.vue'
|
|
14
|
-
import AppCompTableOfContent from './components/AppCompTableOfContent.vue'
|
|
15
|
-
import AppCompMenu from './components/AppCompMenu.vue'
|
|
16
|
-
import AppCompMenuItem from './components/AppCompMenuItem.vue'
|
|
17
|
-
import AppCompPopUpNext from './components/AppCompPopUpNext.vue'
|
|
18
|
-
import AppCompNavigation from './components/AppCompNavigation.vue'
|
|
19
|
-
import AppCompNoteCall from './components/AppCompNoteCall.vue'
|
|
20
|
-
import AppCompNoteCredit from './components/AppCompNoteCredit.vue'
|
|
21
|
-
import AppCompVideoPlayer from './components/AppCompVideoPlayer.vue'
|
|
22
|
-
import AppCompPlayBarNext from './components/AppCompPlayBarNext.vue'
|
|
23
|
-
import AppCompQuizNext from './components/AppCompQuizNext.vue'
|
|
24
|
-
import AppCompQuizRecall from './components/AppCompQuizRecall.vue'
|
|
25
|
-
import AppBaseSkeleton from './components/AppBaseSkeleton.vue'
|
|
26
|
-
|
|
27
|
-
import GsapPlugin from './plugins/gsap'
|
|
28
|
-
import eventBus from './plugins/bus'
|
|
29
|
-
import helper from './plugins/helper'
|
|
30
|
-
import analytics from './plugins/analytics'
|
|
31
|
-
import mergeLocales from './plugins/i18n'
|
|
32
|
-
import { scormPlugin } from './plugins/scorm'
|
|
33
|
-
import { xapiPlugin } from './plugins/xapi'
|
|
34
|
-
import { $idb } from './plugins/idb'
|
|
35
|
-
import { validatefileContent } from './shared/validators.js'
|
|
36
|
-
import { createPinia } from 'pinia'
|
|
37
|
-
import { useAppStore } from './module/stores/appStore.js'
|
|
38
|
-
import axios from 'axios'
|
|
39
|
-
import AppCompSVGNext from './components/AppCompSVGNext.vue'
|
|
40
|
-
import VueSafeTeleport from 'vue-safe-teleport'
|
|
41
|
-
import { FocusTrap } from 'focus-trap-vue'
|
|
42
|
-
import nvdaFix from './directives/nvdaFix.js'
|
|
43
|
-
|
|
44
|
-
const pinia = createPinia()
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
install(app, options) {
|
|
48
|
-
app.use(pinia)
|
|
49
|
-
app.use(scormPlugin
|
|
50
|
-
app.use(GsapPlugin
|
|
51
|
-
app.use(xapiPlugin
|
|
52
|
-
app.use(VueSafeTeleport)
|
|
53
|
-
app.component('FocusTrap', FocusTrap)
|
|
54
|
-
|
|
55
|
-
app.
|
|
56
|
-
app.use($idb)
|
|
57
|
-
|
|
58
|
-
app.component('AppBase', AppBase)
|
|
59
|
-
app.component('AppBaseButton', AppBaseButton)
|
|
60
|
-
app.component('AppBaseModule', AppBaseModule)
|
|
61
|
-
app.component('AppBasePage', AppBasePage)
|
|
62
|
-
app.component('AppBaseFlipCard', AppBaseFlipCard)
|
|
63
|
-
app.component('AppBaseErrorDisplay', AppBaseErrorDisplay)
|
|
64
|
-
app.component('AppCompMenu', AppCompMenu)
|
|
65
|
-
//app.component('app-comp-bif', AppCompBif)
|
|
66
|
-
app.component('AppCompAudioPlayer', AppCompAudio)
|
|
67
|
-
app.component('AppCompBranchButtons', AppCompBranchButtons)
|
|
68
|
-
app.component('AppCompCarousel', AppCompCarousel)
|
|
69
|
-
app.component('AppCompMenuItem', AppCompMenuItem)
|
|
70
|
-
app.component('AppCompJauge', AppCompJauge)
|
|
71
|
-
app.component('AppCompTableOfContent', AppCompTableOfContent)
|
|
72
|
-
app.component('AppCompPopUpNext', AppCompPopUpNext)
|
|
73
|
-
app.component('AppCompNavigation', AppCompNavigation)
|
|
74
|
-
app.component('AppCompNoteCredit', AppCompNoteCredit)
|
|
75
|
-
app.component('AppCompNoteCall', AppCompNoteCall)
|
|
76
|
-
app.component('AppBasePopover', AppBasePopover)
|
|
77
|
-
app.component('AppCompVideoPlayer', AppCompVideoPlayer)
|
|
78
|
-
app.component('AppCompPlayBarNext', AppCompPlayBarNext)
|
|
79
|
-
app.component('AppCompQuizNext', AppCompQuizNext)
|
|
80
|
-
app.component('AppIconsNext', AppCompSVGNext)
|
|
81
|
-
app.component('AppCompQuizRecall', AppCompQuizRecall)
|
|
82
|
-
app.component('AppBaseSkeleton', AppBaseSkeleton)
|
|
83
|
-
app.component(AppCompViewDisplay)
|
|
84
|
-
|
|
85
|
-
if (!options)
|
|
86
|
-
throw new Error(
|
|
87
|
-
'💥You did not provide i18n and vuex store. Please install and provide them.'
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
const requiredOptions = ['i18n', 'menuSettings']
|
|
91
|
-
const errorMissing = {
|
|
92
|
-
i18n: { a: 'Internationalisation', b: 'vue-I18n' },
|
|
93
|
-
menuSettings: { a: 'Menu Settings file', b: 'menuSettings' }
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/*Watch for appBase data received in the store
|
|
97
|
-
*To set connection Info
|
|
98
|
-
*To set the connection with indexDB
|
|
99
|
-
*To fetch data from servers /storage
|
|
100
|
-
*To set document lang
|
|
101
|
-
*/
|
|
102
|
-
const appStore = useAppStore()
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
auth,
|
|
127
|
-
endpoint,
|
|
128
|
-
registration
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
let
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
const
|
|
391
|
-
email: actorMbox,
|
|
392
|
-
activityId,
|
|
393
|
-
verb: '
|
|
394
|
-
}
|
|
395
|
-
const
|
|
396
|
-
email: actorMbox,
|
|
397
|
-
activityId
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
//=================================
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
1
|
+
import AppBase from './components/AppBase.vue'
|
|
2
|
+
import AppBaseButton from './components/AppBaseButton.vue'
|
|
3
|
+
import AppBaseModule from './components/AppBaseModule.vue'
|
|
4
|
+
import AppBasePage from './components/AppBasePage.vue'
|
|
5
|
+
import AppBaseFlipCard from './components/AppBaseFlipCard.vue'
|
|
6
|
+
import AppBasePopover from './components/AppBasePopover.vue'
|
|
7
|
+
import AppCompJauge from './components/AppCompJauge.vue'
|
|
8
|
+
import AppBaseErrorDisplay from './components/AppBaseErrorDisplay.vue'
|
|
9
|
+
//import AppCompBif from './components/AppCompBif.vue'
|
|
10
|
+
import AppCompAudio from './components/AppCompAudio.vue'
|
|
11
|
+
import AppCompBranchButtons from './components/AppCompBranchButtons.vue'
|
|
12
|
+
import AppCompCarousel from './components/AppCompCarousel.vue'
|
|
13
|
+
import AppCompViewDisplay from './components/AppCompViewDisplay.vue'
|
|
14
|
+
import AppCompTableOfContent from './components/AppCompTableOfContent.vue'
|
|
15
|
+
import AppCompMenu from './components/AppCompMenu.vue'
|
|
16
|
+
import AppCompMenuItem from './components/AppCompMenuItem.vue'
|
|
17
|
+
import AppCompPopUpNext from './components/AppCompPopUpNext.vue'
|
|
18
|
+
import AppCompNavigation from './components/AppCompNavigation.vue'
|
|
19
|
+
import AppCompNoteCall from './components/AppCompNoteCall.vue'
|
|
20
|
+
import AppCompNoteCredit from './components/AppCompNoteCredit.vue'
|
|
21
|
+
import AppCompVideoPlayer from './components/AppCompVideoPlayer.vue'
|
|
22
|
+
import AppCompPlayBarNext from './components/AppCompPlayBarNext.vue'
|
|
23
|
+
import AppCompQuizNext from './components/AppCompQuizNext.vue'
|
|
24
|
+
import AppCompQuizRecall from './components/AppCompQuizRecall.vue'
|
|
25
|
+
import AppBaseSkeleton from './components/AppBaseSkeleton.vue'
|
|
26
|
+
|
|
27
|
+
import GsapPlugin from './plugins/gsap'
|
|
28
|
+
import eventBus from './plugins/bus'
|
|
29
|
+
import helper from './plugins/helper'
|
|
30
|
+
import analytics from './plugins/analytics'
|
|
31
|
+
import mergeLocales from './plugins/i18n'
|
|
32
|
+
import { scormPlugin } from './plugins/scorm'
|
|
33
|
+
import { xapiPlugin } from './plugins/xapi'
|
|
34
|
+
import { $idb } from './plugins/idb'
|
|
35
|
+
import { validatefileContent } from './shared/validators.js'
|
|
36
|
+
import { createPinia } from 'pinia'
|
|
37
|
+
import { useAppStore } from './module/stores/appStore.js'
|
|
38
|
+
import axios from 'axios'
|
|
39
|
+
import AppCompSVGNext from './components/AppCompSVGNext.vue'
|
|
40
|
+
import VueSafeTeleport from 'vue-safe-teleport'
|
|
41
|
+
import { FocusTrap } from 'focus-trap-vue'
|
|
42
|
+
import nvdaFix from './directives/nvdaFix.js'
|
|
43
|
+
import pckg from '../package.json'
|
|
44
|
+
const pinia = createPinia()
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
install(app, options) {
|
|
48
|
+
app.use(pinia)
|
|
49
|
+
app.use(scormPlugin)
|
|
50
|
+
app.use(GsapPlugin)
|
|
51
|
+
app.use(xapiPlugin)
|
|
52
|
+
app.use(VueSafeTeleport)
|
|
53
|
+
app.component('FocusTrap', FocusTrap)
|
|
54
|
+
|
|
55
|
+
app.use(eventBus)
|
|
56
|
+
app.use($idb)
|
|
57
|
+
|
|
58
|
+
app.component('AppBase', AppBase)
|
|
59
|
+
app.component('AppBaseButton', AppBaseButton)
|
|
60
|
+
app.component('AppBaseModule', AppBaseModule)
|
|
61
|
+
app.component('AppBasePage', AppBasePage)
|
|
62
|
+
app.component('AppBaseFlipCard', AppBaseFlipCard)
|
|
63
|
+
app.component('AppBaseErrorDisplay', AppBaseErrorDisplay)
|
|
64
|
+
app.component('AppCompMenu', AppCompMenu)
|
|
65
|
+
//app.component('app-comp-bif', AppCompBif)
|
|
66
|
+
app.component('AppCompAudioPlayer', AppCompAudio)
|
|
67
|
+
app.component('AppCompBranchButtons', AppCompBranchButtons)
|
|
68
|
+
app.component('AppCompCarousel', AppCompCarousel)
|
|
69
|
+
app.component('AppCompMenuItem', AppCompMenuItem)
|
|
70
|
+
app.component('AppCompJauge', AppCompJauge)
|
|
71
|
+
app.component('AppCompTableOfContent', AppCompTableOfContent)
|
|
72
|
+
app.component('AppCompPopUpNext', AppCompPopUpNext)
|
|
73
|
+
app.component('AppCompNavigation', AppCompNavigation)
|
|
74
|
+
app.component('AppCompNoteCredit', AppCompNoteCredit)
|
|
75
|
+
app.component('AppCompNoteCall', AppCompNoteCall)
|
|
76
|
+
app.component('AppBasePopover', AppBasePopover)
|
|
77
|
+
app.component('AppCompVideoPlayer', AppCompVideoPlayer)
|
|
78
|
+
app.component('AppCompPlayBarNext', AppCompPlayBarNext)
|
|
79
|
+
app.component('AppCompQuizNext', AppCompQuizNext)
|
|
80
|
+
app.component('AppIconsNext', AppCompSVGNext)
|
|
81
|
+
app.component('AppCompQuizRecall', AppCompQuizRecall)
|
|
82
|
+
app.component('AppBaseSkeleton', AppBaseSkeleton)
|
|
83
|
+
app.component(AppCompViewDisplay)
|
|
84
|
+
|
|
85
|
+
if (!options)
|
|
86
|
+
throw new Error(
|
|
87
|
+
'💥You did not provide i18n and vuex store. Please install and provide them.'
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const requiredOptions = ['i18n', 'menuSettings']
|
|
91
|
+
const errorMissing = {
|
|
92
|
+
i18n: { a: 'Internationalisation', b: 'vue-I18n' },
|
|
93
|
+
menuSettings: { a: 'Menu Settings file', b: 'menuSettings' }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*Watch for appBase data received in the store
|
|
97
|
+
*To set connection Info
|
|
98
|
+
*To set the connection with indexDB
|
|
99
|
+
*To fetch data from servers /storage
|
|
100
|
+
*To set document lang
|
|
101
|
+
*/
|
|
102
|
+
const appStore = useAppStore()
|
|
103
|
+
const { name, version } = pckg
|
|
104
|
+
|
|
105
|
+
appStore.setAppPackageInfo({
|
|
106
|
+
packageVersion: `v${version}`,
|
|
107
|
+
packageName: name
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const unsubscribeToSetConfig = appStore.$onAction(
|
|
111
|
+
({
|
|
112
|
+
name, // name of the action
|
|
113
|
+
store, // store instance, same as `someStore`
|
|
114
|
+
args, // array of parameters passed to the action
|
|
115
|
+
after // hook after the action returns or resolves
|
|
116
|
+
}) => {
|
|
117
|
+
after(async (result) => {
|
|
118
|
+
if (name !== 'initializeApp') return
|
|
119
|
+
let { appConfigs } = appStore.$state
|
|
120
|
+
let { remote = false, specification } = appConfigs
|
|
121
|
+
const c = await configConnection(appConfigs)
|
|
122
|
+
store.lrsConfig = c
|
|
123
|
+
const { $scorm, $xapi, $idb } = app.config.globalProperties
|
|
124
|
+
if (specification == 'xapi') {
|
|
125
|
+
const {
|
|
126
|
+
auth,
|
|
127
|
+
endpoint,
|
|
128
|
+
registration = $xapi.ruuid()
|
|
129
|
+
} = store.lrsConfig
|
|
130
|
+
|
|
131
|
+
const config = {
|
|
132
|
+
auth,
|
|
133
|
+
endpoint,
|
|
134
|
+
registration,
|
|
135
|
+
activity_platform: `SIPI_organizationId`
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
$xapi._configLRS(config) // configure and launch LRS
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//Configure connection with the Data from appBase
|
|
142
|
+
//===================================================
|
|
143
|
+
|
|
144
|
+
const activity_id = c ? c.activity_id : null
|
|
145
|
+
|
|
146
|
+
//Redefine actor with value from connection informtion
|
|
147
|
+
if (c && c.actor) appConfigs.actor = c.actor
|
|
148
|
+
|
|
149
|
+
//========================FETCHING EXISTING DATA AND SETTING STORE STATE===========================
|
|
150
|
+
/*Fetch user existing data from the server
|
|
151
|
+
and set/update initial state of the store
|
|
152
|
+
*/
|
|
153
|
+
const res = await fetchDatasFromServer({
|
|
154
|
+
$scorm,
|
|
155
|
+
$xapi,
|
|
156
|
+
$idb,
|
|
157
|
+
activity_id,
|
|
158
|
+
...appConfigs
|
|
159
|
+
})
|
|
160
|
+
//Update the store state
|
|
161
|
+
|
|
162
|
+
if (res) {
|
|
163
|
+
const {
|
|
164
|
+
routeHistory,
|
|
165
|
+
userSettings = {},
|
|
166
|
+
progress,
|
|
167
|
+
playbarValues = null,
|
|
168
|
+
lessonPosition = null,
|
|
169
|
+
completedState = null
|
|
170
|
+
} = res
|
|
171
|
+
|
|
172
|
+
appStore.setUserMetaData(progress)
|
|
173
|
+
appStore.setRouteHistory(routeHistory)
|
|
174
|
+
appStore.setApplicationSettings(userSettings)
|
|
175
|
+
|
|
176
|
+
if (playbarValues)
|
|
177
|
+
appStore.$state.mediaPlaybarValues = playbarValues
|
|
178
|
+
|
|
179
|
+
if (lessonPosition) appStore.setLessonPosition(lessonPosition)
|
|
180
|
+
if (completedState) appStore.setCompletionState(completedState)
|
|
181
|
+
}
|
|
182
|
+
//Open Connection to IDB and Save the store state to localDB
|
|
183
|
+
let dbStoreActive =
|
|
184
|
+
!window.location.hostname.includes('cegepadistance.ca') && !remote
|
|
185
|
+
|
|
186
|
+
if (dbStoreActive) {
|
|
187
|
+
console.log(`🏬 IDB Store active!`)
|
|
188
|
+
await $idb.openDB()
|
|
189
|
+
await $idb.saveState(appStore, appConfigs.idb_id)
|
|
190
|
+
}
|
|
191
|
+
//Update Loaging state
|
|
192
|
+
appStore.userDataLoaded = true
|
|
193
|
+
|
|
194
|
+
//Set document lang attribute (wcag request)
|
|
195
|
+
document.documentElement.setAttribute('lang', appConfigs.lang)
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
app.directive('nvda-fix', nvdaFix)
|
|
200
|
+
app.provide('unsubscribeToSetConfig', unsubscribeToSetConfig)
|
|
201
|
+
|
|
202
|
+
/* Check that required options are provided */
|
|
203
|
+
requiredOptions.forEach((key) => {
|
|
204
|
+
// required key is missing in $data that was passed for the page
|
|
205
|
+
if (!Object.keys(options).includes(key)) {
|
|
206
|
+
throw new Error(
|
|
207
|
+
`👉${errorMissing[key].a}👈 is not provided. Please install and provide 👉${errorMissing[key].b}👈.`
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (key === 'menuSettings') {
|
|
212
|
+
const mapAct = appStore.$state.thisModule.activities
|
|
213
|
+
if (!mapAct) return
|
|
214
|
+
const keys4Lesson = ['lessonTitle', 'lessonNumber', ...mapAct.keys()]
|
|
215
|
+
const keys4ActivityOpt = ['title', 'subTitle']
|
|
216
|
+
const keys4ActivityMandatory = ['time', 'anchors']
|
|
217
|
+
const keys4Anchors = ['anchorName', 'pageRef', 'page']
|
|
218
|
+
|
|
219
|
+
const errChecked = validatefileContent(
|
|
220
|
+
'menuSettings',
|
|
221
|
+
options.menuSettings,
|
|
222
|
+
{
|
|
223
|
+
keys4Lesson,
|
|
224
|
+
keys4ActivityMandatory,
|
|
225
|
+
keys4ActivityOpt,
|
|
226
|
+
keys4Anchors
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
if (errChecked) {
|
|
230
|
+
appStore.errMenuSetting = errChecked
|
|
231
|
+
} else {
|
|
232
|
+
appStore.errMenuSetting = false
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
window.App_DEBUGMODE = false
|
|
238
|
+
|
|
239
|
+
/* Local Method to configurate the connection info */
|
|
240
|
+
const configConnection = async (data) => {
|
|
241
|
+
let connectionInfo
|
|
242
|
+
|
|
243
|
+
switch (true) {
|
|
244
|
+
case window.location.origin.includes('cegepadistance.ca'): {
|
|
245
|
+
if (data.specification == 'scorm') {
|
|
246
|
+
connectionInfo = {
|
|
247
|
+
remote: true,
|
|
248
|
+
endpoint: 'scorm'
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
try {
|
|
252
|
+
// Accessing User && Activity Info from Url parametters
|
|
253
|
+
const queryString = window.location.search
|
|
254
|
+
const urlParams = new URLSearchParams(queryString)
|
|
255
|
+
let c // Initialize connection object
|
|
256
|
+
//Get User && Activity info
|
|
257
|
+
if (urlParams.get('actor') && urlParams.get('activity_id')) {
|
|
258
|
+
c = {
|
|
259
|
+
actor: JSON.parse(urlParams.get('actor')),
|
|
260
|
+
activity_id: urlParams.get('activity_id'),
|
|
261
|
+
endpoint: urlParams.get('endpoint'),
|
|
262
|
+
registration: urlParams.get('registration'),
|
|
263
|
+
remote: true
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Get LRS autorisation info from serveur
|
|
267
|
+
const request = await axios.get('../../configs-xapi/xapi.json')
|
|
268
|
+
|
|
269
|
+
const { basicauth } = request.data
|
|
270
|
+
|
|
271
|
+
c.auth = basicauth
|
|
272
|
+
connectionInfo = c
|
|
273
|
+
} catch (err) {
|
|
274
|
+
console.error('DOWNLOAD ERROR: 💥', err)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
break
|
|
279
|
+
}
|
|
280
|
+
case window.location.origin.includes('localhost'): {
|
|
281
|
+
if (!data || data.specification == 'scorm') return
|
|
282
|
+
let {
|
|
283
|
+
id,
|
|
284
|
+
crs_id = null,
|
|
285
|
+
actor = {
|
|
286
|
+
mbox: 'mailto:totoescargot@email.com',
|
|
287
|
+
name: 'Toto Escargot',
|
|
288
|
+
objectType: 'Agent'
|
|
289
|
+
},
|
|
290
|
+
endpointConfig = null,
|
|
291
|
+
remote = null
|
|
292
|
+
} = data
|
|
293
|
+
|
|
294
|
+
const origin = window.location.origin
|
|
295
|
+
const activity_id = crs_id
|
|
296
|
+
? `${origin}/${crs_id}/${id}`
|
|
297
|
+
: `${origin}/${id}`
|
|
298
|
+
|
|
299
|
+
if (remote == null) remote = false
|
|
300
|
+
|
|
301
|
+
if (endpointConfig == null)
|
|
302
|
+
endpointConfig = {
|
|
303
|
+
endpoint: 'https://learninglocker.cegepadistance.ca/data/xAPI/',
|
|
304
|
+
auth: 'Basic MmU4ZGQ3NTY1NDRiZWUxNmUxZWYzZDZiOThjNWVjY2YxNjVhZjIyNzpkY2Q5Zjk4OWZlYjU3MmZlZjBhNDkxZDIxNmYyNmQyY2M1YTQ4Nzlh'
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
connectionInfo = {
|
|
308
|
+
actor,
|
|
309
|
+
activity_id,
|
|
310
|
+
remote,
|
|
311
|
+
...endpointConfig
|
|
312
|
+
}
|
|
313
|
+
break
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return connectionInfo
|
|
318
|
+
}
|
|
319
|
+
/* Local Method for data fetching */
|
|
320
|
+
const fetchDatasFromServer = async (config) => {
|
|
321
|
+
const {
|
|
322
|
+
$scorm,
|
|
323
|
+
$xapi,
|
|
324
|
+
$idb,
|
|
325
|
+
actor,
|
|
326
|
+
activity_id,
|
|
327
|
+
crs_id,
|
|
328
|
+
idb_id,
|
|
329
|
+
specification,
|
|
330
|
+
remote
|
|
331
|
+
} = config
|
|
332
|
+
|
|
333
|
+
let server = remote ? specification : 'local'
|
|
334
|
+
//falback to idb when scorm and origin is localhost
|
|
335
|
+
//falback to idb when scorm and origin is localhost
|
|
336
|
+
if (
|
|
337
|
+
(specification == 'scorm' && window.location.hostname == 'localhost') ||
|
|
338
|
+
!window.location.hostname.includes('cegepadistance.ca')
|
|
339
|
+
)
|
|
340
|
+
server = 'local'
|
|
341
|
+
|
|
342
|
+
let data = null
|
|
343
|
+
|
|
344
|
+
switch (server) {
|
|
345
|
+
case 'scorm': {
|
|
346
|
+
if ($scorm.initialized) {
|
|
347
|
+
const lessonStatus = $scorm.GetValue('cmi.core.lesson_status', true)
|
|
348
|
+
if (lessonStatus === 'unknown') {
|
|
349
|
+
$scorm.setValue('cmi.core.lesson_status', 'incomplete')
|
|
350
|
+
$scorm.Commit()
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const suspendData = $scorm.GetValue('cmi.suspend_data')
|
|
354
|
+
if (suspendData !== '') {
|
|
355
|
+
try {
|
|
356
|
+
const parsed = JSON.parse(suspendData.replace(/\\/g, ''))
|
|
357
|
+
const {
|
|
358
|
+
userData: progress,
|
|
359
|
+
routeHistory,
|
|
360
|
+
userSettings
|
|
361
|
+
} = parsed
|
|
362
|
+
|
|
363
|
+
const lessonPosition = this.$scorm.GetValue(
|
|
364
|
+
'cmi.core.lesson_location',
|
|
365
|
+
false
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
data = {
|
|
369
|
+
progress,
|
|
370
|
+
routeHistory,
|
|
371
|
+
lessonPosition,
|
|
372
|
+
userSettings
|
|
373
|
+
}
|
|
374
|
+
} catch (err) {
|
|
375
|
+
console.error('❌ Failed to parse suspend_data:', err)
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
break
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
case 'xapi': {
|
|
383
|
+
try {
|
|
384
|
+
const actorMbox = actor.mbox.replace('mailto:', '')
|
|
385
|
+
const activityId = activity_id
|
|
386
|
+
const _url = new URL(activityId)
|
|
387
|
+
const parentID = `${_url.origin}/${crs_id}` // redefining activity id for statement
|
|
388
|
+
|
|
389
|
+
const lessonProgressParam = { email: actorMbox, activityId }
|
|
390
|
+
const lessonStateParam = {
|
|
391
|
+
email: actorMbox,
|
|
392
|
+
activityId,
|
|
393
|
+
verb: 'completed'
|
|
394
|
+
}
|
|
395
|
+
const lessonPosionParam = {
|
|
396
|
+
email: actorMbox,
|
|
397
|
+
activityId
|
|
398
|
+
}
|
|
399
|
+
const playbarParam = {
|
|
400
|
+
email: actorMbox,
|
|
401
|
+
activityId,
|
|
402
|
+
verb: 'played'
|
|
403
|
+
}
|
|
404
|
+
const preferencesParam = {
|
|
405
|
+
email: actorMbox,
|
|
406
|
+
activityId: parentID,
|
|
407
|
+
verb: 'preferred'
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const fetchParams = [
|
|
411
|
+
lessonProgressParam,
|
|
412
|
+
lessonStateParam,
|
|
413
|
+
lessonPosionParam,
|
|
414
|
+
playbarParam,
|
|
415
|
+
preferencesParam
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
const {
|
|
419
|
+
userData,
|
|
420
|
+
savedPoint,
|
|
421
|
+
preferredSettings,
|
|
422
|
+
playbarValues,
|
|
423
|
+
lessonStatus
|
|
424
|
+
} = await $xapi._getBulkData(fetchParams)
|
|
425
|
+
|
|
426
|
+
const { routeHistory = [], ...progress } = userData
|
|
427
|
+
|
|
428
|
+
const completedState = lessonStatus || {}
|
|
429
|
+
const lessonPosition = savedPoint || ''
|
|
430
|
+
const userSettings = preferredSettings || {}
|
|
431
|
+
|
|
432
|
+
data = {
|
|
433
|
+
progress,
|
|
434
|
+
routeHistory,
|
|
435
|
+
lessonPosition,
|
|
436
|
+
completedState,
|
|
437
|
+
playbarValues,
|
|
438
|
+
userSettings
|
|
439
|
+
}
|
|
440
|
+
} catch (err) {
|
|
441
|
+
throw new Error(err)
|
|
442
|
+
}
|
|
443
|
+
break
|
|
444
|
+
}
|
|
445
|
+
default: {
|
|
446
|
+
try {
|
|
447
|
+
await $idb.openDB() //open the new instance in indexDB
|
|
448
|
+
const res = await $idb.getFromDB(idb_id) // get existing Data from db
|
|
449
|
+
|
|
450
|
+
if (res && res.$record) data = res.$record
|
|
451
|
+
} catch (err) {
|
|
452
|
+
console.error('❌ Failed get Data from IndexDB:', err)
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return data
|
|
458
|
+
}
|
|
459
|
+
//=================================END SET LRS INFO ====================================
|
|
460
|
+
window.setDebugMode = (mode) => {
|
|
461
|
+
appStore.appDebugMode = mode
|
|
462
|
+
const msg = mode ? 'DEBUG MODE ON' : 'DEBUG MODE OFF'
|
|
463
|
+
console.log(`🚩 ${msg}`)
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
appStore.menuSetting = options.menuSettings
|
|
467
|
+
|
|
468
|
+
//=================================SETTING PREFERENCES ====================================
|
|
469
|
+
|
|
470
|
+
//define the settings option for user preference according to the mode of App
|
|
471
|
+
let settingsOptions = {
|
|
472
|
+
autoplay: null
|
|
473
|
+
// onboarding: null,// Uncomment when ready to add onboarding in settings
|
|
474
|
+
// subtitles: null,// Uncomment when ready to add subtitle in settings
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
appStore.applicationSettings = settingsOptions
|
|
478
|
+
//=================================END SETTING PREFERENCES ====================================//
|
|
479
|
+
|
|
480
|
+
//mergeLocales
|
|
481
|
+
mergeLocales(options.i18n.global)
|
|
482
|
+
app.use(helper)
|
|
483
|
+
app.use(analytics)
|
|
484
|
+
|
|
485
|
+
//=======================================
|
|
486
|
+
const { packageName, packageVersion } = appStore.getAppPackageInfo()
|
|
487
|
+
console.log(
|
|
488
|
+
`%c 📦${packageName} %c${packageVersion}`,
|
|
489
|
+
'color: white; background: #35495e; padding: 4px 8px; border-radius: 4px 0 0 4px;',
|
|
490
|
+
'color: white; background: #41b883; padding: 4px 8px; border-radius: 0 4px 4px 0;'
|
|
491
|
+
)
|
|
492
|
+
}
|
|
493
|
+
}
|