forked from NDLANO/h5p-escape-room
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrades.js
51 lines (46 loc) · 1.48 KB
/
upgrades.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// <reference path="./index.d.ts" />
var H5PUpgrades = H5PUpgrades || {};
H5PUpgrades['H5P.NDLAThreeImage'] = (function () {
return {
0: {
2: function (parameters, finished) {
if (parameters && parameters.context &&
parameters.context.behaviour && parameters.context.behaviour.length) {
// Add wrapper for audio
const audio = parameters.context.behaviour;
parameters.context.behaviour = {
audio: audio
};
}
finished(null, parameters);
},
/**
* @param {{ threeImage: {scenes: Array<SceneParams>}; behaviour?: any; }} parameters
* @param {(param0: any, parameters: any) => void} finished
*/
4: function (parameters, finished) {
if (parameters && parameters.behaviour) {
parameters.behaviour.label = {
showLabel: false,
labelPosition: 'right'
};
}
if (parameters && parameters.threeImage && parameters.threeImage.scenes) {
for (const scene of parameters.threeImage.scenes) {
if (scene.interactions) {
for (const interaction of scene.interactions) {
if (!interaction.label) {
interaction.label = {
labelPosition: 'inherit',
showLabel: 'inherit',
}
}
}
}
}
}
finished(null, parameters);
}
}
};
})();