]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Make code more JS-style
authorCheng Zhao <zcbenz@gmail.com>
Thu, 22 Oct 2015 06:24:09 +0000 (14:24 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 22 Oct 2015 06:24:09 +0000 (14:24 +0800)
docs/api/app.md

index 9c9afdee763a523376488f69e51024f9b86b3e82..95aa80b6dc8345b57b71db9bd1253da121fd4496 100644 (file)
@@ -245,7 +245,7 @@ Returns the current application locale.
 Resolves the proxy information for `url`. The `callback` will be called with
 `callback(proxy)` when the request is performed.
 
-### `app.addRecentDocument(path)`
+### `app.addRecentDocument(path)` _OS X_ _Windows_
 
 * `path` String
 
@@ -254,7 +254,7 @@ Adds `path` to the recent documents list.
 This list is managed by the OS. On Windows you can visit the list from the task
 bar, and on OS X you can visit it from dock menu.
 
-### `app.clearRecentDocuments()`
+### `app.clearRecentDocuments()` _OS X_ _Windows_
 
 Clears the recent documents list.
 
@@ -308,10 +308,9 @@ primary window focused and non-minimized.
 `false` if the secondary process should retry sending it or it failed.
 
 ```js
+var myWindow;
 app.on('ready', function() {
-  var myWindow;
-
-  var shouldQuit = app.makeSingleInstance(function(command_line, working_directory) {
+  var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
     // Someone tried to run a second instance, we should focus our window
     if (myWindow) {
       if (myWindow.isMinimized()) myWindow.restore();