diff --git a/main.js b/main.js index b76e3aaf5..c749e3810 100644 --- a/main.js +++ b/main.js @@ -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) { @@ -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(); diff --git a/package.json b/package.json index 797bd1a87..fd0474f32 100644 --- a/package.json +++ b/package.json @@ -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",