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

bisitz bisitz@source.lon-capa.org
Wed, 05 Aug 2009 11:01:38 -0000


bisitz		Wed Aug  5 11:01:38 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmenu.pm 
  Log:
  - Corrected nested comment structure in Javascript code to achieve proper XHTML conform code.
  - lonmenu.pm: Also properly include Javascript
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.876 loncom/interface/loncommon.pm:1.877
--- loncom/interface/loncommon.pm:1.876	Tue Aug  4 19:53:42 2009
+++ loncom/interface/loncommon.pm	Wed Aug  5 11:01:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.876 2009/08/04 19:53:42 raeburn Exp $
+# $Id: loncommon.pm,v 1.877 2009/08/05 11:01:38 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1194,8 +1194,8 @@
 
     my $template .= <<"ENDTEMPLATE";
 <script type="text/javascript">
-// <!-- BEGIN LON-CAPA Internal
 // <![CDATA[
+// <!-- BEGIN LON-CAPA Internal
 var banner_link = '';
 function helpMenu(target) {
     var caller = this;
@@ -1220,8 +1220,8 @@
     caller.document.close()
     caller.focus()
 }
-// ]]>
 // END LON-CAPA Internal -->
+// ]]>
 </script>
 ENDTEMPLATE
     return $template;
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.276 loncom/interface/lonmenu.pm:1.277
--- loncom/interface/lonmenu.pm:1.276	Tue Jul 21 14:36:08 2009
+++ loncom/interface/lonmenu.pm	Wed Aug  5 11:01:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.276 2009/07/21 14:36:08 droeschl Exp $
+# $Id: lonmenu.pm,v 1.277 2009/08/05 11:01:38 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -299,8 +299,8 @@
     my $helplink = &Apache::loncommon::top_nav_help('Help');
 	return (<<ENDINLINEMENU);
 <script type="text/javascript">
-// BEGIN LON-CAPA Internal
 // <![CDATA[
+// BEGIN LON-CAPA Internal
 $utility
 // ]]>
 </script>
@@ -357,8 +357,14 @@
          (!&Apache::lonnet::is_on_map(
 	   &unescape($env{'request.noversionuri'})))) &&
         (!$forcereg))) {
- 	return $result.
-          '<script type="text/javascript">function LONCAPAreg(){;} function LONCAPAstale(){}</script>'.$force_title;
+ 	return
+        $result
+       .'<script type="text/javascript">'."\n"
+       .'// <![CDATA['."\n"
+       .'function LONCAPAreg(){;} function LONCAPAstale(){}'."\n"
+       .'// ]]>'."\n"
+       .'</script>'
+       .$force_title;
     }
 # Graphical display after login only
     if ($env{'request.registered'} && !$forcereg) { return ''; }
@@ -712,6 +718,7 @@
 	    $result = (<<ENDREGTHIS);
      
 <script type="text/javascript">
+// <![CDATA[
 // BEGIN LON-CAPA Internal
 var swmenu=null;
 
@@ -747,6 +754,7 @@
       }
 
 // END LON-CAPA Internal 
+// ]]>
 </script>
 ENDREGTHIS
         }
@@ -762,6 +770,7 @@
            $result = (<<ENDDONOTREGTHIS);
 
 <script type="text/javascript">
+// <![CDATA[
 // BEGIN LON-CAPA Internal
 var swmenu=null;
 
@@ -786,6 +795,7 @@
     }
 
 // END LON-CAPA Internal
+// ]]>
 </script>
 ENDDONOTREGTHIS
        }
@@ -856,6 +866,7 @@
     my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited');
     return(<<ENDREMOTESTARTUP);
 <script type="text/javascript">
+// <![CDATA[
 var timestart;
 function wheelswitch() {
     if (typeof(document.wheel) != 'undefined') {
@@ -906,6 +917,7 @@
    wait();
 }
 
+// ]]>
 </script>
 ENDREMOTESTARTUP
 }
@@ -913,8 +925,10 @@
 sub setflags() {
     return(<<ENDSETFLAGS);
 <script type="text/javascript">
+// <![CDATA[
     menuloaded=0;
     tim=0;
+// ]]>
 </script>
 ENDSETFLAGS
 }
@@ -923,7 +937,9 @@
     if ($env{'environment.remote'} eq 'off') { return ''; }
     return(<<ENDMAINCALL);
 <script type="text/javascript">
+// <![CDATA[
     main();
+// ]]>
 </script>
 ENDMAINCALL
 }
@@ -965,7 +981,12 @@
 sub open {
     my $returnval='';
     if ($env{'environment.remote'} eq 'off') { 
-	return '<script type="text/javascript">self.name="loncapaclient";</script>';
+	return
+        '<script type="text/javascript">'."\n"
+       .'// <![CDATA['."\n"
+       .'self.name="loncapaclient";'."\n"
+       .'// ]]>'."\n"
+       .'</script>';
     }
     my $menuname = &get_menu_name();
     
@@ -978,11 +999,13 @@
 #}
 #ENDRESIZE
 #    }
-    $returnval.=(<<ENDOPEN);
+    $returnval=(<<ENDOPEN);
+// <![CDATA[
 window.status='Opening LON-CAPA Remote Control';
 var menu=window.open("/res/adm/pages/menu.html?inhibitmenu=yes","$menuname",
 "height=375,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5");
 self.name='loncapaclient';
+// ]]>
 ENDOPEN
     return '<script type="text/javascript">'.$returnval.'</script>';
 }
@@ -1285,6 +1308,7 @@
     my $menuname = &get_menu_name();
     return(<<ENDCLOSE);
 <script type="text/javascript">
+// <![CDATA[
 window.status='Accessing Remote Control';
 menu=window.open("/adm/rat/empty.html","$menuname",
                  "height=350,width=150,scrollbars=no,menubar=no");
@@ -1294,6 +1318,7 @@
 window.status='Closing Remote Control';
 menu.close();
 window.status='Done.';
+// ]]>
 </script>
 ENDCLOSE
 }