Added device chat support in mobile app.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-05 12:08:13 -08:00
parent 91f33dfd73
commit ef08c0b9b8
2 changed files with 243 additions and 221 deletions

File diff suppressed because it is too large Load Diff

View File

@ -723,7 +723,8 @@
<div id=deskarea4 style="position:absolute;bottom:0px;width:100%;height:32px">
<div style=padding-top:2px;padding-bottom:2px;background:#C0C0C0>
<div style=float:right;text-align:right>
<span id=DeskToastButton><img src='images/icon-notify.png' onclick=deviceToastFunction() height=16 width=16 style=padding-top:5px /></span>&nbsp;
<span id=DeskChatButton><img src='images/icon-chat.png' onclick=deviceChat(event) height=16 width=16 style=padding-top:5px;cursor:pointer /></span>&nbsp;
<span id=DeskToastButton><img src='images/icon-notify.png' onclick=deviceToastFunction() height=16 width=16 style=padding-top:5px;cursor:pointer /></span>&nbsp;
<!--<input id=DeskToolsButton type=button value=Tools onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()">&nbsp;-->
</div>
<div>
@ -2957,6 +2958,20 @@
setDialogMode(2, "Device Action", (count == 0) ? 1 : 3, deviceActionFunctionEx, x);
}
function deviceChat(e) {
if (xxdialogMode) return;
setDialogMode(2, "Device Action", 3, function () {
var url = '/messenger?id=meshmessenger/' + encodeURIComponentEx(currentNode._id) + '/' + encodeURIComponentEx(userinfo._id) + '&title=' + currentNode.name;
if ((authCookie != null) && (authCookie != '')) { url += '&auth=' + authCookie; }
if (e && (e.shiftKey == true)) {
safeNewWindow(url, 'meshmessenger:' + currentNode._id);
} else {
safeNewWindow(url, 'meshmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560');
}
meshserver.send({ action: 'meshmessenger', nodeid: decodeURIComponent(currentNode._id) });
}, "Start chat session?");
}
function deviceActionFunctionEx() {
var op = Q('d2deviceop').value;
if (op == 100) {