Diff for /rat/lonwrapper.pm between versions 1.45 and 1.46

version 1.45, 2013/10/15 10:17:19 version 1.46, 2013/10/22 23:13:54
Line 47  sub wrapper { Line 47  sub wrapper {
         $forcereg = 1;          $forcereg = 1;
     }      }
   
       my %lt = &Apache::lonlocal::texthash(
                                             'noif' => 'No iframe support.',
                                             'show' => 'Show content in pop-up window',
                                           );
   
       my $noiframe = &Apache::loncommon::modal_link($url,$lt{'show'},500,400);
     my $args = {'bgcolor' => '#FFFFFF'};      my $args = {'bgcolor' => '#FFFFFF'};
     if ($forcereg) {      if ($forcereg) {
         $args->{'force_register'} = $forcereg;          $args->{'force_register'} = $forcereg;
Line 58  sub wrapper { Line 64  sub wrapper {
         $args->{'use_absolute'} = $absolute;           $args->{'use_absolute'} = $absolute; 
     }      }
   
     my $startpage =  Apache::loncommon::start_page('Menu',undef,$args);      my $startpage = &Apache::loncommon::start_page('Menu',undef,$args);
     my $endpage =  Apache::loncommon::end_page();      my $endpage = &Apache::loncommon::end_page();
   
     my $script = Apache::lonhtmlcommon::scripttag(<<SCRIPT );      if ($env{'browser.mobile'}) {
     \$(document).ready( function() {          return <<ENDFRAME;
         \$(window).unbind('resize').resize(function(){          $startpage
             var header;          <div style="overflow:scroll; -webkit-overflow-scrolling:touch;">
             var offset = 5;          <iframe src="$url" height="100%" width="100%" frameborder="0">
             var height = 0;              $lt{'noif'} $noiframe
             var hdrtop = 0;          </iframe>
             if (\$('div.LC_head_subbox:first').length) {          </div>
                 header = \$('div.LC_head_subbox:first');          $endpage
                 offset = 9;  ENDFRAME
             } else {      } else {
                 if (\$('#LC_breadcrumbs').length) {          my $script = &Apache::lonhtmlcommon::scripttag(<<SCRIPT);
                     header = \$('#LC_breadcrumbs');          \$(document).ready( function() {
               \$(window).unbind('resize').resize(function(){
                   var header;
                   var offset = 5;
                   var height = 0;
                   var hdrtop = 0;
                   if (\$('div.LC_head_subbox:first').length) {
                       header = \$('div.LC_head_subbox:first');
                       offset = 9;
                   } else {
                       if (\$('#LC_breadcrumbs').length) {
                           header = \$('#LC_breadcrumbs');
                       }
                 }                  }
             }                  if (header.length) {
             if (header.length) {                      height = header.height();
                 height = header.height();                      hdrtop = header.position().top;
                 hdrtop = header.position().top;                  }
             }                  var pos = height + hdrtop + offset;
             var pos = height + hdrtop + offset;                  \$('.LC_iframecontainer').css('top', pos);
             \$('.LC_iframecontainer').css('top', pos);              });
         });          });
     });          window.onload = function(){  \$(window).trigger('resize') };
     window.onload = function(){  \$(window).trigger('resize') };   
 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;          $startpage
     $startpage          $script
     $script          <div class="LC_iframecontainer">
     <div class="LC_iframecontainer">              <iframe src="$url">$lt{'noif'} $noiframe</iframe>
         <iframe src="$url">No iframe support!</iframe>          </div>
     </div>          $endpage
     $endpage  
 ENDFRAME  ENDFRAME
       }
 }  }
   
 sub handler {  sub handler {
Line 203  described at http://www.lon-capa.org. Line 220  described at http://www.lon-capa.org.
   
 =over  =over
   
 =item $url   =item $url
    
 url to display by including in an iframe within a  url to display by including in an iframe within a
 LON-CAPA page which has a standard LON-CAPA inline menu.  LON-CAPA page which has a standard LON-CAPA inline menu.
   
Line 213  LON-CAPA page which has a standard LON-C Line 230  LON-CAPA page which has a standard LON-C
 breadcrumbs for unregistered urls  breadcrumbs for unregistered urls
 (i.e., external resources in Supplemental Content).  (i.e., external resources in Supplemental Content).
   
 =item $absolute   =item $absolute
   
 contains protocol (http or https) followed by  contains protocol (http or https) followed by
 the hostname, if menu items in the standard LON-CAPA  the hostname, if menu items in the standard LON-CAPA
Line 224  relative URLs. Line 241  relative URLs.
 That will be the case where an external resource has been   That will be the case where an external resource has been 
 served from port 80, when the server customarily serves  served from port 80, when the server customarily serves
 requests using Apache/SSL (i.e., port 443). mod_rewrite   requests using Apache/SSL (i.e., port 443). mod_rewrite 
 is used to switch requests for external resources    is used to switch requests for external resources 
 from https:// to http:// where the the URL of the remote site   from https:// to http:// where the the URL of the remote site 
 specified in the resource itself is http://.  specified in the resource itself is http://.
   
Line 245  Returns markup for the entire page. Line 262  Returns markup for the entire page.
   
 =cut  =cut
   
   
   
   
   
   
   

Removed from v.1.45  
changed lines
  Added in v.1.46


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