From 441a637da2255671da28ca1f91cb25babf44f80f Mon Sep 17 00:00:00 2001 From: lada Date: Mon, 28 Jul 2025 19:32:30 +0200 Subject: [PATCH 1/3] Add dummy change to test gemini integration --- client/src/components/LoginButton/LoginButton.tsx | 4 ++-- client/src/components/Profile/Profile.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/LoginButton/LoginButton.tsx b/client/src/components/LoginButton/LoginButton.tsx index 2b8d68e..d2c1aa2 100644 --- a/client/src/components/LoginButton/LoginButton.tsx +++ b/client/src/components/LoginButton/LoginButton.tsx @@ -1,9 +1,9 @@ import React from "react"; export const LoginButton: React.FC = () => { - const login = () => { + const login = React.useCallback(() => { window.location.href = "http://localhost:4000/auth/login"; - }; + }, []); return ( diff --git a/client/src/components/Profile/Profile.tsx b/client/src/components/Profile/Profile.tsx index 0be0fc6..ec67dfb 100644 --- a/client/src/components/Profile/Profile.tsx +++ b/client/src/components/Profile/Profile.tsx @@ -1,12 +1,12 @@ import React from "react"; type Props = { - name: string; + name?: string; picture: string; }; export const Profile: React.FC = ({ name, picture }) => { return ( -
+

{name}

Profile picture
From 27ea4c9b9e3ca8cecbd8c9ed444743ebffec73af Mon Sep 17 00:00:00 2001 From: lada Date: Mon, 28 Jul 2025 19:43:46 +0200 Subject: [PATCH 2/3] Improve formatting --- docs/js/index.js | 14 +++++++------- docs/js/index2.js | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/js/index.js b/docs/js/index.js index 64be29f..a1ce8bc 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -17,11 +17,11 @@ const test = () => { // console.log(c) // b = "nova hodnota" -// const o = { -// data: () => { -// console.log("data"); -// }, -// }; -// o["data"]?.(); -// o["data2"]?.(); +const o = { + data: () => { + console.log("data"); + }, +}; +o["data"]?.(); +o["data2"]?.(); test(); diff --git a/docs/js/index2.js b/docs/js/index2.js index 1cf29dc..2ce1074 100644 --- a/docs/js/index2.js +++ b/docs/js/index2.js @@ -1,4 +1,5 @@ console.clear(); + const obj = { a: 1, self: () => obj, @@ -19,6 +20,8 @@ const obj = { console.log("test2:"); console.log(obj.test2()); + + console.log("test:"); console.log(obj.test()); @@ -30,5 +33,7 @@ console.log(obj.test2.apply({})); console.log("self"); console.log(obj.self()); + +console.log("----- TIMEOUT ------") setTimeout(obj.testConsole, 3000); setTimeout(obj.testConsole2, 3000); From 3bb9b84a06954cab42e4e3a1b1ad3a82b424f2a8 Mon Sep 17 00:00:00 2001 From: lada Date: Mon, 4 Aug 2025 19:32:41 +0200 Subject: [PATCH 3/3] Code fixes --- docs/js3/hell_await.js | 2 +- docs/js3/hell_promise.js | 2 +- docs/js3/index.html | 61 +++++++++++++++++++++++++--------------- docs/js3/pocasi.html | 3 +- docs/js3/pocasi.js | 18 +++++------- 5 files changed, 48 insertions(+), 38 deletions(-) diff --git a/docs/js3/hell_await.js b/docs/js3/hell_await.js index 23aaa98..d90cce9 100644 --- a/docs/js3/hell_await.js +++ b/docs/js3/hell_await.js @@ -28,7 +28,7 @@ const demo = () => { const run = async () => { try { - console.log("HODNOTA "+ hodnota); + // console.log("HODNOTA "+ hodnota); await deleteCopyFile(); const items = await getItems(); await writeItems(items); diff --git a/docs/js3/hell_promise.js b/docs/js3/hell_promise.js index 6d80941..ae801a9 100644 --- a/docs/js3/hell_promise.js +++ b/docs/js3/hell_promise.js @@ -26,7 +26,7 @@ deleteCopyFile() .then(getItems) .then(writeItems) .then(() => { - console.log("DONE"); + console.log("All done"); }) .catch((err) => { console.error("oops"); diff --git a/docs/js3/index.html b/docs/js3/index.html index f25fc1d..46c6f73 100644 --- a/docs/js3/index.html +++ b/docs/js3/index.html @@ -3,35 +3,46 @@ Demo +
-

Demo

- -
- -
- -
- - -
- -
- - -
- - - +
+

Demo

+ +
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ + +
diff --git a/docs/js3/pocasi.html b/docs/js3/pocasi.html index 0e258d3..bfa67ff 100644 --- a/docs/js3/pocasi.html +++ b/docs/js3/pocasi.html @@ -6,9 +6,8 @@
- - +
diff --git a/docs/js3/pocasi.js b/docs/js3/pocasi.js index 61ecaa7..a28c500 100644 --- a/docs/js3/pocasi.js +++ b/docs/js3/pocasi.js @@ -8,11 +8,7 @@ const getCityCoords = async (cityName) => { try { const response = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${cityName}&language=en&format=json`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ key: "value" }), + method: "GET", }); @@ -25,6 +21,7 @@ const getCityCoords = async (cityName) => { return { latitude, longitude }; } catch (e) { window.alert(e.message); + return undefined; } }; const getForecast = async ({ latitude, longitude }) => { @@ -38,7 +35,7 @@ const getForecast = async ({ latitude, longitude }) => { const max = jsonResponse.daily.temperature_2m_max[0]; const min = jsonResponse.daily.temperature_2m_min[0]; const average = (max + min) / 2; - print({ average: average + jsonResponse.daily_units.temperature_2m_max }); + return average + jsonResponse.daily_units.temperature_2m_max; } catch (e) { window.alert(e.message); } @@ -46,10 +43,9 @@ const getForecast = async ({ latitude, longitude }) => { window.document.getElementById("pocasi").addEventListener("click", async () => { - const mesto = "Praha"; + const cities = document.querySelector("textarea").value.split(/[:;]/); - const cityCoords = await getCityCoords(mesto); - print(cityCoords); - - const forecast = await getForecast(cityCoords); + const cityCoords = await getCityCoords(cities[0]); + print(`\n Coordinates: ${JSON.stringify(cityCoords, null, 4)}\n`); + print(` ${await getForecast(cityCoords)}`); });