Browse Source

[eslint] consistent-this

dev1
Lyubo Marinov 8 years ago
parent
commit
3deb625337

+ 1
- 0
.eslintrc.js View File

@@ -159,6 +159,7 @@ module.exports = {
159 159
         'comma-spacing': 2,
160 160
         'comma-style': 2,
161 161
         'computed-property-spacing': 2,
162
+        'consistent-this': [ 'error', 'self' ],
162 163
         'eol-last': 2,
163 164
         'func-names': 0,
164 165
         'func-style': 0,

+ 1
- 4
JitsiConference.js View File

@@ -758,11 +758,8 @@ JitsiConference.prototype.lock = function(password) {
758 758
         return Promise.reject();
759 759
     }
760 760
 
761
-    const conference = this;
762
-
763
-
764 761
     return new Promise((resolve, reject) => {
765
-        conference.room.lockRoom(
762
+        this.room.lockRoom(
766 763
             password || '',
767 764
             () => resolve(),
768 765
             err => reject(err),

+ 3
- 6
modules/transcription/audioRecorder.js View File

@@ -252,17 +252,15 @@ audioRecorder.prototype.stop = function() {
252 252
  * link hacking to download all recorded audio streams
253 253
  */
254 254
 audioRecorder.prototype.download = function() {
255
-    const t = this;
256
-
257 255
     this.recorders.forEach(trackRecorder => {
258
-        const blob = new Blob(trackRecorder.data, { type: t.fileType });
256
+        const blob = new Blob(trackRecorder.data, { type: this.fileType });
259 257
         const url = URL.createObjectURL(blob);
260 258
         const a = document.createElement('a');
261 259
 
262 260
         document.body.appendChild(a);
263 261
         a.style = 'display: none';
264 262
         a.href = url;
265
-        a.download = `test.${t.fileType.split('/')[1]}`;
263
+        a.download = `test.${this.fileType.split('/')[1]}`;
266 264
         a.click();
267 265
         window.URL.revokeObjectURL(url);
268 266
     });
@@ -283,13 +281,12 @@ audioRecorder.prototype.getRecordingResults = function() {
283 281
     this.updateNames();
284 282
 
285 283
     const array = [];
286
-    const t = this;
287 284
 
288 285
     this.recorders.forEach(
289 286
           recorder =>
290 287
               array.push(
291 288
                   new RecordingResult(
292
-                      new Blob(recorder.data, { type: t.fileType }),
289
+                      new Blob(recorder.data, { type: this.fileType }),
293 290
                       recorder.name,
294 291
                       recorder.startTime)));
295 292
 

+ 2
- 4
modules/transcription/transcriber.js View File

@@ -86,13 +86,11 @@ transcriber.prototype.stop = function stop(callback) {
86 86
     this.audioRecorder.stop();
87 87
 
88 88
     // and send all recorded audio the the transcription service
89
-    const t = this;
90
-
91 89
     const callBack = blobCallBack.bind(this);
92 90
 
93 91
     this.audioRecorder.getRecordingResults().forEach(recordingResult => {
94
-        t.transcriptionService.send(recordingResult, callBack);
95
-        t.counter++;
92
+        this.transcriptionService.send(recordingResult, callBack);
93
+        this.counter++;
96 94
     });
97 95
 
98 96
     // set the state to "transcribing" so that maybeMerge() functions correctly

+ 2
- 4
modules/transcription/transcriptionServices/AbstractTranscriptionService.js View File

@@ -17,11 +17,9 @@ const TranscriptionService = function() {
17 17
  *        the answer as a WordArray
18 18
  */
19 19
 TranscriptionService.prototype.send = function send(recordingResult, callback) {
20
-    const t = this;
21
-
22 20
     this.sendRequest(recordingResult.blob, response => {
23
-        if (t.verify(response)) {
24
-            recordingResult.wordArray = t.formatResponse(response);
21
+        if (this.verify(response)) {
22
+            recordingResult.wordArray = this.formatResponse(response);
25 23
         } else {
26 24
             console.log('the retrieved response from the server is not valid!');
27 25
             recordingResult.wordArray = [];

Loading…
Cancel
Save