-
Notifications
You must be signed in to change notification settings - Fork 63
/
upgrades.js
45 lines (40 loc) · 1.17 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
var H5PUpgrades = H5PUpgrades || {};
H5PUpgrades['H5P.MemoryGame'] = (function () {
return {
1: {
/**
* Asynchronous content upgrade hook.
* Upgrades content parameters to support Memory Game 1.1.
*
* Move card images into card object as this allows for additonal
* properties for each card.
*
* @params {object} parameters
* @params {function} finished
*/
1: function (parameters, finished) {
for (var i = 0; i < parameters.cards.length; i++) {
parameters.cards[i] = {
image: parameters.cards[i]
};
}
finished(null, parameters);
},
/**
* Asynchronous content upgrade hook.
* Upgrades content parameters to support Memory Game 1.2.
*
* Add default behavioural settings for the new options.
*
* @params {object} parameters
* @params {function} finished
*/
2: function (parameters, finished) {
parameters.behaviour = {};
parameters.behaviour.useGrid = false;
parameters.behaviour.allowRetry = false;
finished(null, parameters);
}
}
};
})();