-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
# compiled output | ||
/dist | ||
/dist-desktop | ||
/tmp | ||
/out-tsc | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const { app, BrowserWindow, shell, Menu } = require('electron'); | ||
|
||
let mainWindow; | ||
|
||
function createWindow () { | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({width: 1000, height: 600}); | ||
const options = { extraHeaders: "pragma: no-cache\n" }; | ||
mainWindow.loadURL('https://nanovault.io', options); | ||
// mainWindow.loadURL('http://localhost:4200/'); | ||
// TODO: Use environment to load config which holds the actual url to load for the app | ||
|
||
// Emitted when the window is closed. | ||
mainWindow.on('closed', function () { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
mainWindow = null | ||
}) | ||
|
||
mainWindow.webContents.on('new-window', function(e, url) { | ||
e.preventDefault(); | ||
shell.openExternal(url); | ||
}); | ||
|
||
if (process.platform === 'darwin') { | ||
// Create our menu entries so that we can use MAC shortcuts | ||
Menu.setApplicationMenu(Menu.buildFromTemplate([ | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{ role: 'undo' }, | ||
{ role: 'redo' }, | ||
{ type: 'separator' }, | ||
{ role: 'cut' }, | ||
{ role: 'copy' }, | ||
{ role: 'paste' }, | ||
{ role: 'pasteandmatchstyle' }, | ||
{ role: 'delete' }, | ||
{ role: 'selectall' } | ||
] | ||
} | ||
])); | ||
} | ||
} | ||
|
||
app.on('ready', createWindow) | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', function () { | ||
// On OS X it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
}) | ||
|
||
app.on('activate', function () { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (mainWindow === null) { | ||
createWindow() | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This file is required by the index.html file and will | ||
// be executed in the renderer process for that window. | ||
// All of the Node.js APIs are available in this process. |