Browse Source

Merge pull request #432 from Alexus230/master

fix linux alt+shift issue
pull/450/head
Ramiro Saenz 9 years ago committed by GitHub
parent
commit
efe55e8299
  1. 44
      electron/menu.js

44
electron/menu.js

@ -18,25 +18,25 @@ function sendAction(action) {
const helpSubmenu = [ const helpSubmenu = [
{ {
label: `Visit ${appName} Website`, label: `&Visit ${appName} Website`,
click() { click() {
shell.openExternal('http://rambox.pro'); shell.openExternal('http://rambox.pro');
} }
}, },
{ {
label: `Facebook`, label: `&Facebook`,
click() { click() {
shell.openExternal('https://www.facebook.com/ramboxapp'); shell.openExternal('https://www.facebook.com/ramboxapp');
} }
}, },
{ {
label: `Twitter`, label: `&Twitter`,
click() { click() {
shell.openExternal('https://www.twitter.com/ramboxapp'); shell.openExternal('https://www.twitter.com/ramboxapp');
} }
}, },
{ {
label: `GitHub`, label: `&GitHub`,
click() { click() {
shell.openExternal('https://www.github.com/saenzramiro/rambox'); shell.openExternal('https://www.github.com/saenzramiro/rambox');
} }
@ -45,7 +45,7 @@ const helpSubmenu = [
type: 'separator' type: 'separator'
}, },
{ {
label: 'Report an Issue...', label: '&Report an Issue...',
click() { click() {
const body = ` const body = `
<!-- Please describe here your issue and steps to reproduce it. --> <!-- Please describe here your issue and steps to reproduce it. -->
@ -62,16 +62,16 @@ const helpSubmenu = [
} }
}, },
{ {
label: `Ask for Help`, label: `&Ask for Help`,
click() { click() {
shell.openExternal('https://gitter.im/saenzramiro/rambox'); shell.openExternal('https://gitter.im/saenzramiro/rambox');
} }
}, },
{ {
label: `Tools`, label: `&Tools`,
submenu: [ submenu: [
{ {
label: `Clear Cache`, label: `&Clear Cache`,
click(item, win) { click(item, win) {
win.webContents.session.clearCache(function() { win.webContents.session.clearCache(function() {
win.reload(); win.reload();
@ -79,7 +79,7 @@ const helpSubmenu = [
} }
}, },
{ {
label: `Clear Local Storage`, label: `&Clear Local Storage`,
click(item, win) { click(item, win) {
win.webContents.session.clearStorageData({ win.webContents.session.clearStorageData({
storages: ['localstorage'] storages: ['localstorage']
@ -94,7 +94,7 @@ const helpSubmenu = [
type: 'separator' type: 'separator'
}, },
{ {
label: `Donate`, label: `&Donate`,
click() { click() {
shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA'); shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA');
} }
@ -103,7 +103,7 @@ const helpSubmenu = [
let tpl = [ let tpl = [
{ {
label: 'Edit', label: '&Edit',
submenu: [ submenu: [
{ {
role: 'undo' role: 'undo'
@ -135,17 +135,17 @@ let tpl = [
] ]
}, },
{ {
label: 'View', label: '&View',
submenu: [ submenu: [
{ {
label: 'Reload', label: '&Reload',
accelerator: 'CmdOrCtrl+R', accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) { click(item, focusedWindow) {
if (focusedWindow) focusedWindow.reload(); if (focusedWindow) focusedWindow.reload();
} }
}, },
{ {
label: 'Reload current Service', label: '&Reload current Service',
accelerator: 'CmdOrCtrl+Shift+R', accelerator: 'CmdOrCtrl+Shift+R',
click() { click() {
sendAction('reloadCurrentService'); sendAction('reloadCurrentService');
@ -166,16 +166,16 @@ let tpl = [
] ]
}, },
{ {
label: 'Window', label: '&Window',
role: 'window', role: 'window',
submenu: [ submenu: [
{ {
label: 'Minimize', label: '&Minimize',
accelerator: 'CmdOrCtrl+M', accelerator: 'CmdOrCtrl+M',
role: 'minimize' role: 'minimize'
}, },
{ {
label: 'Close', label: '&Close',
accelerator: 'CmdOrCtrl+W', accelerator: 'CmdOrCtrl+W',
role: 'close' role: 'close'
}, },
@ -186,7 +186,7 @@ let tpl = [
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(item, focusedWindow) { click(item, focusedWindow) {
if (focusedWindow) focusedWindow.webContents.toggleDevTools(); if (focusedWindow) focusedWindow.webContents.toggleDevTools();
@ -195,7 +195,7 @@ let tpl = [
] ]
}, },
{ {
label: 'Help', label: '&Help',
role: 'help' role: 'help'
} }
]; ];
@ -253,7 +253,7 @@ if (process.platform === 'darwin') {
}); });
} else { } else {
tpl.unshift({ tpl.unshift({
label: 'File', label: '&File',
submenu: [ submenu: [
{ {
role: 'quit' role: 'quit'
@ -264,7 +264,7 @@ if (process.platform === 'darwin') {
type: 'separator' type: 'separator'
}); });
helpSubmenu.push({ helpSubmenu.push({
label: `Check for updates...`, label: `&Check for updates...`,
click(item, win) { click(item, win) {
const webContents = win.webContents; const webContents = win.webContents;
const send = webContents.send.bind(win.webContents); const send = webContents.send.bind(win.webContents);
@ -278,7 +278,7 @@ if (process.platform === 'darwin') {
} }
}); });
helpSubmenu.push({ helpSubmenu.push({
label: `About ${appName}`, label: `&About ${appName}`,
click() { click() {
sendAction('showAbout') sendAction('showAbout')
} }

Loading…
Cancel
Save