[LON-CAPA-cvs] cvs: rat(version_2_11_X) / lonwrapper.pm

raeburn raeburn at source.lon-capa.org
Fri Aug 5 17:34:54 EDT 2016


raeburn		Fri Aug  5 21:34:54 2016 EDT

  Modified files:              (Branch: version_2_11_X)
    /rat	lonwrapper.pm 
  Log:
  - For 2.11
    - Backport 1.51
  
  
Index: rat/lonwrapper.pm
diff -u rat/lonwrapper.pm:1.49 rat/lonwrapper.pm:1.49.2.1
--- rat/lonwrapper.pm:1.49	Tue Jun 17 23:22:21 2014
+++ rat/lonwrapper.pm	Fri Aug  5 21:34:54 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Wrapper for external and binary files as standalone resources
 #
-# $Id: lonwrapper.pm,v 1.49 2014/06/17 23:22:21 raeburn Exp $
+# $Id: lonwrapper.pm,v 1.49.2.1 2016/08/05 21:34:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,7 +52,15 @@
                                           'show' => 'Show content in pop-up window',
                                         );
 
-    my $noiframe = &Apache::loncommon::modal_link($url,$lt{'show'},500,400);
+    my $anchor;
+    if (($is_ext) && ($env{'form.symb'})) {
+        (undef,undef,my $res) = &Apache::lonnet::decode_symb($env{'form.symb'});
+        if ($res =~ /(\#.+)$/) {
+            $anchor = $1;
+        }
+    }
+
+    my $noiframe = &Apache::loncommon::modal_link($url.$anchor,$lt{'show'},500,400);
     my $args = {'bgcolor' => '#FFFFFF'};
     if ($forcereg) {
         $args->{'force_register'} = $forcereg;
@@ -85,7 +93,7 @@
             $output .= '<a href="'.$url.'">'.&mt('Link to PDF (for mobile devices)').'</a>';
         } else {
             $output .= '<div style="overflow:scroll; -webkit-overflow-scrolling:touch;">'."\n".
-                       '<iframe src="'.$url.'" height="100%" width="100%" frameborder="0">'."\n".
+                       '<iframe src="'.$url.$anchor.'" height="100%" width="100%" frameborder="0">'."\n".
                        "$lt{'noif'} $noiframe\n".
                        "</iframe>\n".
                        "</div>\n";
@@ -123,7 +131,7 @@
         $startpage
         $script
         <div class="LC_iframecontainer">
-            <iframe src="$url">$lt{'noif'} $noiframe</iframe>
+            <iframe src="$url$anchor">$lt{'noif'} $noiframe</iframe>
         </div>
         $endpage
 ENDFRAME




More information about the LON-CAPA-cvs mailing list