Skip to content

Commit

Permalink
ja: Format /web/api using Prettier (part 4) (#14668)
Browse files Browse the repository at this point in the history
* ja: Format /web/api using Prettier (part 4)

* Add a .gitignore for a file with bad changes

* Fix formatting
  • Loading branch information
queengooborg authored Aug 4, 2023
1 parent 7d0e3ea commit eed44f9
Show file tree
Hide file tree
Showing 80 changed files with 688 additions and 599 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ build/
/files/fr/web/css/place-self/index.md
/files/fr/web/javascript/reference/global_objects/array/includes/index.md
/files/fr/web/javascript/reference/global_objects/intl/displaynames/of/index.md
/files/ja/web/api/audiobuffer/audiobuffer/index.md
/files/ko/web/css/css_flow_layout/block_and_inline_layout_in_normal_flow/index.md
/files/pt-br/learn/server-side/django/forms/index.md
/files/ru/learn/server-side/django/forms/index.md
Expand Down
8 changes: 4 additions & 4 deletions files/ja/web/api/dompointreadonly/frompoint_static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ slug: Web/API/DOMPointReadOnly/fromPoint_static
## 構文

```js
fromPoint(sourcePoint)
fromPoint(sourcePoint);
```

### 引数
Expand Down Expand Up @@ -41,17 +41,17 @@ fromPoint(sourcePoint)
このサンプルでは、 {{domxref("DOMPointReadOnly.x", "x")}} と {{domxref("DOMPointReadOnly.y", "y")}} に使用する値を含むインラインオブジェクトを指定し、二次元点を作成しています。 `z``w` プロパティは既定値(それぞれ `0``1`)のままにしておくことが可能です。

```js
const point2D = DOMPointReadOnly.fromPoint({x: 25, y: 25})
const point2D = DOMPointReadOnly.fromPoint({ x: 25, y: 25 });
```

### 既存の点を使用して三次元の点を作成します。

この例では、 {{domxref("DOMPoint")}} を用いて、 {{domxref("DOMPoint.DOMPoint", "new DOMPoint()")}} 型の点 `origPoint` を作成しています。そして、その点は `fromPoint()` の入力として使用され、新しい点 `newPoint` を作成します。

```js
const origPoint = new DOMPoint(25, 25, 100, 0.5)
const origPoint = new DOMPoint(25, 25, 100, 0.5);

const newPoint = DOMPointReadOnly.fromPoint(origPoint)
const newPoint = DOMPointReadOnly.fromPoint(origPoint);
```

## 仕様書
Expand Down
2 changes: 1 addition & 1 deletion files/ja/web/api/dompointreadonly/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const point3DPerspective = new DOMPointReadOnly(100, 100, 100, 1.0);
もう一つの選択肢は、静的な {{domxref("DOMPointReadOnly.fromPoint()")}} メソッドを使用する方法です。

```js
const point = DOMPointReadOnly.fromPoint({x: 100, y: 100, z: 50, w: 1.0});
const point = DOMPointReadOnly.fromPoint({ x: 100, y: 100, z: 50, w: 1.0 });
```

## コンストラクター
Expand Down
2 changes: 1 addition & 1 deletion files/ja/web/api/dompointreadonly/tojson/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ slug: Web/API/DOMPointReadOnly/toJSON
## 構文

```js
toJSON()
toJSON();
```

### 引数
Expand Down
4 changes: 2 additions & 2 deletions files/ja/web/api/domrect/fromrect_static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ slug: Web/API/DOMRect/fromRect_static
## 構文

```js
fromRect()
fromRect(rectangle)
fromRect();
fromRect(rectangle);
```

### 引数
Expand Down
5 changes: 3 additions & 2 deletions files/ja/web/api/domrectreadonly/domrectreadonly/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ slug: Web/API/DOMRectReadOnly/DOMRectReadOnly
## 構文

```js
new DOMRectReadOnly(x, y, width, height)
new DOMRectReadOnly(x, y, width, height);
```

### 引数

- _x_
- : `DOMRectReadOnly` の原点の `x` 座標です。
- _y_

- : `DOMRectReadOnly` の原点の `y` 座標です。

- _width_
Expand All @@ -30,7 +31,7 @@ new DOMRectReadOnly(x, y, width, height)
新しい `DOMPoint` を作成するには、次のようなコード行を実行します。

```js
const myDOMRect = new DOMRectReadOnly(0, 0, 100, 100)
const myDOMRect = new DOMRectReadOnly(0, 0, 100, 100);
// 'myDOMRect' をコンソールで実行すると、次の行が返ります。
// DOMRect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 }
```
Expand Down
4 changes: 2 additions & 2 deletions files/ja/web/api/domrectreadonly/fromrect_static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ slug: Web/API/DOMRectReadOnly/fromRect_static
## 構文

```js
fromRect()
fromRect(rectangle)
fromRect();
fromRect(rectangle);
```

### 引数
Expand Down
2 changes: 1 addition & 1 deletion files/ja/web/api/dragevent/datatransfer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ l10n:

```js
function processData(d) {
// データを処理...
// データを処理...
}

dragTarget.addEventListener(
Expand Down
1 change: 1 addition & 0 deletions files/ja/web/api/eckeygenparams/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ l10n:
- `name`
- : 文字列。使用したいアルゴリズムにより、`ECDSA` または `ECDH` に設定するべきです。
- `namedCurve`

- : 使用する楕円曲線の名前を表す文字列です。以下の [NIST](https://www.nist.gov/) によって承認された曲線の名前のうちいずれかを指定できます。

- `P-256`
Expand Down
2 changes: 1 addition & 1 deletion files/ja/web/api/element/append/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ console.log(div.childNodes); // NodeList [ <p> ]
let div = document.createElement("div");
div.append("Some text");

console.log(div.textContent) // "Some text"
console.log(div.textContent); // "Some text"
```

### 要素とテキストの追加
Expand Down
32 changes: 18 additions & 14 deletions files/ja/web/api/element/compositionend_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ slug: Web/API/Element/compositionend_event
```js
const inputElement = document.querySelector('input[type="text"]');

inputElement.addEventListener('compositionend', (event) => {
inputElement.addEventListener("compositionend", (event) => {
console.log(`generated characters were: ${event.data}`);
});
```
Expand All @@ -46,8 +46,11 @@ inputElement.addEventListener('compositionend', (event) => {

```html
<div class="control">
<label for="name">On macOS, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label>
<input type="text" id="example" name="example">
<label for="name"
>On macOS, click in the textbox below,<br />
then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label
>
<input type="text" id="example" name="example" />
</div>

<div class="event-log">
Expand All @@ -59,7 +62,7 @@ inputElement.addEventListener('compositionend', (event) => {

```css hidden
body {
padding: .2rem;
padding: 0.2rem;
display: grid;
grid-template-areas: "control log";
}
Expand All @@ -76,12 +79,13 @@ body {
resize: none;
}

label, button {
label,
button {
display: block;
}

input[type="text"] {
margin: .5rem 0;
margin: 0.5rem 0;
}

kbd {
Expand All @@ -95,20 +99,20 @@ kbd {

```js
const inputElement = document.querySelector('input[type="text"]');
const log = document.querySelector('.event-log-contents');
const clearLog = document.querySelector('.clear-log');
const log = document.querySelector(".event-log-contents");
const clearLog = document.querySelector(".clear-log");

clearLog.addEventListener('click', () => {
log.textContent = '';
clearLog.addEventListener("click", () => {
log.textContent = "";
});

function handleEvent(event) {
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
}

inputElement.addEventListener('compositionstart', handleEvent);
inputElement.addEventListener('compositionupdate', handleEvent);
inputElement.addEventListener('compositionend', handleEvent);
inputElement.addEventListener("compositionstart", handleEvent);
inputElement.addEventListener("compositionupdate", handleEvent);
inputElement.addEventListener("compositionend", handleEvent);
```

#### 結果
Expand Down
32 changes: 18 additions & 14 deletions files/ja/web/api/element/compositionstart_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ slug: Web/API/Element/compositionstart_event
```js
const inputElement = document.querySelector('input[type="text"]');

inputElement.addEventListener('compositionstart', (event) => {
inputElement.addEventListener("compositionstart", (event) => {
console.log(`generated characters were: ${event.data}`);
});
```
Expand All @@ -46,8 +46,11 @@ inputElement.addEventListener('compositionstart', (event) => {

```html
<div class="control">
<label for="name">On macOS, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label>
<input type="text" id="example" name="example">
<label for="name"
>On macOS, click in the textbox below,<br />
then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label
>
<input type="text" id="example" name="example" />
</div>

<div class="event-log">
Expand All @@ -59,7 +62,7 @@ inputElement.addEventListener('compositionstart', (event) => {

```css hidden
body {
padding: .2rem;
padding: 0.2rem;
display: grid;
grid-template-areas: "control log";
}
Expand All @@ -76,12 +79,13 @@ body {
resize: none;
}

label, button {
label,
button {
display: block;
}

input[type="text"] {
margin: .5rem 0;
margin: 0.5rem 0;
}

kbd {
Expand All @@ -95,20 +99,20 @@ kbd {

```js
const inputElement = document.querySelector('input[type="text"]');
const log = document.querySelector('.event-log-contents');
const clearLog = document.querySelector('.clear-log');
const log = document.querySelector(".event-log-contents");
const clearLog = document.querySelector(".clear-log");

clearLog.addEventListener('click', () => {
log.textContent = '';
clearLog.addEventListener("click", () => {
log.textContent = "";
});

function handleEvent(event) {
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
}

inputElement.addEventListener('compositionstart', handleEvent);
inputElement.addEventListener('compositionupdate', handleEvent);
inputElement.addEventListener('compositionend', handleEvent);
inputElement.addEventListener("compositionstart", handleEvent);
inputElement.addEventListener("compositionupdate", handleEvent);
inputElement.addEventListener("compositionend", handleEvent);
```

#### 結果
Expand Down
32 changes: 18 additions & 14 deletions files/ja/web/api/element/compositionupdate_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ slug: Web/API/Element/compositionupdate_event
```js
const inputElement = document.querySelector('input[type="text"]');

inputElement.addEventListener('compositionupdate', (event) => {
inputElement.addEventListener("compositionupdate", (event) => {
console.log(`generated characters were: ${event.data}`);
});
```
Expand All @@ -46,8 +46,11 @@ inputElement.addEventListener('compositionupdate', (event) => {

```html
<div class="control">
<label for="name">On macOS, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label>
<input type="text" id="example" name="example">
<label for="name"
>On macOS, click in the textbox below,<br />
then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label
>
<input type="text" id="example" name="example" />
</div>

<div class="event-log">
Expand All @@ -59,7 +62,7 @@ inputElement.addEventListener('compositionupdate', (event) => {

```css hidden
body {
padding: .2rem;
padding: 0.2rem;
display: grid;
grid-template-areas: "control log";
}
Expand All @@ -76,12 +79,13 @@ body {
resize: none;
}

label, button {
label,
button {
display: block;
}

input[type="text"] {
margin: .5rem 0;
margin: 0.5rem 0;
}

kbd {
Expand All @@ -95,20 +99,20 @@ kbd {

```js
const inputElement = document.querySelector('input[type="text"]');
const log = document.querySelector('.event-log-contents');
const clearLog = document.querySelector('.clear-log');
const log = document.querySelector(".event-log-contents");
const clearLog = document.querySelector(".clear-log");

clearLog.addEventListener('click', () => {
log.textContent = '';
clearLog.addEventListener("click", () => {
log.textContent = "";
});

function handleEvent(event) {
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
log.textContent = log.textContent + `${event.type}: ${event.data}\n`;
}

inputElement.addEventListener('compositionstart', handleEvent);
inputElement.addEventListener('compositionupdate', handleEvent);
inputElement.addEventListener('compositionend', handleEvent);
inputElement.addEventListener("compositionstart", handleEvent);
inputElement.addEventListener("compositionupdate", handleEvent);
inputElement.addEventListener("compositionend", handleEvent);
```

#### 結果
Expand Down
6 changes: 3 additions & 3 deletions files/ja/web/api/element/fullscreenchange_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ l10n:
このイベント名を {{domxref("EventTarget.addEventListener", "addEventListener()")}} などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

```js
addEventListener('fullscreenchange', (event) => { });
addEventListener("fullscreenchange", (event) => {});

onfullscreenchange = (event) => { };
onfullscreenchange = (event) => {};
```

## イベント型
Expand Down Expand Up @@ -52,7 +52,7 @@ onfullscreenchange = (event) => { };
### JavaScript

```js
function fullscreenchanged (event) {
function fullscreenchanged(event) {
// document.fullscreenElement は、全画面モードにある要素があれば
// それを指します。要素がなければ、このプロパティの値は null に
// あります。
Expand Down
2 changes: 1 addition & 1 deletion files/ja/web/api/element/getelementsbytagname/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ getElementsByTagName(tagName)

### 返値

*生きた* {{domxref("HTMLCollection")}} で、タグ名が一致する要素が出現順で入ります。要素が見つからなかった場合は `HTMLCollection` は空になります。
_生きた_ {{domxref("HTMLCollection")}} で、タグ名が一致する要素が出現順で入ります。要素が見つからなかった場合は `HTMLCollection` は空になります。

##

Expand Down
Loading

0 comments on commit eed44f9

Please sign in to comment.