Enable ESLint on jitsi-meet with the same configuration and the same
goals as in lib-jitsi-meet.
This commit is contained in:
Lyubomir Marinov 2016-10-03 11:12:04 -05:00
parent 98bc16801c
commit a2b076985a
47 changed files with 192 additions and 213 deletions

11
.eslintignore Normal file
View File

@ -0,0 +1,11 @@
# The build artifacts of the jitsi-meet project.
build/*
# Third-party source code which we (1) do not want to modify or (2) try to
# modify as little as possible.
libs/*
# ESLint will by default ignore its own configuration file. However, there does
# not seem to be a reason why we will want to risk being inconsistent with our
# remaining JavaScript source code.
!.eslintrc.js

37
.eslintrc.js Normal file
View File

@ -0,0 +1,37 @@
module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es6': true
},
'extends': 'eslint:recommended',
'globals': {
// The globals that (1) are accessed but not defined within many of our
// files, (2) are certainly defined, and (3) we would like to use
// without explicitly specifying them (using a comment) inside of our
// files.
'__filename': false
},
'parserOptions': {
'ecmaFeatures': {
'experimentalObjectRestSpread': true
},
'sourceType': 'module'
},
'rules': {
'new-cap': [
'error',
{
'capIsNew': false // Behave like JSHint's newcap.
}
],
// While it is considered a best practice to avoid using methods on
// console in JavaScript that is designed to be executed in the browser
// and ESLint includes the rule among its set of recommended rules, (1)
// the general practice is to strip such calls before pushing to
// production and (2) we prefer to utilize console in lib-jitsi-meet
// (and jitsi-meet).
'no-console': 'off',
'semi': 'error'
}
};

View File

@ -1,5 +1,9 @@
/* global ga */
(function (ctx) {
function Analytics() {
/* eslint-disable */
/**
* Google Analytics
*/
@ -8,6 +12,8 @@
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-319188-14', 'jit.si');
ga('send', 'pageview');
/* eslint-enable */
}
Analytics.prototype.sendEvent = function (action, data, label, browserName) {

2
app.js
View File

@ -1,4 +1,4 @@
/* global $, JitsiMeetJS, config, getRoomName */
/* global $, config, getRoomName */
/* application specific logic */
import "babel-polyfill";

View File

@ -19,7 +19,6 @@ import {reportError} from './modules/util/helpers';
import UIErrors from './modules/UI/UIErrors';
import UIUtil from './modules/UI/util/UIUtil';
const ConnectionEvents = JitsiMeetJS.events.connection;
const ConnectionErrors = JitsiMeetJS.errors.connection;
const ConferenceEvents = JitsiMeetJS.events.conference;
@ -159,29 +158,24 @@ function getDisplayName (id) {
/**
* Mute or unmute local audio stream if it exists.
* @param {boolean} muted if audio stream should be muted or unmuted.
* @param {boolean} indicates if this local audio mute was a result of user
* interaction
*
* @param {boolean} muted - if audio stream should be muted or unmuted.
* @param {boolean} userInteraction - indicates if this local audio mute was a
* result of user interaction
*/
function muteLocalAudio (muted, userInteraction) {
if (!localAudio) {
function muteLocalAudio (muted) {
muteLocalMedia(localAudio, muted, 'Audio');
}
function muteLocalMedia(localMedia, muted, localMediaTypeString) {
if (!localMedia) {
return;
}
if (muted) {
localAudio.mute().then(function(value) {},
function(value) {
console.warn('Audio Mute was rejected:', value);
}
);
} else {
localAudio.unmute().then(function(value) {},
function(value) {
console.warn('Audio unmute was rejected:', value);
}
);
}
const method = muted ? 'mute' : 'unmute';
localMedia[method]().catch(reason => {
console.warn(`${localMediaTypeString} ${method} was rejected:`, reason);
});
}
/**
@ -189,23 +183,7 @@ function muteLocalAudio (muted, userInteraction) {
* @param {boolean} muted if video stream should be muted or unmuted.
*/
function muteLocalVideo (muted) {
if (!localVideo) {
return;
}
if (muted) {
localVideo.mute().then(function(value) {},
function(value) {
console.warn('Video mute was rejected:', value);
}
);
} else {
localVideo.unmute().then(function(value) {},
function(value) {
console.warn('Video unmute was rejected:', value);
}
);
}
muteLocalMedia(localVideo, muted, 'Video');
}
/**
@ -433,7 +411,7 @@ class ConferenceConnector {
room.on(ConferenceEvents.CONFERENCE_ERROR,
this._onConferenceError.bind(this));
}
_handleConferenceFailed(err, msg) {
_handleConferenceFailed(err) {
this._unsubscribe();
this._reject(err);
}
@ -1284,6 +1262,7 @@ export default {
UIUtil.animateShowElement($("#talkWhileMutedPopup"), true, 5000);
});
/*
room.on(ConferenceEvents.IN_LAST_N_CHANGED, (inLastN) => {
//FIXME
if (config.muteLocalVideoIfNotInLastN) {
@ -1292,6 +1271,7 @@ export default {
// APP.UI.markVideoMuted(true/false);
}
});
*/
room.on(
ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids, enteringIds) => {
APP.UI.handleLastNEndpoints(ids, enteringIds);

View File

@ -1,5 +1,6 @@
/* jshint -W101 */
var config = {
/* jshint maxlen:false */
var config = { // eslint-disable-line no-unused-vars
// configLocation: './config.json', // see ./modules/HttpConfigFetch.js
hosts: {
domain: 'jitsi-meet.example.com',

View File

@ -1,4 +1,4 @@
var interfaceConfig = {
var interfaceConfig = { // eslint-disable-line no-unused-vars
CANVAS_EXTRA: 104,
CANVAS_RADIUS: 0,
SHADOW_COLOR: '#ffffff',

View File

@ -336,7 +336,6 @@ JitsiMeetExternalAPI.prototype.removeEventListener = function(event) {
* @param events array with the names of the events.
*/
JitsiMeetExternalAPI.prototype.removeEventListeners = function(events) {
var eventsArray = [];
for(var i = 0; i < events.length; i++)
this.removeEventListener(events[i]);
};

View File

@ -261,25 +261,26 @@ class FollowMe {
* @param newValue the new value
* @private
*/
// eslint-disable-next-line no-unused-vars
_localPropertyChange (property, oldValue, newValue) {
// Only a moderator is allowed to send commands.
var conference = this._conference;
const conference = this._conference;
if (!conference.isModerator)
return;
var commands = conference.commands;
const commands = conference.commands;
// XXX The "Follow Me" command represents a snapshot of all states
// which are to be followed so don't forget to removeCommand before
// sendCommand!
commands.removeCommand(_COMMAND);
var self = this;
const local = this._local;
commands.sendCommandOnce(
_COMMAND,
{
attributes: {
filmStripVisible: self._local.filmStripVisible,
nextOnStage: self._local.nextOnStage,
sharedDocumentVisible: self._local.sharedDocumentVisible
filmStripVisible: local.filmStripVisible,
nextOnStage: local.nextOnStage,
sharedDocumentVisible: local.sharedDocumentVisible
}
});
}

View File

@ -1,5 +1,4 @@
/* global APP, JitsiMeetJS, $, config, interfaceConfig, toastr */
/* jshint -W101 */
var UI = {};
import Chat from "./side_pannels/chat/Chat";
@ -10,11 +9,11 @@ import Avatar from "./avatar/Avatar";
import SideContainerToggler from "./side_pannels/SideContainerToggler";
import UIUtil from "./util/UIUtil";
import UIEvents from "../../service/UI/UIEvents";
import CQEvents from '../../service/connectionquality/CQEvents';
import EtherpadManager from './etherpad/Etherpad';
import SharedVideoManager from './shared_video/SharedVideo';
import Recording from "./recording/Recording";
import GumPermissionsOverlay from './gum_overlay/UserMediaPermissionsGuidanceOverlay';
import GumPermissionsOverlay
from './gum_overlay/UserMediaPermissionsGuidanceOverlay';
import VideoLayout from "./videolayout/VideoLayout";
import FilmStrip from "./videolayout/FilmStrip";
@ -194,21 +193,16 @@ UI.notifyReservationError = function (code, msg) {
"dialog.reservationError");
var message = APP.translation.generateTranslationHTML(
"dialog.reservationErrorMsg", {code: code, msg: msg});
messageHandler.openDialog(
title,
message,
true, {},
function (event, value, message, formVals) {
return false;
}
);
messageHandler.openDialog(title, message, true, {}, () => false);
};
/**
* Notify user that he has been kicked from the server.
*/
UI.notifyKicked = function () {
messageHandler.openMessageDialog("dialog.sessTerminated", "dialog.kickMessage");
messageHandler.openMessageDialog(
"dialog.sessTerminated",
"dialog.kickMessage");
};
/**
@ -218,13 +212,9 @@ UI.notifyKicked = function () {
UI.notifyConferenceDestroyed = function (reason) {
//FIXME: use Session Terminated from translation, but
// 'reason' text comes from XMPP packet and is not translated
var title = APP.translation.generateTranslationHTML("dialog.sessTerminated");
messageHandler.openDialog(
title, reason, true, {},
function (event, value, message, formVals) {
return false;
}
);
const title
= APP.translation.generateTranslationHTML("dialog.sessTerminated");
messageHandler.openDialog(title, reason, true, {}, () => false);
};
/**
@ -287,7 +277,9 @@ UI.setRaisedHandStatus = (participant, raisedHandStatus) => {
* Sets the local "raised hand" status.
*/
UI.setLocalRaisedHandStatus = (raisedHandStatus) => {
VideoLayout.setRaisedHandStatus(APP.conference.getMyUserId(), raisedHandStatus);
VideoLayout.setRaisedHandStatus(
APP.conference.getMyUserId(),
raisedHandStatus);
};
/**
@ -579,10 +571,6 @@ UI.removeRemoteStream = function (track) {
VideoLayout.onRemoteStreamRemoved(track);
};
function chatAddError(errorMessage, originalText) {
return Chat.chatAddError(errorMessage, originalText);
}
/**
* Update chat subject.
* @param {string} subject new chat subject
@ -959,9 +947,7 @@ UI.notifyConnectionFailed = function (stropheErrorMsg) {
"dialog.connectError");
}
messageHandler.openDialog(
title, message, true, {}, function (e, v, m, f) { return false; }
);
messageHandler.openDialog(title, message, true, {}, () => false);
};
@ -975,9 +961,7 @@ UI.notifyMaxUsersLimitReached = function () {
var message = APP.translation.generateTranslationHTML(
"dialog.maxUsersLimitReached");
messageHandler.openDialog(
title, message, true, {}, function (e, v, m, f) { return false; }
);
messageHandler.openDialog(title, message, true, {}, () => false);
};
/**
@ -985,8 +969,12 @@ UI.notifyMaxUsersLimitReached = function () {
*/
UI.notifyInitiallyMuted = function () {
messageHandler.notify(
null, "notify.mutedTitle", "connected", "notify.muted", null, {timeOut: 120000}
);
null,
"notify.mutedTitle",
"connected",
"notify.muted",
null,
{ timeOut: 120000 });
};
/**
@ -1089,6 +1077,7 @@ UI.addMessage = function (from, displayName, message, stamp) {
Chat.updateChatConversation(from, displayName, message, stamp);
};
// eslint-disable-next-line no-unused-vars
UI.updateDTMFSupport = function (isDTMFSupported) {
//TODO: enable when the UI is ready
//Toolbar.showDialPadButton(dtmfSupport);
@ -1105,7 +1094,7 @@ UI.requestFeedback = function () {
else if (Feedback.isEnabled() && Feedback.isSubmitted())
return Promise.resolve();
else
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
if (Feedback.isEnabled()) {
// If the user has already entered feedback, we'll show the
// window and immidiately start the conference dispose timeout.
@ -1272,7 +1261,7 @@ UI.showExtensionExternalInstallationDialog = function (url) {
null,
true,
"dialog.goToStore",
function(e,v,m,f){
function(e,v) {
if (v) {
e.preventDefault();
eventEmitter.emit(UIEvents.OPEN_EXTENSION_STORE, url);
@ -1407,13 +1396,12 @@ UI.showDeviceErrorDialog = function (micError, cameraError) {
let title = "dialog.error";
if (micError && micError.name === TrackErrors.PERMISSION_DENIED) {
if (cameraError && cameraError.name === TrackErrors.PERMISSION_DENIED) {
title = "dialog.permissionDenied";
} else if (!cameraError) {
if (!cameraError
|| cameraError.name === TrackErrors.PERMISSION_DENIED) {
title = "dialog.permissionDenied";
}
} else if (cameraError &&
cameraError.name === TrackErrors.PERMISSION_DENIED) {
} else if (cameraError
&& cameraError.name === TrackErrors.PERMISSION_DENIED) {
title = "dialog.permissionDenied";
}

View File

@ -4,7 +4,6 @@ import LoginDialog from './LoginDialog';
import UIUtil from '../util/UIUtil';
import {openConnection} from '../../../connection';
const ConferenceEvents = JitsiMeetJS.events.conference;
const ConnectionErrors = JitsiMeetJS.errors.connection;
let externalAuthWindow;
@ -73,7 +72,6 @@ function redirectToTokenAuthService(roomName) {
* @param room the name fo the conference room.
*/
function initJWTTokenListener(room) {
var self = this;
var listener = function (event) {
if (externalAuthWindow !== event.source) {
console.warn("Ignored message not coming " +
@ -279,15 +277,12 @@ function showXmppPasswordPrompt(roomName, connect) {
function requestAuth(roomName, connect) {
if (isTokenAuthEnabled) {
// This Promise never resolves as user gets redirected to another URL
return new Promise(function (resolve, reject) {
redirectToTokenAuthService(roomName);
});
return new Promise(() => redirectToTokenAuthService(roomName));
} else {
return showXmppPasswordPrompt(roomName, connect);
}
}
export default {
authenticate,
requireAuth,

View File

@ -1,4 +1,4 @@
/* global $, APP, config*/
/* global APP, config */
/**
* Build html for "password required" dialog.
@ -109,7 +109,7 @@ function LoginDialog(successCallback, cancelCallback) {
html: '<div id="errorMessage"></div>',
buttons: finishedButtons,
defaultButton: 0,
submit: function (e, v, m, f) {
submit: function (e, v) {
e.preventDefault();
if (v === 'retry') {
connDialog.goToState('login');

View File

@ -51,7 +51,7 @@ function askForPassword () {
APP.UI.messageHandler.openTwoButtonDialog(
null, null, null, msg,
true, "dialog.Ok",
function (e, v, m, f) {}, null,
function () {}, null,
function (e, v, m, f) {
if (v && f.lockKey) {
resolve(UIUtil.escapeHtml(f.lockKey));

View File

@ -2,7 +2,6 @@
import VideoLayout from "../videolayout/VideoLayout";
import LargeContainer from '../videolayout/LargeContainer';
import UIUtil from "../util/UIUtil";
import UIEvents from "../../../service/UI/UIEvents";
import FilmStrip from '../videolayout/FilmStrip';
@ -101,6 +100,7 @@ class Etherpad extends LargeContainer {
return document.getElementById('etherpad');
}
// eslint-disable-next-line no-unused-vars
resize (containerWidth, containerHeight, animate) {
let height = containerHeight - FilmStrip.getFilmStripHeight();
let width = containerWidth;

View File

@ -1,4 +1,4 @@
/* global $, APP, config, interfaceConfig, JitsiMeetJS */
/* global $, APP, JitsiMeetJS */
import UIEvents from "../../../service/UI/UIEvents";
import FeedabckWindow from "./FeedbackWindow";

View File

@ -1,5 +1,4 @@
/* global $, APP, interfaceConfig, AJS */
/* jshint -W101 */
const selector = '#aui-feedback-dialog';
@ -9,21 +8,21 @@ const selector = '#aui-feedback-dialog';
*
* @param starCount the number of stars, for which to toggle the css class
*/
let toggleStars = function(starCount) {
function toggleStars(starCount) {
$('#stars > a').each(function(index, el) {
if (index <= starCount) {
el.classList.add("starHover");
} else
el.classList.remove("starHover");
});
};
}
/**
* Constructs the html for the rated feedback window.
*
* @returns {string} the contructed html string
*/
let createRateFeedbackHTML = function (Feedback) {
function createRateFeedbackHTML() {
let rateExperience
= APP.translation.translateString('dialog.rateExperience'),
feedbackHelp = APP.translation.translateString('dialog.feedbackHelp');
@ -58,17 +57,22 @@ let createRateFeedbackHTML = function (Feedback) {
<p>&nbsp;</p>
<p>${ feedbackHelp }</p>
</div>
<textarea id="feedbackTextArea" rows="10" cols="40" autofocus></textarea>
<textarea id="feedbackTextArea" rows="10" cols="40" autofocus>
</textarea>
</form>
<footer class="aui-dialog2-footer feedback__footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-close-button" class="aui-button aui-button_close">Close</button>
<button id="dialog-submit-button" class="aui-button aui-button_submit">Submit</button>
<button
id="dialog-close-button"
class="aui-button aui-button_close">Close</button>
<button
id="dialog-submit-button"
class="aui-button aui-button_submit">Submit</button>
</div>
</footer>
</div>
`;
};
}
/**
* Callback for Rate Feedback

View File

@ -1,4 +1,4 @@
/* global $, APP, JitsiMeetJS */
/* global $, APP */
let $overlay;

View File

@ -97,7 +97,7 @@ function _requestLiveStreamId() {
],
focus: ':input:first',
defaultButton: 1,
submit: function (e, v, m, f) {
submit: function (e, v) {
e.preventDefault();
if (v === 0) {
reject(APP.UI.messageHandler.CANCEL);
@ -177,7 +177,7 @@ function _showStopRecordingPrompt (recordingType) {
null,
false,
buttonKey,
function(e,v,m,f) {
function(e,v) {
if (v) {
resolve();
} else {

View File

@ -729,7 +729,7 @@ function showStopVideoPropmpt() {
null,
false,
"dialog.Remove",
function(e,v,m,f) {
function(e,v) {
if (v) {
resolve();
} else {
@ -811,7 +811,7 @@ function requestVideoLink() {
],
focus: ':input:first',
defaultButton: 1,
submit: function (e, v, m, f) {
submit: function (e, v) {
e.preventDefault();
if (v === 0) {
reject();

View File

@ -1,4 +1,3 @@
/* global APP */
import UIUtil from '../../util/UIUtil';
import UIEvents from '../../../../service/UI/UIEvents';

View File

@ -4,7 +4,6 @@ import UIEvents from '../../../../service/UI/UIEvents';
import UIUtil from '../../util/UIUtil';
let numberOfContacts = 0;
let notificationInterval;
/**
* Updates the number of participants in the contact list button and sets
@ -61,10 +60,6 @@ function getContactEl (id) {
return $(`#contacts>li[id="${id}"]`);
}
function contactElExists (id) {
return getContactEl(id).length > 0;
}
/**
* Contact list.
*/

View File

@ -1,7 +1,6 @@
/* global APP, $, JitsiMeetJS */
/* global $ */
import UIUtil from "../../util/UIUtil";
import UIEvents from "../../../../service/UI/UIEvents";
import languages from "../../../../service/translation/languages";
import Settings from '../../../settings/Settings';
export default {

View File

@ -1,4 +1,4 @@
/* global APP, $, JitsiMeetJS, interfaceConfig */
/* global APP, $, JitsiMeetJS */
import UIUtil from "../../util/UIUtil";
import UIEvents from "../../../../service/UI/UIEvents";
import languages from "../../../../service/translation/languages";

View File

@ -1,5 +1,4 @@
/* global APP, $, config, interfaceConfig, JitsiMeetJS */
/* jshint -W101 */
import UIUtil from '../util/UIUtil';
import UIEvents from '../../../service/UI/UIEvents';
import SideContainerToggler from "../side_pannels/SideContainerToggler";
@ -350,7 +349,11 @@ function showSipNumberInput () {
APP.UI.messageHandler.openTwoButtonDialog(
null, null, null,
`<h2>${sipMsg}</h2>
<input name="sipNumber" type="text" value="${defaultNumber}" autofocus>`,
<input
name="sipNumber"
type="text"
value="${defaultNumber}"
autofocus>`,
false, "dialog.Dial",
function (e, v, m, f) {
if (v && f.sipNumber) {
@ -739,7 +742,7 @@ const Toolbar = {
/**
* Handles the side toolbar toggle.
*/
_handleSideToolbarContainerToggled(containerId, isVisible) {
_handleSideToolbarContainerToggled(containerId) {
Object.keys(defaultToolbarButtons).forEach(
id => {
if (!UIUtil.isButtonEnabled(id))

View File

@ -3,7 +3,6 @@
import UIUtil from '../util/UIUtil';
import Toolbar from './Toolbar';
import SideContainerToggler from "../side_pannels/SideContainerToggler";
import FilmStrip from '../videolayout/FilmStrip.js';
let toolbarTimeoutObject;
let toolbarTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
@ -27,7 +26,7 @@ function showDesktopSharingButton() {
* @param force {true} to force the hiding of the toolbar without caring about
* the extended toolbar side panels.
*/
function hideToolbar(force) {
function hideToolbar(force) { // eslint-disable-line no-unused-vars
if (alwaysVisibleToolbar) {
return;
}

View File

@ -1,5 +1,4 @@
/* global $, APP, jQuery, toastr, Impromptu */
/* jshint -W101 */
/* global $, APP, toastr, Impromptu */
import UIUtil from './UIUtil';
@ -274,7 +273,8 @@ var messageHandler = {
displayNameSpan + '<br>' +
'<span class=' + cls + ' data-i18n="' + messageKey + '"' +
(messageArguments?
" data-i18n-options='" + JSON.stringify(messageArguments) + "'"
" data-i18n-options='" + JSON.stringify(messageArguments)
+ "'"
: "") + ">" +
APP.translation.translateString(messageKey,
messageArguments) +

View File

@ -1,4 +1,4 @@
/* global $, APP, config, AJS, interfaceConfig */
/* global $, APP, AJS, interfaceConfig */
import KeyboardShortcut from '../../keyboardshortcut/keyboardshortcut';

View File

@ -416,7 +416,7 @@ ConnectionIndicator.prototype.updateResolutionIndicator = function () {
else if (this.resolution !== null) {
let resolutions = this.resolution || {};
Object.keys(resolutions).map(function (ssrc) {
let {width, height} = resolutions[ssrc];
const { height } = resolutions[ssrc];
if (height >= config.minHDHeight)
showResolutionLabel = true;
});

View File

@ -1,4 +1,4 @@
/* global $, APP, interfaceConfig, config*/
/* global $, interfaceConfig */
import UIEvents from "../../../service/UI/UIEvents";
import UIUtil from "../util/UIUtil";

View File

@ -24,19 +24,20 @@ export default class LargeContainer {
* @param {number} containerHeight available height
* @param {boolean} animate if container should animate it's resize process
*/
// eslint-disable-next-line no-unused-vars
resize (containerWidth, containerHeight, animate) {
}
/**
* Handler for "hover in" events.
*/
onHoverIn (e) {
onHoverIn (e) { // eslint-disable-line no-unused-vars
}
/**
* Handler for "hover out" events.
*/
onHoverOut (e) {
onHoverOut (e) { // eslint-disable-line no-unused-vars
}
/**
@ -44,14 +45,14 @@ export default class LargeContainer {
* @param {JitsiTrack?} stream new stream
* @param {string} videoType video type
*/
setStream (stream, videoType) {
setStream (stream, videoType) { // eslint-disable-line no-unused-vars
}
/**
* Show or hide user avatar.
* @param {boolean} show
*/
showAvatar (show) {
showAvatar (show) { // eslint-disable-line no-unused-vars
}
/**

View File

@ -1,13 +1,10 @@
/* global $, APP, interfaceConfig */
/* jshint -W101 */
import Avatar from "../avatar/Avatar";
import {createDeferred} from '../../util/helpers';
import UIUtil from "../util/UIUtil";
import {VideoContainer, VIDEO_CONTAINER_TYPE} from "./VideoContainer";
import LargeContainer from "./LargeContainer";
import AudioLevels from "../audio_levels/AudioLevels";
/**

View File

@ -34,26 +34,10 @@ function LocalVideo(VideoLayout, emitter) {
LocalVideo.prototype = Object.create(SmallVideo.prototype);
LocalVideo.prototype.constructor = LocalVideo;
/**
* Creates the edit display name button.
*
* @returns {object} the edit button
*/
function createEditDisplayNameButton() {
var editButton = document.createElement('a');
editButton.className = 'displayname';
UIUtil.setTooltip(editButton,
"videothumbnail.editnickname",
"left");
editButton.innerHTML = '<i class="icon-edit"></i>';
return editButton;
}
/**
* Sets the display name for the given video span id.
*/
LocalVideo.prototype.setDisplayName = function(displayName, key) {
LocalVideo.prototype.setDisplayName = function(displayName) {
if (!this.container) {
console.warn(
"Unable to set displayName - " + this.videoSpanId +
@ -138,7 +122,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) {
$editDisplayName.focus();
$editDisplayName.select();
$editDisplayName.one("focusout", function (e) {
$editDisplayName.one("focusout", function () {
self.emitter.emit(UIEvents.NICKNAME_CHANGED, this.value);
$editDisplayName.hide();
$localDisplayName.show();

View File

@ -3,7 +3,6 @@
import ConnectionIndicator from './ConnectionIndicator';
import SmallVideo from "./SmallVideo";
import AudioLevels from "../audio_levels/AudioLevels";
import UIUtils from "../util/UIUtil";
import UIEvents from '../../../service/UI/UIEvents';
import JitsiPopover from "../util/JitsiPopover";
@ -61,8 +60,7 @@ RemoteVideo.prototype.addRemoteVideoContainer = function() {
this.addRemoteVideoMenu();
}
let { remoteVideo } = this.VideoLayout.resizeThumbnails(false, true);
let { thumbHeight, thumbWidth } = remoteVideo;
this.VideoLayout.resizeThumbnails(false, true);
this.addAudioLevelIndicator();
@ -429,7 +427,6 @@ RemoteVideo.prototype.addRemoteStreamElement = function (stream) {
return;
let streamElement = SmallVideo.createStreamElement(stream);
let newElementId = streamElement.id;
// Put new stream element always in front
UIUtils.prependChild(this.container, streamElement);

View File

@ -574,7 +574,6 @@ SmallVideo.prototype.getIndicatorSpan = function(id) {
* is added, and will fire a RESOLUTION_CHANGED event.
*/
SmallVideo.prototype.waitForResolutionChange = function() {
let self = this;
let beforeChange = window.performance.now();
let videos = this.selectVideoElement();
if (!videos || !videos.length || videos.length <= 0)
@ -582,17 +581,17 @@ SmallVideo.prototype.waitForResolutionChange = function() {
let video = videos[0];
let oldWidth = video.videoWidth;
let oldHeight = video.videoHeight;
video.onresize = (event) => {
video.onresize = () => {
if (video.videoWidth != oldWidth || video.videoHeight != oldHeight) {
// Only run once.
video.onresize = null;
let delay = window.performance.now() - beforeChange;
let emitter = self.VideoLayout.getEventEmitter();
let emitter = this.VideoLayout.getEventEmitter();
if (emitter) {
emitter.emit(
UIEvents.RESOLUTION_CHANGED,
self.getId(),
this.getId(),
oldWidth + "x" + oldHeight,
video.videoWidth + "x" + video.videoHeight,
delay);

View File

@ -139,11 +139,7 @@ function getCameraVideoPosition(videoWidth,
* @return an array with 2 elements, the horizontal indent and the vertical
* indent
*/
function getDesktopVideoPosition(videoWidth,
videoHeight,
videoSpaceWidth,
videoSpaceHeight) {
function getDesktopVideoPosition(videoWidth, videoHeight, videoSpaceWidth) {
let horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
let verticalIndent = 0;// Top aligned
@ -428,7 +424,6 @@ export class VideoContainer extends LargeContainer {
return Promise.resolve();
}
let $wrapper = this.$wrapper;
return new Promise((resolve) => {
this.$wrapper.css('visibility', 'visible').fadeTo(
FADE_DURATION_MS,

View File

@ -1,7 +1,5 @@
/* global config, APP, $, interfaceConfig, JitsiMeetJS */
/* jshint -W101 */
/* global config, APP, $, interfaceConfig */
import Avatar from "../avatar/Avatar";
import FilmStrip from "./FilmStrip";
import UIEvents from "../../../service/UI/UIEvents";
import UIUtil from "../util/UIUtil";
@ -9,11 +7,8 @@ import UIUtil from "../util/UIUtil";
import RemoteVideo from "./RemoteVideo";
import LargeVideoManager from "./LargeVideoManager";
import {VIDEO_CONTAINER_TYPE} from "./VideoContainer";
import {SHARED_VIDEO_CONTAINER_TYPE} from '../shared_video/SharedVideo';
import LocalVideo from "./LocalVideo";
const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
var remoteVideos = {};
var localVideoThumbnail = null;
@ -106,7 +101,7 @@ var VideoLayout = {
localVideoThumbnail.setVideoType(VIDEO_CONTAINER_TYPE);
// if we do not resize the thumbs here, if there is no video device
// the local video thumb maybe one pixel
let { localVideo } = this.resizeThumbnails(false, true);
this.resizeThumbnails(false, true);
emitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked);
this.lastNCount = config.channelLastN;
@ -316,7 +311,8 @@ var VideoLayout = {
onRemoteStreamRemoved (stream) {
let id = stream.getParticipantId();
let remoteVideo = remoteVideos[id];
if (remoteVideo) { // remote stream may be removed after participant left the conference
// Remote stream may be removed after participant left the conference.
if (remoteVideo) {
remoteVideo.removeRemoteStreamElement(stream);
}
},
@ -519,12 +515,9 @@ var VideoLayout = {
resizeThumbnails ( animate = false,
forceUpdate = false,
onComplete = null) {
let { localVideo, remoteVideo }
const { localVideo, remoteVideo }
= FilmStrip.calculateThumbnailSize();
let {thumbWidth, thumbHeight} = remoteVideo;
FilmStrip.resizeThumbnails(localVideo, remoteVideo,
animate, forceUpdate)
.then(function () {
@ -653,6 +646,7 @@ var VideoLayout = {
* @param {boolean} isActive true if the connection is ok or false when
* the user is having connectivity issues.
*/
// eslint-disable-next-line no-unused-vars
onParticipantConnectionStatusChanged (id, isActive) {
// Show/hide warning on the large video
if (this.isCurrentlyOnLarge(id)) {

View File

@ -75,8 +75,6 @@ function setupWelcomePage() {
});
if (interfaceConfig.GENERATE_ROOMNAMES_ON_WELCOME_PAGE !== false) {
var updateTimeout;
var animateTimeout;
var selector = $("#reload_roomname");
selector.click(function () {
clearTimeout(updateTimeout);

View File

@ -32,7 +32,7 @@ var HttpConfig = {
var error = "Get config response status: " + textStatus;
complete(false, error);
},
success: function(data, textStatus, jqXHR) {
success: function(data) {
try {
configUtil.overrideConfigJSON(
config, interfaceConfig, data);

View File

@ -1,4 +1,4 @@
/* global $, $iq, config, interfaceConfig, getConfigParamsFromUrl */
/* global config, interfaceConfig, getConfigParamsFromUrl */
var configUtils = require('./Util');
var params = {};

View File

@ -1,4 +1,3 @@
/* global $ */
var ConfigUtil = {
/**
* Method overrides JSON properties in <tt>config</tt> and

View File

@ -1,5 +1,3 @@
/* global APP, require */
/* jshint -W101 */
import EventEmitter from "events";
import CQEvents from "../../service/connectionquality/CQEvents";

View File

@ -1,4 +1,4 @@
/* global $, APP, JitsiMeetJS, config, interfaceConfig */
/* global APP, JitsiMeetJS */
let currentAudioInputDevices,
currentVideoInputDevices,

View File

@ -1,4 +1,4 @@
/* global APP, $, config */
/* global APP, config */
/**
* The (name of the) command which transports the recorder info.
@ -26,7 +26,6 @@ class Recorder {
// which are to be followed so don't forget to removeCommand before
// sendCommand!
commands.removeCommand(_USER_INFO_COMMAND);
var self = this;
commands.sendCommand(
_USER_INFO_COMMAND,
{

View File

@ -3,11 +3,9 @@ var i18n = require("i18next-client");
var languages = require("../../service/translation/languages");
var DEFAULT_LANG = languages.EN;
i18n.addPostProcessor("resolveAppName", function(value, key, options) {
return value.replace("__app__", interfaceConfig.APP_NAME);
});
i18n.addPostProcessor(
"resolveAppName",
value => value.replace("__app__", interfaceConfig.APP_NAME));
var defaultOptions = {
detectLngQS: "lang",
@ -34,7 +32,7 @@ var defaultOptions = {
{ lng: lng, ns: ns });
i18n.functions.ajax({
url: url,
success: function(data, status, xhr) {
success: function(data) {
i18n.functions.log('loaded: ' + url);
done(null, data);
},
@ -63,7 +61,7 @@ var defaultOptions = {
// localStorageExpirationTime: 86400000 // in ms, default 1 week
};
function initCompleted(t) {
function initCompleted() {
$("[data-i18n]").i18n();
}

View File

@ -44,6 +44,7 @@
"babel-register": "*",
"clean-css": "*",
"css-loader": "*",
"eslint": "*",
"expose-loader": "*",
"file-loader": "*",
"imports-loader": "*",
@ -56,7 +57,7 @@
},
"license": "Apache-2.0",
"scripts": {
"lint": "jshint .",
"lint": "jshint . && eslint .",
"validate": "npm ls"
},
"pre-commit": [

View File

@ -9,7 +9,7 @@
/**
* Builds and returns the room name.
*/
function getRoomName () {
function getRoomName () { // eslint-disable-line no-unused-vars
var path = window.location.pathname;
var roomName;
@ -42,6 +42,7 @@ function getRoomName () {
* @param dontParse if false or undefined some transformations
* (for parsing the value as JSON) are going to be executed
*/
// eslint-disable-next-line no-unused-vars
function getConfigParamsFromUrl(source, dontParse) {
var paramStr = (source === "search")? location.search : location.hash;
if (!paramStr)

View File

@ -1,5 +1,6 @@
/* global __dirname */
import process from 'process';
import webpack from 'webpack';
const aui_css = __dirname + '/node_modules/@atlassian/aui/dist/aui/css/';
const minimize