Ticket #7915: 7915_3.patch

File 7915_3.patch, 21.6 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/iframe/dialogs/iframe.js

     
    3535                        value = this.getValue();
    3636                if ( isRemove )
    3737                        iframeNode.removeAttribute( this.att || this.id );
     38                else if ( this.id == 'height' || this.id == 'width' )
     39                        iframeNode.setStyle( this.id, value );
     40                else if ( this.id == 'height' || this.id == 'width' )
     41                        iframeNode.setStyle( this.id, value );
    3842                else if ( isCheckbox )
    3943                        iframeNode.setAttribute( this.id, checkboxValues[ this.id ][ value ] );
    4044                else
     
    8387                                        var iframeNode = editor.restoreRealElement( fakeImage );
    8488                                        this.iframeNode = iframeNode;
    8589
    86                                         this.setupContent( iframeNode, fakeImage );
     90                                        this.setupContent( iframeNode );
    8791                                }
    88 
    89                                 // Call the onChange method for the widht and height fields so
    90                                 // they get reflected into the Advanced tab.
    91                                 var widthInput = this.getContentElement( 'info', 'width' ),
    92                                         heightInput = this.getContentElement( 'info', 'height' );
    93                                 widthInput && widthInput.onChange();
    94                                 heightInput && heightInput.onChange();
    9592                        },
    9693                        onOk : function()
    9794                        {
     
    154151                                                                        label : commonLang.width,
    155152                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    156153                                                                        getValue : defaultToPixel,
    157                                                                         setup : function( iframeNode, fakeImage )
    158                                                                         {
    159                                                                                 loadValue.apply( this, arguments );
    160                                                                                 fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
    161                                                                         },
     154                                                                        setup : loadValue,
    162155                                                                        commit : function( iframeNode, extraStyles )
    163156                                                                        {
    164157                                                                                commitValue.apply( this, arguments );
     
    180173                                                                        label : commonLang.height,
    181174                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    182175                                                                        getValue : defaultToPixel,
    183                                                                         setup : function( iframeNode, fakeImage )
    184                                                                         {
    185                                                                                 loadValue.apply( this, arguments );
    186                                                                                 fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
    187                                                                         },
     176                                                                        setup : loadValue,
    188177                                                                        commit : function( iframeNode, extraStyles )
    189178                                                                        {
    190179                                                                                commitValue.apply( this, arguments );
  • _source/plugins/flash/plugin.js

     
    77{
    88        var flashFilenameRegex = /\.swf(?:$|\?)/i;
    99
    10         var cssifyLength = CKEDITOR.tools.cssLength;
    11 
    1210        function isFlashEmbed( element )
    1311        {
    1412                var attributes = element.attributes;
     
    1816
    1917        function createFakeElement( editor, realElement )
    2018        {
    21                 var fakeElement = editor.createFakeParserElement( realElement, 'cke_flash', 'flash', true ),
    22                         fakeStyle = fakeElement.attributes.style || '';
    23 
    24                 var width = realElement.attributes.width,
    25                         height = realElement.attributes.height;
    26 
    27                 if ( typeof width != 'undefined' )
    28                         fakeStyle = fakeElement.attributes.style = fakeStyle + 'width:' + cssifyLength( width ) + ';';
    29 
    30                 if ( typeof height != 'undefined' )
    31                         fakeStyle = fakeElement.attributes.style = fakeStyle + 'height:' + cssifyLength( height ) + ';';
    32 
    33                 return fakeElement;
     19                return editor.createFakeParserElement( realElement, 'cke_flash', 'flash', true );
    3420        }
    3521
    3622        CKEDITOR.plugins.add( 'flash',
     
    9480                afterInit : function( editor )
    9581                {
    9682                        var dataProcessor = editor.dataProcessor,
    97                                 dataFilter = dataProcessor && dataProcessor.dataFilter;
     83                                dataFilter = dataProcessor && dataProcessor.dataFilter,
     84                                htmlFilter = dataProcessor && dataProcessor.htmlFilter;
    9885
    9986                        if ( dataFilter )
    10087                        {
     
    136123                                                }
    137124                                        },
    138125                                        5);
    139                         }
     126
     127                                // Align embed and object dimensions.
     128                                htmlFilter.addRules(
     129                                        {
     130                                                elements : {
     131                                                        'embed' : function( element )
     132                                                        {
     133                                                                if ( isFlashEmbed( element ) && element.parent.name == 'object' )
     134                                                                {
     135                                                                        var object = element.parent,
     136                                                                                objStyles = new CKEDITOR.htmlParser.cssStyle( object ).rules,
     137                                                                                embedStyle = new CKEDITOR.htmlParser.cssStyle( element );
     138
     139                                                                        embedStyle.rules.width = objStyles.width;
     140                                                                        embedStyle.rules.height = objStyles.height;
     141                                                                        element.attributes.style = String( embedStyle );
     142                                                                }
     143                                                        }
     144                                                }
     145                                        });
     146                        }
    140147                },
    141148
    142149                requires : [ 'fakeobjects' ]
  • _source/plugins/dialogadvtab/plugin.js

     
    1919function commitAdvParams()
    2020{
    2121        // Dialogs may use different parameters in the commit list, so, by
    22         // definition, we take the first CKEDITOR.dom.element available.
     22        // definition, we take all CKEDITOR.dom.element available.
    2323        var element;
    2424
    2525        for ( var i = 0 ; i < arguments.length ; i++ )
    2626        {
    27                 if ( arguments[ i ] instanceof CKEDITOR.dom.element )
     27                if ( ( element = arguments[ i ] ) instanceof CKEDITOR.dom.element )
    2828                {
    29                         element = arguments[ i ];
    30                         break;
    31                 }
    32         }
    33 
    34         if ( element )
    35         {
    36                 var attrName = this.att,
    37                         value = this.getValue();
     29                        var attrName = this.att,
     30                                value = this.getValue();
    3831
    39                 if ( value )
    40                         element.setAttribute( attrName, value );
    41                 else
    42                         element.removeAttribute( attrName, value );
    43         }
    44 }
     32                        if ( value )
     33                                element.setAttribute( attrName, value );
     34                        else
     35                                element.removeAttribute( attrName, value );
     36                }
     37        }
     38}
    4539
    4640CKEDITOR.plugins.add( 'dialogadvtab',
    4741{
     
    200194                                });
    201195                }
    202196
     197                if ( tabConfig.title )
     198                {
     199                        contents = [];
     200
     201                        contents.push(
     202                                {
     203                                        id : 'txtGenTitle',
     204                                        att : 'title',
     205                                        type : 'text',
     206                                        label : editor.lang.common.advisoryTitle,
     207                                        'default' : '',
     208                                        setup : setupAdvParams,
     209                                        commit : commitAdvParams
     210                                });
     211
     212                        result.elements[ 0 ].children.push(
     213                                {
     214                                        type : 'hbox',
     215                                        widths : [ '50%', '50%' ],
     216                                        children : contents
     217                                });
     218                }
     219
    203220                return result;
    204221        }
    205222});
  • _source/plugins/iframe/plugin.js

     
    1 /*
     1/*
    22Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
    55
    66(function()
    77{
    8         function createFakeElement( editor, realElement )
    9         {
    10                 var fakeElement = editor.createFakeParserElement( realElement, 'cke_iframe', 'iframe', true ),
    11                         fakeStyle = fakeElement.attributes.style || '';
    12 
    13                 var width = realElement.attributes.width,
    14                         height = realElement.attributes.height;
    15 
    16                 if ( typeof width != 'undefined' )
    17                         fakeStyle += 'width:' + CKEDITOR.tools.cssLength( width ) + ';';
    18 
    19                 if ( typeof height != 'undefined' )
    20                         fakeStyle += 'height:' + CKEDITOR.tools.cssLength( height ) + ';';
    21 
    22                 fakeElement.attributes.style = fakeStyle;
    23 
    24                 return fakeElement;
    25         }
    26 
    278        CKEDITOR.plugins.add( 'iframe',
    289        {
    2910                requires : [ 'dialog', 'fakeobjects' ],
     
    9677                                        {
    9778                                                iframe : function( element )
    9879                                                {
    99                                                         return createFakeElement( editor, element );
     80                                                        return editor.createFakeParserElement( element, 'cke_iframe', 'iframe', true );
    10081                                                }
    10182                                        }
    10283                                });
  • _source/plugins/flash/dialogs/flash.js

     
    2020         */
    2121        var ATTRTYPE_OBJECT = 1,
    2222                ATTRTYPE_PARAM = 2,
    23                 ATTRTYPE_EMBED = 4;
     23                STYLE_OBJECT = 3,
     24                ATTRTYPE_EMBED = 4,
     25                STYLE_EMBED = 5;
    2426
    2527        var attributesMap =
    2628        {
     
    3133                src : [ { type : ATTRTYPE_PARAM, name : 'movie' }, { type : ATTRTYPE_EMBED, name : 'src' }, { type : ATTRTYPE_OBJECT, name :  'data' } ],
    3234                name : [ { type : ATTRTYPE_EMBED, name : 'name' } ],
    3335                align : [ { type : ATTRTYPE_OBJECT, name : 'align' } ],
    34                 title : [ { type : ATTRTYPE_OBJECT, name : 'title' }, { type : ATTRTYPE_EMBED, name : 'title' } ],
    35                 'class' : [ { type : ATTRTYPE_OBJECT, name : 'class' }, { type : ATTRTYPE_EMBED, name : 'class'} ],
    36                 width : [ { type : ATTRTYPE_OBJECT, name : 'width' }, { type : ATTRTYPE_EMBED, name : 'width' } ],
    37                 height : [ { type : ATTRTYPE_OBJECT, name : 'height' }, { type : ATTRTYPE_EMBED, name : 'height' } ],
     36                width : [ { type : STYLE_OBJECT, name : 'width' }, { type : STYLE_EMBED, name : 'width' } ],
     37                height : [ { type : STYLE_OBJECT, name : 'height' }, { type : STYLE_EMBED, name : 'height' } ],
    3838                hSpace : [ { type : ATTRTYPE_OBJECT, name : 'hSpace' }, { type : ATTRTYPE_EMBED, name : 'hSpace' } ],
    3939                vSpace : [ { type : ATTRTYPE_OBJECT, name : 'vSpace' }, { type : ATTRTYPE_EMBED, name : 'vSpace' } ],
    40                 style : [ { type : ATTRTYPE_OBJECT, name : 'style' }, { type : ATTRTYPE_EMBED, name : 'style' } ],
    4140                type : [ { type : ATTRTYPE_EMBED, name : 'type' } ]
    4241        };
    4342
     
    167166                                                embedNode.removeAttribute( attrDef.name );
    168167                                        else
    169168                                                embedNode.setAttribute( attrDef.name, value );
     169                                        break;
     170                                case STYLE_EMBED:
     171                                case STYLE_OBJECT:
     172                                        var target = attrDef.type == STYLE_OBJECT ? objectNode : embedNode;
     173                                        target.setStyle( attrDef.name, this.getValue() );
    170174                        }
    171175                }
    172176        }
    173177
    174178        CKEDITOR.dialog.add( 'flash', function( editor )
    175179        {
     180                var advtab = editor.plugins.dialogadvtab;
    176181                var makeObjectTag = !editor.config.flashEmbedTagOnly,
    177182                        makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly;
    178183
     
    185190                        title : editor.lang.flash.title,
    186191                        minWidth : 420,
    187192                        minHeight : 310,
     193                        onLoad : function()
     194                        {
     195                                var dialog = this,
     196                                        styles = dialog.getContentElement( 'advanced', 'advStyles' );
     197
     198                                styles && styles.on( 'change', function()
     199                                        {
     200                                                // Synchronize width value.
     201                                                var width = this.getStyle( 'width', '' ),
     202                                                        txtWidth = dialog.getContentElement( 'info', 'width' );
     203
     204                                                txtWidth && txtWidth.setValue( width, true );
     205
     206                                                // Synchronize height value.
     207                                                var height = this.getStyle( 'height', '' ),
     208                                                        txtHeight = dialog.getContentElement( 'info', 'height' );
     209
     210                                                txtHeight && txtHeight.setValue( height, true );
     211                                        });
     212                        },
    188213                        onShow : function()
    189214                        {
    190215                                // Clear previously saved elements.
     
    370395                                                                        style : 'width:95px',
    371396                                                                        label : editor.lang.common.width,
    372397                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
     398                                                                        getValue : CKEDITOR.tools.cssLength,
    373399                                                                        setup : function( objectNode, embedNode, paramMap, fakeImage )
    374400                                                                        {
    375401                                                                                loadValue.apply( this, arguments );
     
    380406                                                                                commitValue.apply( this, arguments );
    381407                                                                                var val = this.getValue();
    382408                                                                                val && ( extraStyles.width = defaultToPixel( val ) );
     409                                                                        },
     410                                                                        onChange : function()
     411                                                                        {
     412                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     413                                                                                        value = this.getValue();
     414                                                                                styles && styles.updateStyle( 'width', value );
    383415                                                                        }
    384416                                                                },
    385417                                                                {
     
    387419                                                                        id : 'height',
    388420                                                                        style : 'width:95px',
    389421                                                                        label : editor.lang.common.height,
     422                                                                        getValue : CKEDITOR.tools.cssLength,
    390423                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    391424                                                                        setup : function( objectNode, embedNode, paramMap, fakeImage )
    392425                                                                        {
     
    398431                                                                                commitValue.apply( this, arguments );
    399432                                                                                var val = this.getValue();
    400433                                                                                val && ( extraStyles.height = defaultToPixel( val ) );
     434                                                                        },
     435                                                                        onChange : function()
     436                                                                        {
     437                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     438                                                                                        value = this.getValue();
     439                                                                                styles && styles.updateStyle( 'height', value );
    401440                                                                        }
    402441                                                                },
    403442                                                                {
     
    629668                                                }
    630669                                        ]
    631670                                },
    632                                 {
    633                                         id : 'advanced',
    634                                         label : editor.lang.common.advancedTab,
    635                                         elements :
    636                                         [
    637                                                 {
    638                                                         type : 'hbox',
    639                                                         widths : [ '45%', '55%' ],
    640                                                         children :
    641                                                         [
    642                                                                 {
    643                                                                         type : 'text',
    644                                                                         id : 'id',
    645                                                                         label : editor.lang.common.id,
    646                                                                         setup : loadValue,
    647                                                                         commit : commitValue
    648                                                                 },
    649                                                                 {
    650                                                                         type : 'text',
    651                                                                         id : 'title',
    652                                                                         label : editor.lang.common.advisoryTitle,
    653                                                                         setup : loadValue,
    654                                                                         commit : commitValue
    655                                                                 }
    656                                                         ]
    657                                                 },
    658                                                 {
    659                                                         type : 'hbox',
    660                                                         widths : [ '45%', '55%' ],
    661                                                         children :
    662                                                         [
    663                                                                 {
    664                                                                         type : 'text',
    665                                                                         id : 'bgcolor',
    666                                                                         label : editor.lang.flash.bgcolor,
    667                                                                         setup : loadValue,
    668                                                                         commit : commitValue
    669                                                                 },
    670                                                                 {
    671                                                                         type : 'text',
    672                                                                         id : 'class',
    673                                                                         label : editor.lang.common.cssClass,
    674                                                                         setup : loadValue,
    675                                                                         commit : commitValue
    676                                                                 }
    677                                                         ]
    678                                                 },
    679                                                 {
    680                                                         type : 'text',
    681                                                         id : 'style',
    682                                                         label : editor.lang.common.cssStyle,
    683                                                         setup : loadValue,
    684                                                         commit : commitValue
    685                                                 }
    686                                         ]
    687                                 }
    688                         ]
     671                                advtab && advtab.createAdvancedTab( editor, { id:1, title:1, classes:1, styles:1 } )
     672                        ]
    689673                };
    690674        } );
    691675})();
  • _source/core/htmlparser/element.js

     
    6060        };
    6161};
    6262
     63/**
     64 *  Object presentation of  CSS style declaration text.
     65 *  @param {CKEDITOR.htmlParser.element|String} elementOrStyleText A html parser element or the inline style text.
     66 */
     67CKEDITOR.htmlParser.cssStyle = function()
     68{
     69         var styleText, arg = arguments[ 0 ],rules = {};
     70        styleText = arg instanceof CKEDITOR.htmlParser.element ? arg.attributes.style : arg;
     71
     72   // html-encoded quote might be introduced by 'font-family'
     73   // from MS-Word which confused the following regexp. e.g.
     74   //'font-family: &quot;Lucida, Console&quot;'
     75   ( styleText || '' )
     76           .replace( /&quot;/g, '"' )
     77           .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
     78                        function( match, name, value )
     79                        {
     80                                name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
     81                                rules[ name.toLowerCase() ] = value;
     82                        });
     83
     84        return {
     85                rules : rules,
     86                toString :function()
     87                {
     88                        var output = [];
     89                        for ( var i in rules )
     90                                rules[ i ] && output.push( i, ':', rules[ i ], ';' );
     91                        return output.join( '' );
     92                }
     93        };
     94};
     95
    6396(function()
    6497{
    6598        // Used to sort attribute entries in an array, where the first element of
  • _source/plugins/fakeobjects/plugin.js

     
    1 /*
     1/*
    22Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
    55
    66(function()
    77{
     8        var CssStyle = CKEDITOR.htmlParser.cssStyle;
    89        var htmlFilterRules =
    910        {
    1011                elements :
     
    1617                                        realFragment = realHtml && new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( realHtml ) ),
    1718                                        realElement = realFragment && realFragment.children[ 0 ];
    1819
    19                                 // If we have width/height in the element, we must move it into
    20                                 // the real element.
     20                                // Width/height in the fake object are subjected to clone into the real element.
    2121                                if ( realElement && element.attributes[ 'data-cke-resizable' ] )
    2222                                {
    23                                         var style = element.attributes.style;
     23                                        var styles = new CssStyle( element ).rules,
     24                                                realStyle = new CssStyle( realElement ),
     25                                                width = styles.width,
     26                                                height = styles.height;
    2427
    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];
    30 
    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                                 }
     28                                        width && ( realStyle.rules.width = width );
     29                                        height && ( realStyle.rules.height = height );
     30                                        realElement.attributes.style = String( realStyle );
     31                                }
    4232
    4333                                return realElement;
    4434                        }
     
    5848                                htmlFilter.addRules( htmlFilterRules );
    5949                }
    6050        });
    61 })();
    6251
    63 CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
    64 {
    65         var lang = this.lang.fakeobjects,
    66                 label = lang[ realElementType ] || lang.unknown;
     52        CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
     53        {
     54                var lang = this.lang.fakeobjects,
     55                        label = lang[ realElementType ] || lang.unknown;
    6756
    68         var attributes =
    69         {
    70                 'class' : className,
    71                 src : CKEDITOR.getUrl( 'images/spacer.gif' ),
    72                 'data-cke-realelement' : encodeURIComponent( realElement.getOuterHtml() ),
    73                 'data-cke-real-node-type' : realElement.type,
    74                 alt : label,
    75                 title : label,
    76                 align : realElement.getAttribute( 'align' ) || ''
    77         };
     57                var attributes =
     58                {
     59                        'class' : className,
     60                        src : CKEDITOR.getUrl( 'images/spacer.gif' ),
     61                        'data-cke-realelement' : encodeURIComponent( realElement.getOuterHtml() ),
     62                        'data-cke-real-node-type' : realElement.type,
     63                        alt : label,
     64                        title : label,
     65                        align : realElement.getAttribute( 'align' ) || ''
     66                };
    7867
    79         if ( realElementType )
    80                 attributes[ 'data-cke-real-element-type' ] = realElementType;
     68                if ( realElementType )
     69                        attributes[ 'data-cke-real-element-type' ] = realElementType;
    8170
    82         if ( isResizable )
    83                 attributes[ 'data-cke-resizable' ] = isResizable;
     71                if ( isResizable )
     72                        attributes[ 'data-cke-resizable' ] = isResizable;
    8473
    85         return this.document.createElement( 'img', { attributes : attributes } );
    86 };
     74                return this.document.createElement( 'img', { attributes : attributes } );
     75        };
    8776
    88 CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
    89 {
    90         var lang = this.lang.fakeobjects,
    91                 label = lang[ realElementType ] || lang.unknown,
    92                 html;
     77        CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
     78        {
     79                var lang = this.lang.fakeobjects,
     80                        label = lang[ realElementType ] || lang.unknown,
     81                        html;
    9382
    94         var writer = new CKEDITOR.htmlParser.basicWriter();
    95         realElement.writeHtml( writer );
    96         html = writer.getHtml();
     83                var writer = new CKEDITOR.htmlParser.basicWriter();
     84                realElement.writeHtml( writer );
     85                html = writer.getHtml();
    9786
    98         var attributes =
    99         {
    100                 'class' : className,
    101                 src : CKEDITOR.getUrl( 'images/spacer.gif' ),
    102                 'data-cke-realelement' : encodeURIComponent( html ),
    103                 'data-cke-real-node-type' : realElement.type,
    104                 alt : label,
    105                 title : label,
    106                 align : realElement.attributes.align || ''
    107         };
     87                var attributes =
     88                {
     89                        'class' : className,
     90                        src : CKEDITOR.getUrl( 'images/spacer.gif' ),
     91                        'data-cke-realelement' : encodeURIComponent( html ),
     92                        'data-cke-real-node-type' : realElement.type,
     93                        alt : label,
     94                        title : label,
     95                        align : realElement.attributes.align || ''
     96                };
    10897
    109         if ( realElementType )
    110                 attributes[ 'data-cke-real-element-type' ] = realElementType;
     98                if ( realElementType )
     99                        attributes[ 'data-cke-real-element-type' ] = realElementType;
    111100
    112         if ( isResizable )
    113                 attributes[ 'data-cke-resizable' ] = isResizable;
     101                if ( isResizable )
     102                {
     103                        attributes[ 'data-cke-resizable' ] = isResizable;
     104                        var fakeStyle = new CssStyle(),
     105                        realStyles = new CssStyle( realElement ).rules;
    114106
    115         return new CKEDITOR.htmlParser.element( 'img', attributes );
    116 };
     107                        var width = realStyles.width,
     108                                height = realStyles.height;
     109
     110                        width != undefined && ( fakeStyle.rules.width = width );
     111                        height != undefined && ( fakeStyle.rules.height = height );
     112                        attributes.style = String( fakeStyle );
     113                }
     114
     115                return new CKEDITOR.htmlParser.element( 'img', attributes );
     116        };
    117117
    118 CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
    119 {
    120         if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
    121                 return null;
     118        CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
     119        {
     120                if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
     121                        return null;
    122122
    123         return CKEDITOR.dom.element.createFromHtml(
    124                 decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
    125                 this.document );
    126 };
     123                var element = CKEDITOR.dom.element.createFromHtml(
     124                        decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
     125                        this.document );
     126
     127                if ( fakeElement.data( 'cke-resizable') )
     128                {
     129                        var width = fakeElement.getStyle( 'width' ),
     130                                height = fakeElement.getStyle( 'height' );
     131
     132                        width != undefined && element.setStyle( 'width', width );
     133                        height != undefined && element.setStyle( 'height', height );
     134                }
     135               
     136                return element;
     137        }
     138
     139})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy