# HG changeset patch # User Nicholas Jillings # Date 1492182772 -3600 # Node ID 723e1e5bae6f9362d8ac6a92298d545477378179 # Parent 57ba3f490836425da6e65b80b55d4441391b3817 JSHint merges diff -r 57ba3f490836 -r 723e1e5bae6f js/core.js --- a/js/core.js Fri Apr 14 16:11:38 2017 +0100 +++ b/js/core.js Fri Apr 14 16:12:52 2017 +0100 @@ -1239,12 +1239,12 @@ // Get the data from Specification var pagePool = []; - for (var page of specification.pages) { + specification.pages.forEach(function(page){ if (page.position !== null || page.alwaysInclude) { page.alwaysInclude = true; } pagePool.push(page); - } + }); if (specification.numPages > 0) { specification.randomiseOrder = true; pagePool = pickSubPool(pagePool, specification.numPages); @@ -1252,22 +1252,22 @@ // Now get the order of pages var fixed = []; - for (var page of pagePool) { + pagePool.forEach(function(page){ if (page.position !== null) { fixed.push(page); var i = pagePool.indexOf(page); pagePool.splice(i, 1); } - } + }); if (specification.randomiseOrder) { pagePool = randomiseOrder(pagePool); } // Place in the correct order - for (var page of fixed) { + fixed.forEach(function(page) { pagePool.splice(page.position, 0, page); - } + }); // Now process the pages pagePool.forEach(function (page, i) {