Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protecting <div> around the geogebra object. #354

Merged
merged 1 commit into from
May 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/Applet.pm
Original file line number Diff line number Diff line change
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