add logging
This commit is contained in:
parent
486bc01976
commit
667551c7a0
27
app.js
27
app.js
|
@ -361,9 +361,30 @@ $(window).bind('unload', function () {
|
|||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Appends the given message to the chat conversation.
|
||||
*/
|
||||
// <a onclick="dump(event.target);">my download button</a>
|
||||
function dump(elem, filename){
|
||||
elem.download = filename || 'xmpplog.json';
|
||||
elem.href = 'data:application/json;charset=utf-8,\n';
|
||||
var data = {};
|
||||
data.time = new Date();
|
||||
data.url = window.location.href;
|
||||
data.ua = navigator.userAgent;
|
||||
if (connection.logger) {
|
||||
data.xmpp = connection.logger.log;
|
||||
}
|
||||
if (connection.jingle) {
|
||||
Object.keys(connection.jingle.sessions).forEach(function (sid) {
|
||||
var session = connection.jingle.sessions[sid];
|
||||
if (session.peerconnection && session.peerconnection.updateLog) {
|
||||
// FIXME: should probably be a .dump call
|
||||
data["jingle_" + session.sid] = session.peerconnection.updateLog;
|
||||
}
|
||||
});
|
||||
}
|
||||
elem.href += encodeURIComponent(JSON.stringify(data, null, ' '));
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateChatConversation(nick, message)
|
||||
{
|
||||
var divClassName = '';
|
||||
|
|
|
@ -13,11 +13,4 @@ Strophe.addConnectionPlugin('logger', {
|
|||
log_outgoing: function (stanza) {
|
||||
this.log.push([new Date().getTime(), 'outgoing', stanza]);
|
||||
},
|
||||
// <a onclick="connection.logger.dump(event.target);">my download button</a>
|
||||
dump: function (what, filename){
|
||||
what.download = filename || 'xmpplog.json';
|
||||
what.href = 'data:application/json;charset=utf-8,\n';
|
||||
what.href += encodeURIComponent(JSON.stringify(this.log, null, ' '));
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
<a class="button" onclick="openLinkDialog();"><i title="Invite others" class="fa fa-link fa-lg"></i></a>
|
||||
<div class="header_button_separator"></div>
|
||||
<a class="button" onclick='openChat();'><i id="chat" title="Open chat" class="fa fa-comments fa-lg"></i></a>
|
||||
<!--i class='fa fa-external-link'> </i>Others can join you by just going to <span id='roomurl'></span-->
|
||||
</div>
|
||||
</div>
|
||||
<div id="settings">
|
||||
|
|
|
@ -72,7 +72,7 @@ ColibriFocus.prototype.makeConference = function (peers) {
|
|||
ob.channels.push([]);
|
||||
});
|
||||
|
||||
this.peerconnection = new RTC.peerconnection(this.connection.jingle.ice_config, this.connection.jingle.pc_constraints);
|
||||
this.peerconnection = new TraceablePeerConnection(this.connection.jingle.ice_config, this.connection.jingle.pc_constraints);
|
||||
this.peerconnection.addStream(this.connection.jingle.localStream);
|
||||
this.peerconnection.oniceconnectionstatechange = function (event) {
|
||||
console.warn('ice connection state changed to', ob.peerconnection.iceConnectionState);
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue