-
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.
A more stable version. Readme changes. Window sizes fiexed.
- Loading branch information
Areas
committed
Jan 24, 2018
1 parent
c5c0335
commit beae36b
Showing
6 changed files
with
44 additions
and
51 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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# m2-list | ||
This is a small todo-list application. It is built by electron. | ||
I build this from **electron-quick-start** repo, and use a lot of code in that repo. | ||
# idea of this application | ||
When you start to work, there are so many things appear in your mind. So you can just write them down and continue your work. After that, you have a list, and this application will give you list item randomly. Then you choose to do it or just get another item. | ||
# command available | ||
<p align="center"> | ||
<h3 align="center">m2-list</h3> | ||
<p align="center">It is a small todo-list application.</p> | ||
</p> | ||
|
||
## Idea | ||
When I start to work, there are so many things appearing in my mind. I just write them down and continue my work. After doing that, I have a list. And this application helps me record such things and give me one randomly to do. Then I choose to do it or just get another list item. | ||
|
||
## Quick-start | ||
- You can [download the Windows release](https://github.com/ginhton/m2-list/releases/download/v0.1/m2-windows.exe). | ||
- You can [download the Linux release](https://github.com/ginhton/m2-list/releases/download/v0.1/m2-linux.AppImage). | ||
- Clone the repo: `git clone https://github.com/ginhton/m2-list.git` | ||
|
||
## Commands available | ||
* `add something-to-do`: this will add something to the whole list. | ||
* `list`: this will list all the things your list. | ||
* `clear`: clear all the things that appears in your list. | ||
* `get`: get a random item from your list, and then you can start to do it. | ||
* `done`: this will mark the item you *get* before done, and remove that item from your list. | ||
* `save`: save current list. And you can close this application. | ||
* `restore`: restore list if you saved list before. | ||
# how to build | ||
* first, you can clone this repo. | ||
* Then, you enter that directory, and run "yarn". | ||
* Then, you run "yarn build" to get distribute version. | ||
* Or you can run "yarn start" to run directly. | ||
* `quit`: quit. |
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,57 +1,36 @@ | ||
const electron = require('electron') | ||
// Module to control application life. | ||
const app = electron.app | ||
// Module to create native browser window. | ||
const BrowserWindow = electron.BrowserWindow | ||
|
||
const path = require('path') | ||
const url = require('url') | ||
|
||
// Keep a global reference of the window object, if you don't, the window will | ||
// be closed automatically when the JavaScript object is garbage collected. | ||
let mainWindow | ||
|
||
function createWindow () { | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({width: 800, height: 600, frame: false}) | ||
mainWindow = new BrowserWindow({ width: 800, height: 600, frame: false, resizable: false }) | ||
|
||
// and load the index.html of the app. | ||
mainWindow.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})) | ||
|
||
// 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 | ||
}) | ||
} | ||
|
||
// 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', 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() | ||
} | ||
}) | ||
|
||
// In this file you can include the rest of your app's specific main process | ||
// code. You can also put them in separate files and require them here. |
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