/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php |
---|
1,17 → 1,20 |
<?php |
header('Content-type: text/html; charset=utf-8'); |
//$spellercss = '/speller/spellerStyle.css'; // by FredCK |
// The following variables values must reflect your installation needs. |
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows) |
//$aspell_prog = 'aspell'; // by FredCK (for Linux) |
$lang = 'en_US'; |
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK |
$tempfiledir = "./"; |
$spellercss = '../spellerStyle.css'; // by FredCK |
//$word_win_src = '/speller/wordWindow.js'; // by FredCK |
$word_win_src = '../wordWindow.js'; // by FredCK |
$textinputs = $_POST['textinputs']; # array |
//$aspell_prog = 'aspell'; // by FredCK (for Linux) |
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows) |
$lang = 'en_US'; |
//$aspell_opts = "-a --lang=$lang --encoding=utf-8"; // by FredCK |
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H"; // by FredCK |
$tempfiledir = "./"; |
$input_separator = "A"; |
# set the JavaScript variable to the submitted text. |
59,7 → 62,7 |
# handle a server-side error. |
function error_handler( $err ) { |
echo "error = '" . escape_quote( $err ) . "';\n"; |
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n"; |
} |
## get the list of misspelled words. Put the results in the javascript words array |
79,6 → 82,10 |
if( $fh = fopen( $tempfile, 'w' )) { |
for( $i = 0; $i < count( $textinputs ); $i++ ) { |
$text = urldecode( $textinputs[$i] ); |
// Strip all tags for the text. (by FredCK - #339 / #681) |
$text = preg_replace( "/<[^>]+>/", " ", $text ) ; |
$lines = explode( "\n", $text ); |
fwrite ( $fh, "%\n" ); # exit terse mode |
fwrite ( $fh, "^$input_separator\n" ); |
190,4 → 197,3 |
</body> |
</html> |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js |
---|
217,7 → 217,7 |
function printForHtml( n ) { |
return n ; // by FredCK |
/* |
var htmlstr = n; |
if( htmlstr.length == 1 ) { |
// do simple case statement if it's just one character |
239,6 → 239,7 |
htmlstr = htmlstr.replace( /\n/g, '<br/>' ); |
return htmlstr; |
} |
*/ |
} |
function _isWordChar( letter ) { |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js |
---|
19,7 → 19,6 |
// this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes"; // by FredCK |
this.popUpProps = null ; // by FredCK |
// this.spellCheckScript = '/speller/server-scripts/spellchecker.php'; // by FredCK |
this.spellCheckScript = 'server-scripts/spellchecker.php'; // by FredCK |
//this.spellCheckScript = '/cgi-bin/spellchecker.pl'; |
// values used to keep track of what happened to a word |
132,6 → 131,7 |
this.currentWordIndex++; |
this._spellcheck(); |
} |
return true; |
} |
function ignoreAll() { |
169,6 → 169,7 |
// finally, move on |
this.currentWordIndex++; |
this._spellcheck(); |
return true; |
} |
function replaceWord() { |
183,7 → 184,7 |
return false; |
} |
if( !this.controlWin.replacementText ) { |
return; |
return false ; |
} |
var txt = this.controlWin.replacementText; |
if( txt.value ) { |
193,6 → 194,7 |
this._spellcheck(); |
} |
} |
return true; |
} |
function replaceAll() { |
208,7 → 210,7 |
return false; |
} |
var txt = this.controlWin.replacementText; |
if( !txt.value ) return; |
if( !txt.value ) return false; |
var newspell = new String( txt.value ); |
// set this word as a "replace all" word. |
232,6 → 234,7 |
// finally, move on |
this.currentWordIndex++; |
this._spellcheck(); |
return true; |
} |
function terminateSpell() { |
286,7 → 289,7 |
function undo() { |
// skip if this is the first word! |
var ti = this.currentTextIndex; |
var wi = this.currentWordIndex |
var wi = this.currentWordIndex; |
if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) { |
this.wordWin.removeFocus( ti, wi ); |
318,15 → 321,16 |
this.controlWin.disableUndo(); |
} |
var i, j, origSpell ; |
// examine what happened to this current word. |
switch( this.wordFlags[text_idx][idx] ) { |
// replace all: go through this and all the future occurances of the word |
// and revert them all to the original spelling and clear their flags |
case this.replAllFlag : |
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == text_idx && j >= idx ) || i > text_idx ) { |
var origSpell = this.wordWin.originalSpellings[i][j]; |
origSpell = this.wordWin.originalSpellings[i][j]; |
if( origSpell == preReplSpell ) { |
this._setWordText ( i, j, origSpell, undefined ); |
} |
338,10 → 342,10 |
// ignore all: go through all the future occurances of the word |
// and clear their flags |
case this.ignrAllFlag : |
for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) { |
for( j = 0; j < this.wordWin.totalWords( i ); j++ ) { |
if(( i == text_idx && j >= idx ) || i > text_idx ) { |
var origSpell = this.wordWin.originalSpellings[i][j]; |
origSpell = this.wordWin.originalSpellings[i][j]; |
if( origSpell == preReplSpell ) { |
this.wordFlags[i][j] = undefined; |
} |
455,4 → 459,3 |
} |
return inputs; |
} |
/branches/livraison_aha/api/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html |
---|
1,8 → 1,8 |
<html> |
<head> |
<link rel="stylesheet" type="text/css" href="spellerStyle.css" /> |
<script src="controlWindow.js"></script> |
<script> |
<script type="text/javascript" src="controlWindow.js"></script> |
<script type="text/javascript"> |
var spellerObject; |
var controlWindowObj; |