Skip to content

Commit a8402db

Browse files
author
Joel Burget
committed
Update template with classes in addition to ids.
Due to the constraints of perseus one (perseus 360?) (one-page-app stuff - ask me if you're interested) I sometimes have to hide the page body and show a perseus renderer. That renderer breaks because it gets workarea, solutionarea, and hintsarea by id... but those ids already exist on the page and they're not the elements we want. But what if there was a way to name elements on the page in such a way that there could be multiple elements with the same label? I scoured the html spec and discovered a little-know but well supported feature called [classes](http://www.w3.org/TR/html5/dom.html#classes). It's risky, but my plan is to select dom nodes using these "classes" instead of ids. Test Plan: Ack for workarea, solutionarea, and hintsarea - determine these class names don't already exist. Auditors: alpert Cc: alex
1 parent 5c7b296 commit a8402db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

exercises/khan-exercise.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
o javascript/exercises-package/problem-template.handlebars
55
o khan-exercises/exercises/khan-exercise.html
66
7-
(these two files should simply be copies of each other)
7+
(these two files should simply be copies of each other (this is a lie))
88
99
TODO(eater): Make this simpler
1010
-->
@@ -20,15 +20,15 @@
2020
<form id="answerform" name="answerform">
2121
<div id="problemarea">
2222
<div id="scratchpad"><div></div></div>
23-
<div id="workarea"></div>
24-
<div id="hintsarea"></div>
23+
<div id="workarea" class="workarea"></div>
24+
<div id="hintsarea" class="hintsarea"></div>
2525
</div>
2626
<div id="answer_area_wrap"><div id="answer_area">
2727
<input style="position: absolute; left: -9999px; width: 1px; height: 1px" type="submit">
2828
<div class="info-box" id="answercontent">
2929
<span id="examples-show">Acceptable formats</span>
3030
<span class="info-box-header">Answer</span>
31-
<div class="fancy-scrollbar" id="solutionarea"></div>
31+
<div class="fancy-scrollbar solutionarea" id="solutionarea"></div>
3232
<ul id="examples" style="display: none"></ul>
3333
<div class="answer-buttons">
3434
<div class="check-answer-wrapper">

0 commit comments

Comments
 (0)