mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
@@ -46,13 +46,20 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pt-5">
|
||||
<div class="pt-5 flex gap-2">
|
||||
|
||||
<button
|
||||
id="shareBtn"
|
||||
class="px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 transition-all"
|
||||
>
|
||||
Share
|
||||
</button>
|
||||
<button
|
||||
id="resetBtn"
|
||||
class="px-4 py-1.5 text-sm font-medium text-white bg-gray-700 rounded hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 focus:ring-offset-gray-900 transition-all"
|
||||
>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ map.on('load', () => {
|
||||
// Set defaults if no params present
|
||||
if (!params.has('line1') && !params.has('line2') && !params.has('lang')) {
|
||||
const url = new URL(window.location)
|
||||
url.searchParams.set('line1', 'underscore,colon,name,latin')
|
||||
url.searchParams.set('line1', 'colon,underscore,name,latin')
|
||||
url.searchParams.set('line2', 'nonlatin')
|
||||
url.searchParams.set('lang', 'en')
|
||||
window.history.replaceState({}, '', url)
|
||||
@@ -29,6 +29,7 @@ map.on('load', () => {
|
||||
applyConfiguration()
|
||||
initializeInputListeners()
|
||||
initializeModal()
|
||||
initializeResetButton()
|
||||
})
|
||||
|
||||
// ============================================
|
||||
@@ -66,6 +67,13 @@ function initializeModal() {
|
||||
})
|
||||
}
|
||||
|
||||
function initializeResetButton() {
|
||||
document.getElementById('resetBtn').addEventListener('click', () => {
|
||||
const hash = window.location.hash
|
||||
window.location.href = `${window.location.pathname}${hash}`
|
||||
})
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 3. CONFIGURATION & SYNC
|
||||
// ============================================
|
||||
@@ -175,12 +183,12 @@ function buildFieldAccessor(config, langCode) {
|
||||
parts.push(['get', `name_${langCode}`])
|
||||
} else if (field === 'colon') {
|
||||
parts.push(['get', `name:${langCode}`])
|
||||
} else if (field === 'name') {
|
||||
parts.push(['get', 'name'])
|
||||
} else if (field === 'latin') {
|
||||
parts.push(['get', 'name:latin'])
|
||||
} else if (field === 'nonlatin') {
|
||||
parts.push(['get', 'name:nonlatin'])
|
||||
} else if (field === 'name') {
|
||||
parts.push(['get', 'name'])
|
||||
} else {
|
||||
parts.push(['get', field])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user