--- loncom/interface/lonhtmlcommon.pm 2016/10/16 21:20:51 1.374 +++ loncom/interface/lonhtmlcommon.pm 2016/10/31 12:59:03 1.375 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.374 2016/10/16 21:20:51 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.375 2016/10/31 12:59:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3496,7 +3496,7 @@ ENDUTILITY sub jump_to_editres { my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, $title,$idx,$suppurl,$todocs) = @_; - my $jscall; + my ($jscall,$anchor); if ($switchserver) { if ($home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. @@ -3516,7 +3516,16 @@ sub jump_to_editres { } } else { unless ($cfile =~ m{^/priv/}) { + if ($cfile =~ m{^(/adm/wrapper/ext/[^#]+)#([^#]+)$}) { + $cfile = $1; + $anchor = $2; + } if ($symb) { + if ($anchor ne '') { + if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) { + $symb = $1.&escape(&escape('#')).$anchor; + } + } $cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb"; } elsif ($folderpath) { $cfile .= (($cfile=~/\?/)?'&':'?'). @@ -3543,6 +3552,9 @@ sub jump_to_editres { $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; } } + if ($anchor ne '') { + $cfile .= '#'.$anchor; + } $jscall = "go('".&Apache::loncommon::escape_single($cfile)."')"; } return $jscall;