--- loncom/interface/loncommon.pm 2013/05/25 21:56:23 1.1130 +++ loncom/interface/loncommon.pm 2013/09/21 13:56:22 1.1156 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1130 2013/05/25 21:56:23 raeburn Exp $ +# $Id: loncommon.pm,v 1.1156 2013/09/21 13:56:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1393,17 +1393,18 @@ END } sub help_menu_js { - my ($text) = @_; + my ($httphost) = @_; my $stayOnPage = 1; my $width = 620; my $height = 600; my $helptopic=&general_help(); - my $details_link = '/adm/help/'.$helptopic.'.hlp'; + my $details_link = $httphost.'/adm/help/'.$helptopic.'.hlp'; my $nothing=&Apache::lonhtmlcommon::javascript_nothing(); my $start_page = &Apache::loncommon::start_page('Help Menu', undef, {'frameset' => 1, 'js_ready' => 1, + 'use_absolute' => $httphost, 'add_entries' => { 'border' => '0', 'rows' => "110,*",},}); @@ -2349,6 +2350,10 @@ Outputs: =item * $clientos +=item * $clientmobile + +=item * $clientinfo + =back =back @@ -2367,6 +2372,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 +2384,7 @@ sub decode_user_agent { } } my $clientos='unknown'; + my $clientinfo; if (($httpbrowser=~/linux/i) || ($httpbrowser=~/unix/i) || ($httpbrowser=~/ux/i) || @@ -2389,8 +2396,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 +3075,8 @@ sub get_related_words { =pod +=back + =head1 Spell checking =over 4 @@ -3093,12 +3110,6 @@ Note: This sub assumes that aspell is in =cut -=pod - -=back - -=cut - sub check_spelling { my ($wordlist, $language) = @_; my @misspellings; @@ -3314,7 +3325,7 @@ sub screenname { # ------------------------------------------------------------- Confirm Wrapper =pod -=item confirmwrapper +=item * &confirmwrapper($message) Wrap messages about completion of operation in box @@ -4932,7 +4943,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 +5006,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 +5037,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); @@ -5114,6 +5125,7 @@ sub bodytag { $public = 1; } if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); } + my $httphost = $args->{'use_absolute'}; $function = &get_users_function() if (!$function); my $img = &designparm($function.'.img',$domain); @@ -5155,6 +5167,8 @@ sub bodytag { my $bodytag = "". &Apache::lontexconvert::init_math_support($args->{'inherit_jsmath'}); + &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); + if (($bodyonly) || ($no_nav_bar) || ($env{'form.inhibitmenu'} eq 'yes')) { return $bodytag; } @@ -5176,7 +5190,6 @@ sub bodytag { } $role = '('.$role.')' if $role; - &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); if ($env{'request.state'} eq 'construct') { $forcereg=1; } @@ -5185,7 +5198,7 @@ sub bodytag { # } $bodytag .= Apache::lonhtmlcommon::scripttag( - Apache::lonmenu::utilityfunctions(), 'start'); + Apache::lonmenu::utilityfunctions($httphost), 'start'); my ($left,$right) = Apache::lonmenu::primary_menu(); @@ -5211,7 +5224,7 @@ sub bodytag { #don't show menus for public users if (!$public){ - $bodytag .= Apache::lonmenu::secondary_menu(); + $bodytag .= Apache::lonmenu::secondary_menu($httphost); $bodytag .= Apache::lonmenu::serverform(); $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); if ($env{'request.state'} eq 'construct') { @@ -6485,6 +6498,14 @@ div.LC_edit_problem_saves { white-space: nowrap; } +.LC_edit_problem_latexhelper{ + text-align: right; +} + +#LC_edit_problem_colorful div{ + margin-left: 40px; +} + img.stift { border-width: 0; vertical-align: middle; @@ -7250,6 +7271,7 @@ sub headtag { my $function = $args->{'function'} || &get_users_function(); my $domain = $args->{'domain'} || &determinedomain(); my $bgcolor = $args->{'bgcolor'} || &designparm($function.'.pgbg',$domain); + my $httphost = $args->{'use_absolute'}; my $url = join(':',$env{'user.name'},$env{'user.domain'}, $Apache::lonnet::perlvar{'lonVersion'}, #time(), @@ -7273,7 +7295,7 @@ sub headtag { if (!$args->{'no_nav_bar'} && !$args->{'only_body'} && !$args->{'frameset'}) { - $result .= &help_menu_js(); + $result .= &help_menu_js($httphost); $result.=&modal_window(); $result.=&togglebox_script(); $result.=&wishlist_window(); @@ -7311,6 +7333,11 @@ ADDMETA .'' .$inhibitprint .$head_extra; + if ($env{'browser.mobile'}) { + $result .= ' + +'; + } return $result.''; } @@ -7644,12 +7671,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 = "