File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ app.on('ready', function(){
36
36
appIcon . window = new BrowserWindow ( defaults ) ;
37
37
appIcon . window . loadUrl ( 'file://' + __dirname + '/index.html' ) ;
38
38
appIcon . window . on ( 'blur' , hideWindow ) ;
39
+
40
+ initMenu ( ) ;
39
41
}
40
42
41
43
function showWindow ( bounds ) {
@@ -49,6 +51,27 @@ app.on('ready', function(){
49
51
appIcon . window . show ( ) ;
50
52
}
51
53
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
+
52
75
function hideWindow ( ) {
53
76
if ( ! appIcon . window ) return ;
54
77
appIcon . window . hide ( ) ;
Original file line number Diff line number Diff line change 4
4
"description" : " Github Notifications on your menu bar." ,
5
5
"main" : " main.js" ,
6
6
"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" ,
8
8
"build" : " npm install && mkdir -p build/js && grunt build && npm run build-js" ,
9
9
"watch-js" : " watchify -t reactify src/js/app.js -o build/js/app.js -v" ,
10
10
"watch" : " grunt build && npm build && npm run watch-js | grunt watch" ,
You can’t perform that action at this time.
0 commit comments