diff --git a/index.html b/index.html
index 3cf000ed6..1be85eb8a 100644
--- a/index.html
+++ b/index.html
@@ -20,7 +20,7 @@
-
+
diff --git a/interface_config.js b/interface_config.js
index 0317683e8..38f3b4f0a 100644
--- a/interface_config.js
+++ b/interface_config.js
@@ -16,6 +16,8 @@ var interfaceConfig = {
APP_NAME: "Jitsi Meet",
INVITATION_POWERED_BY: true,
ACTIVE_SPEAKER_AVATAR_SIZE: 100,
+ TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop', 'record', 'security', 'invite',
+ 'chat', 'prezi', 'etherpad', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'],
/**
* Whether to only show the filmstrip (and hide the toolbar).
*/
diff --git a/modules/UI/toolbars/BottomToolbar.js b/modules/UI/toolbars/BottomToolbar.js
index da857ca11..330c8c747 100644
--- a/modules/UI/toolbars/BottomToolbar.js
+++ b/modules/UI/toolbars/BottomToolbar.js
@@ -1,5 +1,6 @@
/* global $ */
var PanelToggler = require("../side_pannels/SidePanelToggler");
+var UIUtil = require("../util/UIUtil");
var buttonHandlers = {
"bottom_toolbar_contact_list": function () {
@@ -13,8 +14,18 @@ var buttonHandlers = {
}
};
+
+var defaultBottomToolbarButtons = {
+ 'chat': '#bottom_toolbar_chat',
+ 'contacts': '#bottom_toolbar_contact_list',
+ 'filmstrip': '#bottom_toolbar_film_strip'
+};
+
+
var BottomToolbar = (function (my) {
my.init = function () {
+ UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
+
for(var k in buttonHandlers)
$("#" + k).click(buttonHandlers[k]);
};
diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js
index a0d0d1d78..9fbc86c81 100644
--- a/modules/UI/toolbars/Toolbar.js
+++ b/modules/UI/toolbars/Toolbar.js
@@ -87,6 +87,19 @@ var buttonHandlers = {
});
}
};
+var defaultToolbarButtons = {
+ 'microphone': '#toolbar_button_mute',
+ 'camera': '#toolbar_button_camera',
+ 'desktop': '#toolbar_button_desktopsharing',
+ 'security': '#toolbar_button_security',
+ 'invite': '#toolbar_button_link',
+ 'chat': '#toolbar_button_chat',
+ 'prezi': '#toolbar_button_prezi',
+ 'ethherpad': '#toolbar_button_etherpad',
+ 'fullscreen': '#toolbar_button_fullScreen',
+ 'settings': '#toolbar_button_settings',
+ 'hangup': '#toolbar_button_hangup'
+};
function hangup() {
APP.xmpp.disposeConference();
@@ -255,6 +268,8 @@ function callSipButtonClicked() {
var Toolbar = (function (my) {
my.init = function (ui) {
+ UIUtil.hideDisabledButtons(defaultToolbarButtons);
+
for(var k in buttonHandlers)
$("#" + k).click(buttonHandlers[k]);
UI = ui;
@@ -339,7 +354,7 @@ var Toolbar = (function (my) {
* Disables and enables some of the buttons.
*/
my.setupButtonsFromConfig = function () {
- if (config.disablePrezi) {
+ if (UIUtil.isButtonEnabled('prezi')) {
$("#toolbar_button_prezi").css({display: "none"});
}
};
@@ -531,7 +546,7 @@ var Toolbar = (function (my) {
* @param show true to show or false to hide
*/
my.showAuthenticateButton = function (show) {
- if (show) {
+ if (UIUtil.isButtonEnabled('authentication') && show) {
$('#authentication').css({display: "inline"});
}
else {
@@ -541,11 +556,7 @@ var Toolbar = (function (my) {
// Shows or hides the 'recording' button.
my.showRecordingButton = function (show) {
- if (!config.enableRecording) {
- return;
- }
-
- if (show) {
+ if (UIUtil.isButtonEnabled('recording') && show) {
$('#toolbar_button_record').css({display: "inline-block"});
}
else {
@@ -597,14 +608,14 @@ var Toolbar = (function (my) {
// checks whether recording is enabled and whether we have params to start automatically recording
my.checkAutoRecord = function () {
- if (config.enableRecording && config.autoRecord) {
+ if (UIUtil.isButtonEnabled('recording') && config.autoRecord) {
toggleRecording(config.autoRecordToken);
}
}
// Shows or hides SIP calls button
my.showSipCallButton = function (show) {
- if (APP.xmpp.isSipGatewayEnabled() && show) {
+ if (APP.xmpp.isSipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {
$('#toolbar_button_sip').css({display: "inline-block"});
} else {
$('#toolbar_button_sip').css({display: "none"});
@@ -613,7 +624,7 @@ var Toolbar = (function (my) {
// Shows or hides the dialpad button
my.showDialPadButton = function (show) {
- if (show) {
+ if (UIUtil.isButtonEnabled('dialpad') && show) {
$('#toolbar_button_dialpad').css({display: "inline-block"});
} else {
$('#toolbar_button_dialpad').css({display: "none"});
@@ -639,7 +650,7 @@ var Toolbar = (function (my) {
* @param show true to show
*/
my.showLoginButton = function (show) {
- if (show) {
+ if (UIUtil.isButtonEnabled('authentication') && show) {
$('#toolbar_button_login').css({display: "list-item"});
} else {
$('#toolbar_button_login').css({display: "none"});
@@ -651,7 +662,7 @@ var Toolbar = (function (my) {
* @param show true to show
*/
my.showLogoutButton = function (show) {
- if (show) {
+ if (UIUtil.isButtonEnabled('authentication') && show) {
$('#toolbar_button_logout').css({display: "list-item"});
} else {
$('#toolbar_button_logout').css({display: "none"});
diff --git a/modules/UI/toolbars/ToolbarToggler.js b/modules/UI/toolbars/ToolbarToggler.js
index 910daac3c..d7e49a25f 100644
--- a/modules/UI/toolbars/ToolbarToggler.js
+++ b/modules/UI/toolbars/ToolbarToggler.js
@@ -2,10 +2,11 @@
DesktopStreaming.showDesktopSharingButton */
var toolbarTimeoutObject,
- toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
+ toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT,
+ UIUtil = require("../util/UIUtil");
function showDesktopSharingButton() {
- if (APP.desktopsharing.isDesktopSharingEnabled()) {
+ if (APP.desktopsharing.isDesktopSharingEnabled() && UIUtil.isButtonEnabled('desktop')) {
$('#toolbar_button_desktopsharing').css({display: "inline-block"});
} else {
$('#toolbar_button_desktopsharing').css({display: "none"});
diff --git a/modules/UI/util/UIUtil.js b/modules/UI/util/UIUtil.js
index 563c20b79..e3094d846 100644
--- a/modules/UI/util/UIUtil.js
+++ b/modules/UI/util/UIUtil.js
@@ -1,8 +1,8 @@
-/* global $ */
+/* global $, config, interfaceConfig */
/**
* Created by hristo on 12/22/14.
*/
-module.exports = {
+var UIUtil = module.exports = {
/**
* Returns the available video width.
*/
@@ -92,5 +92,23 @@ module.exports = {
} else {
container.appendChild(newChild);
}
+ },
+
+ isButtonEnabled: function (name) {
+ var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
+ if (name === 'prezi') {
+ return isEnabled && !config.disablePrezi;
+ } else if (name === 'recording') {
+ return isEnabled && config.enableRecording;
+ }
+ return isEnabled;
+ },
+
+ hideDisabledButtons: function (mappings) {
+ var selector = Object.keys(mappings)
+ .map(function (buttonName) { return UIUtil.isButtonEnabled(buttonName) ? null : mappings[buttonName]; })
+ .filter(function (item) { return item; })
+ .join(',');
+ $(selector).hide();
}
};
\ No newline at end of file