Diff for /loncom/interface/lonspeller.pm between versions 1.11 and 1.17

version 1.11, 2005/04/07 06:56:23 version 1.17, 2006/07/03 13:40:42
Line 54  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 64  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 = &Apache::loncommon::js_ready($suggestions);
     if (($suggestions) && (!$insidelink)) {      if (($suggestions) && (!$insidelink)) {
  my $html=&Apache::lonxml::xmlbegin('encode');   my $start_page=
  $output.='<a href="javascript:spellwin=window.open('.      &Apache::loncommon::start_page('Speller Suggestions',undef,
     &Apache::lonhtmlcommon::javascript_nothing().     {'only_body'   => 1,
     ',\'spellwin\',\'height=140,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no\');'.      'js_ready'    => 1,
                     'spellwin.'.&Apache::lonhtmlcommon::javascript_docopen().';spellwin.document.writeln(\''.$html.'<head></head><body><h3>'.$word.      'bgcolor'     => '#FFFFFF'});
                     '</h3>'.$suggestions.'</body></html>\');spellwin.document.close();spellwin.focus()">';   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 128  sub handler { Line 149  sub handler {
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
   
     &initspeller();      &initspeller();
     my $html=&Apache::lonxml::xmlbegin();      my $start_page = 
     $r->print($html.'<head><title>'.   &Apache::loncommon::start_page('Spell Checker',undef,
       &mt('Spell Checker').         {'only_body' => 1,
       '</title></head><body bgcolor="#DDDDDD">'.   '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.11  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>