-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply-personal-styles.user.js
58 lines (49 loc) · 1.77 KB
/
apply-personal-styles.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// ==UserScript==
// @name Change average sheet style [ECE Paris]
// @namespace ECE Paris Script
// @version 0.1
// @description Allows you to change the average style sheet automatically.
// @author BragdonD
// @match https://campusonline.inseec.net/note/*
// @require https://cdnjs.cloudflare.com/ajax/libs/arrive/2.4.1/arrive.min.js
// @homepageURL https://github.com/bragdond/ECE-Scripts
// @supportURL https://github.com/bragdond/ECE-Scripts/issues
// @downloadURL https://raw.githubusercontent.com/bragdond/ECE-Scripts/main/apply-personal-styles.user.js
// @updateURL https://raw.githubusercontent.com/bragdond/ECE-Scripts/main/apply-personal-styles.user.js
// @grant none
// ==/UserScript==
var $ = window.jQuery;
const ensStyle = `
color: #fff !important;
background-color: #376bc5;
font-weight: bold !important;
`;
const ev1Style = `
color: #000 !important;
background-color: #95bcff;
`;
const fpcStyle = `
color: #000 !important;
background-color: #619bff;
font-weight: bold !important;
`;
function changeEnsStyle($ensElement) {
$ensElement.attr("style", function() { return $(this).attr("style") + ensStyle });
}
function changeEv1Style($ev1Element) {
$ev1Element.attr("style", function() { return $(this).attr("style") + ev1Style });
}
function changeFpcStyle($fpcElement) {
$fpcElement.attr("style", function() { return $(this).attr("style") + fpcStyle });
}
(function() {
'use strict';
const resultatsContainerId = "resultat-note";
const resultatsTableId = "table_note";
window.addEventListener("display-grades", () => {
const table = $("#".concat(resultatsTableId));
changeEnsStyle($(".item-ens"));
changeEv1Style($(".item-ev1"));
changeFpcStyle($(".item-fpc"));
});
})();