From 51163b167cce01af6101438e5e61145ad798f213 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Sat, 8 Mar 2025 16:03:30 +0900 Subject: Restructure python code to be modular The python code is now a package named app. app/models: db models app/routes: flask blueprints app/static: css, js app/templates: jinja html templates --- static/block_weather.js | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 static/block_weather.js (limited to 'static/block_weather.js') diff --git a/static/block_weather.js b/static/block_weather.js deleted file mode 100644 index 4ae6d2d..0000000 --- a/static/block_weather.js +++ /dev/null @@ -1,14 +0,0 @@ -export function updateWeather() { - const city = document.getElementById("city").value; - fetch(`/weather?city=${encodeURIComponent(city)}`) - .then(res => res.json()) - .then(data => { - if (!data) { - document.getElementById("weather-summary").innerText = `Error, "${city}" city not found`; - return - } - document.getElementById("weather-summary").innerText = data.summary; - document.getElementById("weather-icon").src = data.icon_url; - }); -} - -- cgit v1.2.3