mirror of https://github.com/embarklabs/embark.git
re-enable whisper in test app
This commit is contained in:
parent
12c8e223d6
commit
9e1fff2cdb
|
@ -125,40 +125,40 @@ $(document).ready(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
////// ===========================
|
// ===========================
|
||||||
////// Communication (Whisper) example
|
// Communication (Whisper) example
|
||||||
////// ===========================
|
// ===========================
|
||||||
////$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
////
|
|
||||||
//// $("#communication .error").hide();
|
$("#communication .error").hide();
|
||||||
//// $("#communication .errorVersion").hide();
|
$("#communication .errorVersion").hide();
|
||||||
//// if (EmbarkJS.Messages.providerName === 'whisper') {
|
if (EmbarkJS.Messages.providerName === 'whisper') {
|
||||||
//// EmbarkJS.Messages.getWhisperVersion(function(err, version) {
|
EmbarkJS.Messages.getWhisperVersion(function(err, version) {
|
||||||
//// if (err) {
|
if (err) {
|
||||||
//// $("#communication .error").show();
|
$("#communication .error").show();
|
||||||
//// $("#communication-controls").hide();
|
$("#communication-controls").hide();
|
||||||
//// $("#status-communication").addClass('status-offline');
|
$("#status-communication").addClass('status-offline');
|
||||||
//// } else {
|
} else {
|
||||||
//// EmbarkJS.Messages.setProvider('whisper');
|
EmbarkJS.Messages.setProvider('whisper');
|
||||||
//// $("#status-communication").addClass('status-online');
|
$("#status-communication").addClass('status-online');
|
||||||
//// }
|
}
|
||||||
//// });
|
});
|
||||||
//// }
|
}
|
||||||
////
|
|
||||||
//// $("#communication button.listenToChannel").click(function() {
|
$("#communication button.listenToChannel").click(function() {
|
||||||
//// var channel = $("#communication .listen input.channel").val();
|
var channel = $("#communication .listen input.channel").val();
|
||||||
//// $("#communication #subscribeList").append("<br> subscribed to " + channel + " now try sending a message");
|
$("#communication #subscribeList").append("<br> subscribed to " + channel + " now try sending a message");
|
||||||
//// EmbarkJS.Messages.listenTo({topic: [channel]}).then(function(message) {
|
EmbarkJS.Messages.listenTo({topic: [channel]}).then(function(message) {
|
||||||
//// $("#communication #messagesList").append("<br> channel: " + channel + " message: " + message);
|
$("#communication #messagesList").append("<br> channel: " + channel + " message: " + message);
|
||||||
//// });
|
});
|
||||||
//// addToLog("#communication", "EmbarkJS.Messages.listenTo({topic: ['" + channel + "']}).then(function(message) {})");
|
addToLog("#communication", "EmbarkJS.Messages.listenTo({topic: ['" + channel + "']}).then(function(message) {})");
|
||||||
//// });
|
});
|
||||||
////
|
|
||||||
//// $("#communication button.sendMessage").click(function() {
|
$("#communication button.sendMessage").click(function() {
|
||||||
//// var channel = $("#communication .send input.channel").val();
|
var channel = $("#communication .send input.channel").val();
|
||||||
//// var message = $("#communication .send input.message").val();
|
var message = $("#communication .send input.message").val();
|
||||||
//// EmbarkJS.Messages.sendMessage({topic: channel, data: message});
|
EmbarkJS.Messages.sendMessage({topic: channel, data: message});
|
||||||
//// addToLog("#communication", "EmbarkJS.Messages.sendMessage({topic: '" + channel + "', data: '" + message + "'})");
|
addToLog("#communication", "EmbarkJS.Messages.sendMessage({topic: '" + channel + "', data: '" + message + "'})");
|
||||||
//// });
|
});
|
||||||
////
|
|
||||||
////});
|
});
|
||||||
|
|
Loading…
Reference in New Issue