Improve CSS + date/time tag

This commit is contained in:
idotj 2023-09-23 19:57:20 +02:00
parent fdf15d60c9
commit d165c659aa
6 changed files with 103 additions and 117 deletions

View File

@ -1,3 +1,7 @@
v3.9.5 - 23/09/2023
- Improve CSS class names
- Use "time" tag for date format
v3.9.4 - 21/09/2023 v3.9.4 - 21/09/2023
- Add replies, reblog (boosts) and favourites counter - Add replies, reblog (boosts) and favourites counter

View File

@ -20,7 +20,7 @@
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
.dummy-container { .dummy-wrapper {
width: 100%; width: 100%;
max-width: 26rem; max-width: 26rem;
height: calc(100% - 4rem); height: calc(100% - 4rem);
@ -30,8 +30,8 @@
</head> </head>
<body> <body>
<div class="dummy-container"> <div class="dummy-wrapper">
<div class="mt-timeline"> <div class="mt-container">
<div id="mt-body" class="mt-body" role="feed"> <div id="mt-body" class="mt-body" role="feed">
<div class="loading-spinner"></div> <div class="loading-spinner"></div>
</div> </div>

View File

@ -1,4 +1,4 @@
/* Mastodon embed feed timeline v3.9.4 */ /* Mastodon embed feed timeline v3.9.5 */
/* More info at: */ /* More info at: */
/* https://gitlab.com/idotj/mastodon-embed-feed-timeline */ /* https://gitlab.com/idotj/mastodon-embed-feed-timeline */
@ -27,40 +27,39 @@ html[data-theme="dark"] {
} }
/* Main container */ /* Main container */
.mt-timeline { .mt-container {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
background: var(--bg-color); background: var(--bg-color);
scrollbar-color: var(--bg-hover-color) rgba(0, 0, 0, 0.1); scrollbar-color: var(--bg-hover-color) rgba(0, 0, 0, 0.1);
} }
.mt-timeline a:link, .mt-container a:link,
.mt-timeline a:active, .mt-container a:active,
.mt-timeline a { .mt-container a {
text-decoration: none; text-decoration: none;
color: var(--link-color); color: var(--link-color);
} }
.mt-timeline a:not(.toot-preview-link):hover { .mt-container a:not(.mt-toot-preview):hover {
text-decoration: underline; text-decoration: underline;
} }
.mt-timeline::-webkit-scrollbar { .mt-container::-webkit-scrollbar {
width: 0.75rem; width: 0.75rem;
height: 0.75rem; height: 0.75rem;
} }
.mt-timeline::-webkit-scrollbar-corner { .mt-container::-webkit-scrollbar-corner {
background: transparent; background: transparent;
} }
.mt-timeline::-webkit-scrollbar-thumb { .mt-container::-webkit-scrollbar-thumb {
border: 0 var(--content-text); border: 0 var(--content-text);
border-radius: 2rem; border-radius: 2rem;
background: var(--bg-hover-color); background: var(--bg-hover-color);
} }
.mt-timeline::-webkit-scrollbar-track { .mt-container::-webkit-scrollbar-track {
border: 0 var(--content-text); border: 0 var(--content-text);
border-radius: 0; border-radius: 0;
background: rgba(0, 0, 0, 0.1); background: rgba(0, 0, 0, 0.1);
} }
.mt-body { .mt-body {
padding: 1rem 1.5rem; padding: 1rem 1.5rem;
white-space: pre-wrap; white-space: pre-wrap;
@ -94,7 +93,7 @@ html[data-theme="dark"] {
} }
/* User avatar */ /* User avatar */
.mt-avatar { .mt-toot-avatar {
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
position: absolute; position: absolute;
@ -103,17 +102,17 @@ html[data-theme="dark"] {
border-radius: 0.25rem; border-radius: 0.25rem;
overflow: hidden; overflow: hidden;
} }
.mt-avatar-image img { .mt-toot-avatar-image img {
width: 100%; width: 100%;
height: auto; height: auto;
} }
.mt-avatar-image .mt-avatar-boosted { .mt-toot-avatar-image .mt-toot-avatar-boosted {
width: 2.25rem; width: 2.25rem;
height: 2.25rem; height: 2.25rem;
border-radius: 0.25rem; border-radius: 0.25rem;
overflow: hidden; overflow: hidden;
} }
.mt-avatar-image .mt-avatar-account { .mt-toot-avatar-image .mt-toot-avatar-account {
width: 1.5rem; width: 1.5rem;
height: 1.5rem; height: 1.5rem;
top: 1.5rem; top: 1.5rem;
@ -127,47 +126,47 @@ html[data-theme="dark"] {
.mt-toot-header { .mt-toot-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-start;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.mt-user { .mt-toot-header-user {
font-weight: 600; font-weight: 600;
padding-right: 1rem; padding-right: 1rem;
} }
.mt-user > a { .mt-toot-header-user > a {
color: var(--content-text) !important; color: var(--content-text) !important;
} }
.toot-date { .mt-toot-header-date {
font-size: 0.75rem; font-size: 0.75rem;
text-align: right; text-align: right;
} }
/* Text */ /* Text */
.toot-text { .mt-toot-text {
margin-bottom: 1rem; margin-bottom: 1rem;
color: var(--content-text); color: var(--content-text);
} }
.toot-text .spoiler-link { .mt-toot-text .spoiler-btn {
display: inline-block; display: inline-block;
} }
.toot-text .spoiler-text-hidden { .mt-toot-text .spoiler-text-hidden {
display: none; display: none;
} }
.toot-text.truncate { .mt-toot-text.truncate {
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
-webkit-line-clamp: var(--text-max-lines); -webkit-line-clamp: var(--text-max-lines);
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.toot-text:not(.truncate) .ellipsis::after { .mt-toot-text:not(.truncate) .ellipsis::after {
content: "..."; content: "...";
} }
.toot-text blockquote { .mt-toot-text blockquote {
border-left: 0.25rem solid var(--line-gray-color); border-left: 0.25rem solid var(--line-gray-color);
margin-left: 0; margin-left: 0;
padding-left: 0.5rem; padding-left: 0.5rem;
} }
.toot-text .custom-emoji { .mt-toot-text .custom-emoji {
height: 1.5rem; height: 1.5rem;
min-width: 1.5rem; min-width: 1.5rem;
margin-bottom: -0.25rem; margin-bottom: -0.25rem;
@ -175,58 +174,42 @@ html[data-theme="dark"] {
} }
/* Poll */ /* Poll */
.toot-poll { .mt-toot-poll {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
color: var(--content-text); color: var(--content-text);
} }
.toot-poll ul { .mt-toot-poll ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.toot-poll ul li { .mt-toot-poll ul li {
font-size: 0.9rem; font-size: 0.9rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.toot-poll ul li:not(:last-child) { .mt-toot-poll ul li:not(:last-child) {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
.toot-poll ul li:before { .mt-toot-poll ul li:before {
content: "◯"; content: "◯";
padding-right: 0.5rem; padding-right: 0.5rem;
} }
/* Medias */ /* Medias */
.toot-media { .mt-toot-media {
overflow: hidden; overflow: hidden;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.toot-media-preview { .mt-toot-media > .spoiler-btn {
position: relative;
margin-top: 0.25rem;
height: auto;
text-align: center;
width: 100%;
}
.toot-media > .spoiler-link {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
z-index: 1; z-index: 1;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.toot-media-spoiler > img { .mt-toot-media-spoiler > img {
filter: blur(2rem); filter: blur(2rem);
} }
.toot-media-preview a {
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.img-ratio14_7 { .img-ratio14_7 {
position: relative; position: relative;
padding-top: 56.95%; padding-top: 56.95%;
@ -243,7 +226,7 @@ html[data-theme="dark"] {
} }
/* Preview link */ /* Preview link */
.toot-preview-link { .mt-toot-preview {
min-height: 4rem; min-height: 4rem;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -254,23 +237,23 @@ html[data-theme="dark"] {
margin: 1rem 0; margin: 1rem 0;
overflow: hidden; overflow: hidden;
} }
.toot-preview-image { .mt-toot-preview-image {
width: 40%; width: 40%;
align-self: stretch; align-self: stretch;
} }
.toot-preview-image img { .mt-toot-preview-image img {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
.toot-preview-noImage { .mt-toot-preview-noImage {
width: 40%; width: 40%;
font-size: 1.5rem; font-size: 1.5rem;
align-self: center; align-self: center;
text-align: center; text-align: center;
} }
.toot-preview-content { .mt-toot-preview-content {
width: 60%; width: 60%;
display: flex; display: flex;
align-self: center; align-self: center;
@ -278,12 +261,12 @@ html[data-theme="dark"] {
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
gap: 0.5rem; gap: 0.5rem;
} }
.toot-preview-title { .mt-toot-preview-title {
font-weight: 600; font-weight: 600;
} }
/* Spoiler button */ /* Spoiler button */
.spoiler-link { .spoiler-btn {
border-radius: 2px; border-radius: 2px;
background-color: var(--line-gray-color); background-color: var(--line-gray-color);
border: 0; border: 0;
@ -298,25 +281,23 @@ html[data-theme="dark"] {
} }
/* Counter bar */ /* Counter bar */
.mt-counter-bar { .mt-toot-counter-bar {
display: flex; display: flex;
gap: clamp(0.25rem, 1vw, 1.5rem); gap: clamp(0.25rem, 1vw, 1.5rem);
color: var(--link-color); color: var(--link-color);
} }
.mt-toot-counter-bar-replies,
.mt-counter-replies, .mt-toot-counter-bar-reblog,
.mt-counter-reblog, .mt-toot-counter-bar-favorites {
.mt-counter-favorites {
display: flex; display: flex;
font-size: 0.75rem; font-size: 0.75rem;
gap: 0.25rem; gap: 0.25rem;
align-items: center; align-items: center;
opacity: 0.5; opacity: 0.5;
} }
.mt-toot-counter-bar-replies > svg,
.mt-counter-replies > svg, .mt-toot-counter-bar-reblog > svg,
.mt-counter-reblog > svg, .mt-toot-counter-bar-favorites > svg {
.mt-counter-favorites > svg {
width: 1rem; width: 1rem;
fill: var(--link-color); fill: var(--link-color);
} }

View File

@ -1,5 +1,5 @@
/** /**
* Mastodon embed feed timeline v3.9.4 * Mastodon embed feed timeline v3.9.5
* More info at: * More info at:
* https://gitlab.com/idotj/mastodon-embed-feed-timeline * https://gitlab.com/idotj/mastodon-embed-feed-timeline
*/ */
@ -166,7 +166,7 @@ MastodonApi.prototype.buildTimeline = async function () {
this.INSTANCE_URL + this.INSTANCE_URL +
"/" + "/" +
linkSeeMorePath + linkSeeMorePath +
'" class="btn" target="_blank" rel="nofollow noopener noreferrer">' + '" target="_blank" rel="nofollow noopener noreferrer">' +
this.LINK_SEE_MORE + this.LINK_SEE_MORE +
"</a></div>"; "</a></div>";
this.mtBodyContainer.parentNode.insertAdjacentHTML( this.mtBodyContainer.parentNode.insertAdjacentHTML(
@ -186,16 +186,13 @@ MastodonApi.prototype.buildTimeline = async function () {
e.target.localName == "article" || e.target.localName == "article" ||
e.target.offsetParent?.localName == "article" || e.target.offsetParent?.localName == "article" ||
(e.target.localName == "img" && (e.target.localName == "img" &&
e.target.offsetParent.className !== "mt-avatar" && e.target.offsetParent.className !== "mt-toot-avatar" &&
e.target.offsetParent.className !== "mt-avatar-account") e.target.offsetParent.className !== "mt-toot-avatar-account")
) { ) {
openTootURL(e); openTootURL(e);
} }
// Check if Show More/Less button was clicked // Check if Show More/Less button was clicked
if ( if (e.target.localName == "button" && e.target.className == "spoiler-btn") {
e.target.localName == "button" &&
e.target.className == "spoiler-link"
) {
toogleSpoiler(e); toogleSpoiler(e);
} }
}); });
@ -216,7 +213,7 @@ MastodonApi.prototype.buildTimeline = async function () {
e.target.localName !== "a" && e.target.localName !== "a" &&
e.target.localName !== "span" && e.target.localName !== "span" &&
e.target.localName !== "button" && e.target.localName !== "button" &&
e.target.parentNode.className !== "toot-preview-image" && e.target.parentNode.className !== "mt-toot-preview-image" &&
urlToot urlToot
) { ) {
window.open(urlToot, "_blank"); window.open(urlToot, "_blank");
@ -230,7 +227,7 @@ MastodonApi.prototype.buildTimeline = async function () {
const toogleSpoiler = function (e) { const toogleSpoiler = function (e) {
const nextSibling = e.target.nextSibling; const nextSibling = e.target.nextSibling;
if (nextSibling.localName === "img") { if (nextSibling.localName === "img") {
e.target.parentNode.classList.remove("toot-media-spoiler"); e.target.parentNode.classList.remove("mt-toot-media-spoiler");
e.target.style.display = "none"; e.target.style.display = "none";
} else if ( } else if (
nextSibling.classList.contains("spoiler-text-hidden") || nextSibling.classList.contains("spoiler-text-hidden") ||
@ -338,7 +335,7 @@ MastodonApi.prototype.getTimelineData = async function () {
return { ...result, ...dataItem }; return { ...result, ...dataItem };
}, {}); }, {});
// console.log("Timeline data: ", this.FETCHED_DATA); console.log("Timeline data fetched: ", this.FETCHED_DATA);
resolve(); resolve();
}); });
}); });
@ -359,7 +356,7 @@ MastodonApi.prototype.appendToot = function (c, i) {
* @param {number} i Index of toot * @param {number} i Index of toot
*/ */
MastodonApi.prototype.assambleToot = function (c, i) { MastodonApi.prototype.assambleToot = function (c, i) {
let avatar, user, url, date; let avatar, user, url, date, formattedDate;
if (c.reblog) { if (c.reblog) {
// BOOSTED toot // BOOSTED toot
@ -370,16 +367,16 @@ MastodonApi.prototype.assambleToot = function (c, i) {
avatar = avatar =
'<a href="' + '<a href="' +
c.reblog.account.url + c.reblog.account.url +
'" class="mt-avatar" rel="nofollow noopener noreferrer" target="_blank">' + '" class="mt-toot-avatar" rel="nofollow noopener noreferrer" target="_blank">' +
'<div class="mt-avatar-image">' + '<div class="mt-toot-avatar-image">' +
'<div class="mt-avatar-boosted">' + '<div class="mt-toot-avatar-boosted">' +
'<img src="' + '<img src="' +
c.reblog.account.avatar + c.reblog.account.avatar +
'" alt="' + '" alt="' +
c.reblog.account.username + c.reblog.account.username +
' avatar" loading="lazy" />' + ' avatar" loading="lazy" />' +
"</div>" + "</div>" +
'<div class="mt-avatar-account">' + '<div class="mt-toot-avatar-account">' +
'<img src="' + '<img src="' +
c.account.avatar + c.account.avatar +
'" alt="' + '" alt="' +
@ -391,7 +388,7 @@ MastodonApi.prototype.assambleToot = function (c, i) {
// User name and url // User name and url
user = user =
'<div class="mt-user">' + '<div class="mt-toot-header-user">' +
'<a href="' + '<a href="' +
c.reblog.account.url + c.reblog.account.url +
'" rel="nofollow noopener noreferrer" target="_blank">' + '" rel="nofollow noopener noreferrer" target="_blank">' +
@ -403,7 +400,7 @@ MastodonApi.prototype.assambleToot = function (c, i) {
"</div>"; "</div>";
// Date // Date
date = this.formatDate(c.reblog.created_at); date = c.reblog.created_at;
} else { } else {
// STANDARD toot // STANDARD toot
// Toot url // Toot url
@ -413,8 +410,8 @@ MastodonApi.prototype.assambleToot = function (c, i) {
avatar = avatar =
'<a href="' + '<a href="' +
c.account.url + c.account.url +
'" class="mt-avatar" rel="nofollow noopener noreferrer" target="_blank">' + '" class="mt-toot-avatar" rel="nofollow noopener noreferrer" target="_blank">' +
'<div class="mt-avatar-image">' + '<div class="mt-toot-avatar-image">' +
'<img src="' + '<img src="' +
c.account.avatar + c.account.avatar +
'" alt="' + '" alt="' +
@ -425,7 +422,7 @@ MastodonApi.prototype.assambleToot = function (c, i) {
// User name and url // User name and url
user = user =
'<div class="mt-user">' + '<div class="mt-toot-header-user">' +
'<a href="' + '<a href="' +
c.account.url + c.account.url +
'" rel="nofollow noopener noreferrer" target="_blank">' + '" rel="nofollow noopener noreferrer" target="_blank">' +
@ -435,16 +432,21 @@ MastodonApi.prototype.assambleToot = function (c, i) {
"</div>"; "</div>";
// Date // Date
date = this.formatDate(c.created_at); date = c.created_at;
} }
// Date // Date
formattedDate = this.formatDate(date);
let timestamp = let timestamp =
'<div class="toot-date">' + '<div class="mt-toot-header-date">' +
'<a href="' + '<a href="' +
url + url +
'" rel="nofollow noopener noreferrer" tabindex="-1" target="_blank">' + '" rel="nofollow noopener noreferrer" target="_blank">' +
'<time datetime="' +
date + date +
'">' +
formattedDate +
"</time>" +
"</a>" + "</a>" +
"</div>"; "</div>";
@ -463,7 +465,7 @@ MastodonApi.prototype.assambleToot = function (c, i) {
content = content =
'<div class="toot-text">' + '<div class="toot-text">' +
c.spoiler_text + c.spoiler_text +
' <button type="button" class="spoiler-link" aria-expanded="false">Show more</button>' + ' <button type="button" class="spoiler-btn" aria-expanded="false">Show more</button>' +
'<div class="spoiler-text-hidden">' + '<div class="spoiler-text-hidden">' +
this.formatTootText(c.content) + this.formatTootText(c.content) +
"</div>" + "</div>" +
@ -476,7 +478,7 @@ MastodonApi.prototype.assambleToot = function (c, i) {
content = content =
'<div class="toot-text">' + '<div class="toot-text">' +
c.reblog.spoiler_text + c.reblog.spoiler_text +
' <button type="button" class="spoiler-link" aria-expanded="false">Show more</button>' + ' <button type="button" class="spoiler-btn" aria-expanded="false">Show more</button>' +
'<div class="spoiler-text-hidden">' + '<div class="spoiler-text-hidden">' +
this.formatTootText(c.reblog.content) + this.formatTootText(c.reblog.content) +
"</div>" + "</div>" +
@ -487,19 +489,19 @@ MastodonApi.prototype.assambleToot = function (c, i) {
c.reblog.spoiler_text === "" c.reblog.spoiler_text === ""
) { ) {
content = content =
'<div class="toot-text ' + '<div class="mt-toot-text' +
text_css + text_css +
'">' + '">' +
"<div>" + '<div class="mt-toot-text-wrapper">' +
this.formatTootText(c.reblog.content) + this.formatTootText(c.reblog.content) +
"</div>" + "</div>" +
"</div>"; "</div>";
} else { } else {
content = content =
'<div class="toot-text ' + '<div class="mt-toot-text' +
text_css + text_css +
'">' + '">' +
"<div>" + '<div class="mt-toot-text-wrapper">' +
this.formatTootText(c.content) + this.formatTootText(c.content) +
"</div>" + "</div>" +
"</div>"; "</div>";
@ -534,32 +536,32 @@ MastodonApi.prototype.assambleToot = function (c, i) {
for (let i in c.poll.options) { for (let i in c.poll.options) {
pollOption += "<li>" + c.poll.options[i].title + "</li>"; pollOption += "<li>" + c.poll.options[i].title + "</li>";
} }
poll = '<div class="toot-poll">' + "<ul>" + pollOption + "</ul>" + "</div>"; poll = '<div class="mt-toot-poll">' + "<ul>" + pollOption + "</ul>" + "</div>";
} }
// Counter bar // Counter bar
let counterBar = ""; let counterBar = "";
if (!this.HIDE_COUNTER_BAR) { if (!this.HIDE_COUNTER_BAR) {
let repliesCount = let repliesCount =
'<div class="mt-counter-replies">' + '<div class="mt-toot-counter-bar-replies">' +
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1792 1600" aria-hidden="true"><path d="M1792 1056q0 166-127 451q-3 7-10.5 24t-13.5 30t-13 22q-12 17-28 17q-15 0-23.5-10t-8.5-25q0-9 2.5-26.5t2.5-23.5q5-68 5-123q0-101-17.5-181t-48.5-138.5t-80-101t-105.5-69.5t-133-42.5t-154-21.5t-175.5-6H640v256q0 26-19 45t-45 19t-45-19L19 621Q0 602 0 576t19-45L531 19q19-19 45-19t45 19t19 45v256h224q713 0 875 403q53 134 53 333z"/></svg>' + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1792 1600" aria-hidden="true"><path d="M1792 1056q0 166-127 451q-3 7-10.5 24t-13.5 30t-13 22q-12 17-28 17q-15 0-23.5-10t-8.5-25q0-9 2.5-26.5t2.5-23.5q5-68 5-123q0-101-17.5-181t-48.5-138.5t-80-101t-105.5-69.5t-133-42.5t-154-21.5t-175.5-6H640v256q0 26-19 45t-45 19t-45-19L19 621Q0 602 0 576t19-45L531 19q19-19 45-19t45 19t19 45v256h224q713 0 875 403q53 134 53 333z"/></svg>' +
c.replies_count + c.replies_count +
"</div>"; "</div>";
let reblogCount = let reblogCount =
'<div class="mt-counter-reblog">' + '<div class="mt-toot-counter-bar-reblog">' +
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1280" aria-hidden="true"><path d="M1280 1248q0 13-9.5 22.5t-22.5 9.5H288q-8 0-13.5-2t-9-7t-5.5-8t-3-11.5t-1-11.5V640H64q-26 0-45-19T0 576q0-24 15-41l320-384q19-22 49-22t49 22l320 384q15 17 15 41q0 26-19 45t-45 19H512v384h576q16 0 25 11l160 192q7 10 7 21zm640-416q0 24-15 41l-320 384q-20 23-49 23t-49-23l-320-384q-15-17-15-41q0-26 19-45t45-19h192V384H832q-16 0-25-12L647 180q-7-9-7-20q0-13 9.5-22.5T672 128h960q8 0 13.5 2t9 7t5.5 8t3 11.5t1 11.5v600h192q26 0 45 19t19 45z"/></svg>' + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1280" aria-hidden="true"><path d="M1280 1248q0 13-9.5 22.5t-22.5 9.5H288q-8 0-13.5-2t-9-7t-5.5-8t-3-11.5t-1-11.5V640H64q-26 0-45-19T0 576q0-24 15-41l320-384q19-22 49-22t49 22l320 384q15 17 15 41q0 26-19 45t-45 19H512v384h576q16 0 25 11l160 192q7 10 7 21zm640-416q0 24-15 41l-320 384q-20 23-49 23t-49-23l-320-384q-15-17-15-41q0-26 19-45t45-19h192V384H832q-16 0-25-12L647 180q-7-9-7-20q0-13 9.5-22.5T672 128h960q8 0 13.5 2t9 7t5.5 8t3 11.5t1 11.5v600h192q26 0 45 19t19 45z"/></svg>' +
c.reblogs_count + c.reblogs_count +
"</div>"; "</div>";
let favoritesCount = let favoritesCount =
'<div class="mt-counter-favorites">' + '<div class="mt-toot-counter-bar-favorites">' +
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1664 1600" aria-hidden="true"><path d="M1664 615q0 22-26 48l-363 354l86 500q1 7 1 20q0 21-10.5 35.5T1321 1587q-19 0-40-12l-449-236l-449 236q-22 12-40 12q-21 0-31.5-14.5T301 1537q0-6 2-20l86-500L25 663Q0 636 0 615q0-37 56-46l502-73L783 41q19-41 49-41t49 41l225 455l502 73q56 9 56 46z"/></svg>' + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1664 1600" aria-hidden="true"><path d="M1664 615q0 22-26 48l-363 354l86 500q1 7 1 20q0 21-10.5 35.5T1321 1587q-19 0-40-12l-449-236l-449 236q-22 12-40 12q-21 0-31.5-14.5T301 1537q0-6 2-20l86-500L25 663Q0 636 0 615q0-37 56-46l502-73L783 41q19-41 49-41t49 41l225 455l502 73q56 9 56 46z"/></svg>' +
c.favourites_count + c.favourites_count +
"</div>"; "</div>";
counterBar = counterBar =
'<div class="mt-counter-bar">' + '<div class="mt-toot-counter-bar">' +
repliesCount + repliesCount +
reblogCount + reblogCount +
favoritesCount + favoritesCount +
@ -691,12 +693,11 @@ MastodonApi.prototype.replaceHTMLtag = function (
MastodonApi.prototype.placeMedias = function (m, s) { MastodonApi.prototype.placeMedias = function (m, s) {
let spoiler = s || false; let spoiler = s || false;
const pic = const pic =
'<div class="toot-media ' + '<div class="mt-toot-media img-ratio14_7 ' +
(spoiler ? "toot-media-spoiler" : "") + (spoiler ? "mt-toot-media-spoiler " : "") +
" img-ratio14_7 " +
this.SPINNER_CLASS + this.SPINNER_CLASS +
'">' + '">' +
(spoiler ? '<button class="spoiler-link">Show content</button>' : "") + (spoiler ? '<button class="spoiler-btn">Show content</button>' : "") +
'<img src="' + '<img src="' +
m.preview_url + m.preview_url +
'" alt="' + '" alt="' +
@ -716,24 +717,24 @@ MastodonApi.prototype.placePreviewLink = function (c) {
let card = let card =
'<a href="' + '<a href="' +
c.url + c.url +
'" class="toot-preview-link" target="_blank" rel="noopener noreferrer">' + '" class="mt-toot-preview" target="_blank" rel="noopener noreferrer">' +
(c.image (c.image
? '<div class="toot-preview-image ' + ? '<div class="mt-toot-preview-image ' +
this.SPINNER_CLASS + this.SPINNER_CLASS +
'"><img src="' + '"><img src="' +
c.image + c.image +
'" alt="" loading="lazy" /></div>' '" alt="" loading="lazy" /></div>'
: '<div class="toot-preview-noImage">📄</div>') + : '<div class="mt-toot-preview-noImage">📄</div>') +
"</div>" + "</div>" +
'<div class="toot-preview-content">' + '<div class="mt-toot-preview-content">' +
(c.provider_name (c.provider_name
? '<span class="toot-preview-provider">' + c.provider_name + "</span>" ? '<span class="mt-toot-preview-provider">' + c.provider_name + "</span>"
: "") + : "") +
'<span class="toot-preview-title">' + '<span class="mt-toot-preview-title">' +
c.title + c.title +
"</span>" + "</span>" +
(c.author_name (c.author_name
? '<span class="toot-preview-author">By ' + c.author_name + "</span>" ? '<span class="mt-toot-preview-author">By ' + c.author_name + "</span>"
: "") + : "") +
"</div>" + "</div>" +
"</a>"; "</a>";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long