Ticket #6462: 6462_4.patch

File 6462_4.patch, 21.0 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/iframe/dialogs/iframe.js

     
    1313                frameborder : { 'true' : '1', 'false' : '0' }
    1414        };
    1515
     16        var defaultToPixel = CKEDITOR.tools.cssLength;
     17
    1618        function loadValue( iframeNode )
    1719        {
    1820                var isCheckbox = this instanceof CKEDITOR.ui.dialog.checkbox;
     
    5658                                styles && styles.on( 'change', function()
    5759                                        {
    5860                                                // Synchronize width value.
    59                                                 var width = parseInt( this.getStyle( 'width', '' ) || '', 10 ),
     61                                                var width = this.getStyle( 'width', '' ),
    6062                                                        txtWidth = dialog.getContentElement( 'info', 'width' );
    6163
    6264                                                txtWidth && txtWidth.setValue( width, true );
    6365
    6466                                                // Synchronize height value.
    65                                                 var height = parseInt( this.getStyle( 'height', '' ) || '', 10 ),
     67                                                var height = this.getStyle( 'height', '' ),
    6668                                                        txtHeight = dialog.getContentElement( 'info', 'height' );
    6769
    6870                                                txtHeight && txtHeight.setValue( height, true );
     
    150152                                                                        style : 'width:100%',
    151153                                                                        labelLayout : 'vertical',
    152154                                                                        label : commonLang.width,
    153                                                                         validate : CKEDITOR.dialog.validate.integer( commonLang.invalidWidth ),
     155                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
     156                                                                        getValue : defaultToPixel,
    154157                                                                        setup : function( iframeNode, fakeImage )
    155158                                                                        {
    156159                                                                                loadValue.apply( this, arguments );
    157                                                                                 if ( fakeImage )
    158                                                                                 {
    159                                                                                         var fakeImageWidth = parseInt( fakeImage.$.style.width, 10 );
    160                                                                                         if ( !isNaN( fakeImageWidth ) )
    161                                                                                                 this.setValue( fakeImageWidth );
    162                                                                                 }
     160                                                                                fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
    163161                                                                        },
    164162                                                                        commit : function( iframeNode, extraStyles )
    165163                                                                        {
    166164                                                                                commitValue.apply( this, arguments );
    167                                                                                 if ( this.getValue() )
    168                                                                                         extraStyles.width = this.getValue() + 'px';
     165                                                                                var val = this.getValue();
     166                                                                                val && ( extraStyles.width = val );
    169167                                                                        },
    170168                                                                        onChange : function()
    171169                                                                        {
    172170                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
    173171                                                                                        value = this.getValue();
    174                                                                                 styles && styles.updateStyle( 'width', value &&  ( value + 'px' ) );
     172                                                                                styles && styles.updateStyle( 'width', value );
    175173                                                                        }
    176174                                                                },
    177175                                                                {
     
    180178                                                                        style : 'width:100%',
    181179                                                                        labelLayout : 'vertical',
    182180                                                                        label : commonLang.height,
    183                                                                         validate : CKEDITOR.dialog.validate.integer( commonLang.invalidHeight ),
     181                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
     182                                                                        getValue : defaultToPixel,
    184183                                                                        setup : function( iframeNode, fakeImage )
    185184                                                                        {
    186185                                                                                loadValue.apply( this, arguments );
    187                                                                                 if ( fakeImage )
    188                                                                                 {
    189                                                                                         var fakeImageHeight = parseInt( fakeImage.$.style.height, 10 );
    190                                                                                         if ( !isNaN( fakeImageHeight ) )
    191                                                                                                 this.setValue( fakeImageHeight );
    192                                                                                 }
     186                                                                                fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
    193187                                                                        },
    194188                                                                        commit : function( iframeNode, extraStyles )
    195189                                                                        {
    196190                                                                                commitValue.apply( this, arguments );
    197                                                                                 if ( this.getValue() )
    198                                                                                         extraStyles.height = this.getValue() + 'px';
     191                                                                                var val = this.getValue();
     192                                                                                val && ( extraStyles.height = val );
    199193                                                                        },
    200194                                                                        onChange : function()
    201195                                                                        {
    202196                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
    203197                                                                                        value = this.getValue();
    204                                                                                 styles && styles.updateStyle( 'height', value &&  ( value + 'px' ) );
     198                                                                                styles && styles.updateStyle( 'height', value );
    205199                                                                        }
    206200                                                                },
    207201                                                                {
  • _source/plugins/dialogadvtab/plugin.js

     
    136136
    137137                                                getStyle : function( name, defaultValue )
    138138                                                {
    139                                                         var match = this.getValue().match( new RegExp( name + '\\s*:\s*([^;]*)', 'i') );
     139                                                        var match = this.getValue().match( new RegExp( name + '\\s*:\\s*([^;]*)', 'i') );
    140140                                                        return match ? match[ 1 ] : defaultValue;
    141141                                                },
    142142
  • _source/plugins/table/dialogs/table.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 widthPattern = /^(\d+(?:\.\d+)?)(px|%)$/,
    9                 heightPattern = /^(\d+(?:\.\d+)?)px$/;
     8        var defaultToPixel = CKEDITOR.tools.cssLength;
    109
    1110        var commitValue = function( data )
    1211        {
     
    4241                                                {
    4342                                                        // Synchronize width value.
    4443                                                        var width = this.getStyle( 'width', '' ),
    45                                                                 txtWidth = dialog.getContentElement( 'info', 'txtWidth' ),
    46                                                                 cmbWidthType = dialog.getContentElement( 'info', 'cmbWidthType' ),
    47                                                                 isPx = 1;
     44                                                                txtWidth = dialog.getContentElement( 'info', 'txtWidth' );
    4845
    49                                                         if ( width )
    50                                                         {
    51                                                                 isPx = ( width.length < 3 || width.substr( width.length - 1 ) != '%' );
    52                                                                 width = parseInt( width, 10 );
    53                                                         }
    54 
    5546                                                        txtWidth && txtWidth.setValue( width, true );
    56                                                         cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents', true );
    5747
    5848                                                        // Synchronize height value.
    5949                                                        var height = this.getStyle( 'height', '' ),
    6050                                                                txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
    6151
    62                                                         height && ( height = parseInt( height, 10 ) );
    6352                                                        txtHeight && txtHeight.setValue( height, true );
    6453                                                });
    6554                                }
     
    224213                                        }
    225214
    226215                                        // Set the width and height.
    227                                         var styles = [];
    228                                         if ( info.txtHeight )
    229                                                 table.setStyle( 'height', CKEDITOR.tools.cssLength( info.txtHeight ) );
    230                                         else
    231                                                 table.removeStyle( 'height' );
     216                                        info.txtHeight ? table.setStyle( 'height', info.txtHeight ) : table.removeStyle( 'height' );
     217                                        info.txtWidth ? table.setStyle( 'width', info.txtWidth ) : table.removeStyle( 'width' );
    232218
    233                                         if ( info.txtWidth )
    234                                         {
    235                                                 var type = info.cmbWidthType || 'pixels';
    236                                                 table.setStyle( 'width', info.txtWidth + ( type == 'pixels' ? 'px' : '%' ) );
    237                                         }
    238                                         else
    239                                                 table.removeStyle( 'width' );
    240 
    241219                                        if ( !table.getAttribute( 'style' ) )
    242220                                                table.removeAttribute( 'style' );
    243221                                }
     
    423401                                                                                                        style : 'width:5em',
    424402                                                                                                        label : editor.lang.common.width,
    425403                                                                                                        'default' : 500,
    426                                                                                                         validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ),
    427 
    428                                                                                                         // Extra labelling of width unit type.
    429                                                                                                         onLoad : function()
    430                                                                                                         {
    431                                                                                                                 var widthType = this.getDialog().getContentElement( 'info', 'cmbWidthType' ),
    432                                                                                                                         labelElement = widthType.getElement(),
    433                                                                                                                         inputElement = this.getInputElement(),
    434                                                                                                                         ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
    435 
    436                                                                                                                 inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
    437                                                                                                         },
    438 
     404                                                                                                        getValue : defaultToPixel,
     405                                                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    439406                                                                                                        onChange : function()
    440407                                                                                                        {
    441408                                                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
    442 
    443                                                                                                                 if ( styles )
    444                                                                                                                 {
    445                                                                                                                         var value = this.getValue();
    446 
    447                                                                                                                         if ( value )
    448                                                                                                                                 value += this.getDialog().getContentElement( 'info', 'cmbWidthType' ).getValue() == 'percents' ? '%' : 'px';
    449 
    450                                                                                                                         styles.updateStyle( 'width', value );
    451                                                                                                                 }
     409                                                                                                                styles && styles.updateStyle( 'width', this.getValue() );
    452410                                                                                                        },
    453 
    454411                                                                                                        setup : function( selectedTable )
    455412                                                                                                        {
    456                                                                                                                 var widthMatch = widthPattern.exec( selectedTable.$.style.width );
    457                                                                                                                 if ( widthMatch )
    458                                                                                                                         this.setValue( widthMatch[1] );
    459                                                                                                                 else
    460                                                                                                                         this.setValue( '' );
     413                                                                                                                var val = selectedTable.getStyle( 'width' );
     414                                                                                                                val && this.setValue( val );
    461415                                                                                                        },
    462416                                                                                                        commit : commitValue
    463                                                                                                 },
    464                                                                                                 {
    465                                                                                                         id : 'cmbWidthType',
    466                                                                                                         type : 'select',
    467                                                                                                         label : editor.lang.table.widthUnit,
    468                                                                                                         labelStyle: 'visibility:hidden',
    469                                                                                                         'default' : 'pixels',
    470                                                                                                         items :
    471                                                                                                         [
    472                                                                                                                 [ editor.lang.table.widthPx , 'pixels'],
    473                                                                                                                 [ editor.lang.table.widthPc , 'percents']
    474                                                                                                         ],
    475                                                                                                         setup : function( selectedTable )
    476                                                                                                         {
    477                                                                                                                 var widthMatch = widthPattern.exec( selectedTable.$.style.width );
    478                                                                                                                 if ( widthMatch )
    479                                                                                                                         this.setValue( widthMatch[2] == 'px' ? 'pixels' : 'percents' );
    480                                                                                                         },
    481                                                                                                         onChange : function()
    482                                                                                                         {
    483                                                                                                                 this.getDialog().getContentElement( 'info', 'txtWidth' ).onChange();
    484                                                                                                         },
    485                                                                                                         commit : commitValue
    486417                                                                                                }
    487418                                                                                        ]
    488419                                                                                },
     
    497428                                                                                                        style : 'width:5em',
    498429                                                                                                        label : editor.lang.common.height,
    499430                                                                                                        'default' : '',
    500                                                                                                         validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidHeight ),
    501 
    502                                                                                                         // Extra labelling of height unit type.
    503                                                                                                         onLoad : function()
    504                                                                                                         {
    505                                                                                                                 var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ),
    506                                                                                                                         labelElement = heightType.getElement(),
    507                                                                                                                         inputElement = this.getInputElement(),
    508                                                                                                                         ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
    509 
    510                                                                                                                 inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
    511                                                                                                         },
    512 
     431                                                                                                        getValue : defaultToPixel,
     432                                                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength ),
    513433                                                                                                        onChange : function()
    514434                                                                                                        {
    515435                                                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
    516 
    517                                                                                                                 if ( styles )
    518                                                                                                                 {
    519                                                                                                                         var value = this.getValue();
    520                                                                                                                         styles.updateStyle( 'height', value && ( value + 'px' ) );
    521                                                                                                                 }
     436                                                                                                                styles && styles.updateStyle( 'height', this.getValue() );
    522437                                                                                                        },
    523438
    524439                                                                                                        setup : function( selectedTable )
    525440                                                                                                        {
    526                                                                                                                 var heightMatch = heightPattern.exec( selectedTable.$.style.height );
    527                                                                                                                 if ( heightMatch )
    528                                                                                                                         this.setValue( heightMatch[1] );
     441                                                                                                                var val = selectedTable.getStyle( 'width' );
     442                                                                                                                val && this.setValue( val );
    529443                                                                                                        },
    530444                                                                                                        commit : commitValue
    531                                                                                                 },
    532                                                                                                 {
    533                                                                                                         id : 'htmlHeightType',
    534                                                                                                         type : 'html',
    535                                                                                                         html : '<div><br />' + editor.lang.table.widthPx + '</div>'
    536445                                                                                                }
    537446                                                                                        ]
    538447                                                                                },
     
    546455                                                                                        style : 'width:3em',
    547456                                                                                        label : editor.lang.table.cellSpace,
    548457                                                                                        'default' : 1,
    549                                                                                         validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidCellSpacing ),
     458                                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    550459                                                                                        setup : function( selectedTable )
    551460                                                                                        {
    552461                                                                                                this.setValue( selectedTable.getAttribute( 'cellSpacing' ) || '' );
     
    565474                                                                                        style : 'width:3em',
    566475                                                                                        label : editor.lang.table.cellPad,
    567476                                                                                        'default' : 1,
    568                                                                                         validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidCellPadding ),
     477                                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    569478                                                                                        setup : function( selectedTable )
    570479                                                                                        {
    571480                                                                                                this.setValue( selectedTable.getAttribute( 'cellPadding' ) || '' );
  • _source/plugins/dialog/plugin.js

     
    23202320                                if ( typeof( elementDefinition.isChanged ) == 'function' )
    23212321                                        this.isChanged = elementDefinition.isChanged;
    23222322
     2323                                // Overload 'get(set)Value' on definition.
     2324                                if ( typeof( elementDefinition.setValue ) == 'function' )
     2325                                {
     2326                                                this.setValue = CKEDITOR.tools.override( this.setValue, function( org )
     2327                                                {
     2328                                                                return function( val ){ org.call( this, elementDefinition.setValue.call( this, val ) ); };
     2329                                                } );
     2330                                }
     2331
     2332                                if ( typeof( elementDefinition.getValue ) == 'function' )
     2333                                {
     2334                                                this.getValue = CKEDITOR.tools.override( this.getValue, function( org )
     2335                                                {
     2336                                                                return function(){ return  elementDefinition.getValue.call( this, org.call( this ) ); };
     2337                                                } );
     2338                                }
     2339
    23232340                                // Add events.
    23242341                                CKEDITOR.event.implementOn( this );
    23252342
     
    29112928        {
    29122929                var notEmptyRegex = /^([a]|[^a])+$/,
    29132930                        integerRegex = /^\d*$/,
    2914                         numberRegex = /^\d*(?:\.\d+)?$/;
     2931                        numberRegex = /^\d*(?:\.\d+)?$/,
     2932                        htmlLengthRegex = /^([+-]?((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
     2933                        cssLengthRegex = /^([+-]?((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i;
    29152934
    29162935                CKEDITOR.VALIDATE_OR = 1;
    29172936                CKEDITOR.VALIDATE_AND = 2;
     
    29202939                {
    29212940                        functions : function()
    29222941                        {
     2942                                var args = arguments;
    29232943                                return function()
    29242944                                {
    29252945                                        /**
     
    29282948                                         * combine validate functions together to make more sophisticated
    29292949                                         * validators.
    29302950                                         */
    2931                                         var value = this && this.getValue ? this.getValue() : arguments[0];
     2951                                        var value = this && this.getValue ? this.getValue() : args[ 0 ];
    29322952
    29332953                                        var msg = undefined,
    29342954                                                relation = CKEDITOR.VALIDATE_AND,
    29352955                                                functions = [], i;
    29362956
    2937                                         for ( i = 0 ; i < arguments.length ; i++ )
     2957                                        for ( i = 0 ; i < args.length ; i++ )
    29382958                                        {
    2939                                                 if ( typeof( arguments[i] ) == 'function' )
    2940                                                         functions.push( arguments[i] );
     2959                                                if ( typeof( args[i] ) == 'function' )
     2960                                                        functions.push( args[i] );
    29412961                                                else
    29422962                                                        break;
    29432963                                        }
    29442964
    2945                                         if ( i < arguments.length && typeof( arguments[i] ) == 'string' )
     2965                                        if ( i < args.length && typeof( args[i] ) == 'string' )
    29462966                                        {
    2947                                                 msg = arguments[i];
     2967                                                msg = args[i];
    29482968                                                i++;
    29492969                                        }
    29502970
    2951                                         if ( i < arguments.length && typeof( arguments[i]) == 'number' )
    2952                                                 relation = arguments[i];
     2971                                        if ( i < args.length && typeof( args[i]) == 'number' )
     2972                                                relation = args[i];
    29532973
    29542974                                        var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false );
    29552975                                        for ( i = 0 ; i < functions.length ; i++ )
     
    29642984                                        {
    29652985                                                if ( msg !== undefined )
    29662986                                                        alert( msg );
    2967                                                 if ( this && ( this.select || this.focus ) )
    2968                                                         ( this.select || this.focus )();
     2987                                                if ( this.select || this.focus  )
     2988                                                {
     2989                                                        if ( this.select )
     2990                                                                this.select();
     2991                                                        else
     2992                                                                this.focus();
     2993                                                }
     2994
    29692995                                                return false;
    29702996                                        }
    29712997
     
    30143040                                return this.regex( numberRegex, msg );
    30153041                        },
    30163042
     3043                        'cssLength' : function( msg )
     3044                        {
     3045                                return this.functions( function( val ){ return cssLengthRegex.test( CKEDITOR.tools.trim( val ) ); }, msg );
     3046                        },
     3047
     3048                        'htmlLength' : function( msg )
     3049                        {
     3050                                return this.functions( function( val ){ return htmlLengthRegex.test( CKEDITOR.tools.trim( val ) ); }, msg );
     3051                        },
     3052
    30173053                        equals : function( value, msg )
    30183054                        {
    30193055                                return this.functions( function( val ){ return val == value; }, msg );
  • _source/lang/en.js

     
    121121                alignBottom             : 'Bottom',
    122122                invalidHeight   : 'Height must be a number.',
    123123                invalidWidth    : 'Width must be a number.',
     124                invalidCssLength        : 'Value must be a valid CSS length unit.',
     125                invalidHtmlLength       : 'Value must be either a number in unit of pixel, or a percentage value',
    124126
    125127                // Put the voice-only part of the label in the span.
    126128                unavailable             : '%1<span class="cke_accessibility">, unavailable</span>'
     
    271273                invalidBorder   : 'Border size must be a number.',
    272274                invalidWidth    : 'Table width must be a number.',
    273275                invalidHeight   : 'Table height must be a number.',
    274                 invalidCellSpacing      : 'Cell spacing must be a number.',
    275                 invalidCellPadding      : 'Cell padding must be a number.',
    276276
    277277                cell :
    278278                {
  • _source/plugins/flash/dialogs/flash.js

     
    4949        for ( i = 0 ; i < names.length ; i++ )
    5050                attributesMap[ names[i] ][0]['default'] = attributesMap[ names[i] ][1]['default'] = true;
    5151
     52        var defaultToPixel = CKEDITOR.tools.cssLength;
     53
    5254        function loadValue( objectNode, embedNode, paramMap )
    5355        {
    5456                var attributes = attributesMap[ this.id ];
     
    367369                                                                        id : 'width',
    368370                                                                        style : 'width:95px',
    369371                                                                        label : editor.lang.common.width,
    370                                                                         validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidWidth ),
     372                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    371373                                                                        setup : function( objectNode, embedNode, paramMap, fakeImage )
    372374                                                                        {
    373375                                                                                loadValue.apply( this, arguments );
    374                                                                                 if ( fakeImage )
    375                                                                                 {
    376                                                                                         var fakeImageWidth = parseInt( fakeImage.$.style.width, 10 );
    377                                                                                         if ( !isNaN( fakeImageWidth ) )
    378                                                                                                 this.setValue( fakeImageWidth );
    379                                                                                 }
     376                                                                                fakeImage && this.setValue( fakeImage.getStyle( 'width' ) );
    380377                                                                        },
    381378                                                                        commit : function( objectNode, embedNode, paramMap, extraStyles )
    382379                                                                        {
    383380                                                                                commitValue.apply( this, arguments );
    384                                                                                 if ( this.getValue() )
    385                                                                                         extraStyles.width = this.getValue() + 'px';
     381                                                                                var val = this.getValue();
     382                                                                                val && ( extraStyles.width = defaultToPixel( val ) );
    386383                                                                        }
    387384                                                                },
    388385                                                                {
     
    390387                                                                        id : 'height',
    391388                                                                        style : 'width:95px',
    392389                                                                        label : editor.lang.common.height,
    393                                                                         validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidHeight ),
     390                                                                        validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength ),
    394391                                                                        setup : function( objectNode, embedNode, paramMap, fakeImage )
    395392                                                                        {
    396393                                                                                loadValue.apply( this, arguments );
    397                                                                                 if ( fakeImage )
    398                                                                                 {
    399                                                                                         var fakeImageHeight = parseInt( fakeImage.$.style.height, 10 );
    400                                                                                         if ( !isNaN( fakeImageHeight ) )
    401                                                                                                 this.setValue( fakeImageHeight );
    402                                                                                 }
     394                                                                                fakeImage && this.setValue( fakeImage.getStyle( 'height' ) );
    403395                                                                        },
    404396                                                                        commit : function( objectNode, embedNode, paramMap, extraStyles )
    405397                                                                        {
    406398                                                                                commitValue.apply( this, arguments );
    407                                                                                 if ( this.getValue() )
    408                                                                                         extraStyles.height = this.getValue() + 'px';
     399                                                                                var val = this.getValue();
     400                                                                                val && ( extraStyles.height = defaultToPixel( val ) );
    409401                                                                        }
    410402                                                                },
    411403                                                                {
  • _source/core/tools.js

     
    680680                 */
    681681                cssLength : (function()
    682682                {
    683                         var decimalRegex = /^\d+(?:\.\d+)?$/;
    684683                        return function( length )
    685684                        {
    686                                 return length + ( decimalRegex.test( length ) ? 'px' : '' );
     685                                return length + ( !length || isNaN( Number( length ) ) ? '' : 'px' );
    687686                        };
    688687                })(),
    689688
  • _source/plugins/fakeobjects/plugin.js

     
    2525                                        if ( style )
    2626                                        {
    2727                                                // Get the width from the style.
    28                                                 var match = /(?:^|\s)width\s*:\s*(\d+)/i.exec( style ),
     28                                                var match = /(?:^|\s)width\s*:\s*(.*?)(:?;|$)/i.exec( style ),
    2929                                                        width = match && match[1];
    3030
    3131                                                // Get the height from the style.
    32                                                 match = /(?:^|\s)height\s*:\s*(\d+)/i.exec( style );
     32                                                match = /(?:^|\s)height\s*:\s*(.*?)(:?;|$)/i.exec( style );
    3333                                                var height = match && match[1];
    3434
    3535                                                if ( width )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy