Diff for /rat/lonwrapper.pm between versions 1.49.2.7 and 1.49.2.8

version 1.49.2.7, 2019/08/02 00:19:00 version 1.49.2.8, 2020/02/16 23:52:03
Line 85  sub wrapper { Line 85  sub wrapper {
         $args->{'only_body'} = $env{'form.only_body'};          $args->{'only_body'} = $env{'form.only_body'};
     }      }
   
     my $startpage = &Apache::loncommon::start_page('Menu',undef,$args);      my $headjs;
   
   #
   # Where iframe is in use, if window.onload() executes before the custom resize function
   # has been defined (jQuery), two global javascript vars (LCnotready and LCresizedef)
   # are used to ensure document.ready() triggers a call to resize, so the iframe contents
   # do not obscure the Functions menu.
   #
   
       unless (($env{'browser.mobile'}) || $uselink) {
           $headjs = '
   <script type="text/javascript">
   // <![CDATA[
   var LCnotready = 0;
   var LCresizedef = 0;
   // ]]>
   </script>'."\n";
   
       my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args);
     my $endpage = &Apache::loncommon::end_page();      my $endpage = &Apache::loncommon::end_page();
   
     if (($uselink) && ($title eq '')) {      if (($uselink) && ($title eq '')) {
Line 149  sub wrapper { Line 167  sub wrapper {
                 var pos = height + hdrtop + offset;                  var pos = height + hdrtop + offset;
                 \$('.LC_iframecontainer').css('top', pos);                  \$('.LC_iframecontainer').css('top', pos);
             });              });
               LCresizedef = 1;
               if (LCnotready == 1) {
                   LCnotready = 0;
                   \$(window).trigger('resize');
               }
         });          });
         window.onload = function(){  \$(window).trigger('resize') };          window.onload = function(){
               if (LCresizedef) {
                   LCnotready = 0;
                   \$(window).trigger('resize') };
               } else {
                   LCnotready = 1;
               }
           };
 SCRIPT  SCRIPT
         # javascript will position the iframe if window was resized (or zoomed)          # javascript will position the iframe if window was resized (or zoomed)
         return <<ENDFRAME;          return <<ENDFRAME;
Line 196  sub handler { Line 226  sub handler {
   
     for ($url){      for ($url){
         s|^/adm/wrapper||;          s|^/adm/wrapper||;
         $is_ext = $_ =~ s|^/ext/|http://|;                   $is_ext = $_ =~ s|^/ext/|http://|;
         s|http://https://|https://|;          s|http://https://?|https://| if ($is_ext);
         s|&colon;|:|g;                        s|&colon;|:|g;
     }      }
   
     if ($url =~ /\.pdf$/i) {      if ($url =~ /\.pdf$/i) {

Removed from v.1.49.2.7  
changed lines
  Added in v.1.49.2.8


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