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

www lon-capa-cvs@mail.lon-capa.org
Sat, 28 May 2005 00:35:49 -0000


www		Fri May 27 20:35:49 2005 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Bug #4114: spellchecker not working on Mac, because somebody decided
  that typeof(null)='object' ... null an object???
  Anyway, works now.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.104 loncom/interface/lonhtmlcommon.pm:1.105
--- loncom/interface/lonhtmlcommon.pm:1.104	Thu Apr  7 02:56:23 2005
+++ loncom/interface/lonhtmlcommon.pm	Fri May 27 20:35:47 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.104 2005/04/07 06:56:23 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.105 2005/05/28 00:35:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -932,13 +932,14 @@
 
 sub spellheader {
     my $html=&Apache::lonxml::xmlbegin();
+    my $nothing=&javascript_nothing();
     return (<<ENDCHECK);
 <script type="text/javascript"> 
 //<!-- BEGIN LON-CAPA Internal
 var checkwin;
 
 function spellcheckerwindow() {
-    checkwin=window.open('/adm/rat/empty.html','spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
+    checkwin=window.open($nothing,'spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
     checkwin.document.writeln('$html<head></head><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>');
     checkwin.document.close();
 }
@@ -953,7 +954,7 @@
     my ($form,$field)=@_;
     my $linktext=&mt('Check Spelling');
     return (<<ENDLINK);
-<a href="javascript:if (typeof(document.$form.onsubmit)!='undefined') { document.$form.onsubmit();};spellcheckerwindow();checkwin.document.forms.spellcheckform.text.value=this.document.forms.$form.$field.value;checkwin.document.forms.spellcheckform.submit();">$linktext</a>
+<a href="javascript:if (typeof(document.$form.onsubmit)!='undefined') { if (document.$form.onsubmit!=null) { document.$form.onsubmit();}};spellcheckerwindow();checkwin.document.forms.spellcheckform.text.value=this.document.forms.$form.$field.value;checkwin.document.forms.spellcheckform.submit();">$linktext</a>
 ENDLINK
 }