diff --git a/src/app.js b/src/app.js index f84dfe8..dd22fd0 100644 --- a/src/app.js +++ b/src/app.js @@ -207,6 +207,8 @@ function saveUserSettings() { // ================= LESSON CACHE ================= +let cachedUserCode = null; + function restoreLessonCache() { try { const cached = localStorage.getItem("codeCrispies.lessonCache"); @@ -230,6 +232,10 @@ function restoreLessonCache() { if (data.levelIndicator && elements.levelIndicator) { elements.levelIndicator.innerHTML = data.levelIndicator; } + // Store userCode to apply after editor init + if (data.userCode) { + cachedUserCode = data.userCode; + } } } catch (e) { // Ignore cache errors @@ -471,7 +477,9 @@ function loadCurrentLesson() { lessonTitle: lesson.title, lessonDescription: lesson.description, taskInstruction: lesson.task, - levelIndicator: elements.levelIndicator?.innerHTML + levelIndicator: elements.levelIndicator?.innerHTML, + userCode: engineState.userCode, + mode: mode }) ); } catch (e) { diff --git a/src/i18n.js b/src/i18n.js index f8e802c..e3f7590 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -76,6 +76,11 @@ const translations = { emmetNested: "form>input+button → nested structure", emmetContent: "p{Hello} → p with text content", + // More Projects + moreProjectsTitle: "More Projects", + htmlOverJsDesc: " - Learn to leverage native HTML elements instead of custom JavaScript solutions", + mandalaDesc: " - Interactive visualization of JavaScript technologies organized by complexity", + // Contact contactTitle: "Contact & Links", contactText: "Code Crispies is developed by librete.ch", @@ -170,6 +175,11 @@ const translations = { emmetNested: "form>input+button → verschachtelte Struktur", emmetContent: "p{Hallo} → p mit Textinhalt", + // More Projects + moreProjectsTitle: "Weitere Projekte", + htmlOverJsDesc: " - Lerne, native HTML-Elemente statt eigener JavaScript-Lösungen zu nutzen", + mandalaDesc: " - Interaktive Visualisierung von JavaScript-Technologien nach Komplexität geordnet", + // Contact contactTitle: "Kontakt & Links", contactText: "Code Crispies wird von librete.ch entwickelt", diff --git a/src/index.html b/src/index.html index 27c6cd1..53a2e93 100644 --- a/src/index.html +++ b/src/index.html @@ -177,6 +177,18 @@
Code Crispies is developed by librete.ch