|
@@ -361,9 +361,30 @@ $(window).bind('unload', function () {
|
361
|
361
|
}
|
362
|
362
|
});
|
363
|
363
|
|
364
|
|
-/*
|
365
|
|
- * Appends the given message to the chat conversation.
|
366
|
|
- */
|
|
364
|
+// <a onclick="dump(event.target);">my download button</a>
|
|
365
|
+function dump(elem, filename){
|
|
366
|
+ elem.download = filename || 'xmpplog.json';
|
|
367
|
+ elem.href = 'data:application/json;charset=utf-8,\n';
|
|
368
|
+ var data = {};
|
|
369
|
+ data.time = new Date();
|
|
370
|
+ data.url = window.location.href;
|
|
371
|
+ data.ua = navigator.userAgent;
|
|
372
|
+ if (connection.logger) {
|
|
373
|
+ data.xmpp = connection.logger.log;
|
|
374
|
+ }
|
|
375
|
+ if (connection.jingle) {
|
|
376
|
+ Object.keys(connection.jingle.sessions).forEach(function (sid) {
|
|
377
|
+ var session = connection.jingle.sessions[sid];
|
|
378
|
+ if (session.peerconnection && session.peerconnection.updateLog) {
|
|
379
|
+ // FIXME: should probably be a .dump call
|
|
380
|
+ data["jingle_" + session.sid] = session.peerconnection.updateLog;
|
|
381
|
+ }
|
|
382
|
+ });
|
|
383
|
+ }
|
|
384
|
+ elem.href += encodeURIComponent(JSON.stringify(data, null, ' '));
|
|
385
|
+ return false;
|
|
386
|
+}
|
|
387
|
+
|
367
|
388
|
function updateChatConversation(nick, message)
|
368
|
389
|
{
|
369
|
390
|
var divClassName = '';
|