Add analytics for toolbar items

This commit is contained in:
Issac Gerges 2015-09-02 12:08:48 -05:00
parent 92a6b765a2
commit 5734d5ad80
1 changed files with 33 additions and 0 deletions

View File

@ -9,6 +9,7 @@ var Authentication = require("../authentication/Authentication");
var UIUtil = require("../util/UIUtil");
var AuthenticationEvents
= require("../../../service/authentication/AuthenticationEvents");
var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
var roomUrl = null;
var sharedKey = '';
@ -17,55 +18,87 @@ var recordingToaster = null;
var buttonHandlers = {
"toolbar_button_mute": function () {
if (APP.RTC.localAudio.isMuted()) {
AnalyticsAdapter.sendEvent('toolbar.audio.unmuted')
} else {
AnalyticsAdapter.sendEvent('toolbar.audio.muted');
}
return APP.UI.toggleAudio();
},
"toolbar_button_camera": function () {
if (APP.RTC.localVideo.isMuted()) {
AnalyticsAdapter.sendEvent('toolbar.video.enabled');
} else {
AnalyticsAdapter.sendEvent('toolbar.video.disabled');
}
return APP.UI.toggleVideo();
},
/*"toolbar_button_authentication": function () {
return Toolbar.authenticateClicked();
},*/
"toolbar_button_record": function () {
AnalyticsAdapter.sendEvent('toolbar.recording.toggled');
return toggleRecording();
},
"toolbar_button_security": function () {
if (sharedKey) {
AnalyticsAdapter.sendEvent('toolbar.lock.disabled')
} else {
AnalyticsAdapter.sendEvent('toolbar.lock.enabled');
}
return Toolbar.openLockDialog();
},
"toolbar_button_link": function () {
AnalyticsAdapter.sendEvent('toolbar.invite.clicked');
return Toolbar.openLinkDialog();
},
"toolbar_button_chat": function () {
AnalyticsAdapter.sendEvent('toolbar.chat.toggled');
return BottomToolbar.toggleChat();
},
"toolbar_button_prezi": function () {
AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
return Prezi.openPreziDialog();
},
"toolbar_button_etherpad": function () {
AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
return Etherpad.toggleEtherpad(0);
},
"toolbar_button_desktopsharing": function () {
if (APP.desktopsharing.isUsingScreenStream) {
AnalyticsAdapter.sendEvent('toolbar.screen.disabled');
} else {
AnalyticsAdapter.sendEvent('toolbar.screen.enabled');
}
return APP.desktopsharing.toggleScreenSharing();
},
"toolbar_button_fullScreen": function() {
AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled');
UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
return Toolbar.toggleFullScreen();
},
"toolbar_button_sip": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.clicked');
return callSipButtonClicked();
},
"toolbar_button_dialpad": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked');
return dialpadButtonClicked();
},
"toolbar_button_settings": function () {
AnalyticsAdapter.sendEvent('toolbar.settings.toggled');
PanelToggler.toggleSettingsMenu();
},
"toolbar_button_hangup": function () {
AnalyticsAdapter.sendEvent('toolbar.hangup');
return hangup();
},
"toolbar_button_login": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked');
Toolbar.authenticateClicked();
},
"toolbar_button_logout": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked');
// Ask for confirmation
messageHandler.openTwoButtonDialog(
"dialog.logoutTitle",