LZT BoldMessage

Всегда пишем жирным текстом

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         LZT BoldMessage
// @namespace    https://greasyfork.org/ru/users/1142494-llimonix
// @version      1.4
// @description  Всегда пишем жирным текстом
// @author       llimonix
// @match        https://zelenka.guru/threads/*
// @match        https://lolz.guru/threads/*
// @icon         https://cdn-icons-png.flaticon.com/512/5838/5838522.png
// @grant        unsafeWindow
// @license      MIT
// ==/UserScript==

(function() {
    const LZTBparentElement = document.querySelector("div.fr-element.fr-view.fr-element-scroll-visible");
    function wrapTextInBoldAndCenter(element) {
        element.innerHTML = `<div style="font-weight: bold;">${element.innerHTML}</div>`;
    }
    function handleMessages() {
        const LZTBmessages = document.querySelectorAll('div.fr-element:not(.processed), .custom:not(.processed)');
        LZTBmessages.forEach(message => {
            wrapTextInBoldAndCenter(LZTBmessages);
            LZTBparentElement.classList.add('processed');
        });
        const LZTBnestedDiv = LZTBparentElement.querySelector("div");
        if (!LZTBnestedDiv) {
            if (LZTBmessages.innerHTML == undefined) {
                LZTBparentElement.innerHTML = `<div style="font-weight: bold">${LZTBparentElement.innerHTML}</div>`;
            } else {
                LZTBparentElement.innerHTML = `<div style="font-weight: bold;">${LZTBparentElement.innerHTML}</div>`;
            }
        }
    }
    LZTBparentElement.addEventListener("keydown", function(event) {
        handleMessages();
    });
})();