Ticket #4968: 4968.patch

File 4968.patch, 2.8 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    762762                }
    763763        });
    764764
    765         // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514)
    766         if ( CKEDITOR.env.gecko )
    767         {
    768765                ( function ()
    769766                {
    770767                        var body = document.body;
     
    773770                                window.addEventListener( 'load', arguments.callee, false );
    774771                        else
    775772                        {
    776                                 body.setAttribute( 'onpageshow', body.getAttribute( 'onpageshow' )
    777                                                 + ';event.persisted && CKEDITOR.tools.callFunction(' +
    778                                                 CKEDITOR.tools.addFunction( function()
    779                                                 {
    780                                                         var allInstances = CKEDITOR.instances,
    781                                                                 editor,
    782                                                                 doc;
    783                                                         for ( var i in allInstances )
    784                                                         {
    785                                                                 editor = allInstances[ i ];
    786                                                                 doc = editor.document;
    787                                                                 if ( doc )
    788                                                                 {
    789                                                                         doc.$.designMode = 'off';
    790                                                                         doc.$.designMode = 'on';
    791                                                                 }
    792                                                         }
    793                                                 } ) + ')' );
    794                         }
    795                 } )();
    796 
    797         }
    798 })();
     773                                // Follow the host application's text direction. (#4968)
     774                                CKEDITOR.config.contentsLangDirection = CKEDITOR.config.contentsLangDirection
     775                                        || CKEDITOR.document.getBody().getComputedStyle( 'direction');
     776
     777                                // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514)
     778                                if ( CKEDITOR.env.gecko )
     779                                {
     780                                        body.setAttribute( 'onpageshow', body.getAttribute( 'onpageshow' )
     781                                                        + ';event.persisted && CKEDITOR.tools.callFunction(' +
     782                                                        CKEDITOR.tools.addFunction( function()
     783                                                        {
     784                                                                var allInstances = CKEDITOR.instances,
     785                                                                        editor,
     786                                                                        doc;
     787                                                                for ( var i in allInstances )
     788                                                                {
     789                                                                        editor = allInstances[ i ];
     790                                                                        doc = editor.document;
     791                                                                        if ( doc )
     792                                                                        {
     793                                                                                doc.$.designMode = 'off';
     794                                                                                doc.$.designMode = 'on';
     795                                                                        }
     796                                                                }
     797                                                        } ) + ')' );
     798                                }
     799                        }
     800                } )();
     801})();
    799802
    800803/**
    801804 * Disables the ability of resize objects (image and tables) in the editing
  • _source/core/config.js

     
    7878         * The writting direction of the language used to write the editor
    7979         * contents. Allowed values are 'ltr' for Left-To-Right language (like
    8080         * English), or 'rtl' for Right-To-Left languages (like Arabic).
    81          * @default 'ltr'
     81         * @name CKEDITOR.config.contentsLangDirection
     82         * @default The host application's text direction.
    8283         * @type String
    8384         * @example
    8485         * config.contentsLangDirection = 'rtl';
    8586         */
    86         contentsLangDirection : 'ltr',
    8787
    8888        /**
    8989         * The user interface language localization to use. If empty, the editor
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy