WOD du jour composé par l'app, hors ligne (5c)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-23 03:00:37 +01:00
co-authored by Claude Opus 5.5
parent 442b3f0a56
commit 7194530b38
9 changed files with 340 additions and 16 deletions
+4 -3
View File
@@ -32,7 +32,7 @@
* | {name: "connect-ai", query: string}
* | {name: "library", query: string}
* | {name: "library-item", id: string, query: string}
* | {name: "wods"}
* | {name: "wods", query: string}
* | {name: "wod", id: string}
* | {name: "reserved"}
* | {name: "not-found"}} Route
@@ -65,7 +65,7 @@ export function parseRoute(hash) {
if (head === "connecter-ia" && parts.length === 1) return { name: "connect-ai", query };
if (head === "bibliotheque" && parts.length === 1) return { name: "library", query };
if (head === "bibliotheque" && parts.length === 2 && arg) return { name: "library-item", id: arg, query };
if (head === "wod" && parts.length === 1) return { name: "wods" };
if (head === "wod" && parts.length === 1) return { name: "wods", query };
if (head === "wod" && parts.length === 2 && arg) return { name: "wod", id: arg };
if (parts.length === 1 && WITH_QUERY[head]) return /** @type {Route} */ ({ name: WITH_QUERY[head], query });
if (parts.length === 1 && SIMPLE[head]) return /** @type {Route} */ ({ name: SIMPLE[head] });
@@ -120,7 +120,8 @@ export const href = {
sync: () => "#/synchro",
pair: () => "#/relier",
library: (/** @type {string} */ query = "") => "#/bibliotheque" + (query ? "?" + query : ""),
wods: () => "#/wod",
/** Le catalogue, et le tirage du WOD du jour (1 omis). */
wods: (/** @type {number} */ draw = 1) => withParams("#/wod", { tirage: draw > 1 ? draw : null }),
wod: (/** @type {string} */ id) => "#/wod/" + enc(id),
libraryItem: (/** @type {string} */ id, /** @type {string} */ query = "") => "#/bibliotheque/" + enc(id) + (query ? "?" + query : ""),
};