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