puzzles.js: normalize whitespace; sort categories

This commit is contained in:
J. Patrick Avery, Jr 2017-02-07 16:44:03 -07:00
parent b85cd306aa
commit 68398a4f91
1 changed files with 40 additions and 38 deletions

View File

@ -10,7 +10,9 @@ function loadPuzzle(cat, id, points) {
function puzzlesRefresh(term, obj) { function puzzlesRefresh(term, obj) {
term.clear(); term.clear();
for (var cat in obj) { var k = Object.keys(obj);
k.sort();
k.forEach(function(cat) {
var puzzles = obj[cat]; var puzzles = obj[cat];
var pdiv = createElement('div'); var pdiv = createElement('div');
@ -43,7 +45,7 @@ function puzzlesRefresh(term, obj) {
} }
term.appendShallow(pdiv); term.appendShallow(pdiv);
} });
} }
function puzzles_start() { function puzzles_start() {