1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

modify: some refactor

This commit is contained in:
sota1235
2017-04-22 11:54:05 +09:00
parent 9a9f0035c2
commit db468fc095

View File

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