Browse Source

Merge branch 'eslint_improvements-2'

master
Lyubo Marinov 8 years ago
parent
commit
0ccc7ce5f0

+ 2
- 0
.eslintrc.js View File

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

+ 1
- 1
JitsiConference.js View File

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

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

@@ -187,8 +187,8 @@ function switchVideo() { // eslint-disable-line no-unused-vars
187 187
         localTracks[1].dispose();
188 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 192
             localTracks.push(tracks[0]);
193 193
             localTracks[1].addEventListener(JitsiMeetJS.events.track.TRACK_MUTE_CHANGED,
194 194
                 function() {
@@ -249,8 +249,8 @@ JitsiMeetJS.init(initOptions).then(function() {
249 249
     JitsiMeetJS.mediaDevices.addEventListener(JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED, onDeviceListChanged);
250 250
 
251 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 254
             throw error;
255 255
         });
256 256
 }).catch(function(error) {

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

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

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

@@ -95,10 +95,10 @@ export default class ChatRoom extends Listenable {
95 95
     }
96 96
 
97 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 102
             'tagName': 'user-agent',
103 103
             'value': navigator.userAgent,
104 104
             'attributes': {xmlns: 'http://jitsi.org/jitmeet/user-agent'}
@@ -109,7 +109,7 @@ export default class ChatRoom extends Listenable {
109 109
     }
110 110
 
111 111
     updateDeviceAvailability(devices) {
112
-        this.presMap['nodes'].push({
112
+        this.presMap.nodes.push({
113 113
             'tagName': 'devices',
114 114
             'children': [
115 115
                 {
@@ -133,7 +133,7 @@ export default class ChatRoom extends Listenable {
133 133
     }
134 134
 
135 135
     sendPresence(fromJoin) {
136
-        var to = this.presMap['to'];
136
+        var to = this.presMap.to;
137 137
         if (!to || (!this.joined && !fromJoin)) {
138 138
             // Too early to send presence - not initialized
139 139
             return;
@@ -147,7 +147,7 @@ export default class ChatRoom extends Listenable {
147 147
         // as joining, and server can send us the message history for the room on
148 148
         // every presence
149 149
         if (fromJoin) {
150
-            pres.c('x', {xmlns: this.presMap['xns']});
150
+            pres.c('x', {xmlns: this.presMap.xns});
151 151
 
152 152
             if (this.password) {
153 153
                 pres.c('password').t(this.password).up();
@@ -774,14 +774,14 @@ export default class ChatRoom extends Listenable {
774 774
             const videoTypeNode = filterNodeFromPresenceJSON(pres, 'videoType');
775 775
 
776 776
             if(videoTypeNode.length > 0) {
777
-                data.videoType = videoTypeNode[0]['value'];
777
+                data.videoType = videoTypeNode[0].value;
778 778
             }
779 779
         } else {
780 780
             logger.error('Unsupported media type: ' + mediaType);
781 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 786
         return data;
787 787
     }

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

@@ -1444,8 +1444,8 @@ export default class JingleSessionPC extends JingleSession {
1444 1444
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1445 1445
      */
1446 1446
     fixSourceAddJingle(jingle) {
1447
-        let ssrcs = this.modifiedSSRCs['unmute'];
1448
-        this.modifiedSSRCs['unmute'] = [];
1447
+        let ssrcs = this.modifiedSSRCs.unmute;
1448
+        this.modifiedSSRCs.unmute = [];
1449 1449
         if (ssrcs && ssrcs.length) {
1450 1450
             ssrcs.forEach(function(ssrcObj) {
1451 1451
                 const desc = $(jingle.tree()).find('>jingle>content[name="'
@@ -1467,8 +1467,8 @@ export default class JingleSessionPC extends JingleSession {
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 1472
         if (ssrcs && ssrcs.length) {
1473 1473
             ssrcs.forEach(function(ssrcObj) {
1474 1474
                 const desc
@@ -1514,8 +1514,8 @@ export default class JingleSessionPC extends JingleSession {
1514 1514
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1515 1515
      */
1516 1516
     fixSourceRemoveJingle(jingle) {
1517
-        let ssrcs = this.modifiedSSRCs['mute'];
1518
-        this.modifiedSSRCs['mute'] = [];
1517
+        let ssrcs = this.modifiedSSRCs.mute;
1518
+        this.modifiedSSRCs.mute = [];
1519 1519
         if (ssrcs && ssrcs.length) {
1520 1520
             ssrcs.forEach(function(ssrcObj) {
1521 1521
                 ssrcObj.ssrcs.forEach(function(ssrc) {
@@ -1537,8 +1537,8 @@ export default class JingleSessionPC extends JingleSession {
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 1542
         if (ssrcs && ssrcs.length) {
1543 1543
             ssrcs.forEach(function(ssrcObj) {
1544 1544
                 const desc

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

@@ -237,7 +237,7 @@ export default class XMPP extends Listenable {
237 237
      * @param options {object} connecting options - rid, sid, jid and password.
238 238
      */
239 239
     attach(options) {
240
-        const now = this.connectionTimes['attaching'] = window.performance.now();
240
+        const now = this.connectionTimes.attaching = window.performance.now();
241 241
         logger.log('(TIME) Strophe Attaching\t:' + now);
242 242
         this.connection.attach(options.jid, options.sid,
243 243
             parseInt(options.rid,10) + 1,

Loading…
Cancel
Save