version 1.99, 2012/08/17 18:02:15
|
version 1.112, 2024/06/06 15:55:19
|
Line 49 BEGIN {
|
Line 49 BEGIN {
|
# Return a true value if HTML5 should be used. |
# Return a true value if HTML5 should be used. |
|
|
sub useHTML5 { |
sub useHTML5 { |
if ($env{'browser.type'} eq 'chrome') { return 1; } |
if ($env{'browser.type'} eq 'chrome') { |
if (($env{'browser.type'} eq 'safari') && |
if ($env{'browser.version'} >= 14) { |
($env{'browser.os'} eq 'mac')) { return 1; } |
return 1; |
|
} |
|
} elsif ($env{'browser.type'} eq 'safari') { |
|
if ($env{'browser.os'} eq 'mac') { |
|
my ($prefix,$version) = ($env{'browser.version'} =~ /^(\d*)(\d{3})\./); |
|
if ($version >= 536) { |
|
return 1; |
|
} |
|
} |
|
} elsif ($env{'browser.type'} eq 'mozilla') { |
|
if ($env{'browser.info'} =~ /^firefox\-(\d+)/) { |
|
my $firefox = $1; |
|
if ((($env{'browser.os'} eq 'mac') && ($firefox >= 20)) || |
|
(($env{'browser.os'} eq 'unix') && ($firefox >= 17)) || |
|
(($env{'browser.os'} eq 'win') && ($firefox >= 14))) { |
|
return 1; |
|
} |
|
} |
|
} elsif ($env{'browser.type'} eq 'explorer') { |
|
if (($env{'browser.os'} eq 'win') && ($env{'browser.version'} >= 10)) { |
|
return 1; |
|
} |
|
} elsif ($env{'browser.type'} eq 'opera') { |
|
if ($env{'browser.version'} >= 18) { |
|
return 1; |
|
} |
|
} |
return 0; |
return 0; |
} |
} |
|
|
Line 133 sub html5_geogebra_startcode {
|
Line 159 sub html5_geogebra_startcode {
|
unless ($height) { $height=400; } |
unless ($height) { $height=400; } |
my $code=&geogebra_internal_program(); |
my $code=&geogebra_internal_program(); |
return (<<ENDSTARTCODE); |
return (<<ENDSTARTCODE); |
|
<div class="LC_left_float" style="margin:0; width:100%;"> |
<article class="geogebraweb" data-param-enableLabelDrags="false" data-param-enableShiftDragZoom="false" |
<article class="geogebraweb" data-param-enableLabelDrags="false" data-param-enableShiftDragZoom="false" |
data-param-width="$width" data-param-height="$height" data-param-id="ggbApplet$appid" |
data-param-width="$width" data-param-height="$height" data-param-id="ggbApplet$appid" |
data-param-ggbbase64="$code"></article> |
data-param-useBrowserForJS="true" data-param-ggbbase64="$code"></article> |
|
</div><div style="padding:0;clear:both;margin:0;border:0"></div> |
ENDSTARTCODE |
ENDSTARTCODE |
} |
} |
|
|
Line 158 sub java_geogebra_default_parameters {
|
Line 186 sub java_geogebra_default_parameters {
|
<param name="boxborder" value="false" /> |
<param name="boxborder" value="false" /> |
<param name="centerimage" value="true" /> |
<param name="centerimage" value="true" /> |
<param name="cache_archive" value="geogebra.jar, geogebra_main.jar, geogebra_gui.jar, geogebra_cas.jar, geogebra_export.jar, geogebra_algos.jar, geogebra_javascript.jar, geogebra_properties.jar, jlatexmath.jar, jlm_cyrillic.jar, jlm_greek.jar" /> |
<param name="cache_archive" value="geogebra.jar, geogebra_main.jar, geogebra_gui.jar, geogebra_cas.jar, geogebra_export.jar, geogebra_algos.jar, geogebra_javascript.jar, geogebra_properties.jar, jlatexmath.jar, jlm_cyrillic.jar, jlm_greek.jar" /> |
<param name="cache_version" value="4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0,4.0.1.0" /> |
<param name="cache_version" value="4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0,4.4.3.0" /> |
<param name="framePossible" value="false" /> |
<param name="framePossible" value="false" /> |
|
|
<param name="showResetIcon" value="false" /> |
<param name="showResetIcon" value="false" /> |
Line 196 sub init_script {
|
Line 224 sub init_script {
|
my $html5init=''; |
my $html5init=''; |
if (&useHTML5()) { |
if (&useHTML5()) { |
$html5init= |
$html5init= |
'<script type="text/javascript" language="javascript" src="/adm/geogebra/html5/web/test42/web/web.nocache.js"></script>'; |
'<script type="text/javascript" language="javascript" src="/adm/geogebra/web/web.nocache.js"></script>'; |
} |
} |
return (<<ENDGGBINIT); |
return (<<ENDGGBINIT); |
$html5init |
$html5init |
Line 810 sub start_backgroundplot {
|
Line 838 sub start_backgroundplot {
|
&Apache::edit::text_arg('Label on Plot:','label', |
&Apache::edit::text_arg('Label on Plot:','label', |
$token,'8'). |
$token,'8'). |
&Apache::edit::text_arg('Color (hex code):','color', |
&Apache::edit::text_arg('Color (hex code):','color', |
$token,'8'). |
$token,'8', 'colorchooser'). |
&Apache::edit::select_arg('Fixed location:','fixed', |
&Apache::edit::select_arg('Fixed location:','fixed', |
['yes','no'],$token). |
['yes','no'],$token). |
&Apache::edit::end_row(); |
&Apache::edit::end_row(); |
Line 887 sub start_functionplotrule {
|
Line 915 sub start_functionplotrule {
|
$result=&Apache::edit::tag_start($target,$token,'Function Plot Graph Rule'). |
$result=&Apache::edit::tag_start($target,$token,'Function Plot Graph Rule'). |
&Apache::edit::text_arg('Index/Name:','index', |
&Apache::edit::text_arg('Index/Name:','index', |
$token,'10').' '. |
$token,'10').' '. |
&Apache::edit::select_arg(&mt('Function:'),'derivativeorder', |
&Apache::edit::select_arg('Function:','derivativeorder', |
[['0','Function itself'], |
[['0','Function itself'], |
['1','First derivative'], |
['1','First derivative'], |
['2','Second derivative'], |
['2','Second derivative'], |
Line 1431 sub start_functionplotresponse {
|
Line 1459 sub start_functionplotresponse {
|
my $ylabel=&Apache::lonxml::get_param('ylabel',$parstack,$safeeval); |
my $ylabel=&Apache::lonxml::get_param('ylabel',$parstack,$safeeval); |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.=&Apache::edit::start_table($token) |
$result.=&Apache::edit::start_table($token) |
.'<tr><td><span class="LC_nobreak">'.&mt('Function Plot Question').'</span></td>' |
.'<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button().&mt('Function Plot Question').'</span></td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.&Apache::edit::deletelist($target,$token).' ' |
.&Apache::edit::deletelist($target,$token).' ' |
.&Apache::edit::insertlist($target,$token).' ' |
.&Apache::edit::insertlist($target,$token).' ' |
Line 1485 sub start_functionplotresponse {
|
Line 1513 sub start_functionplotresponse {
|
$env{'form.counter'},$Apache::lonxml::curdepth); |
$env{'form.counter'},$Apache::lonxml::curdepth); |
&Apache::lonxml::add_script_result( |
&Apache::lonxml::add_script_result( |
&Apache::loncommon::modal_adhoc_window($function_name,700,500, |
&Apache::loncommon::modal_adhoc_window($function_name,700,500, |
'<pre>'.$Apache::functionplotresponse::ruleslog.'</pre>', |
'<pre style="background-color:#ffffff;">'.$Apache::functionplotresponse::ruleslog.'</pre>', |
&mt('Rules Log'))."<br />"); |
&mt('Rules Log'))."<br />"); |
} |
} |
return $result; |
return $result; |
Line 2018 sub start_functionplotruleset {
|
Line 2046 sub start_functionplotruleset {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
return &Apache::edit::start_table($token). |
return &Apache::edit::start_table($token). |
'<tr><td><span class="LC_nobreak">'.&mt('Function Plot Rule Set').'</span></td>' |
'<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button().&mt('Function Plot Rule Set').'</span></td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.&Apache::edit::deletelist($target,$token).' '. |
.&Apache::edit::deletelist($target,$token).' '. |
&Apache::edit::insertlist($target,$token).' ' |
&Apache::edit::insertlist($target,$token).' ' |
Line 2211 sub start_functionplotelements {
|
Line 2239 sub start_functionplotelements {
|
|
|
if ($target eq 'edit') { |
if ($target eq 'edit') { |
return &Apache::edit::start_table($token). |
return &Apache::edit::start_table($token). |
'<tr><td><span class="LC_nobreak">'.&mt('Function Plot Elements').'</span></td>' |
'<tr><td><span class="LC_nobreak">'.&Apache::loncommon::insert_folding_button() |
|
.&mt('Function Plot Elements').'</span></td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.&Apache::edit::deletelist($target,$token).' '. |
.&Apache::edit::deletelist($target,$token).' '. |
&Apache::edit::insertlist($target,$token).' ' |
&Apache::edit::insertlist($target,$token).' ' |