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

www lon-capa-cvs@mail.lon-capa.org
Mon, 27 Sep 2004 20:59:21 -0000


www		Mon Sep 27 16:59:21 2004 EDT

  Modified files:              
    /loncom/homework	chemresponse.pm grades.pm 
    /loncom/xml	scripttag.pm 
  Log:
  Trying to fix Bug #3449. The previous syntax was definitely wrong, not sure
  if this works.
  
  
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.38 loncom/homework/chemresponse.pm:1.39
--- loncom/homework/chemresponse.pm:1.38	Thu Aug 12 00:33:22 2004
+++ loncom/homework/chemresponse.pm	Mon Sep 27 16:59:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # chemical equation style response
 #
-# $Id: chemresponse.pm,v 1.38 2004/08/12 04:33:22 albertel Exp $
+# $Id: chemresponse.pm,v 1.39 2004/09/27 20:59:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -121,8 +121,9 @@
 CHEMPAGE
     $body=&HTML::Entities::encode($body,'<>&"');
     $body=~s/\n/ /g;
+    my $nothing= &Apache::lonhtmlcommon::javascript_nothing();
     my $result=<<CHEMINPUT;
-<input type="button" value="Draw Molecule" onClick="javascript:editor=window.open('','','width=500,height=500,scrollbars=no,resizable=yes');editor.document.open('text/html','replace');editor.document.writeln('$body')" />
+<input type="button" value="Draw Molecule" onClick="javascript:editor=window.open('','','width=500,height=500,scrollbars=no,resizable=yes');editor.document.open($nothing,'replace');editor.document.writeln('$body')" />
 CHEMINPUT
     return $result;
 }
@@ -308,11 +309,12 @@
     my $id_es=&Apache::lonnet::escape($id);
     my $field_es=&Apache::lonnet::escape($field);
     my $reaction_es=&Apache::lonnet::escape($reaction);
+    my $nothing= &Apache::lonhtmlcommon::javascript_nothing();
     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.document.open('text/html','replace');
+	editor.document.open($nothing,'replace');
 	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>');
     }
 </script>
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.215 loncom/homework/grades.pm:1.216
--- loncom/homework/grades.pm:1.215	Fri Sep 24 18:03:23 2004
+++ loncom/homework/grades.pm	Mon Sep 27 16:59:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.215 2004/09/24 22:03:23 albertel Exp $
+# $Id: grades.pm,v 1.216 2004/09/27 20:59:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -25,16 +25,7 @@
 #
 # http://www.lon-capa.org/
 #
-# 2/9,2/13 Guy Albertelli
-# 6/8 Gerd Kortemeyer
-# 7/26 H.K. Ng
-# 8/20 Gerd Kortemeyer
-# Year 2002
-# June-August H.K. Ng
-# Year 2003
-# February, March H.K. Ng
-# July, H. K. Ng
-#
+###
 
 package Apache::grades;
 use strict;
@@ -1001,6 +992,7 @@
     my $request = shift;
     my $iconpath = $request->dir_config('lonIconsURL');
     &commonJSfunctions($request);
+    my $nothing= &Apache::lonhtmlcommon::javascript_nothing();
     $request->print(<<SUBJAVASCRIPT);
 <script type="text/javascript" language="javascript">
 
@@ -1113,7 +1105,7 @@
     pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height);
     pWin.focus();
     pDoc = pWin.document;
-    pDoc.open('text/html','replace');
+    pDoc.open($nothing,'replace');
     pDoc.write("<html><head>");
     pDoc.write("<title>Message Central</title>");
 
@@ -1244,7 +1236,7 @@
     hwdWin = window.open('', 'KeywordHighlightCentral', 'resizeable=yes,toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx='+xpos+',screeny='+ypos);
     hwdWin.focus();
     var hDoc = hwdWin.document;
-    hDoc.open('text/html','replace');
+    hDoc.open($nothing,'replace');
     hDoc.write("<html><head>");
     hDoc.write("<title>Highlight Central</title>");
 
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.115 loncom/xml/scripttag.pm:1.116
--- loncom/xml/scripttag.pm:1.115	Wed Aug 18 16:48:45 2004
+++ loncom/xml/scripttag.pm	Mon Sep 27 16:59:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.115 2004/08/18 20:48:45 albertel Exp $
+# $Id: scripttag.pm,v 1.116 2004/09/27 20:59:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -25,8 +25,7 @@
 #
 # http://www.lon-capa.org/
 #
-# 2/21 Guy
-# 8/20 Gerd Kortemeyer
+
 
 package Apache::scripttag;
 
@@ -119,7 +118,8 @@
 	    ($Apache::lonhomework::viewgrades == 'F')) {
 	    $Apache::lonxml::evaluate--;
 	    my (undef,undef,$udom,$uname)=&Apache::lonxml::whichuser();
-	    $result.="<script type=\"text/javascript\"> function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
+	    my $nothing= &Apache::lonhtmlcommon::javascript_nothing();
+	    $result.="<script type=\"text/javascript\"> function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.document.open($nothing,'replace');newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
 	    my $listing=&Apache::run::dump($target,$safeeval);
 	    $listing=~s/\'/\\\'/g;
 	    $listing=~s/\n/\\n/g;