diff --git a/web/_js/atlas.js b/web/_js/atlas.js index 7dfee742..3faf411f 100644 --- a/web/_js/atlas.js +++ b/web/_js/atlas.js @@ -14,7 +14,7 @@ */ window.addEventListener("error", function (e) { - console.log(e); + console.error(e); let errorMessage = "

An error has occurred:

"; errorMessage += "

" + e.message + "

"; errorMessage += "

on line " + e.lineno + "

"; diff --git a/web/_js/draw.js b/web/_js/draw.js index 22b46571..7d69c8d6 100644 --- a/web/_js/draw.js +++ b/web/_js/draw.js @@ -579,7 +579,7 @@ function initPeriodGroups() { updatePeriodGroups() } else if (event.target.textContent === "Paste") { pathWithPeriods[index][1] = [...periodClipboard.path] - console.log(pathWithPeriods[index]) + // console.log(pathWithPeriods[index]) if (pathWithPeriods.length > 2) console.log(pathWithPeriods[2]) initPeriodGroups() } @@ -653,9 +653,9 @@ function updatePeriodGroups() { if (periodClipboard.index !== null) { if (index !== periodClipboard.index) { periodCopyEl.textContent = "Paste" - console.log(JSON.stringify(pathWithPeriods[index][1])) - console.log(JSON.stringify(periodClipboard.path)) - console.log(JSON.stringify(pathWithPeriods[index][1]) === JSON.stringify(periodClipboard.path)) + // console.log(JSON.stringify(pathWithPeriods[index][1])) + // console.log(JSON.stringify(periodClipboard.path)) + // console.log(JSON.stringify(pathWithPeriods[index][1]) === JSON.stringify(periodClipboard.path)) if (JSON.stringify(pathWithPeriods[index][1]) === JSON.stringify(periodClipboard.path)) { periodCopyEl.disabled = true } else { diff --git a/web/_js/overlap.js b/web/_js/overlap.js index a9682ebe..4fc2a8cc 100644 --- a/web/_js/overlap.js +++ b/web/_js/overlap.js @@ -74,7 +74,7 @@ function initOverlap() { } } - console.log(blank + " blank pixels, which are " + Math.round(blank / 100) / 100 + "% of the canvas (" + (100 - Math.round(blank / 100) / 100) + "% mapped)"); + console.info(blank + " blank pixels, which are " + Math.round(blank / 100) / 100 + "% of the canvas (" + (100 - Math.round(blank / 100) / 100) + "% mapped)"); } } diff --git a/web/_js/stats.js b/web/_js/stats.js index 898cbcb3..116cc747 100644 --- a/web/_js/stats.js +++ b/web/_js/stats.js @@ -82,8 +82,8 @@ for (const i in areas) { } } -console.log("There are " + largerThanMax + " entries larger than " + max + ", accounting for " + (largerThanMax / areas.length * 100) + "% of all entries."); -console.log("The largest entry has an area of " + areas[areas.length - 1] + " pixels."); +console.info("There are " + largerThanMax + " entries larger than " + max + ", accounting for " + (largerThanMax / areas.length * 100) + "% of all entries."); +console.info("The largest entry has an area of " + areas[areas.length - 1] + " pixels."); const counts = [0]; const brackets = [max / steps]; @@ -230,12 +230,12 @@ document.getElementById("wrapper").appendChild(el); //console.log(areas); -console.log("Median area: " + areas[~~(areas.length / 2)]); +console.info("Median area: " + areas[~~(areas.length / 2)]); -console.log("Average area: " + (areasSum / atlas.length)); +console.info("Average area: " + (areasSum / atlas.length)); const topCount = 50; -console.log("The " + topCount + " largest entries:"); +console.info("The " + topCount + " largest entries:"); let outstring = ""; @@ -243,7 +243,7 @@ for (let i = 0; i < topCount; i++) { outstring += ((i + 1) + "|[" + atlas[atlas.length - i - 1].name + "](http://place-atlas.stefanocoding.me/?id=" + atlas[atlas.length - i - 1].id + ")|" + ~~atlas[atlas.length - i - 1].area + "|" + Math.round(atlas[atlas.length - i - 1].area / 100) / 100 + "%\n"); } -console.log(outstring); +console.info(outstring); atlas.sort(function (a, b) { if (a.center[0] < b.center[0]) { @@ -256,7 +256,7 @@ atlas.sort(function (a, b) { return 0; }); -console.log("Median x: " + atlas[~~(atlas.length / 2)].center[0]); +console.info("Median x: " + atlas[~~(atlas.length / 2)].center[0]); atlas.sort(function (a, b) { if (a.center[1] < b.center[1]) { @@ -269,7 +269,7 @@ atlas.sort(function (a, b) { return 0; }); -console.log("Median y: " + atlas[~~(atlas.length / 2)].center[1]); +console.info("Median y: " + atlas[~~(atlas.length / 2)].center[1]); diff --git a/web/_js/time.js b/web/_js/time.js index ae5452bf..86739e05 100644 --- a/web/_js/time.js +++ b/web/_js/time.js @@ -146,7 +146,7 @@ const dispatchTimeUpdateEvent = (period = timelineSlider.value, atlas = atlas) = } async function updateBackground(newPeriod = currentPeriod, newVariation = currentVariation) { - console.log(newPeriod, newVariation) + // console.log(newPeriod, newVariation) abortController.abort() abortController = new AbortController() currentUpdateIndex++ @@ -194,11 +194,11 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren imageCache[url] = URL.createObjectURL(imageBlob) } const imageLayer = new Image() - console.log(imageCache[url]) + // console.log(imageCache[url]) await new Promise(resolve => { imageLayer.onload = () => { context.drawImage(imageLayer, 0, 0) - console.log("image done") + // console.log("image done") resolve() } imageLayer.src = imageCache[url] @@ -207,7 +207,7 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren } if (currentUpdateIndex !== myUpdateIndex) return [configObject, newPeriod, newVariation] const blob = await new Promise(resolve => canvas.toBlob(resolve)) - console.log(URL.createObjectURL(blob)) + // console.log(URL.createObjectURL(blob)) image.src = URL.createObjectURL(blob) } diff --git a/web/_js/view.js b/web/_js/view.js index c4ec9b9c..dc69efed 100644 --- a/web/_js/view.js +++ b/web/_js/view.js @@ -574,8 +574,7 @@ async function render() { context.globalCompositeOperation = "source-over"; context.drawImage(overrideImage, startX, startY); } catch (ex) { - console.log("Cannot override image."); - console.log(ex); + console.error("Cannot override image.", ex); } } }