--- loncom/interface/lonhtmlcommon.pm 2018/04/24 13:40:32 1.393 +++ loncom/interface/lonhtmlcommon.pm 2021/04/29 17:45:22 1.398 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.393 2018/04/24 13:40:32 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.398 2021/04/29 17:45:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -866,13 +866,14 @@ parameter setting wizard. ############################################## sub pjump_javascript_definition { my $Str = <

'; } - if ($stuvcurrent ne '') { + if (($stuvcurrent ne '') || ($divforres)) { $return .= ''; } return $return; @@ -3508,7 +3509,16 @@ function go(url) { currentURL = null; currentSymb= null; var lcHostname = setLCHost(); - window.location.href=lcHostname+url; + if (lcHostname!='' && lcHostname!= null) { + var RegExp = /^https?\:/; + if (RegExp.test(url)) { + window.location.href=url; + } else { + window.location.href=lcHostname+url; + } + } else { + window.location.href=url; + } } } @@ -3548,13 +3558,15 @@ sub jump_to_editres { } } else { unless ($cfile =~ m{^/priv/}) { - if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))#([^#]+)$}) { + if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))(?:|#([^#]+))$}) { $cfile = $1; my $extlink = $2; $anchor = $3; $is_ext = 1; if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) { - $usehttp = 1; + unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) { + $usehttp = 1; + } } elsif ($env{'request.use_absolute'}) { if ($env{'request.use_absolute'} =~ m{^https://}) { $usehttps = 1; @@ -3567,7 +3579,9 @@ sub jump_to_editres { ($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) && ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) { if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { - $usehttp = 1; + unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) { + $usehttp = 1; + } } } } elsif ($env{'request.use_absolute'}) { @@ -3607,9 +3621,7 @@ sub jump_to_editres { if ($hostname ne '') { $cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile; } - unless ($is_ext) { - $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1'; - } + $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1'; } elsif ($usehttps) { $cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile; }