Ticket #2780: 2780.patch
File 2780.patch, 4.2 KB (added by , 15 years ago) |
---|
-
_source/core/dtd.js
57 57 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}, 58 58 F = {ins:1,del:1,script:1}, 59 59 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), 61 61 I = X({p:1},H), 62 62 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}, 64 64 65 65 L = X({a:1},J), 66 66 M = {tr:1}, … … 106 106 * @type Object 107 107 * @example 108 108 */ 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}, 110 110 111 111 /** 112 112 * List of elements used inside the "table" element, like "tbody" or "td". … … 166 166 'var' : L, 167 167 div : P, 168 168 object : O, 169 embed : O, 169 170 sup : L, 170 171 dd : P, 171 172 strike : L, -
_source/plugins/fakeobjects/plugin.js
84 84 * @constructor 85 85 * @example 86 86 */ 87 CKEDITOR.plugins.fakeobjects = function( )87 CKEDITOR.plugins.fakeobjects = function( editor ) 88 88 { 89 89 this._ = 90 90 { 91 editor : editor, 91 92 objectTypes : [ 92 93 { 93 94 match : function( nodeName, attributes ) … … 144 145 { 145 146 var $ = element.$.cloneNode( true ), 146 147 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 ); 149 152 150 // Get the object's HTML code.151 temp.appendChild( $ );152 html = temp.innerHTML;153 154 153 // Get the fake element's CSS class. 155 154 var cssClass = 'unknown'; 156 155 var realElementType = element.getName(); 157 156 for ( var i = 0 ; i < this._.objectTypes.length ; i++ ) 158 157 { 159 if ( this._.objectTypes[i].match( element.getName(), element.$ ) )158 if ( this._.objectTypes[i].match( element.getName(), $ ) ) 160 159 { 161 160 cssClass = 'cke_fakeobject' + ' ' + this._.objectTypes[i].cssClass; 162 161 realElementType = this._.objectTypes[i].cssClass; … … 189 188 restoreElement : function( fakeImgElement ) 190 189 { 191 190 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 ); 193 192 194 193 if ( fakeImgElement.$.style.width ) 195 194 realElement.setStyle( 'width', fakeImgElement.$.style.width ); … … 417 416 { 418 417 init : function( editor, pluginPath ) 419 418 { 420 editor.fakeobjects = new CKEDITOR.plugins.fakeobjects( );419 editor.fakeobjects = new CKEDITOR.plugins.fakeobjects( editor ); 421 420 } 422 421 } ); 423 422 })();