YLCET Layout 1

Change YLCET layout

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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