Ticket #2685: 2685.patch

File 2685.patch, 12.4 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _whatsnew.html

     
    3737        <p>
    3838                New Features and Improvements:</p>
    3939        <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>
    4045                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2430">#2430</a>] In the table
    4146                        dialog it's possible to create header cells in the first row (included in a thead element)
    4247                        or the first column of the table. </li>
  • editor/_source/commandclasses/fckspellcheckcommand_gecko.js

     
    2525var FCKSpellCheckCommand = function()
    2626{
    2727        this.Name = 'SpellCheck' ;
    28         this.IsEnabled = ( FCKConfig.SpellChecker == 'SpellerPages' ) ;
     28        this.IsEnabled = ( FCKConfig.SpellChecker != 'ieSpell' ) ;
    2929}
    3030
    3131FCKSpellCheckCommand.prototype.Execute = function()
    3232{
    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                default :
     40                        FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ;
     41        }
    3442}
    3543
    3644FCKSpellCheckCommand.prototype.GetState = function()
  • editor/_source/commandclasses/fckspellcheckcommand_ie.js

     
    2525var FCKSpellCheckCommand = function()
    2626{
    2727        this.Name = 'SpellCheck' ;
    28         this.IsEnabled = ( FCKConfig.SpellChecker == 'ieSpell' || FCKConfig.SpellChecker == 'SpellerPages' ) ;
     28        this.IsEnabled = true ;
    2929}
    3030
    3131FCKSpellCheckCommand.prototype.Execute = function()
     
    3939                case 'SpellerPages' :
    4040                        FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
    4141                        break ;
     42
     43                default :
     44                        FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'wsc/w.html', 530, 480 ) ;
    4245        }
    4346}
    4447
  • 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                        function gup( name )
     28                        {
     29                          name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
     30                          var regexS = "[\\?&]"+name+"=([^&#]*)";
     31                          var regex = new RegExp( regexS );
     32                          var results = regex.exec( window.location.href );
     33                          if( results == null )
     34                            return "";
     35                          else
     36                            return results[1];
     37                        }
     38
     39            // intermediate document with the same domain as destinatioin frame
     40            // destinatioin is a topnav frame in frameset.html (top.html - template)
     41            function sendData2Master(){
     42               
     43                var destination = parent.parent;
     44                               
     45                try {
     46                                        if (destination.XDTMaster) { //&& window.confirm(gup('cmd')
     47                                                var t = destination.XDTMaster.read([gup('cmd'), gup('data')]);
     48                                                //console.info("%s client iframe to XDTMaster %o" ,t,[gup('cmd'), gup('data')]);
     49                                               
     50                                                window.clearInterval(interval);
     51                                        } else {
     52                                                //console.info("XDTMaster are not exist");
     53                                                /*jsl:pass*/
     54                                        }
     55                                               
     56                } catch (err) {
     57                                        //alert("oooooooooo");
     58                                }
     59            }
     60           
     61                        function onLoad (){
     62                                interval = window.setInterval(sendData2Master,100);
     63                        }
     64        </script>
     65</head>
     66<body onload="onLoad()">
     67        <p></p>
     68</body>
     69</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                        function doLoadScript (url) { if (!url) return false; var h = document.getElementsByTagName("head")[0]; var s = document.createElement("script"); s.type = "text/javascript" ; s.src  = url ; h.appendChild(s); return true;}
     28            function tryLoad (){
     29                if (typeof(opener) == 'undefined' || !opener){
     30                    opener = parent;
     31                }
     32                // get access to global parameters
     33                oParams = opener.oldFramesetPageParams;
     34                // make frameset rows string prepare
     35                sFramesetRows = ( parseInt(oParams.firstframeh,10) || '30') + ",*,"+( parseInt(oParams.thirdframeh,10) || '150')+",0";
     36                document.getElementById('itFrameset').rows = sFramesetRows;
     37                // dynamic including init frames and crossdomain transport code
     38                // from config sproxy_js_frameset url
     39                var addScriptUrl = oParams.sproxy_js_frameset;
     40                doLoadScript(addScriptUrl);
     41            }
     42        </script>
     43</head>
     44<frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0">
     45    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame>
     46    <frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame>
     47    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame>
     48    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame>
     49</frameset>
     50</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>Untitled Document</title>
     25        <script src="http://loader.spellchecker.net/sproxy_fck/sproxy.php?plugin=fck2&amp;customerid=1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk&amp;cmd=script&amp;doc=wsc&amp;schema=22" type="text/javascript"></script>
     26        <script type="text/javascript">
     27
     28        var oEditor = window.parent.InnerDialogLoaded() ;
     29        var FCKConfig = oEditor.FCKConfig;
     30
     31        function Ok(){
     32
     33                return window.parent.Cancel();
     34        }
     35
     36        var ctrlId =  'myEditor' ;
     37
     38    function onCancel (dT){
     39        // dT is texarea
     40
     41                window.parent.Cancel()
     42    }
     43
     44    function onFinish (dT){
     45        // dT is texarea
     46                //console.info(dT.value);
     47                oEditor.FCK.EditorDocument.body.innerHTML = dT.value;
     48                //alert ([t.length,dT.value.length])
     49                Ok();
     50    }
     51
     52
     53        function _cancelOnError (m){
     54                var message = m || 'Sorry, but service is unavailable now.';
     55                if (typeof(WSC_Error) == 'undefined')
     56                    alert(message);
     57        return Ok();
     58        }
     59
     60        function URL_abs2full (uri){
     61                return uri.match('http')
     62                    ? uri
     63                        : document.location.protocol + '//' + document.location.host + uri;
     64        }
     65
     66        function onLoad()
     67                {
     68                        // HTML data
     69                        var sData = oEditor.FCK.GetHTML();
     70
     71                        if (/^\s*$/.test(sData))
     72                                return _cancelOnError('Nothing to check.');
     73
     74                        if (typeof(doSpell) == 'undefined' || !doSpell)
     75                               return _cancelOnError('Sorry, but service is unavailable now.');
     76
     77                    // global var
     78                        gFCKPluginName = 'wsc';
     79                        // place data into texarea
     80                        var dCurT = document.getElementById(ctrlId);
     81                        dCurT.value = sData;
     82
     83                        //dCurT.value = t;
     84                        // get WSC work as it likes )))
     85                        //window.setTimeout(function(){
     86
     87
     88                           // skin path corecting
     89                           var sPath2Scin = URL_abs2full(FCKConfig.SkinDialogCSS);
     90                           var sPathCiframe = FCKConfig.BasePath + 'wsc/ciframe.html';
     91                           var sPathFrameset = FCKConfig.BasePath + 'wsc/tmpFrameset.html';
     92
     93                           var LangComparer = new _SP_FCK_LangCompare();
     94               LangComparer.setDefaulLangCode(oEditor.FCK.Language.DefaultLanguage);
     95
     96
     97                                        doSpell({
     98                            ctrl: ctrlId,
     99                            lang: LangComparer.getSPLangCode(oEditor.FCK.Language.GetActiveLanguage()),
     100                            winType:'wsc_frames',// if not defined window popup will run
     101                            // callback binding section
     102                                                        onCancel:onCancel,
     103                                                        onFinish:onFinish,
     104                                                        // @TODO: basePath assingning
     105                                                        // some manipulations with client static pages
     106                                                        framesetPath: sPathFrameset,
     107                                                        iframePath  : sPathCiframe,
     108                                                        // styles defining
     109                                                        schemaURI: sPath2Scin
     110                        });
     111
     112
     113                        return true;
     114                }
     115
     116                </script>
     117</head>
     118<body onload="onLoad()" style="padding: 0px; overflow: hidden;">
     119        <textarea style="display: none;" id="myEditor" rows="10" cols="40"></textarea>
     120        <iframe src="" name="wsc_frames" id="wsc_frames" style="position: absolute; top: 0px;
     121                left: 0px; width: 500px; height: 395px; width: 500px; margin: 0px; padding: 0px;
     122                border: 0px; display: block;"></iframe>
     123</body>
     124</html>
  • fckconfig.js

     
    160160FCKConfig.StylesXmlPath         = FCKConfig.EditorPath + 'fckstyles.xml' ;
    161161FCKConfig.TemplatesXmlPath      = FCKConfig.EditorPath + 'fcktemplates.xml' ;
    162162
    163 FCKConfig.SpellChecker                  = 'ieSpell' ;   // 'ieSpell' | 'SpellerPages'
     163FCKConfig.SpellChecker                  = 'WSC' ;       // 'WSC' | 'SpellerPages' | 'ieSpell'
    164164FCKConfig.IeSpellDownloadUrl    = 'http://www.iespell.com/download.php' ;
    165165FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ;        // Available extension: .php .cfm .pl
    166166FCKConfig.FirefoxSpellChecker   = false ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy