Add mailbox inner channel

This commit is contained in:
yflory
2019-05-15 14:52:58 +02:00
parent 11b57cddb1
commit 3feb310fc4
3 changed files with 45 additions and 0 deletions

View File

@@ -656,6 +656,12 @@ define([
};
cursor.onEvent = Util.mkEvent();
// Mailbox
var mailbox = common.mailbox = {};
mailbox.execCommand = function (data, cb) {
postMessage("MAILBOX_COMMAND", data, cb);
};
mailbox.onEvent = Util.mkEvent();
// Pad RPC
var pad = common.padRpc = {};
@@ -1096,6 +1102,8 @@ define([
CHAT_EVENT: common.messenger.onEvent.fire,
// Cursor
CURSOR_EVENT: common.cursor.onEvent.fire,
// Mailbox
MAILBOX_EVENT: common.mailbox.onEvent.fire,
// Pad
PAD_READY: common.padRpc.onReadyEvent.fire,
PAD_MESSAGE: common.padRpc.onMessageEvent.fire,