add sentence quiz

This commit is contained in:
patarapolw committed 2019-08-16 14:27:15 +07:00
1 parent 4fe298eab0
commit 80b0b86d66
4 files changed
+31 -3

No files matched your search

+14 -1
View File
@@ -8,7 +8,20 @@ window.addEventListener("keydown", (ev) => {
speak(s);
}
}
})
});
window.onload = () => {
for (const a of Array.from(document.getElementsByTagName("a"))) {
const href = a.href;
console.log(href);
const m = /^slide:github:([^/]+)\/([^/]+)\/(.+)$/.exec(href);
if (m) {
const url = new URL("https://reveal-md.herokuapp.com/");
url.searchParams.append("q", `https://raw.githubusercontent.com/${m[1]}/${m[2]}/master/src/resources/${m[3]}`);
a.href = url.href;
}
}
}
function speak(s: string) {
const allVoices = speechSynthesis.getVoices();
+1 -1
View File
@@ -8,4 +8,4 @@ tags:
### Sentence quiz
Please see [`github:patarapolw/zhdiary/slides/句子1.1.md`]()
Please see [`slide:github:patarapolw/zhdiary/slides/句子1.1.md`](slide:github:patarapolw/zhdiary/slides/句子1.1.md)