Skip to content

Commit

Permalink
Merge pull request #857 from lean-ja/Seasawher/issue534
Browse files Browse the repository at this point in the history
テスト: iPadおよびiPhoneのsafariではページごとの実行ボタンが動作しない
  • Loading branch information
Seasawher authored Sep 21, 2024
2 parents cca0c30 + 4b673a9 commit 6060a60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
21 changes: 8 additions & 13 deletions assets/filePlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@
// 演習問題のファイルのみ、`Examples` ディレクトリではなくて `Exercise` ディレクトリにある
editButtonLink.href = editButtonLink.href.replace('/Examples/Exercise/', '/Exercise/');

// ボタンをクリックしたときに以下を実行
editButtonLink.addEventListener('click', async function (e) {
// デフォルトの挙動をキャンセル
e.preventDefault();

fetch(editButtonLink.href)
.then(response => response.text())
.then(body => {
const escaped_code = encodeURIComponent(body);
const url = `https://live.lean-lang.org/#code=${escaped_code}`;
open(url);
});
});
// URL を書き換える
fetch(editButtonLink.href)
.then(response => response.text())
.then(body => {
const escaped_code = encodeURIComponent(body);
const url = `https://live.lean-lang.org/#code=${escaped_code}`;
editButtonLink.href = url;
});
})();
2 changes: 1 addition & 1 deletion theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</a>
{{/if}}
{{#if git_repository_edit_url}}
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit">
<a href="{{git_repository_edit_url}}" title="Suggest an edit" aria-label="Suggest an edit" target=_blank>
<i id="git-edit-button" class="fa fa-edit"></i>
</a>
{{/if}}
Expand Down

0 comments on commit 6060a60

Please sign in to comment.