--- loncom/interface/lonhtmlcommon.pm 2016/10/23 20:07:28 1.358.2.8 +++ loncom/interface/lonhtmlcommon.pm 2016/10/31 21:00:49 1.358.2.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.358.2.8 2016/10/23 20:07:28 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.358.2.9 2016/10/31 21:00:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3396,8 +3396,8 @@ ENDUTILITY sub jump_to_editres { my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, - $title,$idx,$suppurl,$todocs) = @_; - my $jscall; + $title,$idx,$suppurl,$todocs,$suppanchor) = @_; + my ($jscall,$anchor); if ($switchserver) { if ($home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. @@ -3417,7 +3417,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=~/\?/)?'&':'?'). @@ -3441,8 +3450,15 @@ sub jump_to_editres { $cfile .= (($cfile=~/\?/)?'&':'?').'register=1'; } if ($todocs) { - $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; + $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; } + if ($suppanchor ne '') { + $cfile .= (($cfile=~/\?/)?'&':'?').'anchor='. + &HTML::Entities::encode($suppanchor,'"<>&'); + } + } + if ($anchor ne '') { + $cfile .= '#'.$anchor; } $jscall = "go('".&Apache::loncommon::escape_single($cfile)."')"; }