sunrize 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict"
1
+ "use strict";
2
2
 
3
3
  const
4
4
  electron = require ("electron"),
@@ -11,39 +11,39 @@ const
11
11
  Template = require ("./Template"),
12
12
  LocalStorage = require ("node-localstorage") .LocalStorage,
13
13
  DataStorage = require ("../Application/DataStorage"),
14
- _ = require ("../Application/GetText")
14
+ _ = require ("../Application/GetText");
15
15
 
16
16
  // Use electron@15.3
17
17
 
18
- const localStorage = new LocalStorage (path .join (electron .app .getPath ("userData"), "Global Storage"))
18
+ const localStorage = new LocalStorage (path .join (electron .app .getPath ("userData"), "Global Storage"));
19
19
 
20
20
  module .exports = class Application
21
21
  {
22
- config = new DataStorage (localStorage, "Sunrize.Application.")
23
- mainMenu = [ ]
24
- openURLValue = ""
25
- exportPath = new Map ()
22
+ config = new DataStorage (localStorage, "Sunrize.Application.");
23
+ mainMenu = [ ];
24
+ openURLValue = "";
25
+ exportPath = new Map ();
26
26
 
27
27
  static run ()
28
28
  {
29
29
  if (electron .app .requestSingleInstanceLock ())
30
- new this ()
30
+ new this ();
31
31
  else
32
- electron .app .quit ()
32
+ electron .app .quit ();
33
33
  }
34
34
 
35
35
  constructor ()
36
36
  {
37
37
  if (process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT")
38
- process .env .ELECTRON_ENABLE_LOGGING = 1
38
+ process .env .ELECTRON_ENABLE_LOGGING = 1;
39
39
 
40
- process .env .ELECTRON_DISABLE_SECURITY_WARNINGS = "true"
40
+ process .env .ELECTRON_DISABLE_SECURITY_WARNINGS = "true";
41
41
 
42
42
  this .menuOptions = {
43
43
  defaultEditMenu: false,
44
44
  undoLabel: _ ("Undo"),
45
45
  redoLabel: _ ("Redo"),
46
- }
46
+ };
47
47
 
48
48
  this .config .setDefaultValues ({
49
49
  position: [undefined, undefined],
@@ -58,82 +58,84 @@ module .exports = class Application
58
58
  textureQuality: "MEDIUM",
59
59
  rubberband: true,
60
60
  timings: false,
61
- })
61
+ });
62
62
 
63
- Template .create (path .join (__dirname, "../assets/html/application-template.html"))
64
- Template .create (path .join (__dirname, "../assets/html/window-template.html"))
65
- Template .create (path .join (__dirname, "../assets/themes/default-template.css"))
66
- Template .create (path .join (__dirname, "../assets/themes/prompt-template.css"))
63
+ Template .create (path .join (__dirname, "../assets/html/application-template.html"));
64
+ Template .create (path .join (__dirname, "../assets/html/window-template.html"));
65
+ Template .create (path .join (__dirname, "../assets/themes/default-template.css"));
66
+ Template .create (path .join (__dirname, "../assets/themes/prompt-template.css"));
67
67
 
68
- this .setup ()
68
+ this .setup ();
69
69
  }
70
70
 
71
71
  async setup ()
72
72
  {
73
73
 
74
- await electron .app .whenReady ()
74
+ await electron .app .whenReady ();
75
75
 
76
- electron .app .on ("activate", (event) => this .activate ())
77
- electron .app .on ("new-window-for-tab", (event) => this .createWindow ())
78
- electron .app .on ("open-file", (event, filePath) => this .openFiles ([url .pathToFileURL (filePath) .href]))
79
- electron .app .on ("window-all-closed", (event) => this .quit ())
76
+ electron .app .on ("activate", (event) => this .activate ());
77
+ electron .app .on ("new-window-for-tab", (event) => this .createWindow ());
78
+ electron .app .on ("open-file", (event, filePath) => this .openFiles ([url .pathToFileURL (filePath) .href]));
79
+ electron .app .on ("window-all-closed", (event) => this .quit ());
80
80
 
81
- electron .ipcMain .on ("title", (event, title) => this .title = title)
82
- electron .ipcMain .on ("current-file", (event, currentFile) => this .currentFile = currentFile)
83
- electron .ipcMain .on ("save-file", (event, filePath) => this .saveFile (filePath))
84
- electron .ipcMain .on ("change-menu", (event, object) => this .updateMenu (object))
85
- electron .ipcMain .on ("context-menu", (event, id, menu) => this .contextMenu (id, menu))
81
+ electron .ipcMain .on ("title", (event, title) => this .title = title);
82
+ electron .ipcMain .on ("current-file", (event, currentFile) => this .currentFile = currentFile);
83
+ electron .ipcMain .on ("save-file", (event, filePath) => this .saveFile (filePath));
84
+ electron .ipcMain .on ("change-menu", (event, object) => this .updateMenu (object));
85
+ electron .ipcMain .on ("context-menu", (event, id, menu) => this .contextMenu (id, menu));
86
86
 
87
- electron .ipcMain .handle ("file-path", async (event, basename) => await this .showSaveDialog (basename))
88
- electron .ipcMain .handle ("fullname", async () => this .fullname)
87
+ electron .ipcMain .handle ("file-path", async (event, basename) => await this .showSaveDialog (basename));
88
+ electron .ipcMain .handle ("fullname", async () => this .fullname);
89
89
 
90
- this .fullname = await (await import ("fullname")) .default ()
90
+ this .fullname = await (await import ("fullname")) .default ();
91
91
 
92
- await this .updateMenu ()
93
- await this .createWindow ()
92
+ await this .updateMenu ();
93
+ await this .createWindow ();
94
94
 
95
- this .openFiles (process .argv .slice (2) .map (filePath => url .pathToFileURL (filePath) .href))
95
+ this .openFiles (process .argv .slice (2) .map (filePath => url .pathToFileURL (filePath) .href));
96
96
 
97
97
  electron .app .on ("second-instance", (event, argv, cwd) =>
98
98
  {
99
- this .openFiles (argv .slice (1) .filter (filePath => fs .existsSync (filePath) && fs .lstatSync (filePath) .isFile ()) .map (filePath => url .pathToFileURL (filePath) .href))
99
+ this .openFiles (argv .slice (1)
100
+ .filter (filePath => fs .existsSync (filePath) && fs .lstatSync (filePath) .isFile ())
101
+ .map (filePath => url .pathToFileURL (filePath) .href));
100
102
 
101
- this .mainWindow .show ()
102
- })
103
+ this .mainWindow .show ();
104
+ });
103
105
  }
104
106
 
105
107
  get applicationShouldQuitAfterLastWindowClosed ()
106
108
  {
107
- return true || process .platform !== "darwin" || process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT"
109
+ return true || process .platform !== "darwin" || process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT";
108
110
  }
109
111
 
110
112
  get title ()
111
113
  {
112
- return this .mainWindow .title
114
+ return this .mainWindow .title;
113
115
  }
114
116
 
115
117
  set title (title)
116
118
  {
117
- this .mainWindow .title = `${title} · Sunrize`
119
+ this .mainWindow .title = `${title} · Sunrize`;
118
120
  }
119
121
 
120
122
  pushMenu (menu)
121
123
  {
122
- this .mainMenu .push (menu)
124
+ this .mainMenu .push (menu);
123
125
  electron .Menu .setApplicationMenu (menu)
124
126
  }
125
127
 
126
128
  popMenu ()
127
129
  {
128
- this .mainMenu .pop ()
129
- electron .Menu .setApplicationMenu (this .mainMenu .at (-1))
130
+ this .mainMenu .pop ();
131
+ electron .Menu .setApplicationMenu (this .mainMenu .at (-1));
130
132
  }
131
133
 
132
134
  updateMenu (object = { })
133
135
  {
134
- Object .assign (this .menuOptions, object)
136
+ Object .assign (this .menuOptions, object);
135
137
 
136
- const exportPath = this .exportPath .get (this .currentFile)
138
+ const exportPath = this .exportPath .get (this .currentFile);
137
139
 
138
140
  const menu = electron .Menu .buildFromTemplate ([
139
141
  {
@@ -148,7 +150,7 @@ module .exports = class Application
148
150
  accelerator: "CmdOrCtrl+N",
149
151
  click: () =>
150
152
  {
151
- this .mainWindow .webContents .send ("open-files")
153
+ this .mainWindow .webContents .send ("open-files");
152
154
  },
153
155
  },
154
156
  { type: "separator" },
@@ -157,12 +159,12 @@ module .exports = class Application
157
159
  accelerator: "CmdOrCtrl+O",
158
160
  click: async () =>
159
161
  {
160
- const response = await this .showOpenDialog (this .currentFile)
162
+ const response = await this .showOpenDialog (this .currentFile);
161
163
 
162
164
  if (response .canceled)
163
- return
165
+ return;
164
166
 
165
- this .openFiles (response .filePaths .map (filePath => url .pathToFileURL (filePath) .href))
167
+ this .openFiles (response .filePaths .map (filePath => url .pathToFileURL (filePath) .href));
166
168
  },
167
169
  },
168
170
  {
@@ -170,7 +172,7 @@ module .exports = class Application
170
172
  accelerator: "Shift+CmdOrCtrl+O",
171
173
  click: async () =>
172
174
  {
173
- const clipboard = await this .clipboard ()
175
+ const clipboard = await this .clipboard ();
174
176
 
175
177
  this .pushMenu (electron .Menu .buildFromTemplate ([
176
178
  {
@@ -178,7 +180,7 @@ module .exports = class Application
178
180
  label: "Sunrize",
179
181
  },
180
182
  { role: "editMenu" },
181
- ]))
183
+ ]));
182
184
 
183
185
  const response = await prompt ({
184
186
  title: "Open URL...",
@@ -192,21 +194,21 @@ module .exports = class Application
192
194
  width: 500,
193
195
  customStylesheet: path .join (__dirname, "../assets/themes/prompt.css"),
194
196
  },
195
- this .mainWindow)
197
+ this .mainWindow);
196
198
 
197
- this .popMenu ()
199
+ this .popMenu ();
198
200
 
199
201
  if (response === null)
200
- return
202
+ return;
201
203
 
202
- this .openFiles ([this .openURLValue = response])
204
+ this .openFiles ([this .openURLValue = response]);
203
205
  },
204
206
  },
205
207
  {
206
- role: "recentdocuments",
208
+ role: "recentDocuments",
207
209
  submenu: [
208
210
  {
209
- role: "clearrecentdocuments",
211
+ role: "clearRecentDocuments",
210
212
  },
211
213
  ],
212
214
  },
@@ -216,7 +218,7 @@ module .exports = class Application
216
218
  accelerator: "CmdOrCtrl+S",
217
219
  click: () =>
218
220
  {
219
- this .mainWindow .webContents .send ("save-file")
221
+ this .mainWindow .webContents .send ("save-file");
220
222
  },
221
223
  },
222
224
  {
@@ -224,28 +226,28 @@ module .exports = class Application
224
226
  accelerator: "Shift+CmdOrCtrl+S",
225
227
  click: async () =>
226
228
  {
227
- const response = await this .showSaveDialog (this .currentFile)
229
+ const response = await this .showSaveDialog (this .currentFile);
228
230
 
229
231
  if (response .canceled)
230
- return
232
+ return;
231
233
 
232
- electron .app .addRecentDocument (response .filePath)
234
+ electron .app .addRecentDocument (response .filePath);
233
235
 
234
- this .mainWindow .webContents .send ("save-file-as", response .filePath)
236
+ this .mainWindow .webContents .send ("save-file-as", response .filePath);
235
237
  },
236
238
  },
237
239
  {
238
240
  label: _ ("Save Copy As..."),
239
241
  click: async () =>
240
242
  {
241
- const response = await this .showSaveDialog (this .currentFile)
243
+ const response = await this .showSaveDialog (this .currentFile);
242
244
 
243
245
  if (response .canceled)
244
- return
246
+ return;
245
247
 
246
- electron .app .addRecentDocument (response .filePath)
248
+ electron .app .addRecentDocument (response .filePath);
247
249
 
248
- this .mainWindow .webContents .send ("save-copy-as", response .filePath)
250
+ this .mainWindow .webContents .send ("save-copy-as", response .filePath);
249
251
  },
250
252
  },
251
253
  {
@@ -253,7 +255,7 @@ module .exports = class Application
253
255
  accelerator: "Alt+CmdOrCtrl+S",
254
256
  click: () =>
255
257
  {
256
- this .mainWindow .webContents .send ("save-all-files")
258
+ this .mainWindow .webContents .send ("save-all-files");
257
259
  },
258
260
  },
259
261
  { type: "separator" },
@@ -263,8 +265,8 @@ module .exports = class Application
263
265
  checked: this .config .autoSave,
264
266
  click: () =>
265
267
  {
266
- this .config .autoSave = !this .config .autoSave
267
- this .mainWindow .webContents .send ("auto-save", this .config .autoSave)
268
+ this .config .autoSave = !this .config .autoSave;
269
+ this .mainWindow .webContents .send ("auto-save", this .config .autoSave);
268
270
  },
269
271
 
270
272
  },
@@ -276,9 +278,9 @@ module .exports = class Application
276
278
  accelerator: "CmdOrCtrl+E",
277
279
  click: async () =>
278
280
  {
279
- const exportPath = this .exportPath .get (this .currentFile)
281
+ const exportPath = this .exportPath .get (this .currentFile);
280
282
 
281
- this .mainWindow .webContents .send ("export-as", exportPath)
283
+ this .mainWindow .webContents .send ("export-as", exportPath);
282
284
  },
283
285
  }
284
286
  ] : [ ],
@@ -287,18 +289,18 @@ module .exports = class Application
287
289
  accelerator: "Shift+CmdOrCtrl+E",
288
290
  click: async () =>
289
291
  {
290
- const response = await this .showExportDialog (this .currentFile)
292
+ const response = await this .showExportDialog (this .currentFile);
291
293
 
292
294
  if (response .canceled)
293
- return
295
+ return;
294
296
 
295
- electron .app .addRecentDocument (response .filePath)
297
+ electron .app .addRecentDocument (response .filePath);
296
298
 
297
- this .exportPath .set (this .currentFile, response .filePath)
299
+ this .exportPath .set (this .currentFile, response .filePath);
298
300
 
299
- this .mainWindow .webContents .send ("export-as", response .filePath)
301
+ this .mainWindow .webContents .send ("export-as", response .filePath);
300
302
 
301
- this .updateMenu ()
303
+ this .updateMenu ();
302
304
  },
303
305
  },
304
306
  { type: "separator" },
@@ -307,7 +309,7 @@ module .exports = class Application
307
309
  accelerator: "CmdOrCtrl+I",
308
310
  click: () =>
309
311
  {
310
- this .mainWindow .webContents .send ("scene-properties")
312
+ this .mainWindow .webContents .send ("scene-properties");
311
313
  },
312
314
  },
313
315
  { type: "separator" },
@@ -326,7 +328,7 @@ module .exports = class Application
326
328
  enabled: this .menuOptions .undoLabel !== _ ("Undo"),
327
329
  click: () =>
328
330
  {
329
- this .mainWindow .webContents .send ("undo")
331
+ this .mainWindow .webContents .send ("undo");
330
332
  },
331
333
  },
332
334
  {
@@ -335,7 +337,7 @@ module .exports = class Application
335
337
  enabled: this .menuOptions .redoLabel !== _ ("Redo"),
336
338
  click: () =>
337
339
  {
338
- this .mainWindow .webContents .send ("redo")
340
+ this .mainWindow .webContents .send ("redo");
339
341
  },
340
342
  },
341
343
  { type: "separator" },
@@ -344,7 +346,7 @@ module .exports = class Application
344
346
  accelerator: "CmdOrCtrl+X",
345
347
  click: () =>
346
348
  {
347
- this .mainWindow .webContents .send ("cut")
349
+ this .mainWindow .webContents .send ("cut");
348
350
  },
349
351
  },
350
352
  {
@@ -352,7 +354,7 @@ module .exports = class Application
352
354
  accelerator: "CmdOrCtrl+C",
353
355
  click: () =>
354
356
  {
355
- this .mainWindow .webContents .send ("copy")
357
+ this .mainWindow .webContents .send ("copy");
356
358
  },
357
359
  },
358
360
  {
@@ -360,7 +362,7 @@ module .exports = class Application
360
362
  accelerator: "CmdOrCtrl+V",
361
363
  click: () =>
362
364
  {
363
- this .mainWindow .webContents .send ("paste")
365
+ this .mainWindow .webContents .send ("paste");
364
366
  },
365
367
  },
366
368
  {
@@ -368,7 +370,7 @@ module .exports = class Application
368
370
  accelerator: "CmdOrCtrl+Backspace",
369
371
  click: () =>
370
372
  {
371
- this .mainWindow .webContents .send ("delete")
373
+ this .mainWindow .webContents .send ("delete");
372
374
  },
373
375
  },
374
376
  ],
@@ -381,7 +383,7 @@ module .exports = class Application
381
383
  accelerator: "CmdOrCtrl+A",
382
384
  click: () =>
383
385
  {
384
- this .mainWindow .webContents .send ("select-all")
386
+ this .mainWindow .webContents .send ("select-all");
385
387
  },
386
388
  },
387
389
  {
@@ -389,7 +391,7 @@ module .exports = class Application
389
391
  accelerator: "Shift+CmdOrCtrl+A",
390
392
  click: () =>
391
393
  {
392
- this .mainWindow .webContents .send ("deselect-all")
394
+ this .mainWindow .webContents .send ("deselect-all");
393
395
  },
394
396
  },
395
397
  { type: "separator" },
@@ -397,21 +399,21 @@ module .exports = class Application
397
399
  label: _ ("Hide Unselected Objects"),
398
400
  click: () =>
399
401
  {
400
- this .mainWindow .webContents .send ("hide-unselected-objects")
402
+ this .mainWindow .webContents .send ("hide-unselected-objects");
401
403
  },
402
404
  },
403
405
  {
404
406
  label: _ ("Show Selected Objects"),
405
407
  click: () =>
406
408
  {
407
- this .mainWindow .webContents .send ("show-selected-objects")
409
+ this .mainWindow .webContents .send ("show-selected-objects");
408
410
  },
409
411
  },
410
412
  {
411
413
  label: _ ("Show All Objects"),
412
414
  click: () =>
413
415
  {
414
- this .mainWindow .webContents .send ("show-all-objects")
416
+ this .mainWindow .webContents .send ("show-all-objects");
415
417
  },
416
418
  },
417
419
  { type: "separator" },
@@ -419,7 +421,7 @@ module .exports = class Application
419
421
  label: _ ("Remove Empty Groups"),
420
422
  click: () =>
421
423
  {
422
- this .mainWindow .webContents .send ("remove-empty-groups")
424
+ this .mainWindow .webContents .send ("remove-empty-groups");
423
425
  },
424
426
  },
425
427
  ],
@@ -444,7 +446,7 @@ module .exports = class Application
444
446
  visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
445
447
  click: () =>
446
448
  {
447
- this .mainWindow .webContents .send ("reload")
449
+ this .mainWindow .webContents .send ("reload");
448
450
  },
449
451
  },
450
452
  {
@@ -452,7 +454,7 @@ module .exports = class Application
452
454
  visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
453
455
  click: () =>
454
456
  {
455
- this .mainWindow .webContents .send ("toggle-developer-tools")
457
+ this .mainWindow .webContents .send ("toggle-developer-tools");
456
458
  },
457
459
  },
458
460
  { type: "separator" },
@@ -465,8 +467,8 @@ module .exports = class Application
465
467
  checked: this .config .expandExternProtoDeclarations,
466
468
  click: () =>
467
469
  {
468
- this .config .expandExternProtoDeclarations = !this .config .expandExternProtoDeclarations
469
- this .mainWindow .webContents .send ("expand-extern-proto-declarations", this .config .expandExternProtoDeclarations)
470
+ this .config .expandExternProtoDeclarations = !this .config .expandExternProtoDeclarations;
471
+ this .mainWindow .webContents .send ("expand-extern-proto-declarations", this .config .expandExternProtoDeclarations);
470
472
  },
471
473
  },
472
474
  {
@@ -475,8 +477,8 @@ module .exports = class Application
475
477
  checked: this .config .expandPrototypeInstances,
476
478
  click: () =>
477
479
  {
478
- this .config .expandPrototypeInstances = !this .config .expandPrototypeInstances
479
- this .mainWindow .webContents .send ("expand-prototype-instances", this .config .expandPrototypeInstances)
480
+ this .config .expandPrototypeInstances = !this .config .expandPrototypeInstances;
481
+ this .mainWindow .webContents .send ("expand-prototype-instances", this .config .expandPrototypeInstances);
480
482
  },
481
483
  },
482
484
  {
@@ -485,8 +487,8 @@ module .exports = class Application
485
487
  checked: this .config .expandInlineNodes,
486
488
  click: () =>
487
489
  {
488
- this .config .expandInlineNodes = !this .config .expandInlineNodes
489
- this .mainWindow .webContents .send ("expand-inline-nodes", this .config .expandInlineNodes)
490
+ this .config .expandInlineNodes = !this .config .expandInlineNodes;
491
+ this .mainWindow .webContents .send ("expand-inline-nodes", this .config .expandInlineNodes);
490
492
  },
491
493
  },
492
494
  ],
@@ -501,8 +503,8 @@ module .exports = class Application
501
503
  checked: this .config .primitiveQuality === "HIGH",
502
504
  click: () =>
503
505
  {
504
- this .config .primitiveQuality = "HIGH"
505
- this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality)
506
+ this .config .primitiveQuality = "HIGH";
507
+ this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality);
506
508
  },
507
509
  },
508
510
  {
@@ -511,8 +513,8 @@ module .exports = class Application
511
513
  checked: this .config .primitiveQuality === "MEDIUM" || this .config .primitiveQuality === undefined,
512
514
  click: () =>
513
515
  {
514
- this .config .primitiveQuality = "MEDIUM"
515
- this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality)
516
+ this .config .primitiveQuality = "MEDIUM";
517
+ this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality);
516
518
  },
517
519
  },
518
520
  {
@@ -521,8 +523,8 @@ module .exports = class Application
521
523
  checked: this .config .primitiveQuality === "LOW",
522
524
  click: () =>
523
525
  {
524
- this .config .primitiveQuality = "LOW"
525
- this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality)
526
+ this .config .primitiveQuality = "LOW";
527
+ this .mainWindow .webContents .send ("primitive-quality", this .config .primitiveQuality);
526
528
  },
527
529
  }
528
530
  ],
@@ -536,8 +538,8 @@ module .exports = class Application
536
538
  checked: this .config .textureQuality === "HIGH",
537
539
  click: () =>
538
540
  {
539
- this .config .textureQuality = "HIGH"
540
- this .mainWindow .webContents .send ("texture-quality", this .config .textureQuality)
541
+ this .config .textureQuality = "HIGH";
542
+ this .mainWindow .webContents .send ("texture-quality", this .config .textureQuality);
541
543
  },
542
544
  },
543
545
  {
@@ -546,8 +548,8 @@ module .exports = class Application
546
548
  checked: this .config .textureQuality === "MEDIUM" || this .config .textureQuality === undefined,
547
549
  click: () =>
548
550
  {
549
- this .config .textureQuality = "MEDIUM"
550
- this .mainWindow .webContents .send ("texture-quality",this .config .textureQuality)
551
+ this .config .textureQuality = "MEDIUM";
552
+ this .mainWindow .webContents .send ("texture-quality",this .config .textureQuality);
551
553
  },
552
554
  },
553
555
  {
@@ -556,8 +558,8 @@ module .exports = class Application
556
558
  checked: this .config .textureQuality === "LOW",
557
559
  click: () =>
558
560
  {
559
- this .config .textureQuality = "LOW"
560
- this .mainWindow .webContents .send ("texture-quality", this .config .textureQuality)
561
+ this .config .textureQuality = "LOW";
562
+ this .mainWindow .webContents .send ("texture-quality", this .config .textureQuality);
561
563
  },
562
564
  }
563
565
  ],
@@ -568,8 +570,8 @@ module .exports = class Application
568
570
  checked: this .config .rubberband,
569
571
  click: () =>
570
572
  {
571
- this .config .rubberband = !this .config .rubberband
572
- this .mainWindow .webContents .send ("display-rubberband", this .config .rubberband)
573
+ this .config .rubberband = !this .config .rubberband;
574
+ this .mainWindow .webContents .send ("display-rubberband", this .config .rubberband);
573
575
  },
574
576
  },
575
577
  {
@@ -578,8 +580,8 @@ module .exports = class Application
578
580
  checked: this .config .timings,
579
581
  click: () =>
580
582
  {
581
- this .config .timings = !this .config .timings
582
- this .mainWindow .webContents .send ("display-timings", this .config .timings)
583
+ this .config .timings = !this .config .timings;
584
+ this .mainWindow .webContents .send ("display-timings", this .config .timings);
583
585
  },
584
586
  },
585
587
  { type: "separator" },
@@ -588,7 +590,7 @@ module .exports = class Application
588
590
  accelerator: "Shift+CmdOrCtrl+L",
589
591
  click: () =>
590
592
  {
591
- this .mainWindow .webContents .send ("show-library")
593
+ this .mainWindow .webContents .send ("show-library");
592
594
  },
593
595
  },
594
596
  { type: "separator" },
@@ -604,7 +606,7 @@ module .exports = class Application
604
606
  label: _ ("Browser Size..."),
605
607
  click: () =>
606
608
  {
607
- this .mainWindow .webContents .send ("browser-size")
609
+ this .mainWindow .webContents .send ("browser-size");
608
610
  },
609
611
  },
610
612
  ],
@@ -620,17 +622,17 @@ module .exports = class Application
620
622
  label: "Learn More",
621
623
  click: async () =>
622
624
  {
623
- await electron .shell .openExternal ("https://create3000.github.io/x_ite/")
625
+ await electron .shell .openExternal ("https://create3000.github.io/x_ite/");
624
626
  },
625
627
  },
626
628
  ],
627
629
  },
628
- ])
630
+ ]);
629
631
 
630
- this .mainMenu [0] = menu
632
+ this .mainMenu [0] = menu;
631
633
 
632
634
  if (this .mainMenu .length === 1)
633
- electron .Menu .setApplicationMenu (menu)
635
+ electron .Menu .setApplicationMenu (menu);
634
636
  }
635
637
 
636
638
  async createWindow ()
@@ -738,10 +740,10 @@ module .exports = class Application
738
740
  for (const URL of urls)
739
741
  {
740
742
  if (URL .startsWith ("file:"))
741
- electron .app .addRecentDocument (url .fileURLToPath (URL))
743
+ electron .app .addRecentDocument (url .fileURLToPath (URL));
742
744
  }
743
745
 
744
- this .mainWindow .webContents .send ("open-files", urls)
746
+ this .mainWindow .webContents .send ("open-files", urls);
745
747
  }
746
748
 
747
749
  async showOpenDialog (defaultPath)
@@ -752,7 +754,7 @@ module .exports = class Application
752
754
  label: "Sunrize",
753
755
  },
754
756
  { role: "editMenu" },
755
- ]))
757
+ ]));
756
758
 
757
759
  const response = await electron .dialog .showOpenDialog ({
758
760
  defaultPath: defaultPath,
@@ -763,16 +765,16 @@ module .exports = class Application
763
765
  extensions: ["x3d", "x3dz", "x3dj", "x3djz", "x3dv", "x3dvz", "wrl", "wrz", "wrl.gz", "vrml", "gltf", "glb", "obj", "stl", "ply", "svg"],
764
766
  },
765
767
  ],
766
- })
768
+ });
767
769
 
768
- this .popMenu ()
770
+ this .popMenu ();
769
771
 
770
- return response
772
+ return response;
771
773
  }
772
774
 
773
775
  saveFile (filePath)
774
776
  {
775
- electron .app .addRecentDocument (filePath)
777
+ electron .app .addRecentDocument (filePath);
776
778
  }
777
779
 
778
780
  async showSaveDialog (defaultPath)
@@ -783,7 +785,7 @@ module .exports = class Application
783
785
  label: "Sunrize",
784
786
  },
785
787
  { role: "editMenu" },
786
- ]))
788
+ ]));
787
789
 
788
790
  const response = await electron .dialog .showSaveDialog ({
789
791
  defaultPath: defaultPath,
@@ -796,11 +798,11 @@ module .exports = class Application
796
798
  { name: "X3D VRML Classic Document", extensions: ["x3dv"] },
797
799
  { name: "X3D VRML Classic Document GZipped", extensions: ["x3dvz"] },
798
800
  ],
799
- })
801
+ });
800
802
 
801
- this .popMenu ()
803
+ this .popMenu ();
802
804
 
803
- return response
805
+ return response;
804
806
  }
805
807
 
806
808
  async showExportDialog (defaultPath)
@@ -811,7 +813,7 @@ module .exports = class Application
811
813
  label: "Sunrize",
812
814
  },
813
815
  { role: "editMenu" },
814
- ]))
816
+ ]));
815
817
 
816
818
  const response = await electron .dialog .showSaveDialog ({
817
819
  defaultPath: defaultPath,
@@ -819,53 +821,53 @@ module .exports = class Application
819
821
  filters : [
820
822
  { name: "HTML Document", extensions: ["html"] },
821
823
  ],
822
- })
824
+ });
823
825
 
824
- this .popMenu ()
826
+ this .popMenu ();
825
827
 
826
- return response
828
+ return response;
827
829
  }
828
830
 
829
831
  maximize ()
830
832
  {
831
- this .config .maximized = true
833
+ this .config .maximized = true;
832
834
  }
833
835
 
834
836
  unmaximize ()
835
837
  {
836
- this .config .maximized = false
838
+ this .config .maximized = false;
837
839
  }
838
840
 
839
841
  enterFullscreen ()
840
842
  {
841
- this .config .fullscreen = true
843
+ this .config .fullscreen = true;
842
844
  }
843
845
 
844
846
  leaveFullscreen ()
845
847
  {
846
- this .config .fullscreen = false
848
+ this .config .fullscreen = false;
847
849
  }
848
850
 
849
851
  blur ()
850
852
  {
851
- this .mainWindow .webContents .send ("save-all-files")
853
+ this .mainWindow .webContents .send ("save-all-files");
852
854
  }
853
855
 
854
856
  close (event)
855
857
  {
856
858
  if (!this .mainWindow .closing)
857
859
  {
858
- event .preventDefault ()
859
- this .mainWindow .closing = true
860
- this .mainWindow .webContents .send ("quit")
860
+ event .preventDefault ();
861
+ this .mainWindow .closing = true;
862
+ this .mainWindow .webContents .send ("quit");
861
863
  }
862
864
  else
863
865
  {
864
866
  if (this .config .maximized || this .config .fullscreen)
865
- return
867
+ return;
866
868
 
867
- this .config .position = this .mainWindow .getPosition ()
868
- this .config .size = this .mainWindow .getSize ()
869
+ this .config .position = this .mainWindow .getPosition ();
870
+ this .config .size = this .mainWindow .getSize ();
869
871
  }
870
872
  }
871
873
 
@@ -873,20 +875,20 @@ module .exports = class Application
873
875
  {
874
876
  try
875
877
  {
876
- return await clipboardy .read ()
878
+ return await clipboardy .read ();
877
879
  }
878
880
  catch
879
881
  {
880
- return ""
882
+ return "";
881
883
  }
882
884
  }
883
885
 
884
886
  quit ()
885
887
  {
886
888
  if (!this .applicationShouldQuitAfterLastWindowClosed)
887
- return
889
+ return;
888
890
 
889
- Template .removeAll ()
890
- electron .app .quit ()
891
+ Template .removeAll ();
892
+ electron .app .quit ();
891
893
  }
892
- }
894
+ };