Ticket #2780: 2780.patch

File 2780.patch, 4.2 KB (added by Martin Kou, 15 years ago)
  • _source/core/dtd.js

     
    5757                E = {hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},
    5858                F = {ins:1,del:1,script:1},
    5959                G = X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F),
    60                 H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G),
     60                H = X({sub:1,img:1,object:1,embed:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G),
    6161                I = X({p:1},H),
    6262                J = X({iframe:1},H,B),
    63                 K = {img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},
     63                K = {img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,embed:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},
    6464
    6565                L = X({a:1},J),
    6666                M = {tr:1},
     
    106106                 * @type Object
    107107                 * @example
    108108                 */
    109                 $tabIndex : {a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},
     109                $tabIndex : {a:1,area:1,button:1,input:1,object:1,embed:1,select:1,textarea:1},
    110110
    111111                /**
    112112                 * List of elements used inside the "table" element, like "tbody" or "td".
     
    166166        'var' : L,
    167167        div : P,
    168168        object : O,
     169                embed : O,
    169170        sup : L,
    170171        dd : P,
    171172        strike : L,
  • _source/plugins/fakeobjects/plugin.js

     
    8484         * @constructor
    8585         * @example
    8686         */
    87         CKEDITOR.plugins.fakeobjects = function()
     87        CKEDITOR.plugins.fakeobjects = function( editor )
    8888        {
    8989                this._ =
    9090                {
     91                        editor : editor,
    9192                        objectTypes : [
    9293                                {
    9394                                        match : function( nodeName, attributes )
     
    144145                {
    145146                        var $ = element.$.cloneNode( true ),
    146147                                doc = $.ownerDocument,
    147                                 temp = doc.createElement( 'div' ),
    148                                 html;
     148                                html, tmp = new CKEDITOR.dom.element( 'div', new CKEDITOR.dom.document( doc ) );
     149                        element = new CKEDITOR.dom.element( $ );
     150                        element.appendTo( tmp );
     151                        html = this._.editor.dataProcessor.toDataFormat( tmp );
    149152
    150                         // Get the object's HTML code.
    151                         temp.appendChild( $ );
    152                         html = temp.innerHTML;
    153 
    154153                        // Get the fake element's CSS class.
    155154                        var cssClass = 'unknown';
    156155                        var realElementType = element.getName();
    157156                        for ( var i = 0 ; i < this._.objectTypes.length ; i++ )
    158157                        {
    159                                 if ( this._.objectTypes[i].match( element.getName(), element.$ ) )
     158                                if ( this._.objectTypes[i].match( element.getName(), $ ) )
    160159                                {
    161160                                        cssClass = 'cke_fakeobject' + ' ' + this._.objectTypes[i].cssClass;
    162161                                        realElementType = this._.objectTypes[i].cssClass;
     
    189188                restoreElement : function( fakeImgElement )
    190189                {
    191190                        var html = decodeURIComponent( fakeImgElement.getAttribute( '_cke_protected_html' ) ),
    192                                 realElement = CKEDITOR.dom.element.createFromHtml( html, editor.document );
     191                                realElement = CKEDITOR.dom.element.createFromHtml( html, this._.editor.document );
    193192
    194193                        if ( fakeImgElement.$.style.width )
    195194                                realElement.setStyle( 'width', fakeImgElement.$.style.width );
     
    417416                {
    418417                        init : function( editor, pluginPath )
    419418                        {
    420                                 editor.fakeobjects = new CKEDITOR.plugins.fakeobjects();
     419                                editor.fakeobjects = new CKEDITOR.plugins.fakeobjects( editor );
    421420                        }
    422421                } );
    423422})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy