From 01b07ffef629e3365b8bc53501b20d43763e2c5d Mon Sep 17 00:00:00 2001 From: mxdanger <32040254+mxdanger@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:50:30 -0700 Subject: [PATCH] Infoblock link text truncate --- web/_js/infoblock.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/_js/infoblock.js b/web/_js/infoblock.js index 6b758640..217ccafd 100644 --- a/web/_js/infoblock.js +++ b/web/_js/infoblock.js @@ -115,7 +115,7 @@ function createInfoBlock(entry) { entry.links.website.forEach(link => { if (link) { const websiteLinkElement = document.createElement("a"); - websiteLinkElement.className = "btn btn-primary" + websiteLinkElement.className = "btn btn-primary text-truncate" websiteLinkElement.target = "_blank"; websiteLinkElement.rel = "noopener noreferrer"; websiteLinkElement.href = link; @@ -138,8 +138,9 @@ function createInfoBlock(entry) { entry.links.discord.forEach(link => { if (link) { const discordLinkElement = document.createElement("a"); + discordLinkElement.className = "btn btn-primary text-truncate" discordLinkElement.target = "_blank"; - wikiLinkElement.rel = "noopener noreferrer"; + discordLinkElement.rel = "noopener noreferrer"; discordLinkElement.href = "https://discord.gg/" + link; discordLinkElement.innerHTML = ` ${link}`; discordGroupElement.appendChild(discordLinkElement); @@ -155,6 +156,7 @@ function createInfoBlock(entry) { entry.links.wiki.forEach(link => { if (link) { const wikiLinkElement = document.createElement("a"); + wikiLinkElement.className = "btn btn-primary text-truncate" wikiLinkElement.target = "_blank"; wikiLinkElement.rel = "noopener noreferrer"; wikiLinkElement.href = "https://place-wiki.stefanocoding.me/wiki/" + link.replace(/ /g, '_');