remove Prezi and Etherpad dependencies from Toolbar

This commit is contained in:
isymchych 2015-12-09 15:09:12 +02:00
parent fbcd2d2320
commit 5846a25fc3
4 changed files with 628 additions and 906 deletions

File diff suppressed because it is too large Load Diff

View File

@ -171,6 +171,14 @@ function registerListeners() {
UI.addListener(UIEvents.EMAIL_CHANGED, function (email) { UI.addListener(UIEvents.EMAIL_CHANGED, function (email) {
UI.setUserAvatar(APP.conference.localId, email); UI.setUserAvatar(APP.conference.localId, email);
}); });
UI.addListener(UIEvents.PREZI_CLICKED, function () {
Prezi.openPreziDialog();
});
UI.addListener(UIEvents.ETHERPAD_CLICKED, function () {
Etherpad.toggleEtherpad(0);
});
} }
function bindEvents() { function bindEvents() {

View File

@ -2,13 +2,9 @@
/* jshint -W101 */ /* jshint -W101 */
var messageHandler = require("../util/MessageHandler"); var messageHandler = require("../util/MessageHandler");
var BottomToolbar = require("./BottomToolbar"); var BottomToolbar = require("./BottomToolbar");
var Prezi = require("../prezi/Prezi");
var Etherpad = require("../etherpad/Etherpad");
var PanelToggler = require("../side_pannels/SidePanelToggler"); var PanelToggler = require("../side_pannels/SidePanelToggler");
var Authentication = require("../authentication/Authentication"); var Authentication = require("../authentication/Authentication");
var UIUtil = require("../util/UIUtil"); var UIUtil = require("../util/UIUtil");
var AuthenticationEvents
= require("../../../service/authentication/AuthenticationEvents");
var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter"); var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
var Feedback = require("../Feedback"); var Feedback = require("../Feedback");
var UIEvents = require("../../../service/UI/UIEvents"); var UIEvents = require("../../../service/UI/UIEvents");
@ -20,7 +16,7 @@ var emitter = null;
var buttonHandlers = { var buttonHandlers = {
"toolbar_button_mute": function () { "toolbar_button_mute": function () {
if (APP.RTC.localAudio.isMuted()) { if (APP.conference.audioMuted) {
AnalyticsAdapter.sendEvent('toolbar.audio.unmuted'); AnalyticsAdapter.sendEvent('toolbar.audio.unmuted');
emitter.emit(UIEvents.AUDIO_MUTED, false); emitter.emit(UIEvents.AUDIO_MUTED, false);
} else { } else {
@ -29,7 +25,7 @@ var buttonHandlers = {
} }
}, },
"toolbar_button_camera": function () { "toolbar_button_camera": function () {
if (APP.RTC.localVideo.isMuted()) { if (APP.conference.videoMuted) {
AnalyticsAdapter.sendEvent('toolbar.video.enabled'); AnalyticsAdapter.sendEvent('toolbar.video.enabled');
emitter.emit(UIEvents.VIDEO_MUTED, false); emitter.emit(UIEvents.VIDEO_MUTED, false);
} else { } else {
@ -62,11 +58,11 @@ var buttonHandlers = {
}, },
"toolbar_button_prezi": function () { "toolbar_button_prezi": function () {
AnalyticsAdapter.sendEvent('toolbar.prezi.clicked'); AnalyticsAdapter.sendEvent('toolbar.prezi.clicked');
return Prezi.openPreziDialog(); emitter.emit(UIEvents.PREZI_CLICKED);
}, },
"toolbar_button_etherpad": function () { "toolbar_button_etherpad": function () {
AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked'); AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked');
return Etherpad.toggleEtherpad(0); emitter.emit(UIEvents.ETHERPAD_CLICKED);
}, },
"toolbar_button_desktopsharing": function () { "toolbar_button_desktopsharing": function () {
if (APP.desktopsharing.isUsingScreenStream) { if (APP.desktopsharing.isUsingScreenStream) {
@ -317,26 +313,6 @@ var Toolbar = (function (my) {
for(var k in buttonHandlers) for(var k in buttonHandlers)
$("#" + k).click(buttonHandlers[k]); $("#" + k).click(buttonHandlers[k]);
// Update login info
APP.xmpp.addListener(
AuthenticationEvents.IDENTITY_UPDATED,
function (authenticationEnabled, userIdentity) {
var loggedIn = false;
if (userIdentity) {
loggedIn = true;
}
Toolbar.showAuthenticateButton(authenticationEnabled);
if (authenticationEnabled) {
Toolbar.setAuthenticatedIdentity(userIdentity);
Toolbar.showLoginButton(!loggedIn);
Toolbar.showLogoutButton(loggedIn);
}
}
);
}; };
/** /**

View File

@ -21,6 +21,8 @@ var UIEvents = {
START_MUTED_CHANGED: "UI.start_muted_changed", START_MUTED_CHANGED: "UI.start_muted_changed",
AUDIO_MUTED: "UI.audio_muted", AUDIO_MUTED: "UI.audio_muted",
VIDEO_MUTED: "UI.video_muted", VIDEO_MUTED: "UI.video_muted",
PREZI_CLICKED: "UI.prezi_clicked",
ETHERPAD_CLICKED: "UI.etherpad_clicked",
/** /**
* Notifies interested parties when the film strip (remote video's panel) * Notifies interested parties when the film strip (remote video's panel)
* is hidden (toggled) or shown (un-toggled). * is hidden (toggled) or shown (un-toggled).