Kleverig Forum Thumbnail Enlarger

Makes forum thread thumbnails bigger for better visibility

Size

2.3 KB

Version

1.0.1

Created

Dec 12, 2025

Updated

4 days ago

1// ==UserScript==
2// @name		Kleverig Forum Thumbnail Enlarger
3// @description		Makes forum thread thumbnails bigger for better visibility
4// @version		1.0.1
5// @match		https://*.kleverig.eu/*
6// @icon		https://www.kleverig.eu/favicon.ico
7// ==/UserScript==
8(function() {
9    'use strict';
10    
11    console.log('Kleverig Forum Thumbnail Enlarger: Starting...');
12    
13    // Function to enlarge thumbnails
14    function enlargeThumbnails() {
15        const thumbnails = document.querySelectorAll('img.preview');
16        console.log(`Found ${thumbnails.length} thumbnails to enlarge`);
17        
18        thumbnails.forEach(thumbnail => {
19            thumbnail.style.width = '120px';
20            thumbnail.style.height = '120px';
21            thumbnail.style.objectFit = 'cover';
22        });
23    }
24    
25    // Apply styles immediately
26    enlargeThumbnails();
27    
28    // Also add CSS to ensure thumbnails stay enlarged
29    TM_addStyle(`
30        img.preview {
31            width: 120px !important;
32            height: 120px !important;
33            object-fit: cover !important;
34        }
35        
36        /* Adjust the thread status link container to accommodate larger thumbnails */
37        a.threadstatus {
38            display: inline-block;
39        }
40        
41        /* Ensure the threadinfo container has enough space */
42        .threadinfo {
43            min-height: 130px;
44        }
45    `);
46    
47    // Watch for dynamically loaded content
48    const observer = new MutationObserver((mutations) => {
49        let shouldEnlarge = false;
50        
51        mutations.forEach(mutation => {
52            mutation.addedNodes.forEach(node => {
53                if (node.nodeType === 1) {
54                    if (node.matches && node.matches('img.preview')) {
55                        shouldEnlarge = true;
56                    } else if (node.querySelector && node.querySelector('img.preview')) {
57                        shouldEnlarge = true;
58                    }
59                }
60            });
61        });
62        
63        if (shouldEnlarge) {
64            console.log('New thumbnails detected, enlarging...');
65            enlargeThumbnails();
66        }
67    });
68    
69    // Start observing the document for changes
70    observer.observe(document.body, {
71        childList: true,
72        subtree: true
73    });
74    
75    console.log('Kleverig Forum Thumbnail Enlarger: Active');
76})();
Kleverig Forum Thumbnail Enlarger | Robomonkey