1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
8 * Licensed under the terms of any of the following licenses at your
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
26 #wsc_frames , #errorMessage{
38 #wsc_frames { z-index:10;}
57 <script type="text/javascript">
59 var oEditor = window.parent.InnerDialogLoaded() ;
60 var FCKConfig = oEditor.FCKConfig;
62 function doLoadScript(url)
67 var s = document.createElement('script') ;
68 s.type = 'text/javascript' ;
71 document.getElementsByTagName('head')[0].appendChild(s) ;
78 return window.parent.Cancel() ;
81 function _callOnCancel( dT )
83 window.parent.Cancel() ;
86 function _callOnFinish( dT )
88 oEditor.FCK.SetData( dT.value ) ;
89 window.parent.CloseDialog( true ) ;
92 function _cancelOnError(m)
94 var _conId = 'errorMessage' ;
95 var message = m || 'Sorry, but service is unavailable now.' ;
97 if ( typeof( WSC_Error ) == 'undefined' )
99 var _con = document.createElement( 'div' ) ;
100 _con.setAttribute( 'id', _conId ) ;
101 document.body.appendChild( _con ) ;
102 dom_con = document.getElementById( _conId ) ;
103 dom_con.innerHTML = message ;
104 dom_con.style.display = 'block' ;
109 function URL_abs2full( uri )
111 return uri.match( 'http' )
113 : document.location.protocol + '//' + document.location.host + uri ;
116 function clearErrorUsermessage()
118 // empty error container
119 var _con = document.getElementById( 'errorMessage' ) ;
124 _con.innerHTML = '' ;
125 _con.style.display = 'none' ;
132 clearErrorUsermessage() ;
133 var _errorMessage = 'The SpellChecker Service is currently unavailable.' ;
134 if ( 'undefined' != typeof( oEditor.FCK.Config.WSChLoaderScript ) )
135 _errorMessage = '<div>The SpellChecker Service is currently unavailable.</div><p>Error loading application<br>service host: ' + oEditor.FCK.Config.WSChLoaderScript + '</p>';
137 var burnSpelling = function( oName, _eMessage )
143 if ( typeof( window[oName] ) == 'function' )
145 else if ( i++ == 180 )
146 _cancelOnError( _eMessage ) ;
150 gInterval = window.setInterval( burnSpelling( 'doSpell', _errorMessage ), 250 ) ;
152 // WSC CORE init section
153 var protocol = document.location.protocol || 'http:' ;
154 var baseUrl = protocol + '//loader.spellchecker.net/sproxy_fck/sproxy.php' ;
155 var plugin = "fck2" ;
156 var customerid = oEditor.FCK.Config.WSCnCustomerId
157 || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk" ;
158 var wscCoreUrl = oEditor.FCK.Config.WSChLoaderScript
160 + 'plugin=' + plugin + '&'
161 + 'customerid='+ customerid + '&'
162 + 'cmd=script&doc=wsc&schema=22' ) ;
165 doLoadScript( wscCoreUrl ) ;
168 function initAndSpell()
170 //xall from window.setInteval expected at once
171 if ( typeof( gInterval ) == 'undefined' )
173 window.clearInterval( gInterval ) ;
175 // global var is used in FCK specific core
176 // change on equal var used in fckplugin.js
177 gFCKPluginName = 'wsc' ;
179 // get the data to be checked
180 var sData = oEditor.FCK.GetData() ;
183 var ctrlId = 'myEditor' ;
184 var dCurT = document.getElementById( ctrlId ) ;
185 dCurT.value = sData ;
187 // service paths corecting/preparing
188 var sPath2Scin = URL_abs2full( oEditor.FCK.Config.SkinDialogCSS ) ;
189 var sPathCiframe = FCKConfig.BasePath + 'wsc/ciframe.html' ;
190 var sPathFrameset = FCKConfig.BasePath + 'wsc/tmpFrameset.html' ;
192 // language abbr standarts comparer
193 var LangComparer = new _SP_FCK_LangCompare() ;
194 LangComparer.setDefaulLangCode( oEditor.FCK.Language.DefaultLanguage ) ;
196 // clear user message console (if application was loaded more then after 2 seconds)
197 clearErrorUsermessage() ;
201 lang : LangComparer.getSPLangCode( oEditor.FCK.Language.GetActiveLanguage() ),
202 winType : 'wsc_frames',// if not defined app will run on winpopup
204 // callback binding section
205 onCancel :window._callOnCancel,
206 onFinish :window._callOnFinish,
208 // @TODO: basePath assingning
210 // some manipulations with client static pages
211 framesetPath : sPathFrameset,
212 iframePath : sPathCiframe,
215 schemaURI : sPath2Scin
223 <body onload="onLoad()" style="padding: 0px; overflow: hidden;">
224 <textarea style="display: none;" id="myEditor" rows="10" cols="40"></textarea>
225 <iframe src="" name="wsc_frames" id="wsc_frames"></iframe>