X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fflash%2Fdialogs%2Fflash.js;h=5ac131aa93748c3c2cde53b19be720b930f89162;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=997ced03bde1153c7a89b63132e959a1ac863a9d;hpb=4e90e78dc97789709ee7404359a5517540c27553;p=ckeditor.git diff --git a/_source/plugins/flash/dialogs/flash.js b/_source/plugins/flash/dialogs/flash.js index 997ced0..5ac131a 100644 --- a/_source/plugins/flash/dialogs/flash.js +++ b/_source/plugins/flash/dialogs/flash.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -49,6 +49,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license for ( i = 0 ; i < names.length ; i++ ) attributesMap[ names[i] ][0]['default'] = attributesMap[ names[i] ][1]['default'] = true; + var defaultToPixel = CKEDITOR.tools.cssLength; + function loadValue( objectNode, embedNode, paramMap ) { var attributes = attributesMap[ this.id ]; @@ -124,7 +126,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license switch ( attrDef.type ) { case ATTRTYPE_OBJECT: - if ( !objectNode ) + // Avoid applying the data attribute when not needed (#7733) + if ( !objectNode || ( attrDef.name == 'data' && embedNode && !objectNode.hasAttribute( 'data' ) ) ) continue; var value = this.getValue(); if ( isRemove || isCheckbox && value === attrDef[ 'default' ] ) @@ -366,46 +369,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license id : 'width', style : 'width:95px', label : editor.lang.common.width, - validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidWidth ), - setup : function( objectNode, embedNode, paramMap, fakeImage ) - { - loadValue.apply( this, arguments ); - if ( fakeImage ) - { - var fakeImageWidth = parseInt( fakeImage.$.style.width, 10 ); - if ( !isNaN( fakeImageWidth ) ) - this.setValue( fakeImageWidth ); - } - }, - commit : function( objectNode, embedNode, paramMap, extraStyles ) - { - commitValue.apply( this, arguments ); - if ( this.getValue() ) - extraStyles.width = this.getValue() + 'px'; - } + validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.width ) ), + setup : loadValue, + commit : commitValue }, { type : 'text', id : 'height', style : 'width:95px', label : editor.lang.common.height, - validate : CKEDITOR.dialog.validate.integer( editor.lang.common.invalidHeight ), - setup : function( objectNode, embedNode, paramMap, fakeImage ) - { - loadValue.apply( this, arguments ); - if ( fakeImage ) - { - var fakeImageHeight = parseInt( fakeImage.$.style.height, 10 ); - if ( !isNaN( fakeImageHeight ) ) - this.setValue( fakeImageHeight ); - } - }, - commit : function( objectNode, embedNode, paramMap, extraStyles ) - { - commitValue.apply( this, arguments ); - if ( this.getValue() ) - extraStyles.height = this.getValue() + 'px'; - } + validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.height ) ), + setup : loadValue, + commit : commitValue }, { type : 'text', @@ -686,6 +661,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { type : 'text', id : 'style', + validate : CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ), label : editor.lang.common.cssStyle, setup : loadValue, commit : commitValue