[LON-CAPA-cvs] cvs: loncom /homework chemresponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 13 Apr 2006 18:57:51 -0000


albertel		Thu Apr 13 14:57:51 2006 EDT

  Modified files:              
    /loncom/homework	chemresponse.pm 
  Log:
  - start_page
  
  
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.64 loncom/homework/chemresponse.pm:1.65
--- loncom/homework/chemresponse.pm:1.64	Wed Mar  8 20:12:05 2006
+++ loncom/homework/chemresponse.pm	Thu Apr 13 14:57:51 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # chemical equation style response
 #
-# $Id: chemresponse.pm,v 1.64 2006/03/09 01:12:05 albertel Exp $
+# $Id: chemresponse.pm,v 1.65 2006/04/13 18:57:51 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -87,10 +87,7 @@
 	    '<input type="button" name="submit" value="Insert Answer" onclick="javascript:submitSmiles();" />';
     }
 
-    my $body=<<CHEMPAGE;
-<html>
-<head>
-<title>Molecule Editor</title>
+    my $js = <<CHEMJS;
 <script type="text/javascript">
 function submitSmiles() {
     jmeFile = document.applets.JME.jmeFile();
@@ -107,8 +104,17 @@
 }
 function substituent(r) {document.applets.JME.setSubstituent(r);}
 </script>
-</head>
-<body bgcolor="#ffffff">
+CHEMJS
+
+    my $start_page = 
+        &Apache::loncommon::start_page('Molecule Editor',$js,
+				       {'only_body' => 1,
+					'bgcolor'   => '#FFFFFF',});
+    my $end_page = 
+	&Apache::loncommon::end_page();
+
+    my $body=<<CHEMPAGE;
+$start_page
 <center>
 <form>
   <table width="440"><tr>
@@ -146,9 +152,9 @@
 <input type="button" value="  Help  " onclick = "javascript:openHelpWindow()" />
 </form>
 </center>
-</body>
-</html>
+$end_page
 CHEMPAGE
+
     $body=&HTML::Entities::encode($body,'<>&"');
     $body=~s/\n/ /g;
     my $nothing=&Apache::lonhtmlcommon::javascript_nothing();
@@ -399,13 +405,23 @@
     my $field_es=&Apache::lonnet::escape($field);
     my $reaction_es=&Apache::lonnet::escape($reaction);
     my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
+    my $start_page = 
+	&Apache::loncommon::start_page('LON-CAPA Reaction Editor',undef,
+				       {'frameset'    => 1,
+					'js_ready'    => 1,
+					'add_entries' => {
+					    'rows'   => "30%",
+					    'border' => "0",}},);
+    my $end_page = 
+	&Apache::loncommon::end_page({'frameset' => 1,
+				      'js_ready' => 1});
     my $result=<<EDITREACTION;
 <script type="text/javascript">
 // <!--
     function create_reaction_window_${id}_${field} () {
 	editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes');
 	editor.$docopen;
-	editor.document.writeln('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html> <head><title>LON-CAPA Reaction Editor</title></head><frameset rows="30%,*" border="0">  <frame src="/res/adm/pages/reactionresponse/reaction_viewer.html?inhibitmenu=yes" name="viewer" scrolling="no" />  <frame src="/res/adm/pages/reactionresponse/reaction_editor.html?inhibitmenu=yes&reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> </frameset> </html>');
+	editor.document.writeln('$start_page <frame src="/res/adm/pages/reactionresponse/reaction_viewer.html?inhibitmenu=yes" name="viewer" scrolling="no" />  <frame src="/res/adm/pages/reactionresponse/reaction_editor.html?inhibitmenu=yes&reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> $end_page');
     }
 // -->
 </script>