aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index ec2ea630..4ac40b65 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -167,6 +167,13 @@ class Client {
});
}
+ api_pronounce(index) {
+ const dfn = this.definitions[index];
+ const url = `http://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kana=${dfn.reading}&kanji=${dfn.expression}`;
+ const audio = new Audio(url);
+ audio.play();
+ }
+
api_displayKanji(kanji) {
bgFindKanji(kanji, (definitions) => {
const sequence = ++this.sequence;