YLCET Layout 1

Change YLCET layout

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         YLCET Layout 1
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Change YLCET layout
// @author       Me
// @match        http://chess.my2dollars.ca/*.html
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var wr = document.getElementById("wrapper");
    if (wr) {
        // insert sidebar
        var sb = document.createElement('div');
        sb.id = "sidebar";
        sb.style="position:fixed; width:500px; height:100%; z-index:1; ";
        wr.parentNode.insertBefore(sb, wr);

        // set margin
        var cp = document.getElementById("full");
        if (cp) {
            cp.removeAttribute('style');
            cp.style='margin-left: 500px; ';
        }
        var yl = document.getElementById("YLCET");
        if (yl) {
            yl.removeAttribute('width');
            yl.width='500px';
            yl.removeAttribute('height');
            yl.height='700px';
        }

        // move chat
        var ch = document.getElementById("chat_right");
        if (ch) {
            ch.parentNode.removeChild(ch);
            sb.appendChild(ch);
            ch.removeAttribute('style');
            ch.style='float:left; top:0;';
        }

        // move game moves
        var gc = document.getElementById("gameboardcontainer");
        if (gc) {
            var gm = document.getElementById("GameMoves");
            if (gm) {
                gm.parentNode.removeChild(gm);
                gc.insertBefore(gm, gc.childNodes[0]);
            }
        }
    }
})();