Ticket #5663: 5663.patch

File 5663.patch, 3.4 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/core/ckeditor.js

     
    6969        delete CKEDITOR.instances[ editor.name ];
    7070};
    7171
     72/**
     73 * Perform global clean up to free as much memory as possible
     74 * when there are no instances left
     75 */
     76CKEDITOR.on( 'instanceDestroyed', function ()
     77        {
     78                if ( CKEDITOR.tools.isEmpty( this.instances ) )
     79                        CKEDITOR.fire( 'reset' );
     80        });
     81
    7282// Load the bootstrap script.
    7383CKEDITOR.loader.load( 'core/_bootstrap' );              // @Packager.RemoveLine
    7484
  • _source/core/dom/domobject.js

     
    143143{
    144144        var customData = {};
    145145
     146        CKEDITOR.on( 'reset', function()
     147                {
     148                        customData = {};
     149                });
     150
    146151        /**
    147152         * Determines whether the specified object is equal to the current object.
    148153         * @name CKEDITOR.dom.domObject.prototype.equals
  • _source/core/tools.js

     
    1 /*
     1/*
    22Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    1212{
    1313        var functions = [];
    1414
     15        CKEDITOR.on( 'reset', function()
     16                {
     17                        functions = [];
     18                });
     19
    1520        /**
    1621         * Utility functions.
    1722         * @namespace
  • _source/plugins/button/plugin.js

     
    270270{
    271271        this.add( name, CKEDITOR.UI_BUTTON, definition );
    272272};
     273
     274CKEDITOR.on( 'reset', function()
     275        {
     276                CKEDITOR.ui.button._.instances = [];
     277        });
  • _source/plugins/wysiwygarea/plugin.js

     
    798798                                window.addEventListener( 'load', arguments.callee, false );
    799799                        else
    800800                        {
    801                                 body.setAttribute( 'onpageshow', body.getAttribute( 'onpageshow' )
    802                                                 + ';event.persisted && CKEDITOR.tools.callFunction(' +
    803                                                 CKEDITOR.tools.addFunction( function()
    804                                                 {
    805                                                         var allInstances = CKEDITOR.instances,
    806                                                                 editor,
    807                                                                 doc;
    808                                                         for ( var i in allInstances )
    809                                                         {
    810                                                                 editor = allInstances[ i ];
    811                                                                 doc = editor.document;
    812                                                                 if ( doc )
    813                                                                 {
    814                                                                         doc.$.designMode = 'off';
    815                                                                         doc.$.designMode = 'on';
    816                                                                 }
    817                                                         }
    818                                                 } ) + ')' );
     801                                var currentHandler = body.getAttribute( 'onpageshow' );
     802                                body.setAttribute( 'onpageshow', ( currentHandler ? currentHandler + ';' : '') +
     803                                                        'event.persisted && (function(){' +
     804                                                                'var allInstances = CKEDITOR.instances, editor, doc;' +
     805                                                                'for ( var i in allInstances )' +
     806                                                                '{' +
     807                                                                '       editor = allInstances[ i ];' +
     808                                                                '       doc = editor.document;' +
     809                                                                '       if ( doc )' +
     810                                                                '       {' +
     811                                                                '               doc.$.designMode = "off";' +
     812                                                                '               doc.$.designMode = "on";' +
     813                                                                '       }' +
     814                                                                '}' +
     815                                                '})();' );
    819816                        }
    820817                } )();
    821818
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy