Browse Source

Prepare for eslint 4

master
Lyubo Marinov 8 years ago
parent
commit
25ec8ac6a7

+ 1
- 1
modules/UI/side_pannels/chat/Chat.js View File

@@ -304,7 +304,7 @@ var Chat = {
304 304
 
305 305
         $('#chatconversation').append(
306 306
             '<div class="errorMessage"><b>Error: </b>' + 'Your message' +
307
-            (originalText? (' \"'+ originalText + '\"') : "") +
307
+            (originalText? (` "${originalText}"`) : "") +
308 308
             ' was not sent.' +
309 309
             (errorMessage? (' Reason: ' + errorMessage) : '') +  '</div>');
310 310
         $('#chatconversation').animate(

+ 4
- 4
react/features/app/functions.native.js View File

@@ -44,16 +44,16 @@ function _fixURIStringHierPart(uri) {
44 44
     // hipchat.com
45 45
     let regex
46 46
         = new RegExp(
47
-                `^${_URI_PROTOCOL_PATTERN}//hipchat\\.com/video/call/`,
48
-                'gi');
47
+            `^${_URI_PROTOCOL_PATTERN}//hipchat\\.com/video/call/`,
48
+            'gi');
49 49
     let match = regex.exec(uri);
50 50
 
51 51
     if (!match) {
52 52
         // enso.me
53 53
         regex
54 54
             = new RegExp(
55
-                    `^${_URI_PROTOCOL_PATTERN}//enso\\.me/(?:call|meeting)/`,
56
-                    'gi');
55
+                `^${_URI_PROTOCOL_PATTERN}//enso\\.me/(?:call|meeting)/`,
56
+                'gi');
57 57
         match = regex.exec(uri);
58 58
     }
59 59
     if (match) {

+ 41
- 41
react/features/base/conference/actions.js View File

@@ -47,70 +47,70 @@ function _addConferenceListeners(conference, dispatch) {
47 47
     // Dispatches into features/base/conference follow:
48 48
 
49 49
     conference.on(
50
-            JitsiConferenceEvents.CONFERENCE_FAILED,
51
-            (...args) => dispatch(conferenceFailed(conference, ...args)));
50
+        JitsiConferenceEvents.CONFERENCE_FAILED,
51
+        (...args) => dispatch(conferenceFailed(conference, ...args)));
52 52
     conference.on(
53
-            JitsiConferenceEvents.CONFERENCE_JOINED,
54
-            (...args) => dispatch(conferenceJoined(conference, ...args)));
53
+        JitsiConferenceEvents.CONFERENCE_JOINED,
54
+        (...args) => dispatch(conferenceJoined(conference, ...args)));
55 55
     conference.on(
56
-            JitsiConferenceEvents.CONFERENCE_LEFT,
57
-            (...args) => dispatch(conferenceLeft(conference, ...args)));
56
+        JitsiConferenceEvents.CONFERENCE_LEFT,
57
+        (...args) => dispatch(conferenceLeft(conference, ...args)));
58 58
 
59 59
     conference.on(
60
-            JitsiConferenceEvents.LOCK_STATE_CHANGED,
61
-            (...args) => dispatch(lockStateChanged(conference, ...args)));
60
+        JitsiConferenceEvents.LOCK_STATE_CHANGED,
61
+        (...args) => dispatch(lockStateChanged(conference, ...args)));
62 62
 
63 63
     // Dispatches into features/base/tracks follow:
64 64
 
65 65
     conference.on(
66
-            JitsiConferenceEvents.TRACK_ADDED,
67
-            t => t && !t.isLocal() && dispatch(trackAdded(t)));
66
+        JitsiConferenceEvents.TRACK_ADDED,
67
+        t => t && !t.isLocal() && dispatch(trackAdded(t)));
68 68
     conference.on(
69
-            JitsiConferenceEvents.TRACK_REMOVED,
70
-            t => t && !t.isLocal() && dispatch(trackRemoved(t)));
69
+        JitsiConferenceEvents.TRACK_REMOVED,
70
+        t => t && !t.isLocal() && dispatch(trackRemoved(t)));
71 71
 
72 72
     // Dispatches into features/base/participants follow:
73 73
 
74 74
     conference.on(
75
-            JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
76
-            (...args) => dispatch(dominantSpeakerChanged(...args)));
75
+        JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
76
+        (...args) => dispatch(dominantSpeakerChanged(...args)));
77 77
 
78 78
     conference.on(
79
-            JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
80
-            (...args) => dispatch(participantConnectionStatusChanged(...args)));
79
+        JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
80
+        (...args) => dispatch(participantConnectionStatusChanged(...args)));
81 81
 
82 82
     conference.on(
83
-            JitsiConferenceEvents.USER_JOINED,
84
-            (id, user) => dispatch(participantJoined({
85
-                id,
86
-                name: user.getDisplayName(),
87
-                role: user.getRole()
88
-            })));
83
+        JitsiConferenceEvents.USER_JOINED,
84
+        (id, user) => dispatch(participantJoined({
85
+            id,
86
+            name: user.getDisplayName(),
87
+            role: user.getRole()
88
+        })));
89 89
     conference.on(
90
-            JitsiConferenceEvents.USER_LEFT,
91
-            (...args) => dispatch(participantLeft(...args)));
90
+        JitsiConferenceEvents.USER_LEFT,
91
+        (...args) => dispatch(participantLeft(...args)));
92 92
     conference.on(
93
-            JitsiConferenceEvents.USER_ROLE_CHANGED,
94
-            (...args) => dispatch(participantRoleChanged(...args)));
93
+        JitsiConferenceEvents.USER_ROLE_CHANGED,
94
+        (...args) => dispatch(participantRoleChanged(...args)));
95 95
 
96 96
     conference.addCommandListener(
97
-            AVATAR_ID_COMMAND,
98
-            (data, id) => dispatch(participantUpdated({
99
-                id,
100
-                avatarID: data.value
101
-            })));
97
+        AVATAR_ID_COMMAND,
98
+        (data, id) => dispatch(participantUpdated({
99
+            id,
100
+            avatarID: data.value
101
+        })));
102 102
     conference.addCommandListener(
103
-            AVATAR_URL_COMMAND,
104
-            (data, id) => dispatch(participantUpdated({
105
-                id,
106
-                avatarURL: data.value
107
-            })));
103
+        AVATAR_URL_COMMAND,
104
+        (data, id) => dispatch(participantUpdated({
105
+            id,
106
+            avatarURL: data.value
107
+        })));
108 108
     conference.addCommandListener(
109
-            EMAIL_COMMAND,
110
-            (data, id) => dispatch(participantUpdated({
111
-                id,
112
-                email: data.value
113
-            })));
109
+        EMAIL_COMMAND,
110
+        (data, id) => dispatch(participantUpdated({
111
+            id,
112
+            email: data.value
113
+        })));
114 114
 }
115 115
 
116 116
 /**

+ 12
- 12
react/features/base/connection/actions.native.js View File

@@ -40,14 +40,14 @@ export function connect() {
40 40
                 });
41 41
 
42 42
         connection.addEventListener(
43
-                JitsiConnectionEvents.CONNECTION_DISCONNECTED,
44
-                _onConnectionDisconnected);
43
+            JitsiConnectionEvents.CONNECTION_DISCONNECTED,
44
+            _onConnectionDisconnected);
45 45
         connection.addEventListener(
46
-                JitsiConnectionEvents.CONNECTION_ESTABLISHED,
47
-                _onConnectionEstablished);
46
+            JitsiConnectionEvents.CONNECTION_ESTABLISHED,
47
+            _onConnectionEstablished);
48 48
         connection.addEventListener(
49
-                JitsiConnectionEvents.CONNECTION_FAILED,
50
-                _onConnectionFailed);
49
+            JitsiConnectionEvents.CONNECTION_FAILED,
50
+            _onConnectionFailed);
51 51
 
52 52
         connection.connect();
53 53
 
@@ -61,8 +61,8 @@ export function connect() {
61 61
          */
62 62
         function _onConnectionDisconnected(message: string) {
63 63
             connection.removeEventListener(
64
-                    JitsiConnectionEvents.CONNECTION_DISCONNECTED,
65
-                    _onConnectionDisconnected);
64
+                JitsiConnectionEvents.CONNECTION_DISCONNECTED,
65
+                _onConnectionDisconnected);
66 66
 
67 67
             dispatch(_connectionDisconnected(connection, message));
68 68
         }
@@ -99,11 +99,11 @@ export function connect() {
99 99
          */
100 100
         function unsubscribe() {
101 101
             connection.removeEventListener(
102
-                    JitsiConnectionEvents.CONNECTION_ESTABLISHED,
103
-                    _onConnectionEstablished);
102
+                JitsiConnectionEvents.CONNECTION_ESTABLISHED,
103
+                _onConnectionEstablished);
104 104
             connection.removeEventListener(
105
-                    JitsiConnectionEvents.CONNECTION_FAILED,
106
-                    _onConnectionFailed);
105
+                JitsiConnectionEvents.CONNECTION_FAILED,
106
+                _onConnectionFailed);
107 107
         }
108 108
     };
109 109
 }

+ 2
- 2
react/features/base/connection/actions.web.js View File

@@ -67,8 +67,8 @@ export function connect() {
67 67
             APP.UI.initConference();
68 68
 
69 69
             APP.UI.addListener(
70
-                    UIEvents.LANG_CHANGED,
71
-                    language => APP.translation.setLanguage(language));
70
+                UIEvents.LANG_CHANGED,
71
+                language => APP.translation.setLanguage(language));
72 72
 
73 73
             APP.keyboardshortcut.init();
74 74
 

+ 1
- 1
react/features/base/i18n/functions.js View File

@@ -12,7 +12,7 @@ export function translate(component) {
12 12
     // Use the default list of namespaces.
13 13
     return (
14 14
         reactI18nextTranslate([ 'main', 'languages' ], { wait: true })(
15
-                component));
15
+            component));
16 16
 }
17 17
 
18 18
 /**

+ 10
- 10
react/features/base/i18n/i18next.js View File

@@ -48,16 +48,16 @@ i18next
48 48
 
49 49
 // Add default language which is preloaded from the source code.
50 50
 i18next.addResourceBundle(
51
-        DEFAULT_LANGUAGE,
52
-        'main',
53
-        MAIN_RESOURCES,
54
-        /* deep */ true,
55
-        /* overwrite */ true);
51
+    DEFAULT_LANGUAGE,
52
+    'main',
53
+    MAIN_RESOURCES,
54
+    /* deep */ true,
55
+    /* overwrite */ true);
56 56
 i18next.addResourceBundle(
57
-        DEFAULT_LANGUAGE,
58
-        'languages',
59
-        LANGUAGES_RESOURCES,
60
-        /* deep */ true,
61
-        /* overwrite */ true);
57
+    DEFAULT_LANGUAGE,
58
+    'languages',
59
+    LANGUAGES_RESOURCES,
60
+    /* deep */ true,
61
+    /* overwrite */ true);
62 62
 
63 63
 export default i18next;

+ 1
- 1
react/features/base/i18n/middleware.js View File

@@ -35,7 +35,7 @@ MiddlewareRegistry.register(store => next => action => {
35 35
  * @returns {Object} The new state that is the result of the reduction of the
36 36
  * specified action.
37 37
  */
38
-function _setConfig({ dispatch, getState }, next, action) {
38
+function _setConfig({ getState }, next, action) {
39 39
     const oldValue = getState()['features/base/config'];
40 40
     const result = next(action);
41 41
     const newValue = getState()['features/base/config'];

+ 6
- 6
react/features/base/lib-jitsi-meet/native/polyfills-browser.js View File

@@ -120,8 +120,8 @@ function _visitNode(node, callback) {
120 120
     if (typeof global.document === 'undefined') {
121 121
         const document
122 122
             = new DOMParser().parseFromString(
123
-                    '<html><head></head><body></body></html>',
124
-                    'text/xml');
123
+                '<html><head></head><body></body></html>',
124
+                'text/xml');
125 125
 
126 126
         // document.addEventListener
127 127
         //
@@ -181,8 +181,8 @@ function _visitNode(node, callback) {
181 181
                         // Parse the content string.
182 182
                         const d
183 183
                             = new DOMParser().parseFromString(
184
-                                    `<div>${innerHTML}</div>`,
185
-                                    'text/xml');
184
+                                `<div>${innerHTML}</div>`,
185
+                                'text/xml');
186 186
 
187 187
                         // Assign the resulting nodes as children of the
188 188
                         // element.
@@ -353,8 +353,8 @@ function _visitNode(node, callback) {
353 353
                     if (responseText) {
354 354
                         responseXML
355 355
                             = new DOMParser().parseFromString(
356
-                                    responseText,
357
-                                    'text/xml');
356
+                                responseText,
357
+                                'text/xml');
358 358
                     }
359 359
 
360 360
                     return responseXML;

+ 3
- 3
react/features/base/react/RouteRegistry.js View File

@@ -76,7 +76,7 @@ class RouteRegistry {
76 76
         });
77 77
     }
78 78
 
79
-/* eslint-disable no-undef */
79
+    /* eslint-disable no-undef */
80 80
 
81 81
     /**
82 82
      * Returns registered route by name if any.
@@ -87,7 +87,7 @@ class RouteRegistry {
87 87
      */
88 88
     getRouteByComponent(component: Class<Component<*>>) {
89 89
 
90
-/* eslint-enable no-undef */
90
+        /* eslint-enable no-undef */
91 91
 
92 92
         const route = this._elements.find(r => r.component === component);
93 93
 
@@ -106,7 +106,7 @@ class RouteRegistry {
106 106
     register(route: Route) {
107 107
         if (this._elements.includes(route)) {
108 108
             throw new Error(
109
-                    `Route ${String(route.component)} is registered already!`);
109
+                `Route ${String(route.component)} is registered already!`);
110 110
         }
111 111
 
112 112
         this._elements.push(route);

+ 1
- 1
react/features/conference/components/Conference.native.js View File

@@ -277,4 +277,4 @@ function _mapStateToProps(state) {
277 277
 }
278 278
 
279 279
 export default reactReduxConnect(_mapStateToProps, _mapDispatchToProps)(
280
-        Conference);
280
+    Conference);

+ 1
- 1
react/features/device-selection/components/DeviceSelectionDialog.js View File

@@ -22,7 +22,7 @@ class DeviceSelectionDialog extends Component {
22 22
      * @static
23 23
      */
24 24
     static propTypes = {
25
-       /**
25
+        /**
26 26
          * All known audio and video devices split by type. This prop comes from
27 27
          * the app state.
28 28
          */

+ 1
- 1
react/features/device-selection/components/DeviceSelectionDialogBase.js View File

@@ -21,7 +21,7 @@ class DeviceSelectionDialogBase extends Component {
21 21
      * @static
22 22
      */
23 23
     static propTypes = {
24
-       /**
24
+        /**
25 25
          * All known audio and video devices split by type. This prop comes from
26 26
          * the app state.
27 27
          */

+ 3
- 2
react/features/invite/middleware.js View File

@@ -16,8 +16,9 @@ MiddlewareRegistry.register(store => next => action => {
16 16
 
17 17
     switch (action.type) {
18 18
     case UPDATE_DIAL_IN_NUMBERS_FAILED:
19
-        logger.error('Error encountered while fetching dial-in numbers:',
20
-           action.error);
19
+        logger.error(
20
+            'Error encountered while fetching dial-in numbers:',
21
+            action.error);
21 22
         break;
22 23
     }
23 24
 

+ 3
- 3
react/features/jwt/middleware.js View File

@@ -100,9 +100,9 @@ function _maybeSetCallOverlayVisible({ dispatch, getState }, next, action) {
100 100
 
101 101
                 callOverlayVisible
102 102
                     = Boolean(
103
-                            participants
104
-                                && participants.length === 1
105
-                                && participants[0].local);
103
+                        participants
104
+                            && participants.length === 1
105
+                            && participants[0].local);
106 106
 
107 107
                 // However, the CallDialog is not to be displayed/visible again
108 108
                 // after all remote participants leave.

+ 6
- 6
react/features/large-video/actions.js View File

@@ -24,15 +24,15 @@ export function selectParticipant() {
24 24
             const id = largeVideo.participantId;
25 25
             const videoTrack
26 26
                 = getTrackByMediaTypeAndParticipant(
27
-                        tracks,
28
-                        MEDIA_TYPE.VIDEO,
29
-                        id);
27
+                    tracks,
28
+                    MEDIA_TYPE.VIDEO,
29
+                    id);
30 30
 
31 31
             try {
32 32
                 conference.selectParticipant(
33
-                        videoTrack && videoTrack.videoType === VIDEO_TYPE.CAMERA
34
-                            ? id
35
-                            : null);
33
+                    videoTrack && videoTrack.videoType === VIDEO_TYPE.CAMERA
34
+                        ? id
35
+                        : null);
36 36
             } catch (err) {
37 37
                 _handleParticipantError(err);
38 38
             }

+ 1
- 2
react/features/mobile/audio-mode/middleware.js View File

@@ -55,8 +55,7 @@ MiddlewareRegistry.register(store => next => action => {
55 55
             AudioMode.setMode(mode)
56 56
                 .catch(err =>
57 57
                     console.error(
58
-                            `Failed to set audio mode ${String(mode)}: `
59
-                                + `${err}`));
58
+                        `Failed to set audio mode ${String(mode)}: ${err}`));
60 59
         }
61 60
     }
62 61
 

+ 2
- 2
react/features/mobile/background/middleware.js View File

@@ -52,8 +52,8 @@ MiddlewareRegistry.register(store => next => action => {
52 52
 
53 53
     case APP_WILL_MOUNT:
54 54
         store.dispatch(
55
-                _setAppStateListener(
56
-                        _onAppStateChange.bind(undefined, store.dispatch)));
55
+            _setAppStateListener(
56
+                _onAppStateChange.bind(undefined, store.dispatch)));
57 57
         break;
58 58
 
59 59
     case APP_WILL_UNMOUNT:

+ 21
- 21
react/features/overlay/components/AbstractPageReloadOverlay.js View File

@@ -133,34 +133,34 @@ export default class AbstractPageReloadOverlay extends Component {
133 133
         // sent to the backed.
134 134
         // FIXME: We should dispatch action for this.
135 135
         APP.conference.logEvent(
136
-                'page.reload',
137
-                /* value */ undefined,
138
-                /* label */ this.props.reason);
136
+            'page.reload',
137
+            /* value */ undefined,
138
+            /* label */ this.props.reason);
139 139
         logger.info(
140
-                `The conference will be reloaded after ${
141
-                    this.state.timeoutSeconds} seconds.`);
140
+            `The conference will be reloaded after ${
141
+                this.state.timeoutSeconds} seconds.`);
142 142
 
143 143
         AJS.progressBars.update('#reloadProgressBar', 0);
144 144
 
145 145
         this._interval
146 146
             = setInterval(
147
-                    () => {
148
-                        if (this.state.timeLeft === 0) {
149
-                            if (this._interval) {
150
-                                clearInterval(this._interval);
151
-                                this._interval = undefined;
152
-                            }
153
-
154
-                            this.props.dispatch(_reloadNow());
155
-                        } else {
156
-                            this.setState(prevState => {
157
-                                return {
158
-                                    timeLeft: prevState.timeLeft - 1
159
-                                };
160
-                            });
147
+                () => {
148
+                    if (this.state.timeLeft === 0) {
149
+                        if (this._interval) {
150
+                            clearInterval(this._interval);
151
+                            this._interval = undefined;
161 152
                         }
162
-                    },
163
-                    1000);
153
+
154
+                        this.props.dispatch(_reloadNow());
155
+                    } else {
156
+                        this.setState(prevState => {
157
+                            return {
158
+                                timeLeft: prevState.timeLeft - 1
159
+                            };
160
+                        });
161
+                    }
162
+                },
163
+                1000);
164 164
     }
165 165
 
166 166
     /**

+ 15
- 16
react/features/overlay/components/ReloadTimer.js View File

@@ -105,19 +105,19 @@ class ReloadTimer extends Component {
105 105
 
106 106
         const intervalId
107 107
             = setInterval(
108
-                    () => {
109
-                        if (this.state.current === this.props.end) {
110
-                            clearInterval(intervalId);
111
-                            this.props.onFinish();
112
-                        } else {
113
-                            this.setState((prevState, props) => {
114
-                                return {
115
-                                    current: prevState.current + props.step
116
-                                };
117
-                            });
118
-                        }
119
-                    },
120
-                    Math.abs(this.props.interval) * 1000);
108
+                () => {
109
+                    if (this.state.current === this.props.end) {
110
+                        clearInterval(intervalId);
111
+                        this.props.onFinish();
112
+                    } else {
113
+                        this.setState((prevState, props) => {
114
+                            return {
115
+                                current: prevState.current + props.step
116
+                            };
117
+                        });
118
+                    }
119
+                },
120
+                Math.abs(this.props.interval) * 1000);
121 121
     }
122 122
 
123 123
     /**
@@ -129,9 +129,8 @@ class ReloadTimer extends Component {
129 129
      */
130 130
     componentDidUpdate() {
131 131
         AJS.progressBars.update(
132
-                '#reloadProgressBar',
133
-                Math.abs(this.state.current - this.props.start)
134
-                    / this.state.time);
132
+            '#reloadProgressBar',
133
+            Math.abs(this.state.current - this.props.start) / this.state.time);
135 134
     }
136 135
 
137 136
     /**

+ 7
- 4
react/features/remote-control/components/RemoteControlAuthorizationDialog.js View File

@@ -74,8 +74,9 @@ class RemoteControlAuthorizationDialog extends Component {
74 74
                 titleKey = 'dialog.remoteControlTitle'
75 75
                 width = 'small'>
76 76
                 {
77
-                    this.props.t('dialog.remoteControlRequestMessage',
78
-                    { user: this.props._displayName })
77
+                    this.props.t(
78
+                        'dialog.remoteControlRequestMessage',
79
+                        { user: this.props._displayName })
79 80
                 }
80 81
                 {
81 82
                     this._getAdditionalMessage()
@@ -153,8 +154,10 @@ class RemoteControlAuthorizationDialog extends Component {
153 154
  */
154 155
 function _mapStateToProps(state, ownProps) {
155 156
     const { _displayName, participantId } = ownProps;
156
-    const participant = getParticipantById(
157
-            state['features/base/participants'], participantId);
157
+    const participant
158
+        = getParticipantById(
159
+            state['features/base/participants'],
160
+            participantId);
158 161
 
159 162
     return {
160 163
         _displayName: participant ? participant.name : _displayName

+ 1
- 1
react/features/speaker-stats/components/SpeakerStats.js View File

@@ -91,7 +91,7 @@ class SpeakerStats extends Component {
91 91
         );
92 92
     }
93 93
 
94
-   /**
94
+    /**
95 95
      * Update the internal state with the latest speaker stats.
96 96
      *
97 97
      * @returns {void}

+ 5
- 5
react/features/welcome/components/AbstractWelcomePage.js View File

@@ -97,11 +97,11 @@ export class AbstractWelcomePage extends Component {
97 97
         if (word.length > 1) {
98 98
             animateTimeoutId
99 99
                 = setTimeout(
100
-                        () => {
101
-                            this._animateRoomnameChanging(
102
-                                    word.substring(1, word.length));
103
-                        },
104
-                        70);
100
+                    () => {
101
+                        this._animateRoomnameChanging(
102
+                            word.substring(1, word.length));
103
+                    },
104
+                    70);
105 105
         }
106 106
 
107 107
         this.setState({

Loading…
Cancel
Save