@@ -4,12 +4,12 @@ $(document).ready(function () {
4
4
/// Globals and initializations
5
5
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6
6
7
- var Editors = new EditorsHandler ( ) ;
8
- var Modals = new ModalsHandler ( ) ;
9
- var IdeSettings = new IdeSettingsHandler ( ) ;
10
- var Sidebar = new SidebarHandler ( ) ;
11
- var Notifications = new NotificationsHandler ( ) ;
12
- var Files = new FilesHandler ( ) ;
7
+ let Editors = new EditorsHandler ( ) ;
8
+ let Modals = new ModalsHandler ( ) ;
9
+ let IdeSettings = new IdeSettingsHandler ( ) ;
10
+ let Sidebar = new SidebarHandler ( ) ;
11
+ let Notifications = new NotificationsHandler ( ) ;
12
+ let Files = new FilesHandler ( ) ;
13
13
14
14
Notifications . init ( ) ;
15
15
Files . init ( Notifications ) ;
@@ -46,8 +46,8 @@ $(document).ready(function () {
46
46
// Push the template into the modal before showing it
47
47
$ ( document ) . on ( 'show.bs.modal' , '.modal' , function ( e ) {
48
48
49
- var $relTgt = $ ( e . relatedTarget ) ;
50
- var callback = function ( ) {
49
+ let $relTgt = $ ( e . relatedTarget ) ;
50
+ let callback = function ( ) {
51
51
} ;
52
52
53
53
if ( $relTgt . hasClass ( 'modal-ide-settings' ) || $relTgt . hasClass ( 'modal-ide-appearance' ) ) {
@@ -79,7 +79,7 @@ $(document).ready(function () {
79
79
// Remove the template from the modal after closing it
80
80
$ ( document ) . on ( 'hide.bs.modal' , '.modal' , function ( e ) {
81
81
Modals . onHideBs ( e . currentTarget ) ;
82
- var aceEditor = Editors . getCurrentEditor ( ) ;
82
+ let aceEditor = Editors . getCurrentEditor ( ) ;
83
83
if ( typeof aceEditor !== typeof undefined ) {
84
84
aceEditor . focus ( ) ;
85
85
}
@@ -106,7 +106,7 @@ $(document).ready(function () {
106
106
// New tab
107
107
$ ( document ) . on ( 'click' , '.action-add-tab' , function ( ) {
108
108
109
- var fileType = $ ( this ) . attr ( 'data-type' ) ;
109
+ let fileType = $ ( this ) . attr ( 'data-type' ) ;
110
110
if ( typeof fileType === typeof undefined || ! fileType ) {
111
111
fileType = Editors . defaultFileExt ;
112
112
}
@@ -117,8 +117,8 @@ $(document).ready(function () {
117
117
// Save file
118
118
$ ( document ) . on ( 'click' , '.action-save' , function ( ) {
119
119
120
- var attr = $ ( this ) . attr ( 'data-idx' ) ;
121
- var idx = ( typeof attr !== typeof undefined && attr !== false ) ? attr : Editors . currentIdx ;
120
+ let attr = $ ( this ) . attr ( 'data-idx' ) ;
121
+ let idx = ( typeof attr !== typeof undefined && attr !== false ) ? attr : Editors . currentIdx ;
122
122
123
123
Editors . onSaveFile ( idx ) ;
124
124
} ) ;
@@ -167,7 +167,7 @@ $(document).ready(function () {
167
167
168
168
// Rename file
169
169
$ ( document ) . on ( '_file.rename' , function ( e ) {
170
- var callback = function ( fileEntry ) {
170
+ let callback = function ( fileEntry ) {
171
171
Files . fileRename ( fileEntry , e . oldFileName , e . newFileName ) . then ( function ( fileEntry ) {
172
172
if ( typeof fileEntry !== typeof undefined ) {
173
173
Editors . onRenameFile ( e . idx , fileEntry ) ;
@@ -186,7 +186,7 @@ $(document).ready(function () {
186
186
} ) ;
187
187
} ;
188
188
189
- var fileEntry = Editors . getEditorDataObj ( e . idx ) ;
189
+ let fileEntry = Editors . getEditorDataObj ( e . idx ) ;
190
190
if ( typeof fileEntry === typeof undefined && typeof e . nodeId !== typeof undefined ) {
191
191
Sidebar . onNodeClick ( e . nodeId ) . then ( function ( idx , fileEntry ) {
192
192
e . idx = idx ;
@@ -219,63 +219,63 @@ $(document).ready(function () {
219
219
220
220
// Perform search on current active editor
221
221
$ ( document ) . on ( 'click' , '.action-search' , function ( ) {
222
- var aceEditor = Editors . getCurrentEditor ( ) ;
222
+ let aceEditor = Editors . getCurrentEditor ( ) ;
223
223
if ( typeof aceEditor !== typeof undefined ) {
224
224
aceEditor . execCommand ( 'find' ) ;
225
225
}
226
226
} ) ;
227
227
228
228
// Perform undo on current active editor
229
229
$ ( document ) . on ( 'click' , '.action-undo' , function ( ) {
230
- var aceEditor = Editors . getCurrentEditor ( ) ;
230
+ let aceEditor = Editors . getCurrentEditor ( ) ;
231
231
if ( typeof aceEditor !== typeof undefined ) {
232
232
aceEditor . undo ( ) ;
233
233
}
234
234
} ) ;
235
235
236
236
// Perform redo on current active editor
237
237
$ ( document ) . on ( 'click' , '.action-redo' , function ( ) {
238
- var aceEditor = Editors . getCurrentEditor ( ) ;
238
+ let aceEditor = Editors . getCurrentEditor ( ) ;
239
239
if ( typeof aceEditor !== typeof undefined ) {
240
240
aceEditor . redo ( ) ;
241
241
}
242
242
} ) ;
243
243
244
244
// Perform cut on current active editor
245
245
$ ( document ) . on ( 'click' , '.action-cut' , function ( ) {
246
- var aceEditor = Editors . getCurrentEditor ( ) ;
246
+ let aceEditor = Editors . getCurrentEditor ( ) ;
247
247
if ( typeof aceEditor !== typeof undefined ) {
248
248
aceEditor . execCommand ( 'cut' ) ;
249
249
}
250
250
} ) ;
251
251
252
252
// Perform copy on current active editor
253
253
$ ( document ) . on ( 'click' , '.action-copy' , function ( ) {
254
- var aceEditor = Editors . getCurrentEditor ( ) ;
254
+ let aceEditor = Editors . getCurrentEditor ( ) ;
255
255
if ( typeof aceEditor !== typeof undefined ) {
256
256
aceEditor . execCommand ( 'copy' ) ;
257
257
}
258
258
} ) ;
259
259
260
260
// Perform paste to current active editor
261
261
$ ( document ) . on ( 'click' , '.action-paste' , function ( ) {
262
- var aceEditor = Editors . getCurrentEditor ( ) ;
262
+ let aceEditor = Editors . getCurrentEditor ( ) ;
263
263
if ( typeof aceEditor !== typeof undefined && Editors . aceClipboard . length > 0 ) {
264
264
aceEditor . execCommand ( 'paste' , Editors . aceClipboard ) ;
265
265
}
266
266
} ) ;
267
267
268
268
// Perform select all
269
269
$ ( document ) . on ( 'click' , '.action-select-all' , function ( ) {
270
- var aceEditor = Editors . getCurrentEditor ( ) ;
270
+ let aceEditor = Editors . getCurrentEditor ( ) ;
271
271
if ( typeof aceEditor !== typeof undefined ) {
272
272
aceEditor . execCommand ( 'selectall' ) ;
273
273
}
274
274
} ) ;
275
275
276
276
// Perform fold all current active editor
277
277
$ ( document ) . on ( 'click' , '.action-fold-all' , function ( ) {
278
- var aceEditor = Editors . getCurrentEditor ( ) ;
278
+ let aceEditor = Editors . getCurrentEditor ( ) ;
279
279
if ( typeof aceEditor !== typeof undefined ) {
280
280
aceEditor . focus ( ) ;
281
281
aceEditor . getSession ( ) . foldAll ( ) ;
@@ -284,7 +284,7 @@ $(document).ready(function () {
284
284
285
285
// Perform unfold all current active editor
286
286
$ ( document ) . on ( 'click' , '.action-unfold-all' , function ( ) {
287
- var aceEditor = Editors . getCurrentEditor ( ) ;
287
+ let aceEditor = Editors . getCurrentEditor ( ) ;
288
288
if ( typeof aceEditor !== typeof undefined ) {
289
289
aceEditor . focus ( ) ;
290
290
aceEditor . getSession ( ) . unfold ( ) ;
@@ -298,39 +298,39 @@ $(document).ready(function () {
298
298
299
299
// Perform minimize
300
300
$ ( document ) . on ( 'click' , '.action-minimize' , function ( ) {
301
- var aceEditor = Editors . getCurrentEditor ( ) ;
301
+ let aceEditor = Editors . getCurrentEditor ( ) ;
302
302
if ( typeof aceEditor !== typeof undefined ) {
303
303
aceEditor . execCommand ( '__minimize' ) ;
304
304
}
305
305
} ) ;
306
306
307
307
// Perform maximize
308
308
$ ( document ) . on ( 'click' , '.action-maximize' , function ( ) {
309
- var aceEditor = Editors . getCurrentEditor ( ) ;
309
+ let aceEditor = Editors . getCurrentEditor ( ) ;
310
310
if ( typeof aceEditor !== typeof undefined ) {
311
311
aceEditor . execCommand ( '__maximize' ) ;
312
312
}
313
313
} ) ;
314
314
315
315
// Perform fullscreen
316
316
$ ( document ) . on ( 'click' , '.action-fullscreen' , function ( ) {
317
- var aceEditor = Editors . getCurrentEditor ( ) ;
317
+ let aceEditor = Editors . getCurrentEditor ( ) ;
318
318
if ( typeof aceEditor !== typeof undefined ) {
319
319
aceEditor . execCommand ( '__fullscreen' ) ;
320
320
}
321
321
} ) ;
322
322
323
323
// Perform font increase
324
324
$ ( document ) . on ( 'click' , '.action-font-increase' , function ( ) {
325
- var aceEditor = Editors . getCurrentEditor ( ) ;
325
+ let aceEditor = Editors . getCurrentEditor ( ) ;
326
326
if ( typeof aceEditor !== typeof undefined ) {
327
327
aceEditor . execCommand ( '__fontIncrease' ) ;
328
328
}
329
329
} ) ;
330
330
331
331
// Perform font decrease
332
332
$ ( document ) . on ( 'click' , '.action-font-decrease' , function ( ) {
333
- var aceEditor = Editors . getCurrentEditor ( ) ;
333
+ let aceEditor = Editors . getCurrentEditor ( ) ;
334
334
if ( typeof aceEditor !== typeof undefined ) {
335
335
aceEditor . execCommand ( '__fontDecrease' ) ;
336
336
}
@@ -345,15 +345,15 @@ $(document).ready(function () {
345
345
346
346
// Toggle read only mode on current active tab
347
347
$ ( document ) . on ( 'click' , '.action-toggle-readonly' , function ( ) {
348
- var aceEditor = Editors . getCurrentEditor ( ) ;
348
+ let aceEditor = Editors . getCurrentEditor ( ) ;
349
349
if ( typeof aceEditor !== typeof undefined ) {
350
350
Editors . onToggleReadOnly ( Editors . currentIdx ) ;
351
351
}
352
352
} ) ;
353
353
354
354
// Toggle read only mode on all tabs
355
355
$ ( document ) . on ( 'click' , '.action-toggle-readonly-all' , function ( ) {
356
- var aceEditor = Editors . getCurrentEditor ( ) ;
356
+ let aceEditor = Editors . getCurrentEditor ( ) ;
357
357
if ( typeof aceEditor !== typeof undefined ) {
358
358
Editors . onToggleReadOnly ( ) ;
359
359
}
@@ -366,7 +366,7 @@ $(document).ready(function () {
366
366
/// Sidebar
367
367
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
368
368
369
- var $aside = $ ( 'aside' ) ;
369
+ let $aside = $ ( 'aside' ) ;
370
370
371
371
// Enable resizable sidebar
372
372
$aside . resizable ( {
0 commit comments