You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type: 'separator'// A dividing line between menu items
19
+
type: "separator",// A dividing line between menu items
20
20
},
21
21
{
22
-
role: 'cut'
22
+
role: "cut",
23
23
},
24
24
{
25
-
role: 'copy'
25
+
role: "copy",
26
26
},
27
27
{
28
-
role: 'paste'
28
+
role: "paste",
29
29
},
30
30
{
31
-
role: 'pasteandmatchstyle'
31
+
role: "pasteandmatchstyle",
32
32
},
33
33
{
34
-
role: 'delete'
34
+
role: "delete",
35
35
},
36
36
{
37
-
role: 'selectall'
38
-
}
39
-
]
37
+
role: "selectall",
38
+
},
39
+
],
40
40
},
41
41
{
42
-
label: 'View',
42
+
label: "View",
43
43
submenu: [
44
44
{
45
-
label: 'Reload',
46
-
accelerator: 'CmdOrCtrl+R',//keyboard shortcut that will reload the current window
47
-
click(item,focusedWindow){
48
-
if(focusedWindow)focusedWindow.reload()
49
-
}
45
+
label: "Reload",
46
+
accelerator: "CmdOrCtrl+R",//keyboard shortcut that will reload the current window
47
+
click(item,focusedWindow){
48
+
if(focusedWindow)focusedWindow.reload();
49
+
},
50
50
},
51
51
{
52
-
label: 'Toggle Developer Tools',
53
-
accelerator: process.platform==='darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',// another keyboard shortcut that will be conditionally assigned depending on whether or not user is on macOS
process.platform==="darwin" ? "Alt+Command+I" : "Ctrl+Shift+I",// another keyboard shortcut that will be conditionally assigned depending on whether or not user is on macOS
if(process.platform==='darwin'){// if user is on mac...
108
-
constname=app.getName()
109
-
template.unshift({// add on these new menu items
108
+
if(process.platform==="darwin"){
109
+
// if user is on mac...
110
+
constname=app.name;
111
+
template.unshift({
112
+
// add on these new menu items
110
113
label: name,
111
114
submenu: [
112
115
{
113
-
role: 'about'
116
+
role: "about",
114
117
},
115
118
{
116
-
type: 'separator'
119
+
type: "separator",
117
120
},
118
121
{
119
-
role: 'services',
120
-
submenu: []
122
+
role: "services",
123
+
submenu: [],
121
124
},
122
125
{
123
-
type: 'separator'
126
+
type: "separator",
124
127
},
125
128
{
126
-
role: 'hide'
129
+
role: "hide",
127
130
},
128
131
{
129
-
role: 'hideothers'
132
+
role: "hideothers",
130
133
},
131
134
{
132
-
role: 'unhide'
135
+
role: "unhide",
133
136
},
134
137
{
135
-
type: 'separator'
138
+
type: "separator",
136
139
},
137
140
{
138
-
role: 'quit'
139
-
}
140
-
]
141
-
})
142
-
// template[1] refers to the Edit menu.
143
-
template[1].submenu.push(// If user is on macOS also provide speech based submenu items in addition to the edit menu's other submenu items that were set earlier
141
+
role: "quit",
142
+
},
143
+
],
144
+
});
145
+
// template[1] refers to the Edit menu.
146
+
template[1].submenu.push(
147
+
// If user is on macOS also provide speech based submenu items in addition to the edit menu's other submenu items that were set earlier
144
148
{
145
-
type: 'separator'
149
+
type: "separator",
146
150
},
147
151
{
148
-
label: 'Speech',
152
+
label: "Speech",
149
153
submenu: [
150
154
{
151
-
role: 'startspeaking'
155
+
role: "startspeaking",
152
156
},
153
157
{
154
-
role: 'stopspeaking'
155
-
}
156
-
]
158
+
role: "stopspeaking",
159
+
},
160
+
],
157
161
}
158
-
)
162
+
);
159
163
//template[3] refers to the Window menu.
160
-
template[3].submenu=[// if user is on macOS replace the Window menu that we created earlier with the submenu below
164
+
template[3].submenu=[
165
+
// if user is on macOS replace the Window menu that we created earlier with the submenu below
161
166
{
162
-
label: 'Close',
163
-
accelerator: 'CmdOrCtrl+W',
164
-
role: 'close'
167
+
label: "Close",
168
+
accelerator: "CmdOrCtrl+W",
169
+
role: "close",
165
170
},
166
171
{
167
-
label: 'Minimize',
168
-
accelerator: 'CmdOrCtrl+M',
169
-
role: 'minimize'
172
+
label: "Minimize",
173
+
accelerator: "CmdOrCtrl+M",
174
+
role: "minimize",
170
175
},
171
176
{
172
-
label: 'Zoom',
173
-
role: 'zoom'
177
+
label: "Zoom",
178
+
role: "zoom",
174
179
},
175
180
{
176
-
type: 'separator'
181
+
type: "separator",
177
182
},
178
183
{
179
-
label: 'Bring All to Front',
180
-
role: 'front'
181
-
}
182
-
]
184
+
label: "Bring All to Front",
185
+
role: "front",
186
+
},
187
+
];
183
188
}
184
189
// create our menu with the Menu module imported from electron,
0 commit comments