2015-07-28 21:52:32 +00:00
|
|
|
/* global $ */
|
2015-01-07 14:54:03 +00:00
|
|
|
var PanelToggler = require("../side_pannels/SidePanelToggler");
|
2015-08-28 21:13:40 +00:00
|
|
|
var UIUtil = require("../util/UIUtil");
|
2015-09-02 17:10:04 +00:00
|
|
|
var AnalyticsAdapter = require("../../statistics/AnalyticsAdapter");
|
2015-11-13 17:04:49 +00:00
|
|
|
var UIEvents = require("../../../service/UI/UIEvents");
|
|
|
|
|
|
|
|
var eventEmitter = null;
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
var buttonHandlers = {
|
|
|
|
"bottom_toolbar_contact_list": function () {
|
2015-09-02 17:10:04 +00:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.contacts.toggled');
|
2015-01-07 14:54:03 +00:00
|
|
|
BottomToolbar.toggleContactList();
|
|
|
|
},
|
|
|
|
"bottom_toolbar_film_strip": function () {
|
2015-09-02 17:10:04 +00:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.filmstrip.toggled');
|
2015-01-07 14:54:03 +00:00
|
|
|
BottomToolbar.toggleFilmStrip();
|
|
|
|
},
|
|
|
|
"bottom_toolbar_chat": function () {
|
2015-09-02 17:10:04 +00:00
|
|
|
AnalyticsAdapter.sendEvent('bottomtoolbar.chat.toggled');
|
2015-01-07 14:54:03 +00:00
|
|
|
BottomToolbar.toggleChat();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-08-28 21:13:40 +00:00
|
|
|
|
|
|
|
var defaultBottomToolbarButtons = {
|
|
|
|
'chat': '#bottom_toolbar_chat',
|
|
|
|
'contacts': '#bottom_toolbar_contact_list',
|
|
|
|
'filmstrip': '#bottom_toolbar_film_strip'
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-08-22 15:37:11 +00:00
|
|
|
var BottomToolbar = (function (my) {
|
2015-11-13 17:04:49 +00:00
|
|
|
my.init = function (emitter) {
|
|
|
|
eventEmitter = emitter;
|
2015-08-28 21:13:40 +00:00
|
|
|
UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
|
|
|
|
|
2015-01-07 14:54:03 +00:00
|
|
|
for(var k in buttonHandlers)
|
|
|
|
$("#" + k).click(buttonHandlers[k]);
|
|
|
|
};
|
|
|
|
|
2014-08-22 15:37:11 +00:00
|
|
|
my.toggleChat = function() {
|
2014-10-31 11:47:12 +00:00
|
|
|
PanelToggler.toggleChat();
|
2014-08-22 15:37:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
my.toggleContactList = function() {
|
2014-10-31 11:47:12 +00:00
|
|
|
PanelToggler.toggleContactList();
|
2014-08-22 15:37:11 +00:00
|
|
|
};
|
|
|
|
|
2014-09-04 08:15:48 +00:00
|
|
|
my.toggleFilmStrip = function() {
|
2014-09-08 15:34:56 +00:00
|
|
|
var filmstrip = $("#remoteVideos");
|
|
|
|
filmstrip.toggleClass("hidden");
|
2015-11-13 17:04:49 +00:00
|
|
|
|
|
|
|
eventEmitter.emit( UIEvents.FILM_STRIP_TOGGLED,
|
|
|
|
filmstrip.hasClass("hidden"));
|
2014-09-04 08:15:48 +00:00
|
|
|
};
|
|
|
|
|
2014-08-22 15:37:11 +00:00
|
|
|
$(document).bind("remotevideo.resized", function (event, width, height) {
|
|
|
|
var bottom = (height - $('#bottomToolbar').outerHeight())/2 + 18;
|
|
|
|
|
|
|
|
$('#bottomToolbar').css({bottom: bottom + 'px'});
|
|
|
|
});
|
|
|
|
|
|
|
|
return my;
|
|
|
|
}(BottomToolbar || {}));
|
2015-01-07 14:54:03 +00:00
|
|
|
|
|
|
|
module.exports = BottomToolbar;
|