|
@@ -87,6 +87,19 @@ var buttonHandlers = {
|
87
|
87
|
});
|
88
|
88
|
}
|
89
|
89
|
};
|
|
90
|
+var defaultToolbarButtons = {
|
|
91
|
+ 'microphone': '#toolbar_button_mute',
|
|
92
|
+ 'camera': '#toolbar_button_camera',
|
|
93
|
+ 'desktop': '#toolbar_button_desktopsharing',
|
|
94
|
+ 'security': '#toolbar_button_security',
|
|
95
|
+ 'invite': '#toolbar_button_link',
|
|
96
|
+ 'chat': '#toolbar_button_chat',
|
|
97
|
+ 'prezi': '#toolbar_button_prezi',
|
|
98
|
+ 'ethherpad': '#toolbar_button_etherpad',
|
|
99
|
+ 'fullscreen': '#toolbar_button_fullScreen',
|
|
100
|
+ 'settings': '#toolbar_button_settings',
|
|
101
|
+ 'hangup': '#toolbar_button_hangup'
|
|
102
|
+};
|
90
|
103
|
|
91
|
104
|
function hangup() {
|
92
|
105
|
APP.xmpp.disposeConference();
|
|
@@ -255,6 +268,8 @@ function callSipButtonClicked() {
|
255
|
268
|
var Toolbar = (function (my) {
|
256
|
269
|
|
257
|
270
|
my.init = function (ui) {
|
|
271
|
+ UIUtil.hideDisabledButtons(defaultToolbarButtons);
|
|
272
|
+
|
258
|
273
|
for(var k in buttonHandlers)
|
259
|
274
|
$("#" + k).click(buttonHandlers[k]);
|
260
|
275
|
UI = ui;
|
|
@@ -339,7 +354,7 @@ var Toolbar = (function (my) {
|
339
|
354
|
* Disables and enables some of the buttons.
|
340
|
355
|
*/
|
341
|
356
|
my.setupButtonsFromConfig = function () {
|
342
|
|
- if (config.disablePrezi) {
|
|
357
|
+ if (UIUtil.isButtonEnabled('prezi')) {
|
343
|
358
|
$("#toolbar_button_prezi").css({display: "none"});
|
344
|
359
|
}
|
345
|
360
|
};
|
|
@@ -531,7 +546,7 @@ var Toolbar = (function (my) {
|
531
|
546
|
* @param show <tt>true</tt> to show or <tt>false</tt> to hide
|
532
|
547
|
*/
|
533
|
548
|
my.showAuthenticateButton = function (show) {
|
534
|
|
- if (show) {
|
|
549
|
+ if (UIUtil.isButtonEnabled('authentication') && show) {
|
535
|
550
|
$('#authentication').css({display: "inline"});
|
536
|
551
|
}
|
537
|
552
|
else {
|
|
@@ -541,11 +556,7 @@ var Toolbar = (function (my) {
|
541
|
556
|
|
542
|
557
|
// Shows or hides the 'recording' button.
|
543
|
558
|
my.showRecordingButton = function (show) {
|
544
|
|
- if (!config.enableRecording) {
|
545
|
|
- return;
|
546
|
|
- }
|
547
|
|
-
|
548
|
|
- if (show) {
|
|
559
|
+ if (UIUtil.isButtonEnabled('recording') && show) {
|
549
|
560
|
$('#toolbar_button_record').css({display: "inline-block"});
|
550
|
561
|
}
|
551
|
562
|
else {
|
|
@@ -597,14 +608,14 @@ var Toolbar = (function (my) {
|
597
|
608
|
|
598
|
609
|
// checks whether recording is enabled and whether we have params to start automatically recording
|
599
|
610
|
my.checkAutoRecord = function () {
|
600
|
|
- if (config.enableRecording && config.autoRecord) {
|
|
611
|
+ if (UIUtil.isButtonEnabled('recording') && config.autoRecord) {
|
601
|
612
|
toggleRecording(config.autoRecordToken);
|
602
|
613
|
}
|
603
|
614
|
}
|
604
|
615
|
|
605
|
616
|
// Shows or hides SIP calls button
|
606
|
617
|
my.showSipCallButton = function (show) {
|
607
|
|
- if (APP.xmpp.isSipGatewayEnabled() && show) {
|
|
618
|
+ if (APP.xmpp.isSipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {
|
608
|
619
|
$('#toolbar_button_sip').css({display: "inline-block"});
|
609
|
620
|
} else {
|
610
|
621
|
$('#toolbar_button_sip').css({display: "none"});
|
|
@@ -613,7 +624,7 @@ var Toolbar = (function (my) {
|
613
|
624
|
|
614
|
625
|
// Shows or hides the dialpad button
|
615
|
626
|
my.showDialPadButton = function (show) {
|
616
|
|
- if (show) {
|
|
627
|
+ if (UIUtil.isButtonEnabled('dialpad') && show) {
|
617
|
628
|
$('#toolbar_button_dialpad').css({display: "inline-block"});
|
618
|
629
|
} else {
|
619
|
630
|
$('#toolbar_button_dialpad').css({display: "none"});
|
|
@@ -639,7 +650,7 @@ var Toolbar = (function (my) {
|
639
|
650
|
* @param show <tt>true</tt> to show
|
640
|
651
|
*/
|
641
|
652
|
my.showLoginButton = function (show) {
|
642
|
|
- if (show) {
|
|
653
|
+ if (UIUtil.isButtonEnabled('authentication') && show) {
|
643
|
654
|
$('#toolbar_button_login').css({display: "list-item"});
|
644
|
655
|
} else {
|
645
|
656
|
$('#toolbar_button_login').css({display: "none"});
|
|
@@ -651,7 +662,7 @@ var Toolbar = (function (my) {
|
651
|
662
|
* @param show <tt>true</tt> to show
|
652
|
663
|
*/
|
653
|
664
|
my.showLogoutButton = function (show) {
|
654
|
|
- if (show) {
|
|
665
|
+ if (UIUtil.isButtonEnabled('authentication') && show) {
|
655
|
666
|
$('#toolbar_button_logout').css({display: "list-item"});
|
656
|
667
|
} else {
|
657
|
668
|
$('#toolbar_button_logout').css({display: "none"});
|