Epitech PowerUp

Add infos on user page

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        Epitech PowerUp
// @namespace   [email protected]
// @description Add infos on user page
// @include     https://intra.epitech.eu/user/*
// @version     0.0.3
// @grant       none
// ==/UserScript==

total = 0;
i = 0;

setTimeout(function () {
    if (document.readyState != "complete") {
        console.log("Wait page");
    }
    if (!(elem = document.getElementById("user-module"))) {
        console.log("wait user-module")
    }
    if (!(elem = elem.getElementsByClassName("overflow")[0])) {
        console.log("wait overflow")
    }
    if (!(elem = elem.getElementsByTagName("tbody")[0])) {
        console.log("wait tbody")
    }
    if (!(elem = elem.getElementsByClassName("item"))) {
        console.log("wait item")
    }
    while (elem[i]) {
        cred = elem[i++].getElementsByClassName("number")[0];
    	total = total + Number(cred.innerText);
    }
    if (elem = document.getElementsByClassName("note")[0]) {
        if (note = elem.getElementsByTagName("span")[0]) {
            note.innerText = note.innerText + " / " + total;
        }
    }
}, 500)