Просмотр исходного кода

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

j8
Lyubo Marinov 8 лет назад
Родитель
Сommit
66ababc6c8

+ 2
- 2
conference.js Просмотреть файл

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

+ 11
- 14
modules/UI/UI.js Просмотреть файл

@@ -4,10 +4,6 @@ const logger = require("jitsi-meet-logger").getLogger(__filename);
4 4
 
5 5
 var UI = {};
6 6
 
7
-import {
8
-    updateDeviceList
9
-} from '../../react/features/base/devices';
10
-
11 7
 import Chat from "./side_pannels/chat/Chat";
12 8
 import SidePanels from "./side_pannels/SidePanels";
13 9
 import Avatar from "./avatar/Avatar";
@@ -27,6 +23,10 @@ import RingOverlay from "./ring_overlay/RingOverlay";
27 23
 import UIErrors from './UIErrors';
28 24
 import { debounce } from "../util/helpers";
29 25
 
26
+
27
+import {
28
+    updateDeviceList
29
+} from '../../react/features/base/devices';
30 30
 import {
31 31
     setAudioMuted,
32 32
     setVideoMuted
@@ -493,7 +493,7 @@ UI.getSharedDocumentManager = () => etherpadManager;
493 493
 UI.addUser = function (user) {
494 494
     var id = user.getId();
495 495
     var displayName = user.getDisplayName();
496
-    UI.hideRingOverLay();
496
+    UI.hideRingOverlay();
497 497
     if (UI.ContactList)
498 498
         UI.ContactList.addContact(id);
499 499
 
@@ -1380,21 +1380,18 @@ UI.showRingOverlay = function () {
1380 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 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 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 Просмотреть файл

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

+ 1
- 1
react/features/base/connection/actions.web.js Просмотреть файл

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

+ 15
- 8
react/features/overlay/components/OverlayContainer.js Просмотреть файл

@@ -111,11 +111,14 @@ class OverlayContainer extends Component {
111 111
 
112 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 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,11 +130,13 @@ class OverlayContainer extends Component {
127 130
      * @protected
128 131
      */
129 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,7 +169,9 @@ class OverlayContainer extends Component {
164 169
                 = filmstripOnly
165 170
                     ? UserMediaPermissionsFilmstripOnlyOverlay
166 171
                     : UserMediaPermissionsOverlay;
167
-            props = { browser: this.props._browser };
172
+            props = {
173
+                browser: this.props._browser
174
+            };
168 175
         }
169 176
 
170 177
         return (

+ 2
- 0
react/features/unsupported-browser/components/HideNotificationBarStyle.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить