Skip to content

Commit 56d758c

Browse files
Merge pull request #437 from ossf/minor_lab_additions1
Minor lab additions1
2 parents 662a139 + 9bb62a1 commit 56d758c

File tree

8 files changed

+30
-4
lines changed

8 files changed

+30
-4
lines changed

docs/labs/checker.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ pre input, pre textarea {
1212
.markdown-body pre textarea, pre textarea {
1313
resize: both;
1414
}
15+
16+
.displayNone {
17+
display: none;
18+
}

docs/labs/checker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ function showDebugOutput(debugOutput, alwaysAlert = true) {
9494
// Use textContent to see the raw unfiltered results
9595
debugDataRegion.textContent = (
9696
String(debugDataRegion.textContent) + debugOutputString + "\n\n");
97+
debugDataRegion.classList.remove('displayNone');
98+
// Force display, just in case:
9799
debugDataRegion.style.display = 'block';
98100
if (alwaysAlert) alert(debugOutputString);
99101
} else {

docs/labs/create_checker.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,3 +613,18 @@ to refer to the corresponding capturing group.
613613

614614
If you load `hello.html` you'll automatically run some self-tests on
615615
the default preprocessor.
616+
617+
## Potential future directions
618+
619+
Below are notes about potential future directions.
620+
621+
Currently this system uses simple input and textarea tags
622+
to retrieve data.
623+
It might be useful to (optionally?) replace that with a code editor.
624+
[Wikipedia's Comparison of JavaScript-based source code editors](https://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors) lists many options.
625+
[CodeJar](https://medv.io/codejar/)
626+
([CodeJar repo](https://github.com/antonmedv/codejar))
627+
looks promising. It has an MIT license, only about 2.5kB,
628+
and you can use a highlighting library such as PrismJS or your own;
629+
it doesn't do any bracket matching though.
630+
There are many larger ones such as Ace and CodeMirror.

docs/labs/csp1.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -409,7 +410,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
409410
<button type="button" id="giveUpButton">Give up</button>
410411
<br><br>
411412
<pre id="correctStamp"></pre>
412-
<textarea id="debugData" rows="20" cols="70" readonly style="display: none;">
413+
<textarea id="debugData" class="displayNone" rows="20" cols="70" readonly>
413414
</textarea>
414415
</form>
415416
</div><!-- End GitHub pages formatting -->

docs/labs/hello.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -170,7 +171,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
170171
<button type="button" id="giveUpButton">Give up</button>
171172
<br><br>
172173
<pre id="correctStamp"></pre>
173-
<textarea id="debugData" rows="20" cols="70" readonly style="display: none;">
174+
<textarea id="debugData" class="displayNone" rows="20" cols="70" readonly>
174175
</textarea>
175176
</form>
176177

docs/labs/input1-emulation.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<script src="lab_runner.js"></script>

docs/labs/input1.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -226,7 +227,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
226227
<button type="button" id="giveUpButton">Give up</button>
227228
<br><br>
228229
<pre id="correctStamp"></pre>
229-
<textarea id="debugData" rows="20" cols="70" readonly style="display: none;">
230+
<textarea id="debugData" class="displayNone" rows="20" cols="70" readonly>
230231
</textarea>
231232
</form>
232233

docs/labs/input2.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -217,7 +218,7 @@ <h2>Interactive Lab (<span id="grade"></span>)</h2>
217218
<button type="button" id="giveUpButton">Give up</button>
218219
<br><br>
219220
<pre id="correctStamp"></pre>
220-
<textarea id="debugData" rows="20" cols="70" readonly style="display: none;">
221+
<textarea id="debugData" class="displayNone" rows="20" cols="70" readonly>
221222
</textarea>
222223
</form>
223224

0 commit comments

Comments
 (0)