version 1.313, 2012/05/09 19:46:30
|
version 1.317, 2012/05/29 01:11:30
|
Line 95 sub direct_parm_link {
|
Line 95 sub direct_parm_link {
|
$filter=&entity_encode($filter); |
$filter=&entity_encode($filter); |
$part=&entity_encode($part); |
$part=&entity_encode($part); |
if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) { |
if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) { |
return "<a target='_top' href='/adm/parmset?symb=$symb&filter=$filter&part=$part'><span class='LC_setting'>$linktext</span></a>"; |
return "<a target='_top' href='/adm/parmset?symb=$symb&filter=$filter&part=$part'><span class='LC_setting'>$linktext</span></a>"; |
} else { |
} else { |
return $linktext; |
return $linktext; |
} |
} |
Line 1370 sub htmlareaselectactive {
|
Line 1370 sub htmlareaselectactive {
|
# is used to determine when the countdown timer turns red to warn the user |
# is used to determine when the countdown timer turns red to warn the user |
# to think about submitting. |
# to think about submitting. |
|
|
my $dueDateLayout = '<b>' . &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} - Submit early!') . '</b>'; |
my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]',"<span id='submitearly'></span>"); |
|
my $early = '- <b>'.&mt('Submit Early').'</b>'; |
|
my $pastdue = '- <b>'.&mt('Past Due').'</b>'; |
$output .= <<JAVASCRIPT; |
$output .= <<JAVASCRIPT; |
|
|
var documentReadyTime; |
var documentReadyTime; |
Line 1382 sub htmlareaselectactive {
|
Line 1384 sub htmlareaselectactive {
|
layout: "$dueDateLayout", |
layout: "$dueDateLayout", |
onTick: function (periods) { |
onTick: function (periods) { |
var latencyEstimate = (documentReadyTime - clientTime) * 2; |
var latencyEstimate = (documentReadyTime - clientTime) * 2; |
|
if(\$.countdown.periodsToSeconds(periods) < (300 + latencyEstimate)) { |
|
\$("#submitearly").html("$early"); |
|
if (\$.countdown.periodsToSeconds(periods) < 1) { |
|
\$("#submitearly").html("$pastdue"); |
|
} |
|
} |
if(\$.countdown.periodsToSeconds(periods) < (60 + latencyEstimate)) { |
if(\$.countdown.periodsToSeconds(periods) < (60 + latencyEstimate)) { |
\$(this).css("color", "red"); //Highlight last minute. |
\$(this).css("color", "red"); //Highlight last minute. |
} |
} |
Line 1484 sub set_due_date {
|
Line 1492 sub set_due_date {
|
# The code should correct for gross differences between the server |
# The code should correct for gross differences between the server |
# and client's time setting |
# and client's time setting |
|
|
my $js = " |
return <<"END"; |
<script type='text/javascript'> |
|
|
<script type="text/javascript"> |
//<![CDATA[ |
//<![CDATA[ |
var serverDueDate = $duems; |
var serverDueDate = $duems; |
var serverTime = $now; |
var serverTime = $now; |
Line 1494 var dueDate = new Date(serverDueDa
|
Line 1503 var dueDate = new Date(serverDueDa
|
|
|
//]]> |
//]]> |
</script> |
</script> |
"; |
|
|
|
return $js; |
END |
} |
} |
## |
## |
# Sets the time at which the problem finished computing. |
# Sets the time at which the problem finished computing. |
Line 1508 var dueDate = new Date(serverDueDa
|
Line 1516 var dueDate = new Date(serverDueDa
|
sub set_compute_end_time { |
sub set_compute_end_time { |
|
|
my $now = time()*1000; # Javascript times are in ms. |
my $now = time()*1000; # Javascript times are in ms. |
my $js = " |
return <<"END"; |
<script type='text/javascript'> |
|
|
<script type="text/javascript"> |
//<![CDATA[ |
//<![CDATA[ |
serverTime = $now; |
serverTime = $now; |
clientTime = (new Date()).getTime(); |
clientTime = (new Date()).getTime(); |
//]]> |
//]]> |
</script> |
</script> |
|
|
"; |
END |
return $js; |
|
|
|
} |
} |
|
|
############################################################ |
############################################################ |
Line 1568 returns: nothing
|
Line 1575 returns: nothing
|
my %tools = (); |
my %tools = (); |
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_; |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, |
|
$CourseBreadcrumbs) = @_; |
# |
# |
$css_class ||= 'LC_breadcrumbs'; |
$css_class ||= 'LC_breadcrumbs'; |
|
|
Line 1609 returns: nothing
|
Line 1617 returns: nothing
|
my $links; |
my $links; |
if ((&show_return_link) && (!$CourseBreadcrumbs)) { |
if ((&show_return_link) && (!$CourseBreadcrumbs)) { |
my $alttext = &mt('Go Back'); |
my $alttext = &mt('Go Back'); |
$links=&htmltag( 'a',"<img src='/res/adm/pages/reload.png' border='0' style='vertical-align:middle;' alt='$alttext' />", |
$links=&htmltag( 'a','<img src="/res/adm/pages/tolastloc.png" alt="'.$alttext.'" class="LC_icon" />', |
{ href => '/adm/flip?postdata=return:', |
{ href => '/adm/flip?postdata=return:', |
title => &mt("Back to most recent content resource") }); |
title => &mt('Back to most recent content resource'), |
|
class => 'LC_menubuttons_link', |
|
}); |
$links=&htmltag('li',$links); |
$links=&htmltag('li',$links); |
} |
} |
$links.= join "", |
$links.= join "", |
Line 1643 returns: nothing
|
Line 1653 returns: nothing
|
$links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', |
$links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', |
$lasttext), {title => $lasttext}); |
$lasttext), {title => $lasttext}); |
|
|
unless ($CourseBreadcrumbs) { |
|
$links .= '<li> <span id="duedatecountdown"></span></li>'; |
|
} |
|
|
|
my $icons = ''; |
my $icons = ''; |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$bug = $last->{'bug'} if (exists($last->{'bug'})); |
$bug = $last->{'bug'} if (exists($last->{'bug'})); |
Line 1724 Currently there are 3 possible values fo
|
Line 1730 Currently there are 3 possible values fo
|
left of breadcrumbs line |
left of breadcrumbs line |
|
|
=item tools |
=item tools |
right of breadcrumbs line |
remaining items in right of breadcrumbs line |
|
|
=item advtools |
=item advtools |
advanced tools shown in a separate box below breadcrumbs line |
advanced tools shown in a separate box below breadcrumbs line |