annotate wiki/htdocs/applets/FCKeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html @ 4326:07862b0663fd

merge moin/1.8 repo
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 22 Aug 2008 22:58:18 +0200
parents 77665d8e2254 6089ade226fb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
1
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
2 <script>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
3
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
4 var wordWindow = null;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
5 var controlWindow = null;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
6
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
7 function init_spell( spellerWindow ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
8
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
9 if( spellerWindow ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
10 if( spellerWindow.windowType == "wordWindow" ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
11 wordWindow = spellerWindow;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
12 } else if ( spellerWindow.windowType == "controlWindow" ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
13 controlWindow = spellerWindow;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
14 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
15 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
16
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
17 if( controlWindow && wordWindow ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
18 // populate the speller object and start it off!
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
19 var speller = opener.speller;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
20 wordWindow.speller = speller;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
21 speller.startCheck( wordWindow, controlWindow );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
22 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
23 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
24
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
25 // encodeForPost
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
26 function encodeForPost( str ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
27 var s = new String( str );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
28 s = encodeURIComponent( s );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
29 // additionally encode single quotes to evade any PHP
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
30 // magic_quotes_gpc setting (it inserts escape characters and
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
31 // therefore skews the btye positions of misspelled words)
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
32 return s.replace( /\'/g, '%27' );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
33 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
34
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
35 // post the text area data to the script that populates the speller
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
36 function postWords() {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
37 var bodyDoc = window.frames[0].document;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
38 bodyDoc.open();
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
39 bodyDoc.write('<html>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
40 bodyDoc.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
41 bodyDoc.write('<link rel="stylesheet" type="text/css" href="spellerStyle.css"/>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
42 if (opener) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
43 var speller = opener.speller;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
44 bodyDoc.write('<body class="normalText" onLoad="document.forms[0].submit();">');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
45 bodyDoc.write('<p>' + window.parent.FCKLang.DlgSpellProgress + '<\/p>'); // by FredCK
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
46 bodyDoc.write('<form action="'+speller.spellCheckScript+'" method="post">');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
47 for( var i = 0; i < speller.textInputs.length; i++ ) {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
48 bodyDoc.write('<input type="hidden" name="textinputs[]" value="'+encodeForPost(speller.textInputs[i].value)+'">');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
49 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
50 bodyDoc.write('<\/form>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
51 bodyDoc.write('<\/body>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
52 } else {
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
53 bodyDoc.write('<body class="normalText">');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
54 bodyDoc.write('<p><b>This page cannot be displayed<\/b><\/p><p>The window was not opened from another window.<\/p>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
55 bodyDoc.write('<\/body>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
56 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
57 bodyDoc.write('<\/html>');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
58 bodyDoc.close();
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
59 }
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
60 </script>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
61
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
62 <html>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
63 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
64 <head>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
65 <title>Speller Pages</title>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
66 </head>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
67 <frameset rows="*,201" onLoad="postWords();">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
68 <frame src="blank.html">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
69 <frame src="controls.html">
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
70 </frameset>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
71 </html>