refactoring
This commit is contained in:
24
web/js/app.js
Normal file
24
web/js/app.js
Normal file
@ -0,0 +1,24 @@
|
||||
// Main application initialization and event handlers
|
||||
|
||||
// Event listeners
|
||||
document.getElementById('searchBtn').addEventListener('click', searchListings);
|
||||
document.getElementById('cancelBtn').addEventListener('click', cancelScraping);
|
||||
|
||||
document.getElementById('searchTerm').addEventListener('keypress', (e) => {
|
||||
if (e.key === 'Enter') searchListings();
|
||||
});
|
||||
|
||||
document.getElementById('sortSelect').addEventListener('change', (e) => {
|
||||
if (AppState.allListings.length > 0) {
|
||||
const sortedListings = sortListings(AppState.allListings, e.target.value);
|
||||
renderResults(sortedListings);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize on page load
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initMap();
|
||||
initPrivacyModal();
|
||||
console.log('Kleinanzeigen Karten-Suche initialized');
|
||||
console.log('API Base URL:', API_BASE_URL);
|
||||
});
|
||||
Reference in New Issue
Block a user