--- loncom/interface/loncommon.pm 2013/07/09 00:17:22 1.1136 +++ loncom/interface/loncommon.pm 2013/07/10 22:07:37 1.1137 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1136 2013/07/09 00:17:22 raeburn Exp $ +# $Id: loncommon.pm,v 1.1137 2013/07/10 22:07:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2349,6 +2349,8 @@ Outputs: =item * $clientos +=item * $clientmobile + =back =back @@ -2367,6 +2369,7 @@ sub decode_user_agent { my $clientversion='0'; my $clientmathml=''; my $clientunicode='0'; + my $clientmobile=0; for (my $i=0;$i<=$#browsertype;$i++) { my ($bname,$match,$notmatch,$vreg,$minv,$univ)=split(/\:/,$browsertype[$i]); if (($httpbrowser=~/$match/i) && ($httpbrowser!~/$notmatch/i)) { @@ -2389,8 +2392,11 @@ sub decode_user_agent { ($httpbrowser=~/powerpc/i)) { $clientos='mac'; } if ($httpbrowser=~/win/i) { $clientos='win'; } 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, - $clientunicode,$clientos,); + $clientunicode,$clientos,$clientmobile); } ############################################################### @@ -7312,6 +7318,11 @@ ADDMETA .'' .$inhibitprint .$head_extra; + if ($env{'browser.mobile'}) { + $result .= ' + +'; + } return $result.''; } @@ -7697,7 +7708,7 @@ sub modal_adhoc_inner { my $innerwidth=$width-20; $content=&js_ready( &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. &end_scrollbox(). &end_page() @@ -7924,13 +7935,32 @@ sub start_scrollbox { my ($table_id,$div_id,$tdcol); if ($id ne '') { $table_id = " id='table_$id'"; - $div_id = " id='div_$id'"; + $div_id = ' id="div_'.$id.'"'; } if ($bgcolor ne '') { $tdcol = "background-color: $bgcolor;"; } + my $nicescroll_js; + if ($env{'browser.mobile'}) { + $nicescroll_js = ' + +'; + } + return <<"END"; -
+$nicescroll_js + +
+
END } @@ -8777,7 +8807,7 @@ of existing file within authoring space space to be exceeded, 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 1. username or coursenum @@ -14179,7 +14209,7 @@ sub init_user_environment { # ------------------------------------ Check browser type and MathML capability my ($httpbrowser,$clientbrowser,$clientversion,$clientmathml, - $clientunicode,$clientos) = &decode_user_agent($r); + $clientunicode,$clientos,$clientmobile) = &decode_user_agent($r); # ------------------------------------------------------------- Get environment @@ -14210,6 +14240,7 @@ sub init_user_environment { "browser.mathml" => $clientmathml, "browser.unicode" => $clientunicode, "browser.os" => $clientos, + "browser.mobile" => $clientmobile, "server.domain" => $Apache::lonnet::perlvar{'lonDefDomain'}, "request.course.fn" => '', "request.course.uri" => '',