diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-08 05:03:18 -0600 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-08 05:03:18 -0600 |
commit | 312c4362e9deed7ed7573e17312c1669cc5e9e65 (patch) | |
tree | 6531a85a8222ab2f2a63eaa5bf454afa424c1740 /js | |
parent | 3e08d71c631c18addec74c805e4b9446428b27bf (diff) | |
download | pathery-312c4362e9deed7ed7573e17312c1669cc5e9e65.tar.xz |
Only show points column when a solution is given
Diffstat (limited to 'js')
-rw-r--r-- | js/scores.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/js/scores.js b/js/scores.js index d9a2842..34d3c87 100644 --- a/js/scores.js +++ b/js/scores.js @@ -122,11 +122,18 @@ function scoresFormatPage(JO) { var updatedLocalTime = new Date();
updatedLocalTime.setTime(JO.updateTime * 1000);
+ //Hack to determine if solutions are given
+ var solutionsGiven = (JO.users && JO.users[1] && JO.users[1].solution);
+
p = p+"<tr title='Last-Update: "+updatedLocalTime.format("mmm d, h:MM TT")+"'>";
p = p+"<th>Rank</th>";
p = p+"<th style='width:125px; overflow:hidden; text-align:left; padding-left:42px;'>Name</th>";
p = p+"<th>Moves</th>";
- p = p+"<th>Points</th>";
+ if(solutionsGiven)
+ {
+ //Only show points column when solutions are given (ie. on old maps on the scoreboard)
+ p = p+"<th>Points</th>";
+ }
p = p+"</tr>";
var showedLastUser = true;
@@ -159,7 +166,7 @@ function scoresFormatPage(JO) { rowclass += ' solutionSelected';
}
- if (u.solution) {
+ if (solutionsGiven) {
rowclass += ' scoreRowSolutionAvailable';
p += "<tr class='"+rowclass+"' id='solution_"+u.solutionID+"'";
p += "onmouseover='showTempSolution(\""+JO.mapid+"\", \""+u.solution+"\", \""+u.moves+"\", \""+u.wallColor+"\", \""+u.wallEmblem+"\")'";
@@ -187,12 +194,12 @@ function scoresFormatPage(JO) { p = p+ "";
p = p+ "<span class='scoreName'><a href='achievements?id="+u.ID+"' style='color:"+u.displayColor+"'>"+u.display+"</a></span>";
p = p+ "</td>";
- if (u.solution) {
+ if (solutionsGiven) {
p = p+ "<td style='text-align:right;'><a href='javascript: void(0);'>"+u.moves+"</a></td>";
p = p+ "<td style='text-align:right;'>"+u.points+"</td>";
} else {
p = p+ "<td style='text-align:right;'>"+u.moves+"</td>";
- p = p+ "<td></td>";
+ //No second <td> since there is not Points column
}
p = p+ "</tr>";
|