Make indenting consistent with rest of project

This commit is contained in:
David Baker 2016-11-03 13:33:49 +00:00
parent fb3ca441ba
commit d9780239b6
1 changed files with 153 additions and 153 deletions

View File

@ -18,166 +18,166 @@ const electron = require('electron');
// Menu template from http://electron.atom.io/docs/api/menu/, edited // Menu template from http://electron.atom.io/docs/api/menu/, edited
const template = [ const template = [
{ {
label: 'Edit', label: 'Edit',
submenu: [ submenu: [
{ {
role: 'undo' role: 'undo'
}, },
{ {
role: 'redo' role: 'redo'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'cut' role: 'cut'
}, },
{ {
role: 'copy' role: 'copy'
}, },
{ {
role: 'paste' role: 'paste'
}, },
{ {
role: 'pasteandmatchstyle' role: 'pasteandmatchstyle'
}, },
{ {
role: 'delete' role: 'delete'
}, },
{ {
role: 'selectall' role: 'selectall'
} }
] ]
}, },
{ {
label: 'View', label: 'View',
submenu: [ submenu: [
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'resetzoom' role: 'resetzoom'
}, },
{ {
role: 'zoomin' role: 'zoomin'
}, },
{ {
role: 'zoomout' role: 'zoomout'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'togglefullscreen' role: 'togglefullscreen'
}, },
{ {
label: 'Toggle Developer Tools', label: 'Toggle Developer Tools',
accelerator: process.platform == 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', accelerator: process.platform == 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
click: function(item, focusedWindow) { click: function(item, focusedWindow) {
if (focusedWindow) focusedWindow.toggleDevTools(); if (focusedWindow) focusedWindow.toggleDevTools();
} }
} }
] ]
}, },
{ {
role: 'window', role: 'window',
submenu: [ submenu: [
{ {
role: 'minimize' role: 'minimize'
}, },
{ {
role: 'close' role: 'close'
} }
] ]
}, },
{ {
role: 'help', role: 'help',
submenu: [ submenu: [
{ {
label: 'riot.im', label: 'riot.im',
click () { electron.shell.openExternal('https://riot.im/') } click () { electron.shell.openExternal('https://riot.im/') }
} }
] ]
} }
]; ];
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
const name = electron.app.getName() const name = electron.app.getName()
template.unshift({ template.unshift({
label: name, label: name,
submenu: [ submenu: [
{ {
role: 'about' role: 'about'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'services', role: 'services',
submenu: [] submenu: []
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'hide' role: 'hide'
}, },
{ {
role: 'hideothers' role: 'hideothers'
}, },
{ {
role: 'unhide' role: 'unhide'
}, },
{ {
type: 'separator' type: 'separator'
}, },
{ {
role: 'quit' role: 'quit'
} }
] ]
}) })
// Edit menu. // Edit menu.
template[1].submenu.push( template[1].submenu.push(
{
type: 'separator'
},
{
label: 'Speech',
submenu: [
{ {
role: 'startspeaking' type: 'separator'
}, },
{ {
role: 'stopspeaking' label: 'Speech',
submenu: [
{
role: 'startspeaking'
},
{
role: 'stopspeaking'
}
]
} }
] )
} // Window menu.
) template[3].submenu = [
// Window menu. {
template[3].submenu = [ label: 'Close',
{ accelerator: 'CmdOrCtrl+W',
label: 'Close', role: 'close'
accelerator: 'CmdOrCtrl+W', },
role: 'close' {
}, label: 'Minimize',
{ accelerator: 'CmdOrCtrl+M',
label: 'Minimize', role: 'minimize'
accelerator: 'CmdOrCtrl+M', },
role: 'minimize' {
}, label: 'Zoom',
{ role: 'zoom'
label: 'Zoom', },
role: 'zoom' {
}, type: 'separator'
{ },
type: 'separator' {
}, label: 'Bring All to Front',
{ role: 'front'
label: 'Bring All to Front', }
role: 'front' ]
}
]
}; };
module.exports = electron.Menu.buildFromTemplate(template) module.exports = electron.Menu.buildFromTemplate(template)