Skip to content

Commit 0e34b18

Browse files
Merge branch 'master' into 1311
2 parents df82a92 + 3dead47 commit 0e34b18

File tree

7 files changed

+42
-41
lines changed

7 files changed

+42
-41
lines changed

2-ui/2-events/03-event-delegation/2-sliding-tree/task.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ importance: 5
1111
구체적인 요구사항은 다음과 같습니다.
1212

1313
- 단 하나의 이벤트 핸들러(이벤트 위임 사용하기)
14+
1415
- 노드(텍스트) 바깥(빈 곳)을 클릭하면 아무 일도 일어나지 않아야 합니다.

2-ui/2-events/03-event-delegation/3-sortable-table/solution.view/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
<thead>
2727
<tr>
2828
<th data-type="number">Age</th>
29-
<th data-type="string">Name</th>
29+
<th data-type="string">이름</th>
3030
</tr>
3131
</thead>
3232
<tbody>
3333
<tr>
3434
<td>5</td>
35-
<td>John</td>
35+
<td>일리야</td>
3636
</tr>
3737
<tr>
3838
<td>2</td>
39-
<td>Pete</td>
39+
<td>보라</td>
4040
</tr>
4141
<tr>
4242
<td>12</td>
43-
<td>Ann</td>
43+
<td>한솔</td>
4444
</tr>
4545
<tr>
4646
<td>9</td>
@@ -60,9 +60,9 @@
6060

6161
let th = e.target;
6262
// if TH, then sort
63-
// cellIndex is the number of th:
63+
// cellIndex는 몇 번째 열인지를 나타내는 인덱스 값입니다.
6464
// 0 for the first column
65-
// 1 for the second column, etc
65+
// 두 번째 열이라면 1이 됩니다.
6666
sortGrid(th.cellIndex, th.dataset.type);
6767
};
6868

@@ -71,7 +71,7 @@
7171

7272
let rowsArray = Array.from(tbody.rows);
7373

74-
// compare(a, b) compares two rows, need for sorting
74+
// 변수 compare에 할당할 함수 compare(a, b)는 두 행을 비교하고 필요에 따라 정렬을 진행합니다.
7575
let compare;
7676

7777
switch (type) {

2-ui/2-events/03-event-delegation/3-sortable-table/source.view/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,36 @@
2525
<table id="grid">
2626
<thead>
2727
<tr>
28-
<th data-type="number">Age</th>
28+
<th data-type="number">나이</th>
2929
<th data-type="string">Name</th>
3030
</tr>
3131
</thead>
3232
<tbody>
3333
<tr>
3434
<td>5</td>
35-
<td>John</td>
35+
<td>일리야</td>
3636
</tr>
3737
<tr>
3838
<td>2</td>
3939
<td>Pete</td>
4040
</tr>
4141
<tr>
4242
<td>12</td>
43-
<td>Ann</td>
43+
<td>호진</td>
4444
</tr>
4545
<tr>
4646
<td>9</td>
4747
<td>Eugene</td>
4848
</tr>
4949
<tr>
5050
<td>1</td>
51-
<td>Ilya</td>
51+
<td>호석</td>
5252
</tr>
5353
</tbody>
5454
</table>
5555

5656
<script>
57-
// ...your code...
57+
// ...여기에 코드를 작성하세요...
5858
</script>
5959

6060
</body>

2-ui/2-events/03-event-delegation/3-sortable-table/task.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@ importance: 4
22

33
---
44

5-
# Sortable table
5+
# 정렬 기능을 제공하는 표
66

7-
Make the table sortable: clicks on `<th>` elements should sort it by corresponding column.
7+
열 제목을 나타내는 요소인 `<th>`를 클릭하면 열 전체가 정렬되는 표를 만들어보세요.
88

9-
Each `<th>` has the type in the attribute, like this:
9+
모든 `<th>` 속성엔 다음과 같이 데이터의 타입이 정의되어 있습니다.
1010

1111
```html
1212
<table id="grid">
1313
<thead>
1414
<tr>
1515
*!*
16-
<th data-type="number">Age</th>
17-
<th data-type="string">Name</th>
16+
<th data-type="number">나이</th>
17+
<th data-type="string">이름</th>
1818
*/!*
1919
</tr>
2020
</thead>
2121
<tbody>
2222
<tr>
2323
<td>5</td>
24-
<td>John</td>
24+
<td>일리야</td>
2525
</tr>
2626
<tr>
2727
<td>10</td>
28-
<td>Ann</td>
28+
<td>보라</td>
2929
</tr>
3030
...
3131
</tbody>
3232
</table>
3333
```
3434

35-
In the example above the first column has numbers, and the second one -- strings. The sorting function should handle sort according to the type.
35+
위 예시에선 첫 번째 열엔 숫자가, 두 번째 열엔 문자열이 들어갑니다. 구현할 정렬 함수는 데이터 타입에 맞게 정렬을 해줘야 합니다.
3636

37-
Only `"string"` and `"number"` types should be supported.
37+
이 문제에선 `'숫자'``'문자열'` 타입만 다룬다고 가정하겠습니다.
3838

39-
The working example:
39+
제대로 해답을 작성했다면 다음 예시처럼 동작해야 합니다.
4040

4141
[iframe border=1 src="solution" height=190]
4242

2-ui/2-events/03-event-delegation/4-behavior-tooltip/source.view/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<style>
77
body {
88
height: 2000px;
9-
/* make body scrollable, the tooltip should work after the scroll */
9+
/* 높이를 일부러 키워서 스크롤이 나타나도록 하였습니다. 스크롤 위치에 상관없이 요구사항대로 툴팁이 나타나야 합니다. */
1010
}
1111

1212
.tooltip {
13-
/* some styles for the tooltip, you can use your own instead */
13+
/* 툴팁을 꾸며주기 위한 CSS입니다. 다른 스타일을 원하면 수정해도 괜찮습니다. */
1414
position: fixed;
1515
padding: 10px 20px;
1616
border: 1px solid #b3c9ce;
@@ -30,7 +30,7 @@
3030
<p>LaLaLa LaLaLa LaLaLa LaLaLa LaLaLa LaLaLa LaLaLa LaLaLa LaLaLa</p>
3131

3232
<button data-tooltip="the tooltip is longer than the element">Short button</button>
33-
<button data-tooltip="HTML<br>tooltip">One more button</button>
33+
<button data-tooltip="두 줄짜리<br>툴팁">...또 다른 버튼...</button>
3434

3535
<p>Scroll the page to make buttons appear on the top, check if the tooltips show up correctly.</p>
3636

2-ui/2-events/03-event-delegation/4-behavior-tooltip/task.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ importance: 5
44

55
# Tooltip behavior
66

7-
Create JS-code for the tooltip behavior.
7+
툴팁(tooltip)을 보여주는 JS 코드를 작성해봅시다.
88

9-
When a mouse comes over an element with `data-tooltip`, the tooltip should appear over it, and when it's gone then hide.
9+
`data-tooltip` 속성이 있는 요소에 마우스를 가져다 대면 툴팁이 보여야 하고, 마우스 커서가 요소에서 떠나면 툴팁이 사라져야 합니다.
1010

11-
An example of annotated HTML:
11+
`data-tooltip` 속성은 다음 HTML처럼 추가할 수 있습니다.
1212
```html
1313
<button data-tooltip="the tooltip is longer than the element">Short button</button>
14-
<button data-tooltip="HTML<br>tooltip">One more button</button>
14+
<button data-tooltip="두 줄짜리<br>툴팁">...또 다른 버튼...</button>
1515
```
1616

1717
Should work like this:
1818

1919
[iframe src="solution" height=200 border=1]
2020

21-
In this task we assume that all elements with `data-tooltip` have only text inside. No nested tags (yet).
21+
`data-tooltip`이 있는 요소엔 텍스트만 있다고 가정하겠습니다. 요소 안에 다른 태그가 있는 경우는 생각하지 않기로 합시다.
2222

2323
Details:
2424

25-
- The distance between the element and the tooltip should be `5px`.
26-
- The tooltip should be centered relative to the element, if possible.
25+
- 툴팁과 요소의 간격은 `5px`입니다.
26+
- 가능하면 툴팁은 요소를 기준으로 중앙에 있도록 합시다.
2727
- The tooltip should not cross window edges. Normally it should be above the element, but if the element is at the page top and there's no space for the tooltip, then below it.
28-
- The tooltip content is given in the `data-tooltip` attribute. It can be arbitrary HTML.
28+
- 툴팁안에 띄울 콘텐츠는 `data-tooltip` 속성에서 가져옵니다. 속성값은 HTML일 수 있습니다.
2929

3030
You'll need two events here:
31-
- `mouseover` triggers when a pointer comes over an element.
32-
- `mouseout` triggers when a pointer leaves an element.
31+
- `mouseover` -- 요소 안으로 포인터가 이동할 때 발생하는 이벤트
32+
- `mouseout`-- 요소 밖으로 포인터가 이동할 때 발생하는 이벤트
3333

34-
Please use event delegation: set up two handlers on `document` to track all "overs" and "outs" from elements with `data-tooltip` and manage tooltips from there.
34+
이벤트 위임을 사용해서 두 개의 핸들러만으로 원하는 기능을 구현하세요. `document`에 핸들러를 추가해 `data-tooltip` 속성이 있는 요소 안이나 밖으로 마우스 포인터가 이동하는 경우를 모두 감지하고 두 핸들러를 통해 툴팁을 보여주거나 감추시면 됩니다.
3535

3636
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
3737

38-
P.S. Only one tooltip may show up at a time.
38+
P.S. 한 번에 한 개의 툴팁 만 보여줄 수 있습니다.

6-data-storage/02-localstorage/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ for(let key of keys) {
127127
숫자나 객체 등 다른 자료형을 사용하게 되면 문자열로 자동 변환됩니다.
128128

129129
```js run
130-
sessionStorage.user = {name: "John"};
131-
alert(sessionStorage.user); // [object Object]
130+
localStorage.user = {name: "John"};
131+
alert(localStorage.user); // [object Object]
132132
```
133133

134134
`JSON`을 사용하면 객체를 쓸 수 있긴 합니다.
135135

136136
```js run
137-
sessionStorage.user = JSON.stringify({name: "John"});
137+
localStorage.user = JSON.stringify({name: "John"});
138138
139139
// 잠시 후
140-
let user = JSON.parse( sessionStorage.user );
140+
let user = JSON.parse( localStorage.user );
141141
alert( user.name ); // John
142142
```
143143

0 commit comments

Comments
 (0)