Reduce borders

Reduce those unnecessary large borders

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Reduce borders
// @version      1.1
// @description  Reduce those unnecessary large borders
// @author       A Meaty Alt
// @include      /fairview\.deadfrontier\.com/
// @grant        none
// @namespace https://greasyfork.org/users/150647
// ==/UserScript==

(function() {
    'use strict';
    var lBorder = 0;
    var rBorder = isGM()? 35 : 33;
    var wrapper = 1;
    var header = 2;
    var tCenter1 = 2;
    var tCenter2 = 4;
    var tCenter3 = 5;
    var tCenter4 = 6;
    var tCenter5 = 7;
    var tProfile = 8;
    var tdProfile = 10;
    var centerBackground = 14;
    fixLeftBorder();
    fixRightBorder();
    fixAllCenter();

    function isGM(){
        return $("td.design2010")[20].textContent.indexOf("GM") > -1;
    }
    function fixLeftBorder(){
        $("td.design2010")[lBorder].setAttribute("width", "10%");
    }
    function fixRightBorder(){
        $("td.design2010")[rBorder].setAttribute("width", "10%");
    }
    function fixAllCenter(){
        fixWrapper();
        fixHeader();
        fixCenter();
        fixProfile();
    }
    function fixWrapper(){
        $("table.design2010")[wrapper].setAttribute("width", "100%");
    }
    function fixHeader(){
        $("td.design2010")[header].style.backgroundRepeat = "round";
    }
    function fixCenter(){
        $("table.design2010")[tCenter1].setAttribute("width", "100%");
        $("table.design2010")[tCenter2].setAttribute("width", "100%");
        $("table.design2010")[tCenter3].setAttribute("width", "100%");
        $("table.design2010")[tCenter4].setAttribute("width", "100%");
        $("table.design2010")[tCenter5].setAttribute("width", "100%");
        $("td.design2010")[centerBackground].style.backgroundRepeat = "round";
        $("td.design2010")[centerBackground].style.backgroundPosition = "";
    }
    function fixProfile(){
        $("table.design2010")[tProfile].setAttribute("width", "100%");
        $("td.design2010")[tdProfile].setAttribute("width", "20%");
    }
})();