-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
203 lines (198 loc) · 4.81 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
const {app, BrowserWindow, dialog, Menu, shell}=require('electron');
var mainWin;
var calcWin, searchWin, commandsWin, settingsWin;
function neWin(){
mainWin=new BrowserWindow({
width: 850, height: 550, minWidth: 450, minHeight: 200,
backgroundColor: '#fff',
icon: `${__dirname}/src/image/icon.png`,
webPreferences: {
worldSafeExecuteJavaScript: true,
nodeIntegration:false,
contextIsolation: true,
preload: `${__dirname}/src/script/node.js`
}
});
mainWin.loadFile(`${__dirname}/src/index.html`);
mainWin.on('closed',()=>{
mainWin=null;
})
}
app.on('ready', neWin);
app.on('window-all-closed',()=>{
if(process.platform!=='darwin'){
app.quit();
}
});
app.on('activate',()=>{
if(mainWin===null){
neWin();
}
})
let menu=Menu.buildFromTemplate([
{
label: '表示',
submenu: [
{
label: 'Litestについて',
accelerator: 'CmdOrCtrl+Alt+A',
click: ()=>{
dialog.showMessageBox(null, {
type: 'info',
icon: './src/image/icon.png',
title: 'Litestについて',
message: 'Litest 2.0.0 B3A1について',
detail: 'バージョン: 2.0.0 B3A1(Beta 3 Alpha 1)\nビルド番号: Build2105.23\n\n開発者: Sorakime\n公式サイト: https://sorakime.github.io/mncr/litest/\nリポジトリ: https://github.com/Sorakime/litest/tree/beta3\n\nCopyright 2021 Sorakime.'
})
}
},
{
type: 'separator'
},
{
role: 'reload',
label: '再読み込み',
},
{
role: 'forceReload',
label: 'より強い再読み込み'
},
{
type: 'separator'
},
{
label: '開発者向け',
submenu: [
{
role: 'toggleDevTools',
label: '開発者向けツール'
},
{
label: 'ソースコードの確認',
accelerator: 'CmdOrCtrl+Alt+S',
click: ()=>{
shell.openExternal('https://github.com/Sorakime/litest/tree/2.0b3a1')
}
}
]
},
{
label: '拡大・縮小',
submenu: [
{
role: 'zoomIn',
label: '拡大',
accelerator: 'CmdOrCtrl+^'
},
{
role: 'zooomOut',
label: '縮小',
accelerator: 'CmdOrCtrl+-'
},
{
role: 'resetZoom',
label: '拡大率をリセット',
accelerator: 'CmdOrCtrl+0'
}
]
},
{
role: 'togglefullscreen',
label: '全画面で表示'
},
{
type: 'separator'
},
{
role: 'quit',
label: 'Litest を終了',
accelerator: 'CmdOrCtrl+Q'
}
]
},
{
label: '編集',
submenu: [
{
role: 'undo',
label: '元に戻す'
},
{
role: 'redo',
label: 'やり直し'
},
{
type: 'separator'
},
{
role: 'cut',
label: 'カット'
},
{
role: 'copy',
label: 'コピー'
},
{
role: 'paste',
label: '貼り付け'
},
{
type: 'separator'
},
{
role: 'selectAll',
label: 'すべて選択'
}
]
},
{
label: 'アプリ',
submenu: [
{
label: 'Calc',
accelerator: 'CmdOrCtrl+Alt+1',
click: ()=>{
calcWin=new BrowserWindow({
width: 450, height: 538.25,
backgroundColor: '#131313'
})
calcWin.loadFile(`./src/app/calc/index.html`);
}
},
{
label: 'Search',
accelerator: 'CmdOrCtrl+Alt+2',
click: ()=>{
searchWin=new BrowserWindow({
width: 800, height: 500,
backgroundColor: '#888888'
})
searchWin.loadFile('./src/app/search/index.html');
}
},
{
label: 'Commands',
accelerator: 'CmdOrCtrl+Alt+3',
click: ()=>{
commandsWin=new BrowserWindow({
width: 750, height: 475,
backgroundColor: '#111'
})
commandsWin.loadFile('./src/app/commands/index.html');
}
},
{
label: 'Settings',
accelerator: 'CmdOrCtrl+Alt+4',
click: ()=>{
settingsWin=new BrowserWindow({
width: 1000, height: 650,
backgroundColor: '#888888'
})
settingsWin.loadFile('./src/app/settings/index.html');
}
}
]
}
])
Menu.setApplicationMenu(menu);