Add support for overlap, remove debug logs

This commit is contained in:
Hans5958 2022-04-10 16:28:27 +07:00
parent 2d20e0931d
commit 1070a5aa65
4 changed files with 14 additions and 10 deletions

View file

@ -113,8 +113,6 @@ function initDraw(){
if(!dragging && drawing && path.length > 0){ if(!dragging && drawing && path.length > 0){
console.log(123)
var coords = getCanvasCoords(e.clientX, e.clientY); var coords = getCanvasCoords(e.clientX, e.clientY);
render(path.concat([coords])); render(path.concat([coords]));
} }
@ -230,7 +228,6 @@ function initDraw(){
jsonString = jsonString.join("\n "); jsonString = jsonString.join("\n ");
jsonString = " "+jsonString; jsonString = " "+jsonString;
textarea.value = jsonString; textarea.value = jsonString;
console.log("a");
var directPostUrl = "https://www.reddit.com/r/placeAtlas2/submit?selftext=true&title=New%20Submission&text="+encodeURIComponent(document.getElementById("exportString").value); var directPostUrl = "https://www.reddit.com/r/placeAtlas2/submit?selftext=true&title=New%20Submission&text="+encodeURIComponent(document.getElementById("exportString").value);
if (jsonString.length > 7493) { if (jsonString.length > 7493) {
directPostUrl = "https://www.reddit.com/r/placeAtlas2/submit?selftext=true&title=New%20Submission&text="+encodeURIComponent(" " + JSON.stringify(exportObject)); directPostUrl = "https://www.reddit.com/r/placeAtlas2/submit?selftext=true&title=New%20Submission&text="+encodeURIComponent(" " + JSON.stringify(exportObject));

View file

@ -85,11 +85,13 @@ function createInfoBlock(entry) {
idElement.style.fontFamily = "Dejavu Sans Mono, sans, Sans-Serif;"; idElement.style.fontFamily = "Dejavu Sans Mono, sans, Sans-Serif;";
element.appendChild(idElement); element.appendChild(idElement);
let editElement = document.createElement("a"); if (!entry.diff || entry.diff !== "delete") {
editElement.innerText = "Edit" let editElement = document.createElement("a");
editElement.className = "objectEdit" editElement.innerText = "Edit"
editElement.href = "./?mode=draw&id=" + entry.id editElement.className = "objectEdit"
element.appendChild(editElement); editElement.href = "./?mode=draw&id=" + entry.id
element.appendChild(editElement);
}
return element; return element;
} }

View file

@ -23,6 +23,13 @@ function initOverlap(){
renderBackground(atlas); renderBackground(atlas);
render(); render();
document.addEventListener('timeupdate', (event) => {
sortedAtlas = atlas.concat()
resetEntriesList(null, null)
renderBackground(tempAtlas);
render();
})
applyView(); applyView();
render(); render();
updateLines(); updateLines();

View file

@ -123,7 +123,6 @@ document.querySelector('#endPeriodField').oninput = (event) => {
}; };
const dispatchTimeUpdateEvent = (period = slider.value, atlas = atlas) => { const dispatchTimeUpdateEvent = (period = slider.value, atlas = atlas) => {
console.log('dispatched!')
const timeUpdateEvent = new CustomEvent('timeupdate', { const timeUpdateEvent = new CustomEvent('timeupdate', {
detail: { detail: {
period: period, period: period,
@ -137,7 +136,6 @@ async function updateTime(currentPeriod) {
period = currentPeriod period = currentPeriod
let configObject = timeConfig[currentPeriod]; let configObject = timeConfig[currentPeriod];
if (!configObject.image) { if (!configObject.image) {
console.log("fetching");
let fetchResult = await fetch(configObject.url); let fetchResult = await fetch(configObject.url);
let imageBlob = await fetchResult.blob(); let imageBlob = await fetchResult.blob();
configObject.image = URL.createObjectURL(imageBlob); configObject.image = URL.createObjectURL(imageBlob);