@@ -151,7 +151,10 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
151
151
</ div >
152
152
</ div >
153
153
< script >
154
- const byId = sel => document . getElementById ( sel ) ;
154
+ function byId ( sel ) {
155
+ return document . getElementById ( sel ) ;
156
+ }
157
+
155
158
window . addEventListener ( 'load' , ( ) => {
156
159
function notifyUpdate ( sw ) {
157
160
const btn = byId ( 'btn-tab-update' ) ;
@@ -167,7 +170,7 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
167
170
}
168
171
if ( 'serviceWorker' in navigator ) {
169
172
navigator . serviceWorker . register ( 'service.worker.js' ) . then (
170
- reg => {
173
+ ( reg ) => {
171
174
if ( reg . waiting ) {
172
175
notifyUpdate ( reg . waiting ) ;
173
176
}
@@ -220,9 +223,7 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
220
223
localStorage . setItem ( 'welcomeModalDismissed' , 'true' ) ;
221
224
}
222
225
}
223
- </ script >
224
- < script src ="redot.editor.js "> </ script >
225
- < script >
226
+
226
227
let editor = null ;
227
228
let game = null ;
228
229
let setStatusMode ;
@@ -234,8 +235,8 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
234
235
return new Promise ( ( resolve , reject ) => {
235
236
const req = indexedDB . deleteDatabase ( path ) ;
236
237
req . onsuccess = ( ) => resolve ( ) ;
237
- req . onerror = err => reject ( err ) ;
238
- req . onblocked = err => reject ( err ) ;
238
+ req . onerror = ( err ) => reject ( err ) ;
239
+ req . onblocked = ( err ) => reject ( err ) ;
239
240
} ) ;
240
241
}
241
242
if ( ! window . confirm ( 'Are you sure you want to delete all the locally stored files?\nClicking "OK" will permanently remove your projects and editor settings!' ) ) {
@@ -262,11 +263,11 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
262
263
byId ( 'tab-game' ) ,
263
264
] ;
264
265
function showTab ( name ) {
265
- tabsLink . forEach ( elem => {
266
+ tabsLink . forEach ( ( elem ) => {
266
267
elem . parentElement . classList . toggle ( 'active' , elem . id === `btn-tab-${ name } ` ) ;
267
268
} ) ;
268
269
269
- tabsContent . forEach ( elem => {
270
+ tabsContent . forEach ( ( elem ) => {
270
271
if ( elem . id === `tab-${ name } ` ) {
271
272
elem . style . display = '' ;
272
273
@@ -372,14 +373,14 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
372
373
}
373
374
}
374
375
375
- setStatusMode = mode => {
376
+ setStatusMode = ( mode ) => {
376
377
if ( statusMode === mode || ! initializing ) {
377
378
return ;
378
379
}
379
380
[ statusProgress , statusIndeterminate , statusNotice ] . forEach ( ( elem ) => {
380
381
elem . style . display = 'none' ;
381
382
} ) ;
382
- animationCallbacks = animationCallbacks . filter ( value => ( value !== animateStatusIndeterminate ) ) ;
383
+ animationCallbacks = animationCallbacks . filter ( ( value ) => ( value !== animateStatusIndeterminate ) ) ;
383
384
switch ( mode ) {
384
385
case 'progress' :
385
386
statusProgress . style . display = 'block' ;
@@ -428,8 +429,8 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
428
429
setLoaderEnabled ( true ) ;
429
430
} ;
430
431
function Execute ( args ) {
431
- const is_editor = args . filter ( v => v === '--editor' || v === '-e' ) . length !== 0 ;
432
- const is_project_manager = args . filter ( v => v === '--project-manager' ) . length !== 0 ;
432
+ const is_editor = args . filter ( ( v ) => v === '--editor' || v === '-e' ) . length !== 0 ;
433
+ const is_project_manager = args . filter ( ( v ) => v === '--project-manager' ) . length !== 0 ;
433
434
const is_game = ! is_editor && ! is_project_manager ;
434
435
if ( video_driver ) {
435
436
args . push ( '--rendering-driver' , video_driver ) ;
@@ -539,17 +540,19 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
539
540
}
540
541
}
541
542
542
- async function preloadZip ( target ) {
543
+ function preloadZip ( target ) {
543
544
if ( target . files . length > 0 ) {
544
545
return target . files [ 0 ] . arrayBuffer ( ) ;
545
546
}
547
+ return Promise . resolve ( null ) ;
546
548
}
547
549
548
550
byId ( 'startButton' ) . onclick = ( ) => {
549
- preloadZip ( byId ( 'zip-file' ) ) . then ( zip => {
551
+ preloadZip ( byId ( 'zip-file' ) ) . then ( ( zip ) => {
550
552
startEditor ( zip ) ;
551
553
} ) ;
552
554
} ;
553
555
</ script >
556
+ < script src ="redot.editor.js "> </ script >
554
557
</ body >
555
558
</ html >
0 commit comments