forked from Shikaga/DamJS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ServicesListElement.js
38 lines (36 loc) · 1.31 KB
/
ServicesListElement.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
define(['lib/react'], function(React) {
return React.createClass({
setServiceUp: function(service) {
return function() {
var e = new caplin.streamlink.impl.event.ServiceStatusEventImpl('OK', service)
var b = CTSL.getSLJS()._streamLinkCore._protocolHandler.connection.connectionListeners[3];
debugger;
b.onServiceStatusChange(e);
}
},
setServiceDown: function(service) {
return function() {
var e = new caplin.streamlink.impl.event.ServiceStatusEventImpl('DOWN', service)
var b = CTSL.getSLJS()._streamLinkCore._protocolHandler.connection.connectionListeners[3];
debugger;
b.onServiceStatusChange(e);
}
},
render: function() {
var serviceElements = []
var services = CTSL.getSLJS()._streamLinkCore._protocolHandler.connection.connectionListeners[3]._services;
if (services) {
for (var service in services) {
serviceElements.push(React.DOM.div({},
React.DOM.span({}, service),
React.DOM.button({onClick: this.setServiceUp(service)}, "Up"),
React.DOM.button({onClick: this.setServiceDown(service)}, "Down")
))
}
}
return React.DOM.div({},
React.DOM.button({onClick: this.props.back}, "Back"),
serviceElements);
}
});
});