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

version 1.1041, 2011/12/20 23:57:51 version 1.1045, 2011/12/22 00:17:04
Line 6563  a#LC_content_toolbar_changefolder_toggle Line 6563  a#LC_content_toolbar_changefolder_toggle
   background-image:url(/res/adm/pages/open-all-folders.gif);    background-image:url(/res/adm/pages/open-all-folders.gif);
 }  }
   
   a#LC_content_toolbar_edittoplevel {
     background-image:url(/res/adm/pages/edittoplevel.gif);
   }
   
 ul#LC_toolbar li a:hover {  ul#LC_toolbar li a:hover {
   background-position: bottom center;    background-position: bottom center;
 }  }
Line 7065  sub modal_adhoc_inner { Line 7069  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 7142  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 7167  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>
 ENDPROGRESSUPDATE  ENDPROGRESSUPDATE
 }  }
   
   my $LClastpercent;
   my $LCidcnt;
   my $LCcurrentid;
   
 sub LCprogressbar {  sub LCprogressbar {
     my ($r,$mode)=(@_);      my ($r)=(@_);
       $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
     $content.=&LCprogressbar_script();      &r_print($r,$content.&LCprogressbar_script($LCcurrentid));
     if ($mode eq 'popup') {  
        $r->print(&modal_adhoc_launch('LCprogwin',500,50,$content));  
     } else {  
        $r->print($content);  
     }  
     $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($r,<<ENDUPDATE);
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
 $function($val,'$text');  LCupdateProgress($val,'$text','$LCcurrentid');
 // ]]>  // ]]>
 </script>  </script>
 ENDUPDATE  ENDUPDATE
     $r->rflush();  }
   
   sub LCprogressbarClose {
       my ($r)=@_;
       $LClastpercent=0;
       &r_print($r,<<ENDCLOSE);
   <script type="text/javascript">
   // <![CDATA[
   \$("#progressbar$LCcurrentid").hide('slow'); 
   // ]]>
   </script>
   ENDCLOSE
   }
   
   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 7222  sub html_encode { Line 7253  sub html_encode {
           
     return $result;      return $result;
 }  }
   
 sub js_ready {  sub js_ready {
     my ($result) = @_;      my ($result) = @_;
   

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


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