📝 Fix coding style issues

* Adjust line length to `80`
* Normalize whitespaces

[ci skip]
This commit is contained in:
Plusb Preco 2016-04-22 22:53:26 +09:00
parent 0282180b9c
commit 4f4277e25e
20 changed files with 73 additions and 54 deletions

View file

@ -523,8 +523,8 @@ This method returns `true` if the system is in Dark Mode, and `false` otherwise.
* `result` Integer - Result of import.
Imports the certificate in pkcs12 format into the platform certificate store.
`callback` is called with the `result` of import operation, a value of `0` indicates
success while any other value indicates failure according to chromium [net_error_list](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h).
`callback` is called with the `result` of import operation, a value of `0`
indicates success while any other value indicates failure according to chromium [net_error_list](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h).
### `app.commandLine.appendSwitch(switch[, value])`

View file

@ -5,8 +5,11 @@ This module provides an interface for the `Squirrel` auto-updater framework.
You can quickly launch a multi-platform release server for distributing your
application by using one of these projects:
- [electron-release-server][electron-release-server]: *A fully featured, self-hosted release server for electron applications, compatible with auto-updater*
- [squirrel-updates-server][squirrel-updates-server]: *A simple node.js server for Squirrel.Mac and Squirrel.Windows which uses GitHub releases*
- [electron-release-server][electron-release-server]: *A fully featured,
self-hosted release server for electron applications, compatible with
auto-updater*
- [squirrel-updates-server][squirrel-updates-server]: *A simple node.js server
for Squirrel.Mac and Squirrel.Windows which uses GitHub releases*
## Platform notices

View file

@ -311,7 +311,8 @@ Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/d
is invoked. These are typically related to keyboard media keys or browser
commands, as well as the "Back" button built into some mice on Windows.
Commands are lowercased with underscores replaced with hyphens and the `APPCOMMAND_` prefix stripped off.
Commands are lowercased with underscores replaced with hyphens and the
`APPCOMMAND_` prefix stripped off.
e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
```js
@ -677,9 +678,9 @@ window.
### `win.setSheetOffset(offset)`
Changes the attachment point for sheets on Mac OS X. By default, sheets are attached
just below the window frame, but you may want to display them beneath a HTML-rendered
toolbar. For example:
Changes the attachment point for sheets on Mac OS X. By default, sheets are
attached just below the window frame, but you may want to display them beneath
a HTML-rendered toolbar. For example:
```
var toolbarRect = document.getElementById('toolbar').getBoundingClientRect();
@ -823,8 +824,8 @@ cleared
* `description` String - a description that will be provided to Accessibility
screen readers
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some
sort of application status or to passively notify the user.
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
convey some sort of application status or to passively notify the user.
### `win.setHasShadow(hasShadow)` _OS X_

View file

@ -60,7 +60,8 @@ ID.
## crash-reporter Payload
The crash reporter will send the following data to the `submitURL` as a `multipart/form-data` `POST`:
The crash reporter will send the following data to the `submitURL` as
a `multipart/form-data` `POST`:
* `ver` String - The version of Electron.
* `platform` String - e.g. 'win32'.

View file

@ -12,7 +12,8 @@ const dialog = require('electron').dialog;
console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]}));
```
The Dialog is opened from Electron's main thread. If you want to use the dialog object from a renderer process, remember to access it using the remote:
The Dialog is opened from Electron's main thread. If you want to use the dialog
object from a renderer process, remember to access it using the remote:
```javascript
const dialog = require('electron').remote.dialog;

View file

@ -1,6 +1,9 @@
# Frameless Window
A frameless window is a window that has no [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of the window, like toolbars, that are not a part of the web page. These are options on the [`BrowserWindow`](browser-window.md) class.
A frameless window is a window that has no
[chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of
the window, like toolbars, that are not a part of the web page. These are
options on the [`BrowserWindow`](browser-window.md) class.
## Create a frameless window
@ -38,7 +41,8 @@ var win = new BrowserWindow({ transparent: true, frame: false });
### Limitations
* You can not click through the transparent area. We are going to introduce an
API to set window shape to solve this, see [our issue](https://github.com/electron/electron/issues/1335) for details.
API to set window shape to solve this, see
[our issue](https://github.com/electron/electron/issues/1335) for details.
* Transparent windows are not resizable. Setting `resizable` to `true` may make
a transparent window stop working on some platforms.
* The `blur` filter only applies to the web page, so there is no way to apply

View file

@ -22,9 +22,10 @@ Create a new `MenuItem` with the following method:
* `sublabel` String
* `accelerator` [Accelerator](accelerator.md)
* `icon` [NativeImage](native-image.md)
* `enabled` Boolean - If false, the menu item will be greyed out and unclickable.
* `enabled` Boolean - If false, the menu item will be greyed out and
unclickable.
* `visible` Boolean - If false, the menu item will be entirely hidden.
* `checked` Boolean - Should only be specified for `checkbox` or `radio` type
* `checked` Boolean - Should only be specified for `checkbox` or `radio` type
menu items.
* `submenu` Menu - Should be specified for `submenu` type menu items. If
`submenu` is specified, the `type: 'submenu'` can be omitted. If the value
@ -61,7 +62,8 @@ On OS X `role` can also have following additional values:
* `help` - The submenu is a "Help" menu
* `services` - The submenu is a "Services" menu
When specifying `role` on OS X, `label` and `accelerator` are the only options that will affect the MenuItem. All other options will be ignored.
When specifying `role` on OS X, `label` and `accelerator` are the only options
that will affect the MenuItem. All other options will be ignored.
## Instance Properties
@ -79,4 +81,3 @@ selected. You can add a `click` function to do additional work.
A `radio` menu item will turn on its `checked` property when clicked, and
will turn off that property for all adjacent items in the same menu. Again,
you can add a `click` function for additional behavior.

View file

@ -10,8 +10,8 @@ upstream node:
* `process.resourcesPath` String - Path to JavaScript source code.
* `process.mas` Boolean - For Mac App Store build, this value is `true`, for
other builds it is `undefined`.
* `process.windowsStore` Boolean - If the app is running as a Windows Store app (appx), this value is `true`, for
other builds it is `undefined`.
* `process.windowsStore` Boolean - If the app is running as a Windows Store app
(appx), this value is `true`, for other builds it is `undefined`.
## Events

View file

@ -447,8 +447,9 @@ The `callback` has to be called with an `response` object:
* `cancel` Boolean
* `responseHeaders` Object (optional) - When provided, the server is assumed
to have responded with these headers.
* `statusLine` String (optional) - Should be provided when overriding `responseHeaders`
to change header status otherwise original response header's status will be used.
* `statusLine` String (optional) - Should be provided when overriding
`responseHeaders` to change header status otherwise original response
header's status will be used.
#### `ses.webRequest.onResponseStarted([filter, ]listener)`

View file

@ -11,8 +11,8 @@ both processes.
The basic rule is: if a module is [GUI][gui] or low-level system related, then
it should be only available in the main process. You need to be familiar with
the concept of [main process vs. renderer process](../tutorial/quick-start.md#the-main-process) scripts to be
able to use those modules.
the concept of [main process vs. renderer process](../tutorial/quick-start.md#the-main-process)
scripts to be able to use those modules.
The main process script is just like a normal Node.js script:

View file

@ -278,7 +278,8 @@ Emitted when media is paused or done playing.
### Event: 'did-change-theme-color'
Emitted when a page's theme color changes. This is usually due to encountering a meta tag:
Emitted when a page's theme color changes. This is usually due to encountering
a meta tag:
```html
<meta name='theme-color' content='#ff0000'>
@ -355,7 +356,8 @@ Returns whether web page is still loading resources.
### `webContents.isLoadingMainFrame()`
Returns whether the main frame (and not just iframes or frames within it) is still loading.
Returns whether the main frame (and not just iframes or frames within it) is
still loading.
### `webContents.isWaitingForResponse()`
@ -525,9 +527,10 @@ Inserts `text` to the focused element.
uppercase letter followed by a lowercase or non-letter.
Accepts several other intra-word matches, defaults to `false`.
Starts a request to find all matches for the `text` in the web page and returns an `Integer`
representing the request id used for the request. The result of the request can be
obtained by subscribing to [`found-in-page`](web-contents.md#event-found-in-page) event.
Starts a request to find all matches for the `text` in the web page and returns
an `Integer` representing the request id used for the request. The result of
the request can be obtained by subscribing to
[`found-in-page`](web-contents.md#event-found-in-page) event.
### `webContents.stopFindInPage(action)`

View file

@ -47,17 +47,17 @@ and displays a "loading..." message during the load time:
## CSS Styling Notes
Please note that the `webview` tag's style uses `display:flex;` internally to
ensure the child `object` element fills the full height and width of its `webview`
container when used with traditional and flexbox layouts (since v0.36.11). Please
do not overwrite the default `display:flex;` CSS property, unless specifying
Please note that the `webview` tag's style uses `display:flex;` internally to
ensure the child `object` element fills the full height and width of its `webview`
container when used with traditional and flexbox layouts (since v0.36.11). Please
do not overwrite the default `display:flex;` CSS property, unless specifying
`display:inline-flex;` for inline layout.
`webview` has issues being hidden using the `hidden` attribute or using `display: none;`.
It can cause unusual rendering behaviour within its child `browserplugin` object
and the web page is reloaded, when the `webview` is un-hidden, as opposed to just
becoming visible again. The recommended approach is to hide the `webview` using
CSS by zeroing the `width` & `height` and allowing the element to shrink to the 0px
`webview` has issues being hidden using the `hidden` attribute or using `display: none;`.
It can cause unusual rendering behaviour within its child `browserplugin` object
and the web page is reloaded, when the `webview` is un-hidden, as opposed to just
becoming visible again. The recommended approach is to hide the `webview` using
CSS by zeroing the `width` & `height` and allowing the element to shrink to the 0px
dimensions via `flex`.
```html
@ -70,7 +70,7 @@ dimensions via `flex`.
webview.hide {
flex: 0 1;
width: 0px;
height: 0px;
height: 0px;
}
</style>
```