Skip to content

Commit f72cbd4

Browse files
committed
merged
1 parent 6d28623 commit f72cbd4

File tree

2 files changed

+80
-91
lines changed

2 files changed

+80
-91
lines changed

app/electron/menu.js

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const { Menu } = require("electron");
1+
const { Menu } = require('electron');
22
const { BrowserWindow } = require('electron');
33
const fs = require('fs');
44
const path = require('path');
5-
const isMac = process.platform === "darwin";
5+
const isMac = process.platform === 'darwin';
66
const port = 5000;
77
const tutorialRoute = `http://localhost:${port}/tutorial`;
88

99
// Create a template for a menu and create menu using that template
10-
var MenuBuilder = function (mainWindow, appName) {
10+
var MenuBuilder = function(mainWindow, appName) {
1111
// https://electronjs.org/docs/api/menu#main-process
1212
// "roles" are predefined by Electron and used for standard actions
1313
// https://www.electronjs.org/docs/api/menu-item
@@ -30,9 +30,9 @@ var MenuBuilder = function (mainWindow, appName) {
3030
});
3131
tutorial.loadURL(`http://localhost:8080/#/tutorial`);
3232
tutorial.show();
33-
}
33+
};
3434

35-
let defaultTemplate = function () {
35+
let defaultTemplate = function() {
3636
return [
3737
// { role: "appMenu" }
3838
...(isMac
@@ -42,202 +42,202 @@ var MenuBuilder = function (mainWindow, appName) {
4242
label: appName,
4343
submenu: [
4444
{
45-
role: "about",
45+
role: 'about'
4646
},
4747
{
48-
type: "separator",
48+
type: 'separator'
4949
},
5050
{
51-
role: "services",
51+
role: 'services'
5252
},
5353
{
54-
type: "separator",
54+
type: 'separator'
5555
},
5656
{
57-
role: "hide",
57+
role: 'hide'
5858
},
5959
{
60-
role: "hideothers",
60+
role: 'hideothers'
6161
},
6262
{
63-
role: "unhide",
63+
role: 'unhide'
6464
},
6565
{
66-
type: "separator",
66+
type: 'separator'
6767
},
6868
{
69-
role: "quit",
70-
},
71-
],
72-
},
69+
role: 'quit'
70+
}
71+
]
72+
}
7373
]
7474
: []),
7575
{
76-
label: "File",
76+
label: 'File',
7777
submenu: [
7878
isMac
7979
? {
80-
role: "close",
80+
role: 'close'
8181
}
8282
: {
83-
role: "quit",
84-
},
85-
],
83+
role: 'quit'
84+
}
85+
]
8686
},
8787
{
88-
label: "Edit",
88+
label: 'Edit',
8989
submenu: [
9090
{
91-
role: "undo",
91+
role: 'undo'
9292
},
9393
{
94-
role: "redo",
94+
role: 'redo'
9595
},
9696
{
97-
type: "separator",
97+
type: 'separator'
9898
},
9999
{
100-
role: "cut",
100+
role: 'cut'
101101
},
102102
{
103-
role: "copy",
103+
role: 'copy'
104104
},
105105
{
106-
role: "paste",
106+
role: 'paste'
107107
},
108108
...(isMac
109109
? [
110110
{
111-
role: "pasteAndMatchStyle",
111+
role: 'pasteAndMatchStyle'
112112
},
113113
{
114-
role: "delete",
114+
role: 'delete'
115115
},
116116
{
117-
role: "selectAll",
117+
role: 'selectAll'
118118
},
119119
{
120-
type: "separator",
120+
type: 'separator'
121121
},
122122
{
123-
label: "Speech",
123+
label: 'Speech',
124124
submenu: [
125125
{
126-
role: "startspeaking",
126+
role: 'startspeaking'
127127
},
128128
{
129-
role: "stopspeaking",
130-
},
131-
],
132-
},
129+
role: 'stopspeaking'
130+
}
131+
]
132+
}
133133
]
134134
: [
135135
{
136-
role: "delete",
136+
role: 'delete'
137137
},
138138
{
139-
type: "separator",
139+
type: 'separator'
140140
},
141141
{
142-
role: "selectAll",
143-
},
144-
]),
145-
],
142+
role: 'selectAll'
143+
}
144+
])
145+
]
146146
},
147147
// { role: "viewMenu" }
148148
{
149-
label: "View",
149+
label: 'View',
150150
submenu: [
151151
{
152-
role: "reload",
152+
role: 'reload'
153153
},
154154
{
155-
role: "forcereload",
155+
role: 'forcereload'
156156
},
157157
{
158-
role: "toggledevtools",
158+
role: 'toggledevtools'
159159
},
160160
{
161-
type: "separator",
161+
type: 'separator'
162162
},
163163
{
164-
role: "resetzoom",
164+
role: 'resetzoom'
165165
},
166166
{
167-
role: "zoomin",
167+
role: 'zoomin'
168168
},
169169
{
170-
role: "zoomout",
170+
role: 'zoomout'
171171
},
172172
{
173-
type: "separator",
173+
type: 'separator'
174174
},
175175
{
176-
role: "togglefullscreen",
177-
},
178-
],
176+
role: 'togglefullscreen'
177+
}
178+
]
179179
},
180180

181181
{
182-
label: "Window",
182+
label: 'Window',
183183
submenu: [
184184
{
185-
role: "minimize",
185+
role: 'minimize'
186186
},
187187
{
188-
role: "zoom",
188+
role: 'zoom'
189189
},
190190
...(isMac
191191
? [
192192
{
193-
type: "separator",
193+
type: 'separator'
194194
},
195195
{
196-
role: "front",
196+
role: 'front'
197197
},
198198
{
199-
type: "separator",
199+
type: 'separator'
200200
},
201201
{
202-
role: "window",
203-
},
202+
role: 'window'
203+
}
204204
]
205205
: [
206206
{
207-
role: "close",
208-
},
209-
]),
210-
],
207+
role: 'close'
208+
}
209+
])
210+
]
211211
},
212212
{
213-
role: "help",
213+
role: 'help',
214214
submenu: [
215215
{
216-
label: "Learn More",
216+
label: 'Learn More',
217217
click: async () => {
218-
const { shell } = require("electron");
218+
const { shell } = require('electron');
219219
await shell.openExternal(
220-
"https://github.com/open-source-labs/ReacType"
220+
'https://github.com/open-source-labs/ReacType'
221221
);
222-
},
223-
},
222+
}
223+
},
224224
{
225-
label: "Tutorial",
225+
label: 'Tutorial',
226226
click: () => openTutorial()
227227
}
228-
],
229-
},
228+
]
229+
}
230230
];
231231
};
232232

233233
// constructs menu from default template
234234
return {
235-
buildMenu: function () {
235+
buildMenu: function() {
236236
const menu = Menu.buildFromTemplate(defaultTemplate());
237237
Menu.setApplicationMenu(menu);
238238

239239
return menu;
240-
},
240+
}
241241
};
242242
};
243243

app/tutorial/index.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)