|
|
@ -10,14 +10,22 @@ const {parser} = require("./Parser"); |
|
|
|
class Ation { |
|
|
|
class Ation { |
|
|
|
windowManager; |
|
|
|
windowManager; |
|
|
|
mainMenu; |
|
|
|
mainMenu; |
|
|
|
|
|
|
|
fileToOpen; |
|
|
|
|
|
|
|
|
|
|
|
constructor() { |
|
|
|
constructor() { |
|
|
|
if (Ation.Instances > 0) |
|
|
|
if (Ation.Instances > 0) |
|
|
|
throw new Error("Only one Instance of Ation possible"); |
|
|
|
throw new Error("Only one Instance of Ation possible"); |
|
|
|
|
|
|
|
this.fileToOpen = null; |
|
|
|
this.windowManager = new WindowManager(this); |
|
|
|
this.windowManager = new WindowManager(this); |
|
|
|
this.mainMenu = new MainMenu(this); |
|
|
|
this.mainMenu = new MainMenu(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.on("open-file", (_, path) => { |
|
|
|
|
|
|
|
this.fileToOpen = path; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
app.whenReady().then(async () => { |
|
|
|
app.whenReady().then(async () => { |
|
|
|
|
|
|
|
if (this.fileToOpen) |
|
|
|
|
|
|
|
dialog.showMessageBox(this.windowManager.mainWindow, {message : this.fileToOpen}); |
|
|
|
protocol.registerFileProtocol("slideimg", (request, callback) => { |
|
|
|
protocol.registerFileProtocol("slideimg", (request, callback) => { |
|
|
|
const uri = request.url.replace(/^slideimg:\/\//, ""); |
|
|
|
const uri = request.url.replace(/^slideimg:\/\//, ""); |
|
|
|
const extension = path.extname(uri).replace(/^\./, ""); |
|
|
|
const extension = path.extname(uri).replace(/^\./, ""); |
|
|
|