-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrades.js
47 lines (37 loc) · 1.42 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
var H5PUpgrades = H5PUpgrades || {};
H5PUpgrades['H5P.ColumnPapiJo'] = (function () {
return {
1: {
/**
* Asynchronous content upgrade hook.
* Upgrades content parameters to support Column 1.10.
*
* - Converts H5P.AppearIn to H5P.AdvancedText
*
* @param {Object} parameters
* @param {function} finished
*/
10: function (parameters, finished) {
if (parameters && parameters.content) {
// Go through content
for (var i = 0; i < parameters.content.length; i++) {
if (parameters.content[i] && parameters.content[i].content) {
const content = parameters.content[i].content;
if (content.library && content.library.split(' ')[0] === 'H5P.AppearIn') {
content.library = 'H5P.AdvancedText 1.1';
content.params = content.params || {};
let roomName = '';
if (content.params.appearRoom) {
roomName = content.params.appearRoom;
}
content.params.text = '<p>AppearIn support for embedded rooms has been deprecated and is no longer maintained. Access your room in a new tab with the following <a target="_blank" href="https://appear.in/' + roomName + '">link.</a></p>';
}
}
}
}
// Done
finished(null, parameters);
}
}
};
})();