-
Notifications
You must be signed in to change notification settings - Fork 65
/
upgrades.js
42 lines (37 loc) · 1.32 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
var H5PUpgrades = H5PUpgrades || {};
H5PUpgrades['H5P.TrueFalse'] = (function () {
return {
1: {
5: function (parameters, finished, extras) {
var title;
if (parameters && parameters.question) {
title = parameters.question;
}
extras = extras || {};
extras.metadata = extras.metadata || {};
extras.metadata.title = (title) ? title.replace(/<[^>]*>?/g, '') : ((extras.metadata.title) ? extras.metadata.title : 'True-False');
finished(null, parameters, extras);
},
/**
* Move disableImageZooming from behaviour to media
*
* @param {object} parameters
* @param {function} finished
*/
6: function (parameters, finished) {
// If image has been used, move it down in the hierarchy and add disableImageZooming
if (parameters && parameters.media) {
parameters.media = {
type: parameters.media,
disableImageZooming: (parameters.behaviour && parameters.behaviour.disableImageZooming) ? parameters.behaviour.disableImageZooming : false
};
}
// Delete old disableImageZooming
if (parameters && parameters.behaviour) {
delete parameters.behaviour.disableImageZooming;
}
finished(null, parameters);
}
}
};
})();