1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2<!--
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5 *
6 * == BEGIN LICENSE ==
7 *
8 * Licensed under the terms of any of the following licenses at your
9 * choice:
10 *
11 *  - GNU General Public License Version 2 or later (the "GPL")
12 *    http://www.gnu.org/licenses/gpl.html
13 *
14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 *    http://www.gnu.org/licenses/lgpl.html
16 *
17 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18 *    http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * Spell Check dialog window.
23-->
24<html>
25	<head>
26		<title>Spell Check</title>
27		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28		<meta content="noindex, nofollow" name="robots">
29		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
30		<script src="fck_spellerpages/spellerpages/spellChecker.js"></script>
31		<script type="text/javascript">
32
33var oEditor = window.parent.InnerDialogLoaded() ;
34var FCKLang = oEditor.FCKLang ;
35var oSpeller;
36
37function Ok () {
38    oSpeller.OnFinished = oSpeller_OnFinished ;
39    oSpeller.terminateSpell();
40     if(window.parent) {
41       window.parent.close();
42     }
43     return true;
44}
45
46window.onload = function()
47{
48	document.getElementById('txtHtml').value = oEditor.FCK.EditorDocument.body.innerHTML ;
49    oSpeller_handleURLInternals(document.getElementById('txtHtml'));
50	oSpeller = new spellChecker( document.getElementById('txtHtml') ) ;
51	oSpeller.spellCheckScript = oEditor.FCKConfig.SpellerPagesServerScript || 'server-scripts/spellchecker.php' ;
52	oSpeller.OnFinished = oSpeller_OnFinished ;
53	oSpeller.openChecker() ;
54        window.parent.SetOkButton( true ) ;
55
56       parent.Sizer.resize_delta_x = 50;
57       parent.Sizer.resize_delta_y = 50;
58       parent.Sizer.RefreshSize();
59
60}
61
62function OnSpellerControlsLoad( controlsWindow )
63{
64	// Translate the dialog box texts
65	oEditor.FCKLanguageManager.TranslatePage( controlsWindow.document ) ;
66}
67var oSpeller_URLInternals = new Array();
68function  oSpeller_handleURLInternals(txtDom) {
69    var index = -1;
70    txtDom.value = txtDom.value.replace(/<a\s+href\s*=\s*([^>]*)>/igm, function(match, paren) {
71                     index++;
72                     oSpeller_URLInternals[index] = paren;
73                     return '<a href=' + index + ';>';
74    });
75
76}
77
78function oSpeller_replaceURLInternals(txtDom) {
79
80    txtDom.value = txtDom.value.replace(/<a href=(\d+);>/igm, function(match, index) {
81                     alert('<a href=' + oSpeller_URLInternals[index] + '>');
82                     return '<a href=' + oSpeller_URLInternals[index] + '>';
83    });
84
85}
86
87function oSpeller_OnFinished( numberOCorrections )
88{
89	if ( numberOCorrections > 0 )
90	{
91		oEditor.FCKUndo.SaveUndoStep() ;
92        oSpeller_replaceURLInternals(document.getElementById('txtHtml'));
93		oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ;
94		if ( oEditor.FCKBrowserInfo.IsIE )
95			oEditor.FCKSelection.Collapse( true ) ;
96            if(window.parent && window.parent.Cancel) {
97               window.parent.Cancel() ;
98               return;
99            }
100	}
101
102
103    if(window.parent) {
104	  window.parent.close();
105     }
106}
107
108		</script>
109	</head>
110	<body style="OVERFLOW: auto"  style="padding:0px;">
111		<input type="hidden" id="txtHtml" value="">
112		<iframe id="frmSpell" src="javascript:void(0)" name="spellchecker" width="100%" height="100%" frameborder="0"></iframe>
113	</body>
114</html>
115