Merge pull request #1427 from placeAtlas/cleanup

Cleanup sync
This commit is contained in:
Stefano 2023-04-07 13:08:07 +02:00 committed by GitHub
commit 95e84e799d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 878 additions and 752 deletions

View file

@ -12180,3 +12180,77 @@ zznclm
11ym62b
1202zbu
11z4vo3
12242w2
1223yqd
124585e
12456c9
1244l35
1242otc
1241t5a
1241oty
1247dzz
1247d05
124785e
1248bx2
12484c5
1247wtz
1247ol7
1253355
1256bcy
1255zlx
1255xpa
12785a3
12784vv
12781rj
1288lnu
1288fxl
12892fn
128f63s
128ssa2
1290btg
128xp74
128utfz
128us0p
128uqzl
12928cm
129ud6g
129vfo0
129uxsp
129uuxe
129yvua
129yfxz
129y688
129xzbv
129zh8g
12a4axm
12a2lce
12ar8bx
12b3k3d
12b6on1
12b6dgu
12b67as
12b667u
12b65bq
12b647g
12b627l
12b60d6
12b5wdq
12b5ojd
12czvqu
12czppx
12czoh9
12c7dtl
12d0c0b
12dztsv
12dzc0r
12dz0wf
12dykxl
12e1qdg
12e1lo4
12e1jx2
12e2ghb
12e6e9h
12e6cuv
12e5yi3
12e5w5s
12e5s3y

View file

@ -10,7 +10,7 @@
with open(merge_source_file, 'r', encoding='UTF-8') as f1:
out_json = json.loads(f1.read())
format_all_entries.format_all_entries(out_json)
format_all_entries(out_json)
base_image_path = os.path.join('..', 'web', '_img', 'canvas', 'place30')
ScaleConfig.image1 = os.path.join(base_image_path, '159.png')

View file

@ -26,10 +26,10 @@ function getPositionOfEntry(entry) {
const areaMap = new Map()
// Modified from https://stackoverflow.com/a/33670691
// Modified from https://stackoverflow.com/a/33670691
function calcPolygonArea(vertices) {
const hit = areaMap.get(vertices)
if (hit !== null) {
if (hit) {
return hit
}

View file

@ -313,12 +313,12 @@ function initDraw() {
directPostUrl += "&text="
if (directPostJsonString.length + directPostJsonString > 7579) {
directPostJsonString = encodeURIComponent(" " + JSON.stringify(exportObject))
directPostJsonString = " " + JSON.stringify(exportObject)
}
if (exportArea.value > 40000) {
exportArea.value = " " + JSON.stringify(exportObject)
}
directPostUrl += directPostJsonString
directPostUrl += encodeURIComponent(directPostJsonString)
if (directPostUrl.length > 7579) {
// exportDirectPostButton.classList.add("disabled")
@ -381,7 +381,7 @@ function initDraw() {
function reset() {
// Requires button to be pressed twice to confirm reset
if (resetButton.textContent = "Confirm Reset") {
if (resetButton.textContent === "Confirm Reset") {
resetButton.textContent = "Reset"
resetButton.className = "btn btn-secondary"

View file

@ -116,9 +116,9 @@ async function init() {
if (period) {
const [, targetPeriod, targetVariation] = parsePeriod(period)
await updateTime(targetPeriod, targetVariation)
await updateTime(targetPeriod, targetVariation, true)
} else {
await updateTime(currentPeriod, currentVariation)
await updateTime(currentPeriod, currentVariation, true)
}
//console.log(document.documentElement.clientWidth, document.documentElement.clientHeight)
@ -420,9 +420,6 @@ async function init() {
scaleZoomOrigin[0] += deltaX / zoom
scaleZoomOrigin[1] += deltaY / zoom
previousZoomOrigin = [zoomOrigin[0], zoomOrigin[1]]
previousScaleZoomOrigin = [scaleZoomOrigin[0], scaleZoomOrigin[1]]
updateLines()
applyView()
}

View file

@ -130,6 +130,9 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren
}
async function updateTime(newPeriod = currentPeriod, newVariation = currentVariation, forceLoad = false) {
if (newPeriod === currentPeriod && !forceLoad) {
return;
}
document.body.dataset.canvasLoading = ""
const oldPeriod = currentPeriod

View file

@ -9,9 +9,6 @@ const linesCanvas = document.getElementById("linesCanvas")
const linesContext = linesCanvas.getContext("2d")
let hovered = []
let previousZoomOrigin = [0, 0]
let previousScaleZoomOrigin = [0, 0]
const backgroundCanvas = document.createElement("canvas")
backgroundCanvas.width = canvasSize.x
backgroundCanvas.height = canvasSize.y
@ -411,7 +408,7 @@ function buildObjectsList(filter = null, sort = null) {
previousScaleZoomOrigin = [scaleZoomOrigin[0], scaleZoomOrigin[1]]
applyView()
setView(this.entry.center[0], this.entry.center[1], setZoomByPath(entry.path))
setView(this.entry.center[0], this.entry.center[1], setZoomByPath(this.entry.path))
hovered = [this.entry]
render()
@ -424,15 +421,12 @@ function buildObjectsList(filter = null, sort = null) {
element.addEventListener("click", function (e) {
toggleFixed(e)
if (fixed) {
previousZoomOrigin = [zoomOrigin[0], zoomOrigin[1]]
previousScaleZoomOrigin = [scaleZoomOrigin[0], scaleZoomOrigin[1]]
applyView()
}
})
element.addEventListener("mouseleave", function () {
if (!fixed && !dragging) {
setView(previousScaleZoomOrigin[0], previousScaleZoomOrigin[1])
hovered = []
updateLines()
render()
@ -706,8 +700,6 @@ function highlightEntryFromUrl() {
render()
hovered[0].element = infoElement
updateLines()
fixed = true
}
function setZoomByPath(path) {
@ -734,7 +726,7 @@ function initView() {
buildObjectsList(null, null)
renderBackground(atlas)
render()
document.addEventListener('timeupdate', () => {
sortedAtlas = atlas.concat()
resetEntriesList(null, null)

File diff suppressed because one or more lines are too long