Skip to content

Commit

Permalink
Add protecting <div> around the geogebra object. The geogebra javaScr…
Browse files Browse the repository at this point in the history
…ipt modifies the style of the second enveloping <div> containing the geogebra object. Specifically it sets the height and width. If the <div> contains other material besides the geogebra object these values for the height and width will be incorrect causing overlapping outputs.
  • Loading branch information
mgage committed May 3, 2018
1 parent 144b7fb commit 13bb849
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/Applet.pm
Expand Up @@ -1144,14 +1144,27 @@ use constant GEOGEBRAWEB_OBJECT_HEADER_TEXT =><<'END_HEADER_SCRIPT';
END_HEADER_SCRIPT

# Some changes in the way geogebra javaScript works make it important
# That the object and the script that calls it are contained in some <div>
# (otherwise geogebra adds height and width values to the second enclosing <div>
# (i.e. the div enclosing the enclosing div) and
# if the div contains more than just the geogebra applet this size will be incorrect. )
# (This behavior is probably a bug in geogebra --
# but I don't have a precise statement of the API.)
# The <div class="enclose_geogebra_object> and <div class="geogebra_object" do nothing for now
# but perhaps they might have a use later. style="height:306 ptx,width: 486 ptx" is inserted in
# the class="enclose_geogebra_object" div by the geogebra applet.

use constant GEOGEBRAWEB_OBJECT_TEXT =><<'END_OBJECT_TEXT';
<div class="enclose_geogebra_object">
<div class="geogebra_object">
<script language="javascript">ww_applet_list["$appletName"].visible = 1; // don't submit things if not visible
</script>
<script type="text/javascript" language="javascript" src="//web.geogebra.org/4.4/web/web.nocache.js"></script>
$webgeogebraParameters
</div>
</div>
END_OBJECT_TEXT

sub new {
Expand Down

0 comments on commit 13bb849

Please sign in to comment.