-
Notifications
You must be signed in to change notification settings - Fork 0
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
12 changed files
with
9,158 additions
and
83 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
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 |
---|---|---|
@@ -1,73 +1,80 @@ | ||
import { app, BrowserWindow, screen } from 'electron'; | ||
import {app, BrowserWindow, screen} from 'electron'; | ||
import * as path from 'path'; | ||
import * as url from 'url'; | ||
import {autoUpdater} from 'electron-updater'; | ||
|
||
|
||
let win, serve; | ||
const args = process.argv.slice(1); | ||
serve = args.some(val => val === '--serve'); | ||
|
||
function createWindow() { | ||
|
||
const electronScreen = screen; | ||
const size = electronScreen.getPrimaryDisplay().workAreaSize; | ||
const electronScreen = screen; | ||
const size = electronScreen.getPrimaryDisplay().workAreaSize; | ||
|
||
// Create the browser window. | ||
win = new BrowserWindow({ | ||
x: 0, | ||
y: 0, | ||
width: 400, | ||
height: 800, | ||
titleBarStyle: 'hidden' | ||
}); | ||
// Create the browser window. | ||
win = new BrowserWindow({ | ||
x: 0, | ||
y: 0, | ||
width: 400, | ||
height: 800, | ||
titleBarStyle: 'hidden' | ||
}); | ||
|
||
if (serve) { | ||
require('electron-reload')(__dirname, { | ||
electron: require(`${__dirname}/node_modules/electron`)}); | ||
win.loadURL('http://localhost:4200'); | ||
} else { | ||
win.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'dist/index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})); | ||
} | ||
if (serve) { | ||
require('electron-reload')(__dirname, { | ||
electron: require(`${__dirname}/node_modules/electron`) | ||
}); | ||
win.loadURL('http://localhost:4200'); | ||
} else { | ||
win.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'dist/index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})); | ||
} | ||
|
||
// win.webContents.openDevTools(); | ||
// win.webContents.openDevTools(); | ||
|
||
// Emitted when the window is closed. | ||
win.on('closed', () => { | ||
// Dereference the window object, usually you would store window | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
win = null; | ||
}); | ||
// Emitted when the window is closed. | ||
win.on('closed', () => { | ||
// Dereference the window object, usually you would store window | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
win = null; | ||
}); | ||
} | ||
|
||
try { | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow); | ||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow); | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', () => { | ||
// 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(); | ||
} | ||
}); | ||
// Quit when all windows are closed. | ||
app.on('window-all-closed', () => { | ||
// 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', () => { | ||
// 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 (win === null) { | ||
createWindow(); | ||
} | ||
}); | ||
app.on('activate', () => { | ||
// 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 (win === null) { | ||
createWindow(); | ||
} | ||
const log = require("electron-log"); | ||
log.transports.file.level = "debug"; | ||
autoUpdater.logger = log; | ||
autoUpdater.checkForUpdatesAndNotify(); | ||
}); | ||
|
||
} catch (e) { | ||
// Catch Error | ||
// throw e; | ||
// Catch Error | ||
// throw e; | ||
} |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{ | ||
"name": "Stors", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A simple task manager for a day", | ||
"homepage": "https://insert.black", | ||
"repository": "https://github.com/drecodeam/stors", | ||
"browser": { | ||
"child_process": false | ||
}, | ||
"author": { | ||
"name": "Drecode Feil", | ||
"email": "[email protected]" | ||
|
@@ -24,14 +27,21 @@ | |
"electron:local": "npm run build:prod && electron .", | ||
"electron:linux": "npm run build:prod && npx electron-builder build --linux", | ||
"electron:windows": "npm run build:prod && npx electron-builder build --windows", | ||
"electron:mac": "npm run build:prod && npx electron-builder build --mac ", | ||
"electron:mac": "npm run build:prod && npx electron-builder build --mac --p", | ||
"release:mac": "npm run build:prod && npx electron-builder build --mac --p always", | ||
"test": "ng test", | ||
"e2e": "ng e2e" | ||
}, | ||
"dependencies": { | ||
"analytics-node": "^3.3.0", | ||
"auto-launch": "^5.0.5", | ||
"electron-updater": "^2.23.3" | ||
"buffer": "^5.1.0", | ||
"electron-log": "^2.2.16", | ||
"electron-updater": "^3.0.3", | ||
"events": "^3.0.0", | ||
"raven-js": "^3.26.4", | ||
"stream": "0.0.2", | ||
"timers": "^0.1.1" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "0.6.3", | ||
|
@@ -48,13 +58,14 @@ | |
"@angular/router": "6.0.3", | ||
"@ngx-translate/core": "10.0.1", | ||
"@ngx-translate/http-loader": "3.0.1", | ||
"@types/es6-collections": "^0.5.31", | ||
"@types/jasmine": "2.8.7", | ||
"@types/jasminewd2": "2.0.3", | ||
"@types/node": "8.9.4", | ||
"airtable": "^0.5.6", | ||
"codelyzer": "4.2.1", | ||
"core-js": "2.5.6", | ||
"electron": "2.0.2", | ||
"electron": "^2.0.2", | ||
"electron-builder": "20.14.7", | ||
"electron-reload": "1.2.2", | ||
"jasmine-core": "3.1.0", | ||
|
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const AppConfig = { | ||
production: true, | ||
environment: 'PROD' | ||
production: true, | ||
environment: 'PROD' | ||
}; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const AppConfig = { | ||
production: false, | ||
environment: 'LOCAL' | ||
production: false, | ||
environment: 'LOCAL' | ||
}; |
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
Oops, something went wrong.