71
HFS ~ HTTP File Server / Re: how to inline images in folder view
« Last post by hanshenrik on August 01, 2024, 03:35:45 PM »Could try the thumbnails plugin: https://github.com/rejetto/thumbnails
But I don't really trust the author, looks like a shady fellow.
So I wrote this custom-html-footer code:
- half-joking, I need to be able to specify max-width, made a feature request here https://github.com/rejetto/thumbnails/issues/3
But I don't really trust the author, looks like a shady fellow.
So I wrote this custom-html-footer code:
Code: [Select]
(function () {
// todo: is there an event fired by HFS when all elements are loaded? that would be better than this retry approach.
let retryUntilSuccessFunction;
retryUntilSuccessFunction = function () {
let images = document.querySelectorAll('span[role="img"].fa-image');
if (images.length === 0) {
setTimeout(retryUntilSuccessFunction, 100);
return;
}
document.querySelectorAll('span[role="img"].fa-image').forEach(function (el) {
let span = el;
while (el.tagName.toLocaleLowerCase() !== 'a') {
el = el.parentNode;
}
let url = el.href;
let imageElement = document.createElement('img');
imageElement.src = url;
imageElement.style['max-width'] = '500px';
span.appendChild(imageElement);
});
};
retryUntilSuccessFunction();
})();
- half-joking, I need to be able to specify max-width, made a feature request here https://github.com/rejetto/thumbnails/issues/3
Recent Posts
I have his email, but I don't want to bother him with this, so I use this space to report that the forum's email system is completely broken. The forum system DOES NOT send any email. This means the following:


