upgrade fckeditor to ckeditor, for IE10 compatibility, RT#22014
[freeside.git] / httemplate / elements / fckeditor / editor / dialog / fck_spellerpages / spellerpages / server-scripts / spellchecker.pl
diff --git a/httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl b/httemplate/elements/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl
deleted file mode 100644 (file)
index fae010d..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/perl\r
-\r
-use CGI qw/ :standard /;\r
-use File::Temp qw/ tempfile tempdir /;\r
-\r
-# my $spellercss = '/speller/spellerStyle.css';                                        # by FredCK\r
-my $spellercss = '../spellerStyle.css';                                                        # by FredCK\r
-# my $wordWindowSrc = '/speller/wordWindow.js';                                        # by FredCK\r
-my $wordWindowSrc = '../wordWindow.js';                                                        # by FredCK\r
-my @textinputs = param( 'textinputs[]' ); # array\r
-# my $aspell_cmd = 'aspell';                                                                   # by FredCK (for Linux)\r
-my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"';   # by FredCK (for Windows)\r
-my $lang = 'en_US';\r
-# my $aspell_opts = "-a --lang=$lang --encoding=utf-8";                        # by FredCK\r
-my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt";          # by FredCK\r
-my $input_separator = "A";\r
-\r
-# set the 'wordtext' JavaScript variable to the submitted text.\r
-sub printTextVar {\r
-       for( my $i = 0; $i <= $#textinputs; $i++ ) {\r
-               print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n";\r
-       }\r
-}\r
-\r
-sub printTextIdxDecl {\r
-       my $idx = shift;\r
-       print "words[$idx] = [];\n";\r
-       print "suggs[$idx] = [];\n";\r
-}\r
-\r
-sub printWordsElem {\r
-       my( $textIdx, $wordIdx, $word ) = @_;\r
-       print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n";\r
-}\r
-\r
-sub printSuggsElem {\r
-       my( $textIdx, $wordIdx, @suggs ) = @_;\r
-       print "suggs[$textIdx][$wordIdx] = [";\r
-       for my $i ( 0..$#suggs ) {\r
-               print "'" . escapeQuote( $suggs[$i] ) . "'";\r
-               if( $i < $#suggs ) {\r
-                       print ", ";\r
-               }\r
-       }\r
-       print "];\n";\r
-}\r
-\r
-sub printCheckerResults {\r
-       my $textInputIdx = -1;\r
-       my $wordIdx = 0;\r
-       my $unhandledText;\r
-       # create temp file\r
-       my $dir = tempdir( CLEANUP => 1 );\r
-       my( $fh, $tmpfilename ) = tempfile( DIR => $dir );\r
-\r
-       # temp file was created properly?\r
-\r
-       # open temp file, add the submitted text.\r
-       for( my $i = 0; $i <= $#textinputs; $i++ ) {\r
-               $text = url_decode( $textinputs[$i] );\r
-               # Strip all tags for the text. (by FredCK - #339 / #681)\r
-               $text =~ s/<[^>]+>/ /g;\r
-               @lines = split( /\n/, $text );\r
-               print $fh "\%\n"; # exit terse mode\r
-               print $fh "^$input_separator\n";\r
-               print $fh "!\n";  # enter terse mode\r
-               for my $line ( @lines ) {\r
-                       # use carat on each line to escape possible aspell commands\r
-                       print $fh "^$line\n";\r
-               }\r
-\r
-       }\r
-       # exec aspell command\r
-       my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1";\r
-       open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return;\r
-       # parse each line of aspell return\r
-       for my $ret ( <ASPELL> ) {\r
-               chomp( $ret );\r
-               # if '&', then not in dictionary but has suggestions\r
-               # if '#', then not in dictionary and no suggestions\r
-               # if '*', then it is a delimiter between text inputs\r
-               if( $ret =~ /^\*/ ) {\r
-                       $textInputIdx++;\r
-                       printTextIdxDecl( $textInputIdx );\r
-                       $wordIdx = 0;\r
-\r
-               } elsif( $ret =~ /^(&|#)/ ) {\r
-                       my @tokens = split( " ", $ret, 5 );\r
-                       printWordsElem( $textInputIdx, $wordIdx, $tokens[1] );\r
-                       my @suggs = ();\r
-                       if( $tokens[4] ) {\r
-                               @suggs = split( ", ", $tokens[4] );\r
-                       }\r
-                       printSuggsElem( $textInputIdx, $wordIdx, @suggs );\r
-                       $wordIdx++;\r
-               } else {\r
-                       $unhandledText .= $ret;\r
-               }\r
-       }\r
-       close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return;\r
-}\r
-\r
-sub escapeQuote {\r
-       my $str = shift;\r
-       $str =~ s/'/\\'/g;\r
-       return $str;\r
-}\r
-\r
-sub handleError {\r
-       my $err = shift;\r
-       print "error = '" . escapeQuote( $err ) . "';\n";\r
-}\r
-\r
-sub url_decode {\r
-       local $_ = @_ ? shift : $_;\r
-       defined or return;\r
-       # change + signs to spaces\r
-       tr/+/ /;\r
-       # change hex escapes to the proper characters\r
-       s/%([a-fA-F0-9]{2})/pack "H2", $1/eg;\r
-       return $_;\r
-}\r
-\r
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\r
-# Display HTML\r
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\r
-\r
-print <<EOF;\r
-Content-type: text/html; charset=utf-8\r
-\r
-<html>\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
-<link rel="stylesheet" type="text/css" href="$spellercss"/>\r
-<script src="$wordWindowSrc"></script>\r
-<script type="text/javascript">\r
-var suggs = new Array();\r
-var words = new Array();\r
-var textinputs = new Array();\r
-var error;\r
-EOF\r
-\r
-printTextVar();\r
-\r
-printCheckerResults();\r
-\r
-print <<EOF;\r
-var wordWindowObj = new wordWindow();\r
-wordWindowObj.originalSpellings = words;\r
-wordWindowObj.suggestions = suggs;\r
-wordWindowObj.textInputs = textinputs;\r
-\r
-\r
-function init_spell() {\r
-       // check if any error occured during server-side processing\r
-       if( error ) {\r
-               alert( error );\r
-       } else {\r
-               // call the init_spell() function in the parent frameset\r
-               if (parent.frames.length) {\r
-                       parent.init_spell( wordWindowObj );\r
-               } else {\r
-                       error = "This page was loaded outside of a frameset. ";\r
-                       error += "It might not display properly";\r
-                       alert( error );\r
-               }\r
-       }\r
-}\r
-\r
-</script>\r
-\r
-</head>\r
-<body onLoad="init_spell();">\r
-\r
-<script type="text/javascript">\r
-wordWindowObj.writeBody();\r
-</script>\r
-\r
-</body>\r
-</html>\r
-EOF\r