-
Notifications
You must be signed in to change notification settings - Fork 1
/
ap-score-reveal.js
46 lines (36 loc) · 1.2 KB
/
ap-score-reveal.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
// ==UserScript==
// @name AP Score Reveal
// @namespace dev.josephgeis.apreveal
// @author Joseph Geis
// @homepageURL https://josephgeis.dev/
// @description Hides AP exam scores, allowing you to reveal your scores one-by-one.
// @license MIT
// @version 1.0.1
// @grant none
// @include https://apscore.collegeboard.org/scores/view-your-scores*
// @run-at document-start
// ==/UserScript==
var preStyles = document.createElement("style")
preStyles.type = "text/css"
preStyles.appendChild(
document.createTextNode(".row-fluid.item > .span5:nth-child(2) { opacity: 0; }")
)
document.head.appendChild(preStyles)
document.addEventListener("DOMContentLoaded", () => {
let scoreFields = document.querySelectorAll(".row-fluid.item > .span5:nth-child(2) > span")
for (field of scoreFields) {
let scoreText = field.querySelector("em")
scoreText.hidden = true
let button = document.createElement("button")
let unhide = () => {
scoreText.hidden = !scoreText.hidden
button.remove()
}
button.addEventListener("click", unhide)
button.appendChild(
document.createTextNode("Show")
)
field.appendChild(button)
}
preStyles.remove();
})