Ticket #3117: 3117.patch

File 3117.patch, 4.3 KB (added by Artur Formella, 15 years ago)
  • _source/plugins/wsc/dialogs/tmpFrameset.html

     
    2424
    2525function tryLoad ()
    2626{
    27     if ( !window.opener )
    28         window.opener = window.parent ;
     27        opener = window.parent;
    2928
    3029    // get access to global parameters
    3130    var oParams = window.opener.oldFramesetPageParams ;
  • _source/plugins/wsc/dialogs/wsc.js

     
    4747                return function ()
    4848                {
    4949                        if ( typeof( window.doSpell ) == 'function' )
     50                        {
     51                                //Call from window.setInteval expected at once.
     52                                if ( typeof( interval ) != 'undefined' )
     53                                        window.clearInterval( interval );
     54
    5055                                initAndSpell( dialog );
     56                        }
    5157                        else if ( i++ == 180 )                                                          // Timeout: 180 * 250ms = 45s.
    5258                                _cancelOnError( errorMsg );
    5359                };
    5460        }
    5561
    56         function _cancelOnError( m )
     62        window._cancelOnError = function( m )
    5763        {
    5864                if ( typeof( window.WSC_Error ) == 'undefined' )
    5965                {
     
    6268                        errorBox.setStyle( 'display', 'block' );
    6369                        errorBox.setHtml( m || editor.lang.spellCheck.notAvailable );
    6470                }
    65         }
     71        };
    6672
    6773        function initAndSpell( dialog )
    6874        {
    69                 //Call from window.setInteval expected at once.
    70                 if ( typeof( interval ) == 'undefined' )
    71                         return;
    72                 window.clearInterval( interval );
    73 
    74                 var sData = editor.getData(),                                                                                   // Get the data to be checked.
    75                         LangComparer = new window._SP_FCK_LangCompare(),                                                        // Language abbr standarts comparer.
     75                var LangComparer = new window._SP_FCK_LangCompare(),                                                    // Language abbr standarts comparer.
    7676                        pluginPath = CKEDITOR.getUrl( editor.plugins.wsc.path + 'dialogs/' ),                   // Service paths corecting/preparing.
    7777                        framesetPath = pluginPath + 'tmpFrameset.html';
    7878
     79                // global var is used in FCK specific core
     80                // change on equal var used in fckplugin.js
     81                gFCKPluginName = 'wsc';
     82
    7983                LangComparer.setDefaulLangCode( editor.config.defaultLanguage );
    8084
    81                 // Prepare content.
    82                 CKEDITOR.document.getById( textareaId ).setValue( sData );
    83 
    84                 // Hide user message console (if application was loaded more then after timeout).
    85                 CKEDITOR.document.getById( errorBoxId ).setStyle( 'display', 'none' );
    86                 CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'block' );
    87 
    8885                window.doSpell({
    8986                        ctrl : textareaId,
    9087                        lang : LangComparer.getSPLangCode( editor.langCode ),
     
    9794                        },
    9895                        onFinish : function( dT )
    9996                        {
     97                                editor.focus();
    10098                                dialog.getParentEditor().setData( dT.value );
    10199                                dialog.hide();
    102100                        },
     
    109107                        // Styles defining.
    110108                        schemaURI : pluginPath + 'wsc.css'
    111109                });
     110
     111                // Hide user message console (if application was loaded more then after timeout).
     112                CKEDITOR.document.getById( errorBoxId ).setStyle( 'display', 'none' );
     113                CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'block' );
    112114        }
    113115
    114116        return {
     
    135137                                                })
    136138                                );
    137139                        }
     140
     141                        var sData = editor.getData();                                                                                   // Get the data to be checked.
     142                        CKEDITOR.document.getById( textareaId ).setValue( sData );
     143
    138144                        interval = window.setInterval( burnSpelling( this, errorMsg ), 250 );
    139145                },
     146                onHide : function()
     147                {
     148                        window.ooo = undefined;
     149                        window.int_framsetLoaded = undefined;
     150                        window.framesetLoaded = undefined;
     151                        window.is_window_opened = false;
     152                },
    140153                contents : [
    141154                        {
    142155                                id : 'general',
  • _source/plugins/wsc/plugin.js

     
    1616
    1717                var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) );
    1818
    19                 // SpellChecker doesn't work in Opera.
    20                 command.modes = { wysiwyg : !( CKEDITOR.env.opera ) };
     19                // SpellChecker doesn't work in Opera and with custom domain
     20                command.modes = { wysiwyg : ( !CKEDITOR.env.opera && document.domain == window.location.hostname ) };
    2121
    2222                editor.ui.addButton( 'SpellChecker',
    2323                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy