Browse Source

Merge branch 'master' into lint

master
Boris Grozev 10 years ago
parent
commit
dff4666bc6

+ 10
- 0
Makefile View File

25
 	cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \
25
 	cp $(OUTPUT_DIR)/*.bundle.js $(DEPLOY_DIR) && \
26
 	./bump-js-versions.sh && \
26
 	./bump-js-versions.sh && \
27
 	([ ! -x deploy-local.sh ] || ./deploy-local.sh)
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 View File

19
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
19
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
21
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
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
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
25
     <link rel="stylesheet" href="css/font.css?v=7"/>
25
     <link rel="stylesheet" href="css/font.css?v=7"/>
26
     <link rel="stylesheet" href="css/toastr.css?v=1">
26
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 2
- 0
interface_config.js View File

16
     APP_NAME: "Jitsi Meet",
16
     APP_NAME: "Jitsi Meet",
17
     INVITATION_POWERED_BY: true,
17
     INVITATION_POWERED_BY: true,
18
     ACTIVE_SPEAKER_AVATAR_SIZE: 100,
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
      * Whether to only show the filmstrip (and hide the toolbar).
22
      * Whether to only show the filmstrip (and hide the toolbar).
21
      */
23
      */

+ 1
- 1
modules/UI/audio_levels/AudioLevels.js View File

244
                 resized = true;
244
                 resized = true;
245
             }
245
             }
246
 
246
 
247
-            if (canvas.heigh !== height + interfaceConfig.CANVAS_EXTRA) {
247
+            if (canvas.height !== height + interfaceConfig.CANVAS_EXTRA) {
248
                 canvas.height = height + interfaceConfig.CANVAS_EXTRA;
248
                 canvas.height = height + interfaceConfig.CANVAS_EXTRA;
249
                 resized = true;
249
                 resized = true;
250
             }
250
             }

+ 11
- 0
modules/UI/toolbars/BottomToolbar.js View File

1
 /* global $ */
1
 /* global $ */
2
 var PanelToggler = require("../side_pannels/SidePanelToggler");
2
 var PanelToggler = require("../side_pannels/SidePanelToggler");
3
+var UIUtil = require("../util/UIUtil");
3
 
4
 
4
 var buttonHandlers = {
5
 var buttonHandlers = {
5
     "bottom_toolbar_contact_list": function () {
6
     "bottom_toolbar_contact_list": function () {
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
 var BottomToolbar = (function (my) {
25
 var BottomToolbar = (function (my) {
17
     my.init = function () {
26
     my.init = function () {
27
+        UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
28
+
18
         for(var k in buttonHandlers)
29
         for(var k in buttonHandlers)
19
             $("#" + k).click(buttonHandlers[k]);
30
             $("#" + k).click(buttonHandlers[k]);
20
     };
31
     };

+ 23
- 12
modules/UI/toolbars/Toolbar.js View File

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

+ 3
- 2
modules/UI/toolbars/ToolbarToggler.js View File

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

+ 20
- 2
modules/UI/util/UIUtil.js View File

1
-/* global $ */
1
+/* global $, config, interfaceConfig */
2
 /**
2
 /**
3
  * Created by hristo on 12/22/14.
3
  * Created by hristo on 12/22/14.
4
  */
4
  */
5
-module.exports = {
5
+var UIUtil = module.exports = {
6
     /**
6
     /**
7
      * Returns the available video width.
7
      * Returns the available video width.
8
      */
8
      */
92
         } else {
92
         } else {
93
             container.appendChild(newChild);
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 View File

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

Loading…
Cancel
Save