Ver código fonte

Merge branch 'eslint_improvements-2'

master
Lyubo Marinov 8 anos atrás
pai
commit
0ccc7ce5f0

+ 2
- 0
.eslintrc.js Ver arquivo

74
         'consistent-return': 0,
74
         'consistent-return': 0,
75
         'curly': 2,
75
         'curly': 2,
76
         'default-case': 0,
76
         'default-case': 0,
77
+        'dot-location': [ 'error', 'property' ],
78
+        'dot-notation': 2,
77
         'no-caller': 2,
79
         'no-caller': 2,
78
         'no-case-declarations': 2,
80
         'no-case-declarations': 2,
79
         'no-div-regex': 0,
81
         'no-div-regex': 0,

+ 1
- 1
JitsiConference.js Ver arquivo

1035
     // add info whether call is cross-region
1035
     // add info whether call is cross-region
1036
     var crossRegion = null;
1036
     var crossRegion = null;
1037
     if (window.jitsiRegionInfo) {
1037
     if (window.jitsiRegionInfo) {
1038
-        crossRegion = window.jitsiRegionInfo['CrossRegion'];
1038
+        crossRegion = window.jitsiRegionInfo.CrossRegion;
1039
     }
1039
     }
1040
     Statistics.analytics.sendEvent(
1040
     Statistics.analytics.sendEvent(
1041
         'session.initiate', {
1041
         'session.initiate', {

+ 4
- 4
doc/example/example.js Ver arquivo

187
         localTracks[1].dispose();
187
         localTracks[1].dispose();
188
         localTracks.pop();
188
         localTracks.pop();
189
     }
189
     }
190
-    JitsiMeetJS.createLocalTracks({devices: isVideo ? ['video'] : ['desktop']}).
191
-        then(function(tracks) {
190
+    JitsiMeetJS.createLocalTracks({devices: isVideo ? ['video'] : ['desktop']})
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,
194
                 function() {
194
                 function() {
249
     JitsiMeetJS.mediaDevices.addEventListener(JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED, onDeviceListChanged);
249
     JitsiMeetJS.mediaDevices.addEventListener(JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED, onDeviceListChanged);
250
 
250
 
251
     connection.connect();
251
     connection.connect();
252
-    JitsiMeetJS.createLocalTracks({devices: ['audio', 'video']}).
253
-        then(onLocalTracks).catch(function(error) {
252
+    JitsiMeetJS.createLocalTracks({devices: ['audio', 'video']})
253
+        .then(onLocalTracks).catch(function(error) {
254
             throw error;
254
             throw error;
255
         });
255
         });
256
 }).catch(function(error) {
256
 }).catch(function(error) {

+ 1
- 1
modules/RTC/RTCUtils.js Ver arquivo

1014
                 };
1014
                 };
1015
 
1015
 
1016
                 if(screenObtainer.isSupported()) {
1016
                 if(screenObtainer.isSupported()) {
1017
-                    deviceGUM['desktop'] = screenObtainer.obtainStream.bind(
1017
+                    deviceGUM.desktop = screenObtainer.obtainStream.bind(
1018
                         screenObtainer,
1018
                         screenObtainer,
1019
                         dsOptions);
1019
                         dsOptions);
1020
                 }
1020
                 }

+ 9
- 9
modules/xmpp/ChatRoom.js Ver arquivo

95
     }
95
     }
96
 
96
 
97
     initPresenceMap() {
97
     initPresenceMap() {
98
-        this.presMap['to'] = this.myroomjid;
99
-        this.presMap['xns'] = 'http://jabber.org/protocol/muc';
100
-        this.presMap['nodes'] = [];
101
-        this.presMap['nodes'].push({
98
+        this.presMap.to = this.myroomjid;
99
+        this.presMap.xns = 'http://jabber.org/protocol/muc';
100
+        this.presMap.nodes = [];
101
+        this.presMap.nodes.push({
102
             'tagName': 'user-agent',
102
             'tagName': 'user-agent',
103
             'value': navigator.userAgent,
103
             'value': navigator.userAgent,
104
             'attributes': {xmlns: 'http://jitsi.org/jitmeet/user-agent'}
104
             'attributes': {xmlns: 'http://jitsi.org/jitmeet/user-agent'}
109
     }
109
     }
110
 
110
 
111
     updateDeviceAvailability(devices) {
111
     updateDeviceAvailability(devices) {
112
-        this.presMap['nodes'].push({
112
+        this.presMap.nodes.push({
113
             'tagName': 'devices',
113
             'tagName': 'devices',
114
             'children': [
114
             'children': [
115
                 {
115
                 {
133
     }
133
     }
134
 
134
 
135
     sendPresence(fromJoin) {
135
     sendPresence(fromJoin) {
136
-        var to = this.presMap['to'];
136
+        var to = this.presMap.to;
137
         if (!to || (!this.joined && !fromJoin)) {
137
         if (!to || (!this.joined && !fromJoin)) {
138
             // Too early to send presence - not initialized
138
             // Too early to send presence - not initialized
139
             return;
139
             return;
147
         // as joining, and server can send us the message history for the room on
147
         // as joining, and server can send us the message history for the room on
148
         // every presence
148
         // every presence
149
         if (fromJoin) {
149
         if (fromJoin) {
150
-            pres.c('x', {xmlns: this.presMap['xns']});
150
+            pres.c('x', {xmlns: this.presMap.xns});
151
 
151
 
152
             if (this.password) {
152
             if (this.password) {
153
                 pres.c('password').t(this.password).up();
153
                 pres.c('password').t(this.password).up();
774
             const videoTypeNode = filterNodeFromPresenceJSON(pres, 'videoType');
774
             const videoTypeNode = filterNodeFromPresenceJSON(pres, 'videoType');
775
 
775
 
776
             if(videoTypeNode.length > 0) {
776
             if(videoTypeNode.length > 0) {
777
-                data.videoType = videoTypeNode[0]['value'];
777
+                data.videoType = videoTypeNode[0].value;
778
             }
778
             }
779
         } else {
779
         } else {
780
             logger.error('Unsupported media type: ' + mediaType);
780
             logger.error('Unsupported media type: ' + mediaType);
781
             return null;
781
             return null;
782
         }
782
         }
783
 
783
 
784
-        data.muted = mutedNode.length > 0 && mutedNode[0]['value'] === 'true';
784
+        data.muted = mutedNode.length > 0 && mutedNode[0].value === 'true';
785
 
785
 
786
         return data;
786
         return data;
787
     }
787
     }

+ 8
- 8
modules/xmpp/JingleSessionPC.js Ver arquivo

1444
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1444
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1445
      */
1445
      */
1446
     fixSourceAddJingle(jingle) {
1446
     fixSourceAddJingle(jingle) {
1447
-        let ssrcs = this.modifiedSSRCs['unmute'];
1448
-        this.modifiedSSRCs['unmute'] = [];
1447
+        let ssrcs = this.modifiedSSRCs.unmute;
1448
+        this.modifiedSSRCs.unmute = [];
1449
         if (ssrcs && ssrcs.length) {
1449
         if (ssrcs && ssrcs.length) {
1450
             ssrcs.forEach(function(ssrcObj) {
1450
             ssrcs.forEach(function(ssrcObj) {
1451
                 const desc = $(jingle.tree()).find('>jingle>content[name="'
1451
                 const desc = $(jingle.tree()).find('>jingle>content[name="'
1467
             });
1467
             });
1468
         }
1468
         }
1469
 
1469
 
1470
-        ssrcs = this.modifiedSSRCs['addMuted'];
1471
-        this.modifiedSSRCs['addMuted'] = [];
1470
+        ssrcs = this.modifiedSSRCs.addMuted;
1471
+        this.modifiedSSRCs.addMuted = [];
1472
         if (ssrcs && ssrcs.length) {
1472
         if (ssrcs && ssrcs.length) {
1473
             ssrcs.forEach(function(ssrcObj) {
1473
             ssrcs.forEach(function(ssrcObj) {
1474
                 const desc
1474
                 const desc
1514
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1514
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1515
      */
1515
      */
1516
     fixSourceRemoveJingle(jingle) {
1516
     fixSourceRemoveJingle(jingle) {
1517
-        let ssrcs = this.modifiedSSRCs['mute'];
1518
-        this.modifiedSSRCs['mute'] = [];
1517
+        let ssrcs = this.modifiedSSRCs.mute;
1518
+        this.modifiedSSRCs.mute = [];
1519
         if (ssrcs && ssrcs.length) {
1519
         if (ssrcs && ssrcs.length) {
1520
             ssrcs.forEach(function(ssrcObj) {
1520
             ssrcs.forEach(function(ssrcObj) {
1521
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1521
                 ssrcObj.ssrcs.forEach(function(ssrc) {
1537
             });
1537
             });
1538
         }
1538
         }
1539
 
1539
 
1540
-        ssrcs = this.modifiedSSRCs['remove'];
1541
-        this.modifiedSSRCs['remove'] = [];
1540
+        ssrcs = this.modifiedSSRCs.remove;
1541
+        this.modifiedSSRCs.remove = [];
1542
         if (ssrcs && ssrcs.length) {
1542
         if (ssrcs && ssrcs.length) {
1543
             ssrcs.forEach(function(ssrcObj) {
1543
             ssrcs.forEach(function(ssrcObj) {
1544
                 const desc
1544
                 const desc

+ 1
- 1
modules/xmpp/xmpp.js Ver arquivo

237
      * @param options {object} connecting options - rid, sid, jid and password.
237
      * @param options {object} connecting options - rid, sid, jid and password.
238
      */
238
      */
239
     attach(options) {
239
     attach(options) {
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,

Carregando…
Cancelar
Salvar