Diff for /loncom/interface/lonmenu.pm between versions 1.431.2.2 and 1.431.2.3

version 1.431.2.2, 2015/04/14 21:35:52 version 1.431.2.3, 2015/05/26 13:25:43
Line 1536  function toggleCountdown() { Line 1536  function toggleCountdown() {
 END  END
 }  }
   
 # This creates a "done button" for timed events.  The confirmation box is a jQuerey  # This creates a "done button" for timed events.  The confirmation box is a jQuery
 # dialog widget.  Clicking OK will set (done = 'true') which is checked in   # dialog widget.  Clicking OK will set (LC_interval_done = 'true') which is checked in 
 # lonhomework.pm.  # lonhomework.pm.
 sub done_button_js {  sub done_button_js {
     return <<END;      my ($type,$height) = @_;
       if ($height !~ /^\d+$/) {
 <form method="post" name="doneButton">          $height = 320;
     <input type="hidden" name="done" value=""/>      }
     <button id="done-confirm-opener" type="button">Done</button>      my %lt = &Apache::lonlocal::texthash(
 </form>                    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="done-confirm" title="WARNING!">  <div id="LC_done-confirm" title="$lt{'title'}">
     <p></span>You are trying to end this timed event early.  Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder.  Click "OK" if you are completely finished.  Click "Cancel" to continue working.</p>      <p>$confirm</p>
 </div>  </div>
   
 <script>  <script type="text/javascript">
 \$( "#done-confirm" ).dialog({ autoOpen: false });  // <![CDATA[
 \$( "#done-confirm-opener" ).click(function() {  \$( "#LC_done-confirm" ).dialog({ autoOpen: false });
     \$( "#done-confirm" ).dialog( "open" );  \$( "#LC_done-confirm-opener" ).click(function() {
     \$( "#done-confirm" ).dialog({      \$( "#LC_done-confirm" ).dialog( "open" );
       \$( "#LC_done-confirm" ).dialog({
       resizable: false,        resizable: false,
       height:320,        height: $height,
       modal: true,        modal: true,
       buttons: {        buttons: {
         "OK": function() {          "OK": function() {
             \$( this ).dialog( "close" );              \$( this ).dialog( "close" );
             \$( '[name="done"]' )[0].value = 'true';              \$( '[name="LC_interval_done"]' )[0].value = 'true';
             \$( '[name="doneButton"]' )[0].submit();              \$( '[name="LCdoneButton"]' )[0].submit();
         },          },
         Cancel: function() {          Cancel: function() {
           \$( this ).dialog( "close" );            \$( this ).dialog( "close" );
Line 1571  sub done_button_js { Line 1590  sub done_button_js {
       }            }    
     })      })
 });  });
   // ]]>
 </script>  </script>
   
 END  END
       } else {
           return;
       }
 }  }
   
 sub utilityfunctions {  sub utilityfunctions {
Line 2256  sub countdown_timer { Line 2279  sub countdown_timer {
                 ($type eq 'Task' && $slothastime)) {                  ($type eq 'Task' && $slothastime)) {
                 $currdisp = 'inline';                  $currdisp = 'inline';
                 $collapse = '&#9658;&nbsp;';                  $collapse = '&#9658;&nbsp;';
                 $donebutton = &done_button_js();                  if ((@interval > 1) && ($hastimeleft)) {
                       $donebutton = &done_button_js($interval[1]);
                   }
             } else {              } else {
                 $currdisp = 'none';                  $currdisp = 'none';
                 $expand = '&#9668;&nbsp;';                  $expand = '&#9668;&nbsp;';
Line 2270  sub countdown_timer { Line 2293  sub countdown_timer {
             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
Line 2279  $collapse Line 2302  $collapse
 <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">  <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
 <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>  <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>
 <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a>  <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a>
 $donebutton  
 END  END
         }          }
     }      }

Removed from v.1.431.2.2  
changed lines
  Added in v.1.431.2.3


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