Selaa lähdekoodia

Comply w/ codying style: naming, formatting, etc.

j8
Lyubo Marinov 8 vuotta sitten
vanhempi
commit
66ababc6c8

+ 2
- 2
conference.js Näytä tiedosto

386
     _onConferenceFailed(err, ...params) {
386
     _onConferenceFailed(err, ...params) {
387
         APP.store.dispatch(conferenceFailed(room, err, ...params));
387
         APP.store.dispatch(conferenceFailed(room, err, ...params));
388
         logger.error('CONFERENCE FAILED:', err, ...params);
388
         logger.error('CONFERENCE FAILED:', err, ...params);
389
-        APP.UI.hideRingOverLay();
389
+        APP.UI.hideRingOverlay();
390
         switch (err) {
390
         switch (err) {
391
 
391
 
392
         case ConferenceErrors.CONNECTION_ERROR:
392
         case ConferenceErrors.CONNECTION_ERROR:
2029
      */
2029
      */
2030
     hangup(requestFeedback = false) {
2030
     hangup(requestFeedback = false) {
2031
         eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP);
2031
         eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP);
2032
-        APP.UI.hideRingOverLay();
2032
+        APP.UI.hideRingOverlay();
2033
         let requestFeedbackPromise = requestFeedback
2033
         let requestFeedbackPromise = requestFeedback
2034
                 ? APP.UI.requestFeedbackOnHangup()
2034
                 ? APP.UI.requestFeedbackOnHangup()
2035
                 // false - because the thank you dialog shouldn't be displayed
2035
                 // false - because the thank you dialog shouldn't be displayed

+ 11
- 14
modules/UI/UI.js Näytä tiedosto

4
 
4
 
5
 var UI = {};
5
 var UI = {};
6
 
6
 
7
-import {
8
-    updateDeviceList
9
-} from '../../react/features/base/devices';
10
-
11
 import Chat from "./side_pannels/chat/Chat";
7
 import Chat from "./side_pannels/chat/Chat";
12
 import SidePanels from "./side_pannels/SidePanels";
8
 import SidePanels from "./side_pannels/SidePanels";
13
 import Avatar from "./avatar/Avatar";
9
 import Avatar from "./avatar/Avatar";
27
 import UIErrors from './UIErrors';
23
 import UIErrors from './UIErrors';
28
 import { debounce } from "../util/helpers";
24
 import { debounce } from "../util/helpers";
29
 
25
 
26
+
27
+import {
28
+    updateDeviceList
29
+} from '../../react/features/base/devices';
30
 import {
30
 import {
31
     setAudioMuted,
31
     setAudioMuted,
32
     setVideoMuted
32
     setVideoMuted
493
 UI.addUser = function (user) {
493
 UI.addUser = function (user) {
494
     var id = user.getId();
494
     var id = user.getId();
495
     var displayName = user.getDisplayName();
495
     var displayName = user.getDisplayName();
496
-    UI.hideRingOverLay();
496
+    UI.hideRingOverlay();
497
     if (UI.ContactList)
497
     if (UI.ContactList)
498
         UI.ContactList.addContact(id);
498
         UI.ContactList.addContact(id);
499
 
499
 
1380
     Filmstrip.toggleFilmstrip(false, false);
1380
     Filmstrip.toggleFilmstrip(false, false);
1381
 };
1381
 };
1382
 
1382
 
1383
-UI.hideRingOverLay = function () {
1384
-    if (!RingOverlay.hide())
1385
-        return;
1386
-    Filmstrip.toggleFilmstrip(true, false);
1387
-};
1383
+UI.hideRingOverlay
1384
+    = () => RingOverlay.hide() && Filmstrip.toggleFilmstrip(true, false);
1388
 
1385
 
1389
 /**
1386
 /**
1390
  * Indicates if any the "top" overlays are currently visible. The check includes
1387
  * Indicates if any the "top" overlays are currently visible. The check includes
1391
- * the call overlay, suspended overlay, GUM permissions overlay
1392
- * and a page reload overlay.
1388
+ * the call overlay, the suspended overlay, the GUM permissions overlay, and the
1389
+ * page-reload overlay.
1393
  *
1390
  *
1394
- * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1391
+ * @returns {*|boolean} {true} if an overlay is visible; {false}, otherwise
1395
  */
1392
  */
1396
 UI.isOverlayVisible = function () {
1393
 UI.isOverlayVisible = function () {
1397
-    return RingOverlay.isVisible() || this.overlayVisible;
1394
+    return this.isRingOverlayVisible() || this.overlayVisible;
1398
 };
1395
 };
1399
 
1396
 
1400
 /**
1397
 /**

+ 24
- 28
modules/UI/ring_overlay/RingOverlay.js Näytä tiedosto

1
 /* global $, APP */
1
 /* global $, APP */
2
-/* jshint -W101 */
2
+
3
 import UIEvents from "../../../service/UI/UIEvents";
3
 import UIEvents from "../../../service/UI/UIEvents";
4
 
4
 
5
 /**
5
 /**
24
     /**
24
     /**
25
      *
25
      *
26
      * @param callee The callee (Object) as defined by the JWT support.
26
      * @param callee The callee (Object) as defined by the JWT support.
27
-     * @param {boolean} disableRingingSound if true the ringing sound wont be played.
27
+     * @param {boolean} disableRinging if true the ringing sound wont be played.
28
      */
28
      */
29
-    constructor(callee, disableRingingSound) {
29
+    constructor(callee, disableRinging) {
30
         this._containerId = 'ringOverlay';
30
         this._containerId = 'ringOverlay';
31
         this._audioContainerId = 'ringOverlayRinging';
31
         this._audioContainerId = 'ringOverlayRinging';
32
         this.isRinging = true;
32
         this.isRinging = true;
33
         this.callee = callee;
33
         this.callee = callee;
34
-        this.disableRingingSound = disableRingingSound;
34
+        this.disableRinging = disableRinging;
35
         this.render();
35
         this.render();
36
-        if(!disableRingingSound)
36
+        if (!disableRinging)
37
             this._initAudio();
37
             this._initAudio();
38
-        this._timeout = setTimeout(() => {
39
-            this.destroy();
40
-            this.render();
41
-        }, 30000);
38
+        this._timeout
39
+            = setTimeout(
40
+                    () => {
41
+                        this.destroy();
42
+                        this.render();
43
+                    },
44
+                    30000);
42
     }
45
     }
43
 
46
 
44
     /**
47
     /**
47
     _initAudio() {
50
     _initAudio() {
48
         this.audio = document.getElementById(this._audioContainerId);
51
         this.audio = document.getElementById(this._audioContainerId);
49
         this.audio.play();
52
         this.audio.play();
50
-        this._setAudioTimeout();
53
+        this.interval = setInterval(() => this.audio.play(), 5000);
51
     }
54
     }
52
 
55
 
53
     /**
56
     /**
58
      */
61
      */
59
     _changeBackground(solid) {
62
     _changeBackground(solid) {
60
         const container = $("#" + this._containerId);
63
         const container = $("#" + this._containerId);
61
-        if(solid) {
64
+
65
+        if (solid) {
62
             container.addClass("solidBG");
66
             container.addClass("solidBG");
63
         } else {
67
         } else {
64
             container.removeClass("solidBG");
68
             container.removeClass("solidBG");
71
     _getHtmlStr(callee) {
75
     _getHtmlStr(callee) {
72
         let callingLabel = this.isRinging ? "<p>Calling...</p>" : "";
76
         let callingLabel = this.isRinging ? "<p>Calling...</p>" : "";
73
         let callerStateLabel =  this.isRinging ? "" : " isn't available";
77
         let callerStateLabel =  this.isRinging ? "" : " isn't available";
74
-        let audioHTML = this.disableRingingSound ? ""
78
+        let audioHTML = this.disableRinging ? ""
75
             : "<audio id=\"" + this._audioContainerId
79
             : "<audio id=\"" + this._audioContainerId
76
                 + "\" src=\"./sounds/ring.ogg\" />";
80
                 + "\" src=\"./sounds/ring.ogg\" />";
81
+
77
         return `
82
         return `
78
             <div id="${this._containerId}" class='ringing' >
83
             <div id="${this._containerId}" class='ringing' >
79
                 <div class='ringing__content'>
84
                 <div class='ringing__content'>
120
         if (this.interval) {
125
         if (this.interval) {
121
             clearInterval(this.interval);
126
             clearInterval(this.interval);
122
         }
127
         }
123
-        if(this._timeout) {
128
+        if (this._timeout) {
124
             clearTimeout(this._timeout);
129
             clearTimeout(this._timeout);
125
         }
130
         }
126
     }
131
     }
127
-
128
-    /**
129
-     * Sets the interval that is going to play the ringing sound.
130
-     */
131
-    _setAudioTimeout() {
132
-        this.interval = setInterval( () => {
133
-            this.audio.play();
134
-        }, 5000);
135
-    }
136
 }
132
 }
137
 
133
 
138
 export default {
134
 export default {
141
      *
137
      *
142
      * @param {Object} callee - The callee. Object containing data about
138
      * @param {Object} callee - The callee. Object containing data about
143
      * callee.
139
      * callee.
144
-     * @param {boolean} disableRingingSound - If true the ringing sound won't be
140
+     * @param {boolean} disableRinging - If true the ringing sound won't be
145
      * played.
141
      * played.
146
      * @returns {void}
142
      * @returns {void}
147
      */
143
      */
148
-    show(callee, disableRingingSound = false) {
149
-        if(overlay) {
144
+    show(callee, disableRinging = false) {
145
+        if (overlay) {
150
             this.hide();
146
             this.hide();
151
         }
147
         }
152
 
148
 
153
-        overlay = new RingOverlay(callee, disableRingingSound);
149
+        overlay = new RingOverlay(callee, disableRinging);
154
         APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE,
150
         APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE,
155
             onAvatarVisible);
151
             onAvatarVisible);
156
     },
152
     },
160
      * overlay.
156
      * overlay.
161
      */
157
      */
162
     hide() {
158
     hide() {
163
-        if(!overlay) {
159
+        if (!overlay) {
164
             return false;
160
             return false;
165
         }
161
         }
166
         overlay.destroy();
162
         overlay.destroy();
176
      * @returns {boolean} true if the ring overlay is currently displayed or
172
      * @returns {boolean} true if the ring overlay is currently displayed or
177
      * false otherwise.
173
      * false otherwise.
178
      */
174
      */
179
-    isVisible () {
175
+    isVisible() {
180
         return overlay !== null;
176
         return overlay !== null;
181
     }
177
     }
182
 };
178
 };

+ 1
- 1
react/features/base/connection/actions.web.js Näytä tiedosto

77
             }
77
             }
78
         })
78
         })
79
             .catch(error => {
79
             .catch(error => {
80
-                APP.UI.hideRingOverLay();
80
+                APP.UI.hideRingOverlay();
81
                 APP.API.notifyConferenceLeft(APP.conference.roomName);
81
                 APP.API.notifyConferenceLeft(APP.conference.roomName);
82
                 logger.error(error);
82
                 logger.error(error);
83
 
83
 

+ 15
- 8
react/features/overlay/components/OverlayContainer.js Näytä tiedosto

111
 
111
 
112
         this.state = {
112
         this.state = {
113
             /**
113
             /**
114
-             * Indicates whether the filmstrip only mode is enabled or not.
114
+             * The indicator which determines whether filmstrip-only mode is
115
+             * enabled.
115
              *
116
              *
116
              * @type {boolean}
117
              * @type {boolean}
117
              */
118
              */
118
-            filmstripOnly: interfaceConfig.filmStripOnly
119
+            filmstripOnly:
120
+                typeof interfaceConfig === 'object'
121
+                    && interfaceConfig.filmStripOnly
119
         };
122
         };
120
     }
123
     }
121
 
124
 
127
      * @protected
130
      * @protected
128
      */
131
      */
129
     componentDidUpdate() {
132
     componentDidUpdate() {
130
-        // FIXME: Temporary workaround until everything is moved to react.
131
-        APP.UI.overlayVisible
132
-            = (this.props._connectionEstablished && this.props._haveToReload)
133
-                || this.props._suspendDetected
134
-                || this.props._isMediaPermissionPromptVisible;
133
+        if (typeof APP === 'object') {
134
+            APP.UI.overlayVisible
135
+                = (this.props._connectionEstablished
136
+                        && this.props._haveToReload)
137
+                    || this.props._suspendDetected
138
+                    || this.props._isMediaPermissionPromptVisible;
139
+        }
135
     }
140
     }
136
 
141
 
137
     /**
142
     /**
164
                 = filmstripOnly
169
                 = filmstripOnly
165
                     ? UserMediaPermissionsFilmstripOnlyOverlay
170
                     ? UserMediaPermissionsFilmstripOnlyOverlay
166
                     : UserMediaPermissionsOverlay;
171
                     : UserMediaPermissionsOverlay;
167
-            props = { browser: this.props._browser };
172
+            props = {
173
+                browser: this.props._browser
174
+            };
168
         }
175
         }
169
 
176
 
170
         return (
177
         return (

+ 2
- 0
react/features/unsupported-browser/components/HideNotificationBarStyle.js Näytä tiedosto

1
+/* @flow */
2
+
1
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
2
 
4
 
3
 /**
5
 /**

Loading…
Peruuta
Tallenna