-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
151 lines (145 loc) · 4.99 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<html>
<head>
<title>RPS-Scoringboard</title>
<script src="jquery-2.1.1.min.js"></script>
<script src="Chart.min.js"></script>
<script src="main.js"></script>
<script src="bootstrap.min.js"></script>
<script src="jquery.dynatable.js"></script>
<link href="bootstrap.min.css" rel="stylesheet">
<link href="bootstrap-theme.min.css" rel="stylesheet">
<link href="jquery.dynatable.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#navbar" aria-expanded="false"
aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">RPS</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#overview">Overview</a></li>
<li><a href="#stats">Statistics</a></li>
<li><a href="#highscore">Highscore</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class ="container" id="outside">
<div class="page-header" id="header">
<br>
<h1>And the winner is...</h1>
<p class="lead" id="header-lead">
Imagine rolling drums for the atmosphere...
</p>
</div>
<div class="row" id="overview">
<br><br>
<div class="col-md-5" id="leftChartColumn">
<h2 id="leftChartName"> Program 1</h2>
<canvas id="leftWinChart" width=450px height=500px></canvas>
</div>
<div class="col-md-5" id="rightChartColumn">
<h2 id ="rightChartName"> Program 2</h2>
<canvas id="rightWinChart" width=450px height=500px></canvas>
</div>
<br>
</div>
<div class="container" id="stats">
<div class="lead" id="statlead">
<h2>Statistsics<h2>
</div>
<div class="col-md-5" id="leftStatColumn">
<h2 id="leftStatName"> Program 1</h2>
<canvas id="leftStatChart" width=450px height=500px></canvas>
</div>
<div class="col-md-5" id="rightStatColumn">
<h2 id="rightStatName"> Programm 2</h2>
<canvas id="rightStatChart" width=450px height=500px></canvas>
</div>
</div>
<div class="container" id="highscore">
<div class="lead" id="statlead">
<h2>Highscore<h2>
</div>
<div class="row" id="statRow">
<table id="highscoreTable" class="table table-bordered">
<th data-dynatable-column="score">Score</th>
<th data-dynatable-column="won">Won</th>
<th data-dynatable-column="name">Name</th>
<!-- <th data-dynatable-colimn="code">Code</th> -->
<tbody></tbody>
</table>
</div>
</div>
</div>
</body>
<footer>
<script type="text/javascript">
function setHighscore(json){
/* console.log(JSON.stringify(json));*/
$('#highscoreTable').dynatable({
table: {
defaultColumnIdStyle: 'camelCase',
columns: null,
headRowSelector: 'tr:first-child', // or e.g. tr:first-child
bodyRowSelector: 'tbody tr',
headRowClass: null
},
features: {
sort: true,
paginate: false,
search: false,
recordCount: false,
perPageSelect: false
},
dataset : {
records: JSON.parse(JSON.stringify(json))
}
});
}
$( document ).ready(function() {
/* $('#highscoreTable').dynatable(); */
initCharts();
/* The real Deal */
hostname = '151.217.63.97';
/* if(hostname=='localhost'){
hostname = 'raziel.virtuos.uos.de';
}/*
/* Last Game & Stats */
lastgameURL = 'http://'+hostname+':5000/lastgame';
$.ajax({
url: lastgameURL,
async: false,
dataType: 'jsonp',
jsonp : false,
jsonpCallback: 'lastgame',
contentType: 'application/json',
success: function(json) {setWinGraphs(json); setStatGraphs(json);},
error: function(e) { console.log('error'); }
});
/* Highscore Table */
highscoreURL = 'http://'+hostname+':5000/highscore'
$.ajax({
url: highscoreURL,
async: false,
dataType: 'jsonp',
jsonp : false,
jsonpCallback: 'highscore',
contentType: 'application/json',
success: function(json) {setHighscore(json);},
error: function(e) {console.log('error in Highscore'); console.log('error'); }
});
/* Dummy Stuff for Displaying nice Charts */
});
</script>
</footer>
</html>