version 1.1043, 2011/12/21 20:21:49
|
version 1.1046, 2011/12/23 16:55:34
|
Line 6973 sub end_page {
|
Line 6973 sub end_page {
|
|
|
sub wishlist_window { |
sub wishlist_window { |
return(<<'ENDWISHLIST'); |
return(<<'ENDWISHLIST'); |
<script type="text/javascript" lang="javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
// <!-- BEGIN LON-CAPA Internal |
// <!-- BEGIN LON-CAPA Internal |
function set_wishlistlink(title, path) { |
function set_wishlistlink(title, path) { |
Line 6995 ENDWISHLIST
|
Line 6995 ENDWISHLIST
|
|
|
sub modal_window { |
sub modal_window { |
return(<<'ENDMODAL'); |
return(<<'ENDMODAL'); |
<script type="text/javascript" lang="javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
// <!-- BEGIN LON-CAPA Internal |
// <!-- BEGIN LON-CAPA Internal |
var modalWindow = { |
var modalWindow = { |
Line 7050 sub modal_link {
|
Line 7050 sub modal_link {
|
sub modal_adhoc_script { |
sub modal_adhoc_script { |
my ($funcname,$width,$height,$content)=@_; |
my ($funcname,$width,$height,$content)=@_; |
return (<<ENDADHOC); |
return (<<ENDADHOC); |
<script type="text/javascript" lang="javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
var $funcname = function() |
var $funcname = function() |
{ |
{ |
Line 7146 sub end_togglebox {
|
Line 7146 sub end_togglebox {
|
} |
} |
|
|
sub LCprogressbar_script { |
sub LCprogressbar_script { |
|
my ($id)=@_; |
return(<<ENDPROGRESS); |
return(<<ENDPROGRESS); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
var LCprogressTxt='---'; |
\$('#progressbar$id').progressbar({ |
|
|
\$('#progressbar').progressbar({ |
|
value: 0, |
value: 0, |
change: function(event, ui) { |
change: function(event, ui) { |
var newVal = \$(this).progressbar('option', 'value'); |
var newVal = \$(this).progressbar('option', 'value'); |
Line 7171 sub LCprogressbarUpdate_script {
|
Line 7170 sub LCprogressbarUpdate_script {
|
</style> |
</style> |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function LCupdateProgress(percent,progresstext) { |
var LCprogressTxt='---'; |
|
|
|
function LCupdateProgress(percent,progresstext,id) { |
LCprogressTxt=progresstext; |
LCprogressTxt=progresstext; |
\$('#progressbar').progressbar('value',percent); |
\$('#progressbar'+id).progressbar('value',percent); |
} |
} |
// ]]> |
// ]]> |
</script> |
</script> |
Line 7181 ENDPROGRESSUPDATE
|
Line 7182 ENDPROGRESSUPDATE
|
} |
} |
|
|
my $LClastpercent; |
my $LClastpercent; |
|
my $LCidcnt; |
|
my $LCcurrentid; |
|
|
sub LCprogressbar { |
sub LCprogressbar { |
my ($r)=(@_); |
my ($r)=(@_); |
$LClastpercent=0; |
$LClastpercent=0; |
|
$LCidcnt++; |
|
$LCcurrentid=$$.'_'.$LCidcnt; |
my $starting=&mt('Starting'); |
my $starting=&mt('Starting'); |
my $content=(<<ENDPROGBAR); |
my $content=(<<ENDPROGBAR); |
<p> |
<p> |
<div id="progressbar"> |
<div id="progressbar$LCcurrentid"> |
<span class="pblabel">$starting</span> |
<span class="pblabel">$starting</span> |
</div> |
</div> |
</p> |
</p> |
ENDPROGBAR |
ENDPROGBAR |
$r->print($content.&LCprogressbar_script()); |
&r_print($r,$content.&LCprogressbar_script($LCcurrentid)); |
$r->rflush(); |
|
} |
} |
|
|
sub LCprogressbarUpdate { |
sub LCprogressbarUpdate { |
Line 7211 sub LCprogressbarUpdate {
|
Line 7215 sub LCprogressbarUpdate {
|
$LClastpercent=$val; |
$LClastpercent=$val; |
unless ($text) { $text=$val.'%'; } |
unless ($text) { $text=$val.'%'; } |
$text=&js_ready($text); |
$text=&js_ready($text); |
$r->print(<<ENDUPDATE); |
&r_print($r,<<ENDUPDATE); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
LCupdateProgress($val,'$text'); |
LCupdateProgress($val,'$text','$LCcurrentid'); |
// ]]> |
// ]]> |
</script> |
</script> |
ENDUPDATE |
ENDUPDATE |
$r->rflush(); |
|
} |
} |
|
|
sub LCprogressbarClose { |
sub LCprogressbarClose { |
my ($r)=@_; |
my ($r)=@_; |
$LClastpercent=0; |
$LClastpercent=0; |
$r->print(<<ENDCLOSE); |
&r_print($r,<<ENDCLOSE); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
\$("#progressbar").hide('slow'); |
\$("#progressbar$LCcurrentid").hide('slow'); |
// ]]> |
// ]]> |
</script> |
</script> |
ENDCLOSE |
ENDCLOSE |
$r->rflush(); |
} |
|
|
|
sub r_print { |
|
my ($r,$to_print)=@_; |
|
if ($r) { |
|
$r->print($to_print); |
|
$r->rflush(); |
|
} else { |
|
print($to_print); |
|
} |
} |
} |
|
|
sub html_encode { |
sub html_encode { |
Line 7241 sub html_encode {
|
Line 7253 sub html_encode {
|
|
|
return $result; |
return $result; |
} |
} |
|
|
sub js_ready { |
sub js_ready { |
my ($result) = @_; |
my ($result) = @_; |
|
|