diff options
author | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2023-01-31 11:43:32 +0300 |
---|---|---|
committer | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2023-01-31 11:43:32 +0300 |
commit | 9d706ff912121bbeb544187045300077f50189c0 (patch) | |
tree | 8fff26ca97078181e57daa4f57e37090afec30bb | |
parent | be78534e0327284378caf23752969eb0502f2744 (diff) | |
download | hovercard.js-master.tar.gz hovercard.js-master.zip |
-rw-r--r-- | hovercard.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hovercard.js b/hovercard.js index c20220f..d71de4a 100644 --- a/hovercard.js +++ b/hovercard.js @@ -14,7 +14,12 @@ var hovercards = { var new_box = document.createElement("div"); new_box.classList.add("hovercard"); if (hovercard_data["pname"]) { - new_box.innerHTML = "<strong>" + hovercard_data["pname"] + "</strong>" + console.log(hovercard_data); + var nick = "" + if (hovercard_data["nickname"]) { + nick = " (" + hovercard_data["nickname"] + ")" + } + new_box.innerHTML = "<strong>" + hovercard_data["pname"] + nick + "</strong>" } else { if (hovercard_data["title"]) { new_box.innerHTML = "<strong>" + hovercard_data["title"] + "</strong>" @@ -23,6 +28,9 @@ var hovercards = { if (hovercard_data["description"]) { new_box.innerHTML = new_box.innerHTML + "<p>" + hovercard_data["description"] + "</p>"; } + if (hovercard_data["note"]) { + new_box.innerHTML = new_box.innerHTML + "<p>" + hovercard_data["note"] + "</p>"; + } // if image available, add it if (hovercard_data["uphoto"]) { new_box.innerHTML = "<img src='" + hovercard_data["uphoto"] + "' alt='" + hovercard_data["pname"] + "' /><br>" + new_box.innerHTML; |