Spaces:
Running
Running
Update practice.html
Browse files- practice.html +22 -7
practice.html
CHANGED
|
@@ -56,14 +56,29 @@
|
|
| 56 |
window.RISE_SELECTED_LEVEL = button.dataset.level;
|
| 57 |
picker.style.display = "none";
|
| 58 |
readingArea.style.display = "block";
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
window.scrollTo({top: 0, behavior: "smooth"});
|
| 68 |
});
|
| 69 |
});
|
|
|
|
| 56 |
window.RISE_SELECTED_LEVEL = button.dataset.level;
|
| 57 |
picker.style.display = "none";
|
| 58 |
readingArea.style.display = "block";
|
| 59 |
+
const container = document.getElementById("rise-reading-app");
|
| 60 |
+
container.innerHTML = "<p>Loading your reading activity...</p>";
|
| 61 |
+
|
| 62 |
+
const oldScript = document.getElementById("rise-frontend-script");
|
| 63 |
+
|
| 64 |
+
if (oldScript) {
|
| 65 |
+
oldScript.remove();
|
| 66 |
}
|
| 67 |
+
|
| 68 |
+
const script = document.createElement("script");
|
| 69 |
+
script.id = "rise-frontend-script";
|
| 70 |
+
script.src = "./rise-frontend.js?v=2";
|
| 71 |
+
|
| 72 |
+
script.onload = () => {
|
| 73 |
+
console.log("RISE frontend script loaded.");
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
script.onerror = () => {
|
| 77 |
+
container.innerHTML =
|
| 78 |
+
"<p style='color:red'>Could not load rise-frontend.js. Check that the file is in the repository root.</p>";
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
document.body.appendChild(script);
|
| 82 |
window.scrollTo({top: 0, behavior: "smooth"});
|
| 83 |
});
|
| 84 |
});
|