Fix CallStats require and initialize API commands and keyboard shortcuts in init method
This commit is contained in:
@@ -15,15 +15,19 @@ var XMPPEvents = require("../../service/xmpp/XMPPEvents");
|
||||
* filmStrip: toggleFilmStrip
|
||||
* }}
|
||||
*/
|
||||
var commands =
|
||||
{
|
||||
displayName: APP.UI.inputDisplayNameHandler,
|
||||
muteAudio: APP.UI.toggleAudio,
|
||||
muteVideo: APP.UI.toggleVideo,
|
||||
toggleFilmStrip: APP.UI.toggleFilmStrip,
|
||||
toggleChat: APP.UI.toggleChat,
|
||||
toggleContactList: APP.UI.toggleContactList
|
||||
};
|
||||
var commands = {};
|
||||
|
||||
function initCommands() {
|
||||
commands =
|
||||
{
|
||||
displayName: APP.UI.inputDisplayNameHandler,
|
||||
muteAudio: APP.UI.toggleAudio,
|
||||
muteVideo: APP.UI.toggleVideo,
|
||||
toggleFilmStrip: APP.UI.toggleFilmStrip,
|
||||
toggleChat: APP.UI.toggleChat,
|
||||
toggleContactList: APP.UI.toggleContactList
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -176,6 +180,7 @@ var API = {
|
||||
* is initialized.
|
||||
*/
|
||||
init: function () {
|
||||
initCommands();
|
||||
if (window.addEventListener)
|
||||
{
|
||||
window.addEventListener('message',
|
||||
|
||||
@@ -1,38 +1,42 @@
|
||||
//maps keycode to character, id of popover for given function and function
|
||||
var shortcuts = {
|
||||
67: {
|
||||
character: "C",
|
||||
id: "toggleChatPopover",
|
||||
function: APP.UI.toggleChat
|
||||
},
|
||||
70: {
|
||||
character: "F",
|
||||
id: "filmstripPopover",
|
||||
function: APP.UI.toggleFilmStrip
|
||||
},
|
||||
77: {
|
||||
character: "M",
|
||||
id: "mutePopover",
|
||||
function: APP.UI.toggleAudio
|
||||
},
|
||||
84: {
|
||||
character: "T",
|
||||
function: function() {
|
||||
if(!APP.RTC.localAudio.isMuted()) {
|
||||
APP.UI.toggleAudio();
|
||||
var shortcuts = {};
|
||||
function initShortcutHandlers() {
|
||||
shortcuts = {
|
||||
67: {
|
||||
character: "C",
|
||||
id: "toggleChatPopover",
|
||||
function: APP.UI.toggleChat
|
||||
},
|
||||
70: {
|
||||
character: "F",
|
||||
id: "filmstripPopover",
|
||||
function: APP.UI.toggleFilmStrip
|
||||
},
|
||||
77: {
|
||||
character: "M",
|
||||
id: "mutePopover",
|
||||
function: APP.UI.toggleAudio
|
||||
},
|
||||
84: {
|
||||
character: "T",
|
||||
function: function() {
|
||||
if(!APP.RTC.localAudio.isMuted()) {
|
||||
APP.UI.toggleAudio();
|
||||
}
|
||||
}
|
||||
},
|
||||
86: {
|
||||
character: "V",
|
||||
id: "toggleVideoPopover",
|
||||
function: APP.UI.toggleVideo
|
||||
}
|
||||
},
|
||||
86: {
|
||||
character: "V",
|
||||
id: "toggleVideoPopover",
|
||||
function: APP.UI.toggleVideo
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
var KeyboardShortcut = {
|
||||
init: function () {
|
||||
initShortcutHandlers();
|
||||
window.onkeyup = function(e) {
|
||||
var keycode = e.which;
|
||||
if(!($(":focus").is("input[type=text]") ||
|
||||
|
||||
Reference in New Issue
Block a user