Ticket #2685: 2685_3.patch
File 2685_3.patch, 13.9 KB (added by , 15 years ago) |
---|
-
_whatsnew.html
37 37 <p> 38 38 New Features and Improvements:</p> 39 39 <ul> 40 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2685">#2685</a>] Integration 41 with "Web Spell Checker", a <strong>zero installation and free spell checker</strong> 42 provided by SpellChecker.net. This is now the default spell checker in the editor 43 (requires internet connection). All previous spell checking solutions are still 44 available.</li> 40 45 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2430">#2430</a>] In the table 41 46 dialog it's possible to create header cells in the first row (included in a thead element) 42 47 or the first column of the table. </li> -
editor/_source/commandclasses/fckspellcheckcommand_gecko.js
25 25 var FCKSpellCheckCommand = function() 26 26 { 27 27 this.Name = 'SpellCheck' ; 28 this.IsEnabled = ( FCKConfig.SpellChecker == 'SpellerPages' ) ;28 this.IsEnabled = ( FCKConfig.SpellChecker != 'ieSpell' ) ; 29 29 } 30 30 31 31 FCKSpellCheckCommand.prototype.Execute = function() 32 32 { 33 FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ; 33 switch ( FCKConfig.SpellChecker ) 34 { 35 case 'SpellerPages' : 36 FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ; 37 break; 38 39 case 'WSC' : 40 FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ; 41 } 34 42 } 35 43 36 44 FCKSpellCheckCommand.prototype.GetState = function() -
editor/_source/commandclasses/fckspellcheckcommand_ie.js
25 25 var FCKSpellCheckCommand = function() 26 26 { 27 27 this.Name = 'SpellCheck' ; 28 this.IsEnabled = ( FCKConfig.SpellChecker == 'ieSpell' || FCKConfig.SpellChecker == 'SpellerPages' );28 this.IsEnabled = true ; 29 29 } 30 30 31 31 FCKSpellCheckCommand.prototype.Execute = function() … … 39 39 case 'SpellerPages' : 40 40 FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ; 41 41 break ; 42 43 case 'WSC' : 44 FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ; 42 45 } 43 46 } 44 47 -
editor/wsc/ciframe.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2 <!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2008 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 <html> 23 <head> 24 <title></title> 25 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 26 <script type="text/javascript"> 27 28 function gup( name ) 29 { 30 name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ; 31 var regexS = '[\\?&]' + name + '=([^&#]*)' ; 32 var regex = new RegExp( regexS ) ; 33 var results = regex.exec( window.location.href ) ; 34 35 if( results == null ) 36 return '' ; 37 else 38 return results[ 1 ] ; 39 } 40 41 function sendData2Master() 42 { 43 var destination = parent.parent ; 44 try 45 { 46 if ( destination.XDTMaster ) 47 { 48 var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ; 49 window.clearInterval( interval ) ; 50 } 51 } 52 catch (e) {} 53 } 54 55 function onLoad() 56 { 57 interval = window.setInterval( sendData2Master, 100 ); 58 } 59 60 </script> 61 </head> 62 <body onload="onLoad()"> 63 <p></p> 64 </body> 65 </html> -
editor/wsc/tmpFrameset.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> 2 <!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2008 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 <html> 23 <head> 24 <title></title> 25 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 26 <script type="text/javascript"> 27 28 function doLoadScript( url ) 29 { 30 if ( !url ) 31 return false ; 32 33 var s = document.createElement( "script" ) ; 34 s.type = "text/javascript" ; 35 s.src = url ; 36 document.getElementsByTagName( "head" )[ 0 ].appendChild( s ) ; 37 38 return true ; 39 } 40 41 function tryLoad () 42 { 43 if ( typeof( opener ) == 'undefined' || !opener ) 44 opener = parent ; 45 46 // get access to global parameters 47 oParams = opener.oldFramesetPageParams ; 48 49 // make frameset rows string prepare 50 sFramesetRows = ( parseInt( oParams.firstframeh, 10 ) || '30') + ",*," + ( parseInt( oParams.thirdframeh, 10 ) || '150' ) + ',0' ; 51 document.getElementById( 'itFrameset' ).rows = sFramesetRows ; 52 53 // dynamic including init frames and crossdomain transport code 54 // from config sproxy_js_frameset url 55 var addScriptUrl = oParams.sproxy_js_frameset ; 56 doLoadScript( addScriptUrl ) ; 57 } 58 59 </script> 60 </head> 61 <frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0"> 62 <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame> 63 <frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame> 64 <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame> 65 <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame> 66 </frameset> 67 </html> -
editor/wsc/w.html
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-2008 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 <html> 23 <head> 24 <title></title> 25 <style> 26 #wsc_frames , #errorMessage{ 27 position:absolute; 28 top:0px; 29 left:0px; 30 width:500px; 31 height:395px; 32 margin:0px; 33 padding:0px; 34 border:0px; 35 display:block; 36 overflow: hidden; 37 } 38 #wsc_frames { z-index:10;} 39 #errorMessage { 40 color:red; 41 display:none; 42 font-size:16px; 43 font-weight:bold; 44 padding-top:160px; 45 text-align:center; 46 z-index:11; 47 } 48 #errorMessage p { 49 color:#000; 50 font-size:11px; 51 text-align:left; 52 font-weight: normal; 53 padding-left:80px; 54 } 55 56 </style> 57 <script type="text/javascript"> 58 59 var oEditor = window.parent.InnerDialogLoaded() ; 60 var FCKConfig = oEditor.FCKConfig; 61 62 function doLoadScript(url) 63 { 64 if (!url) 65 return false ; 66 67 var s = document.createElement('script') ; 68 s.type = 'text/javascript' ; 69 s.src = url ; 70 71 document.getElementsByTagName('head')[0].appendChild(s) ; 72 73 return true ; 74 } 75 76 function Ok() 77 { 78 return window.parent.Cancel() ; 79 } 80 81 function _callOnCancel( dT ) 82 { 83 window.parent.Cancel() ; 84 } 85 86 function _callOnFinish( dT ) 87 { 88 oEditor.FCK.SetData( dT.value ) ; 89 window.parent.CloseDialog( true ) ; 90 } 91 92 function _cancelOnError(m) 93 { 94 var _conId = 'errorMessage' ; 95 var message = m || 'Sorry, but service is unavailable now.' ; 96 97 if ( typeof( WSC_Error ) == 'undefined' ) 98 { 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' ; 105 } 106 //return Ok() ; 107 } 108 109 function URL_abs2full( uri ) 110 { 111 return uri.match( 'http' ) 112 ? uri 113 : document.location.protocol + '//' + document.location.host + uri ; 114 } 115 116 function clearErrorUsermessage() 117 { 118 // empty error container 119 var _con = document.getElementById( 'errorMessage' ) ; 120 121 if ( !_con ) 122 return ; 123 124 _con.innerHTML = '' ; 125 _con.style.display = 'none' ; 126 } 127 128 var gInterval ; 129 130 function onLoad() 131 { 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 application loading<br>service host: ' + oEditor.FCK.Config.WSChLoaderScript + '</p>'; 136 137 var burnSpelling = function( oName, _eMessage ) 138 { 139 var i = 0 ; 140 141 return function () 142 { 143 if ( typeof( window[oName] ) == 'function' ) 144 initAndSpell() ; 145 else if ( i++ == 30 ) 146 _cancelOnError( _eMessage ) ; 147 } 148 } 149 150 gInterval = window.setInterval( burnSpelling( 'doSpell', _errorMessage ), 100 ) ; 151 152 // WSC CORE init section 153 var baseUrl = "http://loader.spellchecker.net/sproxy_fck/sproxy.php" ; 154 var plugin = "fck2" ; 155 var customerid = oEditor.FCK.Config.WSCnCustomerId 156 || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk" ; 157 var wscCoreUrl = oEditor.FCK.Config.WSChLoaderScript 158 || ( baseUrl + '?' 159 + 'plugin=' + plugin + '&' 160 + 'customerid='+ customerid + '&' 161 + 'cmd=script&doc=wsc&schema=22' ) ; 162 163 // load WSC core 164 doLoadScript( wscCoreUrl ) ; 165 } 166 167 function initAndSpell() 168 { 169 //xall from window.setInteval expected at once 170 if ( typeof( gInterval ) == 'undefined' ) 171 return null ; 172 window.clearInterval( gInterval ) ; 173 174 // global var is used in FCK specific core 175 // change on equal var used in fckplugin.js 176 gFCKPluginName = 'wsc' ; 177 178 // get the data to be checked 179 var sData = oEditor.FCK.GetData() ; 180 181 // prepare content 182 var ctrlId = 'myEditor' ; 183 var dCurT = document.getElementById( ctrlId ) ; 184 dCurT.value = sData ; 185 186 // service paths corecting/preparing 187 var sPath2Scin = URL_abs2full( oEditor.FCK.Config.SkinDialogCSS ) ; 188 var sPathCiframe = FCKConfig.BasePath + 'wsc/ciframe.html' ; 189 var sPathFrameset = FCKConfig.BasePath + 'wsc/tmpFrameset.html' ; 190 191 // language abbr standarts comparer 192 var LangComparer = new _SP_FCK_LangCompare() ; 193 LangComparer.setDefaulLangCode( oEditor.FCK.Language.DefaultLanguage ) ; 194 195 // clear user message console (if application was loaded more then after 2 seconds) 196 clearErrorUsermessage() ; 197 198 doSpell( { 199 ctrl : ctrlId, 200 lang : LangComparer.getSPLangCode( oEditor.FCK.Language.GetActiveLanguage() ), 201 winType : 'wsc_frames',// if not defined app will run on winpopup 202 203 // callback binding section 204 onCancel :window._callOnCancel, 205 onFinish :window._callOnFinish, 206 207 // @TODO: basePath assingning 208 209 // some manipulations with client static pages 210 framesetPath : sPathFrameset, 211 iframePath : sPathCiframe, 212 213 // styles defining 214 schemaURI : sPath2Scin 215 } ) ; 216 217 return true ; 218 } 219 220 </script> 221 </head> 222 <body onload="onLoad()" style="padding: 0px; overflow: hidden;"> 223 <textarea style="display: none;" id="myEditor" rows="10" cols="40"></textarea> 224 <iframe src="" name="wsc_frames" id="wsc_frames"></iframe> 225 </body> 226 </html> -
fckconfig.js
160 160 FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ; 161 161 FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ; 162 162 163 FCKConfig.SpellChecker = ' ieSpell' ; // 'ieSpell' | 'SpellerPages'163 FCKConfig.SpellChecker = 'WSC' ; // 'WSC' | 'SpellerPages' | 'ieSpell' 164 164 FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/download.php' ; 165 165 FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ; // Available extension: .php .cfm .pl 166 166 FCKConfig.FirefoxSpellChecker = false ;