4 var wordWindow = null;
\r
5 var controlWindow = null;
\r
7 function init_spell( spellerWindow ) {
\r
9 if( spellerWindow ) {
\r
10 if( spellerWindow.windowType == "wordWindow" ) {
\r
11 wordWindow = spellerWindow;
\r
12 } else if ( spellerWindow.windowType == "controlWindow" ) {
\r
13 controlWindow = spellerWindow;
\r
17 if( controlWindow && wordWindow ) {
\r
18 // populate the speller object and start it off!
\r
19 var speller = opener.speller;
\r
20 wordWindow.speller = speller;
\r
21 speller.startCheck( wordWindow, controlWindow );
\r
26 function encodeForPost( str ) {
\r
27 var s = new String( str );
\r
28 s = encodeURIComponent( s );
\r
29 // additionally encode single quotes to evade any PHP
\r
30 // magic_quotes_gpc setting (it inserts escape characters and
\r
31 // therefore skews the btye positions of misspelled words)
\r
32 return s.replace( /\'/g, '%27' );
\r
35 // post the text area data to the script that populates the speller
\r
36 function postWords() {
\r
37 var bodyDoc = window.frames[0].document;
\r
39 bodyDoc.write('<html>');
\r
40 bodyDoc.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
\r
41 bodyDoc.write('<link rel="stylesheet" type="text/css" href="spellerStyle.css"/>');
\r
43 var speller = opener.speller;
\r
44 bodyDoc.write('<body class="normalText" onLoad="document.forms[0].submit();">');
\r
45 bodyDoc.write('<p>' + window.parent.FCKLang.DlgSpellProgress + '<\/p>'); // by FredCK
\r
46 bodyDoc.write('<form action="'+speller.spellCheckScript+'" method="post">');
\r
47 for( var i = 0; i < speller.textInputs.length; i++ ) {
\r
48 bodyDoc.write('<input type="hidden" name="textinputs[]" value="'+encodeForPost(speller.textInputs[i].value)+'">');
\r
50 bodyDoc.write('<\/form>');
\r
51 bodyDoc.write('<\/body>');
\r
53 bodyDoc.write('<body class="normalText">');
\r
54 bodyDoc.write('<p><b>This page cannot be displayed<\/b><\/p><p>The window was not opened from another window.<\/p>');
\r
55 bodyDoc.write('<\/body>');
\r
57 bodyDoc.write('<\/html>');
\r
63 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
\r
65 <title>Speller Pages</title>
\r
67 <frameset rows="*,201" onLoad="postWords();">
\r
68 <frame src="blank.html">
\r
69 <frame src="controls.html">
\r