diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/markdown.js b/markdown.js index b5458e7..02c98d4 100644 --- a/markdown.js +++ b/markdown.js @@ -173,7 +173,7 @@ function attach(attachment) { let embeddedElement; if (attachment.mime.includes("image")) { - if (whitelist.some(source => link.includes(source)) || settingsstuff().imagewhitelist) { + if (whitelist.some(source => link.includes(source))) { const element = document.createElement("div"); element.classList.add("image-outer"); diff --git a/share/script.js b/share/script.js index 8c975ae..c66534b 100644 --- a/share/script.js +++ b/share/script.js @@ -19,6 +19,10 @@ async function loadsharedpost() { } } +function settingsstuff() { + return false; +} + function loadpost(p) { let user, content; let bridged = bridges.includes(p.u); @@ -105,10 +109,21 @@ function loadpost(p) { const links = content.match(/(?:https?|ftp):\/\/[^\s(){}[\]]+/g); const embd = embed(links); - if (embd) { - embd.forEach(embeddedElement => { - wrapperDiv.appendChild(embeddedElement); + if (embd || p.attachments) { + const embedsDiv = document.createElement('div'); + embedsDiv.classList.add('embeds'); + if (embd) { + embd.forEach(embeddedElement => { + embedsDiv.appendChild(embeddedElement); + }); + } + + p.attachments.forEach(attachment => { + const g = attach(attachment); + embedsDiv.appendChild(g); }); + + wrapperDiv.appendChild(embedsDiv); } loadPfp(user).then(pfpElement => { diff --git a/share/styles.css b/share/styles.css index 58c9fbb..3f507b6 100644 --- a/share/styles.css +++ b/share/styles.css @@ -23,6 +23,8 @@ bridge { .embed { border-radius: 5px; + max-width: 300px; + max-height: 300px; } .info {