X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fflash%2Fdialogs%2Fflash.js;h=20bec0d36296763da4e91a350e3d6d98d62f8525;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=fb5ffd85e2b3e0e374f8d1c04e718290eb2b2156;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/flash/dialogs/flash.js b/_source/plugins/flash/dialogs/flash.js index fb5ffd8..20bec0d 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-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -28,10 +28,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license classid : [ { type : ATTRTYPE_OBJECT, name : 'classid' } ], codebase : [ { type : ATTRTYPE_OBJECT, name : 'codebase'} ], pluginspage : [ { type : ATTRTYPE_EMBED, name : 'pluginspage' } ], - src : [ { type : ATTRTYPE_PARAM, name : 'movie' }, { type : ATTRTYPE_EMBED, name : 'src' } ], + src : [ { type : ATTRTYPE_PARAM, name : 'movie' }, { type : ATTRTYPE_EMBED, name : 'src' }, { type : ATTRTYPE_OBJECT, name : 'data' } ], name : [ { type : ATTRTYPE_EMBED, name : 'name' } ], align : [ { type : ATTRTYPE_OBJECT, name : 'align' } ], - title : [ { type : ATTRTYPE_OBJECT, name : 'title' }, { type : ATTRTYPE_EMBED, name : 'title' } ], 'class' : [ { type : ATTRTYPE_OBJECT, name : 'class' }, { type : ATTRTYPE_EMBED, name : 'class'} ], width : [ { type : ATTRTYPE_OBJECT, name : 'width' }, { type : ATTRTYPE_EMBED, name : 'width' } ], height : [ { type : ATTRTYPE_OBJECT, name : 'height' }, { type : ATTRTYPE_EMBED, name : 'height' } ], @@ -49,6 +48,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 +125,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 +368,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', @@ -643,7 +617,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license [ { type : 'hbox', - widths : [ '45%', '55%' ], children : [ { @@ -652,13 +625,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license label : editor.lang.common.id, setup : loadValue, commit : commitValue - }, - { - type : 'text', - id : 'title', - label : editor.lang.common.advisoryTitle, - setup : loadValue, - commit : commitValue } ] }, @@ -686,6 +652,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