From 66ababc6c8c3cfcec6456c477c7397390c73ce32 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Wed, 24 May 2017 11:58:32 -0500 Subject: [PATCH] Comply w/ codying style: naming, formatting, etc. --- conference.js | 4 +- modules/UI/UI.js | 25 ++++----- modules/UI/ring_overlay/RingOverlay.js | 52 +++++++++---------- react/features/base/connection/actions.web.js | 2 +- .../overlay/components/OverlayContainer.js | 23 +++++--- .../components/HideNotificationBarStyle.js | 2 + 6 files changed, 55 insertions(+), 53 deletions(-) diff --git a/conference.js b/conference.js index e1046f800..3e25317ff 100644 --- a/conference.js +++ b/conference.js @@ -386,7 +386,7 @@ class ConferenceConnector { _onConferenceFailed(err, ...params) { APP.store.dispatch(conferenceFailed(room, err, ...params)); logger.error('CONFERENCE FAILED:', err, ...params); - APP.UI.hideRingOverLay(); + APP.UI.hideRingOverlay(); switch (err) { case ConferenceErrors.CONNECTION_ERROR: @@ -2029,7 +2029,7 @@ export default { */ hangup(requestFeedback = false) { eventEmitter.emit(JitsiMeetConferenceEvents.BEFORE_HANGUP); - APP.UI.hideRingOverLay(); + APP.UI.hideRingOverlay(); let requestFeedbackPromise = requestFeedback ? APP.UI.requestFeedbackOnHangup() // false - because the thank you dialog shouldn't be displayed diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 2e713a8e4..c002f0443 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -4,10 +4,6 @@ const logger = require("jitsi-meet-logger").getLogger(__filename); var UI = {}; -import { - updateDeviceList -} from '../../react/features/base/devices'; - import Chat from "./side_pannels/chat/Chat"; import SidePanels from "./side_pannels/SidePanels"; import Avatar from "./avatar/Avatar"; @@ -27,6 +23,10 @@ import RingOverlay from "./ring_overlay/RingOverlay"; import UIErrors from './UIErrors'; import { debounce } from "../util/helpers"; + +import { + updateDeviceList +} from '../../react/features/base/devices'; import { setAudioMuted, setVideoMuted @@ -493,7 +493,7 @@ UI.getSharedDocumentManager = () => etherpadManager; UI.addUser = function (user) { var id = user.getId(); var displayName = user.getDisplayName(); - UI.hideRingOverLay(); + UI.hideRingOverlay(); if (UI.ContactList) UI.ContactList.addContact(id); @@ -1380,21 +1380,18 @@ UI.showRingOverlay = function () { Filmstrip.toggleFilmstrip(false, false); }; -UI.hideRingOverLay = function () { - if (!RingOverlay.hide()) - return; - Filmstrip.toggleFilmstrip(true, false); -}; +UI.hideRingOverlay + = () => RingOverlay.hide() && Filmstrip.toggleFilmstrip(true, false); /** * Indicates if any the "top" overlays are currently visible. The check includes - * the call overlay, suspended overlay, GUM permissions overlay - * and a page reload overlay. + * the call overlay, the suspended overlay, the GUM permissions overlay, and the + * page-reload overlay. * - * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise + * @returns {*|boolean} {true} if an overlay is visible; {false}, otherwise */ UI.isOverlayVisible = function () { - return RingOverlay.isVisible() || this.overlayVisible; + return this.isRingOverlayVisible() || this.overlayVisible; }; /** diff --git a/modules/UI/ring_overlay/RingOverlay.js b/modules/UI/ring_overlay/RingOverlay.js index 76ec0fe26..e9d58b5e1 100644 --- a/modules/UI/ring_overlay/RingOverlay.js +++ b/modules/UI/ring_overlay/RingOverlay.js @@ -1,5 +1,5 @@ /* global $, APP */ -/* jshint -W101 */ + import UIEvents from "../../../service/UI/UIEvents"; /** @@ -24,21 +24,24 @@ class RingOverlay { /** * * @param callee The callee (Object) as defined by the JWT support. - * @param {boolean} disableRingingSound if true the ringing sound wont be played. + * @param {boolean} disableRinging if true the ringing sound wont be played. */ - constructor(callee, disableRingingSound) { + constructor(callee, disableRinging) { this._containerId = 'ringOverlay'; this._audioContainerId = 'ringOverlayRinging'; this.isRinging = true; this.callee = callee; - this.disableRingingSound = disableRingingSound; + this.disableRinging = disableRinging; this.render(); - if(!disableRingingSound) + if (!disableRinging) this._initAudio(); - this._timeout = setTimeout(() => { - this.destroy(); - this.render(); - }, 30000); + this._timeout + = setTimeout( + () => { + this.destroy(); + this.render(); + }, + 30000); } /** @@ -47,7 +50,7 @@ class RingOverlay { _initAudio() { this.audio = document.getElementById(this._audioContainerId); this.audio.play(); - this._setAudioTimeout(); + this.interval = setInterval(() => this.audio.play(), 5000); } /** @@ -58,7 +61,8 @@ class RingOverlay { */ _changeBackground(solid) { const container = $("#" + this._containerId); - if(solid) { + + if (solid) { container.addClass("solidBG"); } else { container.removeClass("solidBG"); @@ -71,9 +75,10 @@ class RingOverlay { _getHtmlStr(callee) { let callingLabel = this.isRinging ? "

Calling...

" : ""; let callerStateLabel = this.isRinging ? "" : " isn't available"; - let audioHTML = this.disableRingingSound ? "" + let audioHTML = this.disableRinging ? "" : "