jvc-nocaps

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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]);
    }

})();