Hebraicize Typing.com

Converts Typing.com to Hebrew keyboard.

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         Hebraicize Typing.com
// @namespace    http://github.com/emosenkis
// @version      2024-12-08
// @description  Converts Typing.com to Hebrew keyboard.
// @author       emosenkis
// @include      https://www.typing.com/*/lesson/*
// @include      https://typing.com/*/lesson/*
// @match        http*://www.typing.com/*/lesson/*
// @match        http*://typing.com/*/lesson/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @license      MIT
// ==/UserScript==

(function(){
    const en = "QWERTYUIOP[ASDFGHJKL;'ZXCVBNM,./";
    const he = "/'קראטוןםפ][שדגכעיחלךף,זסבהנמצתץ.";
    function hebraicize() {
        const els = document.querySelectorAll(".key-label, .letter");
        for(const el of els) {
            if (el.innerText == null || el.hebraicized === el.innerText) { continue }
            el.hebraicized = el.innerText;
            const it = el.innerText.trim();
            if (it.length !== 1) { continue };
            const idx = en.indexOf(it.toUpperCase());
            if (idx === -1) { continue };
            console.log(it + " -> " + he[idx]);
            el.innerText = el.innerText.replace(it, he[idx])
        }
    }
    hebraicize();
    new MutationObserver(hebraicize).observe(document, {childList:true,subtree:true})
}())