Diff for /loncom/interface/lonspeller.pm between versions 1.7 and 1.16

version 1.7, 2004/07/29 13:38:31 version 1.16, 2006/03/24 21:40:11
Line 33  package Apache::lonspeller; Line 33  package Apache::lonspeller;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Text::Aspell;  use Text::Aspell;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnet;
 use Apache::lontexconvert();  use Apache::lontexconvert();
 use HTML::LCParser;  use HTML::LCParser;
 use strict;  use strict;
Line 41  my $speller; Line 42  my $speller;
 my $insidelink;  my $insidelink;
   
 sub spellcheck_language {  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') {      if (&mt('spellcheck_lang') ne 'spellcheck_lang') {
  return &mt('spellcheck_lang');   return &mt('spellcheck_lang');
     }      }
Line 53  sub set_language { Line 54  sub set_language {
     $speller->set_option('lang',$lang);      $speller->set_option('lang',$lang);
 }  }
   
   {
       my $uniq;
       sub get_uniq {
    return ++$uniq;
       }
   }
   
 sub textsection {  sub textsection {
     my $input=shift;      my $input=shift;
     my $output='';      my $output='';
Line 63  sub textsection { Line 71  sub textsection {
     $output.=$word;      $output.=$word;
  } else {   } else {
     my $suggestions=join(' ',$speller->suggest($word));      my $suggestions=join(' ',$speller->suggest($word));
     $suggestions=~s/\'/\\\'/gs;      $suggestions = "<script>alert('sug')</script>".$suggestions;
       $suggestions = &Apache::loncommon::js_ready($suggestions);
     if (($suggestions) && (!$insidelink)) {      if (($suggestions) && (!$insidelink)) {
  $output.='<a href="javascript:alert('."'".   my $start_page=
     $suggestions."');".      &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,});
    my $num = &get_uniq();
    my $info  ='<h3>'.$word.'</h3>'.$suggestions;
    $output .= "<script type=\"text/javascript\">
   //<!--
    function LONCAPA_lonspeller_$num() {
       spellwin=open(".&Apache::lonhtmlcommon::javascript_nothing().",'spellwin','width=140,height=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
       spellwin.".&Apache::lonhtmlcommon::javascript_docopen().";
       spellwin.document.writeln('$start_page $info $end_page');
       spellwin.document.close();
       spellwin.focus();
   }
   //-->
   </script><a href=\"javascript:LONCAPA_lonspeller_$num();void(0);\">";
     }      }
     $output.='<font color="red">'.$word.'</font>';      $output.='<font color="red">'.$word.'</font>';
     if (($suggestions) && (!$insidelink)) { $output.='</a>'; }      if (($suggestions) && (!$insidelink)) { $output.='</a>'; }
Line 124  sub handler { Line 150  sub handler {
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
   
     &initspeller();      &initspeller();
     $r->print('<html><head><title>'.      my $start_page = 
       &mt('Spell Checker').   &Apache::loncommon::start_page('Spell Checker',undef,
       '</title></head><body bgcolor="#DDDDDD">'.         {'only_body' => 1,
    'bgcolor'   => '#DDDDDD'});
       $r->print($start_page.
       &Apache::lontexconvert::msgtexconverted(        &Apache::lontexconvert::msgtexconverted(
      &markeduptext($ENV{'form.text'})).       &markeduptext($env{'form.text'})).
       '</body></html>');        &Apache::loncommon::end_page());
     return OK;      return OK;
 }  }
   

Removed from v.1.7  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.