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

droeschl droeschl@source.lon-capa.org
Thu, 04 Mar 2010 19:35:53 -0000


droeschl		Thu Mar  4 19:35:53 2010 EDT

  Modified files:              
    /rat	lonwrapper.pm 
  Log:
  - correct selection of LC_iframecontainer
  - use scripttag function
  
  
Index: rat/lonwrapper.pm
diff -u rat/lonwrapper.pm:1.38 rat/lonwrapper.pm:1.39
--- rat/lonwrapper.pm:1.38	Wed Mar  3 21:33:20 2010
+++ rat/lonwrapper.pm	Thu Mar  4 19:35:53 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Wrapper for external and binary files as standalone resources
 #
-# $Id: lonwrapper.pm,v 1.38 2010/03/03 21:33:20 droeschl Exp $
+# $Id: lonwrapper.pm,v 1.39 2010/03/04 19:35:53 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,20 +42,22 @@
 					  { 'force_register' =>1, 'bgcolor'   => '#FFFFFF',}) ;
     my $endpage =  Apache::loncommon::end_page();
 
-    # javascript will position the iframe if window was resized (or zoomed)
-    return <<ENDFRAME;
-    $startpage
-    <script type="text/javascript">
+    my $script = Apache::lonhtmlcommon::scripttag(<<SCRIPT );
     \$(document).ready( function() {
         \$(window).unbind('resize').resize(function(){
-            var header = \$('#LC_head_subbox')[0] ?  \$('#LC_head_subbox') :  \$('#LC_breadcrumbs');
+            var header = \$('#LC_head_subbox')[0] ?  \$('#LC_head_subbox') 
+                                                  :  \$('#LC_breadcrumbs');
             var pos = header.height() + header.position().top + 5;
-            \$('.iframecontainer').css('top', pos);
+            \$('.LC_iframecontainer').css('top', pos);
         });
     });
-    window.onload = function(){  \$(window).trigger('resize') };
-    </script>
+    window.onload = function(){  \$(window).trigger('resize') }; 
+SCRIPT
 
+    # javascript will position the iframe if window was resized (or zoomed)
+    return <<ENDFRAME;
+    $startpage
+    $script
     <div class="LC_iframecontainer">
         <iframe src="$url">No iframe support!</iframe>
     </div>