Slon/Static/html: Display images in user statuses
This commit is contained in:
parent
b104551bbd
commit
140284233d
3 changed files with 13 additions and 4 deletions
|
@ -24,6 +24,9 @@ a {
|
|||
color: #800;
|
||||
text-decoration-thickness: 2px;
|
||||
}
|
||||
.img-media {
|
||||
max-width: 640px;
|
||||
}
|
||||
.page-container {
|
||||
width: 800px;
|
||||
margin: auto;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!doctypehtml>
|
||||
<title></title>
|
||||
<link href=https://error.checksum.fail/css/12391289038129038.css rel=stylesheet>
|
||||
<link href=https://error.checksum.fail/css/9271390173902173.css rel=stylesheet>
|
||||
<link href=https://linusg.github.io/serenityos-emoji-font/SerenityOS-Emoji.css rel=stylesheet>
|
||||
<style>
|
||||
* {
|
||||
|
@ -26,4 +26,4 @@
|
|||
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js"></script>
|
||||
<script>dayjs.extend(window.dayjs_plugin_relativeTime)</script>
|
||||
<script src=https://error.checksum.fail/js/header.js></script>
|
||||
<script src=https://error.checksum.fail/js/12389290138092193.js></script>
|
||||
<script src=https://error.checksum.fail/js/29137902173921730271.js></script>
|
|
@ -82,7 +82,13 @@ function updateStatuses(user, statuses) {
|
|||
content_html += "<span title=Public>🌎</span> ";
|
||||
}
|
||||
content_html += "<span class=status-timestamp>" + smolDate(dayjs(status["created_at"]).fromNow()) + "</span><br></div>";
|
||||
content_html += "<div class=status-text>" + status["content"] + "</div>";
|
||||
content_html += "<div class=status-text>" + status["content"];
|
||||
if (!!status["media_attachments"] && status["media_attachments"].length) {
|
||||
for (var x = 0; x < status["media_attachments"].length; x++) {
|
||||
content_html += "<img class=img-media src=\"" + status["media_attachments"][x]["url"] + "\"></div>";
|
||||
}
|
||||
}
|
||||
content_html += "</div>";
|
||||
content_html += "<span class=status-counts>💬 " + status["replies_count"] + " 🔁 " + status["reblogs_count"] + " ⭐ " + status["favourites_count"] + "</span>";
|
||||
content_html += "<div class=status-footer>via <a href=" + status["application"]["website"] + ">" + status["application"]["name"] + "</a></div>";
|
||||
content.innerHTML = content_html;
|
||||
|
@ -119,7 +125,7 @@ function updateStatuses(user, statuses) {
|
|||
}
|
||||
pageContent.innerHTML = "";
|
||||
pageContent.appendChild(elements);
|
||||
updateStatusContainers();
|
||||
window.onload = updateStatusContainers();
|
||||
}
|
||||
|
||||
function getStatuses(user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue