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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 20 Oct 2004 10:54:08 -0000


foxr		Wed Oct 20 06:54:08 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Move javacript_escape sub to end of file to be consistent with commenting
  on file organization in the front of the file.
  
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.125 loncom/interface/lonindexer.pm:1.126
--- loncom/interface/lonindexer.pm:1.125	Wed Oct 20 06:51:50 2004
+++ loncom/interface/lonindexer.pm	Wed Oct 20 06:54:08 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.125 2004/10/20 10:51:50 foxr Exp $
+# $Id: lonindexer.pm,v 1.126 2004/10/20 10:54:08 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,31 +74,6 @@
 
 
 
-#
-#    Escapes strings that may have embedded 's that will be put into
-#    javascript strings as 'strings'.
-#    The assumptions are:
-#       There has been no effort to escape ' with \'
-#       Any \'s in the string are intended to be there as part of the URL
-#        and must also be escaped.
-# Parameters:
-#     input     - The string to escape.
-# Returns:
-#     The escaped string (' replaced by \' and \ replaced by \\).
-#
-sub javascript_escape {
-    my ($input) = @_;
-
-    #  I imagine a regexp wizard could combine the two expressions below.
-    #  If you do you might want to comment the result.
-
-    $input =~ s/\\/\\\\/g;	# Escape the /'s..(must be first)>
-    $input =~ s/\'/\\\'/g;	# Esacpe the 's....
-
-    return $input;
-}
-
-
 
 # ----------------------------- Handling routine called via Apache and mod_perl
 sub handler {
@@ -1257,6 +1232,33 @@
     }
 }
 
+
+#
+#    Escapes strings that may have embedded 's that will be put into
+#    javascript strings as 'strings'.
+#    The assumptions are:
+#       There has been no effort to escape ' with \'
+#       Any \'s in the string are intended to be there as part of the URL
+#        and must also be escaped.
+# Parameters:
+#     input     - The string to escape.
+# Returns:
+#     The escaped string (' replaced by \' and \ replaced by \\).
+#
+sub javascript_escape {
+    my ($input) = @_;
+
+    #  I imagine a regexp wizard could combine the two expressions below.
+    #  If you do you might want to comment the result.
+
+    $input =~ s/\\/\\\\/g;	# Escape the /'s..(must be first)>
+    $input =~ s/\'/\\\'/g;	# Esacpe the 's....
+
+    return $input;
+}
+
+
+
 =head1 NAME
 
 Apache::lonindexer - mod_perl module for cross server filesystem browsing