[LON-CAPA-cvs] cvs: loncom /xml scripttag.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 20:36:32 -0000


albertel		Wed Jun 18 16:36:32 2003 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - IE can't handle href links that are 10,000 characters long.
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.97 loncom/xml/scripttag.pm:1.98
--- loncom/xml/scripttag.pm:1.97	Mon Jun  9 17:37:54 2003
+++ loncom/xml/scripttag.pm	Wed Jun 18 16:36:32 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.97 2003/06/09 21:37:54 albertel Exp $
+# $Id: scripttag.pm,v 1.98 2003/06/18 20:36:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -283,15 +283,15 @@
   if ($target eq 'web') {
     my $output=&Apache::lonxml::endredirection;
     $output =~ s/[\n\r]/ /g;
-    $output = &HTML::Entities::encode($output,'<>&"\'');
-    $output =~ s/&/\\&/g;
+#    $output = &HTML::Entities::encode($output,'<>&"\'');
+    $output =~ s/\'/\\\'/g;
     my $linktext= &Apache::lonxml::get_param('linktext',$parstack,$safeeval);
     if (!$linktext) { $linktext='<sup>*</sup>'; }
     my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);
     if (!$width) { $width='500'; }
     my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
     if (!$height) { $height='200'; }
-    $result = "<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=$width,height=$height,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor=&quot;#FFFFFF&quot;> $output </body></html>\');newWindow.document.close();void(0);\">$linktext</a>";
+    $result = "<script type=\"text/javascript\"> function LONCAPA_newwindow_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=$width,height=$height,scrollbars=1');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>newwindow</title></head><body bgcolor=\"#FFFFFF\"> $output </body></html>');newWindow.document.close();}</script><a href=\"javascript:LONCAPA_newwindow_$Apache::lonxml::curdepth();void(0);\">$linktext</a>";
   } elsif ($target eq 'tex') {
       $result = '}';
   } else {