--- loncom/interface/lonhtmlcommon.pm 2012/02/22 10:18:26 1.301 +++ loncom/interface/lonhtmlcommon.pm 2012/04/04 10:47:29 1.307 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.301 2012/02/22 10:18:26 foxr Exp $ +# $Id: lonhtmlcommon.pm,v 1.307 2012/04/04 10:47:29 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1072,6 +1072,8 @@ sub Close_PrgWin { sub crumbs { my ($uri,$target,$prefix,$form,$skiplast)=@_; +# You cannot crumbnify uploaded or adm resources + if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Group Content)'); } if ($target) { $target = ' target="'. &Apache::loncommon::escape_single($target).'"'; @@ -1109,6 +1111,7 @@ sub crumbs { if ($uri !~ m|/$|) { $output=~s|/$||; } $output.=''; + return $output; } @@ -1173,6 +1176,8 @@ ENDEDITOR + + ENDJQUERY return $s; } @@ -1304,8 +1309,55 @@ sub htmlareaselectactive { $.fn.jPicker.defaults.images.clientPath="/adm/jpicker/images/"; $(".colorchooser").jPicker(); -c }); + + }); '; + # Code to put a due date countdown in 'duedatecountdown' span. + # This is currently located in the breadcrumb headers. + # note that the dueDateLayout is internatinoalized below. + # Here document is used to support the substitution into the javascript below. + # ..which unforunately necessitates escaping the $'s in the javascript. + # There are several times of importance + # + # serverDueDate - The absolute time at which the problem expires. + # serverTime - The server's time when the problem finished computing. + # clientTime - The client's time...as close to serverTime as possible. + # The clientTime will be slightly later due to + # 1. The latency between problem computation and + # the first network action. + # 2. The time required between the page load-start and the actual + # initial javascript execution that got clientTime. + # These are used as follows: + # The difference between clientTime and serverTime are used to + # correct for differences in clock settings between the browser's system and the + # server's. + # + # The difference between clientTime and the time at which the ready() method + # starts executing is used to estimate latencies for page load and submission. + # Since this is an estimate, it is doubled. The latency estimate + one minute + # is used to determine when the countdown timer turns red to warn the user + # to think about submitting. + + my $dueDateLayout = '' . &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} - Submit early!') . ''; + $output .= < $lasttext}); + $links .= '
  • '; + my $icons = ''; $faq = $last->{'faq'} if (exists($last->{'faq'})); $bug = $last->{'bug'} if (exists($last->{'bug'})); @@ -1519,6 +1630,7 @@ returns: nothing $faq,$bug); } # + unless ($CourseBreadcrumbs) { @@ -1527,12 +1639,14 @@ returns: nothing $links = &htmltag('ul', $links, { class => "LC_CourseBreadcrumbs" }); } + if ($component) { $links = &htmltag('span', ( $no_mt ? $component : mt($component) ). ( $icons ? $icons : '' ), { class => 'LC_breadcrumbs_component' } ) - .$links; + .$links +; } &render_tools(\$links); @@ -1543,7 +1657,12 @@ returns: nothing # Return the @Crumbs stack to what we started with push(@Crumbs,$last); shift(@Crumbs); + + # Return the breadcrumb's line + + + return "$links"; }