Diff for /loncom/interface/loncommon.pm between versions 1.1041 and 1.1042

version 1.1041, 2011/12/20 23:57:51 version 1.1042, 2011/12/21 18:01:58
Line 7065  sub modal_adhoc_inner { Line 7065  sub modal_adhoc_inner {
     my ($funcname,$width,$height,$content)=@_;      my ($funcname,$width,$height,$content)=@_;
     my $innerwidth=$width-20;      my $innerwidth=$width-20;
     $content=&js_ready(      $content=&js_ready(
                &start_page('Dialog',undef,{'only_body'=>1,'add_progressbar'=>1,'bgcolor'=>'#FFFFFF'}).                 &start_page('Dialog',undef,{'only_body'=>1,'bgcolor'=>'#FFFFFF'}).
                  &start_scrollbox($width.'px',$innerwidth.'px',$height.'px').                   &start_scrollbox($width.'px',$innerwidth.'px',$height.'px').
                     $content.                      $content.
                  &end_scrollbox().                   &end_scrollbox().
Line 7176  function LCupdateProgress(percent,progre Line 7176  function LCupdateProgress(percent,progre
 ENDPROGRESSUPDATE  ENDPROGRESSUPDATE
 }  }
   
   my $LClastpercent;
   
 sub LCprogressbar {  sub LCprogressbar {
     my ($r,$mode)=(@_);      my ($r)=(@_);
       $LClastpercent=0;
     my $starting=&mt('Starting');      my $starting=&mt('Starting');
     my $content=(<<ENDPROGBAR);      my $content=(<<ENDPROGBAR);
 <p>  <p>
Line 7186  sub LCprogressbar { Line 7189  sub LCprogressbar {
   </div>    </div>
 </p>  </p>
 ENDPROGBAR  ENDPROGBAR
     $content.=&LCprogressbar_script();      $r->print($content.&LCprogressbar_script());
     if ($mode eq 'popup') {  
        $r->print(&modal_adhoc_launch('LCprogwin',500,50,$content));  
     } else {  
        $r->print($content);  
     }  
     $r->rflush();      $r->rflush();
 }  }
   
 sub LCprogressbarUpdate {  sub LCprogressbarUpdate {
     my ($r,$val,$text,$mode)=@_;      my ($r,$val,$text)=@_;
     unless ($val) { $val=0; }      unless ($val) { 
          if ($LClastpercent) {
              $val=$LClastpercent;
          } else {
              $val=0;
          }
       }
     if ($val<0) { $val=0; }      if ($val<0) { $val=0; }
     if ($val>100) { $val=0; }      if ($val>100) { $val=0; }
       $LClastpercent=$val;
     unless ($text) { $text=$val.'%'; }      unless ($text) { $text=$val.'%'; }
     my $function='';  
     if ($mode eq 'popup') { $function='modalWindow.'; }  
     $function.='LCupdateProgress';  
     $text=&js_ready($text);      $text=&js_ready($text);
     $r->print(<<ENDUPDATE);      $r->print(<<ENDUPDATE);
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
 $function($val,'$text');  LCupdateProgress($val,'$text');
 // ]]>  // ]]>
 </script>  </script>
 ENDUPDATE  ENDUPDATE
     $r->rflush();      $r->rflush();
 }  }
   
   sub LCprogressbarClose {
       my ($r)=@_;
       $LClastpercent=0;
       $r->print(<<ENDCLOSE);
   <script type="text/javascript">
   // <![CDATA[
   \$("#progressbar").hide('slow'); 
   // ]]>
   </script>
   ENDCLOSE
       $r->rflush();
   }
   
 sub html_encode {  sub html_encode {
     my ($result) = @_;      my ($result) = @_;
   

Removed from v.1.1041  
changed lines
  Added in v.1.1042


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