Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ app.on('ready', function(){
appIcon.window = new BrowserWindow(defaults);
appIcon.window.loadUrl('file://' + __dirname + '/index.html');
appIcon.window.on('blur', hideWindow);

initMenu();
}

function showWindow (bounds) {
Expand All @@ -49,6 +51,27 @@ app.on('ready', function(){
appIcon.window.show();
}

function initMenu () {
var template = [{
label: 'Edit',
submenu: [
{
label: 'Copy',
accelerator: 'Command+C',
selector: 'copy:'
},
{
label: 'Paste',
accelerator: 'Command+V',
selector: 'paste:'
}
]
}];

menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}

function hideWindow () {
if (!appIcon.window) return;
appIcon.window.hide();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Github Notifications on your menu bar.",
"main": "main.js",
"scripts": {
"build-js": "npm run mkdirs && browserify -t reactify src/js/app.js -o build/js/app.js",
"build-js": "npm run mkdir -p build/js && browserify -t reactify src/js/app.js -o build/js/app.js",
"build": "npm install && mkdir -p build/js && grunt build && npm run build-js",
"watch-js": "watchify -t reactify src/js/app.js -o build/js/app.js -v",
"watch": "grunt build && npm build && npm run watch-js | grunt watch",
Expand Down