Reduce borders

Reduce those unnecessary large borders

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला 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%");
    }
})();