Merge branch 'master' into lint

This commit is contained in:
Boris Grozev 2015-09-14 09:15:51 -05:00
commit dff4666bc6
9 changed files with 73 additions and 20 deletions

View File

@ -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

View File

@ -19,8 +19,8 @@
<script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=131"></script>
<script src="interface_config.js?v=6"></script>
<script src="libs/app.bundle.js?v=138"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1">

View File

@ -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).
*/

View File

@ -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;
}

View File

@ -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]);
};

View File

@ -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 <tt>true</tt> to show or <tt>false</tt> 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 <tt>true</tt> 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 <tt>true</tt> 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"});

View File

@ -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"});

View File

@ -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();
}
};

View File

@ -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",