diff options
-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; |