|
| 1 | +From me: |
| 2 | + |
| 3 | +I just thought of a possible solution for those nasty CSS clashes that |
| 4 | +you guys are encountering: |
| 5 | + |
| 6 | +I could prefix all of my python tutor CSS rules with something like |
| 7 | +div.ExecutionVisualizer. e.g., |
| 8 | + |
| 9 | +div.ExecutionVisualizer table td { |
| 10 | + ... blah blah ... |
| 11 | +} |
| 12 | + |
| 13 | +and then when the user creates an ExecutionVisualizer object with |
| 14 | +JavaScript and passes it a div, I use JavaScript to set its class to |
| 15 | +"ExecutionVisualizer". |
| 16 | + |
| 17 | +Thoughts? |
| 18 | + |
| 19 | + |
| 20 | +--- |
| 21 | +From John: |
| 22 | + |
| 23 | +That's a good idea. It would also be great to establish two different |
| 24 | +top-level div classes: one for embedded and one for stand-alone |
| 25 | +visualizers. Embedded visualizers typically need to be more densely |
| 26 | +laid out, otherwise they eat up the entire page. You can see my css |
| 27 | +changes for embedding in the master branch of my fork. |
| 28 | + |
| 29 | +https://github.com/papajohn/OnlinePythonTutor/blob/master/PyTutorGAE/css/pytutor.css |
| 30 | +[downloaded as papajohn-pytutor.css] |
| 31 | + |
| 32 | +Ideally, I'd add the option of creating an embedded visualizer or a |
| 33 | +stand-alone one on construction, and each would be allowed to have |
| 34 | +different styles but mostly share the same styles. |
| 35 | + |
| 36 | + |
| 37 | +--- |
| 38 | +From Sean: |
| 39 | + |
| 40 | +Philip, just wondering, could you just make a new container div with the |
| 41 | +right class, and stick it into the div passed to your code? This might |
| 42 | +be easier than fiddling with the class on the div the user gives, and |
| 43 | +I'm also wondering whether there could be unforeseen interactions with |
| 44 | +other classes that might have been prespecified on that div. I don't |
| 45 | +know what the downsides of the new approach are, though. |
| 46 | + |
0 commit comments