diff --git a/main.js b/main.js index 5ddb190..122c676 100644 --- a/main.js +++ b/main.js @@ -316,6 +316,43 @@ function doSearch(state = true) { temp += "
"; meaning.innerHTML += temp; } + //antonyms, synonyms + if (json[results[i]][o]["antonyms"] != undefined) { + let temp = "" + temp += "";
+ for (let e in json[results[i]][o]["antonyms"]) {
+ let r = json[results[i]][o]["antonyms"][e];
+ temp += ""+generateRuby(r);
+ if (json[r] != undefined) {
+ temp += " - ";
+ for (let i in json[r]) {
+ if (i != 0) temp += ", ";
+ temp += json[r][i]["translation"];
+ }
+ }
+ temp += "
";
+ }
+ temp += "
";
+ for (let e in json[results[i]][o]["synonyms"]) {
+ let r = json[results[i]][o]["synonyms"][e];
+ temp += ""+generateRuby(r);
+ if (json[r] != undefined) {
+ temp += " - ";
+ for (let i in json[r]) {
+ if (i != 0) temp += ", ";
+ temp += json[r][i]["translation"];
+ }
+ }
+ temp += "
";
+ }
+ temp += "
"+json[results[i]][o]["notes"]+"
";