fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -9
  3. package/src/$locales/en.json +39 -15
  4. package/src/$locales/fr.json +48 -23
  5. package/src/components/AppBase.vue +245 -266
  6. package/src/components/AppBaseErrorDisplay.vue +29 -0
  7. package/src/components/AppBaseModule.vue +485 -232
  8. package/src/components/AppBasePage.vue +28 -54
  9. package/src/components/AppCompBif.vue +120 -0
  10. package/src/components/AppCompBranchButtons.vue +31 -30
  11. package/src/components/AppCompButtonProgress.vue +35 -46
  12. package/src/components/AppCompCarousel.vue +154 -247
  13. package/src/components/AppCompJauge.vue +1 -2
  14. package/src/components/AppCompMediaPlayer.vue +106 -74
  15. package/src/components/AppCompMenu.vue +87 -81
  16. package/src/components/AppCompMenuItem.vue +48 -90
  17. package/src/components/AppCompNavigation.vue +949 -0
  18. package/src/components/AppCompNoteCall.vue +126 -0
  19. package/src/components/AppCompNoteCredit.vue +164 -0
  20. package/src/components/AppCompPlayBar.vue +864 -1085
  21. package/src/components/AppCompPopUp.vue +26 -27
  22. package/src/components/AppCompPopover.vue +27 -0
  23. package/src/components/AppCompQuiz.vue +27 -36
  24. package/src/components/AppCompQuizRecall.vue +250 -0
  25. package/src/components/AppCompSVG.vue +309 -0
  26. package/src/components/AppCompSettingsMenu.vue +1 -0
  27. package/src/components/AppCompTableOfContent.vue +140 -85
  28. package/src/components/AppCompTranscript.vue +19 -0
  29. package/src/components/AppCompVideoPlayer.vue +336 -0
  30. package/src/components/BaseModule.vue +24 -105
  31. package/src/main.js +18 -9
  32. package/src/mixins/$pageMixins.js +106 -28
  33. package/src/mixins/timerMixin.js +31 -7
  34. package/src/module/store.js +33 -12
  35. package/src/module/xapi/Crypto/encoders/Hex.js +2 -1
  36. package/src/module/xapi/wrapper.js +4 -4
  37. package/src/plugins/gsap.js +4 -1
  38. package/src/plugins/helper.js +53 -18
  39. package/src/plugins/idb.js +1 -0
  40. package/src/public/index.html +1 -1
  41. package/src/router/index.js +41 -0
  42. package/src/router/routes.js +337 -0
  43. package/src/routes_bckp.js +313 -0
  44. package/src/routes_static.js +344 -0
  45. package/src/shared/generalfuncs.js +79 -4
  46. package/src/shared/validators.js +249 -0
  47. package/src/components/AppCompNavigationFull.vue +0 -1791
  48. package/src/components/AppCompToolTip.vue +0 -94
  49. package/src/routes.js +0 -734
@@ -0,0 +1,126 @@
1
+ <!--
2
+ ----------------- MUST DO STYLE!! -----------------------
3
+ @ Description:
4
+ @ What it does:
5
+ -->
6
+
7
+ <template>
8
+ <div
9
+ :id="`rnt_${stripRefNote}`"
10
+ :ref="`#rnt_${stripRefNote}`"
11
+ class="callEndNote"
12
+ :dataRef="`nt_${stripRefNote}`"
13
+ >
14
+ <b-link
15
+ v-if="!error"
16
+ class="nrlm"
17
+ tabindex="0"
18
+ :title="$t('text.title_link_call')"
19
+ @click="openNote()"
20
+ >
21
+ <sup>{{ stripRefNote }}</sup>
22
+ </b-link>
23
+
24
+ <div v-else>
25
+ <sup>error</sup>
26
+ </div>
27
+ </div>
28
+ </template>
29
+ <script>
30
+ export default {
31
+ props: {
32
+ refNote: {
33
+ type: String,
34
+ default: ' '
35
+ }
36
+ },
37
+ data() {
38
+ return {
39
+ route: this.$route.meta.activity_ref,
40
+ notes: null,
41
+ jsons: null
42
+ }
43
+ },
44
+ computed: {
45
+ // Return the number for the note
46
+ stripRefNote() {
47
+ let ref = this.refNote
48
+ let newRef
49
+ let toStrip = ref.indexOf('_')
50
+ newRef = this.refNote.substr(toStrip + 1)
51
+
52
+ return newRef
53
+ },
54
+ error() {
55
+ ///// -------------------------- MUST REDO INFORMATION NOT FROM JSON ANYMORE
56
+ let er = false
57
+ // let info = this.jsons
58
+
59
+ // if (info) {
60
+ // if (Object.keys(info.note).length === 0) {
61
+ // er = true
62
+ // console.warn(
63
+ // '%c WARNING!>>> AppCompNoteCall: Your note file is empty, note cannot be call',
64
+ // 'background: orange; color: white; display: block; margin:5px;'
65
+ // )
66
+ // } else if (
67
+ // info.note.value[this.stripRefNote - 1] === ' ' ||
68
+ // info.note.value[this.stripRefNote - 1] === undefined
69
+ // ) {
70
+ // er = true
71
+ // console.warn(
72
+ // '%c WARNING!>>> AppCompNoteCall: The note you try to call doesnt existe.',
73
+ // 'background: orange; color: white; display: block; margin:5px;'
74
+ // )
75
+ // } else {
76
+ // //check if value are the same :
77
+ // ///https://stackoverflow.com/questions/7376598/in-javascript-how-do-i-check-if-an-array-has-duplicate-values
78
+ // const items = [...document.getElementsByClassName('callEndNote')]
79
+
80
+ // let cltn = []
81
+ // items.forEach((element) => {
82
+ // cltn.push(element.getAttribute('dataref'))
83
+ // })
84
+ // const l = cltn.some((e, i) => cltn.indexOf(e) < i)
85
+ // if (l) {
86
+ // er = true
87
+ // console.warn(
88
+ // '%c WARNING!>>> AppCompNoteCall: You call this note twice',
89
+ // 'background: orange; color: white; display: block; margin:5px;'
90
+ // )
91
+ // }
92
+ // }
93
+ // }
94
+
95
+ return er
96
+ }
97
+ },
98
+ mounted() {},
99
+ methods: {
100
+ //open the widget and give information to highlight
101
+ openNote() {
102
+ this.$bus.$emit('note-to-show', this.$el)
103
+ },
104
+ lookForElement(elId) {
105
+ let clcn = document.getElementsByClassName('endNoteLink')
106
+
107
+ for (let element of clcn) {
108
+ if (element.id === elId) {
109
+ return element
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ </script>
116
+ <style lang="scss">
117
+ .callEndNote {
118
+ display: inline-block;
119
+ margin-left: -4px;
120
+
121
+ &.b {
122
+ margin-left: 0 !important ;
123
+ margin-right: -4px !important ;
124
+ }
125
+ }
126
+ </style>
@@ -0,0 +1,164 @@
1
+ <!--
2
+ ----------------- MUST ADD ERROR GESTION ------------------
3
+ ----------------- MUST ADD css ------------------
4
+
5
+ @ Description:
6
+ @ What it does:
7
+ -->
8
+ <template>
9
+ <div class="noteCredit" :class="{ openW: showWidget }">
10
+ <app-base-button id="close-toc" @click="close()">X</app-base-button>
11
+
12
+ <div>
13
+ <p>{{ $t('text.title_credit') }}</p>
14
+
15
+ <ul v-if="credits != null">
16
+ <li
17
+ v-for="(credit, index) of credits"
18
+ :key="`note_${index}`"
19
+ :ref="`#nt_${index + 1}`"
20
+ v-html="credit"
21
+ ></li>
22
+ </ul>
23
+ <p v-else>{{ $t('text.no_credit') }}</p>
24
+ </div>
25
+ <div>
26
+ <p>{{ $t('text.title_note') }}</p>
27
+ <ul v-if="notes != null">
28
+ <li
29
+ v-for="(note, index) of notes"
30
+ :id="`nt_${index + 1}`"
31
+ :key="`note_${index}`"
32
+ :dataRef="`rnt_${index + 1}`"
33
+ class="widget-note"
34
+ >
35
+ <button
36
+ :noteRef="`rnt_${index + 1}`"
37
+ class="btn backToNoteRef"
38
+ @click="focusNote($event)"
39
+ >
40
+ <span v-html="note"></span>
41
+ </button>
42
+ </li>
43
+ </ul>
44
+
45
+ <p v-else>{{ $t('text.no_note') }}</p>
46
+ </div>
47
+ </div>
48
+ </template>
49
+ <script>
50
+ export default {
51
+ data() {
52
+ return {
53
+ notes: null,
54
+ credits: null,
55
+ current: false,
56
+ jsons: null,
57
+ showWidget: false
58
+ }
59
+ },
60
+ computed: {
61
+ error() {
62
+ // ---------------- MUST BE REDO BECAUSE INFO CHANGE ----------------------
63
+ let er = false
64
+ // let info = this.jsons
65
+ // if (info) {
66
+ // if (Object.keys(info.note).length === 0) {
67
+ // er = true
68
+ // console.warn(
69
+ // '%c WARNING!>>> AppCompNoteFin: Your note file is empty.',
70
+ // 'background: orange; color: white; display: block; margin:5px;'
71
+ // )
72
+ // }
73
+ // }
74
+ return er
75
+ }
76
+ },
77
+ async created() {},
78
+ mounted() {
79
+ this.$bus.$on('credit-note', (data) => {
80
+ this.notes = data.note
81
+ this.credits = data.credit
82
+ })
83
+
84
+ // close or open widget depending which btn was click
85
+ this.$bus.$on('toggle-widget', (data) => {
86
+ if (data == 'noteCredit') this.showWidget = !this.showWidget
87
+ else this.showWidget = false
88
+ })
89
+
90
+ //close widget
91
+ this.$bus.$on('close-widget', (data) => {
92
+ this.showWidget = false
93
+ })
94
+
95
+ // show widget when note click and higligth note
96
+ this.$bus.$on('note-to-show', (el) => {
97
+ this.showWidget = true
98
+
99
+ if (el) {
100
+ let ref = el.getAttribute('dataRef')
101
+
102
+ this.removefocus()
103
+
104
+ let elAtt = document.getElementsByClassName('widget-note')
105
+ var arr = Array.from(elAtt)
106
+
107
+ for (let element of arr) {
108
+ if (ref == element.getAttribute('id')) {
109
+ element.setAttribute('dataCurrent', true)
110
+ }
111
+ }
112
+ }
113
+ })
114
+ },
115
+ methods: {
116
+ //close widget
117
+ close() {
118
+ this.showWidget = !this.showWidget
119
+ },
120
+ removefocus() {
121
+ let elAtt = document.querySelectorAll("[dataCurrent='true']")
122
+
123
+ var arr = Array.from(elAtt)
124
+
125
+ for (let element of arr) {
126
+ element.setAttribute('dataCurrent', false)
127
+ }
128
+ },
129
+ focusNote(el) {
130
+ let e = document.getElementsByClassName('callEndNote')
131
+ let t = el.target.getAttribute('noteref')
132
+ for (let element of e) {
133
+ element.setAttribute('dataCurrentnote', false)
134
+ if (element.id === t) {
135
+ element.setAttribute('dataCurrentnote', true)
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ </script>
142
+ <style lang="scss">
143
+ .noteCredit {
144
+ position: absolute;
145
+ top: 0;
146
+ left: 200%;
147
+ display: none;
148
+ opacity: 0;
149
+
150
+ &.openW {
151
+ display: block;
152
+ opacity: 1;
153
+ }
154
+
155
+ span {
156
+ pointer-events: none;
157
+ }
158
+
159
+ .overlay-w {
160
+ width: 100%;
161
+ height: 100%;
162
+ }
163
+ }
164
+ </style>