-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndex.html
73 lines (64 loc) · 3.14 KB
/
Index.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>Colored Calendar for SharePoint</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
crossorigin="anonymous">
<script src="colorcalendar.js" type="text/javascript"></script>
</head>
<body>
<div class="container">
<h1>Colored Calendar for SharePoint tester</h1>
<div class="alert alert-info">
<p>Enter some input values, you can adjust the values CAL_RANDOM and XXX_MODIFIER until you like the resulting colors (foreground & background)</p>
</div>
<div class="container-fluid">
<div class="form-group">
<div class="col-sm-2"><span>Enter your event title</span></div>
<div class="col-sm-10"><input type="text" id="testInput" class="form-control" /></div>
</div>
<hr />
<div class="form-group">
<div class="col-sm-2"><span>CAL_RANDOM</span></div>
<div class="col-sm-10"><input type="number" id="CAL_RANDOM" class="modifier form-control" /></div>
</div>
<div class="form-group">
<div class="col-sm-2"><span>RED_MODIFIER</span></div>
<div class="col-sm-10"><input type="number" id="RED_MODIFIER" class="modifier form-control" /></div>
</div>
<div class="form-group">
<div class="col-sm-2"><span>GREEN_MODIFIER</span></div>
<div class="col-sm-10"><input type="number" id="GREEN_MODIFIER" class="modifier form-control" /></div>
</div>
<div class="form-group">
<div class="col-sm-2"><span>BLUE_MODIFIER</span></div>
<div class="col-sm-10"><input type="number" id="BLUE_MODIFIER" class="modifier form-control" /></div>
</div>
</div>
</div>
<script type="text/javascript">
function ColorSite(value){
var background = GetColorCodeFromCategory(GetName(value));
var foreground = GetForegroundColor(background);
document.body.style.backgroundColor = "rgb(" + background + ")";
console.log(foreground);
document.body.style.color = foreground;
}
document.getElementById("testInput").addEventListener("keyup", (event) => {
ColorSite(event.target.value);
});
for (let element of (document.getElementsByClassName("modifier"))) {
element.value = eval(element.id);
element.addEventListener("keyup", (event) => {
let updateVar = element.id + " = " + element.value;
eval(updateVar);
ColorSite(document.getElementById("testInput").value);
});
};
</script>
</body>
</html>