-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit b1897a6
Showing
10 changed files
with
2,782 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
2, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"no-console": [ | ||
"warn", | ||
{ | ||
"allow": [ | ||
"error", | ||
"info", | ||
"warn" | ||
] | ||
} | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
] | ||
} | ||
} |
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,2 @@ | ||
dist | ||
node_modules |
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,12 @@ | ||
# Android Messages | ||
|
||
By GyozaGuy | ||
|
||
## Description | ||
|
||
A basic Electron app that wraps [messages.android.com](https://messages.android.com). | ||
|
||
## Icon | ||
|
||
["message"](https://thenounproject.com/term/message/849833) | ||
by Gregor Cresnar from the Noun Project. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,76 @@ | ||
const {app, BrowserWindow, Menu, Tray} = require('electron'); | ||
require('electron-reload')(__dirname); | ||
|
||
let win; | ||
|
||
function createTray() { | ||
const contextMenu = Menu.buildFromTemplate([ | ||
{label: 'Quit', click: () => app.quit()} | ||
]); | ||
const tray = new Tray(__dirname + '/img/appicon-tray.png'); | ||
|
||
tray.setToolTip('Messages'); | ||
tray.setContextMenu(contextMenu); | ||
|
||
tray.on('click', () => { | ||
if (!win) { | ||
createWindow(); | ||
} else if (win.isVisible()) { | ||
if (win.isFocused()) { | ||
win.hide(); | ||
} else { | ||
win.focus(); | ||
} | ||
} else { | ||
win.show(); | ||
} | ||
}); | ||
|
||
tray.on('right-click', () => { | ||
tray.popUpContextMenu(contextMenu); | ||
}); | ||
} | ||
|
||
function createWindow(cb) { | ||
win = new BrowserWindow({height: 700, show: false, width: 1000}); | ||
|
||
win.loadURL('https://messages.android.com'); | ||
|
||
win.once('ready-to-show', () => { | ||
win.show(); | ||
|
||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
} | ||
}); | ||
|
||
win.on('close', () => { | ||
// e.preventDefault(); | ||
// win.hide(); | ||
win = null; | ||
}); | ||
|
||
// win.openDevTools(); | ||
} | ||
|
||
app.on('activate', () => { | ||
if (!win) { | ||
createWindow(); | ||
} else { | ||
win.show(); | ||
} | ||
}); | ||
|
||
app.on('ready', () => { | ||
createWindow(() => { | ||
if (process.platform !== 'darwin') { | ||
createTray(); | ||
} | ||
}); | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); |
Oops, something went wrong.