feat: add More Projects section to help dialog

- Add HTML over JS and Web Engineering Mandala projects
- Include i18n translations for EN and DE
- Add userCode to lesson cache for faster reload
This commit is contained in:
2025-12-30 21:21:47 +01:00
parent 1185d452dc
commit a4787731dc
4 changed files with 32 additions and 2 deletions

View File

@@ -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) {