Commit 44cd9618 authored by Adrien Dorsaz's avatar Adrien Dorsaz

pubsub: we are able to display fetched informations !

well, not really interesting right now...
parent 5feef276
......@@ -68,7 +68,20 @@ function checkConnection() {
function refreshNetwork(response) {
if (!response.error) {
let xmppNet = document.getElementById('xmppNet');
xmppNet.innerHTML = response.toString();
let pubsubNet = {'pubsub': []}
let pubsubIterator = response.network.pubsub.keys();
let isIteratorDone = false
while (!isIteratorDone) {
let pubsub = pubsubIterator.next();
isIteratorDone = pubsub.done;
if (!isIteratorDone) {
pubsubNet['pubsub'].push({'name': pubsub.value});
}
}
xmppNet.innerHTML = Mustache.render('{{#pubsub}}{{name}}<br>{{/pubsub}}', pubsubNet);
}
else {
panel['error'].className = 'panel enabled';
......
......@@ -81,7 +81,8 @@ class Network {
}
browser.runtime.sendMessage({
'subject': 'refreshNetwork'
'subject': 'refreshNetwork',
'network': this
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment