TFS+

RTL Support in TFS

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

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

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.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

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!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

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

// ==UserScript==
// @name         TFS+
// @description  RTL Support in TFS
// @version      2.0
// @match       http://tfs-app:8080/tfs*
// @match       https://azure-devops/*
// @author       Shay Cohen
// @grant        none
// @namespace https://greasyfork.org/users/313606
// ==/UserScript==

(function() {
    'use strict';

    //Can't use this because tfs has iframes in inner text-editors, and the outer "head" doesn't apply
    //$head.append(('<style>.tfsScriptRtl { direction: rtl !important; text-align: right; }</style>'));

	// You should leave the one you want, and comment out the other one
    var rtlRgx = new RegExp("[\u0590-\u05ff]"); // any Hebrew
    //var rtlRgx = new RegExp("^[^a-zA-Z]*[\u0590-\u05ff]"); // Hebrew before any English

    var checkOne = function(e, txt) {
        if(rtlRgx.test(txt)) {
            if(!e.fixedByScript) {
                e.fixedByScript = true;
                e.prevDir = e.dir;
                e.dir = "rtl";
                var $e = $(e);
                e.prevAlign = $e.css("text-align");
				if(e.prevAlign == "left")
					$e.css("text-align", "right");
            }
        } else {
			if(e.fixedByScript) {
				e.fixedByScript = false;
				e.dir = e.prevDir;
				if(e.prevAlign == "left")
					$(e).css("text-align", e.prevAlign);
			}
        }
    };

    var checkAll = function() {
        $("body *:not(:has(*))").each(function(i, e) {
            checkOne(e, e.innerText);
        });
        $("body input[type='text']").each(function(i, e) {
            checkOne(e, e.value);
        });
    };

    setInterval(checkAll, 500);
})();