aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-07-18 08:08:31 -0700
committerAlex Yatskov <alex@foosoft.net>2016-07-18 08:08:31 -0700
commita567ef360523e71040348fdded761c6d71a6d4d5 (patch)
treef662ea0b4566c69c21418fd9e5f05c5b7504f078 /ext/fg/js/client.js
parentcea8471290d906cc268902e82704f8efad82fda6 (diff)
Pronounce => Play Audio
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 1f77ed95..10e8a0ae 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -168,9 +168,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}`;
+ api_playAudio(index) {
+ const definition = this.definitions[index];
+
+ let url = `https://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kanji=${definition.expression}`;
+ if (definition.reading) {
+ url += `&kana=${definition.reading}`;
+ }
for (let key in this.audio) {
this.audio[key].pause();