--- loncom/interface/lonspeller.pm 2004/12/02 20:54:26 1.9
+++ loncom/interface/lonspeller.pm 2006/03/21 20:19:41 1.13
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Interface routines for Aspell
#
-# $Id: lonspeller.pm,v 1.9 2004/12/02 20:54:26 albertel Exp $
+# $Id: lonspeller.pm,v 1.13 2006/03/21 20:19:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,6 +33,7 @@ package Apache::lonspeller;
use Apache::Constants qw(:common);
use Text::Aspell;
use Apache::lonlocal;
+use Apache::lonnet;
use Apache::lontexconvert();
use HTML::LCParser;
use strict;
@@ -41,7 +42,7 @@ my $speller;
my $insidelink;
sub spellcheck_language {
- if ($ENV{'form.lang'}) { return $ENV{'form.lang'}; }
+ if ($env{'form.lang'}) { return $env{'form.lang'}; }
if (&mt('spellcheck_lang') ne 'spellcheck_lang') {
return &mt('spellcheck_lang');
}
@@ -65,11 +66,18 @@ sub textsection {
my $suggestions=join(' ',$speller->suggest($word));
$suggestions=~s/\'/\\\'/gs;
if (($suggestions) && (!$insidelink)) {
+ my $start_page=
+ &Apache::loncommon::start_page('Speller Suggestions',undef,
+ {'only_body' => 1,
+ 'js_ready' => 1,
+ 'bgcolor' => '#FFFFFF'});
+ my $end_page=
+ &Apache::loncommon::end_page({'js_ready' => 1});
$output.='';
+ 'spellwin.'.&Apache::lonhtmlcommon::javascript_docopen().';spellwin.document.writeln(\''.$start_page.''.$word.
+ '
'.$suggestions.$end_page.'\');spellwin.document.close();spellwin.focus()">';
}
$output.=''.$word.'';
if (($suggestions) && (!$insidelink)) { $output.=''; }
@@ -126,12 +134,12 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
&initspeller();
- $r->print('