--- loncom/interface/loncommon.pm 2013/04/24 02:43:59 1.1123 +++ loncom/interface/loncommon.pm 2013/08/18 17:31:26 1.1146 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1123 2013/04/24 02:43:59 raeburn Exp $ +# $Id: loncommon.pm,v 1.1146 2013/08/18 17:31:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2349,6 +2349,10 @@ Outputs: =item * $clientos +=item * $clientmobile + +=item * $clientinfo + =back =back @@ -2367,6 +2371,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)) { @@ -2378,6 +2383,7 @@ sub decode_user_agent { } } my $clientos='unknown'; + my $clientinfo; if (($httpbrowser=~/linux/i) || ($httpbrowser=~/unix/i) || ($httpbrowser=~/ux/i) || @@ -2389,8 +2395,16 @@ 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); + } + if ($httpbrowser=~ m{Firefox/(\d+\.\d+)}) { + $clientinfo = 'firefox-'.$1; + } elsif ($httpbrowser=~ m{chromeframe/(\d+\.\d+)\.}) { + $clientinfo = 'chromeframe-'.$1; + } return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml, - $clientunicode,$clientos,); + $clientunicode,$clientos,$clientmobile,$clientinfo); } ############################################################### @@ -3060,6 +3074,8 @@ sub get_related_words { =pod +=back + =head1 Spell checking =over 4 @@ -3093,12 +3109,6 @@ Note: This sub assumes that aspell is in =cut -=pod - -=back - -=cut - sub check_spelling { my ($wordlist, $language) = @_; my @misspellings; @@ -3314,7 +3324,7 @@ sub screenname { # ------------------------------------------------------------- Confirm Wrapper =pod -=item confirmwrapper +=item * &confirmwrapper($message) Wrap messages about completion of operation in box @@ -4932,7 +4942,7 @@ sub designparm { Inputs: $url (usually will be undef). -Returns: Path to Construction Space containing the resource or +Returns: Path to Authoring Space containing the resource or directory being viewed (or for which action is being taken). If $url is provided, and begins /priv// the path will be that portion of the $context argument. @@ -4995,7 +5005,7 @@ Input: (optional) filename from which br is appropriate for use in building the breadcrumb trail. Returns: HTML div with CSTR path and recent box - To be included on Construction Space pages + To be included on Authoring Space pages =cut @@ -5026,7 +5036,7 @@ sub CSTR_pageheader { my $output = '
' .&Apache::loncommon::help_open_menu('','',3,'Authoring') #FIXME: Broken? Where is it? - .''.&mt('Construction Space:').' ' + .''.&mt('Authoring Space:').' ' .'
' #FIXME lonpubdir: target="_parent" .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv/'.$udom,undef,undef); @@ -5155,16 +5165,14 @@ sub bodytag { my $bodytag = "". &Apache::lontexconvert::init_math_support($args->{'inherit_jsmath'}); - if ($bodyonly) { + &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); + + if (($bodyonly) || ($no_nav_bar) || ($env{'form.inhibitmenu'} eq 'yes')) { return $bodytag; - } + } - my $name = &plainname($env{'user.name'},$env{'user.domain'}); if ($public) { undef($role); - } else { - $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'}, - undef,'LC_menubuttons_link'); } my $titleinfo = '

'.$title.'

'; @@ -5180,11 +5188,6 @@ sub bodytag { } $role = '('.$role.')' if $role; - &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); - - if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { - return $bodytag; - } if ($env{'request.state'} eq 'construct') { $forcereg=1; } @@ -5192,25 +5195,25 @@ sub bodytag { # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls # } + $bodytag .= Apache::lonhtmlcommon::scripttag( + Apache::lonmenu::utilityfunctions(), 'start'); + my ($left,$right) = Apache::lonmenu::primary_menu(); if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { if ($dc_info) { $dc_info = qq|$dc_info|; } - $bodytag .= qq|
$name $role
+ $bodytag .= qq|
$left $role
$realm $dc_info
|; return $bodytag; } unless ($env{'request.symb'} =~ m/\.page___\d+___/) { - $bodytag .= qq|
$name $role
|; + $bodytag .= qq|
$left $role
|; } - $bodytag .= Apache::lonhtmlcommon::scripttag( - Apache::lonmenu::utilityfunctions(), 'start'); - - $bodytag .= Apache::lonmenu::primary_menu(); + $bodytag .= $right; if ($dc_info) { $dc_info = &dc_courseid_toggle($dc_info); @@ -5410,6 +5413,14 @@ form, .inline { vertical-align:middle; } +.LC_floatleft { + float: left; +} + +.LC_floatright { + float: right; +} + .LC_400Box { width:400px; } @@ -6480,6 +6491,11 @@ div.LC_edit_problem_saves { padding-bottom: 5px; } +.LC_edit_opt { + padding-left: 1em; + white-space: nowrap; +} + img.stift { border-width: 0; vertical-align: middle; @@ -6494,6 +6510,7 @@ div.LC_createcourse { } .LC_dccid { + float: right; margin: 0.2em 0 0 0; padding: 0; font-size: 90%; @@ -6591,7 +6608,6 @@ fieldset > legend { } ol.LC_primary_menu { - float: right; margin: 0; padding: 0; background-color: $pgbg_or_bgcolor; @@ -7306,6 +7322,11 @@ ADDMETA .'' .$inhibitprint .$head_extra; + if ($env{'browser.mobile'}) { + $result .= ' + +'; + } return $result.''; } @@ -7639,12 +7660,12 @@ var modalWindow = { $(".LCmodal-overlay").click(function(){modalWindow.close();}); } }; - var openMyModal = function(source,width,height,scrolling) + var openMyModal = function(source,width,height,scrolling,transparency,style) { modalWindow.windowId = "myModal"; modalWindow.width = width; modalWindow.height = height; - modalWindow.content = "