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