Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.303 and 1.304

version 1.303, 2012/03/20 13:36:19 version 1.304, 2012/03/25 14:36:01
Line 1111  sub crumbs { Line 1111  sub crumbs {
     if ($uri !~ m|/$|) { $output=~s|/$||; }      if ($uri !~ m|/$|) { $output=~s|/$||; }
     $output.='</span>';      $output.='</span>';
   
   
     return $output;      return $output;
 }  }
   
Line 1175  ENDEDITOR Line 1176  ENDEDITOR
 <script type="text/javascript" src="/adm/jpicker/js/jpicker-1.1.6.min.js" >  <script type="text/javascript" src="/adm/jpicker/js/jpicker-1.1.6.min.js" >
 </script>  </script>
 <link rel="stylesheet" type="text/css" href="/adm/jpicker/css/jPicker-1.1.6.min.css" />  <link rel="stylesheet" type="text/css" href="/adm/jpicker/css/jPicker-1.1.6.min.css" />
   <script type='text/javascript' src='/adm/countdown/js/jquery.countdown.js'></script>
   <link rel="stylesheet" type="text/css" src='/adm/countdown/css/jquery.countdown.css' />
 ENDJQUERY  ENDJQUERY
  return $s;   return $s;
 }  }
Line 1306  sub htmlareaselectactive { Line 1309  sub htmlareaselectactive {
                 $.fn.jPicker.defaults.images.clientPath="/adm/jpicker/images/";                  $.fn.jPicker.defaults.images.clientPath="/adm/jpicker/images/";
                 $(".colorchooser").jPicker();                  $(".colorchooser").jPicker();
   
                   // Only define the countdown if a dueDate variable is defined:
   
                  if (typeof(dueDate) != "undefined") {
                     $("#duedatecountdown").countdown({until: dueDate, compact: true, 
                                                     layout: "<b>Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn}</b>",
                                                     onTick: function (periods) {
                            if($.countdown.periodsToSeconds(periods) < 60) {
                                $(this).css("color", "red");   //Highlight last minute.
                            }
                         }
                     });
                  }
   
  });   });
 ';  ';
     if ($dragmath_prefix ne '') {      if ($dragmath_prefix ne '') {
Line 1383  sub show_return_link { Line 1399  sub show_return_link {
 }  }
   
   
   ##
   #   Set the dueDate variable...note this is done in the timezone
   #   of the browser.
   #
   # @param epoch relative time at which the problem is due.
   #
   # @return the javascript fragment to set the date:
   #
   sub set_due_date {
       my $dueStamp = shift;
       my $duems    = $dueStamp * 1000; # Javascript Date object needs ms not seconds.
   
       my $now = time()*1000;
   
       # This slightly obscure bit of javascript sets the dueDate variable
       # to the time in the browser at which the problem was due.  
       # The code should correct for gross differences between the server
       # and client's time setting
   
       my $js = "
   <script type='text/javascript'>
     //<![CDATA[
   var serverDueDate = $duems;
   var serverTime    = $now;
   var clientTime    = (new Date()).getTime();
   var dueDate       = new Date(serverDueDate + (clientTime - serverTime));
   
     //]]>
   </script>
   ";
   
   }
   
 ############################################################  ############################################################
 ############################################################  ############################################################
   
Line 1501  returns: nothing Line 1550  returns: nothing
   
         # last breadcrumb is the first order heading of a page          # last breadcrumb is the first order heading of a page
         # for course breadcrumbs it's just bold          # for course breadcrumbs it's just bold
   
         $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',          $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
                 $lasttext), {title => $lasttext});                  $lasttext), {title => $lasttext});
   
    $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 1521  returns: nothing Line 1573  returns: nothing
                                                          $faq,$bug);                                                           $faq,$bug);
         }          }
         #          #
   
   
   
         unless ($CourseBreadcrumbs) {          unless ($CourseBreadcrumbs) {
Line 1529  returns: nothing Line 1582  returns: nothing
             $links = &htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });              $links = &htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });
         }          }
   
   
         if ($component) {          if ($component) {
             $links = &htmltag('span',               $links = &htmltag('span', 
                              ( $no_mt ? $component : mt($component) ).                               ( $no_mt ? $component : mt($component) ).
                              ( $icons ? $icons : '' ),                               ( $icons ? $icons : '' ),
                              { class => 'LC_breadcrumbs_component' } )                               { class => 'LC_breadcrumbs_component' } )
                              .$links;                               .$links 
   ;
         }          }
                   
         &render_tools(\$links);          &render_tools(\$links);
Line 1545  returns: nothing Line 1600  returns: nothing
         # Return the @Crumbs stack to what we started with          # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);          push(@Crumbs,$last);
         shift(@Crumbs);          shift(@Crumbs);
   
   
         # Return the breadcrumb's line          # Return the breadcrumb's line
   
       
   
         return "$links";          return "$links";
     }      }
   

Removed from v.1.303  
changed lines
  Added in v.1.304


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>