Ticket #8226: 8226_2.patch

File 8226_2.patch, 1.9 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

New patch

  • _source/core/dom/element.js

     
    14791479                                }
    14801480                        }
    14811481
    1482                         return $ && new CKEDITOR.dom.document( $.contentWindow.document );
     1482                        return $ && $.contentWindow && new CKEDITOR.dom.document( $.contentWindow.document );
    14831483                },
    14841484
    14851485                /**
  • _source/core/editor.js

     
    465465                                                || getNewName();
    466466
    467467                        if ( this.name in CKEDITOR.instances )
    468                                 throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.';
     468                        {
     469                                // Check if the editor has been removed from the DOM
     470                                var previous = CKEDITOR.instances[ this.name ],
     471                                        container = previous.container.$;
     472                                while ( container && container!=document.body )
     473                                        container = container.parentNode;
    469474
     475                                // If it isn't in the document DOM, destroy it silently
     476                                if ( !container )
     477                                        previous.destroy( false );
     478                                else
     479                                        alert( '[CKEDITOR.editor] The instance "' + this.name + '" already exists.' );
     480                        }
    470481                        /**
    471482                         * A unique random string assigned to each editor instance on the page.
    472483                         * @name CKEDITOR.editor.prototype.id
  • _source/plugins/wysiwygarea/plugin.js

     
    10321032                                                                        xmlDeclaration = fullPage && editor.xmlDeclaration,
    10331033                                                                        doc = iframe.getFrameDocument();
    10341034
     1035                                                                if ( !doc )
     1036                                                                        return null;
     1037
    10351038                                                                var data = fullPage
    10361039                                                                        ? doc.getDocumentElement().getOuterHtml()
    10371040                                                                        : doc.getBody().getHtml();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy