Skip to content

Commit

Permalink
Merge pull request #18 from ekonstantinidis/authwindow-clipboard
Browse files Browse the repository at this point in the history
Allow copy & paste within the app
  • Loading branch information
ekonstantinidis committed May 28, 2015
2 parents 1b4a0e3 + 7a01ec0 commit bc13eae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
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

0 comments on commit bc13eae

Please sign in to comment.