[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 03 Jul 2006 20:00:21 -0000
albertel Mon Jul 3 16:00:21 2006 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm
Log:
- fix problems with speller window being slow in creation
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.139 loncom/interface/lonhtmlcommon.pm:1.140
--- loncom/interface/lonhtmlcommon.pm:1.139 Sun Jul 2 21:02:32 2006
+++ loncom/interface/lonhtmlcommon.pm Mon Jul 3 16:00:20 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.139 2006/07/03 01:02:32 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.140 2006/07/03 20:00:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1025,9 +1025,14 @@
sub spellheader {
my $start_page=
&Apache::loncommon::start_page('Speller Suggestions',undef,
- {'only_body' => 1,
- 'js_ready' => 1,
- 'bgcolor' => '#DDDDDD',});
+ {'only_body' => 1,
+ 'js_ready' => 1,
+ 'bgcolor' => '#DDDDDD',
+ 'add_entries' => {
+ 'onload' =>
+ 'document.forms.spellcheckform.submit()',
+ }
+ });
my $end_page=
&Apache::loncommon::end_page({'js_ready' => 1});
@@ -1037,9 +1042,10 @@
//<!-- BEGIN LON-CAPA Internal
var checkwin;
-function spellcheckerwindow() {
+function spellcheckerwindow(string) {
+ var esc_string = string.replace(/\"/g,'"');
checkwin=window.open($nothing,'spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
- checkwin.document.writeln('$start_page<form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /><\/form>$end_page');
+ checkwin.document.writeln('$start_page<form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="'+esc_string+'" /><\/form>$end_page');
checkwin.document.close();
}
// END LON-CAPA Internal -->
@@ -1053,7 +1059,7 @@
my ($form,$field)=@_;
my $linktext=&mt('Check Spelling');
return (<<ENDLINK);
-<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>
+<a href="javascript:if (typeof(document.$form.onsubmit)!='undefined') { if (document.$form.onsubmit!=null) { document.$form.onsubmit();}};spellcheckerwindow(this.document.forms.$form.$field.value);">$linktext</a>
ENDLINK
}