Browse Source

[eslint] space-infix-ops

dev1
Lyubo Marinov 8 years ago
parent
commit
324afc0caf

+ 1
- 0
.eslintrc.js View File

157
         'padded-blocks': 0,
157
         'padded-blocks': 0,
158
         'quote-props': 0,
158
         'quote-props': 0,
159
         'semi': [ 'error', 'always' ],
159
         'semi': [ 'error', 'always' ],
160
+        'space-infix-ops': 2,
160
         'space-unary-ops': 2,
161
         'space-unary-ops': 2,
161
         'spaced-comment': 2,
162
         'spaced-comment': 2,
162
         'unicode-bom': 0,
163
         'unicode-bom': 0,

+ 1
- 1
JitsiConference.js View File

1196
  * @return {string} local user's ID
1196
  * @return {string} local user's ID
1197
  */
1197
  */
1198
 JitsiConference.prototype.myUserId = function () {
1198
 JitsiConference.prototype.myUserId = function () {
1199
-    return this.room && this.room.myroomjid? Strophe.getResourceFromJid(this.room.myroomjid) : null;
1199
+    return this.room && this.room.myroomjid ? Strophe.getResourceFromJid(this.room.myroomjid) : null;
1200
 };
1200
 };
1201
 
1201
 
1202
 JitsiConference.prototype.sendTones = function (tones, duration, pause) {
1202
 JitsiConference.prototype.sendTones = function (tones, duration, pause) {

+ 1
- 1
JitsiTrackErrors.js View File

18
  * selection dialog in jidesha extension for Chrome.
18
  * selection dialog in jidesha extension for Chrome.
19
  */
19
  */
20
 export const CHROME_EXTENSION_USER_CANCELED
20
 export const CHROME_EXTENSION_USER_CANCELED
21
-    ="gum.chrome_extension_user_canceled";
21
+    = "gum.chrome_extension_user_canceled";
22
 /**
22
 /**
23
  * An error which indicates that some of requested constraints in
23
  * An error which indicates that some of requested constraints in
24
  * getUserMedia call were not satisfied.
24
  * getUserMedia call were not satisfied.

+ 2
- 2
doc/example/example.js View File

106
         return;
106
         return;
107
     }
107
     }
108
     var tracks = remoteTracks[id];
108
     var tracks = remoteTracks[id];
109
-    for(var i = 0; i< tracks.length; i++) {
109
+    for(var i = 0; i < tracks.length; i++) {
110
         tracks[i].detach($("#" + id + tracks[i].getType()));
110
         tracks[i].detach($("#" + id + tracks[i].getType()));
111
     }
111
     }
112
 }
112
 }
187
         localTracks[1].dispose();
187
         localTracks[1].dispose();
188
         localTracks.pop();
188
         localTracks.pop();
189
     }
189
     }
190
-    JitsiMeetJS.createLocalTracks({devices: isVideo? ["video"] : ["desktop"]}).
190
+    JitsiMeetJS.createLocalTracks({devices: isVideo ? ["video"] : ["desktop"]}).
191
         then(function (tracks) {
191
         then(function (tracks) {
192
             localTracks.push(tracks[0]);
192
             localTracks.push(tracks[0]);
193
             localTracks[1].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
193
             localTracks[1].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,

+ 1
- 1
modules/RTC/JitsiRemoteTrack.js View File

153
         - window.connectionTimes["obtainPermissions.start"]);
153
         - window.connectionTimes["obtainPermissions.start"]);
154
     this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
154
     this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
155
     console.log("(TIME) TTFM " + type + ":\t", ttfm);
155
     console.log("(TIME) TTFM " + type + ":\t", ttfm);
156
-    var eventName = type +'.ttfm';
156
+    var eventName = type + '.ttfm';
157
     if(this.hasBeenMuted) {
157
     if(this.hasBeenMuted) {
158
         eventName += '.muted';
158
         eventName += '.muted';
159
     }
159
     }

+ 1
- 1
modules/RTC/RTC.js View File

96
             function (tracksInfo) {
96
             function (tracksInfo) {
97
                 var tracks = createLocalTracks(tracksInfo, options);
97
                 var tracks = createLocalTracks(tracksInfo, options);
98
                 return !tracks.some(track =>
98
                 return !tracks.some(track =>
99
-                    !track._isReceivingData())? tracks
99
+                    !track._isReceivingData()) ? tracks
100
                         : Promise.reject(new JitsiTrackError(
100
                         : Promise.reject(new JitsiTrackError(
101
                             JitsiTrackErrors.NO_DATA_FROM_SOURCE));
101
                             JitsiTrackErrors.NO_DATA_FROM_SOURCE));
102
             });
102
             });

+ 2
- 2
modules/RTC/RTCUtils.js View File

1153
             return true;
1153
             return true;
1154
         }
1154
         }
1155
         return typeof MediaStreamTrack !== "undefined" &&
1155
         return typeof MediaStreamTrack !== "undefined" &&
1156
-            MediaStreamTrack.getSources? true : false;
1156
+            MediaStreamTrack.getSources ? true : false;
1157
     }
1157
     }
1158
 
1158
 
1159
     /**
1159
     /**
1206
             : RTCBrowserType.isChrome() ||
1206
             : RTCBrowserType.isChrome() ||
1207
                 RTCBrowserType.isFirefox() ||
1207
                 RTCBrowserType.isFirefox() ||
1208
                 RTCBrowserType.isOpera() ||
1208
                 RTCBrowserType.isOpera() ||
1209
-                RTCBrowserType.isTemasysPluginUsed()||
1209
+                RTCBrowserType.isTemasysPluginUsed() ||
1210
                 RTCBrowserType.isNWJS() ||
1210
                 RTCBrowserType.isNWJS() ||
1211
                 RTCBrowserType.isElectron();
1211
                 RTCBrowserType.isElectron();
1212
     }
1212
     }

+ 2
- 2
modules/RTC/TraceablePeerConnection.js View File

535
 
535
 
536
             if (Array.isArray(mLine.ssrcs)) {
536
             if (Array.isArray(mLine.ssrcs)) {
537
                 var i;
537
                 var i;
538
-                for (i = 0; i<mLine.ssrcs.length; i++){
538
+                for (i = 0; i < mLine.ssrcs.length; i++){
539
                     if (typeof mLine.ssrcs[i] === 'object'
539
                     if (typeof mLine.ssrcs[i] === 'object'
540
                         && typeof mLine.ssrcs[i].id !== 'undefined'
540
                         && typeof mLine.ssrcs[i].id !== 'undefined'
541
                         && firstSsrcs.indexOf(mLine.ssrcs[i].id) >= 0) {
541
                         && firstSsrcs.indexOf(mLine.ssrcs[i].id) >= 0) {
544
                     }
544
                     }
545
                 }
545
                 }
546
 
546
 
547
-                for (i = 0; i<mLine.ssrcs.length; i++){
547
+                for (i = 0; i < mLine.ssrcs.length; i++){
548
                     if (typeof mLine.ssrcs[i] !== 'undefined') {
548
                     if (typeof mLine.ssrcs[i] !== 'undefined') {
549
                         newSsrcLines.push(mLine.ssrcs[i]);
549
                         newSsrcLines.push(mLine.ssrcs[i]);
550
                     }
550
                     }

+ 1
- 1
modules/connectivity/ConnectionQuality.js View File

57
         if (simulcastFormat) {
57
         if (simulcastFormat) {
58
             // Sum the target fields from all simulcast layers for the given
58
             // Sum the target fields from all simulcast layers for the given
59
             // resolution (e.g. 720p + 360p + 180p).
59
             // resolution (e.g. 720p + 360p + 180p).
60
-            for (height = simulcastFormat.height; height >= 180; height /=2) {
60
+            for (height = simulcastFormat.height; height >= 180; height /= 2) {
61
                 simulcastFormat
61
                 simulcastFormat
62
                     = kSimulcastFormats.find(f => f.height == height);
62
                     = kSimulcastFormats.find(f => f.height == height);
63
                 if (simulcastFormat) {
63
                 if (simulcastFormat) {

+ 1
- 1
modules/connectivity/ParticipantConnectionStatus.js View File

175
 
175
 
176
         logger.debug(
176
         logger.debug(
177
             'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
177
             'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
178
-                + Date.now() +'): ' + endpointId + ': ' + isActive);
178
+                + Date.now() + '): ' + endpointId + ': ' + isActive);
179
 
179
 
180
         // Filter out events for the local JID for now
180
         // Filter out events for the local JID for now
181
         if (endpointId !== this.conference.myUserId()) {
181
         if (endpointId !== this.conference.myUserId()) {

+ 1
- 1
modules/statistics/CallStats.js View File

237
 
237
 
238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
239
     if (callStats && err !== 'success') {
239
     if (callStats && err !== 'success') {
240
-        logger.error("Monitoring status: "+ err + " msg: " + msg);
240
+        logger.error("Monitoring status: " + err + " msg: " + msg);
241
     }
241
     }
242
 });
242
 });
243
 
243
 

+ 1
- 1
modules/statistics/RTPStatsCollector.js View File

67
     if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0) {
67
     if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0) {
68
         return 0;
68
         return 0;
69
     }
69
     }
70
-    return Math.round((lostPackets/totalPackets)*100);
70
+    return Math.round((lostPackets / totalPackets) * 100);
71
 }
71
 }
72
 
72
 
73
 /**
73
 /**

+ 1
- 1
modules/transcription/transcriber.js View File

114
         answer.wordArray.forEach(function(wordObject) {
114
         answer.wordArray.forEach(function(wordObject) {
115
             wordObject.begin += offset;
115
             wordObject.begin += offset;
116
             wordObject.end += offset;
116
             wordObject.end += offset;
117
-            array += wordObject.word+",";
117
+            array += wordObject.word + ",";
118
         });
118
         });
119
         array += "]";
119
         array += "]";
120
         console.log(array);
120
         console.log(array);

+ 1
- 1
modules/xmpp/Caps.js View File

105
         const user
105
         const user
106
             = jid in this.jidToVersion ? this.jidToVersion[jid] : null;
106
             = jid in this.jidToVersion ? this.jidToVersion[jid] : null;
107
         if(!user || !(user.version in this.versionToCapabilities)) {
107
         if(!user || !(user.version in this.versionToCapabilities)) {
108
-            const node = user? user.node + "#" + user.version : null;
108
+            const node = user ? user.node + "#" + user.version : null;
109
             return new Promise ( (resolve, reject) =>
109
             return new Promise ( (resolve, reject) =>
110
                 this.disco.info(jid, node, response => {
110
                 this.disco.info(jid, node, response => {
111
                     const features = new Set();
111
                     const features = new Set();

+ 2
- 2
modules/xmpp/ChatRoom.js View File

292
         }
292
         }
293
 
293
 
294
         if (from == this.myroomjid) {
294
         if (from == this.myroomjid) {
295
-            var newRole = member.affiliation == "owner"? member.role : "none";
295
+            var newRole = member.affiliation == "owner" ? member.role : "none";
296
             if (this.role !== newRole) {
296
             if (this.role !== newRole) {
297
                 this.role = newRole;
297
                 this.role = newRole;
298
                 this.eventEmitter.emit(XMPPEvents.LOCAL_ROLE_CHANGED, this.role);
298
                 this.eventEmitter.emit(XMPPEvents.LOCAL_ROLE_CHANGED, this.role);
572
             }
572
             }
573
         }
573
         }
574
 
574
 
575
-        if (from==this.roomjid && $(msg).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length) {
575
+        if (from == this.roomjid && $(msg).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length) {
576
             this.discoRoomInfo();
576
             this.discoRoomInfo();
577
         }
577
         }
578
 
578
 

+ 1
- 1
modules/xmpp/JingleSessionPC.js View File

1050
                     const ssrcLines
1050
                     const ssrcLines
1051
                         = SDPUtil.find_lines(media, 'a=ssrc:' + ssrc);
1051
                         = SDPUtil.find_lines(media, 'a=ssrc:' + ssrc);
1052
                     if (ssrcLines.length) {
1052
                     if (ssrcLines.length) {
1053
-                        removeSsrcInfo[idx] += ssrcLines.join("\r\n")+"\r\n";
1053
+                        removeSsrcInfo[idx] += ssrcLines.join("\r\n") + "\r\n";
1054
                     }
1054
                     }
1055
                 });
1055
                 });
1056
                 removeSsrcInfo[idx] += lines;
1056
                 removeSsrcInfo[idx] += lines;

+ 1
- 1
modules/xmpp/SDP.js View File

615
 
615
 
616
     content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function () {
616
     content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function () {
617
         var protocol = this.getAttribute('protocol');
617
         var protocol = this.getAttribute('protocol');
618
-        protocol = typeof protocol === 'string' ? protocol.toLowerCase(): '';
618
+        protocol = typeof protocol === 'string' ? protocol.toLowerCase() : '';
619
 
619
 
620
         if ((self.removeTcpCandidates
620
         if ((self.removeTcpCandidates
621
                 && (protocol === 'tcp' || protocol === 'ssltcp')) ||
621
                 && (protocol === 'tcp' || protocol === 'ssltcp')) ||

+ 1
- 1
modules/xmpp/SDPDiffer.js View File

23
             return false;
23
             return false;
24
         }
24
         }
25
 
25
 
26
-        for (var i = 0, l=this.length; i < l; i++) {
26
+        for (var i = 0, l = this.length; i < l; i++) {
27
             // Check if we have nested arrays
27
             // Check if we have nested arrays
28
             if (this[i] instanceof Array && array[i] instanceof Array) {
28
             if (this[i] instanceof Array && array[i] instanceof Array) {
29
                 // recurse into the nested arrays
29
                 // recurse into the nested arrays

+ 1
- 1
modules/xmpp/moderator.js View File

337
         return;
337
         return;
338
     }
338
     }
339
     var waitMs = this.getNextErrorTimeout();
339
     var waitMs = this.getNextErrorTimeout();
340
-    var errmsg = "Focus error, retry after "+ waitMs;
340
+    var errmsg = "Focus error, retry after " + waitMs;
341
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
341
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
342
     logger.error(errmsg, error);
342
     logger.error(errmsg, error);
343
     // Show message
343
     // Show message

+ 2
- 2
modules/xmpp/xmpp.js View File

240
         const now = this.connectionTimes["attaching"] = window.performance.now();
240
         const now = this.connectionTimes["attaching"] = window.performance.now();
241
         logger.log("(TIME) Strophe Attaching\t:" + now);
241
         logger.log("(TIME) Strophe Attaching\t:" + now);
242
         this.connection.attach(options.jid, options.sid,
242
         this.connection.attach(options.jid, options.sid,
243
-            parseInt(options.rid,10)+1,
243
+            parseInt(options.rid,10) + 1,
244
             this.connectionHandler.bind(this, options.password));
244
             this.connectionHandler.bind(this, options.password));
245
     }
245
     }
246
 
246
 
296
      */
296
      */
297
     getJingleLog () {
297
     getJingleLog () {
298
         const jingle = this.connection.jingle;
298
         const jingle = this.connection.jingle;
299
-        return jingle? jingle.getLog() : {};
299
+        return jingle ? jingle.getLog() : {};
300
     }
300
     }
301
 
301
 
302
     /**
302
     /**

Loading…
Cancel
Save