Skip to content

Commit bc13eae

Browse files
Merge pull request #18 from ekonstantinidis/authwindow-clipboard
Allow copy & paste within the app
2 parents 1b4a0e3 + 7a01ec0 commit bc13eae

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

main.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ app.on('ready', function(){
3636
appIcon.window = new BrowserWindow(defaults);
3737
appIcon.window.loadUrl('file://' + __dirname + '/index.html');
3838
appIcon.window.on('blur', hideWindow);
39+
40+
initMenu();
3941
}
4042

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

54+
function initMenu () {
55+
var template = [{
56+
label: 'Edit',
57+
submenu: [
58+
{
59+
label: 'Copy',
60+
accelerator: 'Command+C',
61+
selector: 'copy:'
62+
},
63+
{
64+
label: 'Paste',
65+
accelerator: 'Command+V',
66+
selector: 'paste:'
67+
}
68+
]
69+
}];
70+
71+
menu = Menu.buildFromTemplate(template);
72+
Menu.setApplicationMenu(menu);
73+
}
74+
5275
function hideWindow () {
5376
if (!appIcon.window) return;
5477
appIcon.window.hide();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Github Notifications on your menu bar.",
55
"main": "main.js",
66
"scripts": {
7-
"build-js": "npm run mkdirs && browserify -t reactify src/js/app.js -o build/js/app.js",
7+
"build-js": "npm run mkdir -p build/js && browserify -t reactify src/js/app.js -o build/js/app.js",
88
"build": "npm install && mkdir -p build/js && grunt build && npm run build-js",
99
"watch-js": "watchify -t reactify src/js/app.js -o build/js/app.js -v",
1010
"watch": "grunt build && npm build && npm run watch-js | grunt watch",

0 commit comments

Comments
 (0)