2015-05-28 13:43:40 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-05-28 14:15:05 -06:00
|
|
|
<title>Points History</title>
|
2017-02-06 10:14:23 -07:00
|
|
|
<meta charset="UTF-8">
|
2015-05-28 13:43:40 -06:00
|
|
|
<script>
|
|
|
|
function init() {
|
2015-05-28 14:15:05 -06:00
|
|
|
|
|
|
|
function getParameterByName(name) {
|
|
|
|
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
|
|
|
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
|
|
|
results = regex.exec(location.search);
|
|
|
|
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
2015-05-28 13:43:40 -06:00
|
|
|
}
|
2015-05-28 14:15:05 -06:00
|
|
|
|
|
|
|
var pointsDiv = document.getElementById("pointslog");
|
|
|
|
var pointshistory = JSON.parse(localStorage.getItem("pointshistory"));
|
|
|
|
// get snapshot specified by query param or else most recent snapshot
|
|
|
|
var i = parseInt(getParameterByName("snapshot")) || pointshistory.length-1;
|
|
|
|
var snapshot = pointshistory[i];
|
|
|
|
pointsDiv.innerHTML = snapshot.map(function(entry){
|
|
|
|
return entry.join(" ");
|
|
|
|
}).join("<br>");
|
2015-05-28 13:43:40 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener("load", init);
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2015-05-28 14:15:05 -06:00
|
|
|
<div id="pointslog"></div>
|
2015-05-28 13:43:40 -06:00
|
|
|
</body>
|
|
|
|
</html>
|