Skip to content

Commit f4c4e54

Browse files
authored
Merge pull request #314 from ut-code/develop
`develop` を `master` にマージ
2 parents 552e50e + ca97a11 commit f4c4e54

File tree

12 files changed

+45
-45
lines changed

12 files changed

+45
-45
lines changed

docs/2-browser-apps/08-css-arrangement/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,6 @@ HTML の要素は、ブロックレベル要素とインライン要素に分類
500500
### 参考: サンプルで使われている CSS プロパティの一覧
501501

502502
- `display`
503-
- `flex-grow`
504-
- `flex-shrink`
505-
- `flex-basis`
506503
- `flex-direction`
507504
- `justify-content`
508505
- `align-self`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function pressed() {
2-
console.log("キーを押しました");
2+
document.write("キーを押しました");
33
}
44

55
window.addEventListener("keypress", pressed);

docs/2-browser-apps/09-project/_samples/calender/index.html renamed to docs/2-browser-apps/09-project/_samples/calendar/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<html lang="ja">
33
<head>
44
<meta charset="UTF-8" />
5-
<title>Calender</title>
5+
<title>Calendar</title>
66
<link rel="stylesheet" href="style.css" />
77
</head>
88
<body>
9-
<table id="calender"></table>
9+
<table id="calendar"></table>
1010
<button id="button">消去</button>
1111
<script src="script.js"></script>
1212
</body>

docs/2-browser-apps/09-project/_samples/calender/script.js renamed to docs/2-browser-apps/09-project/_samples/calendar/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const year = today.getFullYear();
44
const month = today.getMonth();
55
const startDate = new Date(year, month, 1);
66
const endDate = new Date(year, month + 1, 0);
7-
const calender = document.getElementById("calender");
7+
const calendar = document.getElementById("calendar");
88
const button = document.getElementById("button");
99

1010
// 編集中の予定を追うための変数
@@ -22,12 +22,12 @@ for (let i = 0; i < 7; i += 1) {
2222
}
2323

2424
// 曜日の行を追加
25-
calender.appendChild(firstRow);
25+
calendar.appendChild(firstRow);
2626

2727
// 日付の行を作成
2828
for (let x = 1; x <= 6; x += 1) {
2929
const tr = document.createElement("tr");
30-
calender.appendChild(tr);
30+
calendar.appendChild(tr);
3131
for (let y = 1; y <= 7; y += 1) {
3232
const td = document.createElement("td");
3333
const ul = document.createElement("ul");

docs/2-browser-apps/09-project/_samples/calender/style.css renamed to docs/2-browser-apps/09-project/_samples/calendar/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#calender > td,
1+
#calendar > td,
22
th {
33
border: 1px solid black;
44
}
55

6-
#calender {
6+
#calendar {
77
border-collapse: collapse;
88
}
99

docs/2-browser-apps/09-project/_samples/event-target/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Document</title>
66
</head>
77
<body>
8-
<div id="div">ここをクリック!</div>
8+
<button id="button">ここをクリック!</button>
99
<script src="script.js"></script>
1010
</body>
1111
</html>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function clicked(e) {
2-
console.log(e.target.tagName);
2+
document.write(e.target.tagName);
33
}
44

5-
const div = document.getElementById("div");
5+
const div = document.getElementById("button");
66

77
div.onclick = clicked;
File renamed without changes.

docs/2-browser-apps/09-project/index.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: プロジェクト
55
import Term from "@site/src/components/Term";
66
import ViewSource from "@site/src/components/ViewSource";
77
import ExternalVideoPlayer from "@site/src/components/ExternalVideoPlayer";
8-
import calenderVideo from "./calender.mp4";
8+
import calendarVideo from "./calendar.mp4";
99

1010
ここまでの知識を使って、今月分の予定管理アプリを作ってみましょう。
1111

@@ -16,20 +16,22 @@ import calenderVideo from "./calender.mp4";
1616
- 編集中には消去ボタンが現れ、押すと予定を削除できる。
1717
- 編集中に別の場所を押したりエンターキーを押したりすると予定が確定する(何も入力していない状態だと消える)
1818

19-
<video src={calenderVideo} controls loop autoPlay muted />
19+
<video src={calendarVideo} controls loop autoPlay muted />
2020

2121
## ヒント
2222

23-
いきなり作るのが難しい場合はタスクを分解してみましょう。今回は大まかに<br/>
24-
① カレンダーを作る<br/>
25-
② カレンダーに機能をつける<br/>
26-
の2つの仕事があるので、まず ① からやっていきましょう。
23+
いきなり作るのが難しい場合はタスクを分解してみましょう。今回は大まかに
2724

28-
### ① について
25+
1. カレンダーを作る
26+
2. カレンダーに機能をつける
2927

30-
- HTML 要素の作成は`document.createElement`関数を使って行えます。また、`appendChild`メソッドを用いることで要素内に子要素を追加することができます
28+
の2つの仕事があるので、まず 1 からやっていきましょう
3129

32-
- 表を作るわけなので`table`タグを使うのですが、日数を1から30前後までいちいち html ファイルに書き込んでいくのは手間ですし応用が効かないので、JavaScript ファイル上で繰り返しを使ってコードを簡潔にしましょう。もちろん今月の日数はカレンダーを見ればわかりますが、[`Date` クラス](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Date)を用いて月初めの日と月終わりの日を取ってこれば、計算をしなくても始まりの曜日や月の日数が取ってこれそうですね。
30+
### 1 について
31+
32+
- HTML 要素の作成は `document.createElement` 関数を使って行えます。また、`appendChild` メソッドを用いることで要素内に子要素を追加することができます。
33+
34+
- 表を作るわけなので `table` タグを使うのですが、日数を1から30前後までいちいち HTML ファイルに書き込んでいくのは手間ですし応用が効かないので、JavaScript ファイル上で繰り返しを使ってコードを簡潔にしましょう。もちろん今月の日数はカレンダーを見ればわかりますが、[`Date` クラス](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Date)を用いて月初めの日と月終わりの日を取ってこれば、計算をしなくても始まりの曜日や月の日数が取ってこれそうですね。
3335

3436
```javascript
3537
const today = new Date();
@@ -42,40 +44,40 @@ const endDate = new Date(year, month + 1, 0);
4244
- 後で日付の下に予定を追加したり予定を編集したりしたいので、予定を書き込むための要素も作ったうえで、その要素を保存するオブジェクトを作っておきましょう。
4345

4446
```javascript
45-
//予定を書き込むための要素を格納するオブジェクト
47+
// 予定を書き込むための要素を格納するオブジェクト
4648
const container = {};
47-
//ここに予定を打ち込む要素を保存しておく
49+
// ここに予定を打ち込む要素を保存しておく
4850
```
4951

50-
### について
52+
### 2 について
5153

52-
- 要素をクリックした時に実行される関数は要素の`onclick` <Term type="javascriptProperty">プロパティ</Term>から設定することができます。
54+
- 要素をクリックした時に実行される関数は要素の `onclick` <Term type="javascriptProperty">プロパティ</Term>から設定することができます。
5355

54-
- イベントが発生して関数が呼び出されると、一番目の引数に発生したイベントの情報が格納された `Event` オブジェクトが渡されてきます。`Event`オブジェクトの`target`<Term type="javascriptProperty">プロパティ</Term>を用いることで、クリックした要素を取得することができます。取得した要素の種類によって関数を変えることで、予定の編集や追加の機能を実現できます。
56+
- イベントが発生して関数が呼び出されると、一番目の引数に発生したイベントの情報が格納された `Event` オブジェクトが渡されてきます。`Event` オブジェクトの `target` <Term type="javascriptProperty">プロパティ</Term>を用いることで、クリックした要素を取得することができます。取得した要素の種類によって関数を変えることで、予定の編集や追加の機能を実現できます。
5557

5658
```html title="index.html"
57-
<div id="div">ここをクリック!</div>
59+
<button id="button">ここをクリック!</button>
5860
```
5961

6062
```javascript title="script.js"
6163
function clicked(e) {
62-
console.log(e.target.tagName);
64+
document.write(e.target.tagName);
6365
}
6466

65-
const div = document.getElementById("div");
67+
const div = document.getElementById("button");
6668

6769
div.onclick = clicked;
6870
```
6971

7072
<ViewSource url={import.meta.url} path="_samples/event-target" />
7173

72-
- グローバル変数の[`window`](https://developer.mozilla.org/ja/docs/Web/API/Window)は、スクリプトを実行しているウィンドウそのものを表します。この変数も`onclick`要素を指定することができます。
74+
- グローバル変数の [`window`](https://developer.mozilla.org/ja/docs/Web/API/Window) は、スクリプトを実行しているウィンドウそのものを表します。この変数も `onclick` 要素を指定することができます。
7375

74-
- [`addEventListener`メソッド](https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener)は、ターゲットに特定のイベントが行われるたびに呼び出される関数を設定します。
76+
- [`addEventListener` メソッド](https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener)は、ターゲットに特定のイベントが行われるたびに呼び出される関数を設定します。
7577

7678
```javascript title="script.js"
7779
function pressed() {
78-
console.log("キーを押しました");
80+
document.write("キーを押しました");
7981
}
8082

8183
window.addEventListener("keypress", pressed);
@@ -87,4 +89,4 @@ window.addEventListener("keypress", pressed);
8789

8890
解答例は次のリンクを参照してください。
8991

90-
<ViewSource url={import.meta.url} path="_samples/calender" />
92+
<ViewSource url={import.meta.url} path="_samples/calendar" />

docs/3-web-servers/01-wsl-setup/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ VS Code の `WSL` 拡張機能を用いると、VS Code を WSL 上で動かす
5252

5353
![WSL 拡張機能のインストール](./install-wsl-extension.png)
5454

55-
拡張機能をインストールすると、左下に緑色のボタンが出現します。クリックすると画面上部からメニューが出現するので、`New WSL Window` を選択しましょう。
55+
拡張機能をインストールすると、左下に緑色のボタンが出現します。クリックすると画面上部からメニューが出現するので、`Connect to WSL` を選択しましょう。
5656

5757
![WSLに接続](./connect-to-wsl.png)
5858

0 commit comments

Comments
 (0)