Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.358.2.17.2.1 and 1.358.2.20

version 1.358.2.17.2.1, 2020/01/16 19:44:52 version 1.358.2.20, 2023/09/11 14:13:31
Line 1693  sub show_return_link { Line 1693  sub show_return_link {
             (($env{'request.noversionuri'}=~/^\/adm\//) &&              (($env{'request.noversionuri'}=~/^\/adm\//) &&
              ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&               ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
              ($env{'request.noversionuri'}!~               ($env{'request.noversionuri'}!~
               m{^/adm/.*/(smppg|bulletinboard|ext\.tool)($|\?)})                m{^/adm/.*/(smppg|bulletinboard)($|\?)})
            ));             ));
 }  }
   
Line 1753  clientTime = (new Date()).getTime(); Line 1753  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 2539  sub course_custom_roles { Line 2581  sub course_custom_roles {
   
   
 sub resource_info_box {  sub resource_info_box {
    my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_;     my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_;
    my $return='';     my $return='';
    if ($stuvcurrent ne '') {     if (($stuvcurrent ne '') || ($divforres)) {
        $return = '<div class="LC_left_float">';         $return = '<div class="LC_left_float">';
    }     }
    if ($symb) {     if ($symb) {
Line 2570  sub resource_info_box { Line 2612  sub resource_info_box {
     } else {      } else {
        $return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>';         $return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>';
     }      }
     if ($stuvcurrent ne '') {      if (($stuvcurrent ne '') || ($divforres)) {
         $return .= '</div>';          $return .= '</div>';
     }      }
     return $return;      return $return;
Line 3301  PARAMSONE Line 3343  PARAMSONE
         if (itemid != null) {          if (itemid != null) {
             itemh = itemid.offsetHeight;              itemh = itemid.offsetHeight;
         }          }
         var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;          var primaryheight = 0;
         var secondaryheight;          if (document.getElementById('LC_nav_bar') != null) {
               primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
           }
           var secondaryheight = 0;
         if (document.getElementById('LC_secondary_menu') != null) {           if (document.getElementById('LC_secondary_menu') != null) { 
             secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;              secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
         }          }
         var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;          var crumbsheight = 0;
           if (document.getElementById('LC_breadcrumbs') != null) {
               crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
           }
         var dccidheight = 0;          var dccidheight = 0;
         if (document.getElementById('dccid') != null) {          if (document.getElementById('dccid') != null) {
             dccidheight = document.getElementById('dccid').offsetHeight;              dccidheight = document.getElementById('dccid').offsetHeight;
Line 3442  sub jump_to_editres { Line 3490  sub jump_to_editres {
                 $anchor = $3;                  $anchor = $3;
                 $is_ext = 1;                  $is_ext = 1;
                 if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) {                  if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) {
                     unless (&Apache::lonnet::uses_sts()) {                      unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                         $usehttp = 1;                          $usehttp = 1;
                     }                      }
                 } elsif ($env{'request.use_absolute'}) {                  } elsif ($env{'request.use_absolute'}) {
Line 3457  sub jump_to_editres { Line 3505  sub jump_to_editres {
                         ($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) &&                          ($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) &&
                         ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) {                          ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) {
                         if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) {                          if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) {
                             unless (&Apache::lonnet::uses_sts()) {                              unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) {
                                 $usehttp = 1;                                  $usehttp = 1;
                             }                              }
                         }                          }

Removed from v.1.358.2.17.2.1  
changed lines
  Added in v.1.358.2.20


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