diff --git a/.prettierignore b/.prettierignore index 833f4eda29f860..04ef8e773802f9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -54,24 +54,11 @@ build/ /files/ja/web/svg/**/*.md # ko -/files/ko/glossary/**/*.md /files/ko/learn/**/*.md -/files/ko/learn/css/**/*.md -/files/ko/learn/html/**/*.md -/files/ko/learn/javascript/**/*.md -/files/ko/learn/server-side/**/*.md -/files/ko/mdn/**/*.md -/files/ko/mozilla/**/*.md -/files/ko/mozilla/add-ons/**/*.md -/files/ko/mozilla/add-ons/webextensions/api/**/*.md -/files/ko/mozilla/firefox**/*.md -/files/ko/web/**/*.md /files/ko/web/api/**/*.md /files/ko/web/css/**/*.md /files/ko/web/html/**/*.md -/files/ko/web/http/**/*.md /files/ko/web/javascript/**/*.md -/files/ko/web/svg/**/*.md # pt-br /files/pt-br/web/api/**/*.md diff --git a/files/ja/web/api/audio_output_devices_api/index.md b/files/ja/web/api/audio_output_devices_api/index.md new file mode 100644 index 00000000000000..acb922fc1b436d --- /dev/null +++ b/files/ja/web/api/audio_output_devices_api/index.md @@ -0,0 +1,108 @@ +--- +title: Audio Output Devices API +slug: Web/API/Audio_Output_Devices_API +l10n: + sourceCommit: d458c221e219591afaa91beafd544d5eb40e790b +--- + +{{DefaultAPISidebar("Audio Output Devices API")}}{{securecontext_header}}{{SeeCompatTable}} + +**Audio Output Devices API** により、ウェブアプリケーションがユーザーに音声の再生に用いる出力デバイスを選択させることができます。 + +## 概念と使用法 + +オペレーティングシステムには、ユーザーが音声をスピーカーから再生するか、Bluetooth ヘッドセットから再生するか、もしくは他の音声出力デバイスから再生するかを選ぶことができる機能があるものが多いです。 +この API は、ウェブページ内でアプリケーションが同様の機能を提供することを可能にします。 + +権限ポリシーで許可されている場合でも、ユーザーは一部の出力デバイスから音声を再生するべきではない場所に居る可能性があるので、特定の音声出力デバイスへのアクセスには明示的なユーザーの許可が必要です。 + +この API は、ドキュメントの [`Permissions-Policy`](/ja/docs/Web/HTTP/Headers/Permissions-Policy) HTTP ヘッダーの [`speaker-selection`](/ja/docs/Web/HTTP/Headers/Permissions-Policy/speaker-selection) ディレクティブによって許可されている場合、ユーザーが希望する音声出力デバイスを選択できるようにする [`MediaDevices.selectAudioOutput()`](/ja/docs/Web/API/MediaDevices/selectAudioOutput) メソッドを提供します。 +これにより選択されたデバイスはユーザーの許可が得られるので、[`MediaDevices.enumerateDevices()`](/ja/docs/Web/API/MediaDevices/enumerateDevices) により列挙したり、[`HTMLMediaElement.setSinkId()`](/ja/docs/Web/API/HTMLMediaElement/setSinkId) により音声出力デバイスとして設定したりできるようになります。 + +音声デバイスは、自由に接続したり切断したりできます。 +このような変化に対応したいアプリケーションは、[`devicechange` イベント](/ja/docs/Web/API/MediaDevices/devicechange_event)を監視し、[`enumerateDevices()`](/ja/docs/Web/API/MediaDevices/enumerateDevices) を用いて `sinkId` が返されたデバイスに含まれているかを判定できます。 +これにより、たとえば、再生を停止したり再開したりできます。 + +## インターフェイス + +### インターフェイスの拡張 + +Audio Output Devices API は以下の API を拡張し、以下の機能を追加します。 + +#### MediaDevices + +- [`MediaDevices.selectAudioOutput()`](/ja/docs/Web/API/MediaDevices/selectAudioOutput) + - : このメソッドは、ユーザーに特定の音声出力デバイス、たとえばスピーカーやヘッドセットを選択させます。 + デバイスを選択すると、そのデバイスを使用するユーザーの許可が得られ、ID を含むそのデバイスの情報を返します。 + +#### HTMLMediaElement + +- [`HTMLMediaElement.setSinkId()`](/ja/docs/Web/API/HTMLMediaElement/setSinkId) + - : このメソッドは、出力用の音声デバイスの ID を設定し、許可が得られていればそのデバイスを使用するようにします。 +- [`HTMLMediaElement.sinkId`](/ja/docs/Web/API/HTMLMediaElement/sinkId) + - : このプロパティは出力に使用されている音声デバイスの一意な ID を返します。デフォルトのユーザーエージェントデバイスが使用されている場合は空文字列を返します。 + +## セキュリティの要件 + +この API へのアクセスは、以下の制限を受けます。 + +- 全てのメソッドやプロパティは[安全なコンテキスト](/ja/docs/Web/Security/Secure_Contexts)でのみ呼びだせます。 + +- [`MediaDevices.selectAudioOutput()`](/ja/docs/Web/API/MediaDevices/selectAudioOutput) はユーザーから選択されたデバイスを音声の出力先として使用する許可を得ます。 + + - アクセスは HTTP の[権限ポリシー](/ja/docs/Web/HTTP/Permissions_Policy)の [`speaker-selection`](/ja/docs/Web/HTTP/Headers/Permissions-Policy/speaker-selection) により制限される可能性があります。 + - [ユーザーによる一時的な有効化](/ja/docs/Web/Security/User_activation)が必要です。 + このメソッドを呼び出すには、ユーザーがページまたは UI 要素を操作する必要があります。 + +- [`HTMLMediaElement.setSinkId()`](/ja/docs/Web/API/HTMLMediaElement/setSinkId) は許可された ID を音声の出力先として設定します。 + + - アクセスは HTTP の[権限ポリシー](/ja/docs/Web/HTTP/Permissions_Policy)の [`speaker-selection`](/ja/docs/Web/HTTP/Headers/Permissions-Policy/speaker-selection) により制限される可能性があります。 + - デフォルト以外のデバイス ID を設定するにはユーザーの許可が必要です。 + - この許可は、`MediaDevices.selectAudioOutput()` によって開くプロンプトで選択することで得られます。 + - ユーザーが [`MediaDevices.getUserMedia()`](/ja/docs/Web/API/MediaDevices/getUserMedia) により既に同じグループのメディア入力デバイスを使用することを許可している場合、出力デバイスを使用する許可が暗黙的に得られます。 + +許可の状態は、[Permissions API](/ja/docs/Web/API/Permissions_API) の [`navigator.permissions.query()`](/ja/docs/Web/API/Permissions/query) に `speaker-selection` 権限を含む `permissionDescriptor` を渡すことで取得できます。 + +## 例 + +これは、ボタンのクリックにより呼び出される関数の中で `selectAudioOutput()` を用い、選択されたデバイスを音声の出力先に設定する例です。 + +このコードは、まず `selectAudioOutput()` に対応しているかを確認します。対応している場合、それを用いて出力先を選択し、[デバイス ID](/ja/docs/Web/API/MediaDeviceInfo/deviceId) を返します。 +そして、音声をデフォルトの出力先を用いて再生し、`setSinkId()` を呼び出して出力先を選択されたデバイスに切り替えます。 + +```js +document.querySelector("#myButton").addEventListener("click", async () => { + if (!navigator.mediaDevices.selectAudioOutput) { + console.log("selectAudioOutput() に未対応か、安全なコンテキストではありません。"); + return; + } + + // デバイスを選択するためのプロンプトを表示する + const audioDevice = await navigator.mediaDevices.selectAudioOutput(); + + // audio 要素を作成し、デフォルトのデバイスで音声の再生を開始する + const audio = document.createElement("audio"); + audio.src = "https://example.com/audio.mp3"; + audio.play(); + + // 出力先を選択された音声出力デバイスに切り替える + audio.setSinkId(audioDevice.deviceId); +}); +``` + +出力の詳細を記録すると、たとえば以下の出力が得られます。 + +```js +console.log( + `${audioDevice.kind}: ${audioDevice.label} id = ${audioDevice.deviceId}`, +); +// audiooutput: Realtek Digital Output (Realtek(R) Audio) id = 0wE6fURSZ20H0N2NbxqgowQJLWbwo+5ablCVVJwRM3k= +``` + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} diff --git a/files/ja/web/api/urlsearchparams/append/index.md b/files/ja/web/api/urlsearchparams/append/index.md index fa443ac31ff897..def14de36a2026 100644 --- a/files/ja/web/api/urlsearchparams/append/index.md +++ b/files/ja/web/api/urlsearchparams/append/index.md @@ -1,11 +1,14 @@ --- -title: URLSearchParams.append() +title: "URLSearchParams: append() メソッド" +short-title: append() slug: Web/API/URLSearchParams/append +l10n: + sourceCommit: acfe8c9f1f4145f77653a2bc64a9744b001358dc --- {{ApiRef("URL API")}} -{{domxref("URLSearchParams")}} インターフェイスの **`append()`** メソッドは、指定されたキー/値のペアを新しい検索パラメーターとして追加します。 +**`append()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、指定されたキー/値のペアを新しい検索パラメーターとして追加します。 下にある例に示すように、同じキーが複数回追加された場合、各値がパラメーター文字列に複数回現れます。 @@ -13,41 +16,41 @@ slug: Web/API/URLSearchParams/append ## 構文 -``` -URLSearchParams.append(name, value) +```js-nolint +append(name, value) ``` -### パラメーター +### 引数 - name - : 追加するパラメーターの名前。 - value - : 追加するパラメーターの値。 -### 戻り値 +### 返値 -無効。 +なし ({{jsxref("undefined")}})。 ## 例 ```js -let url = new URL('https://example.com?foo=1&bar=2'); -let params = new URLSearchParams(url.search.slice(1)); +let url = new URL("https://example.com?foo=1&bar=2"); +let params = new URLSearchParams(url.search); // 2番目の foo パラメーターを追加します。 -params.append('foo', 4); -// クエリー文字列は現在: 'foo=1&bar=2&foo=4' +params.append("foo", 4); +// クエリー文字列はこうなる: 'foo=1&bar=2&foo=4' ``` -## 仕様 +## 仕様書 {{Specifications}} ## ブラウザーの互換性 -{{Compat("api.URLSearchParams.append")}} +{{Compat}} ## 関連項目 -- その他の URL 関連インターフェイス: {{domxref("URL")}}、{{domxref("HTMLHyperlinkElementUtils")}}。 -- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developers.google.com/web/updates/2016/01/urlsearchparams?hl=en)(英語) +- {{domxref("URL")}} +- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developer.chrome.com/blog/urlsearchparams/)(英語) diff --git a/files/ja/web/api/urlsearchparams/delete/index.md b/files/ja/web/api/urlsearchparams/delete/index.md index 9b204c685e3b8f..b48b97456ad6af 100644 --- a/files/ja/web/api/urlsearchparams/delete/index.md +++ b/files/ja/web/api/urlsearchparams/delete/index.md @@ -1,43 +1,106 @@ --- -title: URLSearchParams.delete() +title: "URLSearchParams: delete() メソッド" +short-title: delete() slug: Web/API/URLSearchParams/delete +l10n: + sourceCommit: 92ae2da158d7462890f6d76d9bd605468bd906eb --- {{ApiRef("URL API")}} -{{domxref("URLSearchParams")}} インターフェイスの **`delete()`** メソッドは、すべての検索パラメーターのリストから、指定された検索パラメーターとそれに関連するすべての値を削除します。 +**`delete()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、すべての検索パラメーターのリストから、指定された検索パラメーターとそれに関連するすべての値を削除します。 -{{availableinworkers}} +パラメーター名とオプションの値は、パラメーターの照合に使用されます。 +パラメーター名のみが指定された場合、その名前に一致するすべての検索パラメーターが、関連する値とともに削除されます。 +パラメーター名と値の両方が指定された場合、パラメーター名と値の両方に一致するすべての検索パラメーターが削除されます。 + +{{AvailableInWorkers}} ## 構文 -``` -URLSearchParams.delete(name) +```js-nolint +delete(name) +delete(name, value) ``` -### パラメーター +### 引数 -- name +- `name` - : 削除するパラメーターの名前。 +- `value` {{optional_inline}} + - : パラメーターを削除するために、指定された名前とともにパラメーターが一致しなければならない値。 -### 戻り値 +### 返値 -無効 +なし ({{jsxref("undefined")}})。 ## 例 +### 指定された名前のすべてのパラメーターを削除 + +この例では、特定の名前を持つクエリーパラメーター(および値)をすべて削除する方法を示します。 + +```html hidden +

+```
+
+```js hidden
+const logElement = document.getElementById("log");
+function log(text) {
+  logElement.innerText += `${text}\n`;
+}
+```
+
 ```js
-let url = new URL('https://example.com?foo=1&bar=2&foo=3');
-let params = new URLSearchParams(url.search.slice(1));
+const url = new URL("https://example.com?foo=1&bar=2&foo=3");
+const params = new URLSearchParams(url.search);
+log(`Query string (before):\t ${params}`);
+params.delete("foo");
+log(`Query string (after):\t ${params}`);
+```
+
+以下のログは、`foo` という名前を持つパラメータがすべて削除されていることを示しています。
+
+{{EmbedLiveSample('Delete all parameters with specified name', '100%', '50')}}
+
+### 指定した名前と値を持つパラメーターの削除
 
-// foo パラメーターを削除します。
-params.delete('foo'); // クエリー文字列は現在: 'bar=2'
+この例では、特定の名前と値に一致するクエリーパラメーターを削除する方法を示します。
+
+```html hidden
+

+```
+
+```js hidden
+const logElement = document.getElementById("log");
+function log(text) {
+  logElement.innerText += `${text}\n`;
+}
+```
+
+```js
+const url = new URL("https://example.com?foo=1&bar=2&foo=3&foo=1");
+const params = new URLSearchParams(url.search);
+log(`Query string (before):\t ${params}`);
+params.delete("foo", "1");
+log(`Query string (after):\t ${params}`);
 ```
 
-## 仕様
+パラメーターの `name` と `value` の両方が一致するパラメーターがすべて削除されるはずです(上記のように、同じ名前と値を持つパラメーターを 2 つ指定する理由はありません)。
+
+{{EmbedLiveSample('Delete parameters with specified name and value', '100%', '50')}}
+
+ブラウザーが `value` オプションに対応している場合、"after" の文字列は `bar=2&foo=3` となります。
+そうでない場合、結果は前の例 (`bar=2`) と同じになります。
+
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.delete")}}
+{{Compat}}
+
+## 関連情報
+
+- [`URLSearchParams` のポリフィル (`core-js`)](https://github.com/zloirock/core-js#url-and-urlsearchparams)
diff --git a/files/ja/web/api/urlsearchparams/entries/index.md b/files/ja/web/api/urlsearchparams/entries/index.md
index eb8ad15c0cbae3..b18590d4f3f400 100644
--- a/files/ja/web/api/urlsearchparams/entries/index.md
+++ b/files/ja/web/api/urlsearchparams/entries/index.md
@@ -1,55 +1,58 @@
 ---
-title: URLSearchParams.entries()
+title: "URLSearchParams: entries() メソッド"
+short-title: entries()
 slug: Web/API/URLSearchParams/entries
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{APIRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`entries()`** メソッドは、このオブジェクトに含まれるすべてのキー/値のペアを反復処理できる {{jsxref("Iteration_protocols","iterator")}} を返します。 各ペアのキーと値は {{domxref("USVString")}} オブジェクトです。
+**`entries()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドは、このオブジェクトに含まれるすべてのキー/値のペアを反復処理できる{{jsxref("Iteration_protocols","イテレーター")}}を返します。それぞれのペアのキーと値は文字列です。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-searchParams.entries();
+```js-nolint
+entries()
 ```
 
-### パラメーター
+### 引数
 
 なし。
 
-### 戻り値
+### 返値
 
-{{jsxref("Iteration_protocols","iterator")}} を返します。
+{{jsxref("Iteration_protocols","イテレーター")}}を返します。
 
 ## 例
 
 ```js
 // テスト用の URLSearchParams オブジェクトの作成
-var searchParams = new URLSearchParams("key1=value1&key2=value2");
+const searchParams = new URLSearchParams("key1=value1&key2=value2");
 
 // キー/値のペアの表示
-for(var pair of searchParams.entries()) {
-   console.log(pair[0]+ ', '+ pair[1]);
+for (const [key, value] of searchParams.entries()) {
+  console.log(`${key}, ${value}`);
 }
 ```
 
 結果は次のとおりです。
 
-```
+```plain
 key1, value1
 key2, value2
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.entries")}}
+{{Compat}}
 
-## 関連項目
+## 関連情報
 
 - {{domxref("URL")}} インターフェイス。
diff --git a/files/ja/web/api/urlsearchparams/foreach/index.md b/files/ja/web/api/urlsearchparams/foreach/index.md
index 1fedfcdddd73fe..0ad41ccfad4ea1 100644
--- a/files/ja/web/api/urlsearchparams/foreach/index.md
+++ b/files/ja/web/api/urlsearchparams/foreach/index.md
@@ -1,55 +1,70 @@
 ---
-title: URLSearchParams.forEach()
+title: "URLSearchParams: forEach() メソッド"
+short-title: forEach()
 slug: Web/API/URLSearchParams/forEach
+l10n:
+  sourceCommit: 592f6ec42e54981b6573b58ec0343c9aa8cbbda8
 ---
 
 {{APIRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`forEach()`** メソッドを使用すると、コールバック関数を介してこのオブジェクトに含まれるすべての値を反復処理できます。
+**`forEach()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドを使用すると、コールバック関数を介してこのオブジェクトに含まれるすべての値を反復処理できます。
 
 {{availableinworkers}}
 
 ## 構文
 
+```js-nolint
+forEach(callback)
+forEach(callback, thisArg)
 ```
-searchParams.forEach(callback);
-```
 
-### パラメーター
+### 引数
+
+- `callback`
+
+  - : それぞれの要素に対して実行される関数で、以下の引数が渡されます。
 
-- callback
-  - : 各パラメーターに対して実行されるコールバック関数。 そのパラメーターとして提供されたパラメーター値を使用します。
+    - `value`
+      - : `URLSearchParams` オブジェクトで現在処理中の項目の値です。
+    - `key`
+      - : `URLSearchParams` オブジェクトで現在処理中の項目のキーです。
+    - `searchParams`
+      - : `forEach()` が呼び出された `URLSearchParams` オブジェクトです。
 
-### 戻り値
+- `thisArg` {{optional_inline}}
+  - : `callback` の実行中に `this` として使用される値です。
 
-無効。
+### 返値
+
+なし ({{jsxref("undefined")}})。
 
 ## 例
 
 ```js
 // テスト用の URLSearchParams オブジェクトの作成
-var searchParams = new URLSearchParams("key1=value1&key2=value2");
+const searchParams = new URLSearchParams("key1=value1&key2=value2");
 
 // 値の記録
-searchParams.forEach(function(value, key) {
+searchParams.forEach((value, key) => {
   console.log(value, key);
 });
 ```
 
 結果は次のとおりです。
 
-```
+```plain
 value1 key1
 value2 key2
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.forEach")}}
+{{Compat}}
 
 ## 関連項目
 
diff --git a/files/ja/web/api/urlsearchparams/get/index.md b/files/ja/web/api/urlsearchparams/get/index.md
index a277e4965a3ccb..9f0f29d2179f30 100644
--- a/files/ja/web/api/urlsearchparams/get/index.md
+++ b/files/ja/web/api/urlsearchparams/get/index.md
@@ -1,49 +1,52 @@
 ---
-title: URLSearchParams.get()
+title: "URLSearchParams: get() メソッド"
+short-title: get()
 slug: Web/API/URLSearchParams/get
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{ApiRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェースの **`get()`** メソッドは、指定された検索パラメーターに関連付けられた最初の値を返します。
+**`get()`** は {{domxref("URLSearchParams")}} インターフェースのメソッドで、指定された検索パラメーターに関連付けられた最初の値を返します。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-URLSearchParams.get(name)
+```js-nolint
+get(name)
 ```
 
-### パラメーター
+### 引数
 
-- name
+- `name`
   - : 返すパラメーターの名前。
 
-### 戻り値
+### 返値
 
-指定された検索パラメーターが見つかった場合、{{domxref("USVString")}}。 それ以外の場合、**`null`**。
+指定された検索パラメーターが見つかった場合は文字列です。それ以外の場合は **`null`** です。
 
 ## 例
 
-ページの URL が `https://example.com/?name=Jonathan&age=18` の場合、次を使用して 'name' および 'age' のパラメーターを解析できます。
+ページの URL が `https://example.com/?name=Jonathan&age=18` の場合、次のように 'name' および 'age' のパラメーターを解釈できます。
 
-```
-let params = new URLSearchParams(document.location.search.substring(1));
-let name = params.get("name"); // 文字列 "Jonathan" です。
-let age = parseInt(params.get("age"), 10); // 数値 18 です。
+```js
+let params = new URLSearchParams(document.location.search);
+let name = params.get("name"); // 文字列 "Jonathan" です
+let age = parseInt(params.get("age"), 10); // 数値 18 です
 ```
 
 クエリー文字列に存在しないパラメーターを要求すると、**`null`** が返されます。
 
-```
+```js
 let address = params.get("address"); // null
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.get")}}
+{{Compat}}
diff --git a/files/ja/web/api/urlsearchparams/getall/index.md b/files/ja/web/api/urlsearchparams/getall/index.md
index 5f635f1a77b955..902d8816d1fe6d 100644
--- a/files/ja/web/api/urlsearchparams/getall/index.md
+++ b/files/ja/web/api/urlsearchparams/getall/index.md
@@ -1,45 +1,48 @@
 ---
-title: URLSearchParams.getAll()
+title: "URLSearchParams: getAll() メソッド"
+short-title: getAll()
 slug: Web/API/URLSearchParams/getAll
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{ApiRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`getAll()`** メソッドは、指定された検索パラメーターに関連付けられたすべての値を配列として返します。
+**`getAll()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、指定された検索パラメーターに関連付けられたすべての値を配列として返します。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-URLSearchParams.getAll(name)
+```js-nolint
+getAll(name)
 ```
 
-### パラメーター
+### 引数
 
-- name
+- `name`
   - : 返すパラメーターの名前。
 
-### 戻り値
+### 返値
 
-{{domxref("USVString")}} の配列。
+文字列の配列です。
 
 ## 例
 
 ```js
-let url = new URL('https://example.com?foo=1&bar=2');
-let params = new URLSearchParams(url.search.slice(1));
+let url = new URL("https://example.com?foo=1&bar=2");
+let params = new URLSearchParams(url.search);
 
-// 2番目の foo パラメーターを追加します。
-params.append('foo', 4);
+// 2 つ目の foo パラメーターを追加します。
+params.append("foo", 4);
 
-console.log(params.getAll('foo')) // ["1","4"] を表示します。
+console.log(params.getAll("foo")); // ["1","4"] を表示します。
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.getAll")}}
+{{Compat}}
diff --git a/files/ja/web/api/urlsearchparams/has/index.md b/files/ja/web/api/urlsearchparams/has/index.md
index 1fb9c83ea7526a..d41956fe6ca514 100644
--- a/files/ja/web/api/urlsearchparams/has/index.md
+++ b/files/ja/web/api/urlsearchparams/has/index.md
@@ -1,42 +1,109 @@
 ---
-title: URLSearchParams.has()
+title: "URLSearchParams: has() メソッド"
+short-title: has()
 slug: Web/API/URLSearchParams/has
+l10n:
+  sourceCommit: 92ae2da158d7462890f6d76d9bd605468bd906eb
 ---
 
 {{ApiRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`has()`** メソッドは、指定された名前のパラメーターが存在するかどうかを示す {{jsxref("Boolean")}} を返します。
+**`has()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドは、指定された名前のパラメーターが存在するかどうかを示す論理値を返します。
 
-{{availableinworkers}}
+パラメーター名とオプションの値は、パラメーターの照合に使用されます。
+パラメーター名のみが指定された場合、このメソッドはクエリー文字列内のいずれかのパラメーターがその名前と一致した場合に `true` を返し、それ以外の場合は `false` を返します。
+パラメーター名と値の両方が指定された場合、あるパラメーターの名前と値の両方が一致した場合に `true` を返します。
+
+{{AvailableInWorkers}}
 
 ## 構文
 
-```
-var hasName = URLSearchParams.has(name)
+```js-nolint
+has(name)
+has(name, value)
 ```
 
-### パラメーター
+### 引数
 
-- name
-  - : 検索するパラメーターの名前。
+- `name`
+  - : 照合するパラメーターの名前です。
+- `value`
+  - : パラメーターの値で、指定された名前と一緒に照合されます。
 
-### 戻り値
+### 返値
 
-{{jsxref("Boolean")}}。
+論理値です。
 
 ## 例
 
+### 指定された名前のパラメーターをチェック
+
+この例では、クエリー文字列に特定の名前のパラメーターがあるかどうかをチェックする方法を示します。
+
+```html hidden
+

+```
+
+```js hidden
+const logElement = document.getElementById("log");
+function log(text) {
+  logElement.innerText += `${text}\n`;
+}
+```
+
 ```js
-let url = new URL('https://example.com?foo=1&bar=2');
-let params = new URLSearchParams(url.search.slice(1));
+const url = new URL("https://example.com?foo=1&bar=2&foo=3");
+const params = new URLSearchParams(url.search);
 
-params.has('bar') === true; // true
+// has() はそのパラメーターがクエリー文字列にある場合に true を返す
+log(`bar?:\t${params.has("bar")}`);
+log(`bark?:\t${params.has("bark")}`);
+log(`foo?:\t${params.has("foo")}`);
 ```
 
-## 仕様
+以下のログは、パラメーター `bar`、`bark`、`foo` がクエリー文字列内に存在するかどうかを示しています。
+
+{{EmbedLiveSample('Check for parameter with specified name', '100%', '80')}}
+
+### 指定された名前と値を持つパラメーターをチェック
+
+この例では、クエリー文字列に特定の名前と値の両方が一致するパラメーターがあるかどうかをチェックする方法を示します。
+
+```html hidden
+

+```
+
+```js hidden
+const logElement = document.getElementById("log");
+function log(text) {
+  logElement.innerText += `${text}\n`;
+}
+```
+
+```js
+const url = new URL("https://example.com?foo=1&bar=2&foo=3");
+const params = new URLSearchParams(url.search);
+
+// has() は、一致する名前と値を持つパラメーターがクエリー文字列内にある場合に true を返します。
+log(`bar=1?:\t${params.has("bar", "1")}`);
+log(`bar=2?:\t${params.has("bar", "2")}`);
+log(`foo=4?:\t${params.has("foo", "4")}`);
+```
+
+パラメーター名が `bar` で値が `2` のもののみが一致するので、上記の 2 番目の値のみが `true` になるはずです。
+
+{{EmbedLiveSample('Check for parameter with specified name and value', '100%', '80')}}
+
+ブラウザーが `value` オプションに対応していない場合、このメソッドは名前に一致し、結果はすべて `true` になるはずです。
+
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.has")}}
+{{Compat}}
+
+## 関連情報
+
+- [`URLSearchParams` のポリフィル (`core-js`)](https://github.com/zloirock/core-js#url-and-urlsearchparams)
diff --git a/files/ja/web/api/urlsearchparams/index.md b/files/ja/web/api/urlsearchparams/index.md
index c6393684ca8f67..f8f29bc445377e 100644
--- a/files/ja/web/api/urlsearchparams/index.md
+++ b/files/ja/web/api/urlsearchparams/index.md
@@ -1,17 +1,21 @@
 ---
 title: URLSearchParams
 slug: Web/API/URLSearchParams
+l10n:
+  sourceCommit: 92ae2da158d7462890f6d76d9bd605468bd906eb
 ---
 
 {{ApiRef("URL API")}}
 
 **`URLSearchParams`** インターフェイスは URL のクエリー文字列の操作に役立つメソッドを定義します。
 
-`URLSearchParams` を実装するオブジェクトは 直接 {{jsxref("Statements/for...of", "for...of")}} で使うことができます。例えば次の 2 行は等価です。
+`URLSearchParams` を実装しているオブジェクトは、{{jsxref("Statements/for...of", "for...of")}} 構造の中で直接使用して、キーと値のペアをクエリー文字列に現れるのと同じ順序で反復処理することができます。例えば次の 2 行は等価です。
 
 ```js
-for (const [key, value] of mySearchParams) {}
-for (const [key, value] of mySearchParams.entries()) {}
+for (const [key, value] of mySearchParams) {
+}
+for (const [key, value] of mySearchParams.entries()) {
+}
 ```
 
 {{availableinworkers}}
@@ -21,77 +25,144 @@ for (const [key, value] of mySearchParams.entries()) {}
 - {{domxref("URLSearchParams.URLSearchParams", 'URLSearchParams()')}}
   - : `URLSearchParams` オブジェクトを返すコンストラクターです。
 
-## メソッド
+## インスタンスプロパティ
+
+- {{domxref("URLSearchParams.size", 'size')}}
+  - : 検索パラメーター項目の総数を示します。
+
+## インスタンスメソッド
 
 - {{domxref("URLSearchParams.append()")}}
   - : 指定されたキーと値のペアを新しい検索パラメーターとして追加します。
 - {{domxref("URLSearchParams.delete()")}}
-  - : 指定された検索パラメーターとその値を、検索パラメーターのリストからすべて削除します。
+  - : 指定された名前と値に一致する検索パラメーターを、検索パラメーターのリストからすべて削除します。
 - {{domxref("URLSearchParams.entries()")}}
-  - : このオブジェクトに含まれるすべてのキーと値のペアを列挙するための {{jsxref("Iteration_protocols","iterator")}} を返します。
+  - : このオブジェクトに含まれるすべてのキーと値のペアを、クエリー文字列に現れるのと同じ順序で反復処理することができる{{jsxref("Iteration_protocols","イテレーター")}}を返します。
 - {{domxref("URLSearchParams.forEach()")}}
-  - : コールバック関数を介して、このオブジェクトに含まれるすべての値を列挙します。
+  - : コールバック関数を介して、このオブジェクトに含まれるすべての値を反復処理します。
 - {{domxref("URLSearchParams.get()")}}
   - : 指定された検索パラメーターに対応する最初の値を返します。
 - {{domxref("URLSearchParams.getAll()")}}
   - : 指定された検索パラメーターに対応するすべての値を返します。
 - {{domxref("URLSearchParams.has()")}}
-  - : 指定された検索パラメーターが存在するかを表す {{jsxref("Boolean")}} 値を返します。
+  - : 指定されたパラメーター、またはパラメーターと値のペアが存在するかどうかを示す論理値を返します。
 - {{domxref("URLSearchParams.keys()")}}
-  - : このオブジェクトに含まれるすべてのキーと値のペアの**キー**を列挙する {{jsxref("Iteration_protocols", "iterator")}} を返します。
+  - : このオブジェクトに含まれるすべてのキーと値のペアのキーを反復処理する {{jsxref("Iteration_protocols", "イテレーター")}}を返します。
 - {{domxref("URLSearchParams.set()")}}
-  - : 指定された検索パラメーターに対応する値を設定します。複数の値が存在していた場合、それらは削除されます。
+  - : 指定された検索パラメーターに結び付けられた値を指定された値に設定します。複数の値が存在していた場合、他のものは削除されます。
 - {{domxref("URLSearchParams.sort()")}}
   - : すべてのキーと値のペアを、キーを基準にソートします。
 - {{domxref("URLSearchParams.toString()")}}
   - : URL で使用するのに適したクエリー文字列を返します。
 - {{domxref("URLSearchParams.values()")}}
-  - : このオブジェクトに含まれるすべてのキーと値のペアの**値**を列挙する {{jsxref("Iteration_protocols", "iterator")}} を返します。
+  - : このオブジェクトに含まれるすべてのキーと値のペアの値を反復処理する {{jsxref("Iteration_protocols", "イテレーター")}}を返します。
 
 ## 例
 
 ```js
-var paramsString = "q=URLUtils.searchParams&topic=api";
-var searchParams = new URLSearchParams(paramsString);
+const paramsString = "q=URLUtils.searchParams&topic=api";
+const searchParams = new URLSearchParams(paramsString);
 
-// 検索パラメーターを列挙する
-for (let p of searchParams) {
+// 検索パラメーターの列挙
+for (const p of searchParams) {
   console.log(p);
 }
 
-searchParams.has("topic") === true; // true
-searchParams.get("topic") === "api"; // true
-searchParams.getAll("topic"); // ["api"]
-searchParams.get("foo") === null; // true
-searchParams.append("topic", "webdev");
-searchParams.toString(); // "q=URLUtils.searchParams&topic=api&topic=webdev"
-searchParams.set("topic", "More webdev");
-searchParams.toString(); // "q=URLUtils.searchParams&topic=More+webdev"
-searchParams.delete("topic");
-searchParams.toString(); // "q=URLUtils.searchParams"
+console.log(searchParams.has("topic")); // true
+console.log(searchParams.has("topic", "fish")); // false
+console.log(searchParams.get("topic") === "api"); // true
+console.log(searchParams.getAll("topic")); // ["api"]
+console.log(searchParams.get("foo") === null); // true
+console.log(searchParams.append("topic", "webdev"));
+console.log(searchParams.toString()); // "q=URLUtils.searchParams&topic=api&topic=webdev"
+console.log(searchParams.set("topic", "More webdev"));
+console.log(searchParams.toString()); // "q=URLUtils.searchParams&topic=More+webdev"
+console.log(searchParams.delete("topic"));
+console.log(searchParams.toString()); // "q=URLUtils.searchParams"
+```
+
+```js
+// 検索パラメーターはオブジェクトにすることもできる
+const paramsObj = { foo: "bar", baz: "bar" };
+const searchParams = new URLSearchParams(paramsObj);
+
+console.log(searchParams.toString()); // "foo=bar&baz=bar"
+console.log(searchParams.has("foo")); // true
+console.log(searchParams.get("foo")); // "bar"
 ```
 
-### コラム
+### 重複する検索パラメーター
 
-`URLSearchParams` コンストラクターは完全な URL をパースしません。ただし、先頭に `?` が存在すれば、読み飛ばします。
+```js
+const paramStr = "foo=bar&foo=baz";
+const searchParams = new URLSearchParams(paramStr);
+
+console.log(searchParams.toString()); // "foo=bar&foo=baz"
+console.log(searchParams.has("foo")); // true
+console.log(searchParams.get("foo")); // bar (最初の値のみを返す)
+console.log(searchParams.getAll("foo")); // ["bar", "baz"]
+```
+
+### URL の解釈なし
+
+`URLSearchParams` コンストラクターは URL 全体を解釈しません。しかし、文字列から最初の `?` 以降が存在すれば、削除します。
 
 ```js
-var paramsString1 = "http://example.com/search?query=%40";
-var searchParams1 = new URLSearchParams(paramsString1);
+const paramsString1 = "http://example.com/search?query=%40";
+const searchParams1 = new URLSearchParams(paramsString1);
+
+console.log(searchParams1.has("query")); // false
+console.log(searchParams1.has("http://example.com/search?query")); // true
 
-searchParams1.has("query"); // false
-searchParams1.has("http://example.com/search?query"); // true
+console.log(searchParams1.get("query")); // null
+console.log(searchParams1.get("http://example.com/search?query")); // "@" (decodeURIComponent('%40') と同じ)
 
-searchParams1.get("query"); // null
-searchParams1.get("http://example.com/search?query"); // "@" (equivalent to decodeURIComponent('%40'))
+const paramsString2 = "?query=value";
+const searchParams2 = new URLSearchParams(paramsString2);
+console.log(searchParams2.has("query")); // true
+
+const url = new URL("http://example.com/search?query=%40");
+const searchParams3 = new URLSearchParams(url.search);
+console.log(searchParams3.has("query")); // true
+```
 
-var paramsString2 = "?query=value";
-var searchParams2 = new URLSearchParams(paramsString2);
-searchParams2.has("query"); // true
+### プラス記号の温存
 
-var url = new URL("http://example.com/search?query=%40");
-var searchParams3 = new URLSearchParams(url.search);
-searchParams3.has("query") // true
+`URLSearchParams` コンストラクターはプラス記号 (`+`) をスペースとして解釈します。以下の例では、[16 進エスケープシーケンス](/ja/docs/Web/JavaScript/Reference/Lexical_grammar#16_進エスケープシーケンス) を使って、URL 検索パラメーターに格納する必要のあるバイナリデータ(各バイトが情報を持つ)を含む文字列を模倣しています。`btoa()` でエンコードされた文字列は `+` を含んでおり、 `URLSearchParams` では温存されないことに注意してください。
+
+```js
+const rawData = "\x13à\x17@\x1F\x80";
+const base64Data = btoa(rawData); // 'E+AXQB+A'
+
+const searchParams = new URLSearchParams(`bin=${base64Data}`); // 'bin=E+AXQB+A'
+const binQuery = searchParams.get("bin"); // 'E AXQB A', '+' はスペースに置き換えられる
+
+console.log(atob(binQuery) === rawData); // false
+```
+
+You can avoid this by encoding the data with the {{jsxref("encodeURIComponent", "encodeURIComponent()")}}.
+
+```js
+const rawData = "\x13à\x17@\x1F\x80";
+const base64Data = btoa(rawData); // 'E+AXQB+A'
+const encodedBase64Data = encodeURIComponent(base64Data); // 'E%2BAXQB%2BA'
+
+const searchParams = new URLSearchParams(`bin=${encodedBase64Data}`); // 'bin=E%2BAXQB%2BA'
+const binQuery = searchParams.get("bin"); // 'E+AXQB+A'
+
+console.log(atob(binQuery) === rawData); // true
+```
+
+### 空の値と値なし
+
+`URLSearchParams` は `=` の後に何もないパラメーターと、`=` もないパラメーターの区別をしません。
+
+```js
+const emptyVal = new URLSearchParams("foo=&bar=baz");
+console.log(emptyVal.get("foo")); // returns ''
+const noEquals = new URLSearchParams("foo&bar=baz");
+console.log(noEquals.get("foo")); // also returns ''
+console.log(noEquals.toString()); // 'foo=&bar=baz'
 ```
 
 ## 仕様書
@@ -100,9 +171,10 @@ searchParams3.has("query") // true
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams")}}
+{{Compat}}
 
 ## 関連情報
 
+- [`URLSearchParams` のポリフィル (`core-js`)](https://github.com/zloirock/core-js#url-and-urlsearchparams)
 - {{domxref("URL")}} インターフェイス。
-- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developers.google.com/web/updates/2016/01/urlsearchparams?hl=en) (英語)
+- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developer.chrome.com/blog/urlsearchparams/) (英語)
diff --git a/files/ja/web/api/urlsearchparams/keys/index.md b/files/ja/web/api/urlsearchparams/keys/index.md
index 05bbfd2fc70b81..085f633303e61d 100644
--- a/files/ja/web/api/urlsearchparams/keys/index.md
+++ b/files/ja/web/api/urlsearchparams/keys/index.md
@@ -1,55 +1,58 @@
 ---
-title: URLSearchParams.keys()
+title: "URLSearchParams: keys() メソッド"
+short-title: keys()
 slug: Web/API/URLSearchParams/keys
+l10n:
+  sourceCommit: 592f6ec42e54981b6573b58ec0343c9aa8cbbda8
 ---
 
 {{APIRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`keys()`** メソッドは、このオブジェクトに含まれるすべてのキーを反復処理できる {{jsxref("Iteration_protocols",'iterator')}} を返します。 キーは {{domxref("USVString")}} オブジェクトです。
+**`keys()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、このオブジェクトに含まれるすべてのキーを反復処理できる{{jsxref("Iteration_protocols",'イテレーター')}}を返します。 キーは文字列です。
 
-{{availableinworkers}}
+> **メモ:** このメソッドは[ウェブワーカー](/ja/docs/Web/API/Web_Workers_API)で利用できます。
 
 ## 構文
 
-```
-searchParams.keys();
+```js-nolint
+keys()
 ```
 
-### パラメーター
+### 引数
 
 なし。
 
-### 戻り値
+### 返値
 
-{{jsxref("Iteration_protocols","iterator")}} を返します。
+{{jsxref("Iteration_protocols","イテレーター")}}を返します。
 
 ## 例
 
 ```js
 // テスト用の URLSearchParams オブジェクトの作成
-var searchParams = new URLSearchParams("key1=value1&key2=value2");
+const searchParams = new URLSearchParams("key1=value1&key2=value2");
 
 // キーの表示
-for(var key of searchParams.keys()) {
+for (const key of searchParams.keys()) {
   console.log(key);
 }
 ```
 
 結果は次のとおりです。
 
-```
+```plain
 key1
 key2
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.keys")}}
+{{Compat}}
 
 ## 関連項目
 
-- {{domxref("URL")}} インターフェイス。
+- {{domxref("URL")}} インターフェイス
diff --git a/files/ja/web/api/urlsearchparams/set/index.md b/files/ja/web/api/urlsearchparams/set/index.md
index 1a9b2f0cc3fc30..8c07626a88c96d 100644
--- a/files/ja/web/api/urlsearchparams/set/index.md
+++ b/files/ja/web/api/urlsearchparams/set/index.md
@@ -1,102 +1,49 @@
 ---
-title: URLSearchParams.set()
+title: "URLSearchParams: set() メソッド"
+short-title: set()
 slug: Web/API/URLSearchParams/set
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{ApiRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`set()`** メソッドは、指定された検索パラメーターに関連付けられた値を指定された値に設定します。 一致する値が複数ある場合、このメソッドは他の値を削除します。 検索パラメーターが存在しない場合、このメソッドはそれを作成します。
+**`set()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、指定された検索パラメーターに関連付けられた値を指定された値に設定します。一致する値が複数ある場合、このメソッドは他の値を削除します。 検索パラメーターが存在しない場合、このメソッドはそれを作成します。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-URLSearchParams.set(name, value)
+```js-nolint
+set(name, value)
 ```
 
-### パラメーター
+### 引数
 
-- name
+- `name`
   - : 設定するパラメーターの名前。
-- value
+- `value`
   - : 設定するパラメーターの値。
 
-### 戻り値
+### 返値
 
-無効。
+なし ({{jsxref("undefined")}})。
 
 ## 例
 
-次の簡単な例から始めましょう。
-
 ```js
-let url = new URL('https://example.com?foo=1&bar=2');
-let params = new URLSearchParams(url.search.slice(1));
-
-// 3番目のパラメーターを追加します。
-params.set('baz', 3);
-```
+let url = new URL("https://example.com?foo=1&bar=2");
+let params = new URLSearchParams(url.search);
 
-以下は、{{domxref("URL")}} を作成し、いくつかの検索パラメーターを設定する方法を示す実際の例です。
-
-[スクラッチパッド](/ja/docs/Tools/Scratchpad)に例をコピーして貼り付けることができます。
-
-- 41 行目:コンソールへの (debug による) 検索パラメーターのダンプを停止するにはコメントにします。
-- 43 行目:生成されたオブジェクトとその文字列表現をコンソールに (info で) ダンプします。
-- 44 行目:生成された URL で新しいウィンドウ/タブを自動的に開こうとします(コメントが解除されている場合)。
-
-```js
-'use strict'
-
-function genURL(rExp, aText, bDebug=false){
-  let theURL
-
-  theURL= new URL('https://regexr.com')
-  theURL.searchParams.set( 'expression', rExp.toString() )
-  theURL.searchParams.set( 'tool', 'replace' )
-  theURL.searchParams.set( 'input', '\u2911\u20dc' )// ⤑⃜
-  theURL.searchParams.set( 'text', aText.join('\n') )
-  if( bDebug ){
-    // キー/値のペアを表示
-    for(var pair of theURL.searchParams.entries()) {
-      console.debug(pair[0] + ' = \'' + pair[1] + '\'');
-    }
-    console.debug(theURL)
-  }
-  return theURL
-}
-var url = genURL(
-  /(^\s*\/\/|\s*[^:]\/\/).*\s*$|\s*\/\*(.|\n)+?\*\/\s*$/gm  // 単一行/複数行のコメント
-  // /(^\s*\/\/.*|\s*[^:]\/\/.*)/g                // 単一行のコメント
-  ,[
-    "これらは動作します:",
-    "",
-    "// eslint-disable-next-line no-unused-vars",
-    "lockPref(  'keyword.URL',\t\t'https://duckduckgo.com/html/?q=!+'  )\t//      test",
-    "/*",
-    "  * bla bla    ",
-    "*/",
-    "",
-    "/* bla bla */",
-    "",
-    "// bla bla ",
-    "",
-    "これらは動作しません:",
-    "console.log(\"http://foo.co.uk/\")",
-    "var url = \"http://regexr.com/foo.html?q=bar\"",
-    "alert(\"https://mediatemple.net\")",
-  ]
-  , true
-)
-console.info( url, url.toString() )
-// window.open( url, 'regex_site' )
+// 3 つ目のパラメーターを追加
+params.set("baz", 3);
+params.toString(); // "foo=1&bar=2&baz=3"
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.set")}}
+{{Compat}}
diff --git a/files/ja/web/api/urlsearchparams/size/index.md b/files/ja/web/api/urlsearchparams/size/index.md
new file mode 100644
index 00000000000000..389441cc2e5b37
--- /dev/null
+++ b/files/ja/web/api/urlsearchparams/size/index.md
@@ -0,0 +1,57 @@
+---
+title: "URLSearchParams: size プロパティ"
+short-title: size
+slug: Web/API/URLSearchParams/size
+l10n:
+  sourceCommit: acfe8c9f1f4145f77653a2bc64a9744b001358dc
+---
+
+{{APIRef("URL API")}}
+
+**`URLSearchParams.size`** は読み取り専用のプロパティで、検索パラメーターの項目の総数を示します。
+
+## 値
+
+数値で、{{domxref("URLSearchParams")}} オブジェクト内の検索パラメーターの項目の総数を示します。
+
+## 例
+
+### 検索パラメーターの項目数の取得
+
+検索パラメーターの項目の総数を取得するには、次のようにします。
+
+```js
+const searchParams = new URLSearchParams("c=4&a=2&b=3&a=1");
+searchParams.size; // 4
+```
+
+`a` 引数が 2 回与えられますが、 `size` は 3 ではなく、与えられたすべての項目の数 (4) を返すことに注意してください。固有のキーの数を取得するには、{{jsxref("Set")}} などを使用してください。
+
+```js
+[...new Set(searchParams.keys())].length; // 3
+```
+
+### 検索パラメーターが存在するかどうかをチェック
+
+size` プロパティは、検索パラメーターがあるかどうかをチェックするのに便利です。
+
+```js
+const url = new URL("https://example.com?foo=1&bar=2");
+
+if (url.searchParams.size) {
+  console.log("URL has search parameters!");
+}
+```
+
+## 仕様書
+
+{{Specifications}}
+
+## ブラウザーの互換性
+
+{{Compat}}
+
+## 関連情報
+
+- {{domxref("URL.searchParams")}}
+- [`URLSearchParams` のポリフィル (`core-js`)](https://github.com/zloirock/core-js#url-and-urlsearchparams)
diff --git a/files/ja/web/api/urlsearchparams/sort/index.md b/files/ja/web/api/urlsearchparams/sort/index.md
index 4e43fc6a2abd83..f9bd86be3235ce 100644
--- a/files/ja/web/api/urlsearchparams/sort/index.md
+++ b/files/ja/web/api/urlsearchparams/sort/index.md
@@ -1,33 +1,36 @@
 ---
-title: URLSearchParams.sort()
+title: "URLSearchParams: sort() メソッド"
+short-title: sort()
 slug: Web/API/URLSearchParams/sort
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{APIRef("URL API")}}
 
-**`URLSearchParams.sort()`** メソッドは、このオブジェクトに含まれるすべてのキー/値のペアをその場でソートし、`undefined` を返します。 ソート順は、キーの Unicode コードポイントに従っています。 このメソッドは、安定したソートアルゴリズムを使用します(つまり、等しいキーを持つキー/値のペア間の相対的な順序が保持されます)。
+**`URLSearchParams.sort()`** メソッドは、このオブジェクトに含まれるすべてのキー/値のペアをその場でソートし、`undefined` を返します。 ソート順は、キーの Unicode コードポイントに従います。 このメソッドは、安定したソートアルゴリズムを使用します(つまり、等しいキーを持つキー/値のペア間の相対的な順序が保持されます)。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-searchParams.sort();
+```js-nolint
+sort()
 ```
 
-### パラメーター
+### 引数
 
 なし。
 
-### 戻り値
+### 返値
 
-`undefined`。
+なし ({{jsxref("undefined")}})。
 
 ## 例
 
 ```js
 // テスト用の URLSearchParams オブジェクトの作成
-var searchParams = new URLSearchParams("c=4&a=2&b=3&a=1");
+const searchParams = new URLSearchParams("c=4&a=2&b=3&a=1");
 
 // キー/値のペアのソート
 searchParams.sort();
@@ -38,14 +41,14 @@ console.log(searchParams.toString());
 
 結果は次のとおりです。
 
-```
+```plain
 a=2&a=1&b=3&c=4
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.sort")}}
+{{Compat}}
diff --git a/files/ja/web/api/urlsearchparams/tostring/index.md b/files/ja/web/api/urlsearchparams/tostring/index.md
index 25048fa60ce1ce..a5e73fea3f0135 100644
--- a/files/ja/web/api/urlsearchparams/tostring/index.md
+++ b/files/ja/web/api/urlsearchparams/tostring/index.md
@@ -1,58 +1,53 @@
 ---
-title: URLSearchParams.toString()
+title: "URLSearchParams: toString() メソッド"
+short-title: toString()
 slug: Web/API/URLSearchParams/toString
+l10n:
+  sourceCommit: 0c8a320b035cf625c1df67713a94ead2e7f3aec6
 ---
 
 {{ApiRef("URL API")}}
 
-{{domxref("URLSearchParams")}} インターフェイスの **`toString()`** メソッドは、URL での使用に適したクエリー文字列を返します。
+**`toString()`** は {{domxref("URLSearchParams")}} インターフェイスのメソッドで、URL での使用に適したクエリー文字列を返します。
 
-> **メモ:** このメソッドは、疑問符のないクエリー文字列を返します。 これは、それを含む [`window.location.search`](/ja/docs/Web/API/HTMLHyperlinkElementUtils/search) とは異なります。
+> **メモ:** このメソッドは、疑問符のないクエリー文字列を返します。これは、それを含む [window.location.search](/ja/docs/Web/API/HTMLAnchorElement/search) とは異なります。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-URLSearchParams.toString()
+```js-nolint
+toString()
 ```
 
-### パラメーター
+### 引数
 
 なし。
 
-### 戻り値
+### 返値
 
-疑問符のない {{domxref("DOMString")}}。
+疑問符を除いた文字列です。(検索パラメーターが設定されていない場合は空文字列を返します。)
 
 ## 例
 
 ```js
-let url = new URL('https://example.com?foo=1&bar=2');
-let params = new URLSearchParams(url.search.slice(1));
+const url = new URL("https://example.com?foo=1&bar=2");
+const params = new URLSearchParams(url.search);
 
 // 2番目の foo パラメーターの追加
-params.append('foo', 4);
-console.log(params.toString());
-// 'foo=1&bar=2&foo=4' を表示
-
-// メモ: params は直接作成することもできます
-let url = new URL('https://example.com?foo=1&bar=2');
-let params = url.searchParams;
-
-// または、さらに単純に
-let params = new URLSearchParams('foo=1&bar=2');
+params.append("foo", 4);
+console.log(params.toString()); // 'foo=1&bar=2&foo=4' と表示
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.toString")}}
+{{Compat}}
 
 ## 関連項目
 
 - {{domxref("URL")}} インターフェイス。
-- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developers.google.com/web/updates/2016/01/urlsearchparams?hl=en)(英語)
+- [Google Developers: URLSearchParams を使用した簡単な URL 操作](https://developer.chrome.com/blog/urlsearchparams/)(英語)
diff --git a/files/ja/web/api/urlsearchparams/urlsearchparams/index.md b/files/ja/web/api/urlsearchparams/urlsearchparams/index.md
index de5f0e7c4fa94f..652ae1ae3b20b0 100644
--- a/files/ja/web/api/urlsearchparams/urlsearchparams/index.md
+++ b/files/ja/web/api/urlsearchparams/urlsearchparams/index.md
@@ -1,8 +1,9 @@
 ---
-title: URLSearchParams()
+title: "URLSearchParams: URLSearchParams() コンストラクター"
+short-title: URLSearchParams()
 slug: Web/API/URLSearchParams/URLSearchParams
 l10n:
-  sourceCommit: 670c6c5b8d75ed18722a10aecf657b7f41ecd78e
+  sourceCommit: acfe8c9f1f4145f77653a2bc64a9744b001358dc
 ---
 
 {{ApiRef("URL API")}}
@@ -18,15 +19,15 @@ new URLSearchParams()
 new URLSearchParams(options)
 ```
 
-### パラメーター
+### 引数
 
 - `options` {{optional_inline}}
   - : 以下のいずれか。
     - 文字列。先頭の文字 `'?'` は無視され、`application/x-www-form-urlencoded` 形式としてパースされます。
-    - 名前を表す文字列と値を表す文字列のペアのリテラル列、もしくはそのような文字列のペアの列を生成する[イテレーター](/ja/docs/Web/JavaScript/Guide/Iterators_and_Generators#%E3%82%A4%E3%83%86%E3%83%AC%E3%83%BC%E3%82%BF%E3%83%BC)を持つ任意のオブジェクト (たとえば {{domxref("FormData")}} のオブジェクト)。なお、{{domxref("File")}} のエントリーは (`application/x-www-form-urlencoded` 形式で期待される) ファイル名ではなく `[object File]` としてシリアライズされます。
+    - 名前を表す文字列と値を表す文字列のペアのリテラル列、もしくはそのような文字列のペアの列を生成する[イテレーター](/ja/docs/Web/JavaScript/Guide/Iterators_and_generators#%E3%82%A4%E3%83%86%E3%83%AC%E3%83%BC%E3%82%BF%E3%83%BC)を持つ任意のオブジェクト(たとえば {{domxref("FormData")}} のオブジェクト)。なお、{{domxref("File")}} のエントリーは(`application/x-www-form-urlencoded` 形式で期待される)ファイル名ではなく `[object File]` としてシリアライズされます。
     - 文字列のキーと文字列の値からなるレコード。なお、ネストには対応していません。
 
-### 戻り値
+### 返値
 
 {{domxref("URLSearchParams")}} のインスタンスです。
 
@@ -36,27 +37,30 @@ new URLSearchParams(options)
 
 ```js
 // url.search からパラメーターを取得し、コンストラクターに渡す
-const url = new URL('https://example.com?foo=1&bar=2');
+const url = new URL("https://example.com?foo=1&bar=2");
 const params1 = new URLSearchParams(url.search);
 
 // URL オブジェクトから直接 URLSearchParams オブジェクトを取得する
-const params1a = url.searchParams
+const params1a = url.searchParams;
 
 // 文字列リテラルを渡す
 const params2 = new URLSearchParams("foo=1&bar=2");
 const params2a = new URLSearchParams("?foo=1&bar=2");
 
 // ペアの列を渡す
-const params3 = new URLSearchParams([["foo", "1"], ["bar", "2"]]);
+const params3 = new URLSearchParams([
+  ["foo", "1"],
+  ["bar", "2"],
+]);
 
 // レコードを渡す
-const params4 = new URLSearchParams({"foo": "1", "bar": "2"});
+const params4 = new URLSearchParams({ foo: "1", bar: "2" });
 ```
 
 この例では、検索パラメーターを持つ既存の URL から、検索パラメーターを表すオブジェクトを用い、新しい URL を構築する方法を示します。
 
 ```js
-const url = new URL('https://example.com/?a=hello&b=world');
+const url = new URL("https://example.com/?a=hello&b=world");
 
 console.log(url.href);
 // https://example.com/?a=hello&b=world
@@ -65,14 +69,14 @@ console.log(url.origin);
 // https://example.com
 
 const add_params = {
-    c: 'a',
-    d: new String(2),
-    e: false.toString(),
-}
+  c: "a",
+  d: new String(2),
+  e: false.toString(),
+};
 
 const new_params = new URLSearchParams([
-    ...Array.from(url.searchParams.entries()), // [["a","hello"],["b","world"]]
-    ...Object.entries(add_params), // [["c","a"],["d","2"],["e","false"]]
+  ...Array.from(url.searchParams.entries()), // [["a","hello"],["b","world"]]
+  ...Object.entries(add_params), // [["c","a"],["d","2"],["e","false"]]
 ]).toString();
 console.log(new_params);
 // a=hello&b=world&c=a&d=2&e=false
@@ -82,18 +86,17 @@ const new_url = new URL(`${url.origin}${url.pathname}?${new_params}`);
 console.log(new_url.href);
 // https://example.com/?a=hello&b=world&c=a&d=2&e=false
 
-
 // (URL, Record) を受け取る関数の形式で
 const addSearchParams = (url, params = {}) =>
   new URL(
     `${url.origin}${url.pathname}?${new URLSearchParams([
       ...Array.from(url.searchParams.entries()),
       ...Object.entries(params),
-    ])}`
+    ])}`,
   );
 ```
 
-## 仕様
+## 仕様書
 
 {{Specifications}}
 
diff --git a/files/ja/web/api/urlsearchparams/values/index.md b/files/ja/web/api/urlsearchparams/values/index.md
index 54ca996b431ef2..b3e2880bbc5da2 100644
--- a/files/ja/web/api/urlsearchparams/values/index.md
+++ b/files/ja/web/api/urlsearchparams/values/index.md
@@ -1,55 +1,72 @@
 ---
-title: URLSearchParams.values()
+title: "URLSearchParams: values() メソッド"
+short-title: values()
 slug: Web/API/URLSearchParams/values
+l10n:
+  sourceCommit: 592f6ec42e54981b6573b58ec0343c9aa8cbbda8
 ---
 
 {{APIRef("URL API")}}
 
-{{domxref("URLsearchParams")}} インターフェースの **`values()`** メソッドは、このオブジェクトに含まれるすべての値を反復処理できる {{jsxref("Iteration_protocols",'iterator')}} を返します。 値は {{domxref("USVString")}} オブジェクトです。
+**`values()`** は {{domxref("URLsearchParams")}} インターフェイスのメソッドで、このオブジェクトに含まれるすべての値を反復処理できる{{jsxref("Iteration_protocols",'イテレーター')}}を返します。 値は文字列です。
 
 {{availableinworkers}}
 
 ## 構文
 
-```
-searchParams.values();
+```js-nolint
+values()
 ```
 
-### パラメーター
+### 引数
 
 なし。
 
-### 戻り値
+### 返値
 
-{{jsxref("Iteration_protocols","iterator")}} を返します。
+{{jsxref("Iteration_protocols","イテレーター")}}を返します。
 
 ## 例
 
+次の例では、`URLSearchParams` コンストラクターに URL 検索文字列を渡し、`values()` が返すイテレーターを使って値をコンソールに表示します。
+
 ```js
-// テスト用の URLSearchParams オブジェクトの作成
-var searchParams = new URLSearchParams("key1=value1&key2=value2");
+const searchParams = new URLSearchParams("key1=value1&key2=value2");
 
-// 値の表示
-for(var value of searchParams.values()) {
+for (const value of searchParams.values()) {
   console.log(value);
 }
 ```
 
 結果は次のとおりです。
 
-```
+```plain
 value1
 value2
 ```
 
-## 仕様
+この例も上記とほぼ同じですが、先にイテレーターを配列にキャストしています。
+
+```js
+const searchParams = new URLSearchParams("key1=value1&key2=value2");
+
+console.log(Array.from(searchParams.values()));
+```
+
+結果は次の通りです。
+
+```plain
+['value1', 'value2']
+```
+
+## 仕様書
 
 {{Specifications}}
 
 ## ブラウザーの互換性
 
-{{Compat("api.URLSearchParams.values")}}
+{{Compat}}
 
-## 関連項目
+## 関連情報
 
-- {{domxref("URL")}} インターフェイス。
+- {{domxref("URL")}} インターフェイス
diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt
index b72a975e2958ed..2a6de35bd180fd 100644
--- a/files/ko/_redirects.txt
+++ b/files/ko/_redirects.txt
@@ -12,10 +12,8 @@
 /ko/docs/About_the_Document_Object_Model	/ko/docs/Web/API/Document_Object_Model
 /ko/docs/Accessibility	/ko/docs/Web/Accessibility
 /ko/docs/Accessibility/ARIA	/ko/docs/Web/Accessibility/ARIA
-/ko/docs/Accessibility/An_overview_of_accessible_web_applications_and_widgets	/ko/docs/Web/Accessibility/An_overview_of_accessible_web_applications_and_widgets
 /ko/docs/Alternative_style_sheets	/ko/docs/Web/CSS/Alternative_style_sheets
 /ko/docs/Apps/Progressive	/ko/docs/Web/Progressive_web_apps
-/ko/docs/Apps/Progressive/Add_to_home_screen	/ko/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable
 /ko/docs/Apps/Progressive/App_structure	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames/App_structure
 /ko/docs/Apps/Progressive/Installable_PWAs	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Installable_PWAs
 /ko/docs/Apps/Progressive/Offline_Service_workers	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Offline_Service_workers
@@ -333,7 +331,6 @@
 /ko/docs/Learn/접근성	/ko/docs/Learn/Accessibility
 /ko/docs/Learn/접근성/HTML	/ko/docs/Learn/Accessibility/HTML
 /ko/docs/Learn/접근성/What_is_accessibility	/ko/docs/Learn/Accessibility/What_is_accessibility
-/ko/docs/Learn/접근성/모바일	/ko/docs/Learn/Accessibility/Mobile
 /ko/docs/Localization	/ko/docs/Glossary/Localization
 /ko/docs/MDN/About	/ko/docs/MDN/Writing_guidelines
 /ko/docs/MDN/Contribute/Content/Best_practices	/ko/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete
@@ -818,7 +815,6 @@
 /ko/docs/Web/Media/Formats/코덱파라미터	/ko/docs/Web/Media/Formats/codecs_parameter
 /ko/docs/Web/Performance/브라우저는_어떻게_동작하는가	/ko/docs/Web/Performance/How_browsers_work
 /ko/docs/Web/Performance/중요_렌더링_경로	/ko/docs/Web/Performance/Critical_rendering_path
-/ko/docs/Web/Progressive_web_apps/Add_to_home_screen	/ko/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable
 /ko/docs/Web/Progressive_web_apps/App_structure	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames/App_structure
 /ko/docs/Web/Progressive_web_apps/Installable_PWAs	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Installable_PWAs
 /ko/docs/Web/Progressive_web_apps/Introduction	/ko/docs/Web/Progressive_web_apps/Tutorials/js13kGames
diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json
index c683b4d182a65e..4e635cb761e4e1 100644
--- a/files/ko/_wikihistory.json
+++ b/files/ko/_wikihistory.json
@@ -735,10 +735,6 @@
     "modified": "2020-07-16T22:40:12.947Z",
     "contributors": ["dev-dongwon"]
   },
-  "Learn/Accessibility/Mobile": {
-    "modified": "2020-07-16T22:40:31.872Z",
-    "contributors": ["seunghun"]
-  },
   "Learn/Accessibility/What_is_accessibility": {
     "modified": "2020-07-16T22:40:05.805Z",
     "contributors": ["seunghun"]
@@ -4688,26 +4684,10 @@
     "modified": "2020-01-12T10:16:30.044Z",
     "contributors": ["alattalatta", "young-gratia", "teoli", "Cho.Eun"]
   },
-  "Web/Accessibility/ARIA/ARIA_Live_Regions": {
-    "modified": "2020-12-05T03:30:43.763Z",
-    "contributors": ["movegun1027"]
-  },
-  "Web/Accessibility/ARIA/ARIA_Techniques": {
-    "modified": "2020-01-12T02:25:07.876Z",
-    "contributors": ["alattalatta", "dcondrey"]
-  },
   "Web/Accessibility/ARIA/Roles": {
     "modified": "2019-03-18T21:24:18.888Z",
     "contributors": ["estelle"]
   },
-  "Web/Accessibility/ARIA/Roles/dialog_role": {
-    "modified": "2019-03-18T21:24:31.941Z",
-    "contributors": ["seokju-na"]
-  },
-  "Web/Accessibility/An_overview_of_accessible_web_applications_and_widgets": {
-    "modified": "2019-03-23T23:21:28.496Z",
-    "contributors": ["dotorify", "teoli", "Cho.Eun"]
-  },
   "Web/Accessibility/Mobile_accessibility_checklist": {
     "modified": "2019-09-08T04:58:59.841Z",
     "contributors": ["seunghun"]
@@ -4893,10 +4873,6 @@
     "modified": "2020-10-15T21:50:30.795Z",
     "contributors": ["alattalatta", "young-gratia"]
   },
-  "Web/CSS/CSS_Selectors": {
-    "modified": "2020-08-22T11:28:21.089Z",
-    "contributors": ["alattalatta"]
-  },
   "Web/CSS/CSS_Types": {
     "modified": "2020-08-06T04:37:09.952Z",
     "contributors": ["alattalatta"]
@@ -5197,6 +5173,10 @@
     "modified": "2019-04-14T23:39:58.448Z",
     "contributors": ["alattalatta", "Netaras"]
   },
+  "Web/CSS/CSS_selectors": {
+    "modified": "2020-08-22T11:28:21.089Z",
+    "contributors": ["alattalatta"]
+  },
   "Web/CSS/CSS_shapes": {
     "modified": "2019-04-25T10:46:18.309Z",
     "contributors": ["alattalatta", "seunghun", "Netaras"]
@@ -6102,22 +6082,10 @@
   "Web/Guide/Audio_and_video_delivery": {
     "modified": "2019-04-17T05:03:01.108Z"
   },
-  "Web/Guide/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video": {
-    "modified": "2019-05-13T05:46:53.607Z",
-    "contributors": ["hoony"]
-  },
-  "Web/Guide/CSS/Block_formatting_context": {
-    "modified": "2020-08-05T00:58:44.120Z",
-    "contributors": ["alattalatta", "moolow", "corps99"]
-  },
   "Web/Guide/Graphics": {
     "modified": "2020-02-15T07:39:57.101Z",
     "contributors": ["Netaras", "hyeonseok", "narae_lee"]
   },
-  "Web/Guide/Mobile": {
-    "modified": "2019-05-30T06:59:50.297Z",
-    "contributors": ["SDSkyKlouD", "Seia-Soto", "xfq"]
-  },
   "Web/Guide/Parsing_and_serializing_XML": {
     "modified": "2019-03-23T22:16:47.020Z",
     "contributors": ["young-gratia"]
@@ -10196,10 +10164,6 @@
     "modified": "2019-03-23T22:00:19.382Z",
     "contributors": ["chrisdavidmills", "cs09g"]
   },
-  "Web/Progressive_web_apps/Guides/Making_PWAs_installable": {
-    "modified": "2020-01-26T15:58:32.379Z",
-    "contributors": ["alattalatta", "chrisdavidmills", "cs09g"]
-  },
   "Web/Progressive_web_apps/Tutorials/js13kGames": {
     "modified": "2019-03-18T20:52:13.104Z",
     "contributors": ["chrisdavidmills", "cs09g"]
diff --git a/files/ko/games/tutorials/2d_breakout_game_phaser/the_score/index.md b/files/ko/games/tutorials/2d_breakout_game_phaser/the_score/index.md
index 209a3d0d6632ce..7ffd605d41cd65 100644
--- a/files/ko/games/tutorials/2d_breakout_game_phaser/the_score/index.md
+++ b/files/ko/games/tutorials/2d_breakout_game_phaser/the_score/index.md
@@ -43,7 +43,7 @@ scoreText = game.add.text(5, 5, "Points: 0", {
 
 마지막 변수는 CSS와 매우 비슷해 보입니다. 우리의 점수는 파란색에, 18픽셀 크기이며, Arial 폰트를 사용하여 나타날 것입니다.
 
-## 블록이 무너지면 점수를 갱신합니다.
+## 블록이 무너지면 점수를 갱신합니다
 
 우리는 공이 블록을 칠때마다 점수를 증가시킵니다 그리고 공이 블록을 칠때마다 동시에 점수판을 갱신하여 화면에 현재 점수를 나타낼 것입니다. 이건 `setText()매소드를 써서 해결 할수 있습니다` — `ballHitBrick()` 함수 아래로 다음과 같은 새로운 코드 두 줄을 추가하세요:
 
diff --git a/files/ko/games/tutorials/html5_gamedev_phaser_device_orientation/index.md b/files/ko/games/tutorials/html5_gamedev_phaser_device_orientation/index.md
index 48ca716f55b1de..0fee5eee37b666 100644
--- a/files/ko/games/tutorials/html5_gamedev_phaser_device_orientation/index.md
+++ b/files/ko/games/tutorials/html5_gamedev_phaser_device_orientation/index.md
@@ -5,7 +5,7 @@ slug: Games/Tutorials/HTML5_Gamedev_Phaser_Device_Orientation
 
 {{GamesSidebar}}
 
-In this tutorial we’ll go through the process of building an HTML5 mobile game that uses the [Device Orientation](/en-US/Apps/Build/gather_and_modify_data/responding_to_device_orientation_changes) and [Vibration](/ko/docs/Web/Guide/API/Vibration) **APIs** to enhance the gameplay and is built using the [Phaser](http://phaser.io/) framework. Basic JavaScript knowledge is recommended to get the most from this tutorial.
+In this tutorial we'll go through the process of building an HTML5 mobile game that uses the [Device Orientation](/en-US/Apps/Build/gather_and_modify_data/responding_to_device_orientation_changes) and [Vibration](/ko/docs/Web/Guide/API/Vibration) **APIs** to enhance the gameplay and is built using the [Phaser](http://phaser.io/) framework. Basic JavaScript knowledge is recommended to get the most from this tutorial.
 
 ## Example game
 
@@ -15,7 +15,7 @@ By the end of the tutorial you will have a fully functional demo game: [Cyber Or
 
 ## Phaser framework
 
-[Phaser](http://phaser.io/) is a framework for building desktop and mobile HTML5 games. It’s quite new, but growing rapidly thanks to the passionate community involved in the development process. You can check it out [on GitHub](https://github.com/photonstorm/phaser) where it’s open sourced, read the [online documentation](http://docs.phaser.io/) and go through the big collection of [examples](http://examples.phaser.io/). The Phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself.
+[Phaser](http://phaser.io/) is a framework for building desktop and mobile HTML5 games. It's quite new, but growing rapidly thanks to the passionate community involved in the development process. You can check it out [on GitHub](https://github.com/photonstorm/phaser) where it's open sourced, read the [online documentation](http://docs.phaser.io/) and go through the big collection of [examples](http://examples.phaser.io/). The Phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself.
 
 ## Starting with the project
 
@@ -31,7 +31,7 @@ You can open the index file in your favourite browser to launch the game and try
 
 ## Setting up the Canvas
 
-We will be rendering our game on Canvas, but we won't do it manually — this will be taken care of by the framework. Let’s set it up: our starting point is the `index.html` file with the following content. You can create this yourself if you want to follow along:
+We will be rendering our game on Canvas, but we won't do it manually — this will be taken care of by the framework. Let's set it up: our starting point is the `index.html` file with the following content. You can create this yourself if you want to follow along:
 
 ```html
 
@@ -94,7 +94,7 @@ The first value is the name of the state and the second one is the object we wan
 
 ## Managing game states
 
-The states in Phaser are separate parts of the game logic; in our case we’re loading them from independent JavaScript files for better maintainability. The basic states used in this game are: `Boot`, `Preloader`, `MainMenu`, `Howto` and `Game`. `Boot` will take care of initializing a few settings, `Preloader` will load all of the assets like graphics and audio, `MainMenu` is the menu with the start button, `Howto` shows the "how to play" instructions and the `Game` state lets you actually play the game. Let's quickly go though the content of those states.
+The states in Phaser are separate parts of the game logic; in our case we're loading them from independent JavaScript files for better maintainability. The basic states used in this game are: `Boot`, `Preloader`, `MainMenu`, `Howto` and `Game`. `Boot` will take care of initializing a few settings, `Preloader` will load all of the assets like graphics and audio, `MainMenu` is the menu with the start button, `Howto` shows the "how to play" instructions and the `Game` state lets you actually play the game. Let's quickly go though the content of those states.
 
 ### Boot.js
 
@@ -260,7 +260,7 @@ The `create` and `update` functions are framework-specific, while others will be
 
 #### Adding the ball and its motion mechanics
 
-First, let’s go to the `create()` function, initialize the ball object itself and assign a few properties to it:
+First, let's go to the `create()` function, initialize the ball object itself and assign a few properties to it:
 
 ```js
 this.ball = this.add.sprite(this.ballStartPos.x, this.ballStartPos.y, "ball");
@@ -270,17 +270,17 @@ this.ball.body.setSize(18, 18);
 this.ball.body.bounce.set(0.3, 0.3);
 ```
 
-Here we’re adding a sprite at the given place on the screen and using the `'ball'` image from the loaded graphic assets. We’re also setting the anchor for any physics calculations to the middle of the ball, enabling the Arcade physics engine (which handles all the physics for the ball movement), and setting the size of the body for the collision detection. The `bounce` property is used to set the bounciness of the ball when it hits the obstacles.
+Here we're adding a sprite at the given place on the screen and using the `'ball'` image from the loaded graphic assets. We're also setting the anchor for any physics calculations to the middle of the ball, enabling the Arcade physics engine (which handles all the physics for the ball movement), and setting the size of the body for the collision detection. The `bounce` property is used to set the bounciness of the ball when it hits the obstacles.
 
 #### Controlling the ball
 
-It’s cool to have the ball ready to be thrown around in the play area, but it’s also important to be able to actually move it! Now we will add the ability to control the ball with the keyboard on the desktop devices, and then we will move to the implementation of the Device Orientation API. Let’s focus on the keyboard first by adding the following to the `create()` function :
+It's cool to have the ball ready to be thrown around in the play area, but it's also important to be able to actually move it! Now we will add the ability to control the ball with the keyboard on the desktop devices, and then we will move to the implementation of the Device Orientation API. Let's focus on the keyboard first by adding the following to the `create()` function :
 
 ```js
 this.keys = this.game.input.keyboard.createCursorKeys();
 ```
 
-As you can see there’s a special Phaser function called `createCursorKeys()`, which will give us an object with event handlers for the four arrow keys to play with: up, down, left and right.
+As you can see there's a special Phaser function called `createCursorKeys()`, which will give us an object with event handlers for the four arrow keys to play with: up, down, left and right.
 
 Next we will add the following code to the `update()` function, so it will be fired on every frame. The `this.keys` object will be checked against player input, so the ball can react accordingly with the predefined force:
 
@@ -301,13 +301,13 @@ That way we can check which key is pressed at the given frame and apply the defi
 
 #### Implementing the Device Orientation API
 
-Probably the most interesting part of the game is its usage of the **Device Orientation API** for control on mobile devices. Thanks to this you can play the game by tilting the device in the direction you want the ball to roll. Here’s the code from the `create()` function responsible for this:
+Probably the most interesting part of the game is its usage of the **Device Orientation API** for control on mobile devices. Thanks to this you can play the game by tilting the device in the direction you want the ball to roll. Here's the code from the `create()` function responsible for this:
 
 ```js
 window.addEventListener("deviceorientation", this.handleOrientation, true);
 ```
 
-We’re adding an event listener to the `"deviceorientation"` event and binding the `handleOrientation` function which looks like this:
+We're adding an event listener to the `"deviceorientation"` event and binding the `handleOrientation` function which looks like this:
 
 ```js
 handleOrientation: function(e) {
@@ -335,7 +335,7 @@ this.hole.anchor.set(0.5);
 this.hole.body.setSize(2, 2);
 ```
 
-The difference is that our hole’s body will not move when we hit it with the ball and will have the collision detection calculated (which will be discussed later on in this article).
+The difference is that our hole's body will not move when we hit it with the ball and will have the collision detection calculated (which will be discussed later on in this article).
 
 #### Building the block labyrinth
 
@@ -390,7 +390,7 @@ Thanks to that the game gives the player a challenge - now he have to roll the b
 
 #### Collision detection
 
-At this point we've got the ball that is controlled by the player, the hole to reach and the obstacles blocking the way. There’s a problem though — our game doesn’t have any collision detection yet, so nothing happens when the ball hits the blocks — it just goes through. Let’s fix it! The good news is that the framework will take care of calculating the collision detection, we only have to specify the colliding objects in the `update()` function:
+At this point we've got the ball that is controlled by the player, the hole to reach and the obstacles blocking the way. There's a problem though — our game doesn't have any collision detection yet, so nothing happens when the ball hits the blocks — it just goes through. Let's fix it! The good news is that the framework will take care of calculating the collision detection, we only have to specify the colliding objects in the `update()` function:
 
 ```js
 this.physics.arcade.collide(
@@ -447,7 +447,7 @@ If the `vibrate` method is supported by the browser and available in the `window
 
 #### Adding the elapsed time
 
-To improve replayability and give players the option to compete with each other we will store the elapsed time — players can then try to improve on their best game completion time. To implement this we have to create a variable for storing the actual number of seconds elapsed from the start of the game, and to show it for the player in the game. Let’s define the variables in the `create` function first:
+To improve replayability and give players the option to compete with each other we will store the elapsed time — players can then try to improve on their best game completion time. To implement this we have to create a variable for storing the actual number of seconds elapsed from the start of the game, and to show it for the player in the game. Let's define the variables in the `create` function first:
 
 ```js
 this.timer = 0; // time elapsed in the current level
@@ -471,7 +471,7 @@ this.totalTimeText = this.game.add.text(
 );
 ```
 
-We’re defining the top and left positions of the text, the content that will be shown and the styling applied to the text. We have this printed out on the screen, but it would be good to update the values every second:
+We're defining the top and left positions of the text, the content that will be shown and the styling applied to the text. We have this printed out on the screen, but it would be good to update the values every second:
 
 ```js
 this.time.events.loop(Phaser.Timer.SECOND, this.updateCounter, this);
@@ -487,11 +487,11 @@ updateCounter: function() {
 },
 ```
 
-As you can see we’re incrementing the `this.timer` variable and updating the content of the text objects with the current values on each iteration, so the player sees the elapsed time.
+As you can see we're incrementing the `this.timer` variable and updating the content of the text objects with the current values on each iteration, so the player sees the elapsed time.
 
 #### Finishing the level and the game
 
-The ball is rolling on the screen, the timer is working and we have the hole created that we have to reach. Now let’s set up the possibility to actually finish the level! The following line in the `update()` function adds a listener that fires when the ball gets to the hole.
+The ball is rolling on the screen, the timer is working and we have the hole created that we have to reach. Now let's set up the possibility to actually finish the level! The following line in the `update()` function adds a listener that fires when the ball gets to the hole.
 
 ```js
 this.physics.arcade.overlap(this.ball, this.hole, this.finishLevel, null, this);
@@ -529,7 +529,7 @@ If the current level is lower than 5, all the neccesary variables are reset and
 
 ## Ideas for new features
 
-This is merely a working demo of a game that could have lots of additional features. We can for example add power-ups to collect along the way that will make our ball roll faster, stop the timer for a few seconds or give the ball special powers to go through obstacles. There’s also room for the traps which will slow the ball down or make it more difficult to reach the hole. You can create more levels of increasing difficulty. You can even implement achievements, leaderboards and medals for different actions in the game. There are endless possibilities — they only depend on your imagination.
+This is merely a working demo of a game that could have lots of additional features. We can for example add power-ups to collect along the way that will make our ball roll faster, stop the timer for a few seconds or give the ball special powers to go through obstacles. There's also room for the traps which will slow the ball down or make it more difficult to reach the hole. You can create more levels of increasing difficulty. You can even implement achievements, leaderboards and medals for different actions in the game. There are endless possibilities — they only depend on your imagination.
 
 ## Summary
 
diff --git a/files/ko/glossary/abstraction/index.md b/files/ko/glossary/abstraction/index.md
index 0898a6cb421419..36a5d4834258d2 100644
--- a/files/ko/glossary/abstraction/index.md
+++ b/files/ko/glossary/abstraction/index.md
@@ -2,6 +2,7 @@
 title: 추상화
 slug: Glossary/Abstraction
 ---
+
 {{Glossary("computer programming", "컴퓨터 프로그래밍")}}에서의 **추상화**란 복잡한 소프트웨어 시스템을 효율적으로 설계하고 구현할 수 있는 방법입니다. 추상화는 뒷편 시스템의 기술적 복잡함을 단순한 {{Glossary("API")}} 뒤에 숨깁니다.
 
 ## 데이터 추상화의 장점
@@ -14,24 +15,24 @@ slug: Glossary/Abstraction
 ## 예
 
 ```js
-    class ImplementAbstraction {
-      // method to set values of internal members
-      set(x, y) {
-        this.a = x;
-        this.b = y;
-      }
-
-      display() {
-        console.log('a = ' + this.a);
-        console.log('b = ' + this.b);
-      }
-    }
-
-    const obj = new ImplementAbstraction();
-    obj.set(10, 20);
-    obj.display();
-    // a = 10
-    // b = 20
+class ImplementAbstraction {
+  // method to set values of internal members
+  set(x, y) {
+    this.a = x;
+    this.b = y;
+  }
+
+  display() {
+    console.log("a = " + this.a);
+    console.log("b = " + this.b);
+  }
+}
+
+const obj = new ImplementAbstraction();
+obj.set(10, 20);
+obj.display();
+// a = 10
+// b = 20
 ```
 
 ## 더 알아보기
diff --git a/files/ko/glossary/attribute/index.md b/files/ko/glossary/attribute/index.md
index 35ea65ac7b9724..6af4d9dc697545 100644
--- a/files/ko/glossary/attribute/index.md
+++ b/files/ko/glossary/attribute/index.md
@@ -2,6 +2,7 @@
 title: 특성
 slug: Glossary/Attribute
 ---
+
 {{QuickLinksWithSubpages("/ko/docs/Glossary")}}
 
 **특성**(attribute)은 {{glossary("tag", "태그")}}를 확장해 동작 방식을 바꾸거나 메타데이터를 제공합니다.
@@ -11,11 +12,11 @@ slug: Glossary/Attribute
 등호 또는 값 없는 특성이 보일 때도 있습니다. {{glossary("HTML")}}에서는 빈 문자열을 제공하는 단축 표기법이고, {{glossary("XML")}}에서는 특성 이름을 제공하는 단축 표기법입니다.
 
 ```html
-
+
 
-
+
 
-
+
 ```
 
 ## 더 알아보기
diff --git a/files/ko/glossary/block-level_content/index.md b/files/ko/glossary/block-level_content/index.md
index 96704ff75057f4..ca2a38fc591369 100644
--- a/files/ko/glossary/block-level_content/index.md
+++ b/files/ko/glossary/block-level_content/index.md
@@ -17,13 +17,18 @@ original_slug: Web/HTML/Block-level_elements
 ### HTML
 
 ```html
-

이 문단은 블록 레벨 요소입니다. 부모 요소와 구분할 수 있도록 배경 색을 입혔습니다.

+

+ 이 문단은 블록 레벨 요소입니다. 부모 요소와 구분할 수 있도록 배경 색을 + 입혔습니다. +

``` ### CSS ```css -p { background-color: #8ABB55; } +p { + background-color: #8abb55; +} ``` {{EmbedLiveSample('블록_레벨_요소')}} diff --git a/files/ko/glossary/breadcrumb/index.md b/files/ko/glossary/breadcrumb/index.md index dd1568eac0e176..2288cd2cc13b1d 100644 --- a/files/ko/glossary/breadcrumb/index.md +++ b/files/ko/glossary/breadcrumb/index.md @@ -2,6 +2,7 @@ title: Breadcrumb (브레드크럼) slug: Glossary/Breadcrumb --- + **브레드크럼**, 또는 브레드크럼 트레일은 일반적으로 사이트의 header와 기본 컨텐츠 사이에 배치되는 탐색 보조 도구로, 사이트 구조와 관련된 현재 페이지의 계층 구조, 최상위에서부터 현재 페이지까지를 사용자의 링크 목록 등으로 표시합니다. 현재 페이지까지 방문한 순서대로 보입니다. 이 문서의 위치 탐색 경로는 다음과 같습니다.: diff --git a/files/ko/glossary/call_stack/index.md b/files/ko/glossary/call_stack/index.md index eb9274c3f75b39..9155df48fca3b2 100644 --- a/files/ko/glossary/call_stack/index.md +++ b/files/ko/glossary/call_stack/index.md @@ -14,12 +14,12 @@ slug: Glossary/Call_stack ```js function greeting() { - // [1] Some codes here - sayHi(); - // [2] Some codes here + // [1] Some codes here + sayHi(); + // [2] Some codes here } function sayHi() { - return "Hi!"; + return "Hi!"; } // Invoke the `greeting` function @@ -34,23 +34,23 @@ greeting(); 2. `greeting()` 함수를 호출합니다. 3. `greeting()` 함수를 호출 스택 리스트에 추가합니다. - > **참고:** 호출 스택 리스트: - > \- greeting + > **참고:** 호출 스택 리스트: + > \- greeting 4. `greeting` 함수 내부의 모든 코드를 실행합니다. 5. `sayHi()` 함수를 얻습니다. 6. `sayHi()` 함수를 호출 스택 리스트에 추가합니다. - > **참고:** 호출 스택 리스트: - > \- greeting - > \- sayHi + > **참고:** 호출 스택 리스트: + > \- greeting + > \- sayHi 7. `sayHi()` 함수의 끝에 도달할 때까지, 함수 내부의 모든 코드를 실행합니다. 8. `sayHi()` 가 호출된 라인으로 돌아와 `greeting()` 함수의 나머지를 계속 실행합니다. 9. 호출 스택 리스트에서 `sayHi()` 함수를 제거합니다. - > **참고:** 호출 스택 리스트: - > \- greeting + > **참고:** 호출 스택 리스트: + > \- greeting 10. `greeting()` 함수 내부의 모든 코드가 실행되었을 때, 이를 호출한 라인으로 돌아와 JS 코드의 나머지를 계속 실행합니다. 11. 호출 스택 리스트에서 `greeting()` 함수를 제거합니다. diff --git a/files/ko/glossary/character/index.md b/files/ko/glossary/character/index.md index 802aaf6a0b3862..affa440c375a0b 100644 --- a/files/ko/glossary/character/index.md +++ b/files/ko/glossary/character/index.md @@ -2,6 +2,7 @@ title: Character slug: Glossary/Character --- + 문자는 기호(글자, 숫자, 문장 부호) 또는 비출력 "제어"(예: 캐리지 리턴 또는 소프트 하이픈)이다. {{glossary("UTF-8")}}은 가장 보편적인 문자 세트이며 유명한 인간 언어들의 문자를 포함한다. ## 더 알아보기 diff --git a/files/ko/glossary/character_encoding/index.md b/files/ko/glossary/character_encoding/index.md index 282a1e0fdc2d17..007ab8e50a2bbc 100644 --- a/files/ko/glossary/character_encoding/index.md +++ b/files/ko/glossary/character_encoding/index.md @@ -8,7 +8,7 @@ slug: Glossary/Character_encoding 예를 들어, HTML에서 우리는 일반적으로 아래 줄과 같이 UTF-8의 문자 인코딩을 선언한다 : ```html - + ``` 이것은 당신이 당신의 HTML 문서에서 인간 언어의 문자를 사용할 수 있도록 보장하며, 그것들은 신뢰성 있게 표시될 것이다. diff --git a/files/ko/glossary/character_set/index.md b/files/ko/glossary/character_set/index.md index bcf56730639a88..34807b3bd46c98 100644 --- a/files/ko/glossary/character_set/index.md +++ b/files/ko/glossary/character_set/index.md @@ -15,11 +15,11 @@ slug: Glossary/Character_set 1. Wikipedia articles - 1. [Character encoding](https://en.wikipedia.org/wiki/Character_encoding) + 1. [Character encoding](https://en.wikipedia.org/wiki/Character_encoding) 2. [Glossary](/ko/docs/Glossary) - 1. {{Glossary("Character")}} - 2. {{Glossary("Unicode")}} + 1. {{Glossary("Character")}} + 2. {{Glossary("Unicode")}} diff --git a/files/ko/glossary/chrome/index.md b/files/ko/glossary/chrome/index.md index d0297d820d5b38..78cec8f9ffb2ca 100644 --- a/files/ko/glossary/chrome/index.md +++ b/files/ko/glossary/chrome/index.md @@ -2,6 +2,7 @@ title: Chrome slug: Glossary/Chrome --- + 브라우저에서 chrome은 웹페이지를 제외한 브라우저의 모든 가시적인 요소이다. (예: 도구 모음, 메뉴 바, 탭) 이것은 {{glossary("Google Chrome")}} 브라우저와 혼동해서는 안 된다. ## 더 알아보기 diff --git a/files/ko/glossary/compile/index.md b/files/ko/glossary/compile/index.md index 95349061824b6e..94bde17126fe16 100644 --- a/files/ko/glossary/compile/index.md +++ b/files/ko/glossary/compile/index.md @@ -2,6 +2,7 @@ title: Compile slug: Glossary/Compile --- + 컴파일(Compile)은 주어진 {{Glossary("computer programming", "language")}}로 작성된 컴퓨터 프로그램을 다른 언어의 동등한 프로그램으로 변환하는 프로세스입니다. 컴파일러는이 작업을 실행하는 소프트웨어입니다. 때로는이 작업을 "조립(assembling)"또는 "빌드(build)"라고도 합니다. 이 작업들은 보통 컴파일과 같은 것(예를 들면 바이너리 형식으로 패키지를 만드는 일) 이상의 작업을 수행합니다 . 일반적으로 컴파일러는 C 또는 {{Glossary("Java")}} 와 같은 고급 언어를 CPU가 이해할 수 있는, 즉 어셈블리어와 같은 기계 언어로 변환합니다. 유사한 수준의 언어 사이에서 번역하는 일부 컴파일러를 트랜스파일러 또는 크로스 컴파일러 라고 합니다. 예를 들어 TypeScript에서 {{Glossary("JavaScript")}}로 컴파일합니다. 그것들은 생산성 도구로 간주됩니다. diff --git a/files/ko/glossary/computer_programming/index.md b/files/ko/glossary/computer_programming/index.md index b0f64349e4878c..023d09e64e062e 100644 --- a/files/ko/glossary/computer_programming/index.md +++ b/files/ko/glossary/computer_programming/index.md @@ -2,6 +2,7 @@ title: Computer Programming slug: Glossary/Computer_Programming --- + 컴퓨터 프로그래밍은 명령어 모음집을 작성하고 구성하는 과정이다. 이것들은 컴퓨터/소프트웨어 프로그램에게 컴퓨터가 이해하는 언어로 무엇을 해야 하는지 알려준다. 이러한 지침은 C++, Java, JavaScript, HTML, Python, Ruby, Rust와 같은 다양한 언어의 형태로 나온다. 적절한 언어를 사용하면 모든 종류의 소프트웨어를 프로그래밍/생성할 수 있다. 이것의 예시에는 복잡한 계산을 하여 과학자들을 돕는 프로그램, 엄청난 양의 데이터를 저장하는 데이터베이스, 음악을 다운받을 수 있는 웹 사이트, 애니메이션 영화를 만들 수 있는 애니메이션 소프트웨어를 들 수 있다. diff --git a/files/ko/glossary/copyleft/index.md b/files/ko/glossary/copyleft/index.md index 12e036b15ab6d1..4ccc614732424b 100644 --- a/files/ko/glossary/copyleft/index.md +++ b/files/ko/glossary/copyleft/index.md @@ -2,6 +2,7 @@ title: Copyleft slug: Glossary/Copyleft --- + Copyleft는 일반적으로 라이선스를 지칭하는 용어로서, 그러한 라이선스는 해당 저작물의 재배포가 원래 라이선스와 동일한 라이선스의 대상이 되어야 한다는 것을 나타내기 위해 사용된다. copyleft 라이선스의 예로는 GNU {{Glossary("GPL")}}(소프트웨어용)과 Creative Commons SA(Share Alike) 라이선스(예술 작품에서)가 있다. ## 더 알아보기 diff --git a/files/ko/glossary/cors/index.md b/files/ko/glossary/cors/index.md index 26737de0773df7..5a2d409d21bdeb 100644 --- a/files/ko/glossary/cors/index.md +++ b/files/ko/glossary/cors/index.md @@ -2,6 +2,7 @@ title: CORS slug: Glossary/CORS --- + 다른 도메인({{glossary("domain","domains")}})에서의 자원을 호출하는 행위에 제한이 없을 경우 안전하지 않습니다. **CORS** (Cross-Origin Resource Sharing)는 이렇게 시스템 수준에서 타 도메인 간 자원 호출을 승인하거나 차단하는 것을 결정하는 것입니다. ## 더 보기 diff --git a/files/ko/glossary/csp/index.md b/files/ko/glossary/csp/index.md index a85ab16114ba1d..0960d1aaff546a 100644 --- a/files/ko/glossary/csp/index.md +++ b/files/ko/glossary/csp/index.md @@ -2,6 +2,7 @@ title: CSP slug: Glossary/CSP --- + CSP (Content Security Policy)는 {{Glossary("XSS")}}이나 데이터 주입과 같은 특정 웹사이트 관련 공격을 탐지 하거나 완화 하기 위해 사용된다. 기본적인 구현은 `Content-Security-Policy`라고 불리는 {{Glossary("HTTP")}} 헤더를 기반으로 한다. diff --git a/files/ko/glossary/css/index.md b/files/ko/glossary/css/index.md index 13fb58b5704d9c..9bdb9f5ace1cb8 100644 --- a/files/ko/glossary/css/index.md +++ b/files/ko/glossary/css/index.md @@ -18,7 +18,7 @@ p { color: yellow; /* The "background-color" property defines the background color, in this case black. */ - background-color: black + background-color: black; } ``` diff --git a/files/ko/glossary/doctype/index.md b/files/ko/glossary/doctype/index.md index 925df02266066f..e2190ba515686c 100644 --- a/files/ko/glossary/doctype/index.md +++ b/files/ko/glossary/doctype/index.md @@ -2,7 +2,8 @@ title: 문서 타입 정의 slug: Glossary/Doctype --- -{{Glossary("HTML")}}에서, doctype은 모든 문서의 최상단에서 찾을 수 있는 "``" 필수 서문이다. doctype은 {{Glossary("브라우저")}}가 문서를 렌더링 할 때 [“quirks mode”](/ko/docs/Quirks_Mode_and_Standards_Mode)로 바뀌지 않도록하는 것이 유일한 목적이다. "``" doctype은 브라우저가 일부 스펙과 맞지 않는 다른 렌더링 모드를 사용하기 보다는 적절한 스펙을 따르는 최선의 시도를 하도록 한다. + +{{Glossary("HTML")}}에서, doctype은 모든 문서의 최상단에서 찾을 수 있는 "``" 필수 서문이다. doctype은 {{Glossary("브라우저")}}가 문서를 렌더링 할 때 ["quirks mode"](/ko/docs/Quirks_Mode_and_Standards_Mode)로 바뀌지 않도록하는 것이 유일한 목적이다. "``" doctype은 브라우저가 일부 스펙과 맞지 않는 다른 렌더링 모드를 사용하기 보다는 적절한 스펙을 따르는 최선의 시도를 하도록 한다. ## 더보기 diff --git a/files/ko/glossary/domain_name/index.md b/files/ko/glossary/domain_name/index.md index 3f4805c1bb109a..58f34cdaa7e5d5 100644 --- a/files/ko/glossary/domain_name/index.md +++ b/files/ko/glossary/domain_name/index.md @@ -2,6 +2,7 @@ title: 도메인 이름 slug: Glossary/Domain_name --- + **도메인 이름**은 {{Glossary("Internet", "인터넷")}} 웹 사이트의 주소로, {{glossary("URL")}}에서 특정 웹 페이지가 속하는 서버를 식별할 때 사용합니다. 도메인 이름은 마침표(점)로 구분한 계층적인 이름(레이블)의 연속으로 구성되며, {{glossary("TLD", "확장")}}으로 끝납니다. ## 더 알아보기 diff --git a/files/ko/glossary/endianness/index.md b/files/ko/glossary/endianness/index.md index 64e7fc633933b5..211e97dde7a28a 100644 --- a/files/ko/glossary/endianness/index.md +++ b/files/ko/glossary/endianness/index.md @@ -2,6 +2,7 @@ title: 엔디언 slug: Glossary/Endianness --- + **엔디언**(endian, endianness) 또는 **바이트 순서**는 숫자를 구성하는 바이트를 컴퓨터가 정렬하는 방법입니다. 메모리의 저장 공간은 인덱스, 또는 주소를 가지고 있습니다. 각각의 바이트는 8비트 숫자(`0x00` 이상, `0xff` 이하)를 저장할 수 있으므로, 그보다 큰 숫자에 대해서는 두 개 이상의 바이트가 필요합니다. 여러 개의 바이트를 정렬하는, 지금까지 가장 많이 쓰이는 방법은 모든 Intel 프로세서가 사용하는 **리틀 엔디언**입니다. 리틀 엔디언은 작은 단위부터 정렬하는 방식으로, 가장 작은 단위의 바이트가 맨 앞 혹은 앞쪽 주소를 차지합니다. 이 방식은 유럽식 날짜 표기(31-12-2050)에 대입할 수 있습니다. diff --git a/files/ko/glossary/entity_header/index.md b/files/ko/glossary/entity_header/index.md index c8d72fba387731..6e5ad515dc8ddc 100644 --- a/files/ko/glossary/entity_header/index.md +++ b/files/ko/glossary/entity_header/index.md @@ -2,6 +2,7 @@ title: 엔티티 헤더 slug: Glossary/Entity_header --- + 엔티티 헤더는 메시지 바디의 컨텐츠를 나타내는 {{glossary("header", "HTTP 헤더")}}입니다. 엔티티 헤더는 HTTP 요청 및 응답 모두에서 사용됩니다. {{HTTPHeader("Content-Length")}}, {{HTTPHeader("Content-Language")}}, {{HTTPHeader("Content-Encoding")}}과 같은 헤더는 엔티티 헤더입니다. 엔티티 헤더가 요청이나 응답 헤더가 아님에도 불구하고, 이러한 용어로 종종 포함됩니다. diff --git a/files/ko/glossary/falsy/index.md b/files/ko/glossary/falsy/index.md index 84a14c95e931ec..fca3336ce0657b 100644 --- a/files/ko/glossary/falsy/index.md +++ b/files/ko/glossary/falsy/index.md @@ -9,15 +9,15 @@ slug: Glossary/Falsy 다음은 8가지 거짓 같은 값들입니다: -| `false` | 키워드 [false](/ko/docs/Web/JavaScript/Reference/Lexical_grammar#구형_표준의_확장_예약_키워드) | -| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | 숫자 [zero](/ko/docs/Web/JavaScript/Data_structures#Number_타입) | -| `-0` | 음수 [zero](/ko/docs/Web/JavaScript/Data_structures#Number_타입) | -| `0n` | [BigInt](/ko/docs/Web/JavaScript/Reference/Global_Objects/BigInt). 불리언으로 사용될 경우, 숫자와 같은 규칙을 따름. `0n`은 거짓 같은 값. | -| `""` | 빈 [string](/ko/docs/Web/JavaScript/Reference/Global_Objects/String) | -| {{Glossary("null")}} | [null](/ko/docs/Web/JavaScript/Reference/Global_Objects/null) - 아무런 값도 없음 | +| `false` | 키워드 [false](/ko/docs/Web/JavaScript/Reference/Lexical_grammar#구형_표준의_확장_예약_키워드) | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | 숫자 [zero](/ko/docs/Web/JavaScript/Data_structures#Number_타입) | +| `-0` | 음수 [zero](/ko/docs/Web/JavaScript/Data_structures#Number_타입) | +| `0n` | [BigInt](/ko/docs/Web/JavaScript/Reference/Global_Objects/BigInt). 불리언으로 사용될 경우, 숫자와 같은 규칙을 따름. `0n`은 거짓 같은 값. | +| `""` | 빈 [string](/ko/docs/Web/JavaScript/Reference/Global_Objects/String) | +| {{Glossary("null")}} | [null](/ko/docs/Web/JavaScript/Reference/Global_Objects/null) - 아무런 값도 없음 | | {{Glossary("undefined")}} | [undefined](/ko/docs/Web/JavaScript/Reference/Global_Objects/undefined) - 원시값 | -| {{Glossary("NaN")}} | [NaN](/ko/docs/Web/JavaScript/Reference/Global_Objects/NaN) - 숫자가 아님 | +| {{Glossary("NaN")}} | [NaN](/ko/docs/Web/JavaScript/Reference/Global_Objects/NaN) - 숫자가 아님 | > **참고:** 오브젝트는 [\[\[IsHTMLDDA\]\] internal slot](https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot) 을 가지고 있어야 거짓같은 값이 됩니다. 이 슬롯은 [`document.all`](/ko/docs/Web/API/Document/all) 에만 존재하며 자바스크립트로 설정될 수 없습니다. @@ -41,10 +41,10 @@ if ("") 첫 번째 객체가 거짓 같은 값이라면, 해당 객체를 반환합니다. ```js -false && "dog" +false && "dog"; // ↪ false -0 && "dog" +0 && "dog"; // ↪ 0 ``` diff --git a/files/ko/glossary/first-class_function/index.md b/files/ko/glossary/first-class_function/index.md index 80ff39fbc2efaa..c16ba07c4ed5d7 100644 --- a/files/ko/glossary/first-class_function/index.md +++ b/files/ko/glossary/first-class_function/index.md @@ -23,8 +23,8 @@ foo(); // 변수를 사용해 호출 {{glossary("Variable", "변수")}}에 '익명함수'를 할당한 다음, 끝에 괄호 `()`를 추가하면서 함수를 호출할 해당 변수를 사용합니다. > **참고:** 함수가 이름을 가지고 있더라도, 변수 이름을 사용하여 함수를 호출할 수 있습니다. -함수에 이름을 지정하는 것은 코드를 디버깅할 때 도움이 됩니다. -하지만 함수를 호출하는 방식에는 영향을 미치지 않을 것입니다. +> 함수에 이름을 지정하는 것은 코드를 디버깅할 때 도움이 됩니다. +> _하지만 함수를 호출하는 방식에는 영향을 미치지 않을 것입니다._ ### 함수에 전달인자로 전달 diff --git a/files/ko/glossary/flex_container/index.md b/files/ko/glossary/flex_container/index.md index d4df3413303957..06f46a66313cca 100644 --- a/files/ko/glossary/flex_container/index.md +++ b/files/ko/glossary/flex_container/index.md @@ -2,6 +2,7 @@ title: 플렉스 컨테이너 slug: Glossary/Flex_Container --- + {{glossary("flexbox", "플렉스박스")}} 레이아웃은 부모 요소의 `display` 속성에 `flex` 또는 `inline-flex` 값을 지정해 정의합니다. 이 때, 부모 요소는 **플렉스 컨테이너**, 각각의 자식 요소를 {{glossary("flex item", "플렉스 항목")}}이 됩니다. `flex` 값은 요소를 블록 레벨 플렉스 컨테이너로 지정하고, `inline-flex`는 인라인 레벨 플렉스 컨테이너로 지정합니다. 두 값은 요소에 새로운 **플렉스 서식 맥락**을 생성합니다. 플렉스 서식 맥락은 블록 서식 맥락과 유사하여 플로팅 요소가 컨테이너를 침범하지 않으며, 컨테이너의 바깥 여백이 자기 아래 플렉스 항목의 바깥 여백과 상쇄되지 않습니다. diff --git a/files/ko/glossary/flex_item/index.md b/files/ko/glossary/flex_item/index.md index 1fc365775d67d1..4d35030532d90d 100644 --- a/files/ko/glossary/flex_item/index.md +++ b/files/ko/glossary/flex_item/index.md @@ -2,6 +2,7 @@ title: 플렉스 항목 slug: Glossary/Flex_Item --- + {{glossary("Flex Container", "플렉스 컨테이너")}}(`display: flex` 또는 `display: inline-flex`를 지정한 요소)의 바로 아래 자식은 **플렉스 항목**이 됩니다. 플렉스 컨테이너 내의 텍스트 역시 플렉스 항목입니다. diff --git a/files/ko/glossary/fork/index.md b/files/ko/glossary/fork/index.md index 626112b4a63a46..601b1288700371 100644 --- a/files/ko/glossary/fork/index.md +++ b/files/ko/glossary/fork/index.md @@ -2,6 +2,7 @@ title: Fork slug: Glossary/Fork --- + 포크는 프로젝트에 누군가의 자신의 수정 사항을 추가하기 위한 어떤 시점에 있는 기존 소프트웨어 프로젝트의 사본이다. 기본적으로, 만약 원본 소프트웨어의 라이센스가 허가한다면, 당신은 코드를 복사하여 자신의 추가사항을 가지고 그 코드를 개발할 수 있는데, 이것이 "포크"가 될 것이다. 포크는 종종 무료 오픈소스 소프트웨어 개발에서 볼 수 있다. 이는 Git(또는 GitHub 플랫폼)을 사용한 기여 모델 덕분에 더 많이 사용되는 용어다. diff --git a/files/ko/glossary/function/index.md b/files/ko/glossary/function/index.md index 16d6cc1022ee9f..c1e2da66f975be 100644 --- a/files/ko/glossary/function/index.md +++ b/files/ko/glossary/function/index.md @@ -23,7 +23,7 @@ slug: Glossary/Function ```js // Function declaration -function foo() {}; +function foo() {} // Named function expression (function bar() {}); @@ -35,17 +35,17 @@ const foo = () => {}; **안쪽 함수**는 다른함수 내부에서 정의된 함수이다(아래 예에서는 square). **바깥 함수**는 함수를 포함하고 있는 함수이다(아래 예에서는 addSquares): ```js -function addSquares(a,b) { - function square(x) { - return x * x; - } - return square(a) + square(b); -}; +function addSquares(a, b) { + function square(x) { + return x * x; + } + return square(a) + square(b); +} //Using ECMAScript 2015 arrow notation -const addSquares = (a,b) => { - const square = x => x*x; - return square(a) + square(b); +const addSquares = (a, b) => { + const square = (x) => x * x; + return square(a) + square(b); }; ``` @@ -53,16 +53,14 @@ const addSquares = (a,b) => { ```js function loop(x) { - if (x >= 10) - return; - loop(x + 1); -}; + if (x >= 10) return; + loop(x + 1); +} //Using ECMAScript 2015 arrow notation -const loop = x => { - if (x >= 10) - return; - loop(x + 1); +const loop = (x) => { + if (x >= 10) return; + loop(x + 1); }; ``` @@ -79,14 +77,14 @@ function foo() { // Function expressions, named or anonymous, can be called immediately (function foo() { - console.log("Hello Foo"); -}()); + console.log("Hello Foo"); +})(); (function food() { - console.log("Hello Food"); + console.log("Hello Food"); })(); -(() => console.log('hello world'))(); +(() => console.log("hello world"))(); ``` IIFE에 대해 더 많은 설명이 필요하다면 위키피디아의 다음 페이지를 확인 바란다: [Immediately Invoked Function Expression](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression) diff --git a/files/ko/glossary/global_object/index.md b/files/ko/glossary/global_object/index.md index 12f8232173b9be..c988667123c35c 100644 --- a/files/ko/glossary/global_object/index.md +++ b/files/ko/glossary/global_object/index.md @@ -2,6 +2,7 @@ title: 전역 객체 slug: Glossary/Global_object --- + 전역 객체 {{glossary("object")}} 는 전역 범위 {{glossary("global scope")}} 에 항상 존재하는 객체를 의미합니다. 자바스크립트에는 전역 객체로 선언된 객체들이 항상 존재합니다. 웹브라우저에서 스크립트가 전역 변수를 생성할 때, 그것들은 전역 객체의 멤버로서 생성됩니다. (이것은 {{Glossary("Node.js")}} 에서는 예외입니다.) 전역 객체의 {{Glossary("interface")}} 는 스크립트가 실행되고 있는 곳의 실행 컨텍스트에 의존합니다. 예를 들어: @@ -23,19 +24,19 @@ foo === window.foo; // Returns: true 전역 객체로 `foo` 변수를 선언한 뒤, 우리는 `foo` 변수명을 사용해 전역 객체인 `window.foo` 의 프로퍼티로 `window` 객체에서 그것의 값에 직접 접근할 수 있습니다., -#### 설명: +#### 설명 전역 객체 `foo` 는 `window` 객체에 아래와 같이 저장됩니다: ```js -foo: "foobar" +foo: "foobar"; ``` ### 전역 함수 접근 ```js function greeting() { - console.log("Hi!"); + console.log("Hi!"); } window.greeting(); // It is the same as the normal invoking: greeting(); @@ -43,13 +44,13 @@ window.greeting(); // It is the same as the normal invoking: greeting(); 위의 예는 `window` 객체의 프로퍼티로서 어떻게 전역 함수가 저장되는지를 보여주고 있습니다 . 우리가 `greeting` 을 전역 함수로써 호출하면 내부적으로는 `window` 객체를 사용해 호출됨을 보여주고 있습니다. -#### 설명: +#### 설명 전역 함수 `greeting` 은 아래와 같이 `window` 객체에 저장됩니다: ```js greeting: function greeting() { - console.log("Hi!"); + console.log("Hi!"); } ``` diff --git a/files/ko/glossary/gpl/index.md b/files/ko/glossary/gpl/index.md index 29d05b33734939..ebdfff8afe46fd 100644 --- a/files/ko/glossary/gpl/index.md +++ b/files/ko/glossary/gpl/index.md @@ -2,6 +2,7 @@ title: GPL slug: Glossary/GPL --- + (GNU) GPL (General Public License)은 Free Software Foundation에서 배포하는 copyleft 무료 소프트웨어 라이선스이다. GPL 라이선스 프로그램의 사용자들은 동일한 면허에 따라 프로그램을 재분배(수정 또는 변경되지 않음)할 경우, 사용, 소스 코드 읽기, 수정 및 변경사항 재분배할 수 있는 자유가 부여된다. ## 더 알아보기 diff --git a/files/ko/glossary/head/index.md b/files/ko/glossary/head/index.md index 995e98c04af363..3e4dffa18e2a1c 100644 --- a/files/ko/glossary/head/index.md +++ b/files/ko/glossary/head/index.md @@ -2,6 +2,7 @@ title: Head slug: Glossary/Head --- + **Head** 란 {{glossary("HTML")}} 문서의 일부분으로써 해당 문서의 {{glossary("metadata")}} 를 포함하는데, 예를 들면 저자, 설명, 그리고 HTML에 적용될 수 있는 {{glossary("CSS")}} 또는 {{glossary("JavaScript")}} 파일들로 연결되는 것들이 이에 해당될 수 있다. ## 더 알아보기 diff --git a/files/ko/glossary/hoisting/index.md b/files/ko/glossary/hoisting/index.md index 2770bab86bf138..5d86aad3634a3b 100644 --- a/files/ko/glossary/hoisting/index.md +++ b/files/ko/glossary/hoisting/index.md @@ -2,6 +2,7 @@ title: 호이스팅 slug: Glossary/Hoisting --- + JavaScript에서 **호이스팅**(hoisting)이란, 인터프리터가 변수와 함수의 메모리 공간을 선언 전에 미리 할당하는 것을 의미합니다. `var`로 선언한 변수의 경우 호이스팅 시 `undefined`로 변수를 초기화합니다. 반면 `let`과 `const`로 선언한 변수의 경우 호이스팅 시 변수를 초기화하지 않습니다. 호이스팅을 설명할 땐 주로 "변수의 선언과 초기화를 분리한 후, 선언만 코드의 최상단으로 옮기는" 것으로 말하곤 합니다. 따라서 변수를 정의하는 코드보다 사용하는 코드가 앞서 등장할 수 있습니다. 다만 선언과 초기화를 함께 수행하는 경우, 선언 코드까지 실행해야 변수가 초기화된 상태가 됨을 주의하세요. @@ -73,8 +74,8 @@ var y = 2; // y를 선언하고 초기화 // 예제 2 // 호이스팅은 없지만, 변수 초기화는 (아직 하지 않은 경우) 변수 선언까지 병행하므로 변수를 사용할 수 있음 -a = '크랜'; // a 초기화 -b = '베리'; // b 초기화 +a = "크랜"; // a 초기화 +b = "베리"; // b 초기화 console.log(a + "" + b); // '크랜베리' ``` diff --git a/files/ko/glossary/html/index.md b/files/ko/glossary/html/index.md index 59154d67979fbf..d049d8792a4b1b 100644 --- a/files/ko/glossary/html/index.md +++ b/files/ko/glossary/html/index.md @@ -2,6 +2,7 @@ title: HTML slug: Glossary/HTML --- + {{QuickLinksWithSubpages("/ko/docs/Glossary")}} **HTML**(Hypertext Markup Language)은 웹페이지의 구조를 지정하는 기술적인 언어입니다. diff --git a/files/ko/glossary/http_3/index.md b/files/ko/glossary/http_3/index.md index df6430e47c5803..3f85cdc7744431 100644 --- a/files/ko/glossary/http_3/index.md +++ b/files/ko/glossary/http_3/index.md @@ -2,6 +2,7 @@ title: HTTP/3 slug: Glossary/HTTP_3 --- + **HTTP/3**는 {{glossary("HTTP 2", "HTTP/2")}} 다음 [HTTP 네크워크 프로토콜](/ko/docs/Web/HTTP/Basics_of_HTTP)입니다. HTTP/3의 요점은 {{glossary("TCP")}} 대신 QUIC이라는 새로운 {{glossary("UDP")}} 프로토콜을 사용하는 것입니다. diff --git a/files/ko/glossary/idempotent/index.md b/files/ko/glossary/idempotent/index.md index 8ac06d9c1b49d1..8cb173f8357022 100644 --- a/files/ko/glossary/idempotent/index.md +++ b/files/ko/glossary/idempotent/index.md @@ -2,6 +2,7 @@ title: 멱등성 slug: Glossary/Idempotent --- + 동일한 요청을 한 번 보내는 것과 여러 번 연속으로 보내는 것이 같은 효과를 지니고, 서버의 상태도 동일하게 남을 때, 해당 HTTP 메서드가 **멱등성**을 가졌다고 말합니다. 다른 말로는, 멱등성 메서드에는 통계 기록 등을 제외하면 어떠한 부수 효과(side effect)도 존재해서는 안됩니다. 올바르게 구현한 경우 {{HTTPMethod("GET")}}, {{HTTPMethod("HEAD")}}, {{HTTPMethod("PUT")}}, {{HTTPMethod("DELETE")}} 메서드는 멱등성을 가지며, {{HTTPMethod("POST")}} 메서드는 그렇지 않습니다. 모든 {{glossary("safe", "안전한")}} 메서드는 멱등성도 가집니다. 멱등성을 따질 땐 실제 서버의 백엔드 상태만 보면 되며, 각 요청에서 반환하는 응답 코드는 다를 수 있습니다. 첫 번째 {{HTTPMethod("DELETE")}} 요청이 {{HTTPStatus("200")}}을 반환한다면, 그 이후는 아마 {{HTTPStatus("404")}}를 반환할 것입니다. `DELETE`가 멱등성을 가진다는 것은, REST API에서 개발자는 `DELETE` 메서드를 사용해 "목록의 마지막 항목 제거" 기능을 구현해서는 안된다는 것입니다. diff --git a/files/ko/glossary/iife/index.md b/files/ko/glossary/iife/index.md index 68e49e6a9b2cd7..21c4d43d7064ae 100644 --- a/files/ko/glossary/iife/index.md +++ b/files/ko/glossary/iife/index.md @@ -7,7 +7,7 @@ slug: Glossary/IIFE ```js (function () { - statements + statements; })(); ``` @@ -21,18 +21,18 @@ slug: Glossary/IIFE ```js (function () { - var aName = "Barry"; + var aName = "Barry"; })(); // IIFE 내부에서 정의된 변수는 외부 범위에서 접근이 불가능하다. -aName // throws "Uncaught ReferenceError: aName is not defined" +aName; // throws "Uncaught ReferenceError: aName is not defined" ``` IIFE를 변수에 할당하면 IIFE 자체는 저장되지 않고, 함수가 실행된 결과만 저장된다. ```js var result = (function () { - var name = "Barry"; - return name; + var name = "Barry"; + return name; })(); // 즉시 결과를 생성한다. result; // "Barry" diff --git a/files/ko/glossary/immutable/index.md b/files/ko/glossary/immutable/index.md index 550517a0cf8755..857db715a568fd 100644 --- a/files/ko/glossary/immutable/index.md +++ b/files/ko/glossary/immutable/index.md @@ -2,6 +2,7 @@ title: Immutable slug: Glossary/Immutable --- + 불변 [객체](/ko/docs/Glossary/Object) 는 내용을 변경할 수 없는 객체입니다. 객체는 다양한 이유로 불변일 수 있습니다. 예를 들어 아래와 같습니다. diff --git a/files/ko/glossary/index.md b/files/ko/glossary/index.md index 2232951fe37f7c..ccd3899c06f1d9 100644 --- a/files/ko/glossary/index.md +++ b/files/ko/glossary/index.md @@ -1,5 +1,5 @@ --- -title: 'MDN Web Docs 용어 사전: 웹 용어 정의' +title: "MDN Web Docs 용어 사전: 웹 용어 정의" slug: Glossary --- diff --git a/files/ko/glossary/inline-level_content/index.md b/files/ko/glossary/inline-level_content/index.md index 4b1b9db80fdad2..b98c6b8f84718c 100644 --- a/files/ko/glossary/inline-level_content/index.md +++ b/files/ko/glossary/inline-level_content/index.md @@ -23,8 +23,10 @@ HTML(**Hypertext Markup Language**)의 요소는 역사적으로 ["블록 레벨 인라인 요소를 보이는 다음 예제를 확인해주세요. ```html -
다음 span은 인라인 요소로, -영향 범위의 시작과 끝을 알 수 있도록 배경색을 지정했습니다.
+
+ 다음 span은 인라인 요소로, 영향 범위의 시작과 + 끝을 알 수 있도록 배경색을 지정했습니다. +
``` 이 예제에서 {{HTMLElement("div")}}는 텍스트를 가진 블록 레벨 요소입니다. 그 텍스트 안에는 인라인 요소인 {{HTMLElement("span")}}이 존재합니다. ``은 인라인이기 때문에 전체 문단이 끊기지 않고 하나로 그려집니다. 결과도 확인해보세요. @@ -46,8 +48,11 @@ background-color:#ee3; 이제 아까 만든 ``을 마치 {{htmlelement("p")}}처럼 블록 레벨인 요소로 바꿔보겠습니다. ```html -
다음 p는

블록 레벨 요소

로, -영향 범위의 시작과 끝을 알 수 있도록 배경색을 지정했습니다. +
+ 다음 p는 +

블록 레벨 요소

+ 로, 영향 범위의 시작과 끝을 알 수 있도록 배경색을 지정했습니다. +
``` ``` -이 코드로는 라벨이 인풋과 명확하게 연관지어집니다. 스크린 리더 설명은 “Fill in your name: edit text”와 같을 것입니다. +이 코드로는 라벨이 인풋과 명확하게 연관지어집니다. 스크린 리더 설명은 "Fill in your name: edit text"와 같을 것입니다. !['Fill in your name'으로 읽히는 좋은 폼 라벨이 주어진 텍스트 인풋 폼 컨트롤.](voiceover-good-form-label.png) @@ -486,7 +486,7 @@ Fill in your name:

``` -첫번째 이미지는 스크린 리더로 봤을 때 사용자에게 별 도움을 주지 않습니다. 예를 들어 VoiceOver는 "/dinosaur.png, image”라고 읽어줍니다. 조금의 도움이라도 제공하기 위해 파일명을 읽어주는 것이죠. 이 예시에서는 유저가 적어도 어떤 종류의 공룡이라는 점을 알 수 있지만, 대부분의 경우 파일명은 기계(예를 들면 디지털 카메라)가 생성합니다. 아마 이미지 내용에 대한 어떤 맥락도 제공하지 않겠죠. +첫번째 이미지는 스크린 리더로 봤을 때 사용자에게 별 도움을 주지 않습니다. 예를 들어 VoiceOver는 "/dinosaur.png, image"라고 읽어줍니다. 조금의 도움이라도 제공하기 위해 파일명을 읽어주는 것이죠. 이 예시에서는 유저가 적어도 어떤 종류의 공룡이라는 점을 알 수 있지만, 대부분의 경우 파일명은 기계(예를 들면 디지털 카메라)가 생성합니다. 아마 이미지 내용에 대한 어떤 맥락도 제공하지 않겠죠. > **참고:** 이것이 이미지 안에 텍스트 콘텐츠를 포함해서는 안되는 이유입니다. 스크린 리더는 그 정보에 접근할 수 없습니다. 다른 단점도 있습니다. 그것을 선택하거나 복사/붙여넣기 할 수 없습니다. 하지 말라면 하지마세요. @@ -548,7 +548,7 @@ HTML에는 {{htmlelement("figure")}}와 어떤 종류(이미지 외에 어떤 ``` -페이지 디자인에 포함되어 있는 이미지가 시각적인 장식의 목적만을 가지는 경우가 있습니다. 위 코드 예시에서는 이미지의 `alt` 속성이 비어있는 것을 볼 수 있는데, 이는 스크린 리더가 이미지를 인식해도 설명을 시도하지 않게 하기 위함입니다. “이미지” 같은 것을 말하기보다요. +페이지 디자인에 포함되어 있는 이미지가 시각적인 장식의 목적만을 가지는 경우가 있습니다. 위 코드 예시에서는 이미지의 `alt` 속성이 비어있는 것을 볼 수 있는데, 이는 스크린 리더가 이미지를 인식해도 설명을 시도하지 않게 하기 위함입니다. "이미지" 같은 것을 말하기보다요. `alt` 속성을 아예 사용하지 않는 대신 빈 문자열을 넣는 것은 많은 스크린 리더가 `alt` 속성이 없는 경우 이미지 URL 자체를 알려주기 때문입니다. 위 예시의 이미지는 관련된 머릿말을 시각적으로 꾸미는 역할을 합니다. 이런 경우, 또는 정말로 의미있는 내용 없이 장식 요소인 경우 `img` 요소에 빈 `alt` 속성을 추가해야 합니다. 또 다른 방법으로는 aria [`role`](/ko/docs/Web/Accessibility/ARIA/Roles) 속성을 활용해 [`role="presentation"`](/ko/docs/Web/Accessibility/ARIA/Roles/presentation_role) 설정을 할 수 있습니다. 이 역시 스크린 리더가 대체 텍스트를 읽지 않도록 합니다. diff --git a/files/ko/learn/accessibility/mobile/index.md b/files/ko/learn/accessibility/mobile/index.md deleted file mode 100644 index cbfc471130b530..00000000000000 --- a/files/ko/learn/accessibility/mobile/index.md +++ /dev/null @@ -1,278 +0,0 @@ ---- -title: 모바일 접근성 -slug: Learn/Accessibility/Mobile -original_slug: Learn/접근성/모바일 ---- - -{{LearnSidebar}}{{PreviousMenuNext("Learn/Accessibility/Multimedia","Learn/Accessibility/Accessibility_troubleshooting", "Learn/Accessibility")}} - -모바일 기기에서 웹 접근이 매우 자주 발생하고 iOS와 안드로이드와 같은 유명 플랫폼들은 전문적인 접근성 점검도구들이 있기 때문에 웹콘텐츠의 접근성을 고려하는 것이 더욱 중요하다. 여기서는 모바일환경을 중심으로 접근성 고려사항을 살펴본다. - - - - - - - - - - - - -
사전지식: -

- 기본적인 컴퓨터 사용능력, HTML, CSS, JavaScript에 대한 기본적인 이해, - 그리고 - 이전 내용들에 대한 이해. -

-
목표: -

- 모바일 기기의 접근성에 어떤 문제가 있는지, 그리고 이를 극복하는 방법을 - 이해한다. -

-
- -## 모바일 장치에서의 접근성 - -접근성 상태(일반적으로 웹 표준에 대한 지원)는 최근의 모바일 장치에서 좋다. 모바일 기기가 데스크톱 브라우저에 전혀 다른 웹 기술을 실행하면서 개발자들이 브라우저 코웃음을 치며 완전히 별개의 사이트에 서비스를 제공하도록 강요하던 시대는 이미 오래 전에 지났다(아직도 상당수의 회사가 모바일 장치의 사용을 감지하여 별도의 모바일 도메인을 서비스하고 있다). - -The state of accessibility — and support for web standards in general — is good in modern mobile devices. Long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). - -These days, mobile devices can usually handle fully-featured websites, and the main platforms even have screenreaders built in to enable visually impaired users to use them successfully. Modern mobile browsers tend to have good support for [WAI-ARIA](/ko/docs/Learn/Accessibility/WAI-ARIA_basics), too. - -To make a website accessible and usable on mobile, you just need to follow general good web design and accessibility best practices. - -There are some exceptions that need special consideration for mobile; the main ones are: - -- Control mechanisms — Make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops (mainly mouse/keyboard). -- User input — Make user input requirements as painless as possible on mobile (e.g., in forms, keep typing to a minimum). -- Responsive design — Make sure layouts work on mobile, conserve image download sizes, and think about the provision of images for high-resolution screens. - -## Summary of screenreader testing on Android and iOS - -The most common mobile platforms have fully functional screen readers. These function in much the same way as desktop screenreaders, except they are largely operated using touch gestures rather than key combinations. - -Let's look at the main two: TalkBack on Android and VoiceOver on iOS. - -### Android TalkBack - -The TalkBack screen reader is built into the Android operating system. - -To turn it on, look up what phone model and Android version you have, and then look up where the TalkBack menu is. It tends to differ widely between Android versions and even between different phone models. Some phone manufacturers (e.g. Samsung) don't even have TalkBack in newer phones, and instead opted for their own screen reader. - -When you've found the TalkBack menu, press the slider switch to turn TalkBack on. Follow any additional on-screen prompts that you are presented with. - -When TalkBack is turned on, your Android device's basic controls will be a bit different. For example: - -1. Single-tapping an app will select it, and the device will read out what the app is. -2. Swiping left and right will move between apps, or buttons/controls if you are in a control bar. The device will read out each option. -3. Double-tapping anywhere will open the app/select the option. -4. You can also "explore by touch" — hold your finger down on the screen and drag it around, and your device will read out the different apps/items you move across. - -If you want to turn TalkBack off: - -1. Navigate back to the TalkBack menu screen (using the different gestures that are currently enabled.) -2. Navigate to the slider switch and activate it to turn it off. - -> **참고:** You can get to your home screen at any time by swiping up and left in a smooth motion. If you have more than one home screen, you can move between them by swiping two fingers left and right. - -For a more complete list of TalkBack gestures, see [Use TalkBack gestures](https://support.google.com/accessibility/android/answer/6151827). - -#### Unlocking the phone - -When TalkBack is turned on, unlocking the phone is a bit different. - -You can do a two-finger swipe up from the bottom of the lock screen. If you've set a passcode or pattern for unlocking your device, you will then be taken to the relevant entry screen to enter it. - -You can also explore by touch to find the _Unlock_ button at the bottom middle of the screen, and then double-tap. - -#### Global and local menus - -TalkBack allows you to access global and local context menus, wherever you have navigated to on the device. The former provides global options relating to the device as a whole, and the latter provides options relating just to the current app/screen you are in. - -To get to these menus: - -1. Access the global menu by quickly swiping down, and then right. -2. Access the local menu by quickly swiping up, and then right. -3. Swipe left and right to cycle between the different options. -4. Once you've selected the option you want, double-click to choose that option. - -For details on all the options available under the global and local context menus, see [Use global and local context menus](https://support.google.com/accessibility/android/answer/6007066). - -#### Browsing web pages - -You can use the local context menu while in a web browser to find options to navigate web pages using just the headings, form controls, or links, or navigate line by line, etc. - -For example, with TalkBack turned on: - -1. Open your web browser. -2. Activate the URL bar. -3. Enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. To enter the text of the URL: - - - Select the URL bar by swiping left/right till you get to it, and then double-tapping. - - Hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to type it. Repeat for each character. - - Once you've finished, find the Enter key and press it. - -4. Swipe left and right to move between different items on the page. -5. Swipe up and right with a smooth motion to enter the local content menu. -6. Swipe right until you find the "Headings and Landmarks" option. -7. Double-tap to select it. Now you'll be able to swipe left and right to move between headings and ARIA landmarks. -8. To go back to the default mode, enter the local context menu again by swiping up and right, select "Default", and then double-tap to activate. - -**Note:** See [Get started on Android with TalkBack](https://support.google.com/accessibility/android/answer/6283677?hl=en&ref_topic=3529932) for more complete documentation. - -### iOS VoiceOver - -A mobile version of VoiceOver is built into the iOS operating system. - -To turn it on, go to Your _Settings_ app and select _Accessibility > VoiceOver_. Press the _VoiceOver_ slider to enable it (you'll also see a number of other options related to VoiceOver on this page). - -> **참고:** Some older iOS devices have the VoiceOver menu at _Settings app_ > _General_ > _Accessibility_ > _VoiceOver_. - -Once VoiceOver is enabled, iOS's basic control gestures will be a bit different: - -1. A single tap will cause the item you tap on to be selected; your device will speak the item you've tapped on. -2. You can also navigate the items on the screen by swiping left and right to move between them, or by sliding your finger around on the screen to move between different items (when you find the item you want, you can remove your finger to select it). -3. To activate the selected item (e.g., open a selected app), double-tap anywhere on the screen. -4. Swipe with three fingers to scroll through a page. -5. Tap with two fingers to perform a context-relevant action — for example, taking a photo while in the camera app. - -To turn it off again, navigate back to _Settings > General > Accessibility > VoiceOver_ using the above gestures, and toggle the _VoiceOver_ slider back to off. - -#### Unlock phone - -To unlock the phone, you need to press the home button (or swipe) as normal. If you have a passcode set, you can select each number by swiping/sliding (as explained above) and then double-tapping to enter each number when you've found the right one. - -#### Using the Rotor - -When VoiceOver is turned on, you have a navigation feature called the Rotor available to you, which allows you to quickly choose from a number of common useful options. To use it: - -1. Twist two fingers around on the screen like you are turning a dial. Each option will be read aloud as you twist further around. You can go back and forth to cycle through the options. -2. Once you've found the option you want: - - - Release your fingers to select it. - - If it is an option you can iterate the value of (such as Volume or Speaking Rate), you can do a swipe up or down to increase or decrease the value of the selected item. - -The options available under the Rotor are context-sensitive — they will differ depending on what app or view you are in (see below for an example). - -#### Browsing web pages - -Let's have a go at web browsing with VoiceOver: - -1. Open your web browser. -2. Activate the URL bar. -3. Enter a web page that has a bunch of headings on it, such as the front page of bbc.co.uk. To enter the text of the URL: - - - Select the URL bar by swiping left/right until you get to it, and then double-tapping. - - For each character, hold your finger down on the virtual keyboard until you get the character you want, and then release your finger to select it. Double-tap to type it. - - Once you've finished, find the Enter key and press it. - -4. Swipe left and right to move between items on the page. You can double-tap an item to select it (e.g., follow a link). -5. By default, the selected Rotor option will be Speaking Rate; you can currently swipe up and down to increase or decrease the speaking rate. -6. Now turn two fingers around the screen like a dial to show the rotor and move between its options. Here are a few examples of the options available: - - - _Speaking Rate_: Change the speaking rate. - - _Containers_: Move between different semantic containers on the page. - - _Headings_: Move between headings on the page. - - _Links_: Move between links on the page. - - _Form Controls_: Move between form controls on the page. - - _Language_: Move between different translations, if they are available. - -7. Select _Headings_. Now you'll be able to swipe up and down to move between headings on the page. - -**Note:** For a more complete reference covering the VoiceOver gestures available and other hints on accessibility testing on iOS, see [Test Accessibility on Your Device with VoiceOver](https://developer.apple.com/library/content/technotes/TestingAccessibilityOfiOSApps/TestAccessibilityonYourDevicewithVoiceOver/TestAccessibilityonYourDevicewithVoiceOver.html#//apple_ref/doc/uid/TP40012619-CH3). - -## Control mechanisms - -In our CSS and JavaScript accessibility article, we looked at the idea of events that are specific to a certain type of control mechanism (see [Mouse-specific events](/ko/docs/Learn/Accessibility/CSS_and_JavaScript#mouse-specific_events)). To recap, these cause accessibility issues because other control mechanisms can't activate the associated functionality. - -As an example, the [click](/ko/docs/Web/API/GlobalEventHandlers/onclick) event is good in terms of accessibility — an associated event handler can be invoked by clicking the element the handler is set on, tabbing to it and pressing Enter/Return, or tapping it on a touchscreen device. Try our [simple-button-example.html](https://github.com/mdn/learning-area/blob/master/accessibility/mobile/simple-button-example.html) example ([see it running live](http://mdn.github.io/learning-area/accessibility/mobile/simple-button-example.html)) to see what we mean. - -Alternatively, mouse-specific events such as [mousedown](/ko/docs/Web/API/GlobalEventHandlers/onmousedown) and [mouseup](/ko/docs/Web/API/GlobalEventHandlers/onmouseup) create problems — their event handlers cannot be invoked using non-mouse controls. - -If you try to control our [simple-box-drag.html](https://github.com/mdn/learning-area/blob/master/accessibility/mobile/simple-box-drag.html) ([see example live](http://mdn.github.io/learning-area/accessibility/mobile/simple-box-drag.html)) example with a keyboard or touch, you'll see the problem. This occurs because we are using code such as the following: - -``` -div.onmousedown = function() { - initialBoxX = div.offsetLeft; - initialBoxY = div.offsetTop; - movePanel(); -} - -document.onmouseup = stopMove; -``` - -To enable other forms of control, you need to use different, yet equivalent events — for example, touch events work on touchscreen devices: - -``` -div.ontouchstart = function(e) { - initialBoxX = div.offsetLeft; - initialBoxY = div.offsetTop; - positionHandler(e); - movePanel(); -} - -panel.ontouchend = stopMove; -``` - -We've provided a simple example that shows how to use the mouse and touch events together — see [multi-control-box-drag.html](https://github.com/mdn/learning-area/blob/master/accessibility/mobile/multi-control-box-drag.html) ([see the example live](http://mdn.github.io/learning-area/accessibility/mobile/multi-control-box-drag.html) also). - -> **참고:** You can also see fully functional examples showing how to implement different control mechanisms at [Implementing game control mechanisms](/ko/docs/Games/Techniques/Control_mechanisms). - -## Responsive design - -[Responsive design](/ko/docs/Web/Apps/Progressive/Responsive) is the practice of making your layouts and other features of your apps dynamically change depending on factors such as screen size and resolution, so they are usable and accessible to users of different device types. - -In particular, the most common problems that need to be addressed for mobile are: - -- Suitability of layouts for mobile devices. A multi-column layout won't work as well on a narrow screen, for example, and the text size may need to be increased so it is legible. Such issues can be solved by creating a responsive layout using technologies such as [media queries](/ko/docs/Web/CSS/Media_Queries), [viewport](/ko/docs/Mozilla/Mobile/Viewport_meta_tag), and [flexbox](/ko/docs/Learn/CSS/CSS_layout/Flexbox). -- Conserving image sizes downloaded. In general, small screen devices won't need images that are as large as their desktop counterparts, and they are more likely to be on slow network connections. Therefore, it is wise to serve smaller images to narrow screen devices as appropriate. You can handle this using [responsive image techniques](/ko/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images). -- Thinking about high resolutions. Many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. Again, you can serve images as appropriate using responsive image techniques. In addition, many image requirements can be fulfilled using the SVG vector images format, which is well-supported across browsers today. SVG has a small file size and will stay sharp regardless of whatever size is being displayed (see [Adding vector graphics to the web](/ko/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web) for more details). - -**Note:** We won't provide a full discussion of responsive design techniques here, as they are covered in other places around MDN (see above links). - -### Specific mobile considerations - -There are other important issues to consider when making sites more accessible on mobile. We have listed a couple here, but we will add more when we think of them. - -#### Not disabling zoom - -Using [viewport](/ko/docs/Mozilla/Mobile/Viewport_meta_tag), it is possible to disable zoom. Always ensure resizing is enabled, and set the width to the device's width in the {{htmlelement("head")}}: - -```html - -``` - -You should never set `user-scalable=no` if at all possible — many people rely on zoom to be able to see the content of your website, so taking this functionality away is a really bad idea. There are certain situations where zooming might break the UI; in such cases, if you feel that you absolutely need to disable zoom, you should provide some other kind of equivalent, such as a control for increasing the text size in a way that doesn't break your UI. - -#### Keeping menus accessible - -Because the screen is so much narrower on mobile devices, it is very common to use media queries and other technologies to make the navigation menu shrink down to a tiny icon at the top of the display — which can be pressed to reveal the menu only if it's needed — when the site is viewed on mobile. This is commonly represented by a "three horizontal lines" icon, and the design pattern is consequently known as a "hamburger menu". - -When implementing such a menu, you need to make sure that the control to reveal it is accessible by appropriate control mechanisms (normally touch for mobile), as discussed in [Control mechanisms](#control_mechanisms) above, and that the rest of the page is moved out of the way or hidden in some way while the menu is being accessed, to avoid confusion with navigating it. - -Click here for a [good hamburger menu example](http://fritz-weisshart.de/meg_men/). - -## User input - -On mobile devices, inputting data tends to be more annoying for users than the equivalent experience on desktop computers. It is more convenient to type text into form inputs using a desktop or laptop keyboard than a touchscreen virtual keyboard or a tiny mobile physical keyboard. - -For this reason, it is worth trying to minimize the amount of typing needed. As an example, instead of getting users to fill out their job title each time using a regular text input, you could instead offer a {{htmlelement("select")}} menu containing the most common options (which also helps with consistency in data entry), and offer an "Other" option that displays a text field to type any outliers into. You can see a simple example of this idea in action in [common-job-types.html](https://github.com/mdn/learning-area/blob/master/accessibility/mobile/common-job-types.html) (see the [common jobs example live](http://mdn.github.io/learning-area/accessibility/mobile/common-job-types.html)). - -It is also worth considering the use of HTML5 form input types such as the date on mobile platforms as they handle them well — both Android and iOS, for example, display usable widgets that fit well with the device experience. See [html5-form-examples.html](https://github.com/mdn/learning-area/blob/master/accessibility/mobile/html5-form-examples.html) for some examples (see the [HTML5 form examples live](http://mdn.github.io/learning-area/accessibility/mobile/html5-form-examples.html)) — try loading these and manipulating them on mobile devices. For example: - -- Types `number`, `tel`, and `email` display suitable virtual keyboards for entering numbers/telephone numbers. -- Types `time` and `date` display suitable pickers for selecting times and dates. - -If you want to provide a different solution for desktops, you could always serve different markup to your mobile devices using feature detection. See [input types](http://diveinto.html5doctor.com/detect.html#input-types) for raw information on detecting different input types, and also check out our [feature detection article](/ko/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection) for much more information. - -## Summary - -In this article, we have provided you with some details about common mobile accessibility-specific issues and how to overcome them. We also took you through the usage of the most common screenreaders to aid you in accessibility testing. - -## See also - -- [Guidelines For Mobile Web Development](https://www.smashingmagazine.com/guidelines-for-mobile-web-development/) — A list of articles in _Smashing Magazine_ covering different techniques for mobile web design. -- [Make your site work on touch devices](http://www.creativebloq.com/javascript/make-your-site-work-touch-devices-51411644) — Useful article about using touch events to get interactions working on mobile devices. - -{{PreviousMenuNext("Learn/Accessibility/Multimedia","Learn/Accessibility/Accessibility_troubleshooting", "Learn/Accessibility")}} diff --git a/files/ko/learn/accessibility/what_is_accessibility/index.md b/files/ko/learn/accessibility/what_is_accessibility/index.md index 095953c1e4322e..eaed31f92bc9ed 100644 --- a/files/ko/learn/accessibility/what_is_accessibility/index.md +++ b/files/ko/learn/accessibility/what_is_accessibility/index.md @@ -110,7 +110,7 @@ l10n: ## 프로젝트에 접근성 구현하기 -실제 프로젝트 구현 단계에서 접근성은 “비싼 추가 사항”으로 간주되는 경우가 많은데, 아래와 같은 경우에는 사실이 될 수 있습니다. +실제 프로젝트 구현 단계에서 접근성은 "비싼 추가 사항"으로 간주되는 경우가 많은데, 아래와 같은 경우에는 사실이 될 수 있습니다. - 심각한 접근성 이슈가 있는 기존의 웹 사이트에 접근성을 추가하며 개조하려고 하는 경우 - 프로젝트가 한참 진행된 뒤에야 접근성을 고려하며 관련된 이슈들을 발견한 경우 @@ -125,7 +125,7 @@ l10n: 접근성을 위한 작업이 필요한 잠재적 문제 영역에 대해 기록하고, 철저하게 테스팅 될 수 있도록 하며 해결 방안과 대안을 생각해야 합니다. 텍스트 콘텐츠는 (다음 아티클에서 살펴볼 것처럼) 쉬운 편이지만, 멀티미디어 콘텐츠나 최신 3D 기술로 만들어진 그래픽들은 어떻게 해야할까요? 프로젝트 예산을 고려해 이런 콘텐츠들을 접근성 있게 만들기 위해서 어떤 일을 할 수 있는지 생각해보세요. 비용은 많이 들겠지만 모든 멀티미디어에 대해 다른 형태의 기록, 음성 등을 제공하는 것도 가능합니다. -동시에 현실적으로 생각하세요. “100% 접근성"은 실현 불가능한 이상입니다. 언제나 예외가 존재하고 어떤 사용자는 어떤 콘텐츠를 사용하기 어렵다고 느낄 것입니다. 하지만 할 수 있는 만큼 노력해야 합니다. 만약 WebGL을 사용해 멋진 3D 파이 차트 그래픽을 만들 계획이라면, 같은 데이터에 대한 데이터 테이블을 접근성 있는 형태로 포함할 수 있습니다. 또는 3D 파이 차트를 테이블로 대체할 수도 있겠습니다. 테이블은 모두에게 접근성 있으며, 더 빠르게 개발 가능하고, CPU 집약적이지도 않으며 유지보수도 더 쉽습니다. +동시에 현실적으로 생각하세요. "100% 접근성"은 실현 불가능한 이상입니다. 언제나 예외가 존재하고 어떤 사용자는 어떤 콘텐츠를 사용하기 어렵다고 느낄 것입니다. 하지만 할 수 있는 만큼 노력해야 합니다. 만약 WebGL을 사용해 멋진 3D 파이 차트 그래픽을 만들 계획이라면, 같은 데이터에 대한 데이터 테이블을 접근성 있는 형태로 포함할 수 있습니다. 또는 3D 파이 차트를 테이블로 대체할 수도 있겠습니다. 테이블은 모두에게 접근성 있으며, 더 빠르게 개발 가능하고, CPU 집약적이지도 않으며 유지보수도 더 쉽습니다. 반면에 흥미로운 3D 아트를 전시하는 갤러리 웹사이트를 작업하고 있다면, 모든 작품이 전적으로 시각적인 매체이므로 시각 장애인에게 완벽한 접근성을 제공하기는 어려울 것입니다. diff --git a/files/ko/learn/common_questions/tools_and_setup/checking_that_your_web_site_is_working_properly/index.md b/files/ko/learn/common_questions/tools_and_setup/checking_that_your_web_site_is_working_properly/index.md index 0560cea75f8994..16ab5b3b72b4d1 100644 --- a/files/ko/learn/common_questions/tools_and_setup/checking_that_your_web_site_is_working_properly/index.md +++ b/files/ko/learn/common_questions/tools_and_setup/checking_that_your_web_site_is_working_properly/index.md @@ -47,7 +47,7 @@ _There is no active learning available yet. [Please, consider contributing](/ko/ 우리의 개인 사이트를 봅시다.(동작x), `http://demozilla.examplehostingprovider.net/`. It's not showing the image we expected! -![Oops, the ‘unicorn’ image is missing](image-missing.png) +![Oops, the 'unicorn' image is missing](image-missing.png) Open Firefox's Network tool (**Tools ➤ Web Developer ➤ Network**) and reload the page: @@ -86,7 +86,7 @@ So what went wrong? At first glance, the image we asked for seems to be in the right place... but the Network tool reported a "404". It turns out that we made a typo in our HTML code: `unicorn_pics.png` rather than `unicorn_pic.png`. So correct the typo in your code editor by changing the image's `src` attribute: -![Deleting the ‘s’](code-correct.png) +![Deleting the 's'](code-correct.png) Save, [push to the server](/en-US/Learn/Upload_files_to_a_web_server), and reload the page in your browser: @@ -105,7 +105,7 @@ The most frequent errors that we find are these: #### Typos in the address -We wanted to type `http://demozilla.examplehostingprovider.net/` but typed too fast and forgot an “l”: +We wanted to type `http://demozilla.examplehostingprovider.net/` but typed too fast and forgot an "l": ![Address unreachable](cannot-find-server.png) @@ -154,7 +154,7 @@ PING mozilla.org (63.245.215.20): 56 data bytes round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms ``` -Just keep in mind a handy keyboard shortcut: **Ctrl+C**. Ctrl+C sends an “interrupt” signal to the runtime and tells it to stop. If you don't stop the runtime, `ping` will ping the server indefinitely. +Just keep in mind a handy keyboard shortcut: **Ctrl+C**. Ctrl+C sends an "interrupt" signal to the runtime and tells it to stop. If you don't stop the runtime, `ping` will ping the server indefinitely. ### A simple checklist diff --git a/files/ko/learn/common_questions/tools_and_setup/upload_files_to_a_web_server/index.md b/files/ko/learn/common_questions/tools_and_setup/upload_files_to_a_web_server/index.md index 16a292b0363aa6..18d6df9508fd6b 100644 --- a/files/ko/learn/common_questions/tools_and_setup/upload_files_to_a_web_server/index.md +++ b/files/ko/learn/common_questions/tools_and_setup/upload_files_to_a_web_server/index.md @@ -85,7 +85,7 @@ To publish to this account, please connect through FTP with the following creden ![Our demozilla personal website, seen in a browser: it's empty](demozilla-empty.png) -> **참고:** 보이는 화면은 여러분의 호스팅 제공자에 따라 다릅니다. 대부분은 “This website is hosted by \[Hosting Service].”과 같은 페이지를 보게될 것입니다. +> **참고:** 보이는 화면은 여러분의 호스팅 제공자에 따라 다릅니다. 대부분은 "This website is hosted by \[Hosting Service]."과 같은 페이지를 보게될 것입니다. 이제 우리의 FTP 클라이언트를 멀리 떨어진 서버에 접속하기 위해 _"Create an account..." 버튼을 누릅니다._ 그리고 호스팅제공자로 부터 받은 정보를 해당 필드에 채워줍니다. diff --git a/files/ko/learn/common_questions/web_mechanics/pages_sites_servers_and_search_engines/index.md b/files/ko/learn/common_questions/web_mechanics/pages_sites_servers_and_search_engines/index.md index 46046eedfa0c5f..ae53414f9ccf60 100644 --- a/files/ko/learn/common_questions/web_mechanics/pages_sites_servers_and_search_engines/index.md +++ b/files/ko/learn/common_questions/web_mechanics/pages_sites_servers_and_search_engines/index.md @@ -84,7 +84,7 @@ _웹 페이지_ 와 _웹사이트 에 대한 생각은_ 특히 하나의*웹 페 ### 웹 서버 -##### *웹 서버*는 한 개 이상의 *웹사이트*를 호스팅하는 컴퓨터입니다. "호스팅"은 모든 _웹 페이지_ 및 웹 페이지가 지원하는 파일들을 컴퓨터에서 이용할 수 있다는 것을 의미한다. *웹 서버*는 유저의 request(요청)마다 호스팅하는 *웹사이트*에서 유저의 브라우저로 *웹 페이지*를 보낼 것이다. +##### *웹 서버*는 한 개 이상의 *웹사이트*를 호스팅하는 컴퓨터입니다. "호스팅"은 모든 _웹 페이지_ 및 웹 페이지가 지원하는 파일들을 컴퓨터에서 이용할 수 있다는 것을 의미한다. *웹 서버*는 유저의 request(요청)마다 호스팅하는 *웹사이트*에서 유저의 브라우저로 *웹 페이지*를 보낼 것이다 *웹 사이트*와 *웹 서버*를 혼동하지 마라. 예를 들어, 당신이 누군가 "내 웹사이트가 반응하지 않는다." 라고 말하는 것을 들었다면, 그것은 사실 *웹 서버*가 반응하지 않는다는 의미이다. 그러므로 *웹사이트*를 이용하지 못 한다. 더 중요하게, *웹 서버*는 여러 웹사이트에 호스팅될 수 있기 때문에, 웹 서버라는 용어는 절대 웹사이트를 지정하기 위해 사용하지 않는다. 그것이 큰 혼란을 일으킬 수 있기 때문이다. 아까의 예처럼, 만약 우리가 "내 웹 서버가 반응하지 않는다." 라고 하면, 그것은 웹 서버가 이용할 수 있는 웹 사이트가 없다는 것을 의미한다. diff --git a/files/ko/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md b/files/ko/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md index 0d915096660839..f12afb46db0ba3 100644 --- a/files/ko/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md +++ b/files/ko/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md @@ -59,7 +59,7 @@ _아직 이용가능한 Active Learning이 없습니다. [Please, consider contr #### 누가 도메인 이름을 갖고 있나요? -You cannot “buy a domain name”. You pay for the right to use a domain name for one or more years. You can renew your right, and your renewal has priority over other people's applications. But you never own the domain name. +You cannot "buy a domain name". You pay for the right to use a domain name for one or more years. You can renew your right, and your renewal has priority over other people's applications. But you never own the domain name. Companies called registrars use domain name registries to keep track of technical and administrative information connecting you to your domain name. @@ -69,7 +69,7 @@ Companies called registrars use domain name registries to keep track of technica To find out whether a given domain name is available, -- Go to a domain name registrar's website. Most of them provide a “whois” service that tells you whether a domain name is available. +- Go to a domain name registrar's website. Most of them provide a "whois" service that tells you whether a domain name is available. - Alternatively, if you use a system with a built-in shell, type a `whois` command into it, as shown here for `mozilla.org`: ``` @@ -113,7 +113,7 @@ NOT FOUND 과정은 다음과 같습니다. 1. 등록 웹사이트로 가세요. -2. 일반적으로 눈에 띄게 “Get a domain name” 이라는 글자가 있을거에요. 클릭하세요. +2. 일반적으로 눈에 띄게 "Get a domain name" 이라는 글자가 있을거에요. 클릭하세요. 3. 요구하는 상세 정보를 채우세요. 그리고 특별히 원하는 도메인 네임의 스펠링을 정확하게 입력했는지 다시한번 확인해주세요. 한번 지불하면 돌이킬 수 없습니다. 4. 등록이 잘 되었다면 등록 웹사이트에서 연락이 올 것입니다. 그리고 몇시간내로 모든 DNS 서버들이 당신의 DNS 정보를 받을거구요. @@ -121,7 +121,7 @@ NOT FOUND #### DNS 갱신 -DNS databases are stored on every DNS server worldwide, and all these servers refer to a few ones called “authoritative name server” or “top-level DNS servers.” Whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every DNS database. Each DNS server that knows about a given domain stores the information for some time before it is automatically invalidated and then refreshed (the DNS server queries an authoritative server again). Thus, it takes some time for DNS servers that know about this domain name to get the up-to-date information. +DNS databases are stored on every DNS server worldwide, and all these servers refer to a few ones called "authoritative name server" or "top-level DNS servers." Whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every DNS database. Each DNS server that knows about a given domain stores the information for some time before it is automatically invalidated and then refreshed (the DNS server queries an authoritative server again). Thus, it takes some time for DNS servers that know about this domain name to get the up-to-date information. > **참고:** **Note :** This time is often called **propagation time**. However this term is not precise since the update is not propagating itself (top → down). DNS servers queried by your computer (down) are the ones that fetch the information from the authoritative server (top) when they need it. diff --git a/files/ko/learn/css/building_blocks/backgrounds_and_borders/index.md b/files/ko/learn/css/building_blocks/backgrounds_and_borders/index.md index 88e287d43edcc2..a74e3a526a8a37 100644 --- a/files/ko/learn/css/building_blocks/backgrounds_and_borders/index.md +++ b/files/ko/learn/css/building_blocks/backgrounds_and_borders/index.md @@ -45,8 +45,14 @@ CSS {{cssxref("background")}} 속성은 이 수업에서 만나게 될 많은 ba ```css .box { - background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 96%) center center / 400px 200px no-repeat, - url(big-star.png) center no-repeat, rebeccapurple; + background: + linear-gradient( + 105deg, + rgba(255, 255, 255, 0.2) 39%, + rgba(51, 56, 57, 1) 96% + ) center center / 400px 200px no-repeat, + url(big-star.png) center no-repeat, + rebeccapurple; } ``` @@ -179,9 +185,12 @@ CSS {{cssxref("background")}} 속성은 이 수업에서 만나게 될 많은 ba 다른 `background-*` 속성은 `background-image` 와 같은 방식으로 쉼표로 구분된 값을 가질 수도 있습니다: ```css -background-image: url(image1.png), url(image2.png), url(image3.png), url(image1.png); +background-image: url(image1.png), url(image2.png), url(image3.png), + url(image1.png); background-repeat: no-repeat, repeat-x, repeat; -background-position: 10px 20px, top right; +background-position: + 10px 20px, + top right; ``` 다른 속성의 각 값은 다른 속성의 같은 위치에 있는 값과 일치합니다. 예를 들어, `image1` 의 `background-repeat` 값은 `no-repeat` 입니다. 그러나, 다른 속성의 값이 다른 경우 어떻게 됩니까? 답은 더 적은 수의 값이 순환한다는 것입니다 — 위의 예에서는 4 개의 배경 이미지가 있지만 2 개의 `background-position` 값만 있습니다. 처음 두 위치 값은 처음 두 이미지에 적용되고 다시 순환됩니다 — `image3` 에는 첫 번째 위치값이 제공되고, `image4` 에는 두 번째 위치값이 제공됩니다. diff --git a/files/ko/learn/css/building_blocks/cascade_and_inheritance/index.md b/files/ko/learn/css/building_blocks/cascade_and_inheritance/index.md index 20c3c9012b9cc7..df0d3cc399f7bf 100644 --- a/files/ko/learn/css/building_blocks/cascade_and_inheritance/index.md +++ b/files/ko/learn/css/building_blocks/cascade_and_inheritance/index.md @@ -2,6 +2,7 @@ title: 계단식 및 상속 slug: Learn/CSS/Building_blocks/Cascade_and_inheritance --- + {{LearnSidebar}}{{NextMenu("Learn/CSS/Building_blocks/Selectors", "Learn/CSS/Building_blocks")}} 이 수업의 목적은 CSS 가 HTML 에 적용되는 방법과 충돌을 해결하는 방법을 제어하는 CSS 의 가장 기본적인 개념인 — 계단식, 우선 순위 및 상속 — 에 대한 이해를 발전시키는 것입니다. @@ -175,12 +176,12 @@ CSS 속기 속성을 `all` 로 사용하면 이러한 상속 값 중 하나를 ( 다음 표는 기분을 전환하기 위해 몇 가지 분리된 예를 보여줍니다. 이것들을 살펴보고 왜 그들이 우리에게 그들에게 주어진 우선 순위를 가지고 있는지 이해하도록 하십시오. 선택자는 아직 자세히 다루지 않았지만, MDN [선택자 참조](/ko/docs/Web/CSS/CSS_Selectors) 에서 각 선택자의 세부 정보를 찾을 수 있습니다. -| 선택자 | Thousands | Hundreds | Tens | Ones | Total specificity | -| ------------------------------------------------------------------------------- | --------- | -------- | ---- | ---- | ----------------- | -| `h1` | 0 | 0 | 0 | 1 | 0001 | -| `h1 + p::first-letter` | 0 | 0 | 0 | 3 | 0003 | -| `li > a[href*="en-US"] > .inline-warning` | 0 | 0 | 2 | 2 | 0022 | -| `#identifier` | 0 | 1 | 0 | 0 | 0100 | +| 선택자 | Thousands | Hundreds | Tens | Ones | Total specificity | +| ------------------------------------------------------------------------ | --------- | -------- | ---- | ---- | ----------------- | +| `h1` | 0 | 0 | 0 | 1 | 0001 | +| `h1 + p::first-letter` | 0 | 0 | 0 | 3 | 0003 | +| `li > a[href*="en-US"] > .inline-warning` | 0 | 0 | 2 | 2 | 0022 | +| `#identifier` | 0 | 1 | 0 | 0 | 0100 | | 요소의 {{htmlattrxref("style")}} 속성 안에 규칙이 있는 선택자가 없습니다 | 1 | 0 | 0 | 0 | 1000 | 계속 진행하기 전에, 실제 사례를 살펴보겠습니다. diff --git a/files/ko/learn/css/building_blocks/handling_different_text_directions/index.md b/files/ko/learn/css/building_blocks/handling_different_text_directions/index.md index 7e4e8caf0be70d..8c71322471a838 100644 --- a/files/ko/learn/css/building_blocks/handling_different_text_directions/index.md +++ b/files/ko/learn/css/building_blocks/handling_different_text_directions/index.md @@ -1,7 +1,6 @@ --- title: 텍스트 표시 방향 제어하기 slug: Learn/CSS/Building_blocks/Handling_different_text_directions - --- {{LearnSidebar}}{{PreviousMenuNext("Learn/CSS/Building_blocks/Backgrounds_and_borders", "Learn/CSS/Building_blocks/Overflowing_content", "Learn/CSS/Building_blocks")}} @@ -80,7 +79,7 @@ CSS 레이아웃, 특히 최신 레이아웃 방법을 살펴보기 시작하면 쓰기 모드 외에 텍스트 방향도 있습니다. 위에서 언급한 것처럼, 아랍어와 같은 일부 언어는 가로로 작성되지만, 오른쪽에서 왼쪽으로 작성됩니다. 이것은 창의적 의미에서 사용할 가능성이 있는 것이 아닙니다 — 단순히 오른쪽에 무언가를 정렬하려면 다른 방법이 있습니다 — 그러나 CSS 의 특성의 일부로 이것을 이해하는 것이 중요합니다. 웹은 왼쪽에서 오른쪽으로 표시되는 언어만을 위한 것이 아닙니다! -쓰기 모드와 텍스트 방향이 변경될 수 있기 때문에, 최신 CSS 레이아웃 방법은 왼쪽과 오른쪽, 위와 아래를 참조하지 않습니다. 대신에 그들은 인라인과 블록이라는 아이디어와 함께 ***시작** *과 ***끝** *에 대해 이야기할 것입니다. 지금 그것에 대해 너무 걱정하지 말고 레이아웃을 살펴보기 시작할 때, 이러한 아이디어를 명심하십시오. CSS 에 대한 이해에 도움이 될 것입니다. +쓰기 모드와 텍스트 방향이 변경될 수 있기 때문에, 최신 CSS 레이아웃 방법은 왼쪽과 오른쪽, 위와 아래를 참조하지 않습니다. 대신에 그들은 인라인과 블록이라는 아이디어와 함께 _시작_ 과 _끝_ 에 대해 이야기할 것입니다. 지금 그것에 대해 너무 걱정하지 말고 레이아웃을 살펴보기 시작할 때, 이러한 아이디어를 명심하십시오. CSS 에 대한 이해에 도움이 될 것입니다. ## 논리적 속성 및 값 diff --git a/files/ko/learn/css/building_blocks/images_media_form_elements/index.md b/files/ko/learn/css/building_blocks/images_media_form_elements/index.md index 807c21ac7b6b61..409ec268e38f08 100644 --- a/files/ko/learn/css/building_blocks/images_media_form_elements/index.md +++ b/files/ko/learn/css/building_blocks/images_media_form_elements/index.md @@ -129,8 +129,8 @@ button, input, select, textarea { - font-family : inherit; - font-size : 100%; + font-family: inherit; + font-size: 100%; } ``` @@ -173,7 +173,8 @@ textarea { font-family: inherit; font-size: 100%; box-sizing: border-box; - padding: 0; margin: 0; + padding: 0; + margin: 0; } textarea { diff --git a/files/ko/learn/css/building_blocks/index.md b/files/ko/learn/css/building_blocks/index.md index f57d587987e4ef..48ba52d890c2eb 100644 --- a/files/ko/learn/css/building_blocks/index.md +++ b/files/ko/learn/css/building_blocks/index.md @@ -2,6 +2,7 @@ title: CSS 구성 블록 slug: Learn/CSS/Building_blocks --- + {{LearnSidebar}} 이 강의에서는 [CSS 첫 번째 단계](/ko/docs/Learn/CSS/First_steps) 가 중단된 부분을 처리합니다 — 이제 언어와 구문에 익숙해졌으며, 약간 더 깊이 익힐 때가 되었을 때, 이를 사용하는 기본적인 경험을 얻었습니다. 이 과목에서는 계단식 및 상속, 사용 가능한 모든 선택자 유형, 단위 크기 조정, 배경 및 테두리 스타일 지정, 디버깅 등을 살펴 봅니다. @@ -35,7 +36,7 @@ slug: Learn/CSS/Building_blocks - [결합자 (combinators)](/ko/docs/Learn/CSS/Building_blocks/Selectors/Combinators) - [박스 모델](/ko/docs/Learn/CSS/Building_blocks/The_box_model) - - : CSS 의 모든 것에는 주위에 박스가 있으며, 이러한 박스를 이해하는 것은 CSS 를 사용하여 레이아웃을 만들거나 다른 항목과 항목을 정렬하는 데 중요합니다. 이 수업에서는 CSS ***박스 모델** *을 제대로 살펴보고, 작동 방식 및 관련 용어를 이해하여 보다 복잡한 레이아웃 작업으로 넘어갈 수 있습니다. + - : CSS 의 모든 것에는 주위에 박스가 있으며, 이러한 박스를 이해하는 것은 CSS 를 사용하여 레이아웃을 만들거나 다른 항목과 항목을 정렬하는 데 중요합니다. 이 수업에서는 CSS _박스 모델_ 을 제대로 살펴보고, 작동 방식 및 관련 용어를 이해하여 보다 복잡한 레이아웃 작업으로 넘어갈 수 있습니다. - [배경 및 테두리](/ko/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders) - : 이번 수업에서는 CSS 배경과 테두리로 할 수 있는 창의적인 작업을 살펴 보겠습니다. 그라데이션 (gradients), 배경 이미지 및 둥근 테두리를 추가하는 경우, 배경과 테두리는 CSS 의 많은 스타일 질문에 대한 답입니다. - [다른 텍스트 방향 처리](/ko/docs/Learn/CSS/Building_blocks/Handling_different_text_directions) diff --git a/files/ko/learn/css/building_blocks/organizing/index.md b/files/ko/learn/css/building_blocks/organizing/index.md index bc70d64595875d..724e5e66ca19f7 100644 --- a/files/ko/learn/css/building_blocks/organizing/index.md +++ b/files/ko/learn/css/building_blocks/organizing/index.md @@ -2,6 +2,7 @@ title: CSS 구성 slug: Learn/CSS/Building_blocks/Organizing --- + {{LearnSidebar}}{{PreviousMenu("Learn/CSS/Building_blocks/Debugging_CSS", "Learn/CSS/Building_blocks")}} 더 큰 스타일 시트와 큰 프로젝트에서 작업을 시작하면 큰 CSS 파일을 유지 관리하는 것이 어려울 수 있습니다. 이 기사에서는 CSS 를 쉽게 유지 관리할 수 있도록 작성하는 몇 가지 모범 사례와 유지 관리성을 개선하기 위해, 다른 사용자가 사용하는 해결책을 간략하게 살펴보겠습니다. @@ -63,8 +64,13 @@ slug: Learn/CSS/Building_blocks/Organizing CSS 형식을 볼 수 있는 몇 가지 방법이 있습니다. 일부 개발자는 다음과 같이 모든 규칙을 한 라인에 넣습니다: ```css -.box { background-color: #567895; } -h2 { background-color: black; color: white; } +.box { + background-color: #567895; +} +h2 { + background-color: black; + color: white; +} ``` 다른 개발자는 모든 것을 새로운 라인으로 나누는 것을 선호합니다: @@ -236,7 +242,7 @@ If you are not taking an OOCSS approach you might create custom CSS for the diff } .comment .content { - font-size: .8rem; + font-size: 0.8rem; } .list-item { @@ -246,7 +252,7 @@ If you are not taking an OOCSS approach you might create custom CSS for the diff } .list-item .content { - font-size: .8rem; + font-size: 0.8rem; } ``` @@ -259,14 +265,14 @@ In OOCSS, you would create one pattern called `media` that would have all of the } .media .content { - font-size: .8rem; + font-size: 0.8rem; } .comment img { border: 1px solid grey; } - .list-item { +.list-item { border-bottom: 1px solid grey; } ``` @@ -286,7 +292,7 @@ The list-item would have `media` and `list-item` applied:
  • -
    +
``` @@ -300,9 +306,7 @@ BEM stands for Block Element Modifier. In BEM a block is a standalone entity suc ```html
- +
``` diff --git a/files/ko/learn/css/building_blocks/selectors/index.md b/files/ko/learn/css/building_blocks/selectors/index.md index 28ae67425d4dd8..d5de7052f1447a 100644 --- a/files/ko/learn/css/building_blocks/selectors/index.md +++ b/files/ko/learn/css/building_blocks/selectors/index.md @@ -52,7 +52,7 @@ CSS 에서, 선택자는 CSS 선택자 사양에 정의되어 있습니다. CSS ## 선택자 목록 -동일한 CSS 를 사용하는 항목이 두 개 이상인 경우 규칙이 모든 개별 선택자에 적용되도록 개별 선택자를 ***선택자 목록** *으로 결합할 수 있습니다. 예를 들어, `h1` 에 대해 동일한 CSS 와 `special` class 를 사용하면 이것을 두 개의 별도 규칙으로 작성할 수 있습니다. +동일한 CSS 를 사용하는 항목이 두 개 이상인 경우 규칙이 모든 개별 선택자에 적용되도록 개별 선택자를 _선택자 목록_ 으로 결합할 수 있습니다. 예를 들어, `h1` 에 대해 동일한 CSS 와 `special` class 를 사용하면 이것을 두 개의 별도 규칙으로 작성할 수 있습니다. ```css h1 { @@ -66,7 +66,7 @@ h1 { 또한 이들 사이에 쉼표를 추가하여 선택자 목록으로 결합할 수도 있습니다. -```css +```css-nolint h1, .special { color: blue; } @@ -102,7 +102,8 @@ h1 { 그러나 결합하면, 전체 규칙이 유효하지 않은 것으로 간주되어 `h1` 또는 class 가 스타일 지정되지 않습니다. ```css -h1, ..special { +h1, +..special { color: blue; } ``` @@ -116,19 +117,22 @@ h1, ..special { 이 그룹에는 `

` 과 같은 HTML 요소를 대상으로 하는 선택자가 포함됩니다. ```css -h1 { } +h1 { +} ``` 또한 class 를 대상으로 하는 선택자가 포함됩니다. ```css -.box { } +.box { +} ``` 또는 ID ```css -#unique { } +#unique { +} ``` ### 속성 선택자 @@ -136,13 +140,16 @@ h1 { } 이 선택자 그룹은 요소에 특정 속성이 있는지에 따라 요소를 선택하는 다른 방법을 제공합니다. ```css -a[title] { } +a[title] { +} ``` 또는 특정 값을 가진 속성의 존재 여부를 기반으로 선택하십시오: ```css -a[href="https://example.com"] { } +a[href="https://example.com"] +{ +} ``` ### Pseudo-classes 및 pseudo-elements @@ -150,13 +157,15 @@ a[href="https://example.com"] { } 이 선택자 그룹에는 요소의 특정 상태를 스타일링하는 pseudo-classes 가 포함됩니다. 예를 들어 `:hover` pseudo-class 는 마우스 포인터에 의해 요소를 가리킬 때만 요소를 선택합니다: ```css -a:hover { } +a:hover { +} ``` 또한 요소 자체가 아닌 요소의 특정 부분을 선택하는 pseudo-elements 도 포함됩니다. 예를 들어, `::first-line` 은 항상 `` 이 첫 번째 형식의 라인을 감싸는 것처럼 작동하여, 요소 내부의 첫 번째 텍스트 라인 (아래의 경우 `

`) 을 선택합니다. ```css -p::first-line { } +p::first-line { +} ``` ### 결합자 (Combinators) @@ -164,7 +173,8 @@ p::first-line { } 최종 선택자 그룹은 문서 내의 요소를 대상으로 하기 위해 다른 선택자를 결합합니다. 예를 들어 다음은 자식 결합자 (`>`) 를 사용하여 `

` 요소의 자식인 단락을 선택합니다: ```css -article > p { } +article > p { +} ``` ## 다음 단계 diff --git a/files/ko/learn/css/building_blocks/styling_tables/index.md b/files/ko/learn/css/building_blocks/styling_tables/index.md index 3ab6a0dc098370..7bec5be1960b8c 100644 --- a/files/ko/learn/css/building_blocks/styling_tables/index.md +++ b/files/ko/learn/css/building_blocks/styling_tables/index.md @@ -32,7 +32,9 @@ HTML 표 스타일링은 세계에서 가장 매력적인 일이 아니지만, ```html - + @@ -55,7 +57,7 @@ HTML 표 스타일링은 세계에서 가장 매력적인 일이 아니지만, - ... some rows removed for brevity + ... some rows removed for brevity @@ -87,9 +89,9 @@ HTML 표 스타일링은 세계에서 가장 매력적인 일이 아니지만, 2. 다음으로, `style.css` 라는 새 파일을 만들고 다른 파일과 같은 디렉토리에 저장하십시오. 3. {{htmlelement("head")}} 안에 다음 HTML 행을 배치하여 CSS 를 HTML 에 연결하십시오: - ```html - - ``` + ```html + + ``` ### 간격 및 레이아웃 @@ -121,7 +123,8 @@ thead th:nth-child(4) { width: 35%; } -th, td { +th, +td { padding: 20px; } ``` @@ -149,7 +152,10 @@ th, td { 먼저, 다음 {{htmlelement("link")}} 요소를 기존 `` 요소 바로 위의 HTML head 에 추가하십시오: ```html - + ``` 이제 이전 CSS 아래의 `style.css` 파일에, 다음 CSS 를 추가하십시오: @@ -158,11 +164,12 @@ th, td { /* typography */ html { - font-family: 'helvetica neue', helvetica, arial, sans-serif; + font-family: "helvetica neue", helvetica, arial, sans-serif; } -thead th, tfoot th { - font-family: 'Rock Salt', cursive; +thead th, +tfoot th { + font-family: "Rock Salt", cursive; } th { @@ -200,14 +207,21 @@ tfoot th { 아래에서 다시 CSS 를 `style.css` 파일에 추가하고, 다시 시작하십시오: ```css -thead, tfoot { +thead, +tfoot { background: url(leopardskin.jpg); color: white; text-shadow: 1px 1px 1px black; } -thead th, tfoot th, tfoot td { - background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5)); +thead th, +tfoot th, +tfoot td { + background: linear-gradient( + to bottom, + rgba(0, 0, 0, 0.1), + rgba(0, 0, 0, 0.5) + ); border: 3px solid purple; } ``` @@ -256,7 +270,7 @@ table { ```css caption { - font-family: 'Rock Salt', cursive; + font-family: "Rock Salt", cursive; padding: 20px; font-style: italic; caption-side: bottom; diff --git a/files/ko/learn/css/building_blocks/the_box_model/index.md b/files/ko/learn/css/building_blocks/the_box_model/index.md index 0f5afadc761678..7663b3af932731 100644 --- a/files/ko/learn/css/building_blocks/the_box_model/index.md +++ b/files/ko/learn/css/building_blocks/the_box_model/index.md @@ -1,7 +1,7 @@ --- -title: 상자 모델 +title: 박스 모델 slug: Learn/CSS/Building_blocks/The_box_model -original_slug: Learn/CSS/Building_blocks/상자_모델 +original_slug: Learn/CSS/Building_blocks/박스_모델 --- {{LearnSidebar}}{{PreviousMenuNext("Learn/CSS/Building_blocks/Selectors/Combinators", "Learn/CSS/Building_blocks/Backgrounds_and_borders", "Learn/CSS/Building_blocks")}} @@ -101,9 +101,9 @@ CSS 레이아웃에 대해 자세한 내용을 배우려면 다음번에는 예 나머지 수업에서는 외부 디스플레이 유형에 집중할 것이다. -## CSS Box Model이란 무엇인가? +## CSS 박스 모델이란 무엇인가? -전체 CSS box model은 블록 박스에 적용되며, 인라인 박스는 박스 모델에 정의된 일부 동작만 사용합니다. 이 모델은 당신이 페이지에서 볼 수 있는 박스를 생성하기 위해 박스의 서로 다른 부분인 여백, 테두리, 패딩 및 콘텐츠등이 어떻게 함께 작동할 것인지를 정의합니다. 몇 가지 복잡성을 추가하기 위해 표준 및 대체 박스 모델이 있습니다. +전체 CSS 박스 모델은 블록 박스에 적용되며, 인라인 박스는 박스 모델에 정의된 일부 동작만 사용합니다. 이 모델은 당신이 페이지에서 볼 수 있는 박스를 생성하기 위해 박스의 서로 다른 부분인 여백, 테두리, 패딩 및 콘텐츠등이 어떻게 함께 작동할 것인지를 정의합니다. 몇 가지 복잡성을 추가하기 위해 표준 및 대체 박스 모델이 있습니다. ### Box의 구성 @@ -118,9 +118,9 @@ CSS 블록 박스 구성하기 위한 우리의 준비물은: ![박스 모델](box-model.png) -### 표준 CSS box model +### 표준 CSS 박스 모델 -표준 box model에서 box에서 `width`와 `height`를 부여하면 *content box*의 너비와 높이가 정의됩니다. 그런 다음 패딩과 테두리는 박스의 너비와 높이에 추가되여 박스가 점유하는 전체 크기가 정해집니다. 그 내용이 아래 이미지에서 제시되었습니다. +표준 박스 모델에서 box에서 `width`와 `height`를 부여하면 *content box*의 너비와 높이가 정의됩니다. 그런 다음 패딩과 테두리는 박스의 너비와 높이에 추가되여 박스가 점유하는 전체 크기가 정해집니다. 그 내용이 아래 이미지에서 제시되었습니다. 우리는 박스의 `width`와 `height`, `margin`과 `border` 및 `padding` CSS 값이 다음과 같이 지정되어 있다고 간주합니다: @@ -140,7 +140,7 @@ CSS 블록 박스 구성하기 위한 우리의 준비물은: > **참고:** 여백은 박스의 실제 크기에 포함되지 않습니다. 물론 여백은 박스가 페이지에서 차지하는 총 공간에 영향을 미치지만, 박스의 외부 공간에만 영향을 미칩니다. 박스의 영역은 테두리에서 멈추게 됩니다. 여백으로 확장되지 않습니다. -### 대체 CSS box model +### 대체 CSS 박스 모델 박스의 실제 크기를 얻기 위해 테두리와 패딩을 추가하는 것이 다소 불편하다고 생각할 수 있습니다. 당신 말이 옳을 것입니다! 이러한 이유로 CSS는 표준 박스 모델 이후 머지않아 대체 박스 모델이 도입되었습니다. 이 모델을 사용한다면 너비는 페이지에서 표시되는 박스 너비이므로 콘텐츠 영역 너비는 너비에서 패딩 및 테두리 너비를 뺀 너비입니다. 위에서 사용된 것과 동일한 CSS를 아래 결과에 대입하면(폭 = 350px, 높이 = 150px)가 됩니다. @@ -160,7 +160,9 @@ CSS 블록 박스 구성하기 위한 우리의 준비물은: html { box-sizing: border-box; } -*, *::before, *::after { +*, +*::before, +*::after { box-sizing: inherit; } ``` diff --git a/files/ko/learn/css/building_blocks/values_and_units/index.md b/files/ko/learn/css/building_blocks/values_and_units/index.md index 78289aa54937ae..71be89c6dff8f4 100644 --- a/files/ko/learn/css/building_blocks/values_and_units/index.md +++ b/files/ko/learn/css/building_blocks/values_and_units/index.md @@ -52,7 +52,7 @@ CSS 사양과 MDN 의 속성 페이지에서 [``](/ko/docs/Web/CSS/color_ ```css h1 { color: black; - background-color: rgb(197,93,161); + background-color: rgb(197, 93, 161); } ``` @@ -64,12 +64,12 @@ CSS 값은 허용가능한 하위값 모음을 정의하는 방법입니다. 즉 CSS 에서 사용할 수 있는 다양한 숫자 데이터 형식이 있습니다. 다음은 모두 숫자로 분류됩니다: -| 데이터 형식 | 설명 | -| ---- | --- | -| [``](/ko/docs/Web/CSS/integer) | `` 은 `1024` 또는`-55` 와 같은 정수입니다. | -| [``](/ko/docs/Web/CSS/number) | `` 는 10진수를 나타냅니다 — 소수점 이하의 소수 자릿수 (예: `0.255`, `128` 또는 `-1.2`) 가 있을 수도 있고 없을 수도 있습니다.| -| [``](/ko/docs/Web/CSS/dimension) | `` 은 예를 들어 `45deg`, `5s` 또는 `10px`. 과 같은 단위가 붙어있는 `` 입니다. `` 은 [``](/ko/docs/Web/CSS/length), [``](/ko/docs/Web/CSS/angle), [` - - -
-
- - - -
- - -
+ {% csrf_token %} + +
+
+ + +
+
+ + + +
+ + +
{# Assumes you setup the password_reset view in your URLconf #} @@ -248,7 +248,7 @@ If you navigate to the logout URL () the Create and open /**locallibrary/templates/registration/logged_out.html**. Copy in the text below: -```html +```django {% extends "base_generic.html" %} {% block content %} @@ -271,7 +271,7 @@ The following templates can be used as a starting point. This is the form used to get the user's email address (for sending the password reset email). Create **/locallibrary/templates/registration/password_reset_form.html**, and give it the following contents: -```html +```django {% extends "base_generic.html" %} {% block content %} @@ -290,11 +290,14 @@ This is the form used to get the user's email address (for sending the password This form is displayed after your email address has been collected. Create **/locallibrary/templates/registration/password_reset_done.html**, and give it the following contents: -```html +```django {% extends "base_generic.html" %} {% block content %} -

We've emailed you instructions for setting your password. If they haven't arrived in a few minutes, check your spam folder.

+

+ We've emailed you instructions for setting your password. If they haven't + arrived in a few minutes, check your spam folder. +

{% endblock %} ``` @@ -302,7 +305,7 @@ This form is displayed after your email address has been collected. Create **/lo This template provides the text of the HTML email containing the reset link that we will send to users. Create **/locallibrary/templates/registration/password_reset_email.html**, and give it the following contents: -```html +```django Someone asked for password reset for email \{{ email }}. Follow the link below: \{{ protocol}}://\{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} ``` @@ -311,35 +314,35 @@ Someone asked for password reset for email \{{ email }}. Follow the link below: This page is where you enter your new password after clicking the link in the password reset email. Create **/locallibrary/templates/registration/password_reset_confirm.html**, and give it the following contents: -```html +```django {% extends "base_generic.html" %} {% block content %} - {% if validlink %} -

Please enter (and confirm) your new password.

-
- {% csrf_token %} -
A summary of the UK's most famous punk bands + A summary of the UK's most famous punk bands +
BandLondon Calling
The Stranglers\{{ form.username.label_tag }}\{{ form.username }}\{{ form.password.label_tag }}\{{ form.password }}\{{ form.username.label_tag }}\{{ form.username }}\{{ form.password.label_tag }}\{{ form.password }}
- - - - - - - - - - - - -
\{{ form.new_password1.errors }} - \{{ form.new_password1 }}
\{{ form.new_password2.errors }} - \{{ form.new_password2 }}
- - {% else %} -

Password reset failed

-

The password reset link was invalid, possibly because it has already been used. Please request a new password reset.

- {% endif %} + {% if validlink %} +

Please enter (and confirm) your new password.

+
+ {% csrf_token %} + + + + + + + + + + + + + +
\{{ form.new_password1.errors }} + \{{ form.new_password1 }}
\{{ form.new_password2.errors }} + \{{ form.new_password2 }}
+
+ {% else %} +

Password reset failed

+

The password reset link was invalid, possibly because it has already been used. Please request a new password reset.

+ {% endif %} {% endblock %} ``` @@ -387,18 +390,17 @@ This section looks at what we can do to selectively control content the user see Open the base template (**/locallibrary/catalog/templates/base_generic.html**) and copy the following text into the `sidebar` block, immediately before the `endblock` template tag. -```html - ``` As you can see, we use `if`-`else`-`endif` template tags to conditionally display text based on whether `\{{ user.is_authenticated }}` is true. If the user is authenticated then we know that we have a valid user, so we call **\\{{ user.get_username }}** to display their name. diff --git a/files/ko/learn/server-side/django/deployment/index.md b/files/ko/learn/server-side/django/deployment/index.md index 7db0710980ae1e..3cdab123c038f9 100644 --- a/files/ko/learn/server-side/django/deployment/index.md +++ b/files/ko/learn/server-side/django/deployment/index.md @@ -1,5 +1,5 @@ --- -title: 'Django 튜토리얼 파트 11: Django 웹사이트 공개하기' +title: "Django 튜토리얼 파트 11: Django 웹사이트 공개하기" slug: Learn/Server-side/Django/Deployment --- @@ -199,10 +199,10 @@ git 으로 작업하는 수많은 방법이 있지만, [Github](https://github.c 2. 로그인 해서 꼭대기 툴바의 **+** 링크를 클릭하여 **New repository**를 선택하라. 3. 이 폼의 모든 필드에 기입하라. 그렇지 않으면 진행이 불가한 것은 아니지만, 모두 채울것을 강력 추천한다. - - 새로운 저장소 이름 (예시: _django_local_library_)과 설명 (예시: "Local Library website written in Django")을 입력하라. - - "_Add .gitignore" 선택 목록에서 "_**Python**_"을 선택하라_. - - "_Add a license" 선택 목록에서 선호하는 라이센스 유형을 선택하라_. - - "**Initialize this repository with a README**." 체크박스에 체크하라 + - 새로운 저장소 이름 (예시: _django_local_library_)과 설명 (예시: "Local Library website written in Django")을 입력하라. + - "_Add .gitignore" 선택 목록에서 "_**Python**_"을 선택하라_. + - "_Add a license" 선택 목록에서 선호하는 라이센스 유형을 선택하라_. + - "**Initialize this repository with a README**." 체크박스에 체크하라 4. " **Create repository"** 버튼을 누른다 5. 신규 저장소 페이지에서 초록색의 "**Clone or download**" 버튼을 클릭한다. @@ -213,65 +213,65 @@ git 으로 작업하는 수많은 방법이 있지만, [Github](https://github.c 1. _git을 로컬 컴퓨터에 설치하라_ (플랫폼별 버전은 [이곳](https://git-scm.com/downloads) 에서 찾을 수 있다). 2. 커맨드 프롬프트/터미널 을 열고 위에서 복사한 URL을 이용하여 저장소 내용을 복제(clone) 한다 : - ```bash - git clone https://github.com//django_local_library.git - ``` + ```bash + git clone https://github.com//django_local_library.git + ``` - 이 명령은 현재 프롬프트의 위치에 저장소를 생성할 것이다. + 이 명령은 현재 프롬프트의 위치에 저장소를 생성할 것이다. 3. 새로운 저장소 위치로 이동한다. - ```bash - cd django_local_library.git - ``` + ```bash + cd django_local_library.git + ``` 마지막 단계는 어플리케이션을 복사하여 git을 이용해 저장소에 파일을 추가하는 것이다 : 1. 이 폴더에 Django 어플리케이션을 복사해 넣는다. (locallibrary 폴더를 포함한 위치가 아니라 **manage.py** 와 그 하위 폴더와 같은 위치의 모든 파일에 대해 작업한다). 2. **.gitignore** 파일을 열어서, 아래 코드를 맨 밑에 복사하고, 저장하라 ( 이 파일은 기본 설정에 의해 git에 저장되지 말아야할 파일을 구분하는데 사용된다). - ``` - # Text backup files - *.bak + ``` + # Text backup files + *.bak - #Database - *.sqlite3 - ``` + #Database + *.sqlite3 + ``` 3. 커맨드 프로프트/터미널을 열고 `add`명령으로 모든 파일을 git에 등록한다. - ```bash - git add -A - ``` + ```bash + git add -A + ``` 4. status 명령을 사용하여 등록하고자 하는 파일이 맞는지 확인한다 ( 당신은 소스파일만 등록 하길 원하고 바이너리나 임시 파일은 원치 않을 것이다). 명령을 실행하면 아래와 유사하게 나온다. - ``` - > git status - On branch master - Your branch is up-to-date with 'origin/master'. - Changes to be committed: - (use "git reset HEAD ..." to unstage) - - modified: .gitignore - new file: catalog/__init__.py - ... - new file: catalog/migrations/0001_initial.py - ... - new file: templates/registration/password_reset_form.html - ``` + ``` + > git status + On branch master + Your branch is up-to-date with 'origin/master'. + Changes to be committed: + (use "git reset HEAD ..." to unstage) + + modified: .gitignore + new file: catalog/__init__.py + ... + new file: catalog/migrations/0001_initial.py + ... + new file: templates/registration/password_reset_form.html + ``` 5. 위의 결과에 만족했다면, commit 명령으로 파일의 로컬 저장소 등록을 확정한다: - ```bash - git commit -m "First version of application moved into github" - ``` + ```bash + git commit -m "First version of application moved into github" + ``` 6. 다음 명령을 이용하여 Github 웹사이트와 로컬 저장소를 동기화 한다: - ``` - git push origin master - ``` + ``` + git push origin master + ``` 이런 작업이 완료된 후, repo를 생성한 Github 페이지로 다시 가서, 페이지를 새로 로딩하여, 전체 어플리케이션이 모두 업로드된것인지 확인할 수 있어야 한다. 이후로 파일 변경 사항이 발생하면 add/commit/push 순서로 명령을 사용하여 저장소를 업데이트 할 수 있다. diff --git a/files/ko/learn/server-side/django/development_environment/index.md b/files/ko/learn/server-side/django/development_environment/index.md index 70bc5fd78484f9..555ca2e64ef987 100644 --- a/files/ko/learn/server-side/django/development_environment/index.md +++ b/files/ko/learn/server-side/django/development_environment/index.md @@ -132,8 +132,8 @@ python3 -V 1. 필요한 설치 파일을 다운로드하세요: - 1. 로 가세요. - 2. **Download Python 3.7.0** 버튼을 선택하세요 (정확한 마이너 버전 숫자는 다를 수도 있습니다). + 1. 로 가세요. + 2. **Download Python 3.7.0** 버튼을 선택하세요 (정확한 마이너 버전 숫자는 다를 수도 있습니다). 2. 파인더를 통해 파일을 찾아, 패키지 파일을 더블클릭 하세요. 그리고선 설치 과정을 따릅니다. @@ -156,8 +156,8 @@ pip3 list 1. 필요한 설치 파일을 다운로드하세요: - 1. 로 가세요 - 2. **Download Python 3.7.1** 버튼을 선택하세요 (정확한 마이너 버전 숫자는 다를 수도 있습니다). + 1. 로 가세요 + 2. **Download Python 3.7.1** 버튼을 선택하세요 (정확한 마이너 버전 숫자는 다를 수도 있습니다). 2. 다운로드된 파일을 더블클릭해서 파이썬을 설치하세요. diff --git a/files/ko/learn/server-side/django/forms/index.md b/files/ko/learn/server-side/django/forms/index.md index 841518faaf6cf2..13da9b6592c6d9 100644 --- a/files/ko/learn/server-side/django/forms/index.md +++ b/files/ko/learn/server-side/django/forms/index.md @@ -1,5 +1,5 @@ --- -title: 'Django 튜토리얼 파트 9: 폼(form)으로 작업하기' +title: "Django 튜토리얼 파트 9: 폼(form)으로 작업하기" slug: Learn/Server-side/Django/Forms --- @@ -52,9 +52,13 @@ slug: Learn/Server-side/Django/Forms ```html
- - - + + +
``` @@ -84,17 +88,17 @@ Django의 폼 처리 과정은 (모델에 대한 정보를 보여주는데 있 1. 사용자가 처음으로 폼을 요청할 때 기본 폼을 보여준다. - - 폼은 비어있는 필드가 있을 수 있다 (예를 들면, 새로운 책을 등록할 경우) 아니면 초기값으로 채워진 필드가 있을 수도 있다. ( 예를 들면, 기존의 책을 수정하거나, 흔히 사용하는 초기값이 있을경우) - - 이 시점의 폼은 (초기값이 있긴해도) 유저가 입력한 값에 연관되지 않았기에 unbound 상태라고 불린다. + - 폼은 비어있는 필드가 있을 수 있다 (예를 들면, 새로운 책을 등록할 경우) 아니면 초기값으로 채워진 필드가 있을 수도 있다. ( 예를 들면, 기존의 책을 수정하거나, 흔히 사용하는 초기값이 있을경우) + - 이 시점의 폼은 (초기값이 있긴해도) 유저가 입력한 값에 연관되지 않았기에 unbound 상태라고 불린다. 2. 제출 요청으로 부터 데이타를 수집하고 그것을 폼에 결합한다. - - 데이타를 폼에 결합(binding) 한다는 것은 사용자 입력 데이타와 유효성을 위반한 경우의 에러메시지가 폼을 재표시할 필요가 있을 때 준비되었다는 의미이다. + - 데이타를 폼에 결합(binding) 한다는 것은 사용자 입력 데이타와 유효성을 위반한 경우의 에러메시지가 폼을 재표시할 필요가 있을 때 준비되었다는 의미이다. 3. 데이타를 다듬어서 유효성을 검증한다. - - 데이타를 다듬는다는 것은 사용자 입력을 정화(sanitisation) 하고 (예를 들면, 잠재적으로 악의적인 콘덴츠를 서버로 보낼수도 있는 유효하지 않은 문자를 제거하는 것) python에서 사용하는 타입의 데이타로 변환하는 것이다. - - 유효성검증은 입력된 값이 해당 필드에 적절한 값인지 검사한다. (예를 들면, 데이타가 허용된 범위에 있는 값인지, 너무 짧거나 길지 않은지 등등) + - 데이타를 다듬는다는 것은 사용자 입력을 정화(sanitisation) 하고 (예를 들면, 잠재적으로 악의적인 콘덴츠를 서버로 보낼수도 있는 유효하지 않은 문자를 제거하는 것) python에서 사용하는 타입의 데이타로 변환하는 것이다. + - 유효성검증은 입력된 값이 해당 필드에 적절한 값인지 검사한다. (예를 들면, 데이타가 허용된 범위에 있는 값인지, 너무 짧거나 길지 않은지 등등) 4. 입력된 어떤 데이타가 유효하지 않다면, 폼을 다시 표시하는데 이번에는 초기값이 아니라 유저가 입력한 데이타와 문제가 있는 필드의 에러 메시지와 함께 표시한다. 5. 입력된 모든 데이타가 유효하다면, 요청된 동작을 수행한다. (예를 들면, 데이타를 저장하거나, 이메일을 보내거나, 검색결과를 반환하거나, 파일을 업로딩하는 작업 등등) @@ -361,19 +365,19 @@ def renew_book_librarian(request, pk): 뷰 에서 참조되는 템플릿 (**/catalog/templates/catalog/book_renew_librarian.html**)을 생성하고 아래 코드를 복사해넣어라 : -```html +```django {% extends "base_generic.html" %} {% block content %} -

Renew: {{ book_instance.book.title }}

-

Borrower: {{ book_instance.borrower }}

-

if book_instance.is_overdue %} class="text-danger"{% endif %}>Due date: {{book_instance.due_back}}

- -
- {% csrf_token %} - {{ form.as_table }} - -
+

Renew: {{ book_instance.book.title }}

+

Borrower: {{ book_instance.borrower }}

+

if book_instance.is_overdue %} class="text-danger"{% endif %}>Due date: {{book_instance.due_back}}

+ +
+ {% csrf_token %} + {{ form.as_table }} + +
{% endblock %} ``` @@ -389,9 +393,16 @@ def renew_book_librarian(request, pk): - +
- Enter date between now and 4 weeks (default 3 weeks). + Enter date between now and 4 weeks (default 3 weeks). ``` @@ -403,14 +414,21 @@ def renew_book_librarian(request, pk): ```html - -
    -
  • Invalid date - renewal in past
  • -
- -
- Enter date between now and 4 weeks (default 3 weeks). - + +
    +
  • Invalid date - renewal in past
  • +
+ +
+ Enter date between now and 4 weeks (default 3 weeks). + ``` @@ -431,8 +449,10 @@ def renew_book_librarian(request, pk): If you accepted the "challenge" in [Django Tutorial Part 8: User authentication and permissions](/ko/docs/Learn/Server-side/Django/authentication_and_sessions#Challenge_yourself) you'll have a list of all books on loan in the library, which is only visible to library staff. We can add a link to our renew page next to each item using the template code below. -```html -{% if perms.catalog.can_mark_returned %}- Renew {% endif %} +```django +{% if perms.catalog.can_mark_returned %}- + Renew +{% endif %} ``` > **참고:** Remember that your test login will need to have the permission "`catalog.can_mark_returned`" in order to access the renew book page (perhaps use your superuser account). @@ -556,19 +576,17 @@ The "create" and "update" views use the same template by default, which will be Create the template file **locallibrary/catalog/templates/catalog/author_form.html** and copy in the text below. -```html -{% extends "base_generic.html" %} +```django +{% extends "base_generic.html" %} {% block content %} - -
+ {% csrf_token %} - {{ form.as_table }} + {{ form.as_table }}
- -
+ {% endblock %} ``` @@ -576,20 +594,18 @@ This is similar to our previous forms, and renders the fields using a table. Not The "delete" view expects to find a template named with the format _model_name_**\_confirm_delete.html** (again, you can change the suffix using `template_name_suffix` in your view). Create the template file **locallibrary/catalog/templates/catalog/author_confirm_delete.html** and copy in the text below. -```html +```django {% extends "base_generic.html" %} {% block content %} +

Delete Author

-

Delete Author

- -

Are you sure you want to delete the author: \{{ author }}?

- -
- {% csrf_token %} - -
+

Are you sure you want to delete the author: \{{ author }}?

+
+ {% csrf_token %} + +
{% endblock %} ``` diff --git a/files/ko/learn/server-side/django/generic_views/index.md b/files/ko/learn/server-side/django/generic_views/index.md index 9808b936f67d1a..95c4263761c231 100644 --- a/files/ko/learn/server-side/django/generic_views/index.md +++ b/files/ko/learn/server-side/django/generic_views/index.md @@ -1,5 +1,5 @@ --- -title: 'Django Tutorial Part 6: Generic list and detail views' +title: "Django Tutorial Part 6: Generic list and detail views" slug: Learn/Server-side/Django/Generic_views --- @@ -126,7 +126,7 @@ class BookListView(generic.ListView): 제네릭 뷰의 템플릿은 다른 템플릿과 비슷합니다 (물론 템플릿에 전달되는 컨텍스트나 정보는 다를지도 모르지만요). 다른 index 템플릿처럼, 우리는 첫번째 줄에 base 템플릿을 넣어 확장한 다음, `content`라는 이름의 블록으로 교체합니다. -```html +```django {% extends "base_generic.html" %} {% block content %} @@ -151,7 +151,7 @@ class BookListView(generic.ListView): [`if`](https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#if), `else` 그리고 `endif` 라는 템플릿 태그들은 `book_list` 이 정의되었는지, 그리고 존재하는지 체크합니다. 만약 `book_list`가 없다면, 책이 존재하지 않는다는 `else` 절의 텍스트 문구가 표시될 것입니다. 만약 `book_list`가 존재한다면, 도서 목록의 갯수만큼 반복만큼 반복해서 실행합니다. -```html +```django {% if book_list %} {% else %} @@ -165,9 +165,9 @@ class BookListView(generic.ListView): [for](https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#for) 와 `endfor` 라는 템플릿 태그들은 아래와 같이 도서 목록을 살펴보는 루프를 위해 사용합니다. 각각의 반복은 `book` 템플릿 변수에 현재 리스트 아이템에 대한 정보를 채웁니다. -```html +```django {% for book in book_list %} -
  • +
  • {% endfor %} ``` @@ -261,10 +261,10 @@ _Regular expressions_ 은 정말로 파워풀한 매핑 툴 입니다. 하지만 몇 가지 실제 패턴 예제를 보도록 합시다: -| Pattern | Description | -| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **r'^book/(?P\\d+)$'** | 이것은 우리가 URL mapper에서 사용한 Regular Expression입니다. 이 표현식은 먼저 문자열이 `book/` 으로 시작하는지 검사하고 (**^book/**), 그 다음에 한 개이상의 숫자가 오는지 (`\d+`), 그리고 문자열이 끝나기 전에 숫자가 아닌 문자가 들어 있지는 않는 지 검사합니다.또한 이 표현식은 모든 숫자들을 변환하고 **(?P\\d+)** 변환된 값을 view 에 'pk'라는 이름의 parameter로 넘깁니다. **변환된 값은 항상 String type으로 넘어갑니다**!예를 들어, 이 표현식은 `book/1234` 을 매칭합니다. 그리고 변수 `pk='1234'` 를 view에 넘깁니다. | -| **r'^book/(\d+)$'** | 이 표현식은 위의 표현식과 동일한 URL들을 매칭합니다. 변환된 정보는 명명되지 않은 argument로 view에 전달됩니다. | +| Pattern | Description | +| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **r'^book/(?P\\d+)$'** | 이것은 우리가 URL mapper에서 사용한 Regular Expression입니다. 이 표현식은 먼저 문자열이 `book/` 으로 시작하는지 검사하고 (**^book/**), 그 다음에 한 개이상의 숫자가 오는지 (`\d+`), 그리고 문자열이 끝나기 전에 숫자가 아닌 문자가 들어 있지는 않는 지 검사합니다.또한 이 표현식은 모든 숫자들을 변환하고 **(?P\\d+)** 변환된 값을 view 에 'pk'라는 이름의 parameter로 넘깁니다. **변환된 값은 항상 String type으로 넘어갑니다**!예를 들어, 이 표현식은 `book/1234` 을 매칭합니다. 그리고 변수 `pk='1234'` 를 view에 넘깁니다. | +| **r'^book/(\d+)$'** | 이 표현식은 위의 표현식과 동일한 URL들을 매칭합니다. 변환된 정보는 명명되지 않은 argument로 view에 전달됩니다. | | **r'^book/(?P\[-\w]+)$'** | 이 표현식은 문자열 처음 부분에 `book/` 으로 시작하는지 검사하고 (**^book/**), 그리고 한 개 또는 그 이상의 '-' 나 word character가 오고 (**\[-\w]+**), 그렇게 끝내는지를 매칭합니다. 이 표현식 또한 매칭된 부분을 변환하고 view 에 'stub' 라는 이름의 parameter로 전달합니다.This is a fairly typical pattern for a "stub". Stubs are URL-friendly word-based primary keys for data. You might use a stub if you wanted your book URL to be more informative. For example `/catalog/book/the-secret-garden` rather than `/catalog/book/33`. | 당신은 다양한 패턴들을 한번의 매칭을 통해 변환시킬 수 있습니다. 그러므로 다양한 정보들을 URL안에 인코딩할 수 있습니다. @@ -327,7 +327,7 @@ def book_detail_view(request, primary_key): **/locallibrary/catalog/templates/catalog/book_detail.html** 파일을 만들고, 아래 텍스트를 복사 붙여넣기 하세요. 위에서 설명한대로, 이 파알명은 제네릭 클래스 기반 상세 뷰의 디폴트 파일명입니다. (`catalog` 애플리케이션의 `Book` 모델을 위한 상세 뷰) -```html +```django {% extends "base_generic.html" %} {% block content %} @@ -507,8 +507,11 @@ URL mappers에 필요한 코드들과 view들은 ,사실상, 우리가 위에서 > - 작가 목록 페이지를 위한 URL mapper를 만들고나면, **All authors** base template에 있는 **All authors** 링크 또한 업데이트 해야될 필요를 느끼게 될 겁니다. 우리가 **All books** 링크 업데이트 때 했던, [수행 과정](#Update_the_base_template)을 따라해주세요. > - 작가 세부 사항 페이지에 대한 URL mapper를 만들고나면, 당신은 [book detail view template](#Creating_the_Detail_View_template) (**/locallibrary/catalog/templates/catalog/book_detail.html**) 또한 업데이트 해야 합니다. 그래야 작가 링크가 당신이 새로 만든 작가 세부 사항 페이지를 가리키거든요. (비어 있는 URL로 있기 보다는 말이죠). 굵게 되어 있는 부분을 template 내의 태그에 넣어주세요. > -> ```html ->

    Author: \{{ book.author }}

    +> ```django +>

    +> Author: +> \{{ book.author }} +>

    > ``` 모두 마치면, 당신의 페이즈들은 아마 밑의 스크린샷과 비슷하게 보일 겁니다. diff --git a/files/ko/learn/server-side/django/home_page/index.md b/files/ko/learn/server-side/django/home_page/index.md index b29c5899572bf9..ba56d9eb339ad2 100644 --- a/files/ko/learn/server-side/django/home_page/index.md +++ b/files/ko/learn/server-side/django/home_page/index.md @@ -1,5 +1,5 @@ --- -title: 'Django Tutorial Part 5: Creating our home page' +title: "Django Tutorial Part 5: Creating our home page" slug: Learn/Server-side/Django/Home_page --- @@ -174,7 +174,7 @@ view 함수의 마지막에선 HTML 페이지를 생성하고 이 페이지를 > **참고:** **주의:** 탬플릿 태그들은 목록을 반복하거나, 변수 값을 기반으로 조건부 연산을 수행하거나, 여타 다른 일들을 할 수 있는 함수입니다. 탬플릿 태그 외에도 탬플릿 구문(syntax)을 사용하면 view에서 탬플릿으로 전달된 변수들을 참조할 수 있고, 탬플릿 필터(filters)를 사용해서 변수의 형식을 지정할 수 있습니다(예를 들어, 문자열을 소문자로 변환). -```html +```django @@ -208,8 +208,8 @@ view 함수의 마지막에선 HTML 페이지를 생성하고 이 페이지를 새로운 파일 **base_generic.html** 을 **/locallibrary/catalog/templates/_base_generic.html_** 경로 안에 생성해서 아래 코드를 파일에 복사 붙여넣기 하세요: -```html - +```django + {% block title %}Local Library{% endblock %} @@ -245,9 +245,9 @@ view 함수의 마지막에선 HTML 페이지를 생성하고 이 페이지를 ```css .sidebar-nav { - margin-top: 20px; - padding: 0; - list-style: none; + margin-top: 20px; + padding: 0; + list-style: none; } ``` @@ -255,7 +255,7 @@ view 함수의 마지막에선 HTML 페이지를 생성하고 이 페이지를 새로운 HTML 파일 **index.html** 을 **/locallibrary/catalog/templates/** 경로 안에 생성해서 아래 코드를 파일 안에 복사 붙여넣기 하세요. 보시는 바와 같이 첫째 행에서 우리의 기본 탬플릿을 확장하고, 탬플릿의 기본 `content` 블럭을 새로운 블럭으로 대체합니다. -```html +```django {% extends "base_generic.html" %} {% block content %} @@ -295,17 +295,20 @@ return render(request, 'index.html', context=context) 아래 코드 샘플처럼, 탬플릿 안에서 당신은 먼저 탬플릿 라이브러리를 추가하기 위해 "static"을 지정하는 `load` 탬플릿 태그를 호출합니다. 그러고 나서 `static` 탬플릿 태그를 사용할 수 있고 관련 URL을 요구되는 파일에 지정할 수 있습니다. -```html +```django {% load static %} - + ``` 비슷한 방법으로 이미지를 페이지에 추가할 수 있습니다. 예를 들어: -```html +```django {% load static %} -UML diagram +UML diagram ``` > **참고:** **주의**: 위의 샘플은 파일들의 위치를 특정하지만, 장고는 기본적으로 파일을 제공하지 않습니다. 우리는 우리가 웹사이트 뼈대를 생성했을 때([created the website skeleton](/ko/docs/Learn/Server-side/Django/skeleton_website)) 전역 URL 매퍼(/locallibrary/locallibrary/urls.py)를 수정하여 개발 웹 서버가 파일을 제공하도록 설정했습니다만, 제품화되었을(in production)때도 파일을 제공할 수 있어야 합니다. 이것에 관해 차후에 다루겠습니다. @@ -360,7 +363,7 @@ TEMPLATES = [ 1. LocalLibrary 기본 탬플릿([base template](#The_LocalLibrary_base_template))에는 `title` 블록이 정의되어 있습니다. 색인 탬플릿([index template](#The_index_template)) 안에 이 블록을 덮어쓰기하고 페이지를 위한 새로운 제목을 만들어 보세요. - > **참고:** **힌트:** [Extending templates](#Extending_templates) 섹션은 블럭(block)을 생성하고 다른 탬플릿에서 블럭을 확장(extend)하는 방법을 설명합니다. + > **참고:** **힌트:** [Extending templates](#Extending_templates) 섹션은 블럭(block)을 생성하고 다른 탬플릿에서 블럭을 확장(extend)하는 방법을 설명합니다. 2. 대소문자 구분 없이 특정한 단어를 포함하는 장르와 책들의 개수(count)를 생성하도록 [view](<#View_(function-based)>) 를 수정하고, 결과를 `context`에 전달해 보세요. 이것은 `num_books`와 `num_instances_available`을 생성하고 사용하는 것과 비슷한 방법으로 달성할 수 있습니다. 그리고 나서 이 변수들을 포함시키기 위해 [index template](#The_index_template) 를 업데이트 하세요. diff --git a/files/ko/learn/server-side/django/index.md b/files/ko/learn/server-side/django/index.md index 3c5a4d5f936755..ebd3a66e09c03d 100644 --- a/files/ko/learn/server-side/django/index.md +++ b/files/ko/learn/server-side/django/index.md @@ -2,6 +2,7 @@ title: Django 웹 프레임워크 (파이썬) slug: Learn/Server-side/Django --- + {{LearnSidebar}} Django는 파이썬으로 구성된, 인기 많고 완벽한 기능을 갖춘 서버-사이드 웹 프레임워크입니다. 이 모듈은 Django가 웹 서버 프레임워크 중 가장 유명한 이유, 개발환경을 설정하는 방법, 그리고 이를 통해 자신만의 웹 애플리케이션을 만드는 방법을 알려줍니다. diff --git a/files/ko/learn/server-side/django/introduction/index.md b/files/ko/learn/server-side/django/introduction/index.md index 6cac87585bead2..2ab158fc1b4cd1 100644 --- a/files/ko/learn/server-side/django/introduction/index.md +++ b/files/ko/learn/server-side/django/introduction/index.md @@ -61,7 +61,7 @@ Django는 다음과 같은 소프트웨어를 개발하는데 도움을 줍니 Django 는 SQL 인젝션, 크로스사이트 스크립팅, 크로스사이트 요청 위조 그리고 클릭 하이젝킹 (이러한 공격 방법에 대한 상세 정보는 [Website security](/ko/docs/Learn/Server-side/First_steps/Website_security)에서 볼 수 있습니다)과 같은 보안 취약점을 보완할 방법 기본적으로 제공합니다. - Scalable(확장성 있는) - - : Django는 컴포넌트 기반의 “[shared-nothing](https://en.wikipedia.org/wiki/Shared_nothing_architecture)” 아키텍쳐(각각의 아키텍쳐가 독립적이어서 필요하다면 교체 및 변경할 수 있는)를 사용합니다. 각 부분이 분명하게 분리되면 어떤 레벨에서든(예를 들면 캐싱 서버, 데이터베이스 서버, 혹은 어플리케이션 서버) 하드웨어를 추가해서 발생하는 늘어난 트래픽에 대응해 크기를 변경할 수 있게 됩니다. 사용자가 가장 많은 몇몇 사이트는 요구사항에 맞춰서 Django의 크기를 성공적으로 변경했습니다. (예를들면 Instagram, Disqus 등) + - : Django는 컴포넌트 기반의 "[shared-nothing](https://en.wikipedia.org/wiki/Shared_nothing_architecture)" 아키텍쳐(각각의 아키텍쳐가 독립적이어서 필요하다면 교체 및 변경할 수 있는)를 사용합니다. 각 부분이 분명하게 분리되면 어떤 레벨에서든(예를 들면 캐싱 서버, 데이터베이스 서버, 혹은 어플리케이션 서버) 하드웨어를 추가해서 발생하는 늘어난 트래픽에 대응해 크기를 변경할 수 있게 됩니다. 사용자가 가장 많은 몇몇 사이트는 요구사항에 맞춰서 Django의 크기를 성공적으로 변경했습니다. (예를들면 Instagram, Disqus 등) - Maintainable(유지보수가 쉬운) - : Django 코드는 유지보수가 쉽고 재사용하기 좋게끔 하는 디자인 원칙들과 패턴들을 이용하여 작성됩니다. 특히 Don't Repeat Yourself (DRY) 원칙을 적용해서 불필요한 중복이 없고 많은 양의 코드를 줄였습니다. 또한 Django는 관련된 기능들을 재사용 가능한 "applications"로 그룹화했고, 더 낮은 레벨에서 관련된 코드들을 모듈로 만들었습니다. ([Model View Controller (MVC)](/en-US/Apps/Fundamentals/Modern_web_app_architecture/MVC_architecture) 패턴과 유사합니다). - Portable(포터블한) diff --git a/files/ko/learn/server-side/django/models/index.md b/files/ko/learn/server-side/django/models/index.md index 780b03c1e2f5c0..96544b24ac18d5 100644 --- a/files/ko/learn/server-side/django/models/index.md +++ b/files/ko/learn/server-side/django/models/index.md @@ -1,5 +1,5 @@ --- -title: 'Django Tutorial Part 3: Using models' +title: "Django Tutorial Part 3: Using models" slug: Learn/Server-side/Django/Models --- diff --git a/files/ko/learn/server-side/django/sessions/index.md b/files/ko/learn/server-side/django/sessions/index.md index 99e5ea05745f44..4bd5d98e729773 100644 --- a/files/ko/learn/server-side/django/sessions/index.md +++ b/files/ko/learn/server-side/django/sessions/index.md @@ -1,5 +1,5 @@ --- -title: 'Django Tutorial Part 7: Sessions framework' +title: "Django Tutorial Part 7: Sessions framework" slug: Learn/Server-side/Django/Sessions --- @@ -138,7 +138,7 @@ def index(request): 메인 HTML template(**/locallibrary/catalog/templates/index.html**) "Dynamic content" 섹션 밑 부분에 context 변수가 보일 수 있도록 밑에 보이는 굵은 선으로 표시된 코드를 추가해주세요: -```html +```django

    Dynamic content

    The library has the following record counts:

    @@ -149,7 +149,10 @@ def index(request):
  • Authors: \{{ num_authors }}
  • -

    You have visited this page \{{ num_visits }}{% if num_visits == 1 %} time{% else %} times{% endif %}.

    +

    + You have visited this page \{{ num_visits }}{% if num_visits == 1 %} time{% + else %} times{% endif %}. +

    ``` 바뀐 것을 저장해주시고 테스트 서버를 재시작해주세요. 페이지를 새로고침할 때 마다, 숫자가 업데이트되는 것을 보실 수 있을겁니다. diff --git a/files/ko/learn/server-side/django/skeleton_website/index.md b/files/ko/learn/server-side/django/skeleton_website/index.md index dac9489ec392bf..15e40aedf8251e 100644 --- a/files/ko/learn/server-side/django/skeleton_website/index.md +++ b/files/ko/learn/server-side/django/skeleton_website/index.md @@ -1,5 +1,5 @@ --- -title: '장고 튜토리얼 강좌 2 : 뼈대 사이트 만들기' +title: "장고 튜토리얼 강좌 2 : 뼈대 사이트 만들기" slug: Learn/Server-side/Django/skeleton_website --- @@ -41,7 +41,7 @@ slug: Learn/Server-side/Django/skeleton_website 1. 프로젝트 폴더, 기본적인 파일 템플릿과 프로젝트 관리 스크립트(**manage.py**)를 만들기 위해서 `django-admin`을 사용합니다. 2. 하나 또는 그 이상의 애플리케이션을 만들기 위해서 **manage.py**를 사용합니다. - > **참고:** 하나의 웹사이트는 하나 또는 그 이상의 섹션으로 구성될 수 있습니다. (예를 들어 main site, blog, wiki, downloads area 등). 장고는 필요할 때에 다른 프로젝트에서 재사용이 가능할 수 있게 , 이 요소들을 분리된 어플리케이션으로 개발하는 것을 추천합니다. + > **참고:** 하나의 웹사이트는 하나 또는 그 이상의 섹션으로 구성될 수 있습니다. (예를 들어 main site, blog, wiki, downloads area 등). 장고는 필요할 때에 다른 프로젝트에서 재사용이 가능할 수 있게 , 이 요소들을 분리된 어플리케이션으로 개발하는 것을 추천합니다. 3. 프로젝트에 포함시키기 위해 새 어플리케이션들을 등록(register)합니다. 4. 각 어플리케이션에 대해 url/mapper를 연결(hook up)합니다. diff --git a/files/ko/learn/server-side/django/testing/index.md b/files/ko/learn/server-side/django/testing/index.md index 375a978ee36748..709c5baa09a837 100644 --- a/files/ko/learn/server-side/django/testing/index.md +++ b/files/ko/learn/server-side/django/testing/index.md @@ -1,5 +1,5 @@ --- -title: 'Django 튜토리얼 파트 10: Django 웹 어플리케이션 테스트하기' +title: "Django 튜토리얼 파트 10: Django 웹 어플리케이션 테스트하기" slug: Learn/Server-side/Django/Testing --- diff --git a/files/ko/learn/server-side/django/tutorial_local_library_website/index.md b/files/ko/learn/server-side/django/tutorial_local_library_website/index.md index f56fa36771d759..1cd0f4fbdd6ffb 100644 --- a/files/ko/learn/server-side/django/tutorial_local_library_website/index.md +++ b/files/ko/learn/server-side/django/tutorial_local_library_website/index.md @@ -1,5 +1,5 @@ --- -title: 'Django 튜토리얼: 지역 도서관 웹사이트' +title: "Django 튜토리얼: 지역 도서관 웹사이트" slug: Learn/Server-side/Django/Tutorial_local_library_website --- diff --git a/files/ko/learn/server-side/django/web_application_security/index.md b/files/ko/learn/server-side/django/web_application_security/index.md index 7dce64725cfc33..a81d1b82cad7b6 100644 --- a/files/ko/learn/server-side/django/web_application_security/index.md +++ b/files/ko/learn/server-side/django/web_application_security/index.md @@ -46,7 +46,7 @@ Django 문서를 여기로 복사해오기보다, 이 문서에서 우리는 Dja ### Cross site scripting (XSS) -XSS is a term used to describe a class of attacks that allow an attacker to inject client-side scripts _through_ the website into the browsers of other users. This is usually achieved by storing malicious scripts in the database where they can be retrieved and displayed to other users, or by getting users to click a link that will cause the attacker’s JavaScript to be executed by the user’s browser. +XSS is a term used to describe a class of attacks that allow an attacker to inject client-side scripts _through_ the website into the browsers of other users. This is usually achieved by storing malicious scripts in the database where they can be retrieved and displayed to other users, or by getting users to click a link that will cause the attacker's JavaScript to be executed by the user's browser. Django's template system protects you against the majority of XSS attacks by [escaping specific characters](https://docs.djangoproject.com/en/2.0/ref/templates/language/#automatic-html-escaping) that are "dangerous" in HTML. We can demonstrate this by attempting to inject some JavaScript into our LocalLibrary website using the Create-author form we set up in [Django Tutorial Part 9: Working with forms](/ko/docs/Learn/Server-side/Django/Forms). @@ -54,10 +54,10 @@ Django's template system protects you against the majority of XSS attacks by [es 2. Open the site in your local browser and login to your superuser account. 3. Navigate to the author-creation page (which should be at URL: [`http://127.0.0.1:8000/catalog/author/create/`](http://127.0.0.1:8000/catalog/author/create/)). 4. Enter names and date details for a new user, and then append the following text to the Last Name field: - ``. - ![Author Form XSS test](author_create_form_alert_xss.png) + ``. + ![Author Form XSS test](author_create_form_alert_xss.png) - > **참고:** This is a harmless script that, if executed, will display an alert box in your browser. If the alert is displayed when you submit the record then the site is vulnerable to XSS threats. + > **참고:** This is a harmless script that, if executed, will display an alert box in your browser. If the alert is displayed when you submit the record then the site is vulnerable to XSS threats. 5. Press **Submit** to save the record. 6. When you save the author it will be displayed as shown below. Because of the XSS protections the `alert()` should not be run. Instead the script is displayed as plain text.![Author detail view XSS test](author_detail_alert_xss.png) @@ -65,7 +65,10 @@ Django's template system protects you against the majority of XSS attacks by [es If you view the page HTML source code, you can see that the dangerous characters for the script tags have been turned into their harmless escape code equivalents (e.g. `>` is now `>`) ```html -

    Author: Boon, David (Boonie)

    +

    + Author: Boon<script>alert('Test alert');</script>, David + (Boonie) +

    ``` Using Django templates protects you against the majority of XSS attacks. However it is possible to turn off this protection, and the protection isn't automatically applied to all tags that wouldn't normally be populated by user input (for example, the `help_text` in a form field is usually not user-supplied, so Django doesn't escape those values). @@ -74,7 +77,7 @@ It is also possible for XSS attacks to originate from other untrusted source of ### Cross site request forgery (CSRF) protection -CSRF attacks allow a malicious user to execute actions using the credentials of another user without that user’s knowledge or consent. For example consider the case where we have a hacker who wants to create additional authors for our LocalLibrary. +CSRF attacks allow a malicious user to execute actions using the credentials of another user without that user's knowledge or consent. For example consider the case where we have a hacker who wants to create additional authors for our LocalLibrary. > **참고:** Obviously our hacker isn't in this for the money! A more ambitious hacker could use the same approach on other sites to perform much more harmful tasks (e.g. transfer money to their own accounts, etc.) @@ -82,19 +85,56 @@ In order to do this, they might create an HTML file like the one below, which co ```html - - -
    - - - - - -
    - -
    - - + +
    + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + +
    + ``` @@ -103,7 +143,10 @@ Run the development web server, and log in with your superuser account. Copy the The way the protection is enabled is that you include the `{% csrf_token %}` template tag in your form definition. This token is then rendered in your HTML as shown below, with a value that is specific to the user on the current browser. ```html - + ``` Django generates a user/browser specific key and will reject forms that do not contain the field, or that contain an incorrect field value for the user/browser. @@ -117,7 +160,7 @@ Django's CSRF protection is turned on by default. You should always use the `{% Django also provides other forms of protection (most of which would be hard or not particularly useful to demonstrate): - SQL injection protection - - : SQL injection vulnerabilities enable malicious users to execute arbitrary SQL code on a database, allowing data to be accessed, modified, or deleted irrespective of the user's permissions. In almost every case you'll be accessing the database using Django’s querysets/models, so the resulting SQL will be properly escaped by the underlying database driver. If you do need to write raw queries or custom SQL then you'll need to explicitly think about preventing SQL injection. + - : SQL injection vulnerabilities enable malicious users to execute arbitrary SQL code on a database, allowing data to be accessed, modified, or deleted irrespective of the user's permissions. In almost every case you'll be accessing the database using Django's querysets/models, so the resulting SQL will be properly escaped by the underlying database driver. If you do need to write raw queries or custom SQL then you'll need to explicitly think about preventing SQL injection. - Clickjacking protection - : In this attack a malicious user hijacks clicks meant for a visible top level site and routes them to a hidden page beneath. This technique might be used, for example, to display a legitimate bank site but capture the login credentials in an invisible [` ``` And here is the change of the `src` attribute: ```js const obj_url = window.URL.createObjectURL(blob); -const iframe = document.getElementById('viewer'); -iframe.setAttribute('src', obj_url); +const iframe = document.getElementById("viewer"); +iframe.setAttribute("src", obj_url); window.URL.revokeObjectURL(obj_url); ``` @@ -498,10 +571,10 @@ window.URL.revokeObjectURL(obj_url); You can manipulate files of other formats the same way. Here is how to preview uploaded video: ```js -const video = document.getElementById('video'); +const video = document.getElementById("video"); const obj_url = window.URL.createObjectURL(blob); video.src = obj_url; -video.play() +video.play(); window.URL.revokeObjectURL(obj_url); ``` diff --git a/files/ko/web/api/filelist/index.md b/files/ko/web/api/filelist/index.md index 67fbf7aeb3c0bf..e537138ba474a6 100644 --- a/files/ko/web/api/filelist/index.md +++ b/files/ko/web/api/filelist/index.md @@ -10,13 +10,13 @@ slug: Web/API/FileList 모든 `` 요소 노드에는 `FileList`를 반환하는 `files` 특성이 있어서 파일의 목록에 접근할 수 있습니다. 예를 들어, 다음과 같은 HTML 코드를 가정하면, ```html - + ``` 아래 코드로 노드의 파일 리스트에서 첫 번째 항목을 [`File`](/ko/docs/Web/API/File) 객체로 가져올 수 있습니다. ```js -const file = document.getElementById('fileItem').files[0]; +const file = document.getElementById("fileItem").files[0]; ``` ## 속성 @@ -39,7 +39,7 @@ const file = document.getElementById('fileItem').files[0]; ```html - +
    ``` @@ -56,10 +56,10 @@ const file = document.getElementById('fileItem').files[0]; #### JavaScript ```js -const output = document.querySelector('.output'); +const output = document.querySelector(".output"); const myFiles = document.querySelector("#myfiles"); -function logFilenames(){ +function logFilenames() { const fileInput = document.querySelector("#myfiles"); const files = fileInput.files; const fileListLength = files.length; diff --git a/files/ko/web/api/filereader/index.md b/files/ko/web/api/filereader/index.md index 8acfc269bb0b21..75fde18b3a2129 100644 --- a/files/ko/web/api/filereader/index.md +++ b/files/ko/web/api/filereader/index.md @@ -2,6 +2,7 @@ title: FileReader slug: Web/API/FileReader --- + {{APIRef("File API")}} **`FileReader`** 객체는 웹 애플리케이션이 비동기적으로 데이터를 읽기 위하여 읽을 파일을 가리키는{{ domxref("File") }} 혹은 {{ domxref("Blob") }} 객체를 이용해 파일의 내용을(혹은 raw data버퍼로) 읽고 사용자의 컴퓨터에 저장하는 것을 가능하게 해줍니다. diff --git a/files/ko/web/api/filereader/loadend_event/index.md b/files/ko/web/api/filereader/loadend_event/index.md index a81f52d7bedc6f..d3074a59252b73 100644 --- a/files/ko/web/api/filereader/loadend_event/index.md +++ b/files/ko/web/api/filereader/loadend_event/index.md @@ -1,5 +1,5 @@ --- -title: 'FileReader: loadend event' +title: "FileReader: loadend event" slug: Web/API/FileReader/loadend_event --- @@ -36,22 +36,22 @@ slug: Web/API/FileReader/loadend_event ```html
    +
    + + +
    -
    - - -
    - - Image preview... - -
    - - -
    + Image preview... +
    + +
    +
    ``` ```css hidden @@ -60,38 +60,38 @@ img.preview { } .event-log-contents { -width: 18rem; -height: 5rem; -border: 1px solid black; -margin: .2rem; -padding: .2rem; + width: 18rem; + height: 5rem; + border: 1px solid black; + margin: 0.2rem; + padding: 0.2rem; } .example { -display: grid; -grid-template-areas: -"select log" -"preview log"; + display: grid; + grid-template-areas: + "select log" + "preview log"; } .file-select { -grid-area: select; + grid-area: select; } .preview { -grid-area: preview; + grid-area: preview; } .event-log { -grid-area: log; + grid-area: log; } -.event-log>label { -display: block; +.event-log > label { + display: block; } .event-log-contents { -resize: none; + resize: none; } ``` @@ -99,37 +99,38 @@ resize: none; ```js const fileInput = document.querySelector('input[type="file"]'); -const preview = document.querySelector('img.preview'); -const eventLog = document.querySelector('.event-log-contents'); +const preview = document.querySelector("img.preview"); +const eventLog = document.querySelector(".event-log-contents"); const reader = new FileReader(); function handleEvent(event) { - eventLog.textContent = eventLog.textContent + `${event.type}: ${event.loaded} bytes transferred\n`; + eventLog.textContent = + eventLog.textContent + `${event.type}: ${event.loaded} bytes transferred\n`; - if (event.type === "load") { - preview.src = reader.result; - } + if (event.type === "load") { + preview.src = reader.result; + } } function addListeners(reader) { - reader.addEventListener('loadstart', handleEvent); - reader.addEventListener('load', handleEvent); - reader.addEventListener('loadend', handleEvent); - reader.addEventListener('progress', handleEvent); - reader.addEventListener('error', handleEvent); - reader.addEventListener('abort', handleEvent); + reader.addEventListener("loadstart", handleEvent); + reader.addEventListener("load", handleEvent); + reader.addEventListener("loadend", handleEvent); + reader.addEventListener("progress", handleEvent); + reader.addEventListener("error", handleEvent); + reader.addEventListener("abort", handleEvent); } function handleSelected(e) { - eventLog.textContent = ''; - const selectedFile = fileInput.files[0]; - if (selectedFile) { - addListeners(reader); - reader.readAsDataURL(selectedFile); - } + eventLog.textContent = ""; + const selectedFile = fileInput.files[0]; + if (selectedFile) { + addListeners(reader); + reader.readAsDataURL(selectedFile); + } } -fileInput.addEventListener('change', handleSelected); +fileInput.addEventListener("change", handleSelected); ``` #### 결과 diff --git a/files/ko/web/api/filereader/readasdataurl/index.md b/files/ko/web/api/filereader/readasdataurl/index.md index 0daf7556ad303e..e372ceaa472a3d 100644 --- a/files/ko/web/api/filereader/readasdataurl/index.md +++ b/files/ko/web/api/filereader/readasdataurl/index.md @@ -2,6 +2,7 @@ title: FileReader.readAsDataURL() slug: Web/API/FileReader/readAsDataURL --- + {{APIRef("File API")}} `readAsDataURL` 메서드는 컨텐츠를 특정 {{domxref("Blob")}} 이나 {{domxref("File")}}에서 읽어 오는 역할을 합니다. 읽어오는 read 행위가 종료되는 경우에, {{domxref("FileReader.readyState","readyState")}} 의 상태가 `DONE`이 되며, {{event("loadend")}} 이벤트가 트리거 됩니다. 이와 함께, base64 인코딩 된 스트링 데이터가 {{domxref("FileReader.result","result")}} 속성(attribute)에 담아지게 됩니다. @@ -30,16 +31,16 @@ instanceOfFileReader.readAsDataURL(blob); ```js function previewFile() { - var preview = document.querySelector('img'); - var file = document.querySelector('input[type=file]').files[0]; + var preview = document.querySelector("img"); + var file = document.querySelector("input[type=file]").files[0]; var reader = new FileReader(); reader.addEventListener( - 'load', + "load", function () { preview.src = reader.result; }, - false + false, ); if (file) { @@ -65,8 +66,8 @@ function previewFile() { ```js function previewFiles() { - var preview = document.querySelector('#preview'); - var files = document.querySelector('input[type=file]').files; + var preview = document.querySelector("#preview"); + var files = document.querySelector("input[type=file]").files; function readAndPreview(file) { // `file.name` 형태의 확장자 규칙에 주의하세요 @@ -74,7 +75,7 @@ function previewFiles() { var reader = new FileReader(); reader.addEventListener( - 'load', + "load", function () { var image = new Image(); image.height = 100; @@ -82,7 +83,7 @@ function previewFiles() { image.src = this.result; preview.appendChild(image); }, - false + false, ); reader.readAsDataURL(file); diff --git a/files/ko/web/api/filereader/readastext/index.md b/files/ko/web/api/filereader/readastext/index.md index 3b54ed4662a31f..804105b582420d 100644 --- a/files/ko/web/api/filereader/readastext/index.md +++ b/files/ko/web/api/filereader/readastext/index.md @@ -2,6 +2,7 @@ title: FileReader.readAsText() slug: Web/API/FileReader/readAsText --- + {{APIRef("File API")}} **`readAsText()`** 메서드는 지정된 {{domxref("Blob")}} 이나 {{domxref("File")}} 의 컨텐츠를 읽기 위해 사용합니다. 읽기 연산이 끝나면, {{domxref("FileReader.readyState","readyState")}} 가 `DONE`으로 바뀌고, {{event("loadend")}} 이벤트가 트리거 되고, {{domxref("FileReader.result","result")}} 프로퍼티는 파일의 내용을 텍스트 문자열로 가집니다. diff --git a/files/ko/web/api/filereader/result/index.md b/files/ko/web/api/filereader/result/index.md index 73b0f0cb73f9b2..4225fbc5ca0aa3 100644 --- a/files/ko/web/api/filereader/result/index.md +++ b/files/ko/web/api/filereader/result/index.md @@ -2,6 +2,7 @@ title: FileReader.result slug: Web/API/FileReader/result --- + {{APIRef("File API")}} 파일의 내용을 반환한다. 이 속성은 읽기가 완료 된 후에만 사용 가능 하며 데이터의 형식은 읽기 작업에 어떤 함수가 사용되었는가에 의해 정해진다. @@ -9,7 +10,7 @@ slug: Web/API/FileReader/result ## Syntax ```js -var file = instanceOfFileReader.result +var file = instanceOfFileReader.result; ``` ## Value diff --git a/files/ko/web/api/formdata/append/index.md b/files/ko/web/api/formdata/append/index.md index 6174107600c212..5336ac29e068a3 100644 --- a/files/ko/web/api/formdata/append/index.md +++ b/files/ko/web/api/formdata/append/index.md @@ -46,15 +46,15 @@ var formData = new FormData(); // Currently empty {{domxref("FormData.append")}}를 사용하여 key/value 쌍을 추가할 수 있습니다: ```js -formData.append('username', 'Chris'); -formData.append('userpic', myFileInput.files[0], 'chris.jpg'); +formData.append("username", "Chris"); +formData.append("userpic", myFileInput.files[0], "chris.jpg"); ``` 일반 form 데이터와 마찬가지로 동일한 이름의 여러 값을 추가할 수 있습니다. 예를들면 (그리고 이름에 \[]를 추가하여 PHP의 명명 규칙과 호환이 가능합니다): ```js -formData.append('userpic[]', myFileInput.files[0], 'chris1.jpg'); -formData.append('userpic[]', myFileInput.files[1], 'chris2.jpg'); +formData.append("userpic[]", myFileInput.files[0], "chris1.jpg"); +formData.append("userpic[]", myFileInput.files[1], "chris2.jpg"); ``` 이 기술을 사용하면 서버에 올라간 결과 데이터가 루프를 도는데 도움이 되는 구조이기 때문에, 이 기술을 사용하면 다중 -파일 업로드를 보다 쉽게 처리할 수 있습니다. diff --git a/files/ko/web/api/formdata/delete/index.md b/files/ko/web/api/formdata/delete/index.md index e3e54bfd8383e6..fea28c41f3ec47 100644 --- a/files/ko/web/api/formdata/delete/index.md +++ b/files/ko/web/api/formdata/delete/index.md @@ -35,7 +35,7 @@ var formData = new FormData(myForm); `delete()`를 사용하여 키와 값을 삭제할 수 있습니다: ```js -formData.delete('username'); +formData.delete("username"); ``` ## 명세서 diff --git a/files/ko/web/api/formdata/entries/index.md b/files/ko/web/api/formdata/entries/index.md index 0f1ab6bcc5ebd2..131b5d47976eb9 100644 --- a/files/ko/web/api/formdata/entries/index.md +++ b/files/ko/web/api/formdata/entries/index.md @@ -24,12 +24,12 @@ formData.entries(); ```js // Create a test FormData object var formData = new FormData(); -formData.append('key1', 'value1'); -formData.append('key2', 'value2'); +formData.append("key1", "value1"); +formData.append("key2", "value2"); // Display the key/value pairs -for(var pair of formData.entries()) { - console.log(pair[0]+ ', '+ pair[1]); +for (var pair of formData.entries()) { + console.log(pair[0] + ", " + pair[1]); } ``` diff --git a/files/ko/web/api/formdata/formdata/index.md b/files/ko/web/api/formdata/formdata/index.md index 89618288821ed8..0cd3484b041d4b 100644 --- a/files/ko/web/api/formdata/formdata/index.md +++ b/files/ko/web/api/formdata/formdata/index.md @@ -12,7 +12,7 @@ slug: Web/API/FormData/FormData ## Syntax ```js -var formData = new FormData(form) +var formData = new FormData(form); ``` ### Parameters @@ -31,7 +31,7 @@ var formData = new FormData(); // Currently empty {{domxref("FormData.append")}}을 사용하여 key/value 쌍을 추가할 수 있습니다: ```js -formData.append('username', 'Chris'); +formData.append("username", "Chris"); ``` 또는 `FormData` 객체를 만들 때 선택적으로 `form` argument를 지정할 수 있는데, 지정된 양식대로 value를 미리 채우는 것입니다: @@ -40,24 +40,24 @@ formData.append('username', 'Chris');
    - +
    - +
    - +
    - +
    ``` > **참고:** 모든 입력 요소는 'name' 속성(attribute) 을 갖고 있습니다. 나중에 value에 접근하는데 필요합니다. ```js -var myForm = document.getElementById('myForm'); +var myForm = document.getElementById("myForm"); formData = new FormData(myForm); ``` diff --git a/files/ko/web/api/formdata/get/index.md b/files/ko/web/api/formdata/get/index.md index 71db2f5bfb60ee..0c4536b92a7983 100644 --- a/files/ko/web/api/formdata/get/index.md +++ b/files/ko/web/api/formdata/get/index.md @@ -35,14 +35,14 @@ var formData = new FormData(); {{domxref("FormData.append")}}를 사용하여 `username` 에 두 개의 값을 추가합니다: ```js -formData.append('username', 'Chris'); -formData.append('username', 'Bob'); +formData.append("username", "Chris"); +formData.append("username", "Bob"); ``` `get()` 함수를 사용하면 `username` 의 첫 번째 value만 반환합니다: ```js -formData.get('username'); // Returns "Chris" +formData.get("username"); // Returns "Chris" ``` ## 명세서 diff --git a/files/ko/web/api/formdata/getall/index.md b/files/ko/web/api/formdata/getall/index.md index 140dfdcb3cffa1..938555392eb29d 100644 --- a/files/ko/web/api/formdata/getall/index.md +++ b/files/ko/web/api/formdata/getall/index.md @@ -35,14 +35,14 @@ var formData = new FormData(); {{domxref("FormData.append")}}를 사용하여 `username` 에 두 개의 값을 추가합니다: ```js -formData.append('username', 'Chris'); -formData.append('username', 'Bob'); +formData.append("username", "Chris"); +formData.append("username", "Bob"); ``` `getAll()` 함수는 `username` 의 값들을 배열로 반환합니다: ```js -formData.getAll('username'); // Returns ["Chris", "Bob"] +formData.getAll("username"); // Returns ["Chris", "Bob"] ``` ## 명세서 diff --git a/files/ko/web/api/formdata/has/index.md b/files/ko/web/api/formdata/has/index.md index 4fdcbf3e120800..1205bfec7229d0 100644 --- a/files/ko/web/api/formdata/has/index.md +++ b/files/ko/web/api/formdata/has/index.md @@ -2,6 +2,7 @@ title: FormData.has() slug: Web/API/FormData/has --- + {{APIRef("XMLHttpRequest")}} {{domxref("FormData")}} 인터페이스의 **`has()`** 메서드는 `FormData` 객체에 특정 키가 들어 있는지 여부를 나타내는 boolean 을 반환합니다. @@ -34,9 +35,9 @@ var formData = new FormData(); 다음 스니펫(코드 조각)은 `FormData` 객체안에 `username` 이 존재하는지 테스트한 결과와, {{domxref("FormData.append")}}를 사용하여 `username` 에 값을 추가한 이후의 결과를 보여줍니다 : ```js -formData.has('username'); // Returns false -formData.append('username', 'Chris'); -formData.has('username'); // Returns true +formData.has("username"); // Returns false +formData.append("username", "Chris"); +formData.has("username"); // Returns true ``` ## 명세서 diff --git a/files/ko/web/api/formdata/index.md b/files/ko/web/api/formdata/index.md index 2141a36ebab23e..428ec3910095a6 100644 --- a/files/ko/web/api/formdata/index.md +++ b/files/ko/web/api/formdata/index.md @@ -2,6 +2,7 @@ title: FormData slug: Web/API/FormData --- + {{APIRef("XMLHttpRequest")}} **`FormData`** 인터페이스는 form 필드와 그 값을 나타내는 일련의 key/value 쌍을 쉽게 생성할 수 있는 방법을 제공합니다. 또한 {{domxref("XMLHttpRequest.send()")}} 메서드를 사용하여 쉽게 전송할 수 있습니다. 인코딩 타입이 `"multipart/form-data"`로 설정된 경우, form에서 사용하는 것과 동일한 포맷을 사용해야 합니다. diff --git a/files/ko/web/api/formdata/keys/index.md b/files/ko/web/api/formdata/keys/index.md index 9874a75393aa5c..b472f338b67880 100644 --- a/files/ko/web/api/formdata/keys/index.md +++ b/files/ko/web/api/formdata/keys/index.md @@ -24,12 +24,12 @@ formData.keys(); ```js // Create a test FormData object var formData = new FormData(); -formData.append('key1', 'value1'); -formData.append('key2', 'value2'); +formData.append("key1", "value1"); +formData.append("key2", "value2"); // Display the keys for (var key of formData.keys()) { - console.log(key); + console.log(key); } ``` diff --git a/files/ko/web/api/formdata/set/index.md b/files/ko/web/api/formdata/set/index.md index ea31b4e3c8e97e..5f4f531bcac7f2 100644 --- a/files/ko/web/api/formdata/set/index.md +++ b/files/ko/web/api/formdata/set/index.md @@ -2,6 +2,7 @@ title: FormData.set() slug: Web/API/FormData/set --- + {{APIRef("XMLHttpRequest")}} {{domxref("FormData")}} 인터페이스의 **`set()`** 메서드는 `FormData` 객체 내에 있는 기존 키에 새 값을 설정하거나, 존재하지 않을 경우 key/value을 추가합니다. @@ -41,8 +42,8 @@ var formData = new FormData(); // Currently empty {{domxref("FormData.set")}}를 사용하여 key/value 쌍을 추가할 수 있습니다:: ```js -formData.set('username', 'Chris'); -formData.set('userpic', myFileInput.files[0], 'chris.jpg'); +formData.set("username", "Chris"); +formData.set("userpic", myFileInput.files[0], "chris.jpg"); ``` ## 명세서 diff --git a/files/ko/web/api/formdata/values/index.md b/files/ko/web/api/formdata/values/index.md index 58c35f46708419..2436448f65fc38 100644 --- a/files/ko/web/api/formdata/values/index.md +++ b/files/ko/web/api/formdata/values/index.md @@ -24,12 +24,12 @@ formData.values(); ```js // Create a test FormData object var formData = new FormData(); -formData.append('key1', 'value1'); -formData.append('key2', 'value2'); +formData.append("key1", "value1"); +formData.append("key2", "value2"); // Display the values for (var value of formData.values()) { - console.log(value); + console.log(value); } ``` diff --git a/files/ko/web/api/fullscreen_api/index.md b/files/ko/web/api/fullscreen_api/index.md index e36b6cb207f251..16b7b762ac522f 100644 --- a/files/ko/web/api/fullscreen_api/index.md +++ b/files/ko/web/api/fullscreen_api/index.md @@ -101,11 +101,15 @@ _Fullscreen API는 full-screen mode를 켜고 끌 때 혹은, full-screen mode 페이지가 로드되면, 이 코드가 실행되어 Enter 키 를 주시하는 이벤트 리스너를 설정합니다. ```js -document.addEventListener("keypress", function(e) { - if (e.keyCode === 13) { - toggleFullScreen(); - } -}, false); +document.addEventListener( + "keypress", + function (e) { + if (e.keyCode === 13) { + toggleFullScreen(); + } + }, + false, +); ``` ### Toggling full-screen mode diff --git a/files/ko/web/api/gamepad_api/using_the_gamepad_api/index.md b/files/ko/web/api/gamepad_api/using_the_gamepad_api/index.md index d0f0e6957c35ae..869bbb8a224b4e 100644 --- a/files/ko/web/api/gamepad_api/using_the_gamepad_api/index.md +++ b/files/ko/web/api/gamepad_api/using_the_gamepad_api/index.md @@ -16,10 +16,14 @@ The [Gamepad API](/ko/docs/Web/API/Gamepad_API) introduces new events on the {{ {{event("gamepadconnected")}} 이벤트를 이렇게 이용할 수 있습니다: ```js -window.addEventListener("gamepadconnected", function(e) { - console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", - e.gamepad.index, e.gamepad.id, - e.gamepad.buttons.length, e.gamepad.axes.length); +window.addEventListener("gamepadconnected", function (e) { + console.log( + "Gamepad connected at index %d: %s. %d buttons, %d axes.", + e.gamepad.index, + e.gamepad.id, + e.gamepad.buttons.length, + e.gamepad.axes.length, + ); }); ``` @@ -30,9 +34,12 @@ window.addEventListener("gamepadconnected", function(e) { When a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. {{ event("gamepadconnected") }}), a second event is dispatched to the focused window, {{ event("gamepaddisconnected") }}: ```js -window.addEventListener("gamepaddisconnected", function(e) { - console.log("Gamepad disconnected from index %d: %s", - e.gamepad.index, e.gamepad.id); +window.addEventListener("gamepaddisconnected", function (e) { + console.log( + "Gamepad disconnected from index %d: %s", + e.gamepad.index, + e.gamepad.id, + ); }); ``` @@ -53,8 +60,20 @@ function gamepadHandler(event, connecting) { } } -window.addEventListener("gamepadconnected", function(e) { gamepadHandler(e, true); }, false); -window.addEventListener("gamepaddisconnected", function(e) { gamepadHandler(e, false); }, false); +window.addEventListener( + "gamepadconnected", + function (e) { + gamepadHandler(e, true); + }, + false, +); +window.addEventListener( + "gamepaddisconnected", + function (e) { + gamepadHandler(e, false); + }, + false, +); ``` This previous example also demonstrates how the `gamepad` property can be held after the event has completed — a technique we will use for device state querying later. @@ -68,11 +87,15 @@ Performing such checks tends to involve using the {{ domxref("Gamepad") }} objec The {{domxref("Navigator.getGamepads()")}} method returns an array of all devices currently visible to the webpage, as {{ domxref("Gamepad") }} objects (the first value is always `null`, so `null` will be returned if there are no gamepads connected.) This can then be used to get the same information. For example, the first code example above you be rewritten as shown below: ```js -window.addEventListener("gamepadconnected", function(e) { +window.addEventListener("gamepadconnected", function (e) { var gp = navigator.getGamepads()[e.gamepad.index]; - console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", - gp.index, gp.id, - gp.buttons.length, gp.axes.length); + console.log( + "Gamepad connected at index %d: %s. %d buttons, %d axes.", + gp.index, + gp.id, + gp.buttons.length, + gp.axes.length, + ); }); ``` @@ -109,9 +132,18 @@ var b = 0; Next we use the {{event("gamepadconnected")}} event to check for a gamepad being connected. When one is connected, we grab the gamepad using {{ domxref("Navigator.getGamepads()") }}`[0]`, print information about the gamepad into our gamepad info `div`, and fire the `gameLoop()` function that starts the whole ball movement process up. ```js -window.addEventListener("gamepadconnected", function(e) { +window.addEventListener("gamepadconnected", function (e) { var gp = navigator.getGamepads()[e.gamepad.index]; - gamepadInfo.innerHTML = "Gamepad connected at index " + gp.index + ": " + gp.id + ". It has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes."; + gamepadInfo.innerHTML = + "Gamepad connected at index " + + gp.index + + ": " + + gp.id + + ". It has " + + gp.buttons.length + + " buttons and " + + gp.axes.length + + " axes."; gameLoop(); }); @@ -120,7 +152,7 @@ window.addEventListener("gamepadconnected", function(e) { Now we use the {{Event("gamepaddisconnected")}} event to check if the gamepad is disconnected again. If so, we stop the {{DOMxRef("Window.requestAnimationFrame", "requestAnimationFrame()")}} loop (see below) and revert the gamepad information back to what it was originally. ```js -window.addEventListener("gamepaddisconnected", function(e) { +window.addEventListener("gamepaddisconnected", function (e) { gamepadInfo.innerHTML = "Waiting for gamepad."; cancelRequestAnimationFrame(start); @@ -132,18 +164,30 @@ Chrome does things differently here. Instead of constantly storing the gamepad's ```js var interval; -if (!('ongamepadconnected' in window)) { +if (!("ongamepadconnected" in window)) { // No gamepad events available, poll instead. interval = setInterval(pollGamepads, 500); } function pollGamepads() { - var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []); + var gamepads = navigator.getGamepads + ? navigator.getGamepads() + : navigator.webkitGetGamepads + ? navigator.webkitGetGamepads + : []; for (var i = 0; i < gamepads.length; i++) { var gp = gamepads[i]; if (gp) { - gamepadInfo.innerHTML = "Gamepad connected at index " + gp.index + ": " + gp.id + - ". It has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes."; + gamepadInfo.innerHTML = + "Gamepad connected at index " + + gp.index + + ": " + + gp.id + + ". It has " + + gp.buttons.length + + " buttons and " + + gp.axes.length + + " axes."; gameLoop(); clearInterval(interval); } @@ -157,14 +201,18 @@ After all this is done, we use our requestAnimationFrame() to request the next a ```js function buttonPressed(b) { - if (typeof(b) == "object") { + if (typeof b == "object") { return b.pressed; } return b == 1.0; } function gameLoop() { - var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []); + var gamepads = navigator.getGamepads + ? navigator.getGamepads() + : navigator.webkitGetGamepads + ? navigator.webkitGetGamepads + : []; if (!gamepads) { return; } @@ -197,7 +245,7 @@ function gameLoop() { This example shows how to use the {{ domxref("Gamepad") }} object, as well as the {{ event("gamepadconnected") }} and {{ event("gamepaddisconnected") }} events in order to display the state of all gamepads connected to the system. You can find a [working demo](http://luser.github.io/gamepadtest/) and look at the [full source code](https://github.com/luser/gamepadtest) on Github. ```js -var haveEvents = 'ongamepadconnected' in window; +var haveEvents = "ongamepadconnected" in window; var controllers = {}; function connecthandler(e) { @@ -278,7 +326,7 @@ function updateStatus() { var b = buttons[i]; var val = controller.buttons[i]; var pressed = val == 1.0; - if (typeof(val) == "object") { + if (typeof val == "object") { pressed = val.pressed; val = val.value; } @@ -305,7 +353,11 @@ function updateStatus() { } function scangamepads() { - var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + var gamepads = navigator.getGamepads + ? navigator.getGamepads() + : navigator.webkitGetGamepads + ? navigator.webkitGetGamepads() + : []; for (var i = 0; i < gamepads.length; i++) { if (gamepads[i]) { if (gamepads[i].index in controllers) { @@ -317,7 +369,6 @@ function scangamepads() { } } - window.addEventListener("gamepadconnected", connecthandler); window.addEventListener("gamepaddisconnected", disconnecthandler); diff --git a/files/ko/web/api/geolocation/clearwatch/index.md b/files/ko/web/api/geolocation/clearwatch/index.md index 3af407b0970431..26c5a6c12f3c6e 100644 --- a/files/ko/web/api/geolocation/clearwatch/index.md +++ b/files/ko/web/api/geolocation/clearwatch/index.md @@ -27,24 +27,24 @@ function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { - console.log('Congratulation, you reach the target'); + console.log("Congratulation, you reach the target"); navigator.geolocation.clearWatch(id); } -}; +} function error(err) { - console.warn('ERROR(' + err.code + '): ' + err.message); -}; + console.warn("ERROR(" + err.code + "): " + err.message); +} target = { - latitude : 0, + latitude: 0, longitude: 0, -} +}; options = { enableHighAccuracy: false, timeout: 5000, - maximumAge: 0 + maximumAge: 0, }; id = navigator.geolocation.watchPosition(success, error, options); diff --git a/files/ko/web/api/geolocation/getcurrentposition/index.md b/files/ko/web/api/geolocation/getcurrentposition/index.md index 1c17cb735d5abe..666f53579dc535 100644 --- a/files/ko/web/api/geolocation/getcurrentposition/index.md +++ b/files/ko/web/api/geolocation/getcurrentposition/index.md @@ -2,6 +2,7 @@ title: Geolocation.getCurrentPosition() slug: Web/API/Geolocation/getCurrentPosition --- + {{securecontext_header}}{{ APIRef("Geolocation API") }} **`Geolocation.getCurrentPosition()`** 메서드는 장치의 현재 위치를 가져옵니다. @@ -9,7 +10,7 @@ slug: Web/API/Geolocation/getCurrentPosition ## 구문 ```js -navigator.geolocation.getCurrentPosition(success, error, [options]) +navigator.geolocation.getCurrentPosition(success, error, [options]); ``` ### 매개변수 @@ -33,13 +34,13 @@ navigator.geolocation.getCurrentPosition(success, error, [options]) var options = { enableHighAccuracy: true, timeout: 5000, - maximumAge: 0 + maximumAge: 0, }; function success(pos) { var crd = pos.coords; - console.log('Your current position is:'); + console.log("Your current position is:"); console.log(`Latitude : ${crd.latitude}`); console.log(`Longitude: ${crd.longitude}`); console.log(`More or less ${crd.accuracy} meters.`); diff --git a/files/ko/web/api/geolocation/watchposition/index.md b/files/ko/web/api/geolocation/watchposition/index.md index 1b8568f1287fe7..6e29d633580839 100644 --- a/files/ko/web/api/geolocation/watchposition/index.md +++ b/files/ko/web/api/geolocation/watchposition/index.md @@ -35,24 +35,24 @@ function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { - console.log('Congratulations, you reached the target'); + console.log("Congratulations, you reached the target"); navigator.geolocation.clearWatch(id); } } function error(err) { - console.warn('ERROR(' + err.code + '): ' + err.message); + console.warn("ERROR(" + err.code + "): " + err.message); } target = { - latitude : 0, - longitude: 0 + latitude: 0, + longitude: 0, }; options = { enableHighAccuracy: false, timeout: 5000, - maximumAge: 0 + maximumAge: 0, }; id = navigator.geolocation.watchPosition(success, error, options); diff --git a/files/ko/web/api/geolocation_api/index.md b/files/ko/web/api/geolocation_api/index.md index 9744b9a0bb18f4..426156587dc32a 100644 --- a/files/ko/web/api/geolocation_api/index.md +++ b/files/ko/web/api/geolocation_api/index.md @@ -4,6 +4,7 @@ slug: Web/API/Geolocation_API l10n: sourceCommit: 1511e914c6b1ce6f88056bfefd48a6aa585cebce --- + {{securecontext_header}}{{DefaultAPISidebar("Geolocation API")}} **Geolocation API**는 사용자의 동의 하에 웹 애플리케이션에서 위치 정보에 접근할 수 있는 API입니다. 개인정보 보호를 위해, 브라우저는 위치 정보를 제공하기 전에 사용자에게 위치 정보 권한에 대한 확인을 받습니다. diff --git a/files/ko/web/api/geolocation_api/using_the_geolocation_api/index.md b/files/ko/web/api/geolocation_api/using_the_geolocation_api/index.md index 2b2cebf1e14694..263099d578c061 100644 --- a/files/ko/web/api/geolocation_api/using_the_geolocation_api/index.md +++ b/files/ko/web/api/geolocation_api/using_the_geolocation_api/index.md @@ -75,7 +75,7 @@ function error() { const options = { enableHighAccuracy: true, maximumAge: 30000, - timeout: 27000 + timeout: 27000, }; const watchID = navigator.geolocation.watchPosition(success, error, options); @@ -91,7 +91,7 @@ const watchID = navigator.geolocation.watchPosition(success, error, options); ```js function success(position) { - const latitude = position.coords.latitude; + const latitude = position.coords.latitude; const longitude = position.coords.longitude; // 위도와 경도를 사용해 작업 수행 @@ -109,7 +109,7 @@ function success(position) { ```js function errorCallback(error) { alert(`ERROR(${error.code}): ${error.message}`); -}; +} ``` ## 예제 @@ -119,11 +119,11 @@ function errorCallback(error) { ```css hidden body { padding: 20px; - background-color:#ffffc9 + background-color: #ffffc9; } button { - margin: .5rem 0; + margin: 0.5rem 0; } ``` diff --git a/files/ko/web/api/geolocationcoordinates/longitude/index.md b/files/ko/web/api/geolocationcoordinates/longitude/index.md index 617b119dcf28f6..85142bb24c6846 100644 --- a/files/ko/web/api/geolocationcoordinates/longitude/index.md +++ b/files/ko/web/api/geolocationcoordinates/longitude/index.md @@ -52,8 +52,8 @@ button.addEventListener("click", () => { ```html

    - 당신의 위치는 위도 0.00°, - 경도 0.00° 입니다. + 당신의 위치는 위도 0.00°, 경도 + 0.00° 입니다.

    ``` diff --git a/files/ko/web/api/geolocationposition/index.md b/files/ko/web/api/geolocationposition/index.md index c87f5132907457..983801cc994173 100644 --- a/files/ko/web/api/geolocationposition/index.md +++ b/files/ko/web/api/geolocationposition/index.md @@ -2,6 +2,7 @@ title: GeolocationPosition slug: Web/API/GeolocationPosition --- + {{securecontext_header}}{{APIRef("Geolocation API")}} **`GeolocationPosition`** 인터페이스는 주어진 시간에 장치가 위치한 지점을 나타냅니다. 지점은 {{domxref("Coordinates")}} 객체로 표현하여, 지구를 나타내는 회전타원체 위의 2D 위치와 더불어 높이와 속도 정보를 담습니다. diff --git a/files/ko/web/api/history/back/index.md b/files/ko/web/api/history/back/index.md index c96e79c58b65a8..f2021fe2114884 100644 --- a/files/ko/web/api/history/back/index.md +++ b/files/ko/web/api/history/back/index.md @@ -2,6 +2,7 @@ title: History.back() slug: Web/API/History/back --- + {{APIRef("DOM")}} **`History.back()`** 메서드는 브라우저가 세션 기록의 바로 뒤 페이지로 이동하도록 지시합니다. {{domxref("History.go", "history.go(-1)")}}와 같습니다. 이전 페이지가 없는 경우 아무것도 하지 않습니다. @@ -11,7 +12,7 @@ slug: Web/API/History/back ## 구문 ```js -history.back() +history.back(); ``` ## 예제 @@ -27,7 +28,7 @@ history.back() ### JavaScript ```js -document.getElementById('go-back').addEventListener('click', () => { +document.getElementById("go-back").addEventListener("click", () => { window.history.back(); }); ``` diff --git a/files/ko/web/api/history/forward/index.md b/files/ko/web/api/history/forward/index.md index e57c46ce936413..4d41a5132e2095 100644 --- a/files/ko/web/api/history/forward/index.md +++ b/files/ko/web/api/history/forward/index.md @@ -12,7 +12,7 @@ slug: Web/API/History/forward ## 구문 ```js -history.forward() +history.forward(); ``` ## 예제 @@ -22,15 +22,15 @@ history.forward() ### HTML ```html - + ``` ### JavaScript ```js -document.getElementById('go-forward').addEventListener('click', e => { +document.getElementById("go-forward").addEventListener("click", (e) => { window.history.forward(); -}) +}); ``` ## 명세 diff --git a/files/ko/web/api/history/go/index.md b/files/ko/web/api/history/go/index.md index 785534a65efa98..5344ce05ea3699 100644 --- a/files/ko/web/api/history/go/index.md +++ b/files/ko/web/api/history/go/index.md @@ -2,6 +2,7 @@ title: History.go() slug: Web/API/History/go --- + {{APIRef("History API")}} **`History.go()`** 메서드는 history 세션에서 특정한 페이지를 로딩합니다. 인자로 전달하는 파라미터 값에 따라 history를 통해서 페이지를 앞 뒤로 이동할 수 있습니다. @@ -11,7 +12,7 @@ slug: Web/API/History/go ## 구문 ```js -history.go([delta]) +history.go([delta]); ``` ### Parameters @@ -24,13 +25,13 @@ history.go([delta]) 한 페이지 뒤로 가기 ({{domxref("History.back", "back()")}}를 호출한 것과 동일): ```js -history.go(-1) +history.go(-1); ``` {{domxref("History.forward", "forward()")}}와 동일한 한 페이지 앞으로 가기: ```js -history.go(1) +history.go(1); ``` 두 페이지 앞으로 가기: diff --git a/files/ko/web/api/history/index.md b/files/ko/web/api/history/index.md index 8de4be0f9bba1a..3143dafff709c5 100644 --- a/files/ko/web/api/history/index.md +++ b/files/ko/web/api/history/index.md @@ -2,6 +2,7 @@ title: History slug: Web/API/History --- + {{APIRef("HTML DOM")}} **`History`** 인터페이스는 브라우저의 세션 기록, 즉 현재 페이지를 불러온 탭 또는 프레임의 방문 기록을 조작할 수 있는 방법을 제공합니다. diff --git a/files/ko/web/api/history/replacestate/index.md b/files/ko/web/api/history/replacestate/index.md index d6516cb893912a..cbdf37e1d1cb29 100644 --- a/files/ko/web/api/history/replacestate/index.md +++ b/files/ko/web/api/history/replacestate/index.md @@ -2,6 +2,7 @@ title: History.replaceState() slug: Web/API/History/replaceState --- + {{APIRef("History API")}} **`History.replaceState()`** 메서드는 현재 history를 수정해 메소드의 매개 변수에 전달 된 `stateObj`, `title`, `URL`로 대체합니다. 이 방법은 특히 일부 유저의 동작에 대한 응답으로 history 객체의 상태나 현재 history의 URL을 업데이트하려는 경우에 유용합니다. @@ -26,14 +27,14 @@ history.replaceState(stateObj, title[, url]) `http://www.mozilla.org/` 에서 아래 JavaScript를 실행한다고 가정합시다: ```js -const stateObj = { foo: 'bar' }; -history.pushState(stateObj, '', 'bar.html'); +const stateObj = { foo: "bar" }; +history.pushState(stateObj, "", "bar.html"); ``` 위 두 줄에 대한 설명은 [Working with the History API](/ko/docs/Web/API/History_API/Working_with_the_History_API) 문서의 [Example of `pushState()` method](/ko/docs/Web/API/History_API/Working_with_the_History_API#Example_of_pushState_method)에서 확인할 수 있습니다. 그 다음, `http://www.mozilla.org/bar.html` 에서 아래와 같은 JavaScript를 실행한다고 가정해보세요: ```js -history.replaceState(stateObj, '', 'bar2.html'); +history.replaceState(stateObj, "", "bar2.html"); ``` 이렇게하면 URL 표시줄에 `http://www.mozilla.org/bar2.html` 이라고 표시되지만, 브라우저가 `bar2.html` 을 로드하거나 `bar2.html`파일이 있는지 확인하지는 않습니다. diff --git a/files/ko/web/api/history/scrollrestoration/index.md b/files/ko/web/api/history/scrollrestoration/index.md index 3cdba0341be85a..cda768fe107bec 100644 --- a/files/ko/web/api/history/scrollrestoration/index.md +++ b/files/ko/web/api/history/scrollrestoration/index.md @@ -2,6 +2,7 @@ title: History.scrollRestoration slug: Web/API/History/scrollRestoration --- + {{APIRef("HTML DOM")}} **`History.scrollRestoration`** 속성을 사용하면 기록 탐색 시 사용할 스크롤 위치 복원 기능의 기본값을 웹 애플리케이션이 지정할 수 있습니다. @@ -24,9 +25,11 @@ let scrollRestore = history.scrollRestoration; ### 현재 스크롤 복원 여부 알아내기 ```js -const scrollRestoration = history.scrollRestoration -if (scrollRestoration === 'manual') { - console.log('The location on the page is not restored, user will need to scroll manually.'); +const scrollRestoration = history.scrollRestoration; +if (scrollRestoration === "manual") { + console.log( + "The location on the page is not restored, user will need to scroll manually.", + ); } ``` @@ -34,7 +37,7 @@ if (scrollRestoration === 'manual') { ```js if (history.scrollRestoration) { - window.history.scrollRestoration = 'manual'; + window.history.scrollRestoration = "manual"; } ``` diff --git a/files/ko/web/api/history/state/index.md b/files/ko/web/api/history/state/index.md index e7ff35bb6dacd5..c4161c5b910288 100644 --- a/files/ko/web/api/history/state/index.md +++ b/files/ko/web/api/history/state/index.md @@ -12,7 +12,7 @@ slug: Web/API/History/state ## 구문 ```js -const currentState = history.state +const currentState = history.state; ``` ### 값 @@ -30,7 +30,7 @@ const currentState = history.state console.log(`History.state before pushState: ${history.state}`); // Now push something on the stack -history.pushState({name: 'Example'}, "pushState example", 'page3.html'); +history.pushState({ name: "Example" }, "pushState example", "page3.html"); // Now state has a value. console.log(`History.state after pushState: ${history.state}`); diff --git a/files/ko/web/api/history_api/index.md b/files/ko/web/api/history_api/index.md index 90c19682b3b1ae..14375b30228421 100644 --- a/files/ko/web/api/history_api/index.md +++ b/files/ko/web/api/history_api/index.md @@ -16,7 +16,7 @@ DOM의 {{domxref("Window")}} 객체는 {{domxref("Window.history", "history")}} 방문 기록의 뒤로 이동하려면 다음과 같이 사용합니다. ```js -history.back() +history.back(); ``` 위의 코드는 사용자가 브라우저 도구 모음의 뒤로 가기 버튼을 누른 것과 같습니다. @@ -24,7 +24,7 @@ history.back() 이와 비슷하게, 기록의 앞으로 (도구 모음의 앞으로 가기 버튼) 가는 것도 할 수 있습니다. ```js -history.forward() +history.forward(); ``` ### 기록의 특정 지점으로 이동 @@ -34,13 +34,13 @@ history.forward() 한 페이지 뒤로 이동하려면 다음과 같이 사용합니다. ({{domxref("History.back", "back()")}}과 동일) ```js -history.go(-1) +history.go(-1); ``` 한 페이지 앞으로 이동하려면 다음과 같이 사용합니다. ({{domxref("History.forward", "forward()")}}와 동일) ```js -history.go(1) +history.go(1); ``` 매개변수로 지정한 숫자를 바꾸면 2 페이지씩 이동하는 것도 가능합니다. @@ -51,14 +51,14 @@ history.go(1) // The following statements // both have the effect of // refreshing the page -history.go(0) -history.go() +history.go(0); +history.go(); ``` {{domxref("History.length", "length")}} 속성을 사용해 방문 기록 스택의 크기도 알아낼 수 있습니다. ```js -let numberOfEntries = window.history.length +let numberOfEntries = window.history.length; ``` ## 인터페이스 @@ -71,16 +71,18 @@ let numberOfEntries = window.history.length 다음 예제는 {{domxref("window.onpopstate")}} 속성에 이벤트 처리기를 부착한 후, {{domxref("window.history", "history")}} 객체를 사용해 브라우저 방문 기록을 추가하거나 대체한 후 탐색하는 코드입니다. ```js -window.onpopstate = function(event) { - alert(`location: ${document.location}, state: ${JSON.stringify(event.state)}`) -} - -history.pushState({page: 1}, "title 1", "?page=1") -history.pushState({page: 2}, "title 2", "?page=2") -history.replaceState({page: 3}, "title 3", "?page=3") -history.back() // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" -history.back() // alerts "location: http://example.com/example.html, state: null" -history.go(2) // alerts "location: http://example.com/example.html?page=3, state: {"page":3}" +window.onpopstate = function (event) { + alert( + `location: ${document.location}, state: ${JSON.stringify(event.state)}`, + ); +}; + +history.pushState({ page: 1 }, "title 1", "?page=1"); +history.pushState({ page: 2 }, "title 2", "?page=2"); +history.replaceState({ page: 3 }, "title 3", "?page=3"); +history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" +history.back(); // alerts "location: http://example.com/example.html, state: null" +history.go(2); // alerts "location: http://example.com/example.html?page=3, state: {"page":3}" ``` ## 명세 diff --git a/files/ko/web/api/html_dom_api/microtask_guide/index.md b/files/ko/web/api/html_dom_api/microtask_guide/index.md index a3404acf0f51d2..24d2982a7fb175 100644 --- a/files/ko/web/api/html_dom_api/microtask_guide/index.md +++ b/files/ko/web/api/html_dom_api/microtask_guide/index.md @@ -72,16 +72,18 @@ queueMicrotask(() => { 마이크로태스크를 사용해 실행 순서를 항상 일정하게 유지할 수 있는 상황은 `if...else` 선언문 (또는 다른 조건 선언문) 중 한 절에서만 프로미스를 사용하고, 다른 절에서는 사용하지 않는 것입니다. 다음과 같은 코드를 고려해보겠습니다. ```js -customElement.prototype.getData = url => { +customElement.prototype.getData = (url) => { if (this.cache[url]) { this.data = this.cache[url]; this.dispatchEvent(new Event("load")); } else { - fetch(url).then(result => result.arrayBuffer()).then(data => { - this.cache[url] = data; - this.data = data; - this.dispatchEvent(new Event("load")); - }); + fetch(url) + .then((result) => result.arrayBuffer()) + .then((data) => { + this.cache[url] = data; + this.data = data; + this.dispatchEvent(new Event("load")); + }); } }; ``` @@ -118,18 +120,20 @@ Data fetched `if` 절에서 마이크로태스크를 사용해 두 절의 균형을 맞춰주는 방법으로 항상 같은 실행 순서를 유지할 수 있습니다. ```js -customElement.prototype.getData = url => { +customElement.prototype.getData = (url) => { if (this.cache[url]) { queueMicrotask(() => { this.data = this.cache[url]; this.dispatchEvent(new Event("load")); }); } else { - fetch(url).then(result => result.arrayBuffer()).then(data => { - this.cache[url] = data; - this.data = data; - this.dispatchEvent(new Event("load")); - }); + fetch(url) + .then((result) => result.arrayBuffer()) + .then((data) => { + this.cache[url] = data; + this.data = data; + this.dispatchEvent(new Event("load")); + }); } }; ``` @@ -145,7 +149,7 @@ customElement.prototype.getData = url => { ```js const messageQueue = []; -let sendMessage = message => { +let sendMessage = (message) => { messageQueue.push(message); if (messageQueue.length === 1) { @@ -175,15 +179,14 @@ let sendMessage = message => { 다음의 간단한 예제에서는, 큐에 추가한 마이크로태스크의 콜백은 최상위 스크립트의 동작이 끝난 후 실행된다는 것을 보입니다. ```html hidden -
    -
    +
    
     ```
     
     #### JavaScript
     
     ```js hidden
     let logElem = document.getElementById("log");
    -let log = s => logElem.innerHTML += s + "
    "; +let log = (s) => (logElem.innerHTML += s + "
    "); ``` 이어지는 코드에서 {{domxref("queueMicrotask()")}}를 사용해 실행할 마이크로태스크를 예약하는 것을 볼 수 있습니다. 앞뒤로는 `log()` 호출을 배치했는데, 화면에 텍스트를 출력하는 함수입니다. @@ -191,7 +194,7 @@ let log = s => logElem.innerHTML += s + "
    "; ```js log("마이크로태스크 추가 전"); queueMicrotask(() => { - log("마이크로태스크를 실행했습니다.") + log("마이크로태스크를 실행했습니다."); }); log("마이크로태스크 추가 후"); ``` @@ -205,15 +208,14 @@ log("마이크로태스크 추가 후"); 이 예제에서는 0밀리초의 타임아웃("최대한 빠르게")을 예약합니다. 여기서 확인할 수 있는 것은 (`setTimeout()` 등을 사용해) 태스크를 생성할 때의 "최대한 빠르게"와, 마이크로태스크에서의 "최대한 빠르게"는 다르다는 점입니다. ```html hidden -
    -
    +
    
     ```
     
     #### JavaScript
     
     ```js hidden
     let logElem = document.getElementById("log");
    -let log = s => logElem.innerHTML += s + "
    "; +let log = (s) => (logElem.innerHTML += s + "
    "); ``` 이어지는 코드에서 {{domxref("queueMicrotask()")}}를 사용해 실행할 마이크로태스크를 예약하는 것을 볼 수 있습니다. 그 위에서는 타임아웃을 0ms 후 발동하도록 예약합니다. 앞뒤로는 `log()` 호출을 배치했는데, 화면에 텍스트를 출력하는 함수입니다. @@ -240,15 +242,14 @@ log("주 프로그램 종료"); 이 예제는 이전 예제를 약간 확장해, `queueMicrotask()`로 마이크로태스크를 예약한 후 모종의 계산 작업을 수행하는 함수를 사용합니다. 여기서 확인해야 할 것은 마이크로태스크의 실행 시점이 함수의 종료 순간이 아니고 주 프로그램의 종료 시점이라는 점입니다. ```html hidden -
    -
    +
    
     ```
     
     #### JavaScript
     
     ```js hidden
     let logElem = document.getElementById("log");
    -let log = s => logElem.innerHTML += s + "
    "; +let log = (s) => (logElem.innerHTML += s + "
    "); ``` 주 프로그램 코드는 다음과 같습니다. `doWork()` 함수가 `queueMicrotask()`를 호출하지만, 태스크가 종료되어 실행 스택에 아무것도 남지 않은 상태가 되는, 즉 전체 프로그램 실행이 종료되기 전까지 이 마이크로태스크는 처리되지 않는 것을 결과에서 볼 수 있습니다. @@ -263,7 +264,7 @@ let doWork = () => { queueMicrotask(urgentCallback); - for (let i=2; i<=10; i++) { + for (let i = 2; i <= 10; i++) { result *= i; } return result; diff --git a/files/ko/web/api/html_drag_and_drop_api/drag_operations/index.md b/files/ko/web/api/html_drag_and_drop_api/drag_operations/index.md index 080a087658fb41..8f3450e43e1194 100644 --- a/files/ko/web/api/html_drag_and_drop_api/drag_operations/index.md +++ b/files/ko/web/api/html_drag_and_drop_api/drag_operations/index.md @@ -3,6 +3,7 @@ title: Drag Operations slug: Web/API/HTML_Drag_and_Drop_API/Drag_operations original_slug: Web/API/HTML_드래그_앤_드롭_API/Drag_operations --- + {{DefaultAPISidebar("HTML Drag and Drop API")}} 다음은 드래그 & 드랍(drag & drop) 동작 실행 시 각 단계에 대한 설명입니다. @@ -24,7 +25,9 @@ HTML에서 이미지나 링크 그리고 선택(selections)에 대한 기본 행 컨텐츠의 일부 영역을 드래그할 수 있도록 만드는 예제는 다음과 같습니다. ```html -
    +
    This text may be dragged.
    ``` @@ -36,7 +39,9 @@ HTML에서 이미지나 링크 그리고 선택(selections)에 대한 기본 행 XUL 요소에 대해서는 `{{htmlattrxref("draggable")}}` 속성을 사용할 필요가 없으며, 모든 XUL 요소는 드래그가 가능합니다. ```html - ``` ## 드래그 작업 시작 @@ -44,7 +49,9 @@ XUL 요소에 대해서는 `{{htmlattrxref("draggable")}}` 속성을 사용할 이 예제에서는 `{{domxref("GlobalEventHandlers.ondragstart","ondragstart")}}` 속성을 이용하여 {{event("dragstart")}} 이벤트에 대한 리스너를 추가합니다. ```html -
    +
    This text may be dragged.
    ``` @@ -108,7 +115,10 @@ event.dataTransfer.setDragImage(image, xOffset, yOffset); ```js function dragWithCustomImage(event) { - var canvas = document.createElementNS("http://www.w3.org/1999/xhtml","canvas"); + var canvas = document.createElementNS( + "http://www.w3.org/1999/xhtml", + "canvas", + ); canvas.width = canvas.height = 50; var ctx = canvas.getContext("2d"); @@ -120,7 +130,7 @@ function dragWithCustomImage(event) { ctx.stroke(); var dt = event.dataTransfer; - dt.setData('text/plain', 'Data to Drag'); + dt.setData("text/plain", "Data to Drag"); dt.setDragImage(canvas, 25, 25); } ``` @@ -182,7 +192,8 @@ event.dataTransfer.dropEffect = "copy"; ```html
    -
    +
    +
    ``` `{{event("dragenter")}}` and `{{event("dragover")}}` 두 이벤트 모두에서 {{domxref("Event.preventDefault","preventDefault()")}} 메서드를 호출하는 것은 그 위치에 드랍이 허용되는 것을 나타냅니다. 하지만, 일반적으로 특정한 상황에서만, 예를 들자면 링크가 드래그될 때만 {{domxref("Event.preventDefault","preventDefault()")}} 메서드를 호출하길 원할 것입니다. 이렇게 하기 위해서는 조건을 확인하여 조건이 충족될 때에만 해당 이벤트를 취소하는 함수를 호출합니다. 조건이 충족되지 않을 경우, 이벤트를 취소하지 않으면 사용자가 마우스 버튼을 놓더라도 드랍은 발생하지 않을 것입니다. @@ -191,14 +202,14 @@ data transfer의 드래그 데이터 형식에 따라 드랍을 허용하거나 ```js function contains(list, value) { - for( var i = 0; i < list.length; ++i ) { - if(list[i] === value) return true; - } - return false; + for (var i = 0; i < list.length; ++i) { + if (list[i] === value) return true; + } + return false; } function doDragOver(event) { - var isLink = contains( event.dataTransfer.types, "text/uri-list"); + var isLink = contains(event.dataTransfer.types, "text/uri-list"); if (isLink) { event.preventDefault(); } @@ -216,7 +227,7 @@ function doDragOver(event) { 그 결과로, [contains](/ko/docs/Web/API/Node/contains) 메서드는 해당 속성에 대해 더 이상 동작하지 않으며; 특정 형식의 데이터가 제공되는지 확인하기 위해서는 다음 코드와 같이 [includes](/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) 메서드를 사용해야 합니다: ```js -if ([...event.dataTransfer.types].includes('text/html')) { +if ([...event.dataTransfer.types].includes("text/html")) { // Do something } ``` @@ -271,8 +282,7 @@ You can retrieve other types of data as well. If the data is a link, it should h function doDrop(event) { var lines = event.dataTransfer.getData("text/uri-list").split("\n"); for (let line of lines) { - if (line.startsWith("#")) - continue; + if (line.startsWith("#")) continue; let link = document.createElement("a"); link.href = line; @@ -302,10 +312,13 @@ The following example returns the data associated with the best-supported format ```js function doDrop(event) { var types = event.dataTransfer.types; - var supportedTypes = ["application/x-moz-file", "text/uri-list", "text/plain"]; + var supportedTypes = [ + "application/x-moz-file", + "text/uri-list", + "text/plain", + ]; types = supportedTypes.filter((value) => types.includes(value)); - if (types.length) - var data = event.dataTransfer.getData(types[0]); + if (types.length) var data = event.dataTransfer.getData(types[0]); event.preventDefault(); } ``` diff --git a/files/ko/web/api/html_drag_and_drop_api/index.md b/files/ko/web/api/html_drag_and_drop_api/index.md index eace153475ea08..713838c894fdbd 100644 --- a/files/ko/web/api/html_drag_and_drop_api/index.md +++ b/files/ko/web/api/html_drag_and_drop_api/index.md @@ -3,6 +3,7 @@ title: HTML 드래그 앤 드롭 API slug: Web/API/HTML_Drag_and_Drop_API original_slug: Web/API/HTML_드래그_앤_드롭_API --- + {{DefaultAPISidebar("HTML 드래그 앤 드롭 API")}} HTML 드래그 앤 드롭 인터페이스는 파이어폭스와 다른 브라우저에서 어플리케이션이 드래그 앤 드롭 기능을 사용하게 해줍니다. 이 기능을 이용해 사용자는 _draggable_ 요소를 마우스로 선택해 _droppable_ 요소로 드래그하고, 마우스 버튼에서 손을 뗌으로써 요소를 드롭할 수 있습니다. 드래그하는 동안 draggable 요소는 반투명한 채로 마우스 포인터를 따라다닙니다. @@ -17,16 +18,16 @@ HTML 드래그 앤 드롭은 {{domxref("Event","DOM event model")}} 과 _{{domxr 모든 [드래그 이벤트](/ko/docs/Web/API/DragEvent#Event_types)는 [글로벌 이벤트 핸들러](/ko/docs/Web/API/DragEvent#GlobalEventHandlers)와 연결되어 있습니다. 각 드래그 이벤트와 드래그 전역 속성은 참조 문서를 가지고 있습니다. 아래 표는 각 이벤트에 대한 간략한 설명과 참조 문서로의 링크를 담고 있습니다. -| 이벤트 | 이벤트 핸들러 | 설명 | -| ------------------------------------------------------------ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| {{domxref('Document/drag_이벤트', 'drag')}} | {{domxref('GlobalEventHandlers.ondrag','ondrag')}} | 요소나 텍스트 블록을 드래그 할 때 발생한다. | -| {{event('dragend')}} | {{domxref('GlobalEventHandlers.ondragend','ondragend')}} | 드래그를 끝냈을 때 발생한다. (마우스 버튼을 떼거나 ESC 키를 누를 때) ([드래그 끝내기](/ko/docs/DragDrop/Drag_Operations#dragend)를 보시오) | -| {{event('dragenter')}} | {{domxref('GlobalEventHandlers.ondragenter','ondragenter')}} | 드래그한 요소나 텍스트 블록을 적합한 드롭 대상위에 올라갔을 때 발생한다. ([드롭 대상 지정하기](/ko/docs/DragDrop/Drag_Operations#droptargets)를 보시오.) | -| {{event('dragexit')}} | {{domxref('GlobalEventHandlers.ondragexit','ondragexit')}} | 요소가 더 이상 드래그의 직접적인 대상이 아닐 때 발생한다. | -| {{event('dragleave')}} | {{domxref('GlobalEventHandlers.ondragleave','ondragleave')}} | 드래그하는 요소나 텍스트 블록이 적합한 드롭 대상에서 벗어났을 때 발생한다. | -| {{event('dragover')}} | {{domxref('GlobalEventHandlers.ondragover','ondragover')}} | 요소나 텍스트 블록을 적합한 드롭 대상 위로 지나갈 때 발생한다. (매 수백 밀리초마다 발생한다.) | -| {{event('dragstart')}} | {{domxref('GlobalEventHandlers.ondragstart','ondragstart')}} | 사용자가 요소나 텍스트 블록을 드래그하기 시작했을 때 발생한다. ([드래그 시작하기](/ko/docs/DragDrop/Drag_Operations#dragstart)를 보시오.) | -| {{event('drop')}} | {{domxref('GlobalEventHandlers.ondrop','ondrop')}} | 요소나 텍스트 블록을 적합한 드롭 대상에 드롭했을 때 발생한다. ([드롭하기](/ko/docs/DragDrop/Drag_Operations#dragstart)를 보시오.) | +| 이벤트 | 이벤트 핸들러 | 설명 | +| ------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| {{domxref('Document/drag_이벤트', 'drag')}} | {{domxref('GlobalEventHandlers.ondrag','ondrag')}} | 요소나 텍스트 블록을 드래그 할 때 발생한다. | +| {{event('dragend')}} | {{domxref('GlobalEventHandlers.ondragend','ondragend')}} | 드래그를 끝냈을 때 발생한다. (마우스 버튼을 떼거나 ESC 키를 누를 때) ([드래그 끝내기](/ko/docs/DragDrop/Drag_Operations#dragend)를 보시오) | +| {{event('dragenter')}} | {{domxref('GlobalEventHandlers.ondragenter','ondragenter')}} | 드래그한 요소나 텍스트 블록을 적합한 드롭 대상위에 올라갔을 때 발생한다. ([드롭 대상 지정하기](/ko/docs/DragDrop/Drag_Operations#droptargets)를 보시오.) | +| {{event('dragexit')}} | {{domxref('GlobalEventHandlers.ondragexit','ondragexit')}} | 요소가 더 이상 드래그의 직접적인 대상이 아닐 때 발생한다. | +| {{event('dragleave')}} | {{domxref('GlobalEventHandlers.ondragleave','ondragleave')}} | 드래그하는 요소나 텍스트 블록이 적합한 드롭 대상에서 벗어났을 때 발생한다. | +| {{event('dragover')}} | {{domxref('GlobalEventHandlers.ondragover','ondragover')}} | 요소나 텍스트 블록을 적합한 드롭 대상 위로 지나갈 때 발생한다. (매 수백 밀리초마다 발생한다.) | +| {{event('dragstart')}} | {{domxref('GlobalEventHandlers.ondragstart','ondragstart')}} | 사용자가 요소나 텍스트 블록을 드래그하기 시작했을 때 발생한다. ([드래그 시작하기](/ko/docs/DragDrop/Drag_Operations#dragstart)를 보시오.) | +| {{event('drop')}} | {{domxref('GlobalEventHandlers.ondrop','ondrop')}} | 요소나 텍스트 블록을 적합한 드롭 대상에 드롭했을 때 발생한다. ([드롭하기](/ko/docs/DragDrop/Drag_Operations#dragstart)를 보시오.) | > **참고:** `참고: dragstart`와 `dragend` 이벤트는 파일을 브라우저로 드래그할 때는 발생하지 않습니다. @@ -60,9 +61,9 @@ A key difference between the {{domxref("DataTransfer")}} and {{domxref("DataTran ```js function dragstart_handler(ev) { - console.log("dragStart"); - // 데이터 전달 객체에 대상 요소의 id를 추가합니다. - ev.dataTransfer.setData("text/plain", ev.target.id); + console.log("dragStart"); + // 데이터 전달 객체에 대상 요소의 id를 추가합니다. + ev.dataTransfer.setData("text/plain", ev.target.id); } ``` @@ -73,7 +74,7 @@ function dragstart_handler(ev) { ev.dataTransfer.setData("text/plain", ev.target.id); } - window.addEventListener('DOMContentLoaded', () => { + window.addEventListener("DOMContentLoaded", () => { // id를 통해 element를 가져옵니다. const element = document.getElementById("p1"); // 'dragstart' 이벤트 리스터를 추가합니다. @@ -112,7 +113,7 @@ function dragstart_handler(ev) { // 드래그 이미지로 사용할 이미지를 만듭니다. // 참고: "example.gif"를 존재하는 이미지로 바꾸지 않으면 기본 드래그 이미지를 사용합니다. var img = new Image(); - img.src = 'example.gif'; + img.src = "example.gif"; ev.dataTransfer.setDragImage(img, 10, 10); } ``` @@ -150,20 +151,25 @@ function dragstart_handler(ev) { ```html -

    Drop Zone

    +

    + Drop Zone +

    ``` 각 핸들러는 {{domxref("Event.preventDefault","preventDefault()")}} 를 호출해 추가적인 이벤트 (터치 이벤트나 포인터 이벤트) 가 일어나지 않도록 합니다. @@ -178,26 +184,33 @@ function drop_handler(ev) { ```html -

    This element is draggable.

    -
    Drop Zone
    +

    + This element is draggable. +

    +
    + Drop Zone +
    ``` 더 많은 정보를 위해 [Performing a Drop](/ko/docs/Web/Guide/HTML/Drag_operations#drop)을 보십시오. diff --git a/files/ko/web/api/htmlcanvaselement/getcontext/index.md b/files/ko/web/api/htmlcanvaselement/getcontext/index.md index 7912940e64ec24..78186b5892861d 100644 --- a/files/ko/web/api/htmlcanvaselement/getcontext/index.md +++ b/files/ko/web/api/htmlcanvaselement/getcontext/index.md @@ -2,6 +2,7 @@ title: HTMLCanvasElement.getContext() slug: Web/API/HTMLCanvasElement/getContext --- + {{APIRef("Canvas API")}} **`HTMLCanvasElement.getContext()`** 메소드는 캔버스의 드로잉 컨텍스트를 반환합니다. 컨텍스트 식별자가 지원되지 않을 경우 {{jsxref("null")}}을 반환합니다. @@ -65,8 +66,8 @@ var ctx = canvas.getContext(contextType, contextAttributes); 다음 코드를 사용해 캔버스의 `2d` 컨텍스트를 얻을 수 있습니다. ```js -var canvas = document.getElementById('canvas'); -var ctx = canvas.getContext('2d'); +var canvas = document.getElementById("canvas"); +var ctx = canvas.getContext("2d"); console.log(ctx); // CanvasRenderingContext2D { ... } ``` diff --git a/files/ko/web/api/htmlcanvaselement/index.md b/files/ko/web/api/htmlcanvaselement/index.md index 55a8b49e0e95a1..8940b30309fabd 100644 --- a/files/ko/web/api/htmlcanvaselement/index.md +++ b/files/ko/web/api/htmlcanvaselement/index.md @@ -2,6 +2,7 @@ title: HTMLCanvasElement slug: Web/API/HTMLCanvasElement --- + {{APIRef("Canvas API")}} **`HTMLCanvasElement`** 인터페이스는 \ 요소의 레이아웃이나 프레젠테이션을 조작하는 여러 프로퍼티와 메서드들을 제공합니다. 또한 `HTMLCanvasElement` 인터페이스는 {{domxref("HTMLElement")}} 인터페이스의 여러 프로퍼티와 메서드들을 상속받습니다. diff --git a/files/ko/web/api/htmlcollection/item/index.md b/files/ko/web/api/htmlcollection/item/index.md index e697c2b1096581..622d6526183082 100644 --- a/files/ko/web/api/htmlcollection/item/index.md +++ b/files/ko/web/api/htmlcollection/item/index.md @@ -12,7 +12,7 @@ slug: Web/API/HTMLCollection/item ## Syntax ```js -var element = HTMLCollection.item(index) +var element = HTMLCollection.item(index); ``` ### 파라미터 @@ -31,9 +31,9 @@ var element = HTMLCollection.item(index) ## Example ```js -var c = document.images; // HTMLCollection입니다 -var img0 = c.item(0); // 이렇게 item() 메소드를 이용할 수 있지만 -var img1 = c[1]; // 이렇게 표기하는게 쉽고 더 보편적입니다 +var c = document.images; // HTMLCollection입니다 +var img0 = c.item(0); // 이렇게 item() 메소드를 이용할 수 있지만 +var img1 = c[1]; // 이렇게 표기하는게 쉽고 더 보편적입니다 ``` ## 브라우저 호환성 diff --git a/files/ko/web/api/htmldocument/index.md b/files/ko/web/api/htmldocument/index.md index 932fc83426becd..f626606e69ebc7 100644 --- a/files/ko/web/api/htmldocument/index.md +++ b/files/ko/web/api/htmldocument/index.md @@ -2,6 +2,7 @@ title: HTMLDocument slug: Web/API/HTMLDocument --- + {{ APIRef("HTML DOM") }} **`HTMLDocument`**은 일반적인 (XML) 문서에서 기본적으로 존재하지 않는 특별한 프로퍼티와 메소드에 접근을 제공하는 DOM의 추상 인터페이스입니다. 특히 HTML 문서와 엘리먼트에 관련된 기능을 추가해줍니다. diff --git a/files/ko/web/api/htmlelement/accesskey/index.md b/files/ko/web/api/htmlelement/accesskey/index.md index a366a6d0cb45e1..adeaf6cc7cf7fc 100644 --- a/files/ko/web/api/htmlelement/accesskey/index.md +++ b/files/ko/web/api/htmlelement/accesskey/index.md @@ -3,6 +3,7 @@ title: Element.accessKey slug: Web/API/HTMLElement/accessKey original_slug: Web/API/Element/accessKey --- + {{APIRef("DOM")}} **`Element.accessKey`** 속성은 주어진 사용자가 눌러 주어진 엘리먼트로 이동할 수 있는 키 입력 세트입니다. diff --git a/files/ko/web/api/htmlelement/accesskeylabel/index.md b/files/ko/web/api/htmlelement/accesskeylabel/index.md index 0ded8af5ead433..f7211ad812d5e3 100644 --- a/files/ko/web/api/htmlelement/accesskeylabel/index.md +++ b/files/ko/web/api/htmlelement/accesskeylabel/index.md @@ -10,7 +10,7 @@ slug: Web/API/HTMLElement/accessKeyLabel ## 구문 ```js -label = element.accessKeyLabel +label = element.accessKeyLabel; ``` ## 예시 @@ -18,16 +18,16 @@ label = element.accessKeyLabel ### JavaScript ```js -var node = document.getElementById('btn1'); +var node = document.getElementById("btn1"); if (node.accessKeyLabel) { - node.title += ' [' + node.accessKeyLabel + ']'; + node.title += " [" + node.accessKeyLabel + "]"; } else { - node.title += ' [' + node.accessKey + ']'; + node.title += " [" + node.accessKey + "]"; } node.onclick = function () { - var p = document.createElement('p'); - p.textContent = 'Clicked!'; + var p = document.createElement("p"); + p.textContent = "Clicked!"; node.parentNode.appendChild(p); }; ``` diff --git a/files/ko/web/api/htmlelement/click/index.md b/files/ko/web/api/htmlelement/click/index.md index 0c5b3cbcabee1a..7fd551625e7141 100644 --- a/files/ko/web/api/htmlelement/click/index.md +++ b/files/ko/web/api/htmlelement/click/index.md @@ -12,7 +12,7 @@ slug: Web/API/HTMLElement/click ## 구문 ```js -element.click() +element.click(); ``` ## 명세 diff --git a/files/ko/web/api/htmlelement/contenteditable/index.md b/files/ko/web/api/htmlelement/contenteditable/index.md index 8a88497e23a388..cef984713bcc1c 100644 --- a/files/ko/web/api/htmlelement/contenteditable/index.md +++ b/files/ko/web/api/htmlelement/contenteditable/index.md @@ -2,6 +2,7 @@ title: HTMLElement.contentEditable slug: Web/API/HTMLElement/contentEditable --- + {{APIRef("HTML DOM")}} {{domxref("HTMLElement")}} 요소의 **`contenteditable`** 속성은 요소의 편집 가능 여부를 나타냅니다. 열거형 속성으로, 다음 중 하나의 값을 가질 수 있습니다. diff --git a/files/ko/web/api/htmlelement/drag_event/index.md b/files/ko/web/api/htmlelement/drag_event/index.md index b10342317568ba..a8140721866c3b 100644 --- a/files/ko/web/api/htmlelement/drag_event/index.md +++ b/files/ko/web/api/htmlelement/drag_event/index.md @@ -1,5 +1,5 @@ --- -title: 'Document: drag 이벤트' +title: "Document: drag 이벤트" slug: Web/API/HTMLElement/drag_event original_slug: Web/API/Document/drag_event --- @@ -43,9 +43,7 @@ original_slug: Web/API/Document/drag_event ```html
    -
    - 드래그 가능 -
    +
    드래그 가능
    ``` @@ -76,7 +74,7 @@ body { } .dragging { - opacity: .5; + opacity: 0.5; } ``` @@ -86,43 +84,47 @@ body { let dragged; /* 드래그 가능한 대상에서 발생하는 이벤트 */ -document.addEventListener("drag", event => { +document.addEventListener("drag", (event) => { console.log("dragging"); }); -document.addEventListener("dragstart", event => { +document.addEventListener("dragstart", (event) => { // 드래그한 요소에 대한 참조 저장 dragged = event.target; // 반투명하게 만들기 event.target.classList.add("dragging"); }); -document.addEventListener("dragend", event => { +document.addEventListener("dragend", (event) => { // 투명도 초기화 event.target.classList.remove("dragging"); }); /* 드롭 대상에서 발생하는 이벤트 */ -document.addEventListener("dragover", event => { - // 드롭을 허용하기 위해 기본 동작 취소 - event.preventDefault(); -}, false); - -document.addEventListener("dragenter", event => { +document.addEventListener( + "dragover", + (event) => { + // 드롭을 허용하기 위해 기본 동작 취소 + event.preventDefault(); + }, + false, +); + +document.addEventListener("dragenter", (event) => { // 드래그 가능한 요소가 대상 위로 오면 강조 if (event.target.classList.contains("dropzone")) { event.target.classList.add("dragover"); } }); -document.addEventListener("dragleave", event => { +document.addEventListener("dragleave", (event) => { // 드래그 가능한 요소가 대상 밖으로 나가면 강조 제거 if (event.target.classList.contains("dropzone")) { event.target.classList.remove("dragover"); } }); -document.addEventListener("drop", event => { +document.addEventListener("drop", (event) => { // 일부 요소의 링크 열기와 같은 기본 동작 취소 event.preventDefault(); // 드래그한 요소를 선택한 드롭 대상으로 이동 diff --git a/files/ko/web/api/htmlelement/dragend_event/index.md b/files/ko/web/api/htmlelement/dragend_event/index.md index 1a8b6aa67ad290..79173db8bd03eb 100644 --- a/files/ko/web/api/htmlelement/dragend_event/index.md +++ b/files/ko/web/api/htmlelement/dragend_event/index.md @@ -1,5 +1,5 @@ --- -title: 'Document: dragend 이벤트' +title: "Document: dragend 이벤트" slug: Web/API/HTMLElement/dragend_event original_slug: Web/API/Document/dragend_event --- @@ -49,9 +49,7 @@ original_slug: Web/API/Document/dragend_event ```html
    -
    - 드래그 가능 -
    +
    드래그 가능
    ``` @@ -77,19 +75,19 @@ body { } .dragging { - opacity: .5; + opacity: 0.5; } ``` #### JavaScript ```js -document.addEventListener("dragstart", event => { +document.addEventListener("dragstart", (event) => { // 반투명하게 만들기 event.target.classList.add("dragging"); }); -document.addEventListener("dragend", event => { +document.addEventListener("dragend", (event) => { // 불투명하게 초기화 event.target.classList.remove("dragging"); }); diff --git a/files/ko/web/api/htmlelement/dragstart_event/index.md b/files/ko/web/api/htmlelement/dragstart_event/index.md index 18d9cca3ca20d8..073145c7ea1288 100644 --- a/files/ko/web/api/htmlelement/dragstart_event/index.md +++ b/files/ko/web/api/htmlelement/dragstart_event/index.md @@ -1,5 +1,5 @@ --- -title: 'Document: dragstart 이벤트' +title: "Document: dragstart 이벤트" slug: Web/API/HTMLElement/dragstart_event original_slug: Web/API/Document/dragstart_event --- @@ -49,9 +49,7 @@ original_slug: Web/API/Document/dragstart_event ```html
    -
    - 드래그 가능 -
    +
    드래그 가능
    ``` @@ -77,19 +75,19 @@ body { } .dragging { - opacity: .5; + opacity: 0.5; } ``` #### JavaScript ```js -document.addEventListener("dragstart", event => { +document.addEventListener("dragstart", (event) => { // 반투명하게 만들기 event.target.classList.add("dragging"); }); -document.addEventListener("dragend", event => { +document.addEventListener("dragend", (event) => { // 불투명하게 초기화 event.target.classList.remove("dragging"); }); diff --git a/files/ko/web/api/htmlelement/index.md b/files/ko/web/api/htmlelement/index.md index cc4f92eea8f857..2b2e0d05a86ebc 100644 --- a/files/ko/web/api/htmlelement/index.md +++ b/files/ko/web/api/htmlelement/index.md @@ -118,80 +118,80 @@ _부모인 {{domxref("Element")}}의 메서드를 상속합니다._ Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. -- [`invalid`](/en-US/docs/Web/API/HTMLElement/invalid_event) +- [`invalid`](/ko/docs/Web/API/HTMLElement/invalid_event) - : Fired when an element does not satisfy its constraints during constraint validation. - Also available via the [`oninvalid`](/en-US/docs/Web/API/GlobalEventHandlers/oninvalid) property. + Also available via the [`oninvalid`](/ko/docs/Web/API/GlobalEventHandlers/oninvalid) property. ### Animation events -- [`animationcancel`](/en-US/docs/Web/API/HTMLElement/animationcancel_event) +- [`animationcancel`](/ko/docs/Web/API/HTMLElement/animationcancel_event) - : Fired when an animation unexpectedly aborts. - Also available via the [`onanimationcancel`](/en-US/docs/Web/API/GlobalEventHandlers/onanimationcancel) property. -- [`animationend`](/en-US/docs/Web/API/HTMLElement/animationend_event) + Also available via the [`onanimationcancel`](/ko/docs/Web/API/GlobalEventHandlers/onanimationcancel) property. +- [`animationend`](/ko/docs/Web/API/HTMLElement/animationend_event) - : Fired when an animation has completed normally. - Also available via the [`onanimationend`](/en-US/docs/Web/API/GlobalEventHandlers/onanimationend) property. -- [`animationiteration`](/en-US/docs/Web/API/HTMLElement/animationiteration_event) + Also available via the [`onanimationend`](/ko/docs/Web/API/GlobalEventHandlers/onanimationend) property. +- [`animationiteration`](/ko/docs/Web/API/HTMLElement/animationiteration_event) - : Fired when an animation iteration has completed. - Also available via the [`onanimationiteration`](/en-US/docs/Web/API/GlobalEventHandlers/onanimationiteration) property. -- [`animationstart`](/en-US/docs/Web/API/HTMLElement/animationstart_event) + Also available via the [`onanimationiteration`](/ko/docs/Web/API/GlobalEventHandlers/onanimationiteration) property. +- [`animationstart`](/ko/docs/Web/API/HTMLElement/animationstart_event) - : Fired when an animation starts. - Also available via the [`onanimationstart`](/en-US/docs/Web/API/GlobalEventHandlers/onanimationstart) property. + Also available via the [`onanimationstart`](/ko/docs/Web/API/GlobalEventHandlers/onanimationstart) property. ### Input events -- [`beforeinput`](/en-US/docs/Web/API/HTMLElement/beforeinput_event) +- [`beforeinput`](/ko/docs/Web/API/HTMLElement/beforeinput_event) - : Fired when the value of an {{HTMLElement("input")}}, {{HTMLElement("select")}}, or {{HTMLElement("textarea")}} element is about to be modified. -- [`input`](/en-US/docs/Web/API/HTMLElement/input_event) +- [`input`](/ko/docs/Web/API/HTMLElement/input_event) - : Fired when the `value` of an {{HTMLElement("input")}}, {{HTMLElement("select")}}, or {{HTMLElement("textarea")}} element has been changed. - Also available via the [`oninput`](/en-US/docs/Web/API/GlobalEventHandlers/oninput) property. + Also available via the [`oninput`](/ko/docs/Web/API/GlobalEventHandlers/oninput) property. ### Pointer events -- [`gotpointercapture`](/en-US/docs/Web/API/HTMLElement/gotpointercapture_event) - - : Fired when an element captures a pointer using [`setPointerCapture()`](/en-US/docs/Web/API/Element/setPointerCapture). - Also available via the [`ongotpointercapture`](/en-US/docs/Web/API/GlobalEventHandlers/ongotpointercapture) property. -- [`lostpointercapture`](/en-US/docs/Web/API/HTMLElement/lostpointercapture_event) +- [`gotpointercapture`](/ko/docs/Web/API/HTMLElement/gotpointercapture_event) + - : Fired when an element captures a pointer using [`setPointerCapture()`](/ko/docs/Web/API/Element/setPointerCapture). + Also available via the [`ongotpointercapture`](/ko/docs/Web/API/GlobalEventHandlers/ongotpointercapture) property. +- [`lostpointercapture`](/ko/docs/Web/API/HTMLElement/lostpointercapture_event) - : Fired when a [captured pointer](/ko/docs/Web/API/Pointer_events#Pointer_capture) is released. - Also available via the [`onlostpointercapture`](/en-US/docs/Web/API/GlobalEventHandlers/onlostpointercapture) property. -- [`pointercancel`](/en-US/docs/Web/API/HTMLElement/pointercancel_event) + Also available via the [`onlostpointercapture`](/ko/docs/Web/API/GlobalEventHandlers/onlostpointercapture) property. +- [`pointercancel`](/ko/docs/Web/API/HTMLElement/pointercancel_event) - : Fired when a pointer event is canceled. - Also available via the [`onpointercancel`](/en-US/docs/Web/API/GlobalEventHandlers/onpointercancel) property. -- [`pointerdown`](/en-US/docs/Web/API/HTMLElement/pointerdown_event) + Also available via the [`onpointercancel`](/ko/docs/Web/API/GlobalEventHandlers/onpointercancel) property. +- [`pointerdown`](/ko/docs/Web/API/HTMLElement/pointerdown_event) - : Fired when a pointer becomes active. - Also available via the [`onpointerdown`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerdown) property. -- [`pointerenter`](/en-US/docs/Web/API/HTMLElement/pointerenter_event) + Also available via the [`onpointerdown`](/ko/docs/Web/API/GlobalEventHandlers/onpointerdown) property. +- [`pointerenter`](/ko/docs/Web/API/HTMLElement/pointerenter_event) - : Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants. - Also available via the [`onpointerenter`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerenter) property. -- [`pointerleave`](/en-US/docs/Web/API/HTMLElement/pointerleave_event) + Also available via the [`onpointerenter`](/ko/docs/Web/API/GlobalEventHandlers/onpointerenter) property. +- [`pointerleave`](/ko/docs/Web/API/HTMLElement/pointerleave_event) - : Fired when a pointer is moved out of the hit test boundaries of an element. - Also available via the [`onpointerleave`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerleave) property. -- [`pointermove`](/en-US/docs/Web/API/HTMLElement/pointermove_event) + Also available via the [`onpointerleave`](/ko/docs/Web/API/GlobalEventHandlers/onpointerleave) property. +- [`pointermove`](/ko/docs/Web/API/HTMLElement/pointermove_event) - : Fired when a pointer changes coordinates. - Also available via the [`onpointermove`](/en-US/docs/Web/API/GlobalEventHandlers/onpointermove) property. -- [`pointerout`](/en-US/docs/Web/API/HTMLElement/pointerout_event) + Also available via the [`onpointermove`](/ko/docs/Web/API/GlobalEventHandlers/onpointermove) property. +- [`pointerout`](/ko/docs/Web/API/HTMLElement/pointerout_event) - : Fired when a pointer is moved out of the _hit test_ boundaries of an element (among other reasons). - Also available via the [`onpointerout`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerout) property. -- [`pointerover`](/en-US/docs/Web/API/HTMLElement/pointerover_event) + Also available via the [`onpointerout`](/ko/docs/Web/API/GlobalEventHandlers/onpointerout) property. +- [`pointerover`](/ko/docs/Web/API/HTMLElement/pointerover_event) - : Fired when a pointer is moved into an element's hit test boundaries. - Also available via the [`onpointerover`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerover) property. -- [`pointerup`](/en-US/docs/Web/API/HTMLElement/pointerup_event) + Also available via the [`onpointerover`](/ko/docs/Web/API/GlobalEventHandlers/onpointerover) property. +- [`pointerup`](/ko/docs/Web/API/HTMLElement/pointerup_event) - : Fired when a pointer is no longer active. - Also available via the [`onpointerup`](/en-US/docs/Web/API/GlobalEventHandlers/onpointerup) property. + Also available via the [`onpointerup`](/ko/docs/Web/API/GlobalEventHandlers/onpointerup) property. ### Transition events -- [`transitioncancel`](/en-US/docs/Web/API/HTMLElement/transitioncancel_event) +- [`transitioncancel`](/ko/docs/Web/API/HTMLElement/transitioncancel_event) - : Fired when a [CSS transition](/ko/docs/CSS/Using_CSS_transitions) is canceled. - Also available via the [`ontransitioncancel`](/en-US/docs/Web/API/GlobalEventHandlers/ontransitioncancel) property. -- [`transitionend`](/en-US/docs/Web/API/HTMLElement/transitionend_event) + Also available via the [`ontransitioncancel`](/ko/docs/Web/API/GlobalEventHandlers/ontransitioncancel) property. +- [`transitionend`](/ko/docs/Web/API/HTMLElement/transitionend_event) - : Fired when a [CSS transition](/ko/docs/CSS/Using_CSS_transitions) has completed. - Also available via the [`ontransitionend`](/en-US/docs/Web/API/GlobalEventHandlers/ontransitionend) property. -- [`transitionrun`](/en-US/docs/Web/API/HTMLElement/transitionrun_event) + Also available via the [`ontransitionend`](/ko/docs/Web/API/GlobalEventHandlers/ontransitionend) property. +- [`transitionrun`](/ko/docs/Web/API/HTMLElement/transitionrun_event) - : Fired when a [CSS transition](/ko/docs/CSS/Using_CSS_transitions) is first created. - Also available via the [`ontransitionrun`](/en-US/docs/Web/API/GlobalEventHandlers/ontransitionrun) property. -- [`transitionstart`](/en-US/docs/Web/API/HTMLElement/transitionstart_event) + Also available via the [`ontransitionrun`](/ko/docs/Web/API/GlobalEventHandlers/ontransitionrun) property. +- [`transitionstart`](/ko/docs/Web/API/HTMLElement/transitionstart_event) - : Fired when a [CSS transition](/ko/docs/CSS/Using_CSS_transitions) has actually started. - Also available via the [`ontransitionstart`](/en-US/docs/Web/API/GlobalEventHandlers/ontransitionstart) property. + Also available via the [`ontransitionstart`](/ko/docs/Web/API/GlobalEventHandlers/ontransitionstart) property. ## 명세 diff --git a/files/ko/web/api/htmlelement/innertext/index.md b/files/ko/web/api/htmlelement/innertext/index.md index fecf0e7ca5a9cb..d4308295478a94 100644 --- a/files/ko/web/api/htmlelement/innertext/index.md +++ b/files/ko/web/api/htmlelement/innertext/index.md @@ -3,6 +3,7 @@ title: HTMLElement.innerText slug: Web/API/HTMLElement/innerText original_slug: Web/API/Node/innerText --- + {{APIRef("HTML DOM")}} {{domxref("HTMLElement")}} 인터페이스의 **`innerText`** 속성은 요소와 그 자손의 렌더링 된 텍스트 콘텐츠를 나타냅니다. `innerText`는 사용자가 커서를 이용해 요소의 콘텐츠를 선택하고 클립보드에 복사했을 때 얻을 수 있는 텍스트의 근삿값을 제공합니다. @@ -12,8 +13,8 @@ original_slug: Web/API/Node/innerText ## 구문 ```js -const renderedText = htmlElement.innerText -htmlElement.innerText = string +const renderedText = htmlElement.innerText; +htmlElement.innerText = string; ``` ### 값 @@ -29,8 +30,12 @@ htmlElement.innerText = string ```html

    원본 요소:

    - -아래에서
    이 글을
    어떻게 인식하는지 살펴보세요. + + 아래에서
    이 글을
    어떻게 인식하는지 살펴보세요. 숨겨진 글

    textContent 결과:

    @@ -42,9 +47,9 @@ htmlElement.innerText = string ### JavaScript ```js -const source = document.getElementById('source'); -const textContentOutput = document.getElementById('textContentOutput'); -const innerTextOutput = document.getElementById('innerTextOutput'); +const source = document.getElementById("source"); +const textContentOutput = document.getElementById("textContentOutput"); +const innerTextOutput = document.getElementById("innerTextOutput"); textContentOutput.innerHTML = source.textContent; innerTextOutput.innerHTML = source.innerText; diff --git a/files/ko/web/api/htmlelement/input_event/index.md b/files/ko/web/api/htmlelement/input_event/index.md index 83e57af5411e7b..910df54097fcbd 100644 --- a/files/ko/web/api/htmlelement/input_event/index.md +++ b/files/ko/web/api/htmlelement/input_event/index.md @@ -1,5 +1,5 @@ --- -title: 'HTMLElement: input 이벤트' +title: "HTMLElement: input 이벤트" short-title: input slug: Web/API/HTMLElement/input_event l10n: @@ -39,17 +39,17 @@ oninput = (event) => {}; ### HTML ```html - +

    ``` ### JavaScript ```js -const input = document.querySelector('input'); -const log = document.getElementById('values'); +const input = document.querySelector("input"); +const log = document.getElementById("values"); -input.addEventListener('input', updateValue); +input.addEventListener("input", updateValue); function updateValue(e) { log.textContent = e.target.value; diff --git a/files/ko/web/api/htmlelement/offsetparent/index.md b/files/ko/web/api/htmlelement/offsetparent/index.md index 8b0ab502c3d1e3..8ef7011678f60e 100644 --- a/files/ko/web/api/htmlelement/offsetparent/index.md +++ b/files/ko/web/api/htmlelement/offsetparent/index.md @@ -2,6 +2,7 @@ title: HTMLElement.offsetParent slug: Web/API/HTMLElement/offsetParent --- + {{ APIRef("HTML DOM") }} **`HTMLElement.offsetParent`** 읽기전용 프라퍼티는 가장 가까운 (포함 계층에서 가장 가까운) 위치가 정해진 포함하는 엘리먼트 객체에 대한 참조를 반환한다. `offsetParent`는 엘리먼트의 위치가 정해지지 않으면 가장 가까운 테이블 또는 테이블 셀, 루트 엘리먼트 (표준 준수 모드에서는 `html`; quirks 렌더링 모드에서는 `body`) 를 반환한다. diff --git a/files/ko/web/api/htmlelement/outertext/index.md b/files/ko/web/api/htmlelement/outertext/index.md index e5fa2cda726f75..273a27f6c1f2f7 100644 --- a/files/ko/web/api/htmlelement/outertext/index.md +++ b/files/ko/web/api/htmlelement/outertext/index.md @@ -2,6 +2,7 @@ title: HTMLElement.outerText slug: Web/API/HTMLElement/outerText --- + {{APIRef("DOM")}} {{ Non-standard_header() }} diff --git a/files/ko/web/api/htmlformelement/elements/index.md b/files/ko/web/api/htmlformelement/elements/index.md index 452fa2e2d7a6c7..1a8b2f24f28a0e 100644 --- a/files/ko/web/api/htmlformelement/elements/index.md +++ b/files/ko/web/api/htmlformelement/elements/index.md @@ -41,9 +41,9 @@ HTML 5 이전에는 `HTMLFormControlsCollection`을 기반으로 하는 {{domxre ```html
    - - - + + +
    ``` diff --git a/files/ko/web/api/htmlformelement/index.md b/files/ko/web/api/htmlformelement/index.md index e5fd65b58c72d8..4237c9098785db 100644 --- a/files/ko/web/api/htmlformelement/index.md +++ b/files/ko/web/api/htmlformelement/index.md @@ -60,15 +60,15 @@ _This interface also inherits methods from its parent, {{domxref("HTMLElement")} Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. -- [`formdata`](/en-US/docs/Web/API/HTMLFormElement/formdata_event) +- [`formdata`](/ko/docs/Web/API/HTMLFormElement/formdata_event) - : The `formdata` event fires after the entry list representing the form's data is constructed. - Also available via the [`onformdata`](/en-US/docs/Web/API/GlobalEventHandlers/onformdata) property. -- [`reset`](/en-US/docs/Web/API/HTMLFormElement/reset_event) + Also available via the [`onformdata`](/ko/docs/Web/API/GlobalEventHandlers/onformdata) property. +- [`reset`](/ko/docs/Web/API/HTMLFormElement/reset_event) - : The `reset` event fires when a form is reset. - Also available via the [`onreset`](/en-US/docs/Web/API/GlobalEventHandlers/onreset) property. -- [`submit`](/en-US/docs/Web/API/HTMLFormElement/submit_event) + Also available via the [`onreset`](/ko/docs/Web/API/GlobalEventHandlers/onreset) property. +- [`submit`](/ko/docs/Web/API/HTMLFormElement/submit_event) - : The `submit` event fires when a form is submitted. - Also available via the [`onsubmit`](/en-US/docs/Web/API/GlobalEventHandlers/onsubmit) property. + Also available via the [`onsubmit`](/ko/docs/Web/API/GlobalEventHandlers/onsubmit) property. ## Usage notes @@ -110,43 +110,59 @@ No other elements are included in the list returned by `elements`, which makes i Creating a new form element, modifying its attributes, then submitting it: ```js -var f = document.createElement("form");// Create a form -document.body.appendChild(f); // Add it to the document body -f.action = "/cgi-bin/some.cgi"; // Add action and method attributes +var f = document.createElement("form"); // Create a form +document.body.appendChild(f); // Add it to the document body +f.action = "/cgi-bin/some.cgi"; // Add action and method attributes f.method = "POST"; -f.submit(); // Call the form's submit method +f.submit(); // Call the form's submit method ``` Extract information from a form element and set some of its attributes: ```html
    -

    Press "Info" for form details, or "Set" to change those details.

    -

    - - - -

    - - +

    Press "Info" for form details, or "Set" to change those details.

    +

    + + + +

    + +
    ``` @@ -156,34 +172,52 @@ Submit a form into a new window: ```html - - -Example new-window form submission - - - -
    -

    -

    -

    - -
    - Pet preference -

    -

    -
    - -
    - Owned vehicles - -

    -

    -
    - -

    -
    - - + + + Example new-window form submission + + +
    +

    + +

    +

    + +

    +

    + +

    + +
    + Pet preference +

    + +

    +

    + +

    +
    + +
    + Owned vehicles + +

    + +

    +

    + +

    +
    + +

    +
    + ``` diff --git a/files/ko/web/api/htmlformelement/submit_event/index.md b/files/ko/web/api/htmlformelement/submit_event/index.md index 4c135e4d4b4e97..80717d146a1ee8 100644 --- a/files/ko/web/api/htmlformelement/submit_event/index.md +++ b/files/ko/web/api/htmlformelement/submit_event/index.md @@ -22,23 +22,23 @@ window.onsubmit = funcRef; ```html - - - -
    - -
    -
    - + + + +
    + +
    +
    + ``` diff --git a/files/ko/web/api/htmlinputelement/select_event/index.md b/files/ko/web/api/htmlinputelement/select_event/index.md index 9cf86419d4ea80..85054a2ef3870a 100644 --- a/files/ko/web/api/htmlinputelement/select_event/index.md +++ b/files/ko/web/api/htmlinputelement/select_event/index.md @@ -1,5 +1,5 @@ --- -title: 'Element: select event' +title: "Element: select event" slug: Web/API/HTMLInputElement/select_event original_slug: Web/API/Element/select_event --- @@ -8,11 +8,11 @@ original_slug: Web/API/Element/select_event **`select`** 이벤트는 어떤 텍스트가 선택되었을 때 발생됩니다. -| Bubbles | Yes | -| ---------------------- | ----------------------------------------------------------------------------------------------------- | -| Cancelable | No | +| Bubbles | Yes | +| ---------------------- | --------------------------------------------------------------------------------------- | +| Cancelable | No | | Interface | 유저 인터페이스로부터 발생된 경우 {{domxref("UIEvent")}}, 아니라면 {{domxref("Event")}} | -| Event handler property | {{domxref("GlobalEventHandlers.onselect", "onselect")}} | +| Event handler property | {{domxref("GlobalEventHandlers.onselect", "onselect")}} | The event is not available for all elements in all languages. For example, in HTML, `select` events can be dispatched only on form `{{HtmlElement('input/text', '<input type="text">')}}` and {{HtmlElement("textarea")}} elements. @@ -21,19 +21,22 @@ The event is not available for all elements in all languages. For example, in HT ### Selection logger ```html - +

    ``` ```js function logSelection(event) { - const log = document.getElementById('log'); - const selection = event.target.value.substring(event.target.selectionStart, event.target.selectionEnd); + const log = document.getElementById("log"); + const selection = event.target.value.substring( + event.target.selectionStart, + event.target.selectionEnd, + ); log.textContent = `You selected: ${selection}`; } -const input = document.querySelector('input'); -input.addEventListener('select', logSelection); +const input = document.querySelector("input"); +input.addEventListener("select", logSelection); ``` {{EmbedLiveSample("Selection_logger")}} diff --git a/files/ko/web/api/htmllielement/index.md b/files/ko/web/api/htmllielement/index.md index 9004fb08ff5ac7..55d9f2537190ee 100644 --- a/files/ko/web/api/htmllielement/index.md +++ b/files/ko/web/api/htmllielement/index.md @@ -2,6 +2,7 @@ title: HTMLLIElement slug: Web/API/HTMLLIElement --- + {{ APIRef("HTML DOM") }} **`HTMLLIElement`** 인터페이스는 리스트 엘리먼트를 조작하기 위한 특정 프로퍼티와 메소드들을 제공합니다. diff --git a/files/ko/web/api/htmlmediaelement/abort_event/index.md b/files/ko/web/api/htmlmediaelement/abort_event/index.md index b0013f0eb6a58b..f2aa1a5c48eb71 100644 --- a/files/ko/web/api/htmlmediaelement/abort_event/index.md +++ b/files/ko/web/api/htmlmediaelement/abort_event/index.md @@ -23,11 +23,11 @@ original_slug: Web/Events/abort ## 속성 -| 속성 | 타입 | 설명 | -| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `target` {{readonlyInline}} | [`EventTarget`](/ko/docs/Web/API/EventTarget) | 이벤트 타겟 (DOM tree의 최상위 타겟). | -| `type` {{readonlyInline}} | [`DOMString`](/ko/docs/Web/API/DOMString) | 이벤트의 타입 | -| `bubbles` {{readonlyInline}} | [`Boolean`](/ko/docs/Web/API/Boolean) | 이벤트가 버블링 되는지 안되는지 | -| `cancelable` {{readonlyInline}} | [`Boolean`](/ko/docs/Web/API/Boolean) | 이벤트가 취소 가능한지 아닌지 | -| `view` {{readonlyInline}} | [`WindowProxy`](/ko/docs/Web/API/WindowProxy) | [`document.defaultView`](/ko/docs/Web/API/Document/defaultView) (document의 `window` ) | -| `detail` {{readonlyInline}} | `long` (`float`) | 0. | +| 속성 | 타입 | 설명 | +| ------------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------- | +| `target` {{readonlyInline}} | [`EventTarget`](/ko/docs/Web/API/EventTarget) | 이벤트 타겟 (DOM tree의 최상위 타겟). | +| `type` {{readonlyInline}} | [`DOMString`](/ko/docs/Web/API/DOMString) | 이벤트의 타입 | +| `bubbles` {{readonlyInline}} | [`Boolean`](/ko/docs/Web/API/Boolean) | 이벤트가 버블링 되는지 안되는지 | +| `cancelable` {{readonlyInline}} | [`Boolean`](/ko/docs/Web/API/Boolean) | 이벤트가 취소 가능한지 아닌지 | +| `view` {{readonlyInline}} | [`WindowProxy`](/ko/docs/Web/API/WindowProxy) | [`document.defaultView`](/ko/docs/Web/API/Document/defaultView) (document의 `window` ) | +| `detail` {{readonlyInline}} | `long` (`float`) | 0. | diff --git a/files/ko/web/api/htmlmediaelement/autoplay/index.md b/files/ko/web/api/htmlmediaelement/autoplay/index.md index 902218cd877225..b16b6843ac6610 100644 --- a/files/ko/web/api/htmlmediaelement/autoplay/index.md +++ b/files/ko/web/api/htmlmediaelement/autoplay/index.md @@ -2,6 +2,7 @@ title: HTMLMediaElement.autoplay slug: Web/API/HTMLMediaElement/autoplay --- + {{APIRef("HTML DOM")}} **`HTMLMediaElement.autoplay`** 프로퍼티는 {{htmlattrxref("autoplay", "video")}} HTML 어트리뷰트의 값을 반환합니다. 이 프로퍼티는 미디어가 문제 없이 재생 가능한 상황이 되면 자동 재생 여부를 결정합니다. @@ -32,14 +33,15 @@ var autoplay = HTMLMediaElement.autoplay; ```html ``` ```js // Disable autoplay (recommended) // false is the default value -document.querySelector('#video').autoplay = false; +document.querySelector("#video").autoplay = false; ``` ## 명세서 diff --git a/files/ko/web/api/htmlmediaelement/canplay_event/index.md b/files/ko/web/api/htmlmediaelement/canplay_event/index.md index 4fb9468b855948..42c15059a09e5b 100644 --- a/files/ko/web/api/htmlmediaelement/canplay_event/index.md +++ b/files/ko/web/api/htmlmediaelement/canplay_event/index.md @@ -1,7 +1,8 @@ --- -title: 'HTMLMediaElement: canplay' +title: "HTMLMediaElement: canplay" slug: Web/API/HTMLMediaElement/canplay_event --- + `canplay` 이벤트는 user agent 가 media 를 재생할 수 있을 때 발생된다. 그러나, 컨텐츠의 추가 버퍼링을 위한 정지 없이 media 를 끝까지 재생하기에는, 로드된 데이터가 충분하지 않을 것으로 추산한다. ## General info @@ -21,12 +22,12 @@ slug: Web/API/HTMLMediaElement/canplay_event ## Properties -| Property | Type | Description | -| ------------------------------------- | ------------------------------------ | ------------------------------------------------------ | +| Property | Type | Description | +| ------------------------------- | -------------------------- | ------------------------------------------------------ | | `target` {{readonlyInline}} | {{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). | -| `type` {{readonlyInline}} | {{domxref("DOMString")}} | The type of event. | -| `bubbles` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event normally bubbles or not. | -| `cancelable` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event is cancellable or not. | +| `type` {{readonlyInline}} | {{domxref("DOMString")}} | The type of event. | +| `bubbles` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event normally bubbles or not. | +| `cancelable` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event is cancellable or not. | ## Related Events diff --git a/files/ko/web/api/htmlmediaelement/canplaythrough_event/index.md b/files/ko/web/api/htmlmediaelement/canplaythrough_event/index.md index 90594e63cd918d..ae5a5602e4f9b5 100644 --- a/files/ko/web/api/htmlmediaelement/canplaythrough_event/index.md +++ b/files/ko/web/api/htmlmediaelement/canplaythrough_event/index.md @@ -1,7 +1,8 @@ --- -title: 'HTMLMediaElement: canplaythrough' +title: "HTMLMediaElement: canplaythrough" slug: Web/API/HTMLMediaElement/canplaythrough_event --- + `canplaythrough` 이벤트는 user agent 가 media 를 재생할 수 있을 때 발생되며, 컨텐츠의 추가 버퍼링을 위한 정지 없이 media 를 끝까지 재생하기에 로드된 데이터가 충분할 것으로 추산한다. ## General info @@ -21,12 +22,12 @@ slug: Web/API/HTMLMediaElement/canplaythrough_event ## Properties -| Property | Type | Description | -| ------------------------------------- | ------------------------------------ | ------------------------------------------------------ | +| Property | Type | Description | +| ------------------------------- | -------------------------- | ------------------------------------------------------ | | `target` {{readonlyInline}} | {{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). | -| `type` {{readonlyInline}} | {{domxref("DOMString")}} | The type of event. | -| `bubbles` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event normally bubbles or not. | -| `cancelable` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event is cancellable or not. | +| `type` {{readonlyInline}} | {{domxref("DOMString")}} | The type of event. | +| `bubbles` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event normally bubbles or not. | +| `cancelable` {{readonlyInline}} | {{jsxref("Boolean")}} | Whether the event is cancellable or not. | ## Related Events diff --git a/files/ko/web/api/htmlmediaelement/index.md b/files/ko/web/api/htmlmediaelement/index.md index 23a758fc5e44b6..ef975467619b1b 100644 --- a/files/ko/web/api/htmlmediaelement/index.md +++ b/files/ko/web/api/htmlmediaelement/index.md @@ -155,7 +155,7 @@ _This interface also inherits methods from its ancestors {{domxref("HTMLElement" ## 이벤트 -_부모 엘리먼트 {{domxref("HTMLElement")}}에서 상속받은 이벤트와_ {{domxref('GlobalEventHandlers')}}에 정의된 이벤트를 믹스인합니다. [`addEventListener()`](/en-US/docs/Web/API/EventTarget/addEventListener)를 통해 이벤트를 수신하거나 `oneventname` 프로퍼티에 리스터를 할당하여 수신합니다. +_부모 엘리먼트 {{domxref("HTMLElement")}}에서 상속받은 이벤트와_ {{domxref('GlobalEventHandlers')}}에 정의된 이벤트를 믹스인합니다. [`addEventListener()`](/ko/docs/Web/API/EventTarget/addEventListener)를 통해 이벤트를 수신하거나 `oneventname` 프로퍼티에 리스터를 할당하여 수신합니다. - {{domxref("HTMLMediaElement.abort_event", 'abort')}} - : 에러 외의 원인으로 전체 리소스가 로드 되지 못했을 때 발생합니다. diff --git a/files/ko/web/api/htmlmediaelement/networkstate/index.md b/files/ko/web/api/htmlmediaelement/networkstate/index.md index f942cc209a1964..5f69267fc913df 100644 --- a/files/ko/web/api/htmlmediaelement/networkstate/index.md +++ b/files/ko/web/api/htmlmediaelement/networkstate/index.md @@ -14,12 +14,12 @@ l10n: 아래의 `unsigned short` 값 중 하나입니다. -| 상수 | 값 | 설명 | -| ------------------- | ----- | --------------------------------------------------------------------------------------- | -| `NETWORK_EMPTY` | 0 | 아직 데이터가 없습니다. 또한 `readyState`는 `HAVE_NOTHING`입니다. | -| `NETWORK_IDLE` | 1 | HTMLMediaElement가 활성 상태이고 리소스를 선택했지만 네트워크를 사용하고 있지 않습니다. | -| `NETWORK_LOADING` | 2 | 브라우저가 HTMLMediaElement 데이터를 다운로드하고 있습니다. | -| `NETWORK_NO_SOURCE` | 3 | HTMLMediaElement src를 찾을 수 없습니다. | +| 상수 | 값 | 설명 | +| ------------------- | --- | --------------------------------------------------------------------------------------- | +| `NETWORK_EMPTY` | 0 | 아직 데이터가 없습니다. 또한 `readyState`는 `HAVE_NOTHING`입니다. | +| `NETWORK_IDLE` | 1 | HTMLMediaElement가 활성 상태이고 리소스를 선택했지만 네트워크를 사용하고 있지 않습니다. | +| `NETWORK_LOADING` | 2 | 브라우저가 HTMLMediaElement 데이터를 다운로드하고 있습니다. | +| `NETWORK_NO_SOURCE` | 3 | HTMLMediaElement src를 찾을 수 없습니다. | ## 예제 diff --git a/files/ko/web/api/htmlselectelement/index.md b/files/ko/web/api/htmlselectelement/index.md index cb89056881aa77..1ba2960926b4b1 100644 --- a/files/ko/web/api/htmlselectelement/index.md +++ b/files/ko/web/api/htmlselectelement/index.md @@ -91,13 +91,13 @@ Listen to these events using {{domxref("EventTarget/addEventListener", "addEvent */ -var select = document.getElementById('s'); +var select = document.getElementById("s"); // return the index of the selected option console.log(select.selectedIndex); // 1 // return the value of the selected option -console.log(select.options[select.selectedIndex].value) // Second +console.log(select.options[select.selectedIndex].value); // Second ``` A better way to track changes to the user's selection is to watch for the {{domxref("HTMLElement/change_event", "change")}} event to occur on the ` @@ -40,12 +40,9 @@ The HTML that creates the selection box and the {{HTMLElement("option")}} elemen -
    - -

    -

    +
    + +

    ``` The ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - -
    - - - -
    -
    - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
      -
    -
    + + +

    IndexedDB Demo: storing blobs, e-publication example

    +
    +

    Works and tested with:

    +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + +
    + + +
    +
    + +
    + + + + + + + + + + + +
    + + + +
    + + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
      +
      ``` ### CSS Content @@ -841,20 +858,22 @@ input { ```js (function () { var COMPAT_ENVS = [ - ['Firefox', ">= 16.0"], - ['Google Chrome', - ">= 24.0 (you may need to get Google Chrome Canary), NO Blob storage support"] + ["Firefox", ">= 16.0"], + [ + "Google Chrome", + ">= 24.0 (you may need to get Google Chrome Canary), NO Blob storage support", + ], ]; - var compat = $('#compat'); + var compat = $("#compat"); compat.empty(); compat.append('
        '); - COMPAT_ENVS.forEach(function(val, idx, array) { - $('#compat-list').append('
      • ' + val[0] + ': ' + val[1] + '
      • '); + COMPAT_ENVS.forEach(function (val, idx, array) { + $("#compat-list").append("
      • " + val[0] + ": " + val[1] + "
      • "); }); - const DB_NAME = 'mdn-demo-indexeddb-epublications'; + const DB_NAME = "mdn-demo-indexeddb-epublications"; const DB_VERSION = 1; // Use a long long for this value (don't use a float) - const DB_STORE_NAME = 'publications'; + const DB_STORE_NAME = "publications"; var db; @@ -877,12 +896,14 @@ input { req.onupgradeneeded = function (evt) { console.log("openDb.onupgradeneeded"); - var store = evt.currentTarget.result.createObjectStore( - DB_STORE_NAME, { keyPath: 'id', autoIncrement: true }); - - store.createIndex('biblioid', 'biblioid', { unique: true }); - store.createIndex('title', 'title', { unique: false }); - store.createIndex('year', 'year', { unique: false }); + var store = evt.currentTarget.result.createObjectStore(DB_STORE_NAME, { + keyPath: "id", + autoIncrement: true, + }); + + store.createIndex("biblioid", "biblioid", { unique: true }); + store.createIndex("title", "title", { unique: false }); + store.createIndex("year", "year", { unique: false }); }; } @@ -896,9 +917,9 @@ input { } function clearObjectStore(store_name) { - var store = getObjectStore(DB_STORE_NAME, 'readwrite'); + var store = getObjectStore(DB_STORE_NAME, "readwrite"); var req = store.clear(); - req.onsuccess = function(evt) { + req.onsuccess = function (evt) { displayActionSuccess("Store cleared"); displayPubList(store); }; @@ -910,10 +931,9 @@ input { function getBlob(key, store, success_callback) { var req = store.get(key); - req.onsuccess = function(evt) { + req.onsuccess = function (evt) { var value = evt.target.result; - if (value) - success_callback(value.blob); + if (value) success_callback(value.blob); }; } @@ -923,12 +943,12 @@ input { function displayPubList(store) { console.log("displayPubList"); - if (typeof store == 'undefined') - store = getObjectStore(DB_STORE_NAME, 'readonly'); + if (typeof store == "undefined") + store = getObjectStore(DB_STORE_NAME, "readonly"); - var pub_msg = $('#pub-msg'); + var pub_msg = $("#pub-msg"); pub_msg.empty(); - var pub_list = $('#pub-list'); + var pub_list = $("#pub-list"); pub_list.empty(); // Resetting the iframe so that it doesn't display previous content newViewerFrame(); @@ -939,18 +959,21 @@ input { // transaction, and their results are returned in the same order. // Thus the count text below will be displayed before the actual pub list // (not that it is algorithmically important in this case). - req.onsuccess = function(evt) { - pub_msg.append('

        There are ' + evt.target.result + - ' record(s) in the object store.

        '); + req.onsuccess = function (evt) { + pub_msg.append( + "

        There are " + + evt.target.result + + " record(s) in the object store.

        ", + ); }; - req.onerror = function(evt) { + req.onerror = function (evt) { console.error("add error", this.error); displayActionFailure(this.error); }; var i = 0; req = store.openCursor(); - req.onsuccess = function(evt) { + req.onsuccess = function (evt) { var cursor = evt.target.result; // If the cursor is pointing at something, ask for the data @@ -959,21 +982,31 @@ input { req = store.get(cursor.key); req.onsuccess = function (evt) { var value = evt.target.result; - var list_item = $('
      • ' + - '[' + cursor.key + '] ' + - '(biblioid: ' + value.biblioid + ') ' + - value.title + - '
      • '); - if (value.year != null) - list_item.append(' - ' + value.year); - - if (value.hasOwnProperty('blob') && - typeof value.blob != 'undefined') { + var list_item = $( + "
      • " + + "[" + + cursor.key + + "] " + + "(biblioid: " + + value.biblioid + + ") " + + value.title + + "
      • ", + ); + if (value.year != null) list_item.append(" - " + value.year); + + if ( + value.hasOwnProperty("blob") && + typeof value.blob != "undefined" + ) { var link = $('File'); - link.on('click', function() { return false; }); - link.on('mouseenter', function(evt) { - setInViewer(evt.target.getAttribute('href')); }); - list_item.append(' / '); + link.on("click", function () { + return false; + }); + link.on("mouseenter", function (evt) { + setInViewer(evt.target.getAttribute("href")); + }); + list_item.append(" / "); list_item.append(link); } else { list_item.append(" / No attached file"); @@ -993,9 +1026,9 @@ input { } function newViewerFrame() { - var viewer = $('#pub-viewer'); + var viewer = $("#pub-viewer"); viewer.empty(); - var iframe = $(' + -
        -
        +
        ``` ### JavaScript @@ -98,8 +95,8 @@ var info = document.getElementById("info"); var target = frameDoc.getElementById("overview"); frameDoc.scrollingElement.scrollTop = target.offsetTop; -info.innerText = "스크롤 후 Y축 차이: " + - frame.contentWindow.pageYOffset + " 픽셀"; +info.innerText = + "스크롤 후 Y축 차이: " + frame.contentWindow.pageYOffset + " 픽셀"; ``` The JavaScript code begins by getting into `frame` and `info` the ` + ``` ### 예시: 전체 화면에서 자동 재생 허용 @@ -188,9 +189,7 @@ Feature-Policy: autoplay 'self'; fullscreen ` + ``` ### 예시: 특정 리소스만 자동 재생 허용 @@ -204,9 +203,11 @@ Feature-Policy: autoplay 'self' https://example.media 그리하여 {{HTMLElement("iframe")}} 역시 자신과 자식 프레임에서 자동 재생 정책을 사용하기 위해 아래와 같이 작성할 수 있습니다: ```html - ``` @@ -221,9 +222,7 @@ Feature-Policy: autoplay 'none' ` + ``` ## 유용한 사례 @@ -235,7 +234,7 @@ Feature-Policy: autoplay 'none' 자동 재생하는 대표적인 케이스는 본문이나 광고 또는 페이지의 메인 기능에 대한 프리뷰로써 짧은 비디오 클립을 자동으로 재생하는 경우입니다. 이 경우 두 가지 선택지가 있습니다: 오디오가 없는 비디오를 재생하거나, 오디오가 있어도 기본적으로 음소거하거나, 아래처럼요: ```html -` 닫기 태그가 필요하다는 것을 잊지 마세요. @@ -1740,20 +1739,18 @@ Safari 지원이 빠져있지만 WebM 컨테이너를 쓸 수 있고 Safari 사 1. WebM 컨테이너에 비디오 코덱은 AV1, 오디오 코덱은 Opus. AV1 인코딩 시 6.3 High level 같은 높은 전문 프로파일을 사용할 수 있다면 훌륭한 품질의 비디오를 4K/8K 해상도로 제공할 수 있습니다. 오디오 인코딩 시 Opus Fullband 프로파일로 48 kHz 샘플링 레이트를 사용한다면 사람이 들을 수 있는 거의 모든 주파수를 캡쳐할 수 있죠. - ```js - - ``` + ```js + + ``` 2. MP4 컨테이너에 비디오 코덱으로 [HEVC](#hevc_h.265) 를 쓰되 프로파일은 Main 4:2:2 10/12 bit 색 깊이, 최대 Main 4:4:4 16 bit 색 깊이 수준의 고급 Main 프로파일을 사용합니다. 비트레이트를 높이면 놀라운 색 재현과 훌륭한 그래픽 퀄리티를 보여줄 것입니다. 또한 하이 다이나믹 레인지 비디오를 위한 HDR 메타데이터도 추가할 수 있습니다. 오디오는 ACC 인코딩 시 높은 샘플링 레이트(최소 48 kHz, 96 kHz 권장)에 fast-encoding이 아닌 complex-encoding을 사용합니다. - ```html - - ``` + ```html + + ``` ### 비디오 보존, 편집, 믹싱을 위한 추천 @@ -1777,11 +1774,11 @@ x264 --crf 18 -preset ultrafast --output outfilename.mp4 infile ```js const kbps = 1024; -const Mbps = kbps*kbps; +const Mbps = kbps * kbps; const options = { mimeType: 'video/webm; codecs="av01.2.19H.12.0.000.09.16.09.1, flac"', - bitsPerSecond: 800*Mbps, + bitsPerSecond: 800 * Mbps, }; let recorder = new MediaRecorder(sourceStream, options); diff --git a/files/ko/web/performance/how_browsers_work/index.md b/files/ko/web/performance/how_browsers_work/index.md index d81909d6ac987b..c1d34bedd3bc3e 100644 --- a/files/ko/web/performance/how_browsers_work/index.md +++ b/files/ko/web/performance/how_browsers_work/index.md @@ -57,7 +57,7 @@ HTTPS를 이용한 보안성있는 연결을 위해서는 또 다른 "핸드셰 웹서버로 한 번 연결이 성립되고 나면, 브라우저는 유저 대신에 초기 [HTTP `GET` request](/ko/docs/Web/HTTP/Methods)를 보냅니다. 웹사이트는 대게 HTML 파일을 요청합니다. 서버가 요청을 받으면, 관련 응답 해더와 함께 HTML의 내용을 응답하게 됩니다. ```html - + diff --git a/files/ko/web/performance/understanding_latency/index.md b/files/ko/web/performance/understanding_latency/index.md index a8cd0cfffdc063..7ab9dde6cfadc0 100644 --- a/files/ko/web/performance/understanding_latency/index.md +++ b/files/ko/web/performance/understanding_latency/index.md @@ -27,16 +27,16 @@ slug: Web/Performance/Understanding_latency 개발자 도구에서 network 테이블의 스로틀링 옵션을 통해 2G, 3G 혹은 다른 대역폭으로 전환할 수 있습니다. 다양한 브라우저의 개발자 도구에는 서로 다른 사전 설정 옵션이 있으며, 모방되는 특성에는 다운로드 속도, 업로드 속도, 최소 대기 시간 또는 데이터 패킷을 보내는 데 필요한 최소 타입이 포함됩니다. 일부 사전 설정의 대략적인 값은 다음과 같습니다. -| 선택 | 다운로드 속도 | 업로드 속도 | 최소 대기 시간 (ms) | -| -------------- | -------------- | ------------ | -------------------- | -| GPRS | 50 Kbps | 20 Kbps | 500 | -| 일반적인 2G | 250 Kbps | 50 Kbps | 300 | -| 좋은 2G | 450 Kbps | 150 Kbps | 150 | -| 일반적인 3G | 750 Kbps | 250 Kbps | 100 | -| 좋은 3G | 1.5 Mbps | 750 Kbps | 40 | -| 일반적인 4G/LTE | 4 Mbps | 3 Mbps | 20 | -| DSL | 2 Mbps | 1 Mbps | 5 | -| Wi-Fi | 30 Mbps | 15 Mbps | 2 | +| 선택 | 다운로드 속도 | 업로드 속도 | 최소 대기 시간 (ms) | +| --------------- | ------------- | ----------- | ------------------- | +| GPRS | 50 Kbps | 20 Kbps | 500 | +| 일반적인 2G | 250 Kbps | 50 Kbps | 300 | +| 좋은 2G | 450 Kbps | 150 Kbps | 150 | +| 일반적인 3G | 750 Kbps | 250 Kbps | 100 | +| 좋은 3G | 1.5 Mbps | 750 Kbps | 40 | +| 일반적인 4G/LTE | 4 Mbps | 3 Mbps | 20 | +| DSL | 2 Mbps | 1 Mbps | 5 | +| Wi-Fi | 30 Mbps | 15 Mbps | 2 | ## 네트워크 시간 측정 diff --git a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-a2hs-banner.png b/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-a2hs-banner.png deleted file mode 100644 index 4610c68f4bfc24..00000000000000 Binary files a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-a2hs-banner.png and /dev/null differ diff --git a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-desktop-a2hs-banner.png b/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-desktop-a2hs-banner.png deleted file mode 100644 index 8edd73c055bf07..00000000000000 Binary files a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/chrome-desktop-a2hs-banner.png and /dev/null differ diff --git a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/fx-a2hs-banner.png b/files/ko/web/progressive_web_apps/guides/making_pwas_installable/fx-a2hs-banner.png deleted file mode 100644 index 4cb887765a10b7..00000000000000 Binary files a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/fx-a2hs-banner.png and /dev/null differ diff --git a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/index.md b/files/ko/web/progressive_web_apps/guides/making_pwas_installable/index.md deleted file mode 100644 index 171069b0f984c0..00000000000000 --- a/files/ko/web/progressive_web_apps/guides/making_pwas_installable/index.md +++ /dev/null @@ -1,206 +0,0 @@ ---- -title: Add to home screen -slug: Web/Progressive_web_apps/Guides/Making_PWAs_installable -original_slug: Web/Progressive_web_apps/Add_to_home_screen ---- - -Add to Home screen (or A2HS for short) is a feature available in modern smartphone browsers that allows developers to easily and conveniently add a shortcut to their Home screen representing their favorite web app (or site) so they can subsequently access it with a single tap. This guide explains how A2HS is used, and what you need to do as a developer to allow your users to take advantage of it. - -## Why A2HS? - -A2HS is thought to be part of the [Progressive Web App](/ko/docs/Web/Progressive_web_apps) philosophy — giving web apps the same user experience advantages as native apps so they can compete in today's ecosystem wars. Part of this is the simple gesture of accessing an app by tapping its icon on your Home screen, and then having it appear neatly in its own window. A2HS makes this possible. - -## What browsers support A2HS? - -A2HS is supported by Mobile Chrome/Android Webview since version 31, Opera for Android since version 32, and Firefox for Android since [version 58](/ko/docs/Mozilla/Firefox/Releases/58). - -## How do you use it? - -We've written a very simple example web site ([see our demo live](https://mdn.github.io/pwa-examples/a2hs/), and also [see the source code](https://github.com/mdn/pwa-examples/tree/master/a2hs)) that doesn't do much, but was developed with the necessary code to allow it to be added to a Home screen, as well as a service worker to enable it to be used offline. The example displays a series of fox pictures. - -If you have Firefox for Android available, use it to navigate to our demo at `https://mdn.github.io/pwa-examples/a2hs/`. You'll see fox pictures, but more important, you'll see a "home" icon with a plus (+) icon inside it — this is the "Add to Home screen" icon displayed for any site that has the necessary features in place. - -![](add-to-home-screen-icon.png) - -Tapping this will show a confirmation banner — pressing the big + _ADD TO HOME SCREEN_ button completes the action, adding the app to the Home screen. (Note: In Android 8 and higher, a system-level "Add to Home screen" permission dialog will be shown first.) - -![](fx-a2hs-banner.png) - -If you have Mobile Chrome available, the experience is slightly different; upon loading our site, you'll see an install banner pop up asking whether you want to add this app to your Home screen. - -![](chrome-a2hs-banner.png) - -> **참고:** You can find out a lot more about Chrome install banners from the article [Web App Install Banners](https://developers.google.com/web/fundamentals/app-install-banners/). - -If you choose not to add it to your Home screen at this point, you can do so later using the _Add to Home screen_ icon in the main Chrome menu. - -Regardless of which browser you are using, when you choose to add the app to your Home screen, you'll see it appear along with a short title, in the same way that native apps do. - -![](a2hs-on-home-screen.png) - -Tapping this icon opens it up, but as a fullscreen app, you'll no longer see the browser UI around it. - -## How do you make an app A2HS-ready? - -To enable your app to be added to a Home screen, it needs the following: - -- To be served over HTTPs — the web is increasingly being moved in a more secure direction, and many modern web technologies (A2HS included) will work only on secure contexts. -- To have a manifest file with the correct fields filled in, linked from the HTML head. -- To have an appropriate icon available for displaying on the Home screen. -- Chrome additionally requires the app to have a service worker registered (e.g., so it can function when offline). - -### Manifest - -The web manifest is written in standard JSON format and should be placed somewhere inside your app directory (in the root is probably best) with the name `somefilename.webmanifest` (we've chosen `manifest.webmanifest`). It contains multiple fields that define certain information about the web app and how it should behave. - -> **참고:** The `.webmanifest` extension is specified in the [Media type registration](https://w3c.github.io/manifest/#media-type-registration) section of the specification, but generally browsers will support manifests with other appropriate extensions, e.g. `.json`. - -The fields needed for A2HS are as follows: - -- `background_color`: Specifies a background color to be used in some app contexts. The most relevant one to A2HS is the splash screen displayed when the app icon on the Home screen is tapped and it first starts to load (this currently appears only when apps have been added to the Home screen by Chrome). -- `display`: Specifies how the app should be displayed. To make it feel like a distinct app (and not just a web page), you should choose a value such as `fullscreen` (no UI is shown at all) or `standalone` (very similar, but system-level UI elements such as the status bar might be visible). -- `icons`: Specifies icons for the browser to use when representing the app in different places (such as on the task switcher, or more important, the Home screen). We've included only one in our demo. -- `name`/`short_name`: These fields provide an app name to be displayed when representing the app in different places. `name` provides the full app name, and `short_name` provides a shortened name to be used when there is insufficient space to display the full name. You are advised to provide both if your app's name is particularly long. -- `start_url`: Provides a path to the asset that should be loaded when the added-to-Home screen app is launched. Note that this has to be a relative URL pointing to the site index, relative to the url of the manifest. Also, be aware that Chrome requires this before it will display the install banner, whereas Firefox doesn't require it for showing the home-with-a-plus icon. - -The manifest for our sample app looks like this: - -```js -{ - "background_color": "purple", - "description": "Shows random fox pictures. Hey, at least it isn't cats.", - "display": "fullscreen", - "icons": [ - { - "src": "icon/fox-icon.png", - "sizes": "192x192", - "type": "image/png" - } - ], - "name": "Awesome fox pictures", - "short_name": "Foxes", - "start_url": "/pwa-examples/a2hs/index.html" -} -``` - -### Appropriate icon - -As shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app. You can include more sizes if you want; Android will choose the most appropriate size for each different use case. You could also decide to include different types of icons so devices can use the best one they are able to (e.g., Chrome already supports the WebP format). - -Note that the `type` member in each icon's object specifies the icon's mimetype, so the browser can quickly read what type the icon is, and then ignore it and move to a different icon if it doesn't support it. - -In terms of how to design the icon, you should follow the same best practices you'd follow for any Android icon (see the [Android icon design guidelines](https://developer.android.com/guide/practices/ui_guidelines/icon_design.html)). - -### Link the HTML to the manifest - -To finish setting up your manifest, you need to reference it from the HTML of your application's home page: - -```html - -``` - -Browsers that support A2HS will know where to look for your manifest once this is in place. - -## What does A2HS not give you? - -Bear in mind that when you add an app to your Home screen, it just makes the app easily accessible — it doesn't download the app's assets and data to your device and make the app available offline, or anything like that. To make your app work offline, you have to use the [Service Worker API](/ko/docs/Web/API/Service_Worker_API) to handle storing the assets offline, and if required, [Web storage](/ko/docs/Web/API/Web_Storage_API) or [IndexedDB](/ko/docs/Web/API/IndexedDB_API) to store its data. - -In our example app, we've just used a service worker to store all necessary files. The service worker is registered against the site with the final code block in the [`index.js`](https://github.com/mdn/pwa-examples/blob/master/a2hs/index.js) file. We then cache all the site's assets using the [Cache API](/ko/docs/Web/API/Cache), and serve them from the cache instead of the network using the code in the [sw.js](https://github.com/mdn/pwa-examples/blob/master/a2hs/sw.js) file. - -## A2HS on desktop - -While originally intended to improve user experience on mobile OSes, there is movement to make PWAs installable on desktop platforms too. - -> **참고:** At the time of writing, the functionality described below was only supported in newer versions of Chrome — by default on Windows, and behind the `#enable-desktop-pwas` flag on macOS. - -### Adding an install button - -To make our PWA installable on desktop, we first added a button to our document to allow users to do the installation — this isn't made available automatically on desktop apps, and the installation needs to be triggered by a user gesture: - -```html - -``` - -We then gave it some simple styling: - -```css -.add-button { - position: absolute; - top: 1px; - left: 1px; -} -``` - -### JavaScript for handling the install - -At the bottom of our [`index.js` file](https://github.com/mdn/pwa-examples/blob/master/a2hs/index.js), we added some JavaScript to handle the installation. First of all, we declare a `deferredPrompt` variable (which we'll explain later on), get a reference to our install button, and set it to `display: none` initially: - -```js -let deferredPrompt; -const addBtn = document.querySelector('.add-button'); -addBtn.style.display = 'none'; -``` - -We hide the button initially because the PWA will not be available for install until it follows the A2HS criteria. When this happens, supporting browsers will fire a `beforeinstallprompt` event. We can then use a handler like the one below to handle the installation: - -```js -window.addEventListener('beforeinstallprompt', (e) => { - // Prevent Chrome 67 and earlier from automatically showing the prompt - e.preventDefault(); - // Stash the event so it can be triggered later. - deferredPrompt = e; - // Update UI to notify the user they can add to home screen - addBtn.style.display = 'block'; - - addBtn.addEventListener('click', (e) => { - // hide our user interface that shows our A2HS button - addBtn.style.display = 'none'; - // Show the prompt - deferredPrompt.prompt(); - // Wait for the user to respond to the prompt - deferredPrompt.userChoice.then((choiceResult) => { - if (choiceResult.outcome === 'accepted') { - console.log('User accepted the A2HS prompt'); - } else { - console.log('User dismissed the A2HS prompt'); - } - deferredPrompt = null; - }); - }); -}); -``` - -So here we: - -- Call {{domxref("Event.preventDefault()")}} to stop Chrome 67 and earlier from calling the install prompt automatically (this behavior changed in Chrome 68). -- Store the event object in the `deferredPrompt` variable so it can be used later on to perform the actual installation. -- Set the button to `display: block` so it appears in the UI for the user to click. -- Set a `click` handler for the button. - -The click handler contains the following steps: - -- Hide the button again with `display: none` — it is no longer needed once the app is installed. -- Use the `prompt()` method available on the `beforeinstallprompt` event object (stored in `deferredPrompt`) to trigger showing the install prompt. -- Respond to the user's interaction with the prompt using the `userChoice` property, again available on the `beforeinstallprompt` event object. -- Set `deferredPrompt` to null since it is no longer needed. - -So when the button is clicked, the install prompt appears. - -![](chrome-desktop-a2hs-banner.png) - -If the user selects _Install_, the app is installed (available as standalone desktop app), and the Install button no longer shows (the `onbeforeinstallprompt` event no longer fires if the app is already installed). When you open the app, it will appear in its own window: - -![](a2hs-installed-desktop.png) - -If the user selects _Cancel_, the state of the app goes back to how it was before the button was clicked. - -> **참고:** The code for this section was mostly taken from [App install banners/Add to Home Screen](https://developers.google.com/web/fundamentals/app-install-banners/) by Pete LaPage. - -## See also - -- [Progressive web apps](/ko/docs/Web/Progressive_web_apps) -- [Service Worker API](/ko/docs/Web/API/Service_Worker_API) -- [Web manifest reference](/ko/docs/Web/Manifest) -- [App install banners](https://developers.google.com/web/fundamentals/app-install-banners/) - -{{QuickLinksWithSubpages("/en-US/docs/Web/Progressive_web_apps/")}} diff --git a/files/ko/web/progressive_web_apps/index.md b/files/ko/web/progressive_web_apps/index.md index 6fd831646414b9..2839feeabca928 100644 --- a/files/ko/web/progressive_web_apps/index.md +++ b/files/ko/web/progressive_web_apps/index.md @@ -52,4 +52,4 @@ PWA는 발견 가능, 설치 가능, 연결 가능해야 하고, 네트워크에 - [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/) — web-app auditing tool that includes PWA-auditing features - [localForage](https://localforage.github.io/localForage/) — `localStorage`-like _async_ storage, to improve your PWA's offline experience -{{QuickLinksWithSubpages("/en-US/docs/Web/Progressive_web_apps/")}} +{{QuickLinksWithSubpages("/ko/docs/Web/Progressive_web_apps/")}} diff --git a/files/ko/web/progressive_web_apps/tutorials/js13kgames/app_structure/index.md b/files/ko/web/progressive_web_apps/tutorials/js13kgames/app_structure/index.md index e73c7577f65919..10a0c4f8107eff 100644 --- a/files/ko/web/progressive_web_apps/tutorials/js13kgames/app_structure/index.md +++ b/files/ko/web/progressive_web_apps/tutorials/js13kgames/app_structure/index.md @@ -64,38 +64,55 @@ Streams API는 개발자가 서버로부터의 데이터 스트리밍에 직접 HTML의 관점에서보면 app shell은 컨텐츠 섹션 외부의 모든 영역입니다. ```html - + - - - js13kGames A-Frame entries - - - - - - - - - - - - -
        -

        -
        -
        -

        js13kGames A-Frame entries

        -

        List of games submitted to the A-Frame category in the js13kGames 2017 competition. You can fork js13kPWA on GitHub to check its source code.

        - -
        - // Content inserted in here -
        -
        - - + + + js13kGames A-Frame entries + + + + + + + + + + + + +
        +

        + +

        +
        +
        +

        js13kGames A-Frame entries

        +

        + List of games submitted to the + A-Frame category in the + js13kGames 2017 competition. + You can + fork js13kPWA on GitHub + to check its source code. +

        + +
        // Content inserted in here
        +
        + + ``` @@ -112,7 +129,8 @@ CSS도 평범합니다. {{cssxref("@font-face")}}를 사용해 커스텀 폰트 app.js 파일은 다음 문서에서 자세히 살펴볼 몇 가지 것들을 합니다. 먼저, 다음 템플릿을 기반으로 컨텐츠를 생성합니다. ```js -var template = "
        \n\ +var template = + ""; -var content = ''; -for(var i=0; i','-'); - content += entry; -}; -document.getElementById('content').innerHTML = content; +var content = ""; +for (var i = 0; i < games.length; i++) { + var entry = template + .replace(/POS/g, i + 1) + .replace(/SLUG/g, games[i].slug) + .replace(/NAME/g, games[i].name) + .replace(/AUTHOR/g, games[i].author) + .replace(/TWITTER/g, games[i].twitter) + .replace(/WEBSITE/g, games[i].website) + .replace(/GITHUB/g, games[i].github); + entry = entry.replace("", "-"); + content += entry; +} +document.getElementById("content").innerHTML = content; ``` 다음으로, service worker를 등록합니다. ```js -if('serviceWorker' in navigator) { - navigator.serviceWorker.register('/pwa-examples/js13kpwa/sw.js'); -}; +if ("serviceWorker" in navigator) { + navigator.serviceWorker.register("/pwa-examples/js13kpwa/sw.js"); +} ``` 다음 코드 블럭은 버튼을 클릭했을 때 알림에 대한 권한을 요청합니다. ```js var button = document.getElementById("notifications"); -button.addEventListener('click', function(e) { - Notification.requestPermission().then(function(result) { - if(result === 'granted') { - randomNotification(); - } - }); +button.addEventListener("click", function (e) { + Notification.requestPermission().then(function (result) { + if (result === "granted") { + randomNotification(); + } + }); }); ``` @@ -163,16 +182,16 @@ button.addEventListener('click', function(e) { ```js function randomNotification() { - var randomItem = Math.floor(Math.random()*games.length); - var notifTitle = games[randomItem].name; - var notifBody = 'Created by '+games[randomItem].author+'.'; - var notifImg = 'data/img/'+games[randomItem].slug+'.jpg'; - var options = { - body: notifBody, - icon: notifImg - } - var notif = new Notification(notifTitle, options); - setTimeout(randomNotification, 30000); + var randomItem = Math.floor(Math.random() * games.length); + var notifTitle = games[randomItem].name; + var notifBody = "Created by " + games[randomItem].author + "."; + var notifImg = "data/img/" + games[randomItem].slug + ".jpg"; + var options = { + body: notifBody, + icon: notifImg, + }; + var notif = new Notification(notifTitle, options); + setTimeout(randomNotification, 30000); } ``` @@ -181,36 +200,36 @@ function randomNotification() { 빠르게 살펴볼 마지막 파일(sw\.js)은 service worker입니다. 이는 먼저 games.js 파일로부터 데이터를 불러옵니다. ```js -self.importScripts('data/games.js'); +self.importScripts("data/games.js"); ``` 다음으로, app shell과 컨텐츠 모두로부터 캐싱할 모든 파일의 리스트를 생성합니다. ```js -var cacheName = 'js13kPWA-v1'; +var cacheName = "js13kPWA-v1"; var appShellFiles = [ - '/pwa-examples/js13kpwa/', - '/pwa-examples/js13kpwa/index.html', - '/pwa-examples/js13kpwa/app.js', - '/pwa-examples/js13kpwa/style.css', - '/pwa-examples/js13kpwa/fonts/graduate.eot', - '/pwa-examples/js13kpwa/fonts/graduate.ttf', - '/pwa-examples/js13kpwa/fonts/graduate.woff', - '/pwa-examples/js13kpwa/favicon.ico', - '/pwa-examples/js13kpwa/img/js13kgames.png', - '/pwa-examples/js13kpwa/img/bg.png', - '/pwa-examples/js13kpwa/icons/icon-32.png', - '/pwa-examples/js13kpwa/icons/icon-64.png', - '/pwa-examples/js13kpwa/icons/icon-96.png', - '/pwa-examples/js13kpwa/icons/icon-128.png', - '/pwa-examples/js13kpwa/icons/icon-168.png', - '/pwa-examples/js13kpwa/icons/icon-192.png', - '/pwa-examples/js13kpwa/icons/icon-256.png', - '/pwa-examples/js13kpwa/icons/icon-512.png' + "/pwa-examples/js13kpwa/", + "/pwa-examples/js13kpwa/index.html", + "/pwa-examples/js13kpwa/app.js", + "/pwa-examples/js13kpwa/style.css", + "/pwa-examples/js13kpwa/fonts/graduate.eot", + "/pwa-examples/js13kpwa/fonts/graduate.ttf", + "/pwa-examples/js13kpwa/fonts/graduate.woff", + "/pwa-examples/js13kpwa/favicon.ico", + "/pwa-examples/js13kpwa/img/js13kgames.png", + "/pwa-examples/js13kpwa/img/bg.png", + "/pwa-examples/js13kpwa/icons/icon-32.png", + "/pwa-examples/js13kpwa/icons/icon-64.png", + "/pwa-examples/js13kpwa/icons/icon-96.png", + "/pwa-examples/js13kpwa/icons/icon-128.png", + "/pwa-examples/js13kpwa/icons/icon-168.png", + "/pwa-examples/js13kpwa/icons/icon-192.png", + "/pwa-examples/js13kpwa/icons/icon-256.png", + "/pwa-examples/js13kpwa/icons/icon-512.png", ]; var gamesImages = []; -for(var i=0; i + ``` > **참고:** 과거에 manifest로 사용되던 몇 가지 흔한 확장자들이 있습니다: `manifest.webapp` 은 Firefox OS 웹 manifest로 유명하며, 많은 사람들이 JSON 구조로 내용이 구성된 `manifest.json`을 사용합니다. 하지만, `.webmanifest` 확장자는 [W3C manifest 명세](https://w3c.github.io/manifest/)에 명시적으로 언급되고 있으므로 이를 그대로 사용하도록 하겠습니다. @@ -37,26 +37,26 @@ original_slug: Web/Progressive_web_apps/Installable_PWAs ```json { - "name": "js13kGames Progressive Web App", - "short_name": "js13kPWA", - "description": "Progressive Web App that lists games submitted to the A-Frame category in the js13kGames 2017 competition.", - "icons": [ - { - "src": "icons/icon-32.png", - "sizes": "32x32", - "type": "image/png" - }, - // ... - { - "src": "icons/icon-512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "start_url": "/pwa-examples/js13kpwa/index.html", - "display": "fullscreen", - "theme_color": "#B12A34", - "background_color": "#B12A34" + "name": "js13kGames Progressive Web App", + "short_name": "js13kPWA", + "description": "Progressive Web App that lists games submitted to the A-Frame category in the js13kGames 2017 competition.", + "icons": [ + { + "src": "icons/icon-32.png", + "sizes": "32x32", + "type": "image/png" + }, + // ... + { + "src": "icons/icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": "/pwa-examples/js13kpwa/index.html", + "display": "fullscreen", + "theme_color": "#B12A34", + "background_color": "#B12A34" } ``` diff --git a/files/ko/web/progressive_web_apps/tutorials/js13kgames/offline_service_workers/index.md b/files/ko/web/progressive_web_apps/tutorials/js13kgames/offline_service_workers/index.md index cf9f2cca248aa3..e62e946e66572c 100644 --- a/files/ko/web/progressive_web_apps/tutorials/js13kgames/offline_service_workers/index.md +++ b/files/ko/web/progressive_web_apps/tutorials/js13kgames/offline_service_workers/index.md @@ -37,9 +37,9 @@ Service Worker는 매우 강력하기때문에 안전한 컨텍스트(HTTPS를 app.js 파일에서 새로운 Service Worker를 등록하는 코드를 살펴보는 것으로 시작할 것입니다. ```js -if('serviceWorker' in navigator) { - navigator.serviceWorker.register('/pwa-examples/js13kpwa/sw.js'); -}; +if ("serviceWorker" in navigator) { + navigator.serviceWorker.register("/pwa-examples/js13kpwa/sw.js"); +} ``` 브라우저에서 Service worker API를 지원한다면, {{domxref("ServiceWorkerContainer.register()")}} 메소드를 사용해 사이트에대해 등록됩니다. 컨텐츠는 sw\.js 파일안에 있으며 등록이 성공한 후에 실행됩니다. 이것이 app.js 파일안에 있는 Service Worker 코드의 유일한 부분입니다. Service Worker에 대한 다른 모든 것들은 sw\.js 파일에 작성되어 있습니다. @@ -53,8 +53,8 @@ if('serviceWorker' in navigator) { API는 우리가 관심있는 주요 이벤트에 대한 이벤트 리스너를 추가할 수 있게 해줍니다. 첫 번째 것은 `install` 이벤트 입니다. ```js -self.addEventListener('install', function(e) { - console.log('[Service Worker] Install'); +self.addEventListener("install", function (e) { + console.log("[Service Worker] Install"); }); ``` @@ -63,26 +63,26 @@ self.addEventListener('install', function(e) { 먼저, 캐시 이름을 저장할 변수를 생성하고, app shell 파일들을 하나의 배열에 나열합니다. ```js -var cacheName = 'js13kPWA-v1'; +var cacheName = "js13kPWA-v1"; var appShellFiles = [ - '/pwa-examples/js13kpwa/', - '/pwa-examples/js13kpwa/index.html', - '/pwa-examples/js13kpwa/app.js', - '/pwa-examples/js13kpwa/style.css', - '/pwa-examples/js13kpwa/fonts/graduate.eot', - '/pwa-examples/js13kpwa/fonts/graduate.ttf', - '/pwa-examples/js13kpwa/fonts/graduate.woff', - '/pwa-examples/js13kpwa/favicon.ico', - '/pwa-examples/js13kpwa/img/js13kgames.png', - '/pwa-examples/js13kpwa/img/bg.png', - '/pwa-examples/js13kpwa/icons/icon-32.png', - '/pwa-examples/js13kpwa/icons/icon-64.png', - '/pwa-examples/js13kpwa/icons/icon-96.png', - '/pwa-examples/js13kpwa/icons/icon-128.png', - '/pwa-examples/js13kpwa/icons/icon-168.png', - '/pwa-examples/js13kpwa/icons/icon-192.png', - '/pwa-examples/js13kpwa/icons/icon-256.png', - '/pwa-examples/js13kpwa/icons/icon-512.png' + "/pwa-examples/js13kpwa/", + "/pwa-examples/js13kpwa/index.html", + "/pwa-examples/js13kpwa/app.js", + "/pwa-examples/js13kpwa/style.css", + "/pwa-examples/js13kpwa/fonts/graduate.eot", + "/pwa-examples/js13kpwa/fonts/graduate.ttf", + "/pwa-examples/js13kpwa/fonts/graduate.woff", + "/pwa-examples/js13kpwa/favicon.ico", + "/pwa-examples/js13kpwa/img/js13kgames.png", + "/pwa-examples/js13kpwa/img/bg.png", + "/pwa-examples/js13kpwa/icons/icon-32.png", + "/pwa-examples/js13kpwa/icons/icon-64.png", + "/pwa-examples/js13kpwa/icons/icon-96.png", + "/pwa-examples/js13kpwa/icons/icon-128.png", + "/pwa-examples/js13kpwa/icons/icon-168.png", + "/pwa-examples/js13kpwa/icons/icon-192.png", + "/pwa-examples/js13kpwa/icons/icon-256.png", + "/pwa-examples/js13kpwa/icons/icon-512.png", ]; ``` @@ -90,8 +90,8 @@ var appShellFiles = [ ```js var gamesImages = []; -for(var i=0; ip { mask: url(#my-mask); } + ``` 위의 예제에서, 모든 문단은 [ID](/ko/docs/Web/HTML/Global_attributes/id)가 `my-mask`인 [SVG ``](/ko/docs/Web/SVG/Element/mask)에 의해 마스크 처리됩니다. @@ -27,11 +31,11 @@ CSS 스타일을 이용해 SVG 효과를 적용하기 위해서, 먼저 적용 - - + + - - + + ``` @@ -53,14 +57,15 @@ Applying the SVG effect to (X)HTML is accomplished by assigning the `target` cla ```html

        - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

        - Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. - Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing + elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Ut enim ad minim veniam.

        ``` @@ -74,22 +79,23 @@ This example demonstrates using SVG to clip HTML content. Notice that even the c ```html

        - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

        - Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. - Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing + elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Ut enim ad minim veniam.

        - - + + ``` @@ -112,7 +118,7 @@ You can make changes to the SVG in real time and see them immediately affect the ```js function toggleRadius() { var circle = document.getElementById("circle"); - circle.r.baseVal.value = 0.40 - circle.r.baseVal.value; + circle.r.baseVal.value = 0.4 - circle.r.baseVal.value; } ``` @@ -124,15 +130,16 @@ This demonstrates applying a filter to HTML content using SVG. It establishes se ```html

        - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

        lorem

        - Lorem ipsum dolor sit amet, consectetur adipisicing - elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. - Ut enim ad minim veniam. + Lorem ipsum dolor sit amet, consectetur adipisicing + elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Ut enim ad minim veniam.

        ``` @@ -141,7 +148,7 @@ Any SVG filter can be applied this way. For example, to apply a blur effect, you ```html - + ``` @@ -151,10 +158,11 @@ You could also apply a color matrix: ```html - + ``` @@ -164,20 +172,29 @@ And some more filters: ```html - + - - + + - + ``` @@ -185,12 +202,24 @@ And some more filters: The five filters are applied using the following CSS: ```css -p.target { filter:url(#f3); } -p.target:hover { filter:url(#f5); } -b.target { filter:url(#f1); } -b.target:hover { filter:url(#f4); } -pre.target { filter:url(#f2); } -pre.target:hover { filter:url(#f3); } +p.target { + filter: url(#f3); +} +p.target:hover { + filter: url(#f5); +} +b.target { + filter: url(#f1); +} +b.target:hover { + filter: url(#f4); +} +pre.target { + filter: url(#f2); +} +pre.target:hover { + filter: url(#f3); +} ``` {{EmbedLiveSample('Example_Filtering', 650, 200)}} @@ -206,7 +235,7 @@ In order to blur text, Webkit based browsers have a (prefixed) CSS filter called - + @@ -215,7 +244,9 @@ In order to blur text, Webkit based browsers have a (prefixed) CSS filter called You can apply the SVG and the CSS filter in the same class: ```css -.blur { filter: url(#wherearemyglasses); } +.blur { + filter: url(#wherearemyglasses); +} ``` {{ EmbedLiveSample('Example_Blurred_Text', 300, 100) }} @@ -229,7 +260,9 @@ SVG used for clipping, masking, and filtering can be loaded from an external sou For example, if your CSS is in a file named `default.css`, it can look like this: ```css -.target { clip-path: url(resources.svg#c1); } +.target { + clip-path: url(resources.svg#c1); +} ``` The SVG is then imported from a file named `resources.svg`, using the clip path with the ID `c1`. diff --git a/files/ko/web/svg/attribute/cx/index.md b/files/ko/web/svg/attribute/cx/index.md index c19dfaf10915cd..dde01fccc3c67e 100644 --- a/files/ko/web/svg/attribute/cx/index.md +++ b/files/ko/web/svg/attribute/cx/index.md @@ -16,17 +16,21 @@ slug: Web/SVG/Attribute/cx ## Example ```css hidden -html,body,svg { height:100% } +html, +body, +svg { + height: 100%; +} ``` ```html - + - + @@ -55,7 +59,7 @@ html,body,svg { height:100% } -> **Note:** SVG2 `cx`로 시작하는 것은 *기하학적 속성* 입니다. 즉, 이 속성은 circle의 CSS 속성으로도 사용할 수 있습니다. +> **Note:** SVG2 `cx`로 시작하는 것은 _기하학적 속성_ 입니다. 즉, 이 속성은 circle의 CSS 속성으로도 사용할 수 있습니다. ## ellipse @@ -78,7 +82,7 @@ html,body,svg { height:100% } -> **Note:** SVG2 `cx`로 시작하는 것은 *기하학적 속성* 입니다. 이는 이 속성이 ellipse의 CSS 속성으로도 사용될 수 있음을 의미합니다. +> **Note:** SVG2 `cx`로 시작하는 것은 _기하학적 속성_ 입니다. 이는 이 속성이 ellipse의 CSS 속성으로도 사용될 수 있음을 의미합니다. ## radialGradient @@ -104,34 +108,56 @@ html,body,svg { height:100% } #### 예제 ```css hidden -html,body,svg { height:100% } +html, +body, +svg { + height: 100%; +} ``` ```html - - + + - - + + - - + + - - - + + + ``` diff --git a/files/ko/web/svg/attribute/d/index.md b/files/ko/web/svg/attribute/d/index.md index 75f17cd9a52283..4b93ff7d2b5fe7 100644 --- a/files/ko/web/svg/attribute/d/index.md +++ b/files/ko/web/svg/attribute/d/index.md @@ -346,13 +346,13 @@ Below is a list of all of the attributes available in SVG along with links to re - Core attributes - - : [Core attributes](/en-US/docs/Web/SVG/Attribute/Core) + - : [Core attributes](/ko/docs/Web/SVG/Attribute/Core) {{SVGAttr("id")}}, {{SVGAttr("lang")}}, {{SVGAttr("tabindex")}}, {{SVGAttr("xml:base")}}, {{SVGAttr("xml:lang")}}, {{SVGAttr("xml:space")}} - Style attributes - - : [Style attributes](/en-US/docs/Web/SVG/Attribute/Styling) + - : [Style attributes](/ko/docs/Web/SVG/Attribute/Styling) {{SVGAttr("class")}}, {{SVGAttr("style")}} @@ -365,7 +365,7 @@ Below is a list of all of the attributes available in SVG along with links to re ### Presentation attributes -> **Note:** All [SVG presentation attributes](/en-US/docs/Web/SVG/Attribute/Presentation) can be used as CSS properties. +> **Note:** All [SVG presentation attributes](/ko/docs/Web/SVG/Attribute/Presentation) can be used as CSS properties. - {{SVGAttr("alignment-baseline")}} - {{SVGAttr("baseline-shift")}} @@ -454,30 +454,30 @@ Below is a list of all of the attributes available in SVG along with links to re - Animation event attributes - - : [Animation event attributes](/en-US/docs/Web/SVG/Attribute/Events#animation_event_attributes) + - : [Animation event attributes](/ko/docs/Web/SVG/Attribute/Events#animation_event_attributes) **`onbegin`**, **`onend`**, **`onrepeat`** - Document event attributes - - : [Document event attributes](/en-US/docs/Web/SVG/Attribute/Events#document_event_attributes) + - : [Document event attributes](/ko/docs/Web/SVG/Attribute/Events#document_event_attributes) **`onabort`**, **`onerror`**, **`onresize`**, **`onscroll`**, **`onunload`** - Global event attributes - - : [Global event attributes](/en-US/docs/Web/SVG/Attribute/Events#global_event_attributes) + - : [Global event attributes](/ko/docs/Web/SVG/Attribute/Events#global_event_attributes) **`oncancel`**, **`oncanplay`**, **`oncanplaythrough`**, **`onchange`**, **`onclick`**, **`onclose`**, **`oncuechange`**, **`ondblclick`**, **`ondrag`**, **`ondragend`**, **`ondragenter`**, **`ondragleave`**, **`ondragover`**, **`ondragstart`**, **`ondrop`**, **`ondurationchange`**, **`onemptied`**, **`onended`**, **`onerror`**, **`onfocus`**, **`oninput`**, **`oninvalid`**, **`onkeydown`**, **`onkeypress`**, **`onkeyup`**, **`onload`**, **`onloadeddata`**, **`onloadedmetadata`**, **`onloadstart`**, **`onmousedown`**, **`onmouseenter`**, **`onmouseleave`**, **`onmousemove`**, **`onmouseout`**, **`onmouseover`**, **`onmouseup`**, **`onmousewheel`**, **`onpause`**, **`onplay`**, **`onplaying`**, **`onprogress`**, **`onratechange`**, **`onreset`**, **`onresize`**, **`onscroll`**, **`onseeked`**, **`onseeking`**, **`onselect`**, **`onshow`**, **`onstalled`**, **`onsubmit`**, **`onsuspend`**, **`ontimeupdate`**, **`ontoggle`**, **`onvolumechange`**, **`onwaiting`** - Graphical event attributes - - : [Graphical event attributes](/en-US/docs/Web/SVG/Attribute/Events#graphical_event_attributes) + - : [Graphical event attributes](/ko/docs/Web/SVG/Attribute/Events#graphical_event_attributes) **`onactivate`**, **`onfocusin`**, **`onfocusout`** ## 같이 보기 -- [SVG element reference](/en-US/docs/Web/SVG/Element) -- [SVG Tutorial](/en-US/docs/Web/SVG/Tutorial) -- [SVG interface reference](/en-US/docs/Web/API/Document_Object_Model#svg_interfaces) +- [SVG element reference](/ko/docs/Web/SVG/Element) +- [SVG Tutorial](/ko/docs/Web/SVG/Tutorial) +- [SVG interface reference](/ko/docs/Web/API/Document_Object_Model#svg_interfaces) diff --git a/files/ko/web/svg/attribute/keytimes/index.md b/files/ko/web/svg/attribute/keytimes/index.md index b40b401f4688c1..6b64b01fbcfaf4 100644 --- a/files/ko/web/svg/attribute/keytimes/index.md +++ b/files/ko/web/svg/attribute/keytimes/index.md @@ -2,6 +2,7 @@ title: keyTimes slug: Web/SVG/Attribute/keyTimes --- + « [SVG Attribute reference home](/ko/docs/Web/SVG/Attribute) `keyTimes` 속성은 애니메이션의 pacing을 제어하는 데 사용되는 세미콜론으로 구분 된 시간 값 목록입니다. 목록의 각 시간은 {{ SVGAttr("values") }} 속성 목록의 값에 해당하며 애니메이션에서 값이 사용되는 시기를 정의합니다. `keyTimes` 목록의 각 시간 값은 0과 1 사이의 부동 소수점 값으로 지정되며 애니메이션 요소의 지속 시간에 대한 비례 오프셋을 나타냅니다. @@ -23,7 +24,7 @@ If the duration is indefinite, any `keyTimes` specification will be ignored. | Categories | Animation value attribute | | ------------------ | -------------------------------------------------------------------------------- | -| Value | \ | +| Value | \ | | Animatable | No | | Normative document | [SVG 1.1 (2nd Edition)](http://www.w3.org/TR/SVG/animate.html#KeyTimesAttribute) | @@ -31,27 +32,29 @@ If the duration is indefinite, any `keyTimes` specification will be ignored. ```html - - - - - - - - - + + + + + + ``` diff --git a/files/ko/web/svg/attribute/values/index.md b/files/ko/web/svg/attribute/values/index.md index e1f347ce3696c5..b2270f89952a93 100644 --- a/files/ko/web/svg/attribute/values/index.md +++ b/files/ko/web/svg/attribute/values/index.md @@ -2,6 +2,7 @@ title: values slug: Web/SVG/Attribute/values --- + « [SVG Attribute reference home](/en/SVG/Attribute) `values` 속성은 사용하는 맥락에 따라 크게 두 가지 의미가 있습니다. @@ -27,7 +28,7 @@ If the attribute is not specified, then the default behavior depends on the valu | Categories | Animation value attribute | | ------------------ | -------------------------------------------------------------------------------- | -| Value | \ | +| Value | \ | | Animatable | No | | Normative document | [SVG 1.1 (2nd Edition)](http://www.w3.org/TR/SVG11/animate.html#ValuesAttribute) | @@ -35,7 +36,7 @@ If the attribute is not specified, then the default behavior depends on the valu | Categories | _None_ | | ------------------ | --------------------------------------------------------------------------------------------- | -| Value | \ \| [\](/en/SVG/Content_type#Number) | +| Value | \ \| [\](/en/SVG/Content_type#Number) | | Animatable | Yes | | Normative document | [SVG 1.1 (2nd Edition)](http://www.w3.org/TR/SVG11/filters.html#feColorMatrixValuesAttribute) | diff --git a/files/ko/web/svg/attribute/version/index.md b/files/ko/web/svg/attribute/version/index.md index 63e8cd86922572..e72e92b4dfaf7c 100644 --- a/files/ko/web/svg/attribute/version/index.md +++ b/files/ko/web/svg/attribute/version/index.md @@ -2,6 +2,7 @@ title: version slug: Web/SVG/Attribute/version --- + **`version`** 속성은 해당 SVG 문서가 어떤 명세를 따르고 있는지 표시하기 위해 사용됩니다. 이는 오직 [\](/ko/docs/Web/SVG/Element/svg) 요소 내에서만 사용되며 순전히 사용되는 버전의 알림을 위한 용도로 프로세싱이나 렌더링에는 영향을 미치지 않습니다. 버전을 명시하기 위해 어떤 숫자든지 입력할 수 있지만, 현재로써 유효하게 사용되는 버전은 1.0과 1.1 두 버전만이 유일합니다. @@ -10,6 +11,6 @@ slug: Web/SVG/Attribute/version | Categories | None | | ------------------ | ------------------------------------------------------------------------------------------------------------- | -| Value | [\](/en/SVG/Content_type#Number) | +| Value | [\](/en/SVG/Content_type#Number) | | Animatable | No | | Normative document | [SVG 1.1 (2nd Edition): version attribute](http://www.w3.org/TR/SVG11/struct.html#SVGElementVersionAttribute) | diff --git a/files/ko/web/svg/attribute/viewbox/index.md b/files/ko/web/svg/attribute/viewbox/index.md index 0c681ec3158c26..ddbd9ac24c060d 100644 --- a/files/ko/web/svg/attribute/viewbox/index.md +++ b/files/ko/web/svg/attribute/viewbox/index.md @@ -2,6 +2,7 @@ title: viewBox slug: Web/SVG/Attribute/viewBox --- + « [SVG Attribute reference home](/en/SVG/Attribute) `viewBox` 속성은 특수한 container element 에 fit 하기 위한 주어진 graphics stretch 의 set 을 명시한다. diff --git a/files/ko/web/svg/element/a/index.md b/files/ko/web/svg/element/a/index.md index daf6f90bebeac6..985675b4da56a4 100644 --- a/files/ko/web/svg/element/a/index.md +++ b/files/ko/web/svg/element/a/index.md @@ -72,13 +72,13 @@ svg|a:active { 값 유형: **\** ; 기본 값: 없음; 애니메이션 가능: **아니요** - {{SVGAttr("href")}} - : 하이퍼링크가 가리키는 URL 또는 URL 조각입니다. - 값 유형: **[\](/en-US/docs/Web/SVG/Content_type#url)** ; 기본값: 없음; 애니메이션 가능: **예** + 값 유형: **[\](/ko/docs/Web/SVG/Content_type#url)** ; 기본값: 없음; 애니메이션 가능: **예** - {{htmlattrxref("hreflang", "a")}} - : 하이퍼링크가 가리키는 URL 또는 URL 조각의 사람 언어입니다. 값 유형: **\** ; 기본값: 없음; 애니메이션 가능: **예** - {{htmlattrxref("ping", "a")}} {{experimental_inline}} - : 공백으로 구분된 URL 목록으로, 하이퍼링크를 따라갈 때 `PING` 본문이 포함된 {{HTTPMethod("POST")}} 요청이 브라우저에서 전송됩니다(백그라운드에서). 일반적으로 추적에 사용됩니다. 동일한 사용 사례를 다루는 보다 광범위하게 지원되는 기능은 {{domxref("Navigator.sendBeacon()")}}을 참조하십시오. - 값 유형: **[\](/en-US/docs/Web/SVG/Content_type#list-of-ts)** ; 기본값: 없음; 애니메이션 가능: **아니요** + 값 유형: **[\](/ko/docs/Web/SVG/Content_type#list-of-ts)** ; 기본값: 없음; 애니메이션 가능: **아니요** - {{htmlattrxref("referrerpolicy", "a")}} - : {{Glossary("URL")}}을 가져올 때 보내는 [리퍼러](/ko/docs/Web/HTTP/Headers/Referer)입니다. 값 유형: `no-referrer`|`no-referrer-when-downgrade`|`same-origin`|`origin`|`strict-origin`|`origin-when-cross-origin`|`strict-origin-when-cross-origin`|`unsafe-url` ; 기본 값: 없음; 애니메이션 가능: **아니요** @@ -93,7 +93,7 @@ svg|a:active { 값 유형: **\** ; 기본 값: 없음; 에니메이션 가능: **예** - {{SVGAttr("xlink:href")}} {{deprecated_inline}} - : 하이퍼링크가 가리키는 URL 또는 URL 조각입니다. 이전 브라우저의 이전 버전과의 호환성을 위해 필요할 수 있습니다. - 값 유형: **[\](/ko/docs/Web/SVG/Content_type#url)** ; 기본값: 없음; 애니메이션 가능: **예** + 값 유형: **[\](/ko/docs/Web/SVG/Content_type#url)** ; 기본값: 없음; 애니메이션 가능: **예** ### 전역 속성 diff --git a/files/ko/web/svg/index.md b/files/ko/web/svg/index.md index fd9092e08782ff..92c9e771db7786 100644 --- a/files/ko/web/svg/index.md +++ b/files/ko/web/svg/index.md @@ -1,7 +1,8 @@ --- -title: 'SVG: Scalable Vector Graphics' +title: "SVG: Scalable Vector Graphics" slug: Web/SVG --- + {{SVGRef}} ## SVG 시작하기 diff --git a/files/ko/web/svg/tutorial/basic_shapes/index.md b/files/ko/web/svg/tutorial/basic_shapes/index.md index 71b042a39871ca..8a76e3aec4b735 100644 --- a/files/ko/web/svg/tutorial/basic_shapes/index.md +++ b/files/ko/web/svg/tutorial/basic_shapes/index.md @@ -2,6 +2,7 @@ title: 기본 도형 slug: Web/SVG/Tutorial/Basic_Shapes --- + {{ PreviousNext("Web/SVG/Tutorial/Positions", "Web/SVG/Tutorial/Paths") }} SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적은 이름에서 명백하게 알 수 있다. 도형들의 위치와 크기를 지정하는 몇몇 속성들은 주어지지만, 여기에서 다뤄지지 않는 다른 속성들과 함께 더 정확하고 완전한 설명이 있는 레퍼런스를 첨부해 두겠다. 그러나, 대부분의 SVG 문서에서 사용되기 때문에 몇 가지 소개를 해줘야한다. @@ -62,7 +63,7 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 당신이 추측한 것 처럼, [circle](/en-US/Web/SVG/Element/circle) 요소는 화면에 원을 그린다. circle 요소에 실제로 적용할 수 있는 속성은 세 가지 뿐이다. ```html - + ``` - `r` @@ -77,7 +78,7 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 [Ellipse](/en-US/Web/SVG/Element/ellipse)는 원의 x와 y 반경 (수학자들은 장반경, 단반경 이라고 함)을 개별적으로 확장 할 수 있는 circle 요소의 좀 더 일반적인 형태이다. ```html - + ``` - `rx` @@ -94,7 +95,7 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 [Line](/en-US/Web/SVG/Element/line)s은 단지 직선이다. line 요소는 선의 시작과 끝 지점을 지정하는 두 점을 속성으로 갖는다. ```html - + ``` - `x1` @@ -111,7 +112,8 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 [Polyline](/en-US/Web/SVG/Element/polyline)s은 연결된 직선들의 그룹이다. 그 목록(직선들)은 꽤 길어질 수 있기 때문에 모든 포인트가 하나의 속성에 포함된다. ```html - + ``` - points @@ -122,7 +124,8 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 [Polygon](/en-US/Web/SVG/Element/polygon)s은 점을 연결하는 직선으로 구성된다는 점에서 polyline과 매우 유사하다. 하지만 다각형의 경우, 자동으로 마지막 포인트로부터 첫 번째 포인트로 직선을 만들어서 닫힌 모양을 만든다. 사각형은 다각형의 하나이므로, 융통성있는 사각형을 필요로 하는 경우 polygon 요소를 사용해서 rect 요소를 만들 수 있다. ```html - + ``` - points @@ -133,7 +136,7 @@ SVG 드로잉에는 몇 가지 기본 도형들이 있다. 도형들의 목적 [패스](/ko/Web/SVG/Element/path)는 아마 SVG에서 사용할 수 있는 가장 일반적인 형태일 것이다. path 요소를 사용해서 당신은 사각형(둥근 모서리가 있거나 없는), 원, 타원, 폴리라인 및 다각형을 그릴 수 있다. 기본적으로 다른 모든 종류의 모양, 베지에 곡선, 2차원 곡선 등이 가능하다. 그러한 이유로, paths 는 튜토리얼의 [the next section](/en-US/Web/SVG/Tutorial/Paths) 에 들어가지만, 지금은 모양을 제어하는 데 사용되는 단일 속성이 있음을 알려주겠다. ```html - + ``` - `d` diff --git a/files/ko/web/svg/tutorial/getting_started/index.md b/files/ko/web/svg/tutorial/getting_started/index.md index c85964de7de457..1f0fa04409de00 100644 --- a/files/ko/web/svg/tutorial/getting_started/index.md +++ b/files/ko/web/svg/tutorial/getting_started/index.md @@ -32,9 +32,9 @@ slug: Web/SVG/Tutorial/Getting_Started 1. SVG 루트 요소(Element)부터 시작합니다. - - DTD기반의 SVG유효성 검사는 해결할 수 있는 것보다 많은 문제를 야기하기 때문에 (X)HTML로 알려진 Doctype 선언은 사용하지 않습니다. - - 다른 유형의 유효성 검사를 위해 SVG버전을 식별하려면 항상 version과 baseProfile 속성(Attribute)을 사용해야 합니다. - - XML 특수언어(dialect)로서 SVG는 (xmlsn 속성에서) 항상 네임 스페이스(namespace)를 올바르게 바인딩 해야합니다. 자세한 내용은[네임 스페이스 충돌 과정](/ko/docs/Web/SVG/Namespaces_Crash_Course) 페이지를 참조하십시오. + - DTD기반의 SVG유효성 검사는 해결할 수 있는 것보다 많은 문제를 야기하기 때문에 (X)HTML로 알려진 Doctype 선언은 사용하지 않습니다. + - 다른 유형의 유효성 검사를 위해 SVG버전을 식별하려면 항상 version과 baseProfile 속성(Attribute)을 사용해야 합니다. + - XML 특수언어(dialect)로서 SVG는 (xmlsn 속성에서) 항상 네임 스페이스(namespace)를 올바르게 바인딩 해야합니다. 자세한 내용은[네임 스페이스 충돌 과정](/ko/docs/Web/SVG/Namespaces_Crash_Course) 페이지를 참조하십시오. 2. 전체 이미지 영역을 포함하는 사각형 \을 그려 배경을 빨간색으로 설정합니다. 3. 빨간색 직사각형의 중앙에 반경 80px의 녹색 원 \이 그려집니다 diff --git a/files/ko/web/svg/tutorial/patterns/index.md b/files/ko/web/svg/tutorial/patterns/index.md index f6e584b4ea62ee..787254c927c9ff 100644 --- a/files/ko/web/svg/tutorial/patterns/index.md +++ b/files/ko/web/svg/tutorial/patterns/index.md @@ -2,6 +2,7 @@ title: 패턴 slug: Web/SVG/Tutorial/Patterns --- + {{ PreviousNext("Web/SVG/Tutorial/Gradients", "Web/SVG/Tutorial/Texts") }} ## 패턴 @@ -12,22 +13,27 @@ slug: Web/SVG/Tutorial/Patterns - - + + - - + + - - - + + + - + ``` diff --git a/files/ko/web/svg/tutorial/positions/index.md b/files/ko/web/svg/tutorial/positions/index.md index 5ab86d750e46b6..7ff5225053bf21 100644 --- a/files/ko/web/svg/tutorial/positions/index.md +++ b/files/ko/web/svg/tutorial/positions/index.md @@ -9,7 +9,7 @@ slug: Web/SVG/Tutorial/Positions ![가운데가 파란색 상자로 표시된 X, Y 좌표 격자](canvas_default_grid.png)모든 요소(Element)에 대해 SVG는 [캔버스](/en/HTML/Canvas)를 포함한 컴퓨터에서 무언가 그리고자 할때 많이 사용되는 것과 유사한 좌표계 또는 그리드 시스템을 사용합니다. 즉, 문서의 왼쪽 위 모서리는 (0,0)으로 간주되며 한 지점의 위치는 왼쪽 상단 모서리에서 픽셀 단위로 표시되고 X축의 양의 방향은 오른쪽, Y축의 양의 방향은 아래쪽으로 향하게됩니다. 어린시절 배웠던 그래프와는 반대라는 점을 기억하세요. 그러나 이것은 HTML의 요소가 배치되는 것과는 같은 방법입니다 (기본적으로 LTR 문서는 X를 오른쪽에서 왼쪽으로 배치하는 RTL 문서가 아닙니다). -#### 예제: +#### 예제 아래 요소는 diff --git a/files/ko/web/svg/tutorial/svg_image_tag/index.md b/files/ko/web/svg/tutorial/svg_image_tag/index.md index ba7290f4c15c5b..8026910fa8a433 100644 --- a/files/ko/web/svg/tutorial/svg_image_tag/index.md +++ b/files/ko/web/svg/tutorial/svg_image_tag/index.md @@ -2,6 +2,7 @@ title: SVG 이미지 요소 slug: Web/SVG/Tutorial/SVG_Image_Tag --- + {{ PreviousNext("Web/SVG/Tutorial/SVG_Fonts", "Web/SVG/Tutorial/Tools_for_SVG") }} SVG {{ SVGElement("image") }} 요소는 비트맵 이미지를 SVG 객체와 함께 표시할 수 있도록 해 준다. diff --git a/files/ko/web/tutorials/index.md b/files/ko/web/tutorials/index.md index 73b7e74d8a2a6b..1ebcf99fd55510 100644 --- a/files/ko/web/tutorials/index.md +++ b/files/ko/web/tutorials/index.md @@ -2,6 +2,7 @@ title: 학습서 slug: Web/Tutorials --- + 이 페이지에는 다양한 학습서 및 교육 자료에 대한 링크가 있습니다. 여러분이 웹 개발을 이제 시작하는 사람이든지, 기초를 공부하는 사람이든지, 이미 개발을 해본 사람이든지 모범 사례에 대한 유용한 자료를 찾으실 수 있습니다. 이들 자료는 웹 개발의 개방형 표준 및 모범 사례를 채택한 미래 지향적 기업 및 웹 개발자가 창작한 것으로서 Creative Commons 등의 개방형 콘텐트 라이선스를 통해 번역을 제공 또는 허용합니다. ## 웹입문자를 위하여 diff --git a/files/ko/web/xml/index.md b/files/ko/web/xml/index.md index 2a9f56a5dadc84..01386661a7a87c 100644 --- a/files/ko/web/xml/index.md +++ b/files/ko/web/xml/index.md @@ -1,8 +1,9 @@ --- -title: 'XML: Extensible Markup Language' +title: "XML: Extensible Markup Language" slug: Web/XML --- -{{QuickLinksWithSubpages("/en-US/docs/Web/XML")}} + +{{QuickLinksWithSubpages("/ko/docs/Web/XML")}} **확장가능한 마크업 언어(XML)는** 엄격하게 직렬화 된 DOM(돔 오브젝트 모델)입니다. diff --git a/files/ko/web/xpath/axes/index.md b/files/ko/web/xpath/axes/index.md index 1e784477536e9b..9ce46c5fceffa2 100644 --- a/files/ko/web/xpath/axes/index.md +++ b/files/ko/web/xpath/axes/index.md @@ -2,6 +2,7 @@ title: Axes slug: Web/XPath/Axes --- + {{ XsltRef() }} [XPath](/ko/XPath) 명세에는 축이 13가지가 있습니다. 축은 문맥 노드와의 관계를 나타내고 트리 위에 문맥 노드에 대응하여 노드를 위치시킬 때 씁니다. 다음은 이용가능한 축 13가지와 [Gecko](/ko/Gecko)에서 가능한 지원 정도에 대한 매우 짧은 설명입니다. XPath 식 사용에 관한 추가 정보는, [Transforming XML with XSLT](/ko/Transforming_XML_with_XSLT) 문서 끝 [For Further Reading](/ko/Transforming_XML_with_XSLT/For_Further_Reading) 절을 보세요. diff --git a/files/ko/web/xpath/functions/ceiling/index.md b/files/ko/web/xpath/functions/ceiling/index.md index 52a1b785188a5a..4d7c817ac38071 100644 --- a/files/ko/web/xpath/functions/ceiling/index.md +++ b/files/ko/web/xpath/functions/ceiling/index.md @@ -2,6 +2,7 @@ title: ceiling slug: Web/XPath/Functions/ceiling --- + {{ XsltRef() }} `ceiling` 함수는 10진수를 평가하고 10진수보다 작지 않은 가장 작은 정수를 반환합니다. diff --git a/files/ko/web/xpath/functions/document/index.md b/files/ko/web/xpath/functions/document/index.md index e57de2644b8704..1cb2a12c60a8f5 100644 --- a/files/ko/web/xpath/functions/document/index.md +++ b/files/ko/web/xpath/functions/document/index.md @@ -2,6 +2,7 @@ title: document slug: Web/XPath/Functions/document --- + {{ XsltRef() }} `document` 함수는 하나 또는 여러 외부 문서에서 노드 집합을 찾고 결과 노드 집합을 반환합니다. diff --git a/files/ko/web/xpath/functions/false/index.md b/files/ko/web/xpath/functions/false/index.md index 6e66c7ee7e8939..88a32c9317652e 100644 --- a/files/ko/web/xpath/functions/false/index.md +++ b/files/ko/web/xpath/functions/false/index.md @@ -1,5 +1,5 @@ --- -title: 'false' +title: "false" slug: Web/XPath/Functions/false --- diff --git a/files/ko/web/xpath/functions/format-number/index.md b/files/ko/web/xpath/functions/format-number/index.md index 1bb12348cf0567..61f14069b9ec26 100644 --- a/files/ko/web/xpath/functions/format-number/index.md +++ b/files/ko/web/xpath/functions/format-number/index.md @@ -2,6 +2,7 @@ title: format-number slug: Web/XPath/Functions/format-number --- + {{ XsltRef() }} `format-number` 함수는 수를 평가하고 제공한 형식으로 그 수를 나타내는 문자열을 반환합니다. diff --git a/files/ko/web/xpath/functions/id/index.md b/files/ko/web/xpath/functions/id/index.md index 5946d2e92c8b32..241edec5e7e411 100644 --- a/files/ko/web/xpath/functions/id/index.md +++ b/files/ko/web/xpath/functions/id/index.md @@ -2,6 +2,7 @@ title: id slug: Web/XPath/Functions/id --- + {{ XsltRef() }} `id` 함수는 인수로 준 id와 일치하는 노드를 찾아 그 식별된 노드를 포함하는 노드 집합을 반환합니다. @@ -15,6 +16,7 @@ id(expression ) ### 인수 - `expression` + - : 만약 `expression`이 노드 집합이면, 노드 집합 안 각 노드의 문자열 값은 개별 id로 다룹니다. 반환하는 노드 집합은 그 id와 대응하는 노드입니다. - 만약 `expression` diff --git a/files/ko/web/xpath/functions/index.md b/files/ko/web/xpath/functions/index.md index 39919d12b3ff27..487bf4fce0d1cd 100644 --- a/files/ko/web/xpath/functions/index.md +++ b/files/ko/web/xpath/functions/index.md @@ -2,6 +2,7 @@ title: Functions slug: Web/XPath/Functions --- + {{ XsltRef() }} 다음은 설명, 문법, 인수 목록, 결과형, 해당 W3C 권고안 소스, 현 [Gecko](/ko/Gecko) 지원 정도를 포함하는 기본 [XPath](/ko/XPath) 함수와 XPath에 더해진 [XSLT](/ko/XSLT) 고유의 추가분에 주석을 단 목록입니다. XPath/XSLT 함수 사용에 관한 추가 정보는, [For Further Reading](/ko/Transforming_XML_with_XSLT/For_Further_Reading) 페이지를 봐 주세요. - [boolean()](Functions/boolean) diff --git a/files/ko/web/xpath/functions/name/index.md b/files/ko/web/xpath/functions/name/index.md index 0c263b8d07cac0..caccf9bd883afa 100644 --- a/files/ko/web/xpath/functions/name/index.md +++ b/files/ko/web/xpath/functions/name/index.md @@ -2,6 +2,7 @@ title: name slug: Web/XPath/Functions/name --- + {{ XsltRef() }} `name` 함수는 인수로 준 노드 집합 안 첫 노드의 QName을 나타내는 문자열을 반환합니다. diff --git a/files/ko/web/xpath/functions/position/index.md b/files/ko/web/xpath/functions/position/index.md index d732959fb670bd..a28f615258ac51 100644 --- a/files/ko/web/xpath/functions/position/index.md +++ b/files/ko/web/xpath/functions/position/index.md @@ -2,6 +2,7 @@ title: position slug: Web/XPath/Functions/position --- + {{ XsltRef() }} `position` 함수는 식 평가 문맥(expression evaluation context)와 위치가 같은 숫자를 반환합니다. diff --git a/files/ko/web/xpath/functions/starts-with/index.md b/files/ko/web/xpath/functions/starts-with/index.md index 5dffe39d57b607..dbba28ff4dfd12 100644 --- a/files/ko/web/xpath/functions/starts-with/index.md +++ b/files/ko/web/xpath/functions/starts-with/index.md @@ -2,6 +2,7 @@ title: starts-with slug: Web/XPath/Functions/starts-with --- + {{ XsltRef() }} `starts-with` 함수는 첫 번째 문자열이 두 번째 문자열로 시작하는 지를 확인한 뒤 true나 false를 반환합니다. diff --git a/files/ko/web/xpath/functions/substring-after/index.md b/files/ko/web/xpath/functions/substring-after/index.md index e8a1d65cfe571f..200e4e35b306ec 100644 --- a/files/ko/web/xpath/functions/substring-after/index.md +++ b/files/ko/web/xpath/functions/substring-after/index.md @@ -2,6 +2,7 @@ title: substring-after slug: Web/XPath/Functions/substring-after --- + {{ XsltRef() }} `substring-after` 함수는 첫 번째 인수에서 두 번째 인수가 나타난 다음의 나머지를 반환합니다. diff --git a/files/ko/web/xpath/functions/substring-before/index.md b/files/ko/web/xpath/functions/substring-before/index.md index e4583eccce3211..89995ca76f1132 100644 --- a/files/ko/web/xpath/functions/substring-before/index.md +++ b/files/ko/web/xpath/functions/substring-before/index.md @@ -2,6 +2,7 @@ title: substring-before slug: Web/XPath/Functions/substring-before --- + {{ XsltRef() }} `substring-before` 함수는 첫 번째 인수에서 두 번째 인수가 나타난 앞의 나머지를 반환합니다. diff --git a/files/ko/web/xpath/functions/system-property/index.md b/files/ko/web/xpath/functions/system-property/index.md index dda6d6138e298e..aa3e3608080302 100644 --- a/files/ko/web/xpath/functions/system-property/index.md +++ b/files/ko/web/xpath/functions/system-property/index.md @@ -2,6 +2,7 @@ title: system-property slug: Web/XPath/Functions/system-property --- + {{ XsltRef() }} `system-property` 함수는 인수로 준 시스템 속성을 나타내는 개체를 반환합니다. diff --git a/files/ko/web/xpath/functions/translate/index.md b/files/ko/web/xpath/functions/translate/index.md index 106b8e4467e1de..7b4c1e40326e5c 100644 --- a/files/ko/web/xpath/functions/translate/index.md +++ b/files/ko/web/xpath/functions/translate/index.md @@ -2,6 +2,7 @@ title: translate slug: Web/XPath/Functions/translate --- + {{ XsltRef() }} `translate` 함수는 문자열과 번역할 문자 집합을 평가하고 번역된 문자열을 반환합니다. diff --git a/files/ko/web/xpath/functions/true/index.md b/files/ko/web/xpath/functions/true/index.md index 3f9f683b631421..33d1db5d33c608 100644 --- a/files/ko/web/xpath/functions/true/index.md +++ b/files/ko/web/xpath/functions/true/index.md @@ -1,5 +1,5 @@ --- -title: 'true' +title: "true" slug: Web/XPath/Functions/true --- diff --git a/files/ko/web/xpath/index.md b/files/ko/web/xpath/index.md index 3a3f93d81a0165..830bd3d6d0882b 100644 --- a/files/ko/web/xpath/index.md +++ b/files/ko/web/xpath/index.md @@ -36,15 +36,15 @@ XPath는 XML 문서의 계층 구조를 항해하기 위해 경로 표기법(URL
          -
        1. XSLT
        2. EXSLT
        3. -
        4. XPath
        5. +
        6. XSLT
        7. EXSLT
        8. +
        9. XPath
        10. Guides
            -
          1. Comparison of CSS Selectors and XPath
          2. -
          3. XPath snippets
          4. +
          5. Comparison of CSS Selectors and XPath
          6. +
          7. XPath snippets
        11. -
        12. XPath Axes{{ListSubpagesForSidebar("/en-US/docs/Web/XPath/Axes")}}
        13. -
        14. XPath Functions{{ListSubpagesForSidebar("/en-US/docs/Web/XPath/Functions")}}
        15. +
        16. XPath Axes{{ListSubpagesForSidebar("/ko/docs/Web/XPath/Axes")}}
        17. +
        18. XPath Functions{{ListSubpagesForSidebar("/ko/docs/Web/XPath/Functions")}}
        diff --git a/files/ko/web/xpath/introduction_to_using_xpath_in_javascript/index.md b/files/ko/web/xpath/introduction_to_using_xpath_in_javascript/index.md index 31312d8686adc7..7196592643efb4 100644 --- a/files/ko/web/xpath/introduction_to_using_xpath_in_javascript/index.md +++ b/files/ko/web/xpath/introduction_to_using_xpath_in_javascript/index.md @@ -3,6 +3,7 @@ title: Introduction to using XPath in JavaScript slug: Web/XPath/Introduction_to_using_XPath_in_JavaScript original_slug: Introduction_to_using_XPath_in_JavaScript --- + 이 문서는 JavaScript 안, 확장기능, 웹사이트에서 [XPath](/ko/XPath)를 사용하기 위한 인터페이스를 설명합니다. Mozilla는 [DOM 3 XPath](http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html)를 상당량 구현합니다. 이것은 XPath 식이 HTML과 XML 문서 모두에서 잘 돌아간다는 것을 뜻합니다. XPath를 사용하는 주 인터페이스는 [document](/ko/DOM/document) 개체의 [evaluate](/ko/DOM/document.evaluate) 함수입니다. @@ -32,6 +33,7 @@ var xpathResult = document.evaluate( xpathExpression, contextNode, namespaceReso - [`XPathEvaluator`](http://www.xulplanet.com/references/objref/XPathEvaluator.html) 개체의 [`createNSResolver`](/ko/DOM/document.createNSResolver) 메소드를 써서 [만듭니다](#Implementing_a_Default_Namespace_Resolver). 항상 가상으로 이를 쓰면 좋습니다. - HTML 문서를 위해서나 namespace 접두사가 없을 때 쓸 수 있는 `null`. 만약 `xpathExpression`가 namespace 접두사를 포함하면 이는 `NAMESPACE_ERR` 코드를 내는 `DOMException`을 가져옴을 유의하세요. - 사용자 정의 맞춤(custom) 함수. 세부 내용은 부록의 [사용자 정의 Namespace Resolver 쓰기](#Implementing_a_User_Defined_Namespace_Resolver) 절을 보세요. + - `resultType`: 평가 결과로 반환되기 바랐던 결과 형을 지정하는 [상수](#XPathResult_Defined_Constants). 가장 흔히 넘겨주는 상수는 가장 자연스러운 형으로 XPath 식의 결과를 반환하는 `XPathResult.ANY_TYPE`입니다. 부록에 [쓸 수 있는 상수](#XPathResult_Defined_Constants) 목록 전체를 포함하는 절이 있습니다. 아래 [반환형 지정](#Specifying_the_Return_Type) 절에서 설명합니다. - `result`: 결과를 반환하는 데 재사용하는 기존 `XPathResult` 개체나 새 `XPathResult` 개체를 만드는 데 쓸 수 있는 `null` 가운데 하나. @@ -50,10 +52,12 @@ var nsResolver = document.createNSResolver( contextNode.ownerDocument == null ? Or alternatively by using the `createNSResolver` method of a `XPathEvaluator` object. ```js -var xpEvaluator = new XPathEvaluator(); -var nsResolver = xpEvaluator.createNSResolver( - contextNode.ownerDocument == null ? contextNode.documentElement : contextNode.ownerDocument.documentElement - ); +var xpEvaluator = new XPathEvaluator(); +var nsResolver = xpEvaluator.createNSResolver( + contextNode.ownerDocument == null + ? contextNode.documentElement + : contextNode.ownerDocument.documentElement, +); ``` 그리고 나서 `document.evaluate` 함수에 `namespaceResolver` 매개변수로 `nsResolver` 변수를 넘겨줍니다. @@ -122,18 +126,23 @@ alert( 'This document contains ' + paragraphCount.stringValue + ' paragraph elem ###### 반복자 예 ```js -var iterator = document.evaluate('//phoneNumber', documentNode, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null ); +var iterator = document.evaluate( + "//phoneNumber", + documentNode, + null, + XPathResult.UNORDERED_NODE_ITERATOR_TYPE, + null, +); try { var thisNode = iterator.iterateNext(); while (thisNode) { - alert( thisNode.textContent ); + alert(thisNode.textContent); thisNode = iterator.iterateNext(); } -} -catch (e) { - dump( 'Error: Document tree modified during iteraton ' + e ); +} catch (e) { + dump("Error: Document tree modified during iteraton " + e); } ``` @@ -151,11 +160,16 @@ Snapshot은 변환 문서로 바꾸지 않습니다. 그래서 반복자와는 ###### Snapshot 예 ```js -var nodesSnapshot = document.evaluate('//phoneNumber', documentNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); - -for ( var i=0 ; i < nodesSnapshot.snapshotLength; i++ ) -{ - dump( nodesSnapshot.snapshotItem(i).textContent ); +var nodesSnapshot = document.evaluate( + "//phoneNumber", + documentNode, + null, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, + null, +); + +for (var i = 0; i < nodesSnapshot.snapshotLength; i++) { + dump(nodesSnapshot.snapshotItem(i).textContent); } ``` @@ -173,9 +187,18 @@ for ( var i=0 ; i < nodesSnapshot.snapshotLength; i++ ) ###### First Node 예 ```js -var firstPhoneNumber = document.evaluate('//phoneNumber', documentNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ); - -dump( 'The first phone number found is ' + firstPhoneNumber.singleNodeValue.textContent ); +var firstPhoneNumber = document.evaluate( + "//phoneNumber", + documentNode, + null, + XPathResult.FIRST_ORDERED_NODE_TYPE, + null, +); + +dump( + "The first phone number found is " + + firstPhoneNumber.singleNodeValue.textContent, +); ``` #### ANY_TYPE 상수 @@ -209,10 +232,10 @@ HTML이 namespace가 없기 때문에, 우리는 `namespaceResolver` 매개변 ```js var thisHeading = headings.iterateNext(); -var alertText = 'Level 2 headings in this document are:\n' +var alertText = "Level 2 headings in this document are:\n"; while (thisHeading) { - alertText += thisHeading.textContent + '\n'; + alertText += thisHeading.textContent + "\n"; thisHeading = headings.iterateNext(); } ``` @@ -251,9 +274,19 @@ req.send(null); var xmlDoc = req.responseXML; -var nsResolver = xmlDoc.createNSResolver( xmlDoc.ownerDocument == null ? xmlDoc.documentElement : xmlDoc.ownerDocument.documentElement); - -var personIterator = xmlDoc.evaluate('//person', xmlDoc, nsResolver, XPathResult.ANY_TYPE, null ); +var nsResolver = xmlDoc.createNSResolver( + xmlDoc.ownerDocument == null + ? xmlDoc.documentElement + : xmlDoc.ownerDocument.documentElement, +); + +var personIterator = xmlDoc.evaluate( + "//person", + xmlDoc, + nsResolver, + XPathResult.ANY_TYPE, + null, +); ``` ## 부록 @@ -273,8 +306,8 @@ var personIterator = xmlDoc.evaluate('//person', xmlDoc, nsResolver, XPathResult ```js function nsResolver(prefix) { var ns = { - 'xhtml' : 'http://www.w3.org/1999/xhtml', - 'mathml': 'http://www.w3.org/1998/Math/MathML' + xhtml: "http://www.w3.org/1999/xhtml", + mathml: "http://www.w3.org/1998/Math/MathML", }; return ns[prefix] || null; } @@ -283,7 +316,13 @@ function nsResolver(prefix) { 그러면 `document.evaluate` 호출은 다음과 같습니다. ```js -document.evaluate( '//xhtml:td/mathml:math', document, nsResolver, XPathResult.ANY_TYPE, null ); +document.evaluate( + "//xhtml:td/mathml:math", + document, + nsResolver, + XPathResult.ANY_TYPE, + null, +); ``` #### XPathResult 정의 상수 diff --git a/files/ko/web/xslt/element/number/index.md b/files/ko/web/xslt/element/number/index.md index 8177ada0181de2..fbbc21476710ed 100644 --- a/files/ko/web/xslt/element/number/index.md +++ b/files/ko/web/xslt/element/number/index.md @@ -32,6 +32,7 @@ original_slug: Web/XSLT/number - `count` - : 소스 트리에서 연속으로 셀 대상을 지정합니다. XPath 식을 씁니다. - `level` + - : 일련번호를 만드는데 소스 트리의 수준을 어떻게 고려해야 하는 지를 정의합니다. 유효한 값은 `single`, `multiple`, `any` 세 가지. 기본값은 `single`입니다. - `single` 목록의 항목대로 연속으로 형제 노드를 번호 매깁니다. 처리기는 `count` 속성과 일치하는 [`ancestor-or-self`](/ko/Transforming_XML_with_XSLT/Mozilla_XSLT%2f%2fXPath_Reference/Axes/ancestor-or-self) 축의 첫 번째 노드로 갑니다. 그리고 나서 역시 `count` 속성과 일치하는 앞선 형제(preceding siblings) 노드(있다면, 한 짝인 `from` 속성에 이르러 멈춤)를 모두 더하여 셉니다. 일치하지 않으면, sequence는 빈 목록입니다. @@ -45,6 +46,7 @@ original_slug: Web/XSLT/number - value - : 숫자에 주어진 형식을 적용합니다. 이것이 사용자 제공 숫자(노드 sequence 숫자와는 반대로)를 표준 `` 형식으로 구성하는 빠른 방법입니다. - format + - : 만드는 숫자의 형식을 정의합니다. - format="1" diff --git a/files/ko/web/xslt/index.md b/files/ko/web/xslt/index.md index 5a866d496ce423..589db6cbb746fc 100644 --- a/files/ko/web/xslt/index.md +++ b/files/ko/web/xslt/index.md @@ -7,47 +7,47 @@ slug: Web/XSLT ## Documentation -- [XSLT Element Reference](/en-US/docs/Web/XSLT/Element) +- [XSLT Element Reference](/ko/docs/Web/XSLT/Element) - : Reference. -- [Transforming XML with XSLT](/en-US/docs/Web/XSLT/Transforming_XML_with_XSLT) +- [Transforming XML with XSLT](/ko/docs/Web/XSLT/Transforming_XML_with_XSLT) - : XSLT는 스타일시트 만든 이가 그러길 바란다면 컨텐트를 모조리 다시 정리하고 다른 형식으로 변환하는 것을 포함하는 컨텐트 조작(manipulating)과 정렬이라는 중요한 두 방식으로 본래 XML 문서를 변환하게 합니다. -- [Using the Mozilla JavaScript interface to XSL Transformations](/en-US/docs/Web/XSLT/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations) +- [Using the Mozilla JavaScript interface to XSL Transformations](/ko/docs/Web/XSLT/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations) - : 이 문서는 Mozilla 1.2의 자바스크립트 인터페이스와 XSLT 처리 엔진까지 설명합니다. -- [Specifying parameters using processing instructions](/en-US/docs/Web/XSLT/PI_Parameters) +- [Specifying parameters using processing instructions](/ko/docs/Web/XSLT/PI_Parameters) - : Firefox allows stylesheet parameters to be specified when using the `` processing instruction. This is done using the `` PI described in this document. - [XSLT Tutorial](https://www.w3schools.com/xml/xsl_intro.asp) - : 이 [W3Schools](http://www.w3schools.com) 입문서는 읽는 이에게 XML 문서를 XHTML같은 다른 형식으로 변환하기 위해 어떻게 XSLT를 사용하는지를 가르칩니다. - [What is XSLT?](https://www.xml.com/pub/a/2000/08/holman/) - : XSLT와 XPath에 대한 이 방대한 해설은 두 기술에 대한 지식이 없다고 가정하고, 배경, 문맥, 구조, 개념, 입문 용어를 통해 읽는 이를 이끕니다. -- [Common XSLT Errors](/en-US/docs/Web/XSLT/Common_errors) +- [Common XSLT Errors](/ko/docs/Web/XSLT/Common_errors) - : This article lists some common problems using XSLT in Firefox. ## Related Topics -- [XML](/en-US/docs/Web/XML/XML_introduction), [XPath](/en-US/docs/Web/XPath) +- [XML](/ko/docs/Web/XML/XML_introduction), [XPath](/ko/docs/Web/XPath)