Diff for /loncom/interface/loncommon.pm between versions 1.1136 and 1.1138

version 1.1136, 2013/07/09 00:17:22 version 1.1138, 2013/07/11 18:24:31
Line 2349  Outputs: Line 2349  Outputs:
   
 =item * $clientos  =item * $clientos
   
   =item * $clientmobile
   
 =back  =back
   
 =back   =back 
Line 2367  sub decode_user_agent { Line 2369  sub decode_user_agent {
     my $clientversion='0';      my $clientversion='0';
     my $clientmathml='';      my $clientmathml='';
     my $clientunicode='0';      my $clientunicode='0';
       my $clientmobile=0;
     for (my $i=0;$i<=$#browsertype;$i++) {      for (my $i=0;$i<=$#browsertype;$i++) {
         my ($bname,$match,$notmatch,$vreg,$minv,$univ)=split(/\:/,$browsertype[$i]);          my ($bname,$match,$notmatch,$vreg,$minv,$univ)=split(/\:/,$browsertype[$i]);
  if (($httpbrowser=~/$match/i)  && ($httpbrowser!~/$notmatch/i)) {   if (($httpbrowser=~/$match/i)  && ($httpbrowser!~/$notmatch/i)) {
Line 2389  sub decode_user_agent { Line 2392  sub decode_user_agent {
         ($httpbrowser=~/powerpc/i)) { $clientos='mac'; }          ($httpbrowser=~/powerpc/i)) { $clientos='mac'; }
     if ($httpbrowser=~/win/i) { $clientos='win'; }      if ($httpbrowser=~/win/i) { $clientos='win'; }
     if ($httpbrowser=~/embed/i) { $clientos='pda'; }      if ($httpbrowser=~/embed/i) { $clientos='pda'; }
       if ($httpbrowser=~/(Android|iPod|iPad|iPhone|webOS|Blackberry|Windows Phone|Opera m(?:ob|in)|Fennec)/i) {
           $clientmobile=lc($1);
       }
     return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,      return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
             $clientunicode,$clientos,);              $clientunicode,$clientos,$clientmobile);
 }  }
   
 ###############################################################  ###############################################################
Line 7312  ADDMETA Line 7318  ADDMETA
  .'<link rel="stylesheet" type="text/css" href="'.$url.'" />'   .'<link rel="stylesheet" type="text/css" href="'.$url.'" />'
         .$inhibitprint          .$inhibitprint
  .$head_extra;   .$head_extra;
       if ($env{'browser.mobile'}) {
           $result .= '
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
   <meta name="apple-mobile-web-app-capable" content="yes" />';
       }
     return $result.'</head>';      return $result.'</head>';
 }  }
   
Line 7697  sub modal_adhoc_inner { Line 7708  sub modal_adhoc_inner {
     my $innerwidth=$width-20;      my $innerwidth=$width-20;
     $content=&js_ready(      $content=&js_ready(
                &start_page('Dialog',undef,{'only_body'=>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','modal').
                     $content.                      $content.
                  &end_scrollbox().                   &end_scrollbox().
                &end_page()                 &end_page()
Line 7917  sub validate_page { Line 7928  sub validate_page {
   
   
 sub start_scrollbox {  sub start_scrollbox {
     my ($outerwidth,$width,$height,$id,$bgcolor)=@_;      my ($outerwidth,$width,$height,$id,$bgcolor,$cursor) = @_;
     unless ($outerwidth) { $outerwidth='520px'; }      unless ($outerwidth) { $outerwidth='520px'; }
     unless ($width) { $width='500px'; }      unless ($width) { $width='500px'; }
     unless ($height) { $height='200px'; }      unless ($height) { $height='200px'; }
     my ($table_id,$div_id,$tdcol);      my ($table_id,$div_id,$tdcol);
     if ($id ne '') {      if ($id ne '') {
         $table_id = " id='table_$id'";          $table_id = " id='table_$id'";
         $div_id = " id='div_$id'";          $div_id = ' id="div_'.$id.'"';
     }      }
     if ($bgcolor ne '') {      if ($bgcolor ne '') {
         $tdcol = "background-color: $bgcolor;";          $tdcol = "background-color: $bgcolor;";
     }      }
       my $nicescroll_js;
       if ($env{'browser.mobile'}) {
           my %options;
           if (ref($cursor) eq 'HASH') {
               %options = %{$cursor};
           }
           unless ($options{'railalign'} =~ /^left|right$/) {
               $options{'railalign'} = 'left';
           }
           unless ($options{'cursorcolor'} =~ /^\#\w+$/) {
               my $function  = &get_users_function();
               $options{'cursorcolor'} = &designparm($function.'.sidebg',$env{'request.role.domain'});
               unless ($options{'cursorcolor'} =~ /^\#\w+$/) {
                   $options{'cursorcolor'} = '#00F';
               }
           }
           if ($options{'cursoropacity'} =~ /^[\d.]+$/) {
               unless ($options{'cursoropacity'} >= 0.0 && $options{'cursoropacity'} <=1.0) {
                   $options{'cursoropacity'}='1.0';
               }
           } else {
               $options{'cursoropacity'}='1.0';
           }
           if ($options{'cursorfixedheight'} eq 'none') {
               delete($options{'cursorfixedheight'});
           } else {
               unless ($options{'cursorfixedheight'} =~ /^\d+$/) { $options{'cursorfixedheight'}='50'; }
           }
           unless ($options{'railoffset'} =~ /^{[\w\:\d]+}$/) {
               delete($options{'railoffset'});
           } 
           my @niceoptions;
           while (my($key,$value) = each(%options)) {
               if ($value =~ /^\{.+\}$/) {
                   push(@niceoptions,$key.':'.$value);
               } else {
                   push(@niceoptions,$key.':"'.$value.'"');
               }
           }
           $nicescroll_js = '
   <script type="text/javascript">
   // <![CDATA[ 
   $(document).ready(
     function() {  
         $("#div_'.$id.'").niceScroll({'.join(',',@niceoptions).'});
     }
   );
   
   // ]]>
   </script>
   ';
       }
   
     return <<"END";      return <<"END";
 <table style="width: $outerwidth; border: 1px solid none;"$table_id><tr><td style="width: $width;$tdcol"><div style="overflow:auto; width:$width; height: $height;"$div_id>  $nicescroll_js
   
   <table style="width: $outerwidth; border: 1px solid none;"$table_id><tr><td style="width: $width;$tdcol">
   <div style="overflow:auto; width:$width; height:$height;"$div_id>
 END  END
 }  }
   
Line 8777  of existing file within authoring space Line 8844  of existing file within authoring space
 space to be exceeded,  space to be exceeded,
   
 Same, if upload of a file directly to a course/community via Course Editor  Same, if upload of a file directly to a course/community via Course Editor
 will cause quota for uploaded content for the course to be exceeded.    will cause quota for uploaded content for the course to be exceeded.
   
 Inputs: 6  Inputs: 6
 1. username or coursenum  1. username or coursenum
Line 14179  sub init_user_environment { Line 14246  sub init_user_environment {
 # ------------------------------------ Check browser type and MathML capability  # ------------------------------------ Check browser type and MathML capability
   
     my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,      my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
         $clientunicode,$clientos) = &decode_user_agent($r);          $clientunicode,$clientos,$clientmobile) = &decode_user_agent($r);
   
 # ------------------------------------------------------------- Get environment  # ------------------------------------------------------------- Get environment
   
Line 14210  sub init_user_environment { Line 14277  sub init_user_environment {
      "browser.mathml"     => $clientmathml,       "browser.mathml"     => $clientmathml,
      "browser.unicode"    => $clientunicode,       "browser.unicode"    => $clientunicode,
      "browser.os"         => $clientos,       "browser.os"         => $clientos,
                "browser.mobile"     => $clientmobile,
      "server.domain"      => $Apache::lonnet::perlvar{'lonDefDomain'},       "server.domain"      => $Apache::lonnet::perlvar{'lonDefDomain'},
      "request.course.fn"  => '',       "request.course.fn"  => '',
      "request.course.uri" => '',       "request.course.uri" => '',

Removed from v.1.1136  
changed lines
  Added in v.1.1138


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