jvc-nocaps

Get rid of POSTS on JVC where WORDS are UPPERCASED for some REASON.

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         jvc-nocaps
// @version      0.1
// @description  Get rid of POSTS on JVC where WORDS are UPPERCASED for some REASON.
// @author       kikakouti
// @match        http://www.jeuxvideo.com/forums/*
// @grant        none
// @namespace https://greatest.deepsurf.us/users/125911
// ==/UserScript==

(function() {
    'use strict';

    function regularReplacer(match, offset, string){
        return match.toLowerCase();
    }

    function removeUppercase(element) {

        if (element.childNodes && element.childNodes.length > 0) {
            for (var i in element.childNodes) {
                removeUppercase(element.childNodes[i]);
            }
        }

        if (element.nodeType == Node.TEXT_NODE && /\S/.test(element.nodeValue)) {
            var text = element.nodeValue;
            element.nodeValue = text.replace(/([A-ZÀÁÂÄÅÃÆÇÉÈÊËÍÌÎÏÑÓÒÔÖØÕOEÚÙÛÜÝY]{3,})/g, regularReplacer);
        }
    }

    var posts = document.getElementsByClassName("txt-msg");
    for (var i in posts) {
        removeUppercase(posts[i]);
    }

    var title = document.getElementById("bloc-title-forum");
    if (title) {
        removeUppercase(title);
    }

    var arianeCrumbs = document.getElementsByClassName("bloc-fil-ariane-crumb-forum");
    for (var j in arianeCrumbs) {
        removeUppercase(arianeCrumbs[j]);
    }

    var topicTitles = document.getElementsByClassName("topic-title");
    for (var k in topicTitles) {
        removeUppercase(topicTitles[k]);
    }

})();