version 1.431, 2015/01/19 15:36:01
|
version 1.431.2.2, 2015/04/14 21:35:52
|
Line 1536 function toggleCountdown() {
|
Line 1536 function toggleCountdown() {
|
END |
END |
} |
} |
|
|
|
# This creates a "done button" for timed events. The confirmation box is a jQuerey |
|
# dialog widget. Clicking OK will set (done = 'true') which is checked in |
|
# lonhomework.pm. |
|
sub done_button_js { |
|
return <<END; |
|
|
|
<form method="post" name="doneButton"> |
|
<input type="hidden" name="done" value=""/> |
|
<button id="done-confirm-opener" type="button">Done</button> |
|
</form> |
|
|
|
<div id="done-confirm" title="WARNING!"> |
|
<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> |
|
</div> |
|
|
|
<script> |
|
\$( "#done-confirm" ).dialog({ autoOpen: false }); |
|
\$( "#done-confirm-opener" ).click(function() { |
|
\$( "#done-confirm" ).dialog( "open" ); |
|
\$( "#done-confirm" ).dialog({ |
|
resizable: false, |
|
height:320, |
|
modal: true, |
|
buttons: { |
|
"OK": function() { |
|
\$( this ).dialog( "close" ); |
|
\$( '[name="done"]' )[0].value = 'true'; |
|
\$( '[name="doneButton"]' )[0].submit(); |
|
}, |
|
Cancel: function() { |
|
\$( this ).dialog( "close" ); |
|
} |
|
} |
|
}) |
|
}); |
|
</script> |
|
|
|
END |
|
} |
|
|
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 2211 sub countdown_timer {
|
Line 2251 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 = '► '; |
$collapse = '► '; |
|
$donebutton = &done_button_js(); |
|
|
|
|
} else { |
} else { |
$currdisp = 'none'; |
$currdisp = 'none'; |
$expand = '◄ '; |
$expand = '◄ '; |
Line 2225 sub countdown_timer {
|
Line 2268 sub countdown_timer {
|
$title = $alttxt.' '; |
$title = $alttxt.' '; |
} |
} |
my $desc = &mt('Countdown to due date/time'); |
my $desc = &mt('Countdown to due date/time'); |
|
|
return <<END; |
return <<END; |
|
|
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
Line 2235 $collapse
|
Line 2279 $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 |
} |
} |
} |
} |