diff --git a/code/region_scoreboard.js b/code/region_scoreboard.js
index 382c7ff8..1617c743 100755
--- a/code/region_scoreboard.js
+++ b/code/region_scoreboard.js
@@ -8,7 +8,7 @@ window.regionScoreboard = function() {
var latE6 = Math.round(latLng.lat*1E6);
var lngE6 = Math.round(latLng.lng*1E6);
- var dlg = dialog({title:'Region scores',html:'Loading regional scores...',width:450,minHeight:370});
+ var dlg = dialog({title:'Region scores',html:'Loading regional scores...',width:450,minHeight:320});
window.postAjax('getRegionScoreDetails', {latE6:latE6,lngE6:lngE6}, function(res){regionScoreboardSuccess(res,dlg);}, function(){regionScoreboardFailure(dlg);});
}
@@ -107,6 +107,17 @@ function regionScoreboardScoreHistoryChart(result) {
return svg;
}
+function regionScoreboardScoreHistoryTable(result) {
+ var history = result.scoreHistory;
+ var table = '
Checkpoint | Enlightened | Resistance |
';
+
+ for(var i=0; i' + history[i][0] + ' | ' + digits(history[i][1]) + ' | ' + digits(history[i][2]) + ' | ';
+ }
+
+ table += '
';
+ return table;
+}
function regionScoreboardSuccess(data,dlg) {
if (data.result === undefined) {
@@ -139,12 +150,16 @@ function regionScoreboardSuccess(data,dlg) {
var first = PLAYER.team == 'RESISTANCE' ? 1 : 0;
- dlg.html('Region scores for '+data.result.regionName+''
- +''+teamRow[first]+teamRow[1-first]+'
'
- +'Checkpoint history'
- +regionScoreboardScoreHistoryChart(data.result)
+ // we need some divs to make the accordion work properly
+ dlg.html(''
+ +'
Region scores for '+data.result.regionName+''
+ +'
'+teamRow[first]+teamRow[1-first]+'
'
+ +regionScoreboardScoreHistoryChart(data.result)+'
'
+ +'
Checkpoint overview'
+ +'
'+regionScoreboardScoreHistoryTable(data.result)+'
'
+'
Top agents'
- +agentTable);
+ +'
'+agentTable+'
'
+ +'
');
$('g.checkpoint', dlg).each(function(i, elem) {
elem = $(elem);
@@ -159,4 +174,9 @@ function regionScoreboardSuccess(data,dlg) {
position: {my: "center bottom", at: "center top-10"}
});
});
+
+ $('.cellscore', dlg).accordion({
+ header: 'b',
+ heightStyle: "fill",
+ });
}
diff --git a/style.css b/style.css
index cac9a663..5f8ee4cd 100644
--- a/style.css
+++ b/style.css
@@ -1099,8 +1099,32 @@ table.artifact td.info {
}
/* region scores */
+.cellscore .ui-accordion-header, .cellscore .ui-accordion-content {
+ border: 1px solid #20a8b1;
+ margin-top: -1px;
+ display: block;
+}
+.cellscore .ui-accordion-header {
+ color: #ffce00;
+ outline: none
+}
+.cellscore .ui-accordion-header::before {
+ font-size: 18px;
+ margin-right: 2px;
+ content: "⊞";
+}
+.cellscore .ui-accordion-header-active::before {
+ content: "⊟";
+}
g.checkpoint:hover circle {
fill-opacity: 1;
stroke-width: 2px;
}
+.checkpoint_table {
+ border-collapse: collapse;
+}
+.checkpoint_table td {
+ text-align: right;
+ padding-left: 10px;
+}