fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.10
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 +6 -31
- package/.prettierrc +11 -0
- package/.vscode/extensions.json +8 -0
- package/.vscode/settings.json +16 -0
- package/CHANGELOG +153 -0
- package/README.md +28 -43
- package/documentation/.vitepress/config.js +114 -0
- package/documentation/api-examples.md +49 -0
- package/documentation/composants/app-base-button.md +58 -0
- package/documentation/composants/app-base-error-display.md +59 -0
- package/documentation/composants/app-base-popover.md +68 -0
- package/documentation/composants/app-comp-audio.md +75 -0
- package/documentation/composants/app-comp-branch-buttons.md +111 -0
- package/documentation/composants/app-comp-button-progress.md +53 -0
- package/documentation/composants/app-comp-carousel.md +53 -0
- package/documentation/composants/app-comp-container.md +53 -0
- package/documentation/composants/app-comp-input-checkbox-next.md +42 -0
- package/documentation/composants/app-comp-input-dropdown-next.md +34 -0
- package/documentation/composants/app-comp-input-radio-next.md +39 -0
- package/documentation/composants/app-comp-input-text-next.md +35 -0
- package/documentation/composants/app-comp-input-text-table-next.md +34 -0
- package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -0
- package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -0
- package/documentation/composants/app-comp-jauge.md +31 -0
- package/documentation/composants/app-comp-menu-item.md +55 -0
- package/documentation/composants/app-comp-menu.md +29 -0
- package/documentation/composants/app-comp-navigation.md +41 -0
- package/documentation/composants/app-comp-note-call.md +53 -0
- package/documentation/composants/app-comp-note-credit.md +53 -0
- package/documentation/composants/app-comp-play-bar-next.md +53 -0
- package/documentation/composants/app-comp-pop-up-next.md +93 -0
- package/documentation/composants/app-comp-quiz-next.md +235 -0
- package/documentation/composants/app-comp-quiz-recall.md +53 -0
- package/documentation/composants/app-comp-svg-next.md +53 -0
- package/documentation/composants/app-comp-table-of-content.md +50 -0
- package/documentation/composants/app-comp-video-player.md +82 -0
- package/documentation/composants.md +46 -0
- package/documentation/composants_critiques/ModelPageComposant.md +53 -0
- package/documentation/composants_critiques/app-base-module.md +43 -0
- package/documentation/composants_critiques/app-base-page.md +48 -0
- package/documentation/composants_critiques/app-base.md +311 -0
- package/documentation/composants_critiques/main.md +15 -0
- package/documentation/demarrage.md +50 -0
- package/documentation/deploiement.md +58 -0
- package/documentation/index.md +33 -0
- package/documentation/markdown-examples.md +85 -0
- package/documentation/public/npm_version.png +0 -0
- package/documentation/public/vite.svg +15 -0
- package/documentation/public/vuejs.svg +2 -0
- package/documentation/public/vuetify.svg +6 -0
- package/eslint.config.js +60 -0
- package/package.json +43 -49
- package/src/$locales/en.json +94 -92
- package/src/$locales/fr.json +77 -113
- package/src/assets/data/onboardingMessages.json +1 -1
- package/src/components/AppBase.vue +971 -437
- package/src/components/AppBaseButton.test.js +21 -0
- package/src/components/AppBaseButton.vue +42 -10
- package/src/components/AppBaseErrorDisplay.vue +209 -162
- package/src/components/AppBaseFlipCard.vue +1 -0
- package/src/components/AppBaseModule.vue +1021 -976
- package/src/components/AppBasePage.vue +656 -128
- package/src/components/AppBasePopover.vue +41 -0
- package/src/components/AppBaseSkeleton.vue +66 -0
- package/src/components/AppCompAudio.vue +256 -0
- package/src/components/AppCompBranchButtons.vue +108 -181
- package/src/components/AppCompButtonProgress.vue +44 -70
- package/src/components/AppCompCarousel.vue +284 -233
- package/src/components/AppCompContainer.vue +29 -0
- package/src/components/AppCompInputCheckBoxNx.vue +323 -0
- package/src/components/AppCompInputDropdownNx.vue +299 -0
- package/src/components/AppCompInputRadioNx.vue +284 -0
- package/src/components/AppCompInputTextNx.vue +153 -0
- package/src/components/AppCompInputTextTableNx.vue +202 -0
- package/src/components/AppCompInputTextToFillDropdownNx.vue +340 -0
- package/src/components/AppCompInputTextToFillNx.vue +313 -0
- package/src/components/AppCompJauge.vue +36 -11
- package/src/components/AppCompMenu.vue +312 -92
- package/src/components/AppCompMenuItem.vue +129 -105
- package/src/components/AppCompNavigation.vue +972 -0
- package/src/components/AppCompNoteCall.vue +161 -0
- package/src/components/AppCompNoteCredit.vue +491 -0
- package/src/components/AppCompPlayBarNext.vue +2288 -0
- package/src/components/AppCompPopUpNext.vue +504 -0
- package/src/components/AppCompQuizNext.vue +510 -0
- package/src/components/AppCompQuizRecall.vue +350 -0
- package/src/components/AppCompSVGNext.vue +346 -0
- package/src/components/AppCompSettingsMenu.vue +18 -16
- package/src/components/AppCompTableOfContent.vue +340 -122
- package/src/components/AppCompVideoPlayer.vue +377 -0
- package/src/components/BaseModule.vue +24 -117
- package/src/components/tests__/AppBaseButton.spec.js +53 -0
- package/src/components/tests__/useTimer.spec.js +91 -0
- package/src/composables/useIdleDetector.js +56 -0
- package/src/composables/useQuiz.js +89 -0
- package/src/composables/useTimer.js +172 -0
- package/src/directives/nvdaFix.js +53 -0
- package/src/externalComps/ModuleView.vue +22 -0
- package/src/externalComps/SummaryView.vue +91 -0
- package/src/main.js +400 -142
- package/src/module/stores/appStore.js +947 -0
- package/src/module/xapi/ADL.js +241 -60
- package/src/module/xapi/Crypto/Hasher.js +8 -8
- package/src/module/xapi/Crypto/WordArray.js +6 -6
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
- package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
- package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
- package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
- package/src/module/xapi/Crypto/encoders/Base.js +7 -7
- package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
- package/src/module/xapi/Crypto/encoders/Hex.js +4 -3
- package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
- package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
- package/src/module/xapi/Statement/index.js +3 -3
- package/src/module/xapi/launch.js +10 -10
- package/src/module/xapi/utils.js +17 -17
- package/src/module/xapi/wrapper.js +223 -218
- package/src/module/xapi/xapiStatement.js +29 -29
- package/src/plugins/analytics.js +34 -0
- package/src/plugins/bus.js +7 -2
- package/src/plugins/gsap.js +9 -8
- package/src/plugins/helper.js +141 -43
- package/src/plugins/i18n.js +13 -18
- package/src/plugins/idb.js +46 -30
- package/src/plugins/save.js +1 -1
- package/src/plugins/scorm.js +15 -15
- package/src/plugins/xapi.js +2 -2
- package/src/public/index.html +23 -11
- package/src/router/index.js +57 -0
- package/src/router/routes.js +312 -0
- package/src/shared/generalfuncs.js +241 -10
- package/src/shared/validators.js +1018 -0
- package/vitest.config.js +19 -0
- package/.eslintignore +0 -29
- package/.eslintrc.js +0 -86
- package/.prettierrc.js +0 -5
- package/babel.config.js +0 -3
- package/src/components/AppBaseDragChoice.vue +0 -91
- package/src/components/AppBaseDropZone.vue +0 -112
- package/src/components/AppCompDragAndDrop.vue +0 -339
- package/src/components/AppCompInputAssociation.vue +0 -332
- package/src/components/AppCompInputCheckBox.vue +0 -227
- package/src/components/AppCompInputDropdown.vue +0 -184
- package/src/components/AppCompInputRadio.vue +0 -169
- package/src/components/AppCompInputTextBox.vue +0 -91
- package/src/components/AppCompInputTextTable.vue +0 -155
- package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
- package/src/components/AppCompInputTextToFillText.vue +0 -164
- package/src/components/AppCompMediaPlayer.vue +0 -365
- package/src/components/AppCompNavigationFull.vue +0 -1791
- package/src/components/AppCompPlayBar.vue +0 -1540
- package/src/components/AppCompPopUp.vue +0 -523
- package/src/components/AppCompQuiz.vue +0 -2998
- package/src/components/AppCompToolTip.vue +0 -94
- package/src/mixins/$pageMixins.js +0 -381
- package/src/mixins/$quizMixins.js +0 -456
- package/src/mixins/timerMixin.js +0 -132
- package/src/module/store.js +0 -874
- package/src/plugins/timeManager.js +0 -77
- package/src/routes.js +0 -734
- package/vue.config.js +0 -83
package/src/plugins/i18n.js
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
1
2
|
/**
|
|
2
3
|
* Merge locales message in project.
|
|
3
4
|
* @summary To merge the locales dictionnary of this library with the locales that user will create
|
|
4
5
|
* @param {Object} i18n - vue-i18n internalization object.
|
|
5
6
|
*/
|
|
6
7
|
export default function mergeLocales(i18n) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// This library locales files
|
|
15
|
-
const thisLocales = require.context(
|
|
16
|
-
'../$locales',
|
|
17
|
-
true,
|
|
18
|
-
/[A-Za-z0-9-_,\s]+\.json$/i
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
thisLocales.keys().forEach((key) => {
|
|
22
|
-
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
|
8
|
+
const thisLocales = import.meta.glob('../$locales/*.json', {
|
|
9
|
+
import: 'default',
|
|
10
|
+
eager: true
|
|
11
|
+
})
|
|
12
|
+
for (const path in thisLocales) {
|
|
13
|
+
const matched = path.match(/([A-Za-z0-9-_]+)\./i)
|
|
23
14
|
if (matched && matched.length > 1) {
|
|
24
15
|
const locale = matched[1]
|
|
16
|
+
|
|
25
17
|
// Using lodash to deeply merge objects
|
|
26
|
-
const
|
|
18
|
+
const coreMessages = JSON.parse(JSON.stringify(thisLocales[path]))
|
|
19
|
+
const templateMessages = JSON.parse(JSON.stringify(i18n.messages[locale]))
|
|
20
|
+
const mergedMessages = _.merge(coreMessages, templateMessages)
|
|
21
|
+
|
|
27
22
|
// Since merLocalMessage will do a shallow merge of the object. We will use setLocalMessage to replace the message with new message object
|
|
28
23
|
i18n.setLocaleMessage(locale, mergedMessages)
|
|
29
24
|
}
|
|
30
|
-
}
|
|
25
|
+
}
|
|
31
26
|
}
|
package/src/plugins/idb.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* idb library by jakearchibald: https://github.com/jakearchibald/idb
|
|
3
3
|
*/
|
|
4
|
-
import { openDB
|
|
4
|
+
import { openDB } from 'idb'
|
|
5
|
+
import $_ from 'lodash'
|
|
6
|
+
//import { createApp } from 'vue'
|
|
5
7
|
//import {*} from "idb";
|
|
6
8
|
let dataBase = null
|
|
7
9
|
let dbName = '$crsDataBase' //test
|
|
8
10
|
let storeName = '$lessonsStore' //test
|
|
9
|
-
openDB, deleteDB, wrap, unwrap
|
|
11
|
+
//openDB, deleteDB, wrap, unwrap
|
|
10
12
|
//$_id
|
|
13
|
+
//const app = createApp({})
|
|
11
14
|
export const $idb = {
|
|
12
|
-
install(
|
|
13
|
-
|
|
15
|
+
install(app) {
|
|
16
|
+
app.config.globalProperties.$idb = {
|
|
14
17
|
/*
|
|
15
18
|
* @ Description: create a indexedDB database
|
|
16
19
|
* Open a data base in indexedDB if does not exist and create a store for the lessons package
|
|
@@ -41,7 +44,7 @@ export const $idb = {
|
|
|
41
44
|
}
|
|
42
45
|
})
|
|
43
46
|
dataBase = db
|
|
44
|
-
|
|
47
|
+
return dataBase
|
|
45
48
|
}
|
|
46
49
|
} catch (err) {
|
|
47
50
|
console.log('==> Erro ', err)
|
|
@@ -64,9 +67,10 @@ export const $idb = {
|
|
|
64
67
|
searchIndex,
|
|
65
68
|
data[searchIndex]
|
|
66
69
|
)
|
|
70
|
+
|
|
67
71
|
//Add entry to database if does not exist
|
|
68
72
|
if (!value) {
|
|
69
|
-
const addedItem = await dataBase.add(storeName, data)
|
|
73
|
+
const addedItem = await dataBase.add(storeName, $_.cloneDeep(data))
|
|
70
74
|
|
|
71
75
|
return addedItem
|
|
72
76
|
}
|
|
@@ -136,7 +140,10 @@ export const $idb = {
|
|
|
136
140
|
if (existingRecord) {
|
|
137
141
|
existingRecord.$record = newValue
|
|
138
142
|
existingRecord.$last_edit = Date.now()
|
|
139
|
-
const updatedItem = await dataBase.put(
|
|
143
|
+
const updatedItem = await dataBase.put(
|
|
144
|
+
storeName,
|
|
145
|
+
$_.cloneDeep(existingRecord)
|
|
146
|
+
)
|
|
140
147
|
//await this.getAllFromDB(storeName)
|
|
141
148
|
return updatedItem
|
|
142
149
|
}
|
|
@@ -177,33 +184,42 @@ export const $idb = {
|
|
|
177
184
|
},
|
|
178
185
|
/**
|
|
179
186
|
* @description creating a small save plug-in to save store state in the localStorage
|
|
180
|
-
* the plugin listen for
|
|
181
|
-
* Since the The handler is called after every
|
|
182
|
-
* when the
|
|
187
|
+
* the plugin listen for changes made to the Pinia store store to store them in the browser storage.
|
|
188
|
+
* Since the The handler is called after every actions we want to limit the saving of data to storage only
|
|
189
|
+
* when the changes are affecting the user interaction.
|
|
183
190
|
* This prevent resetting the store to initial state when the browser refreshes
|
|
184
|
-
*
|
|
185
|
-
* @param {Object} store vuex Store
|
|
191
|
+
* @param {Object} store Pinia Store
|
|
186
192
|
* @param {String} item package $idb_id
|
|
187
193
|
*/
|
|
188
|
-
saveState(store, item) {
|
|
189
|
-
store
|
|
190
|
-
//
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
194
|
+
async saveState(store, item) {
|
|
195
|
+
store.$onAction(async ({ name, store, args, after }) => {
|
|
196
|
+
//Should only track changes actions on userMetadata
|
|
197
|
+
if (!['updateUserMetaData', 'setUserMetaData'].includes(name)) return
|
|
198
|
+
|
|
199
|
+
// Open DB with a store
|
|
200
|
+
const search = await this.getFromDB(item)
|
|
201
|
+
|
|
202
|
+
if (Object.entries(store.$state.userMetaData).length && search) {
|
|
203
|
+
// Update the db store
|
|
204
|
+
await this.updateDataInDB(item, {
|
|
205
|
+
progress: store.$state.userMetaData,
|
|
206
|
+
userSettings: store.$state.applicationSettings,
|
|
207
|
+
routeHistory: store.getRouteHistory
|
|
208
|
+
})
|
|
209
|
+
//==================================================
|
|
210
|
+
} else {
|
|
211
|
+
//Add Entry to db store
|
|
212
|
+
await this.insertDataInDB({
|
|
213
|
+
$idb_id: item,
|
|
214
|
+
$record: {
|
|
215
|
+
progress: store.$state.userMetaData,
|
|
216
|
+
userSettings: store.$state.applicationSettings,
|
|
217
|
+
routeHistory: store.getRouteHistory
|
|
218
|
+
},
|
|
219
|
+
$last_edit: Date.now()
|
|
220
|
+
})
|
|
206
221
|
}
|
|
222
|
+
//})
|
|
207
223
|
})
|
|
208
224
|
}
|
|
209
225
|
}
|
package/src/plugins/save.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* creating a small save plug-in to save store state in the localStorage
|
|
2
|
-
* the plugin listen for mutations made to the
|
|
2
|
+
* the plugin listen for mutations made to the Pinia store and store them in the local browser storage.
|
|
3
3
|
* This prevent reseting the store to initial state when the browser refreshes
|
|
4
4
|
* Note: the plugin is used in the store.js
|
|
5
5
|
*/
|
package/src/plugins/scorm.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export const scormPlugin = {
|
|
7
|
-
install: function(
|
|
7
|
+
install: function (app) {
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
app.config.globalProperties.$scorm = {
|
|
10
10
|
nFindAPITries: 0,
|
|
11
11
|
API: null,
|
|
12
12
|
maxTries: 500,
|
|
@@ -41,7 +41,7 @@ export const scormPlugin = {
|
|
|
41
41
|
// value to the win parameter passed in, based on the number of
|
|
42
42
|
// parents. At the end of the function call, the win variable will be
|
|
43
43
|
// set to the upper most parent in the chain of parents.
|
|
44
|
-
ScanForAPI: function(win) {
|
|
44
|
+
ScanForAPI: function (win) {
|
|
45
45
|
while (win.API == null && win.parent != null && win.parent != win) {
|
|
46
46
|
this.nFindAPITries++
|
|
47
47
|
if (this.nFindAPITries > this.maxTries) {
|
|
@@ -60,7 +60,7 @@ export const scormPlugin = {
|
|
|
60
60
|
// function then checks to see if there are any opener windows. If
|
|
61
61
|
// the window has an opener, the function begins to look for the
|
|
62
62
|
// this.API Instance in the opener window.
|
|
63
|
-
GetAPI: function(win) {
|
|
63
|
+
GetAPI: function (win) {
|
|
64
64
|
if (win.parent != null && win.parent != win) {
|
|
65
65
|
this.API = this.ScanForAPI(win.parent)
|
|
66
66
|
}
|
|
@@ -70,7 +70,7 @@ export const scormPlugin = {
|
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
// Initalize
|
|
73
|
-
Initialize: function() {
|
|
73
|
+
Initialize: function () {
|
|
74
74
|
let result
|
|
75
75
|
|
|
76
76
|
this.GetAPI(window)
|
|
@@ -104,7 +104,7 @@ export const scormPlugin = {
|
|
|
104
104
|
this.initialized = true
|
|
105
105
|
},
|
|
106
106
|
//Termitate the communication with the LMS
|
|
107
|
-
Finish: function(finalState) {
|
|
107
|
+
Finish: function (finalState) {
|
|
108
108
|
let result
|
|
109
109
|
//Don't terminate if we haven't initialized or if we've already terminated
|
|
110
110
|
if (this.initialized === false || this.terminateCalled === true) {
|
|
@@ -144,7 +144,7 @@ export const scormPlugin = {
|
|
|
144
144
|
//There are situations where a GetValue call is expected to have an error
|
|
145
145
|
//and should not alert the user.
|
|
146
146
|
|
|
147
|
-
GetValue: function(element, checkError) {
|
|
147
|
+
GetValue: function (element, checkError) {
|
|
148
148
|
let result
|
|
149
149
|
|
|
150
150
|
if (this.initialized == false || this.terminateCalled == true) {
|
|
@@ -179,7 +179,7 @@ export const scormPlugin = {
|
|
|
179
179
|
return result
|
|
180
180
|
},
|
|
181
181
|
|
|
182
|
-
SetValue: function(element, value) {
|
|
182
|
+
SetValue: function (element, value) {
|
|
183
183
|
let result
|
|
184
184
|
|
|
185
185
|
if (this.initialized == false || this.terminateCalled == true) {
|
|
@@ -209,7 +209,7 @@ export const scormPlugin = {
|
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
|
|
212
|
-
Commit: function() {
|
|
212
|
+
Commit: function () {
|
|
213
213
|
let result
|
|
214
214
|
|
|
215
215
|
result = this.API.LMSCommit('')
|
|
@@ -235,7 +235,7 @@ export const scormPlugin = {
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
//==================== CUSTOME METHODS =============================
|
|
238
|
-
checkForError: function() {
|
|
238
|
+
checkForError: function () {
|
|
239
239
|
let error_type = null
|
|
240
240
|
let errorNumber = this.API.LMSGetLastError()
|
|
241
241
|
if (errorNumber !== '' || errorNumber !== '0') {
|
|
@@ -249,24 +249,24 @@ export const scormPlugin = {
|
|
|
249
249
|
} else return error_type
|
|
250
250
|
},
|
|
251
251
|
|
|
252
|
-
formateMsg: function(msg, data) {
|
|
252
|
+
formateMsg: function (msg, data) {
|
|
253
253
|
msg.replace('$@errorDescription', data)
|
|
254
254
|
},
|
|
255
255
|
|
|
256
|
-
getScormStatus: function() {
|
|
256
|
+
getScormStatus: function () {
|
|
257
257
|
return this.initialized
|
|
258
258
|
},
|
|
259
259
|
|
|
260
|
-
getScormAPI: function() {
|
|
260
|
+
getScormAPI: function () {
|
|
261
261
|
return this.API
|
|
262
262
|
},
|
|
263
263
|
|
|
264
|
-
setCompletionStatus: function(newStatus) {
|
|
264
|
+
setCompletionStatus: function (newStatus) {
|
|
265
265
|
this.API.RunTimeData.CompletionStatus = newStatus
|
|
266
266
|
this.Commit()
|
|
267
267
|
},
|
|
268
268
|
|
|
269
|
-
setSucessStatus: function(newStatus) {
|
|
269
|
+
setSucessStatus: function (newStatus) {
|
|
270
270
|
this.API.RunTimeData.SuccessStatus = newStatus
|
|
271
271
|
this.Commit()
|
|
272
272
|
},
|
package/src/plugins/xapi.js
CHANGED
package/src/public/index.html
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-build-time="<%= new Date().toLocaleString() %>">
|
|
3
3
|
<head>
|
|
4
|
-
<meta charset="utf-8"
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge"
|
|
6
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0"
|
|
7
|
-
<meta name="apple-mobile-web-app-capable" content="yes"
|
|
8
|
-
<link rel="icon" href="<%= BASE_URL %>favicon.ico"
|
|
9
|
-
<link
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
7
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
8
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
10
13
|
<title>dfcad-prototype</title>
|
|
11
|
-
<link
|
|
12
|
-
|
|
14
|
+
<link
|
|
15
|
+
rel="stylesheet"
|
|
16
|
+
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
|
|
17
|
+
/>
|
|
18
|
+
<link
|
|
19
|
+
rel="stylesheet"
|
|
20
|
+
href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"
|
|
21
|
+
/>
|
|
13
22
|
</head>
|
|
14
23
|
<body>
|
|
15
24
|
<noscript>
|
|
16
|
-
<strong>
|
|
25
|
+
<strong>
|
|
26
|
+
We're sorry but dfcad-prototype doesn't work properly without JavaScript
|
|
27
|
+
enabled. Please enable it to continue.
|
|
28
|
+
</strong>
|
|
17
29
|
</noscript>
|
|
18
30
|
<div id="app"></div>
|
|
19
31
|
<!-- built files will be auto injected -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//import VueRouter from 'vue-router'
|
|
2
|
+
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
3
|
+
import routes from './routes'
|
|
4
|
+
import { useAppStore } from '../module/stores/appStore'
|
|
5
|
+
import { inject } from 'vue'
|
|
6
|
+
|
|
7
|
+
//Vue.use(VueRouter)
|
|
8
|
+
|
|
9
|
+
const router = createRouter({
|
|
10
|
+
history: createWebHashHistory(),
|
|
11
|
+
routes,
|
|
12
|
+
scrollBehavior(to, from, savedPosition) {
|
|
13
|
+
if (to.hash) {
|
|
14
|
+
;(from, savedPosition)
|
|
15
|
+
return {
|
|
16
|
+
selector: to.hash
|
|
17
|
+
// , offset: { x: 0, y: 10 }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
router.beforeResolve((to, from, next) => {
|
|
24
|
+
const app = inject('app')
|
|
25
|
+
const appStore = useAppStore()
|
|
26
|
+
const { getWidgetOpen, getPopupIsOpen, getSidebarIsOpen } = appStore
|
|
27
|
+
const noNavigationToMenu = appStore.getSettingsFromStore('no_menu')
|
|
28
|
+
|
|
29
|
+
if (to.name == 'module') return next({ name: 'menu' }) //redirect to 404 if trying to access module directly
|
|
30
|
+
|
|
31
|
+
if (getWidgetOpen) app.config.globalProperties.$bus.$emit('close-widget') //close opened widget
|
|
32
|
+
if (getPopupIsOpen) app.config.globalProperties.$bus.$emit('close-popup') //close the popup
|
|
33
|
+
if (getSidebarIsOpen) app.config.globalProperties.$bus.$emit('close-sidebar') //close the sidebar
|
|
34
|
+
|
|
35
|
+
if (from.name !== 'module')
|
|
36
|
+
app.config.globalProperties.$bus.$emit('update-route-history', from)
|
|
37
|
+
|
|
38
|
+
app.config.globalProperties.$bus.$emit('update-content', to) //update the content of the current page
|
|
39
|
+
//hidle detector should be stopped in menu
|
|
40
|
+
if (to.name == 'menu') {
|
|
41
|
+
app.config.globalProperties.$bus.$emit('stop-app-timer')
|
|
42
|
+
app.config.globalProperties.$bus.$emit('stop-idle-detector')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if ((noNavigationToMenu && to.name == 'menu') || to.name == 'module') {
|
|
46
|
+
const r = app.config.globalProperties.$helper.getRoutesFromVueRouter() //This return all the routes defined for the module
|
|
47
|
+
let safeRoute = r.meta.children[0] //get the first navigable route from the module routes
|
|
48
|
+
|
|
49
|
+
return next({
|
|
50
|
+
name: safeRoute._namedRoute // redirect to safety route //
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return next(true)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
export default router
|