From b5aa2a31a10e13df15205c9fae4970feda570539 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Apr 2015 13:27:19 -0700 Subject: [PATCH 1/5] Make full screen menu a toggler --- atom/browser/default_app/default_app.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/atom/browser/default_app/default_app.js b/atom/browser/default_app/default_app.js index dffe03c628e1..7eeebf9188bc 100644 --- a/atom/browser/default_app/default_app.js +++ b/atom/browser/default_app/default_app.js @@ -112,11 +112,12 @@ app.on('ready', function() { click: function() { mainWindow.restart(); } }, { - label: 'Enter Fullscreen', - click: function() { mainWindow.setFullScreen(true); } + label: 'Toggle Full Screen', + accelerator: 'Ctrl+Command+F', + click: function() { mainWindow.setFullScreen(!mainWindow.isFullScreen()); } }, { - label: 'Toggle DevTools', + label: 'Toggle Developer Tools', accelerator: 'Alt+Command+I', click: function() { mainWindow.toggleDevTools(); } }, @@ -173,11 +174,12 @@ app.on('ready', function() { click: function() { mainWindow.restart(); } }, { - label: '&Enter Fullscreen', - click: function() { mainWindow.setFullScreen(true); } + label: 'Toggle &Full Screen', + accelerator: 'F11', + click: function() { mainWindow.setFullScreen(!mainWindow.isFullScreen()); } }, { - label: '&Toggle DevTools', + label: 'Toggle &Developer Tools', accelerator: 'Alt+Ctrl+I', click: function() { mainWindow.toggleDevTools(); } }, From e3c21424de55c36d7dd7851c8733fc8af863f436 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Apr 2015 13:32:46 -0700 Subject: [PATCH 2/5] Add default help menu --- atom/browser/default_app/default_app.js | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/atom/browser/default_app/default_app.js b/atom/browser/default_app/default_app.js index 7eeebf9188bc..263f563ce52f 100644 --- a/atom/browser/default_app/default_app.js +++ b/atom/browser/default_app/default_app.js @@ -145,6 +145,23 @@ app.on('ready', function() { }, ] }, + { + label: 'Help', + submenu: [ + { + label: 'Documentation', + click: function() { require('shell').openExternal('https://github.com/atom/electron/tree/master/docs#readme') } + }, + { + label: 'Community Discussions', + click: function() { require('shell').openExternal('https://discuss.atom.io/c/electron') } + }, + { + label: 'Search Issues', + click: function() { require('shell').openExternal('https://github.com/atom/electron/issues') } + } + ] + } ]; menu = Menu.buildFromTemplate(template); @@ -185,6 +202,23 @@ app.on('ready', function() { }, ] }, + { + label: 'Help', + submenu: [ + { + label: 'Documentation', + click: function() { require('shell').openExternal('https://github.com/atom/electron/tree/master/docs#readme') } + }, + { + label: 'Community Discussions', + click: function() { require('shell').openExternal('https://discuss.atom.io/c/electron') } + }, + { + label: 'Search Issues', + click: function() { require('shell').openExternal('https://github.com/atom/electron/issues') } + } + ] + } ]; menu = Menu.buildFromTemplate(template); From f4a27f699a4a50268c8469b0d27198b4764c876b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Apr 2015 13:37:34 -0700 Subject: [PATCH 3/5] Add help menu to electron site --- atom/browser/default_app/default_app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atom/browser/default_app/default_app.js b/atom/browser/default_app/default_app.js index 263f563ce52f..e471b23ae621 100644 --- a/atom/browser/default_app/default_app.js +++ b/atom/browser/default_app/default_app.js @@ -148,6 +148,10 @@ app.on('ready', function() { { label: 'Help', submenu: [ + { + label: 'Learn More', + click: function() { require('shell').openExternal('http://electron.atom.io') } + }, { label: 'Documentation', click: function() { require('shell').openExternal('https://github.com/atom/electron/tree/master/docs#readme') } @@ -205,6 +209,10 @@ app.on('ready', function() { { label: 'Help', submenu: [ + { + label: 'Learn More', + click: function() { require('shell').openExternal('http://electron.atom.io') } + }, { label: 'Documentation', click: function() { require('shell').openExternal('https://github.com/atom/electron/tree/master/docs#readme') } From da07e72f20df2862c3bdd7cc6c3db61be58a9f68 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Apr 2015 14:02:49 -0700 Subject: [PATCH 4/5] Add -h/--help usage message --- atom/browser/default_app/main.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index bdb88a7cc29a..231e254bdc79 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -11,11 +11,14 @@ app.on('window-all-closed', function() { // Parse command line options. var argv = process.argv.slice(1); -var option = { file: null, version: null, webdriver: null }; +var option = { file: null, help: null, version: null, webdriver: null }; for (var i in argv) { if (argv[i] == '--version' || argv[i] == '-v') { option.version = true; break; + } else if (argv[i] == '--help' || argv[i] == '-h') { + option.help = true; + break; } else if (argv[i] == '--test-type=webdriver') { option.webdriver = true; } else if (argv[i][0] == '-') { @@ -58,7 +61,16 @@ if (option.file && !option.webdriver) { } } } else if (option.version) { - console.log('v' + process.versions['electron']); + console.log('v' + process.versions.electron); + process.exit(0); +} else if (option.help) { + var helpMessage = "Electron v" + process.versions.electron + " - Cross Platform Desktop Application Shell\n\n"; + helpMessage += "Usage: electron [options] [path]\n\n"; + helpMessage += "Specify a path to the Electron app to open\n\n"; + helpMessage += "Options:\n"; + helpMessage += " -h, --help Print this usage message.\n"; + helpMessage += " -v, --version Print the version."; + console.log(helpMessage); process.exit(0); } else { require('./default_app.js'); From fdfd8807a0787c5ed323253b7e4051f5cdba8da6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 24 Apr 2015 14:17:15 -0700 Subject: [PATCH 5/5] Tweak path docs --- atom/browser/default_app/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index 231e254bdc79..5664fac4cd21 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -66,7 +66,8 @@ if (option.file && !option.webdriver) { } else if (option.help) { var helpMessage = "Electron v" + process.versions.electron + " - Cross Platform Desktop Application Shell\n\n"; helpMessage += "Usage: electron [options] [path]\n\n"; - helpMessage += "Specify a path to the Electron app to open\n\n"; + helpMessage += "A path to an Electron application may be specified. The path must be to \n"; + helpMessage += "an index.js file or to a folder containing a package.json or index.js file.\n\n"; helpMessage += "Options:\n"; helpMessage += " -h, --help Print this usage message.\n"; helpMessage += " -v, --version Print the version.";