Catalogue des WOD de référence (lot 4d)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-18 15:15:45 +01:00
co-authored by Claude Opus 5.5
parent 35a826ddf0
commit 79ce7b34ac
13 changed files with 325 additions and 5 deletions
+6
View File
@@ -32,6 +32,8 @@
* | {name: "connect-ai", query: string}
* | {name: "library", query: string}
* | {name: "library-item", id: string, query: string}
* | {name: "wods"}
* | {name: "wod", id: string}
* | {name: "reserved"}
* | {name: "not-found"}} Route
*/
@@ -63,6 +65,8 @@ 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 === 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] });
return { name: "not-found" };
@@ -116,6 +120,8 @@ export const href = {
sync: () => "#/synchro",
pair: () => "#/relier",
library: (/** @type {string} */ query = "") => "#/bibliotheque" + (query ? "?" + query : ""),
wods: () => "#/wod",
wod: (/** @type {string} */ id) => "#/wod/" + enc(id),
libraryItem: (/** @type {string} */ id, /** @type {string} */ query = "") => "#/bibliotheque/" + enc(id) + (query ? "?" + query : ""),
};