diff --git a/Makefile b/Makefile index 1dca402b0..9ab630d36 100644 --- a/Makefile +++ b/Makefile @@ -25,3 +25,13 @@ deploy: cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \ ./bump-js-versions.sh && \ ([ ! -x deploy-local.sh ] || ./deploy-local.sh) + +uglify: + uglifyjs libs/app.bundle.js -o libs/app.bundle.min.js --source-map libs/app.bundle.js.map + rm -f libs/app.bundle.js + +source-package: + mkdir -p source_package/jitsi-meet && \ + cp -r analytics.js app.js css external_api.js favicon.ico fonts images index.html interface_config.js libs plugin.*html sounds title.html unsupported_browser.html LICENSE config.js lang source_package/jitsi-meet && \ + (cd source_package ; tar cjf ../jitsi-meet.tar.bz2 jitsi-meet) && \ + rm -rf source_package diff --git a/index.html b/index.html index 3cf000ed6..13bf5e548 100644 --- a/index.html +++ b/index.html @@ -19,8 +19,8 @@ - - + + diff --git a/interface_config.js b/interface_config.js index 0317683e8..f0c5f41f0 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', 'recording', '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/audio_levels/AudioLevels.js b/modules/UI/audio_levels/AudioLevels.js index 1f86a0600..b34403c32 100644 --- a/modules/UI/audio_levels/AudioLevels.js +++ b/modules/UI/audio_levels/AudioLevels.js @@ -244,7 +244,7 @@ var AudioLevels = (function(my) { resized = true; } - if (canvas.heigh !== height + interfaceConfig.CANVAS_EXTRA) { + if (canvas.height !== height + interfaceConfig.CANVAS_EXTRA) { canvas.height = height + interfaceConfig.CANVAS_EXTRA; resized = true; } 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 a8240a618..c41d91c69 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -88,6 +88,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(); @@ -256,6 +269,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; @@ -340,7 +355,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"}); } }; @@ -532,7 +547,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 { @@ -542,11 +557,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 { @@ -598,14 +609,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"}); @@ -614,7 +625,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"}); @@ -640,7 +651,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"}); @@ -652,7 +663,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 diff --git a/package.json b/package.json index ca9ed3ad6..361b15570 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "events": "*", "pako": "*", "i18next-client": "1.7.7", - "sdp-interop": "0.1.4", + "sdp-interop": "0.1.8", "sdp-transform": "1.4.1", "sdp-simulcast": "0.1.0", "async": "0.9.0",