Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.163 and 1.166

version 1.163, 2007/09/26 12:42:32 version 1.166, 2007/10/04 01:16:58
Line 481  ENDJS Line 481  ENDJS
     return $result;      return $result;
 }  }
   
   
   sub build_url {
       my ($base, $fields)=@_;
       my $url;
       $url = $base.'?';
       foreach my $key(keys(%$fields)) {
           $url.=$key.'='.$$fields{$key}.'&';
       }
       $url =~ s/&$//;
       return $url;
   }
   
   
 ##############################################  ##############################################
 ##############################################  ##############################################
   
Line 682  Returns: a perl string as described. Line 695  Returns: a perl string as described.
 ##############################################  ##############################################
 ##############################################  ##############################################
 sub StatusOptions {  sub StatusOptions {
     my ($status, $formName,$size,$onchange)=@_;      my ($status, $formName,$size,$onchange,$mult)=@_;
     $size = 1 if (!defined($size));      $size = 1 if (!defined($size));
     if (! defined($status)) {      if (! defined($status)) {
         $status = 'Active';          $status = 'Active';
Line 691  sub StatusOptions { Line 704  sub StatusOptions {
   
     my $Str = '';      my $Str = '';
     $Str .= '<select name="Status"';      $Str .= '<select name="Status"';
       if (defined($mult)){
           $Str .= ' multiple="multiple" ';
       }
     if(defined($formName) && $formName ne '' && ! defined($onchange)) {      if(defined($formName) && $formName ne '' && ! defined($onchange)) {
         $Str .= ' onchange="document.'.$formName.'.submit()"';          $Str .= ' onchange="document.'.$formName.'.submit()"';
     }      }
Line 1879  END Line 1895  END
     return $scripttag;      return $scripttag;
 }  }
   
 ##############################################  
 ##############################################  
   
 # javascript_window_dims  
 #  
 # Generates javascript to get the dimensions of the user's browser window.  
   
 sub javascript_window_dims {  
     my $scripttag .= <<'END';  
 function getDimensions(width,height) {  
     width.value = getWindowWidth();  
     height.value = getWindowHeight();  
     return;  
 }  
    
 function getWindowWidth() {  
   var width = 0;  
   if( document.documentElement && document.documentElement.clientWidth ) {  
     width = document.documentElement.clientWidth;  
   }  
   else if( document.body && document.body.clientWidth ) {  
     width = document.body.clientWidth;  
   }  
   else if( window.innerWidth ) {  
     width = window.innerWidth - 18;  
   }  
   return width;  
 }  
   
 function getWindowHeight() {  
   var height = 0;  
   if( document.documentElement && document.documentElement.clientHeight ) {  
     height = document.documentElement.clientHeight;  
   }  
   else if( document.body && document.body.clientHeight ) {  
     height = document.body.clientHeight;  
   }  
   else if( window.innerHeight ) {  
     height = window.innerHeight - 18;  
   }  
   return height;  
 }  
   
 END  
     return $scripttag;  
 }  
 1;  1;
   
 __END__  __END__

Removed from v.1.163  
changed lines
  Added in v.1.166


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