Reduce borders

Reduce those unnecessary large borders

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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%");
    }
})();