Ticket #7915: 7915.patch
File 7915.patch, 3.8 KB (added by , 12 years ago) |
---|
-
_source/plugins/iframe/dialogs/iframe.js
35 35 value = this.getValue(); 36 36 if ( isRemove ) 37 37 iframeNode.removeAttribute( this.att || this.id ); 38 else if ( this.id == 'height' || this.id == 'width' ) 39 iframeNode.setStyle( this.id, value ); 38 40 else if ( isCheckbox ) 39 41 iframeNode.setAttribute( this.id, checkboxValues[ this.id ][ value ] ); 40 42 else -
_source/plugins/iframe/plugin.js
8 8 function createFakeElement( editor, realElement ) 9 9 { 10 10 var fakeElement = editor.createFakeParserElement( realElement, 'cke_iframe', 'iframe', true ), 11 fakeStyle = fakeElement.attributes.style || ''; 11 fakeStyle = fakeElement.attributes.style || '', 12 realStyle = new CKEDITOR.htmlParser.style( realElement.attributes.style ).rules; 12 13 13 var width = real Element.attributes.width,14 height = real Element.attributes.height;14 var width = realStyle && realStyle.width, 15 height = realStyle && realStyle.height; 15 16 16 17 if ( typeof width != 'undefined' ) 17 18 fakeStyle += 'width:' + CKEDITOR.tools.cssLength( width ) + ';'; -
_source/core/htmlparser/element.js
60 60 }; 61 61 }; 62 62 63 CKEDITOR.htmlParser.style = function( styleText ) 64 { 65 var rules = {}; 66 67 // html-encoded quote might be introduced by 'font-family' 68 // from MS-Word which confused the following regexp. e.g. 69 //'font-family: "Lucida, Console"' 70 ( styleText || '' ) 71 .replace( /"/g, '"' ) 72 .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, 73 function( match, name, value ) 74 { 75 name == 'font-family' && ( value = value.replace( /["']/g, '' ) ); 76 rules[ name.toLowerCase() ] = value; 77 }); 78 79 return { 80 rules : rules, 81 toString :function() 82 { 83 var output = []; 84 for ( var i in rules ) 85 output.push( i, ':', rules[ i], ';' ); 86 return output.join( '' ); 87 } 88 }; 89 }; 90 63 91 (function() 64 92 { 65 93 // Used to sort attribute entries in an array, where the first element of -
_source/plugins/fakeobjects/plugin.js
20 20 // the real element. 21 21 if ( realElement && element.attributes[ 'data-cke-resizable' ] ) 22 22 { 23 var style = element.attributes.style; 23 var style = new CKEDITOR.htmlParser.style( element.attributes.style ).rules, 24 width = style.width, 25 height = style.height; 24 26 25 if ( style ) 26 { 27 // Get the width from the style. 28 var match = /(?:^|\s)width\s*:\s*(.*?)(:?;|$)/i.exec( style ), 29 width = match && match[1]; 27 var realStyle = new CKEDITOR.htmlParser.style( realElement.attributes.style ); 30 28 31 // Get the height from the style. 32 match = /(?:^|\s)height\s*:\s*(.*?)(:?;|$)/i.exec( style ); 33 var height = match && match[1]; 34 35 if ( width ) 36 realElement.attributes.width = width; 37 38 if ( height ) 39 realElement.attributes.height = height; 40 } 41 } 29 width && ( realStyle.rules.width = width ); 30 height && ( realStyle.rules.height = height ); 31 realElement.attributes.style = realStyle.toString(); 32 } 42 33 43 34 return realElement; 44 35 }