Skip to content

Commit 59d0cb4

Browse files
authored
feat: Add type hints for js function by JSDoc (#79)
1 parent 95fef31 commit 59d0cb4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

templates/components/challenge_area.html

+8
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
</div>
5050

5151
<script type="text/javascript">
52+
/**
53+
* Render the code area with CodeMirror and Jinja2.
54+
*
55+
* @param {string} code_under_test - The code to be tested.
56+
* @param {string} test_code - The test code.
57+
* @param {'basic'|'intermediate'|'advanced'|'extreme'} level - The level of the challenge.
58+
* @param {string} name - The name of the challenge.
59+
*/
5260
function renderCodeArea(code_under_test, test_code, level, name) {
5361
let confetti = new JSConfetti();
5462
let initTheme = localStorage.getItem('theme') === 'dark' ? "material-darker" : "default"

templates/components/challenge_sidebar.html

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ <h5 class="challenge-level">{{ level }}</h5>
134134
});
135135
});
136136

137+
/**
138+
* Remove previously highlighted style from the challenge list.
139+
*
140+
* @param {Event} event - The click event.
141+
*/
137142
function removeHighlight(event) {
138143
previousActiveChallenges = document.getElementsByClassName("active-challenge");
139144
for (c of previousActiveChallenges) {

0 commit comments

Comments
 (0)