Diff for /loncom/interface/lonmenu.pm between versions 1.434 and 1.435

version 1.434, 2015/05/28 03:14:25 version 1.435, 2015/06/17 03:57:15
Line 1543  function toggleCountdown() { Line 1543  function toggleCountdown() {
 END  END
 }  }
   
   # This creates a "done button" for timed events.  The confirmation box is a jQuery
   # dialog widget.  Clicking OK will set (LC_interval_done = 'true') which is checked in 
   # lonhomework.pm.
   sub done_button_js {
       my ($type,$height) = @_;
       if ($height !~ /^\d+$/) {
           $height = 320;
       }
       my %lt = &Apache::lonlocal::texthash(
                    title    => 'WARNING!',
                    button   => 'Done',
                    preamble => 'You are trying to end this timed event early.',
                    map      => 'Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder.',
                    resource => 'Confirming that you are done will cause the time to expire for this question, and prevent you from changing your answer(s).', 
                    ok       => 'Click "OK" if you are completely finished.',
                    cancel   => 'Click "Cancel" to continue working.',
       );
       my $confirm;
       if (($type eq 'map') || ($type eq 'resource')) {
           $confirm = $lt{'preamble'}.' '.$lt{$type}.' '.$lt{'ok'}.' '.$lt{'cancel'};
       }
       if ($confirm) {
           return <<END;
   
   <form method="post" name="LCdoneButton" action="">
       <input type="hidden" name="LC_interval_done" value="" />
       <button id="LC_done-confirm-opener" type="button">$lt{'button'}</button>
   </form>
   
   <div id="LC_done-confirm" title="$lt{'title'}">
       <p>$confirm</p>
   </div>
   
   <script type="text/javascript">
   // <![CDATA[
   \$( "#LC_done-confirm" ).dialog({ autoOpen: false });
   \$( "#LC_done-confirm-opener" ).click(function() {
       \$( "#LC_done-confirm" ).dialog( "open" );
       \$( "#LC_done-confirm" ).dialog({
         resizable: false,
         height: $height,
         modal: true,
         buttons: {
           "OK": function() {
               \$( this ).dialog( "close" );
               \$( '[name="LC_interval_done"]' )[0].value = 'true';
               \$( '[name="LCdoneButton"]' )[0].submit();
           },
           Cancel: function() {
             \$( this ).dialog( "close" );
           }
         }    
       })
   });
   // ]]>
   </script>
   
   END
       } else {
           return;
       }
   }
   
 sub utilityfunctions {  sub utilityfunctions {
     my ($httphost) = @_;      my ($httphost) = @_;
     my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));      my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
Line 2217  sub countdown_timer { Line 2280  sub countdown_timer {
         if (($duedate && $duedate > time) ||          if (($duedate && $duedate > time) ||
             (!$duedate && $hastimeleft) ||              (!$duedate && $hastimeleft) ||
             ($slot_name ne '' && $slothastime)) {              ($slot_name ne '' && $slothastime)) {
             my ($collapse,$expand,$alttxt,$title,$currdisp);              my ($collapse,$expand,$alttxt,$title,$currdisp,$donebutton);
             if ((@interval > 1 && $hastimeleft) ||              if ((@interval > 1 && $hastimeleft) ||
                 ($type eq 'Task' && $slothastime)) {                  ($type eq 'Task' && $slothastime)) {
                 $currdisp = 'inline';                  $currdisp = 'inline';
                 $collapse = '&#9658;&nbsp;';                  $collapse = '&#9658;&nbsp;';
                   if ((@interval > 1) && ($hastimeleft)) {
                       $donebutton = &done_button_js($interval[1]);
                   }
             } else {              } else {
                 $currdisp = 'none';                  $currdisp = 'none';
                 $expand = '&#9668;&nbsp;';                  $expand = '&#9668;&nbsp;';
Line 2231  sub countdown_timer { Line 2297  sub countdown_timer {
                 $title = $alttxt.'&nbsp;';                  $title = $alttxt.'&nbsp;';
             }              }
             my $desc = &mt('Countdown to due date/time');              my $desc = &mt('Countdown to due date/time');
             return <<END;  
   
               return <<END;
   $donebutton
 <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">  <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
 <span id="ddcountcollapse" class="LC_menubuttons_inline_text">  <span id="ddcountcollapse" class="LC_menubuttons_inline_text">
 $collapse  $collapse

Removed from v.1.434  
changed lines
  Added in v.1.435


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