[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm

foxr lon-capa-cvs@mail.lon-capa.org
Thu, 21 Oct 2004 11:18:41 -0000


foxr		Thu Oct 21 07:18:41 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Changed javascript_escape calls to escape_single.  I think this module
  may be pretty well funky URL clean.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.127 loncom/interface/lonindexer.pm:1.128
--- loncom/interface/lonindexer.pm:1.127	Thu Oct 21 05:53:44 2004
+++ loncom/interface/lonindexer.pm	Thu Oct 21 07:18:41 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.127 2004/10/21 09:53:44 foxr Exp $
+# $Id: lonindexer.pm,v 1.128 2004/10/21 11:18:41 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,6 +147,7 @@
        }
        $r->print(<<ENDSUBM);
 		<html>
+		<!-- Generated by lonindexer.pm -->
 		<script type="text/javascript">
 		function load() {
 			window.opener.document.forms["$ENV{'form.form'}"]
@@ -348,6 +349,8 @@
 <head>
 <title>The LearningOnline Network With CAPA Directory Browser</title>
 
+<!-- Generated by lonindexer.pm -->
+
 <script type="text/javascript">
 $catalogmodefunctions
 function openWindow(url, wdwName, w, h, toolbar,scrollbar,locationbar) {
@@ -484,7 +487,7 @@
 				(($ENV{'form.catalogmode'} eq 'groupimport')?
 				 'document.forms.fileattr':'')).
 		  &Apache::lonhtmlcommon::select_recent('residx','resrecent',
-'this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'));
+'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'));
 # -------------------------------------------------------- Resource Home Button
 	my $reshome=$ENV{'course.'.$ENV{'request.course.id'}.'.reshome'};
 	if ($reshome) {
@@ -726,7 +729,7 @@
         debuggingWindow.document.writeln(text);
     }
 }
-output("<html><head><title>Debugging Window</title></head><body><pre>");   
+output("<html><head><title>Debugging Window</title><!-- for lonindexer.pm --></head><body><pre>");   
 </script>
 ENDJS
 }
@@ -846,7 +849,7 @@
 		   $diropen.'.gif"'); 
 	$r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
 		   "\n");
-	my $quotable_filecom = &Apache::loncommon::javascript_escape($filecom[0]);
+	my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
 	$r->print ('<a href="javascript:gothere(\''.$quotable_filecom.
 		   '\')"><img src="'.$iconpath.'server.gif"');
 	$r->print (' border="0" /></a>'."\n");
@@ -874,7 +877,7 @@
 		   '.gif"'); 
 	$r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
 		   "\n");
-	my $quotable_curdir = &Apache::loncommon::javascript_escape($curdir);
+	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
 	$r->print ('<a href="javascript:gothere(\''.$quotable_curdir
 		   .'\')"><img src='.
 		   $iconpath.'quill.gif border="0" name="'.$msg.
@@ -905,7 +908,7 @@
 	$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap='1' align='top'>");
 	
         if ($ENV{'form.catalogmode'} eq 'interactive') {
-	    my $quotable_filelink = &Apache::loncommon::javascript_escape($filelink);
+	    my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
             $r->print("<a href=\"javascript:select_data(\'",
                       $quotable_filelink,"')\">");
 	    $r->print("<img src='",$iconpath,"select.gif' border='0' /></a>".
@@ -966,7 +969,7 @@
 	if ($filelink=~/\.(page|sequence)$/) {
 	    $r->print('</form>');
 	}
-	my $quotable_filelink = &Apache::loncommon::javascript_escape($filelink);
+	my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
 
 
 	$r->print (" <a href=\"javascript:openWindow('".$quotable_filelink.
@@ -1033,7 +1036,7 @@
 	    my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
 	    if($source eq 'open') {
 		my $sourcelink = &Apache::lonsource::make_link($filelink,$listname);
-		my $quotable_sourcelink = &Apache::loncommon::javascript_escape($sourcelink);
+		my $quotable_sourcelink = &Apache::loncommon::escape_single($sourcelink);
 		$r->print('<td>'."<a href=\"javascript:openWindow('"
 			  .$quotable_sourcelink.
 			  "', 'previewsource', '700', '700', 'no', 'yes','yes')\";".
@@ -1112,7 +1115,7 @@
 		   'folder_pointer_'.$diropen.'.gif"');
 	$r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
 		   "\n");
-	my $quotable_curdir = &Apache::loncommon::javascript_escape($curdir);
+	my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
 	$r->print ('<a href="javascript:gothere(\''
 		   .$quotable_curdir.'\')"><img src="'.
 		   $iconpath.'folder_'.$diropen.'.gif" border="0" /></a>'.