auto-sync: 2026-05-13 10:50:01
This commit is contained in:
BIN
tasks/enduro-trails/reports/tri/tri-chuvash-z10.png
Normal file
BIN
tasks/enduro-trails/reports/tri/tri-chuvash-z10.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 594 KiB |
BIN
tasks/enduro-trails/reports/tri/tri-hillshade-chuvash-z12.png
Normal file
BIN
tasks/enduro-trails/reports/tri/tri-hillshade-chuvash-z12.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 677 KiB |
BIN
tasks/enduro-trails/reports/tri/tri-moscow-z10.png
Normal file
BIN
tasks/enduro-trails/reports/tri/tri-moscow-z10.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
40
tasks/enduro-trails/scripts/patch_tri_ui.sh
Normal file
40
tasks/enduro-trails/scripts/patch_tri_ui.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
FILE="/home/slin/enduro-trails/prototype/static/app.js"
|
||||
|
||||
# 1. In onTerrainCheckbox(): add triChecked + localStorage + applyTerrainLayer
|
||||
# After line with hillshadeChecked declaration (line 2672), add triChecked
|
||||
sed -i '2672a\ const triChecked = document.getElementById('\''terrain-tri-cb'\'').checked;' "$FILE"
|
||||
|
||||
# After localStorage hillshade (now line 2677 because we added 1 line), add tri localStorage
|
||||
sed -i '2677a\ localStorage.setItem('\''terrain-tri'\'', triChecked ? '\''1'\'' : '\''0'\'');' "$FILE"
|
||||
|
||||
# Update active state to include tri (line with btn.classList.toggle)
|
||||
# Now at line 2681 (shifted by 2)
|
||||
sed -i 's/btn.classList.toggle('\''active'\'', hypsoChecked || hillshadeChecked)/btn.classList.toggle('\''active'\'', hypsoChecked || hillshadeChecked || triChecked)/' "$FILE"
|
||||
|
||||
# After applyTerrainLayer hillshade line, add TRI layer
|
||||
# Find the hillshade applyTerrainLayer line and add after it
|
||||
sed -i '/applyTerrainLayer.*terrain-hillshade.*hillshadeChecked/a\ applyTerrainLayer('\''terrain-tri'\'', TERRAIN_BASE_URL + '\''/tri/{z}/{x}/{y}.png'\'', triChecked, 0.70, 5, 15);' "$FILE"
|
||||
|
||||
# 2. In restoreTerrainState(): add tri restore
|
||||
# After "const hillshade = localStorage..." line
|
||||
sed -i '/const hillshade = localStorage.getItem.*terrain-hillshade/a\ const tri = localStorage.getItem('\''terrain-tri'\'') === '\''1'\'';' "$FILE"
|
||||
|
||||
# After "const hillshadeCb = document.getElementById..."
|
||||
sed -i '/const hillshadeCb = document.getElementById/a\ const triCb = document.getElementById('\''terrain-tri-cb'\'');' "$FILE"
|
||||
|
||||
# After "if (hillshadeCb) hillshadeCb.checked = hillshade;"
|
||||
sed -i '/if (hillshadeCb) hillshadeCb.checked = hillshade;/a\ if (triCb) triCb.checked = tri;' "$FILE"
|
||||
|
||||
# Update the "if (hypso || hillshade)" to include tri
|
||||
sed -i 's/if (hypso || hillshade) {/if (hypso || hillshade || tri) {/' "$FILE"
|
||||
|
||||
# Update btn active state in restoreTerrainState
|
||||
sed -i "s/if (btn) btn.classList.toggle('active', hypso || hillshade);/if (btn) btn.classList.toggle('active', hypso || hillshade || tri);/" "$FILE"
|
||||
|
||||
echo "Patching done. Verifying..."
|
||||
grep -n "terrain-tri" "$FILE"
|
||||
echo "---"
|
||||
grep -n "triChecked\|triCb\| tri " "$FILE" | head -15
|
||||
Reference in New Issue
Block a user