Skip to content

Commit b21b578

Browse files
committed
filePlay.js の修正
1 parent bbf57f1 commit b21b578

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

assets/filePlay.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
* 一瞬元のアイコンが表示されるのを防ぐためにHTML側で上書きを行っていることに注意
66
*/
77
function filePlay() {
8-
// 編集ボタンのアイコン部分の `i` 要素
9-
const editButtonIcon = document.querySelector("#lean-play-button");
8+
// ボタンのアイコン部分の `i` 要素
9+
const playButtonIcon = document.querySelector("#lean-play-button");
1010

11-
// 編集ボタンを表す `a` 要素
12-
const editButtonLink = editButtonIcon.parentElement;
11+
// ボタンを表す `a` 要素
12+
const playButtonLink = playButtonIcon.parentElement;
1313

1414
// 拡張子が `.md` になっているので `.lean` に修正する
15-
editButtonLink.href = editButtonLink.href.replace(/\.md$/, ".lean");
15+
playButtonLink.href = playButtonLink.href.replace(/\.md$/, ".lean");
1616

1717
// Lean ファイルがあるのは `booksrc` ではなく `LeanByExample` ディレクトリ
18-
editButtonLink.href = editButtonLink.href.replace(
18+
playButtonLink.href = playButtonLink.href.replace(
1919
"/booksrc/",
2020
"/LeanByExample/",
2121
);
2222

2323
// URL を書き換える
24-
fetch(editButtonLink.href)
24+
fetch(playButtonLink.href)
2525
.then((response) => response.text())
2626
.then((body) => {
2727
const escaped_code = encodeURIComponent(body);
2828
const url = `https://live.lean-lang.org/#code=${escaped_code}`;
29-
editButtonLink.href = url;
29+
playButtonLink.href = url;
3030
});
3131
}
3232

0 commit comments

Comments
 (0)