-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (32 loc) · 1.32 KB
/
index.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
/*
_ _ _
| | | | (_)
| |__ ___ _ __ ___ _____ _____ _ __| | ________ _ ___
| '_ \ / _ \| '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /______| / __|
| | | | (_) | | | | | | __/\ V V / (_) | | | < | \__ \
|_| |_|\___/|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ | |___/
_/ |
|__/
*/
const homeworkConfig = JSON.parse(localStorage.getItem('homework')) || { debug: false };
function setHomeworkConfig() { localStorage.setItem('homework', JSON.stringify(homeworkConfig)); }
/*
_ _
| | | |
__| | ___| |__ _ _ __ _
/ _` |/ _ \ '_ \| | | |/ _` |
| (_| | __/ |_) | |_| | (_| |
\__,_|\___|_.__/ \__,_|\__, |
__/ |
|___/
*/
if (process.env.NODE_ENV == 'development') {
document.body.classList.toggle('debug', homeworkConfig.debug);
document.body.addEventListener('keyup', function(event) {
if (event.shiftKey == true && event.ctrlKey == true && (event.keyCode||event.which) == 68) {
homeworkConfig.debug = !homeworkConfig.debug;
document.body.classList.toggle('debug', homeworkConfig.debug);
setHomeworkConfig();
}
});
}