Can now save chat session in messenger.

This commit is contained in:
Ylian Saint-Hilaire 2020-06-30 12:42:58 -07:00
parent 2830fdd980
commit 45cbb73547
7 changed files with 49 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

View File

@ -119,6 +119,11 @@
background-color: gray; background-color: gray;
} }
.icon15 {
background: url(../images/messenger32.png) -448px 0px;
background-color: gray;
}
.fileicon { .fileicon {
background: url(../images/messenger32.png) -96px 0px; background: url(../images/messenger32.png) -96px 0px;
height: 32px; height: 32px;

View File

@ -5269,6 +5269,12 @@
"default.handlebars->27->1366" "default.handlebars->27->1366"
] ]
}, },
{
"en": "ChatSession",
"xloc": [
"messenger.handlebars->13->14"
]
},
{ {
"cs": "čečenština", "cs": "čečenština",
"de": "Tschetschenisch", "de": "Tschetschenisch",
@ -6504,7 +6510,7 @@
"ru": "Подключено.", "ru": "Подключено.",
"zh-chs": "連接的。", "zh-chs": "連接的。",
"xloc": [ "xloc": [
"messenger.handlebars->13->7" "messenger.handlebars->13->12"
] ]
}, },
{ {
@ -6580,7 +6586,7 @@
"ru": "Подключение прервано.", "ru": "Подключение прервано.",
"zh-chs": "連接已關閉。", "zh-chs": "連接已關閉。",
"xloc": [ "xloc": [
"messenger.handlebars->13->3" "messenger.handlebars->13->6"
] ]
}, },
{ {
@ -6673,7 +6679,8 @@
"zh-chs": "控制", "zh-chs": "控制",
"xloc": [ "xloc": [
"default.handlebars->27->618", "default.handlebars->27->618",
"default.handlebars->27->637" "default.handlebars->27->637",
"messenger.handlebars->13->1"
] ]
}, },
{ {
@ -8979,7 +8986,8 @@
"ru": "Скачать", "ru": "Скачать",
"zh-chs": "下載", "zh-chs": "下載",
"xloc": [ "xloc": [
"download.handlebars->container->page_content->column_l->1" "download.handlebars->container->page_content->column_l->1",
"messenger.handlebars->13->10"
] ]
}, },
{ {
@ -10655,7 +10663,7 @@
"ru": "Ошибка: Не указан ключ подключения.", "ru": "Ошибка: Не указан ключ подключения.",
"zh-chs": "錯誤:未指定連接密鑰。", "zh-chs": "錯誤:未指定連接密鑰。",
"xloc": [ "xloc": [
"messenger.handlebars->13->8" "messenger.handlebars->13->13"
] ]
}, },
{ {
@ -15126,8 +15134,8 @@
"ru": "Ограничение загрузки 10 файлов одновременно.", "ru": "Ограничение загрузки 10 файлов одновременно.",
"zh-chs": "一次最多可上傳10個文件。", "zh-chs": "一次最多可上傳10個文件。",
"xloc": [ "xloc": [
"messenger.handlebars->13->4", "messenger.handlebars->13->7",
"messenger.handlebars->13->5" "messenger.handlebars->13->8"
] ]
}, },
{ {
@ -15534,6 +15542,7 @@
"ru": "Локальный", "ru": "Локальный",
"zh-chs": "本地", "zh-chs": "本地",
"xloc": [ "xloc": [
"messenger.handlebars->13->5",
"messenger.handlebars->localVideo->1" "messenger.handlebars->localVideo->1"
] ]
}, },
@ -17170,8 +17179,8 @@
"ru": "MeshMessenger", "ru": "MeshMessenger",
"zh-chs": "網格信使", "zh-chs": "網格信使",
"xloc": [ "xloc": [
"messenger.handlebars->13->1", "messenger.handlebars->13->3",
"messenger.handlebars->13->2", "messenger.handlebars->13->4",
"messenger.handlebars->xtop->3->0->xtitle" "messenger.handlebars->xtop->3->0->xtitle"
] ]
}, },
@ -21444,6 +21453,7 @@
"ru": "Удаленно", "ru": "Удаленно",
"zh-chs": "遠程", "zh-chs": "遠程",
"xloc": [ "xloc": [
"messenger.handlebars->13->2",
"messenger.handlebars->remoteVideo->1" "messenger.handlebars->remoteVideo->1"
] ]
}, },
@ -22675,6 +22685,12 @@
"default.handlebars->container->column_l->p11->deskarea0->deskarea4->1" "default.handlebars->container->column_l->p11->deskarea0->deskarea4->1"
] ]
}, },
{
"en": "Save conversation",
"xloc": [
"messenger.handlebars->xtop->1"
]
},
{ {
"cs": "Uložit umístění uzlu", "cs": "Uložit umístění uzlu",
"de": "Knoten-Standort speichern", "de": "Knoten-Standort speichern",
@ -27453,7 +27469,8 @@
"default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->2->1->3", "default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->2->1->3",
"default-mobile.handlebars->container->page_content->column_l->p5->p5myfiles->p5toolbar->1->0->1->3", "default-mobile.handlebars->container->page_content->column_l->p5->p5myfiles->p5toolbar->1->0->1->3",
"default.handlebars->container->column_l->p13->p13toolbar->1->2->1->3", "default.handlebars->container->column_l->p13->p13toolbar->1->2->1->3",
"default.handlebars->container->column_l->p5->p5toolbar->1->0->p5filehead->3" "default.handlebars->container->column_l->p5->p5toolbar->1->0->p5filehead->3",
"messenger.handlebars->13->9"
] ]
}, },
{ {
@ -28560,7 +28577,7 @@
"ru": "В ожидании другой стороны...", "ru": "В ожидании другой стороны...",
"zh-chs": "正在等待其他用戶...", "zh-chs": "正在等待其他用戶...",
"xloc": [ "xloc": [
"messenger.handlebars->13->6" "messenger.handlebars->13->11"
] ]
}, },
{ {

View File

@ -13,7 +13,8 @@
<body style="font-family:Arial,Helvetica,sans-serif"> <body style="font-family:Arial,Helvetica,sans-serif">
<div id="xtop" style="position:absolute;left:0;right:0;top:0;height:38px;background-color:#036;color:#c8c8c8;box-shadow:3px 3px 10px gray"> <div id="xtop" style="position:absolute;left:0;right:0;top:0;height:38px;background-color:#036;color:#c8c8c8;box-shadow:3px 3px 10px gray">
<div style="position:absolute;background-color:#036;right:0;height:38px"> <div style="position:absolute;background-color:#036;right:0;height:38px">
<div id="notifyButton" class="icon13 topButton" style="margin-right:4px;display:none" title="Enable browser notification" onclick="enableNotificationsButtonClick()"></div> <div id="saveButton" class="icon15 topButton" style="margin-right:4px" title="Save conversation" onclick="saveChatSession()"></div>
<div id="notifyButton" class="icon13 topButton" style="display:none" title="Enable browser notification" onclick="enableNotificationsButtonClick()"></div>
<div id="fileButton" class="icon4 topButton" title="Share a file" style="display:none" onclick="fileButtonClick()"></div> <div id="fileButton" class="icon4 topButton" title="Share a file" style="display:none" onclick="fileButtonClick()"></div>
<div id="camButton" class="icon2 topButton" title="Activate camera & microphone" style="display:none" onclick="camButtonClick()"></div> <div id="camButton" class="icon2 topButton" title="Activate camera & microphone" style="display:none" onclick="camButtonClick()"></div>
<div id="micButton" class="icon6 topButton" title="Activate microphone" style="display:none" onclick="micButtonClick()"></div> <div id="micButton" class="icon6 topButton" title="Activate microphone" style="display:none" onclick="micButtonClick()"></div>
@ -61,6 +62,7 @@
var webrtcconfiguration = '{{{webrtconfig}}}'; var webrtcconfiguration = '{{{webrtconfig}}}';
if (webrtcconfiguration == '') { webrtcconfiguration = null; } else { try { webrtcconfiguration = JSON.parse(decodeURIComponent(webrtcconfiguration)); } catch (ex) { console.log('Invalid WebRTC config: "' + webrtcconfiguration + '".'); webrtcconfiguration = null; } } if (webrtcconfiguration == '') { webrtcconfiguration = null; } else { try { webrtcconfiguration = JSON.parse(decodeURIComponent(webrtcconfiguration)); } catch (ex) { console.log('Invalid WebRTC config: "' + webrtcconfiguration + '".'); webrtcconfiguration = null; } }
var windowFocus = true; var windowFocus = true;
var chatTestSession = new Date().toString() + '\r\n';
// File transfer state // File transfer state
var fileUploads = []; var fileUploads = [];
@ -119,7 +121,7 @@
} }
function onUserInputFocus(x) { userInputFocus = x; } function onUserInputFocus(x) { userInputFocus = x; }
function displayClear() { QH('xmsg', ''); cancelAllFileTransfers(); fileUploads = [], fileDownloads = {}; } function displayClear() { chatTestSession = new Date().toString() + '\r\n'; QH('xmsg', ''); cancelAllFileTransfers(); fileUploads = [], fileDownloads = {}; }
// Polyfill FileReader if needed // Polyfill FileReader if needed
if (!FileReader.prototype.readAsBinaryString) { if (!FileReader.prototype.readAsBinaryString) {
@ -154,6 +156,7 @@
// Display a control message // Display a control message
function displayControl(msg) { function displayControl(msg) {
chatTestSession += ("Control" + '> ' + msg + '\r\n');
QA('xmsg', '<div style="clear:both"><div style="color:gray;float:left;margin-bottom:2px">' + EscapeHtml(msg) + '</div><div></div></div>'); QA('xmsg', '<div style="clear:both"><div style="color:gray;float:left;margin-bottom:2px">' + EscapeHtml(msg) + '</div><div></div></div>');
Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;//Q('xmsg').scrollHeight; Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;//Q('xmsg').scrollHeight;
} }
@ -168,7 +171,7 @@
// Display a message from the remote user // Display a message from the remote user
function displayRemote(msg) { function displayRemote(msg) {
console.log(document.activeElement); chatTestSession += ("Remote" + '> ' + msg + '\r\n');
QA('xmsg', '<div style="clear:both"><div class="remoteBubble">' + EscapeHtml(msg) + '</div><div></div></div>'); QA('xmsg', '<div style="clear:both"><div class="remoteBubble">' + EscapeHtml(msg) + '</div><div></div></div>');
Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight; Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;
@ -191,6 +194,7 @@
var outtext = Q('xouttext').value; var outtext = Q('xouttext').value;
if (outtext.length > 0) { if (outtext.length > 0) {
Q('xouttext').value = ''; Q('xouttext').value = '';
chatTestSession += ("Local" + '> ' + outtext + '\r\n');
QA('xmsg', '<div style="clear:both"><div class="localBubble">' + EscapeHtml(outtext) + '</div><div></div></div>'); QA('xmsg', '<div style="clear:both"><div class="localBubble">' + EscapeHtml(outtext) + '</div><div></div></div>');
Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight; Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;
send({ action: 'chat', msg: outtext }); send({ action: 'chat', msg: outtext });
@ -425,6 +429,8 @@
if (state != 2) return; if (state != 2) return;
file.id = Math.random(); file.id = Math.random();
fileUploads.push(file); fileUploads.push(file);
console.log(file);
chatTestSession += ("Upload" + '> ' + file.name + '\r\n');
QA('xmsg', '<div style="clear:both"></div><div id="FILEUP-' + file.id + '" class="localBubble" style="width:240px;cursor:pointer" onclick="cancelFileTransfer(\'' + file.id + '\')"><div id="FILEUP-ICON-' + file.id + '" class="fileicon" style="float:left;width:32px;height:32px"></div><div><div id="FILEUP-NAME-' + file.id + '" style="height:16px;overflow:hidden;white-space:nowrap;" title="' + file.name + '">' + file.name + '</div><div style="width:200px;background-color:lightgray;margin-left:32px;border-radius:3px;margin-top:3px;height:11px"><div id="FILEUP-PROGRESS-' + file.id + '" style="width:0px;background-color:green;border-radius:3px;height:11px">&nbsp;</div></div></div></div>'); QA('xmsg', '<div style="clear:both"></div><div id="FILEUP-' + file.id + '" class="localBubble" style="width:240px;cursor:pointer" onclick="cancelFileTransfer(\'' + file.id + '\')"><div id="FILEUP-ICON-' + file.id + '" class="fileicon" style="float:left;width:32px;height:32px"></div><div><div id="FILEUP-NAME-' + file.id + '" style="height:16px;overflow:hidden;white-space:nowrap;" title="' + file.name + '">' + file.name + '</div><div style="width:200px;background-color:lightgray;margin-left:32px;border-radius:3px;margin-top:3px;height:11px"><div id="FILEUP-PROGRESS-' + file.id + '" style="width:0px;background-color:green;border-radius:3px;height:11px">&nbsp;</div></div></div></div>');
Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight; Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;
send({ action: 'file', size: file.size, id: file.id, type: file.type, name: file.name }); send({ action: 'file', size: file.size, id: file.id, type: file.type, name: file.name });
@ -434,6 +440,8 @@
function startFileDownload(file) { function startFileDownload(file) {
if (state != 2) return; if (state != 2) return;
fileDownloads[file.id] = file; fileDownloads[file.id] = file;
console.log(file);
chatTestSession += ("Download" + '> ' + file.name + '\r\n');
QA('xmsg', '<div style="clear:both"></div><div id="FILEUP-' + file.id + '" class="remoteBubble" style="width:240px;cursor:pointer" onclick="saveFileTransfer(\'' + file.id + '\')"><div id="FILEUP-ICON-' + file.id + '" class="fileicon" style="float:left;width:32px;height:32px"></div><div><div id="FILEUP-NAME-' + file.id + '" style="height:16px;overflow:hidden;white-space:nowrap;" title="' + file.name + '">' + file.name + '</div><div style="width:200px;background-color:lightgray;margin-left:32px;border-radius:3px;margin-top:3px;height:11px"><div id="FILEUP-PROGRESS-' + file.id + '" style="width:0px;background-color:green;border-radius:3px;height:11px">&nbsp;</div></div></div></div>'); QA('xmsg', '<div style="clear:both"></div><div id="FILEUP-' + file.id + '" class="remoteBubble" style="width:240px;cursor:pointer" onclick="saveFileTransfer(\'' + file.id + '\')"><div id="FILEUP-ICON-' + file.id + '" class="fileicon" style="float:left;width:32px;height:32px"></div><div><div id="FILEUP-NAME-' + file.id + '" style="height:16px;overflow:hidden;white-space:nowrap;" title="' + file.name + '">' + file.name + '</div><div style="width:200px;background-color:lightgray;margin-left:32px;border-radius:3px;margin-top:3px;height:11px"><div id="FILEUP-PROGRESS-' + file.id + '" style="width:0px;background-color:green;border-radius:3px;height:11px">&nbsp;</div></div></div></div>');
Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight; Q('xmsgparent').scrollTop = Q('xmsgparent').scrollHeight;
} }
@ -637,6 +645,10 @@
} }
} }
function saveChatSession() {
saveAs(data2blob(chatTestSession), "ChatSession");
}
start(); start();
function onUnLoad() { function onUnLoad() {