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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 04 Jun 2003 22:30:02 -0000


albertel		Wed Jun  4 18:30:02 2003 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - width,height,linktext added as atrributes to <window>, BUG#1612
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.91 loncom/xml/scripttag.pm:1.92
--- loncom/xml/scripttag.pm:1.91	Wed May 28 17:05:33 2003
+++ loncom/xml/scripttag.pm	Wed Jun  4 18:30:00 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.91 2003/05/28 21:05:33 albertel Exp $
+# $Id: scripttag.pm,v 1.92 2003/06/04 22:30:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -282,8 +282,14 @@
   my $result;
   if ($target eq 'web') {
     my $output=&Apache::lonxml::endredirection;
+    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'; }
     $output =~ s/\"/\&quot\;/g;
-    $result = "<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,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);\"><sup>*</sup></a>";
+    $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>";
   } elsif ($target eq 'tex') {
       $result = '}';
   } else {