English Lev Net

Redirect to English version of Lev Net

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         English Lev Net
// @namespace    Violentmonkey Scripts
// @version      0.1.1
// @description  Redirect to English version of Lev Net
// @author       Jonah Lawrence
// @include      /^.*://.*levnet\.jct\.ac\.il/*/
// @grant        none
// @license      MIT
// ==/UserScript==

/* jshint esversion: 8 */

window.addEventListener("load", function() {
    "use strict";
    
    const langSelect = angular.element('select[ng-model="model.currentLanguage"]');
    const okButton = angular.element('div[local-title="title_local_switcher"] button[local="ok_button"]');

    // Check if the website language is Hebrew
    if (langSelect.scope().model.currentLanguage === "he") {

        // Change the selected language to English
        langSelect.scope().model.currentLanguage = "en";

        // Trigger a change on the select element from Angular
        langSelect.triggerHandler("change");

        // Trigger a click on the OK button
        okButton.click();

    }

}, false);