Making MIUI forums usable

Disable all the annoying crap from the MIUI forums

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Making MIUI forums usable
// @description  Disable all the annoying crap from the MIUI forums
// @version      1.4
// @author       Mario O.M.
// @namespace    https://github.com/marioortizmanero/
// @match        http://*.miui.com/*
// @match        https://*.miui.com/*
// @match        https://web.archive.org/web/*/http://*.miui.com/*
// @match        https://web.archive.org/web/*/https://*.miui.com/*
// @grant        none
// ==/UserScript==

// This script isn't useful since the 8th of April, when the MIUI forums were merged into the Mi Community.

(function() {
    'use strict';
    var to_remove = [
        'cm', // Experience widget under upvoted posts
        'md_ctrl', // Big medals in the user data
        'sign', // Signature under the comments
        'pil cl', // Credits and such data under the profile image
        'b_rad_5', // Profile icons
        'pbg2', // Small experience bar under the profile icon
        'start', // Small medals under the profile icon
    ];

    for (let i = 0; i < to_remove.length; i++) {
        let element = document.getElementsByClassName(to_remove[i]);
        while (element.length > 0) {
            element[0].parentNode.removeChild(element[0]);
        }
    }

    const margins1 = document.getElementsByClassName('plc'); // Margins between comments 1
    for (let i = 0; i < margins1.length; i++) {
        margins1[i].style.padding = "4px 10px";
    }

    const margins2 = document.getElementsByClassName('t_fsz'); // Margins between comments 2
    for (let i = 0; i < margins2.length; i++) {
        margins2[i].style.minHeight = "40px";
    }

    const stamp = document.getElementById('threadstamp'); // Stamp in some posts
    stamp.style.display = "none";
})();