Ticket #7915: 7915_4.patch

File 7915_4.patch, 21.8 KB (added by Sa'ar Zac Elias, 12 years ago)
  • _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 arg = arguments[ 0 ],
     70                styleText = arg instanceof CKEDITOR.htmlParser.element ? arg.attributes.style : arg,
     71                rules = {};
     72
     73        // html-encoded quote might be introduced by 'font-family'
     74        // from MS-Word which confused the following regexp. e.g.
     75        //'font-family: "Lucida, Console"'
     76        ( styleText || '' )
     77                .replace( /"/g, '"' )
     78                .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
     79                        function( match, name, value )
     80                        {
     81                                name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
     82                                rules[ name.toLowerCase() ] = value;
     83                        });
     84
     85        return {
     86                rules : rules,
     87                toString :function()
     88                {
     89                        var output = [];
     90                        for ( var i in rules )
     91                                rules[ i ] && output.push( i, ':', rules[ i ], ';' );
     92                        return output.join( '' );
     93                }
     94        };
     95};
     96
    6397(function()
    6498{
    6599        // Used to sort attribute entries in an array, where the first element of
  • _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;
     29                        var attrName = this.att,
     30                                value = this.getValue();
     31
     32                        value ? element.setAttribute( attrName, value ) : element.removeAttribute( attrName );
    3133                }
    3234        }
    33 
    34         if ( element )
    35         {
    36                 var attrName = this.att,
    37                         value = this.getValue();
    38 
    39                 if ( value )
    40                         element.setAttribute( attrName, value );
    41                 else
    42                         element.removeAttribute( attrName, value );
    43         }
    4435}
    4536
    4637CKEDITOR.plugins.add( 'dialogadvtab',
     
    200191                                });
    201192                }
    202193
     194                if ( tabConfig.title )
     195                {
     196                        result.elements[ 0 ].children.push(
     197                                {
     198                                        type : 'hbox',
     199                                        widths : [ '50%', '50%' ],
     200                                        children :
     201                                        [
     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                                });
     213                }
     214
    203215                return result;
    204216        }
    205217});
  • _source/plugins/fakeobjects/plugin.js

     
    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,
     27                                                styleStr;
    2428
    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                                         }
     29                                        width && ( realStyle.rules.width = width );
     30                                        height && ( realStyle.rules.height = height );
     31                                        if ( ( styleStr = String( realStyle ) ) )
     32                                                realElement.attributes.style = styleStr;
    4133                                }
    4234
    4335                                return realElement;
     
    5850                                htmlFilter.addRules( htmlFilterRules );
    5951                }
    6052        });
    61 })();
    6253
    63 CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
    64 {
    65         var lang = this.lang.fakeobjects,
    66                 label = lang[ realElementType ] || lang.unknown;
     54        CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable )
     55        {
     56                var lang = this.lang.fakeobjects,
     57                        label = lang[ realElementType ] || lang.unknown;
    6758
    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' ) || ''
     59                var attributes =
     60                {
     61                        'class' : className,
     62                        src : CKEDITOR.getUrl( 'images/spacer.gif' ),
     63                        'data-cke-realelement' : encodeURIComponent( realElement.getOuterHtml() ),
     64                        'data-cke-real-node-type' : realElement.type,
     65                        alt : label,
     66                        title : label,
     67                        align : realElement.getAttribute( 'align' ) || ''
     68                };
     69
     70                if ( realElementType )
     71                        attributes[ 'data-cke-real-element-type' ] = realElementType;
     72
     73                if ( isResizable )
     74                        attributes[ 'data-cke-resizable' ] = isResizable;
     75
     76                return this.document.createElement( 'img', { attributes : attributes } );
    7777        };
    7878
    79         if ( realElementType )
    80                 attributes[ 'data-cke-real-element-type' ] = realElementType;
     79        CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
     80        {
     81                var lang = this.lang.fakeobjects,
     82                        label = lang[ realElementType ] || lang.unknown,
     83                        html;
    8184
    82         if ( isResizable )
    83                 attributes[ 'data-cke-resizable' ] = isResizable;
     85                var writer = new CKEDITOR.htmlParser.basicWriter();
     86                realElement.writeHtml( writer );
     87                html = writer.getHtml();
    8488
    85         return this.document.createElement( 'img', { attributes : attributes } );
    86 };
     89                var attributes =
     90                {
     91                        'class' : className,
     92                        src : CKEDITOR.getUrl( 'images/spacer.gif' ),
     93                        'data-cke-realelement' : encodeURIComponent( html ),
     94                        'data-cke-real-node-type' : realElement.type,
     95                        alt : label,
     96                        title : label,
     97                        align : realElement.attributes.align || ''
     98                };
    8799
    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;
     100                if ( realElementType )
     101                        attributes[ 'data-cke-real-element-type' ] = realElementType;
    93102
    94         var writer = new CKEDITOR.htmlParser.basicWriter();
    95         realElement.writeHtml( writer );
    96         html = writer.getHtml();
     103                if ( isResizable )
     104                {
     105                        attributes[ 'data-cke-resizable' ] = isResizable;
     106                        var fakeStyle = new cssStyle(),
     107                                realStyles = new cssStyle( realElement ).rules;
    97108
    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 || ''
     109                        var width = realStyles.width || CKEDITOR.tools.cssLength( realElement.attributes.width || '' ),
     110                                height = realStyles.height || CKEDITOR.tools.cssLength( realElement.attributes.height || '' ),
     111                                styleStr;
     112
     113                        width != undefined && ( fakeStyle.rules.width = width );
     114                        height != undefined && ( fakeStyle.rules.height = height );
     115                        if ( ( styleStr = String( fakeStyle ) ) )
     116                                attributes.style = styleStr;
     117                }
     118
     119                return new CKEDITOR.htmlParser.element( 'img', attributes );
    107120        };
    108121
    109         if ( realElementType )
    110                 attributes[ 'data-cke-real-element-type' ] = realElementType;
     122        CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
     123        {
     124                if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
     125                        return null;
    111126
    112         if ( isResizable )
    113                 attributes[ 'data-cke-resizable' ] = isResizable;
     127                var element = CKEDITOR.dom.element.createFromHtml(
     128                        decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
     129                        this.document );
    114130
    115         return new CKEDITOR.htmlParser.element( 'img', attributes );
    116 };
     131                if ( fakeElement.data( 'cke-resizable' ) )
     132                {
     133                        var width = fakeElement.getStyle( 'width' ),
     134                                height = fakeElement.getStyle( 'height' );
    117135
    118 CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
    119 {
    120         if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
    121                 return null;
     136                        width != undefined && element.setStyle( 'width', width );
     137                        height != undefined && element.setStyle( 'height', height );
     138                }
     139               
     140                return element;
     141        }
    122142
    123         return CKEDITOR.dom.element.createFromHtml(
    124                 decodeURIComponent( fakeElement.data( 'cke-realelement' ) ),
    125                 this.document );
    126 };
     143})();
  • _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 && 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 );
     
    378404                                                                        commit : function( objectNode, embedNode, paramMap, extraStyles )
    379405                                                                        {
    380406                                                                                commitValue.apply( this, arguments );
     407
     408                                                                                objectNode && objectNode.removeAttribute( 'width' );
     409                                                                                embedNode && embedNode.removeAttribute( 'width' );
     410
    381411                                                                                var val = this.getValue();
    382412                                                                                val && ( extraStyles.width = defaultToPixel( val ) );
     413                                                                        },
     414                                                                        onChange : function()
     415                                                                        {
     416                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     417                                                                                        value = this.getValue();
     418                                                                                styles && styles.updateStyle( 'width', value );
    383419                                                                        }
    384420                                                                },
    385421                                                                {
     
    387423                                                                        id : 'height',
    388424                                                                        style : 'width:95px',
    389425                                                                        label : editor.lang.common.height,
     426                                                                        getValue : CKEDITOR.tools.cssLength,
    390427                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    391428                                                                        setup : function( objectNode, embedNode, paramMap, fakeImage )
    392429                                                                        {
     
    396433                                                                        commit : function( objectNode, embedNode, paramMap, extraStyles )
    397434                                                                        {
    398435                                                                                commitValue.apply( this, arguments );
     436
     437                                                                                objectNode && objectNode.removeAttribute( 'height' );
     438                                                                                embedNode && embedNode.removeAttribute( 'height' );
     439
    399440                                                                                var val = this.getValue();
    400441                                                                                val && ( extraStyles.height = defaultToPixel( val ) );
     442                                                                        },
     443                                                                        onChange : function()
     444                                                                        {
     445                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     446                                                                                        value = this.getValue();
     447                                                                                styles && styles.updateStyle( 'height', value );
    401448                                                                        }
    402449                                                                },
    403450                                                                {
     
    629676                                                }
    630677                                        ]
    631678                                },
    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                                 }
     679                                advtab && advtab.createAdvancedTab( editor, { id:1, title:1, classes:1, styles:1 } )
    688680                        ]
    689681                };
    690682        } );
  • _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);
     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                                                                                styleStr;
     139
     140                                                                        embedStyle.rules.width = objStyles.width;
     141                                                                        embedStyle.rules.height = objStyles.height;
     142
     143                                                                        if ( ( styleStr = String( embedStyle ) ) )
     144                                                                                element.attributes.style = styleStr;
     145                                                                }
     146                                                        }
     147                                                }
     148                                        });
    139149                        }
    140150                },
    141151
  • _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 );
    3840                else if ( isCheckbox )
    3941                        iframeNode.setAttribute( this.id, checkboxValues[ this.id ][ value ] );
    4042                else
     
    8385                                        var iframeNode = editor.restoreRealElement( fakeImage );
    8486                                        this.iframeNode = iframeNode;
    8587
    86                                         this.setupContent( iframeNode, fakeImage );
     88                                        this.setupContent( iframeNode );
    8789                                }
    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();
    9590                        },
    9691                        onOk : function()
    9792                        {
     
    154149                                                                        label : commonLang.width,
    155150                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    156151                                                                        getValue : defaultToPixel,
    157                                                                         setup : function( iframeNode, fakeImage )
    158                                                                         {
    159                                                                                 loadValue.apply( this, arguments );
    160                                                                                 fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
    161                                                                         },
     152                                                                        setup : loadValue,
    162153                                                                        commit : function( iframeNode, extraStyles )
    163154                                                                        {
    164155                                                                                commitValue.apply( this, arguments );
     
    180171                                                                        label : commonLang.height,
    181172                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    182173                                                                        getValue : defaultToPixel,
    183                                                                         setup : function( iframeNode, fakeImage )
    184                                                                         {
    185                                                                                 loadValue.apply( this, arguments );
    186                                                                                 fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
    187                                                                         },
     174                                                                        setup : loadValue,
    188175                                                                        commit : function( iframeNode, extraStyles )
    189176                                                                        {
    190177                                                                                commitValue.apply( this, arguments );
  • _source/plugins/iframe/plugin.js

     
    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                                });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy