Browse Source

[eslint] consistent-this

dev1
Lyubo Marinov 8 years ago
parent
commit
3deb625337

+ 1
- 0
.eslintrc.js View File

159
         'comma-spacing': 2,
159
         'comma-spacing': 2,
160
         'comma-style': 2,
160
         'comma-style': 2,
161
         'computed-property-spacing': 2,
161
         'computed-property-spacing': 2,
162
+        'consistent-this': [ 'error', 'self' ],
162
         'eol-last': 2,
163
         'eol-last': 2,
163
         'func-names': 0,
164
         'func-names': 0,
164
         'func-style': 0,
165
         'func-style': 0,

+ 1
- 4
JitsiConference.js View File

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

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

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

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

86
     this.audioRecorder.stop();
86
     this.audioRecorder.stop();
87
 
87
 
88
     // and send all recorded audio the the transcription service
88
     // and send all recorded audio the the transcription service
89
-    const t = this;
90
-
91
     const callBack = blobCallBack.bind(this);
89
     const callBack = blobCallBack.bind(this);
92
 
90
 
93
     this.audioRecorder.getRecordingResults().forEach(recordingResult => {
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
     // set the state to "transcribing" so that maybeMerge() functions correctly
96
     // set the state to "transcribing" so that maybeMerge() functions correctly

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

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

Loading…
Cancel
Save