Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.407 and 1.410

version 1.407, 2022/10/20 01:03:16 version 1.410, 2023/09/27 14:52:26
Line 1737  sub show_return_link { Line 1737  sub show_return_link {
     unless ($env{'request.course.id'}) { return 0; }      unless ($env{'request.course.id'}) { return 0; }
     if ($env{'request.noversionuri'}=~m{^/priv/} ||      if ($env{'request.noversionuri'}=~m{^/priv/} ||
         $env{'request.uri'}=~m{^/priv/}) { return 1; }          $env{'request.uri'}=~m{^/priv/}) { return 1; }
     return if ($env{'request.noversionuri'} eq '/adm/supplemental');      return if (($env{'request.noversionuri'} eq '/adm/supplemental') &&
                  ($env{'form.folder'} ne 'supplemental'));
       return if (($env{'form.folderpath'} ne '') &&
                  (($env{'request.noversionuri'} =~ m{^/adm/$match_domain/$match_username/aboutme$}) ||
                   ($env{'request.noversionuri'} =~ m{^/public/$match_domain/$match_courseid/syllabus$})));
     return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') &&      return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') &&
                (!$env{'request.role.adv'}));                 (!$env{'request.role.adv'}));
     if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)})      if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)})
Line 1745  sub show_return_link { Line 1749  sub show_return_link {
   
         return if ($env{'form.register'});          return if ($env{'form.register'});
     }      }
       if ((($env{'request.symb'} ne '') || ($env{'form.folderpath'} ne '')) &&
            ($env{'request.noversionuri'} =~m{^/adm/coursedocs/showdoc/uploaded/($match_domain)/($match_courseid)/(docs|supplemental)/})) {
           my ($cdom,$cnum,$area) =  ($1,$2,$3);
           if (($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom) &&
               ($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum)) {
               if (($env{'request.symb'}) && ($area eq 'docs')) {
                   my ($map,$resid,$url) = &Apache::lonnet::decode_symb($env{'request.symb'});
                   return if ($env{'request.noversionuri'} eq '/adm/coursedocs/showdoc/'.$url);
               } elsif (($env{'form.folderpath'}) && ($area eq 'supplemental')) {
                   return;
               }
           }
       }
     return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&      return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
              $env{'request.symb'} eq '')               $env{'request.symb'} eq '')
             ||              ||
Line 1813  clientTime = (new Date()).getTime(); Line 1830  clientTime = (new Date()).getTime();
 END  END
 }  }
   
   ##
   # Client-side javascript to convert any dashes in text pasted
   # into textbox(es) for numericalresponse item(s) to a standard
   # minus, i.e., - . Calls to dash_to_minus_js() in end_problem()
   # and in loncommon::endbodytag() for a .page (arg: dashjs => 1)
   #
   # Will apply to any input tag with class: LC_numresponse_text.
   # Currently set in start_textline for numericalresponse items.
   #
   
   sub dash_to_minus_js {
       return <<'ENDJS';
   
   <script type="text/javascript">
   //<![CDATA[
   //<!-- BEGIN LON-CAPA Internal
   document.addEventListener("DOMContentLoaded", (event) => {
       const numresp = document.querySelectorAll("input.LC_numresponse_text");
       if (numresp.length > 0) {
           numresp.forEach((el) => {
               el.addEventListener("paste", (e) => {
                   e.preventDefault();
                   e.stopPropagation();
                   let p = (e.clipboardData || window.clipboardData).getData("text");
                   p.toString();
                   p = p.replace(/\p{Dash}/gu, '-');
                   putInText(p);
               });
           });
       }
       const putInText = (newText, el = document.activeElement) => {
           const [start, end] = [el.selectionStart, el.selectionEnd];
           el.setRangeText(newText, start, end, 'end');
       }
   });
   // END LON-CAPA Internal -->
   //]]>
   </script>
   
   ENDJS
   }
   
 ############################################################  ############################################################
 ############################################################  ############################################################
   
Line 2263  sub docs_breadcrumbs { Line 2322  sub docs_breadcrumbs {
 # each of randompick number, hidden, encrypted, random order, is_page   # each of randompick number, hidden, encrypted, random order, is_page 
 # are appended with ":"s to the foldername  # are appended with ":"s to the foldername
         $name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//;          $name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//;
         if ($contenteditor) {            if ($contenteditor) {
             if ($supplementalflag) {              if ($supplementalflag) {
                 if ($2) { $ishidden=1; }                  if ($2) { $ishidden=1; }
             } else {              } else {
Line 2307  sub docs_breadcrumbs { Line 2366  sub docs_breadcrumbs {
             $plain=~s/\&gt\;\s*$//;              $plain=~s/\&gt\;\s*$//;
         }          }
         my $menulink = 0;          my $menulink = 0;
         if (!$allowed && !$contenteditor) {          if (!$allowed && !$contenteditor && !$supplementalflag) { 
             $menulink = 1;              $menulink = 1;
         }          }
         if ($checklinkprot) {          if ($checklinkprot) {

Removed from v.1.407  
changed lines
  Added in v.1.410


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>