mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
modify: some refactor
This commit is contained in:
@@ -3,11 +3,11 @@ const BrowserWindow = electron.BrowserWindow
|
||||
const shell = electron.shell
|
||||
const mainWindow = require('./main-window')
|
||||
|
||||
const OSX = process.platform === 'darwin'
|
||||
const macOS = process.platform === 'darwin'
|
||||
// const WIN = process.platform === 'win32'
|
||||
const LINUX = process.platform === 'linux'
|
||||
|
||||
var boost = OSX
|
||||
const boost = macOS
|
||||
? {
|
||||
label: 'Boostnote',
|
||||
submenu: [
|
||||
@@ -50,13 +50,13 @@ var boost = OSX
|
||||
]
|
||||
}
|
||||
|
||||
var file = {
|
||||
const file = {
|
||||
label: 'File',
|
||||
submenu: [
|
||||
{
|
||||
label: 'New Note',
|
||||
accelerator: 'CommandOrControl+N',
|
||||
click: function () {
|
||||
click () {
|
||||
mainWindow.webContents.send('top:new-note')
|
||||
}
|
||||
},
|
||||
@@ -94,8 +94,8 @@ var file = {
|
||||
},
|
||||
{
|
||||
label: 'Delete Note',
|
||||
accelerator: OSX ? 'Control+Backspace' : 'Control+Delete',
|
||||
click: function () {
|
||||
accelerator: macOS ? 'Control+Backspace' : 'Control+Delete',
|
||||
click () {
|
||||
mainWindow.webContents.send('detail:delete')
|
||||
}
|
||||
}
|
||||
@@ -105,13 +105,12 @@ var file = {
|
||||
if (LINUX) {
|
||||
file.submenu.push({
|
||||
type: 'separator'
|
||||
})
|
||||
file.submenu.push({
|
||||
}, {
|
||||
role: 'quit'
|
||||
})
|
||||
}
|
||||
|
||||
var edit = {
|
||||
const edit = {
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{
|
||||
@@ -150,20 +149,20 @@ var edit = {
|
||||
]
|
||||
}
|
||||
|
||||
var view = {
|
||||
const view = {
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Reload',
|
||||
accelerator: 'CommandOrControl+R',
|
||||
click: function () {
|
||||
click() {
|
||||
BrowserWindow.getFocusedWindow().reload()
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Toggle Developer Tools',
|
||||
accelerator: OSX ? 'Command+Alt+I' : 'Control+Shift+I',
|
||||
click: function () {
|
||||
accelerator: macOS ? 'Command+Alt+I' : 'Control+Shift+I',
|
||||
click() {
|
||||
BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||
}
|
||||
},
|
||||
@@ -204,7 +203,7 @@ var view = {
|
||||
]
|
||||
}
|
||||
|
||||
var window = {
|
||||
const window = {
|
||||
label: 'Window',
|
||||
submenu: [
|
||||
{
|
||||
@@ -227,21 +226,21 @@ var window = {
|
||||
]
|
||||
}
|
||||
|
||||
var help = {
|
||||
const help = {
|
||||
label: 'Help',
|
||||
role: 'help',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Boostnote official site',
|
||||
click: function () { shell.openExternal('https://boostnote.io/') }
|
||||
click () { shell.openExternal('https://boostnote.io/') }
|
||||
},
|
||||
{
|
||||
label: 'Issue Tracker',
|
||||
click: function () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
|
||||
click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
|
||||
},
|
||||
{
|
||||
label: 'Changelog',
|
||||
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
|
||||
click () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user