File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 5
5
* 一瞬元のアイコンが表示されるのを防ぐためにHTML側で上書きを行っていることに注意
6
6
*/
7
7
function filePlay ( ) {
8
- // 編集ボタンのアイコン部分の `i` 要素
9
- const editButtonIcon = document . querySelector ( "#lean-play-button" ) ;
8
+ // ボタンのアイコン部分の `i` 要素
9
+ const playButtonIcon = document . querySelector ( "#lean-play-button" ) ;
10
10
11
- // 編集ボタンを表す `a` 要素
12
- const editButtonLink = editButtonIcon . parentElement ;
11
+ // ボタンを表す `a` 要素
12
+ const playButtonLink = playButtonIcon . parentElement ;
13
13
14
14
// 拡張子が `.md` になっているので `.lean` に修正する
15
- editButtonLink . href = editButtonLink . href . replace ( / \. m d $ / , ".lean" ) ;
15
+ playButtonLink . href = playButtonLink . href . replace ( / \. m d $ / , ".lean" ) ;
16
16
17
17
// Lean ファイルがあるのは `booksrc` ではなく `LeanByExample` ディレクトリ
18
- editButtonLink . href = editButtonLink . href . replace (
18
+ playButtonLink . href = playButtonLink . href . replace (
19
19
"/booksrc/" ,
20
20
"/LeanByExample/" ,
21
21
) ;
22
22
23
23
// URL を書き換える
24
- fetch ( editButtonLink . href )
24
+ fetch ( playButtonLink . href )
25
25
. then ( ( response ) => response . text ( ) )
26
26
. then ( ( body ) => {
27
27
const escaped_code = encodeURIComponent ( body ) ;
28
28
const url = `https://live.lean-lang.org/#code=${ escaped_code } ` ;
29
- editButtonLink . href = url ;
29
+ playButtonLink . href = url ;
30
30
} ) ;
31
31
}
32
32
You can’t perform that action at this time.
0 commit comments