Selaa lähdekoodia

Merge branch 'master' into lint

master
Boris Grozev 10 vuotta sitten
vanhempi
commit
dff4666bc6

+ 10
- 0
Makefile Näytä tiedosto

@@ -25,3 +25,13 @@ deploy:
25 25
 	cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \
26 26
 	./bump-js-versions.sh && \
27 27
 	([ ! -x deploy-local.sh ] || ./deploy-local.sh)
28
+
29
+uglify:
30
+	uglifyjs libs/app.bundle.js -o libs/app.bundle.min.js --source-map libs/app.bundle.js.map
31
+	rm -f libs/app.bundle.js
32
+
33
+source-package:
34
+	mkdir -p source_package/jitsi-meet && \
35
+	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 && \
36
+	(cd source_package ; tar cjf ../jitsi-meet.tar.bz2 jitsi-meet) && \
37
+	rm -rf source_package

+ 2
- 2
index.html Näytä tiedosto

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

+ 2
- 0
interface_config.js Näytä tiedosto

@@ -16,6 +16,8 @@ var interfaceConfig = {
16 16
     APP_NAME: "Jitsi Meet",
17 17
     INVITATION_POWERED_BY: true,
18 18
     ACTIVE_SPEAKER_AVATAR_SIZE: 100,
19
+    TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop', 'recording', 'security', 'invite',
20
+        'chat', 'prezi', 'etherpad', 'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip', 'contacts'],
19 21
     /**
20 22
      * Whether to only show the filmstrip (and hide the toolbar).
21 23
      */

+ 1
- 1
modules/UI/audio_levels/AudioLevels.js Näytä tiedosto

@@ -244,7 +244,7 @@ var AudioLevels = (function(my) {
244 244
                 resized = true;
245 245
             }
246 246
 
247
-            if (canvas.heigh !== height + interfaceConfig.CANVAS_EXTRA) {
247
+            if (canvas.height !== height + interfaceConfig.CANVAS_EXTRA) {
248 248
                 canvas.height = height + interfaceConfig.CANVAS_EXTRA;
249 249
                 resized = true;
250 250
             }

+ 11
- 0
modules/UI/toolbars/BottomToolbar.js Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 /* global $ */
2 2
 var PanelToggler = require("../side_pannels/SidePanelToggler");
3
+var UIUtil = require("../util/UIUtil");
3 4
 
4 5
 var buttonHandlers = {
5 6
     "bottom_toolbar_contact_list": function () {
@@ -13,8 +14,18 @@ var buttonHandlers = {
13 14
     }
14 15
 };
15 16
 
17
+
18
+var defaultBottomToolbarButtons = {
19
+    'chat': '#bottom_toolbar_chat',
20
+    'contacts': '#bottom_toolbar_contact_list',
21
+    'filmstrip': '#bottom_toolbar_film_strip'
22
+};
23
+
24
+
16 25
 var BottomToolbar = (function (my) {
17 26
     my.init = function () {
27
+        UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
28
+
18 29
         for(var k in buttonHandlers)
19 30
             $("#" + k).click(buttonHandlers[k]);
20 31
     };

+ 23
- 12
modules/UI/toolbars/Toolbar.js Näytä tiedosto

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

+ 3
- 2
modules/UI/toolbars/ToolbarToggler.js Näytä tiedosto

@@ -2,10 +2,11 @@
2 2
  DesktopStreaming.showDesktopSharingButton */
3 3
 
4 4
 var toolbarTimeoutObject,
5
-    toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
5
+    toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT,
6
+    UIUtil = require("../util/UIUtil");
6 7
 
7 8
 function showDesktopSharingButton() {
8
-    if (APP.desktopsharing.isDesktopSharingEnabled()) {
9
+    if (APP.desktopsharing.isDesktopSharingEnabled() && UIUtil.isButtonEnabled('desktop')) {
9 10
         $('#toolbar_button_desktopsharing').css({display: "inline-block"});
10 11
     } else {
11 12
         $('#toolbar_button_desktopsharing').css({display: "none"});

+ 20
- 2
modules/UI/util/UIUtil.js Näytä tiedosto

@@ -1,8 +1,8 @@
1
-/* global $ */
1
+/* global $, config, interfaceConfig */
2 2
 /**
3 3
  * Created by hristo on 12/22/14.
4 4
  */
5
-module.exports = {
5
+var UIUtil = module.exports = {
6 6
     /**
7 7
      * Returns the available video width.
8 8
      */
@@ -92,5 +92,23 @@ module.exports = {
92 92
         } else {
93 93
             container.appendChild(newChild);
94 94
         }
95
+    },
96
+
97
+    isButtonEnabled: function (name) {
98
+        var isEnabled = interfaceConfig.TOOLBAR_BUTTONS.indexOf(name) !== -1;
99
+        if (name === 'prezi') {
100
+            return isEnabled && !config.disablePrezi;
101
+        } else if (name === 'recording') {
102
+            return isEnabled && config.enableRecording;
103
+        }
104
+        return isEnabled;
105
+    },
106
+
107
+    hideDisabledButtons: function (mappings) {
108
+        var selector = Object.keys(mappings)
109
+          .map(function (buttonName) { return UIUtil.isButtonEnabled(buttonName) ? null : mappings[buttonName]; })
110
+          .filter(function (item) { return item; })
111
+          .join(',');
112
+        $(selector).hide();
95 113
     }
96 114
 };

+ 1
- 1
package.json Näytä tiedosto

@@ -19,7 +19,7 @@
19 19
       "events": "*",
20 20
       "pako": "*",
21 21
       "i18next-client": "1.7.7",
22
-      "sdp-interop": "0.1.4",
22
+      "sdp-interop": "0.1.8",
23 23
       "sdp-transform": "1.4.1",
24 24
       "sdp-simulcast": "0.1.0",
25 25
       "async": "0.9.0",

Loading…
Peruuta
Tallenna