forked from info-beamer/package-scheduled-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
control.html
49 lines (46 loc) · 1.54 KB
/
control.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id='triggers'></div>
<script src="hosted.js"></script>
<script>
var container = document.getElementById('triggers');
ib.setDefaultStyle();
ib.ready.then(function() {
var triggers = [];
for (var schedule_id in ib.config.schedules) {
var schedule = ib.config.schedules[schedule_id];
for (var page_id in schedule.pages) {
var page = schedule.pages[page_id];
var interaction = page.interaction;
if (interaction.key == "remote" && triggers.indexOf(interaction.remote) == -1) {
triggers.push(interaction.remote);
}
}
}
triggers.sort();
if (triggers.length == 0) {
var info = document.createElement("em");
info.appendChild(document.createTextNode("No remote triggers configured for this setup."));
container.appendChild(info);
return
}
for (var idx in triggers) {
let trigger = triggers[idx];
var btn = document.createElement("button");
btn.appendChild(document.createTextNode(trigger));
btn.classList.add('btn');
btn.classList.add('btn-default');
btn.addEventListener('click', function(evt) {
ib.sendCommand("remote/trigger", trigger);
});
container.appendChild(btn);
container.appendChild(document.createTextNode(" "));
}
})
</script>
</body>
</html>