X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fflash%2Fdialogs%2Fflash.js;h=7b7649d7175b5702c3814ac1c5f0db82c1118629;hb=6e682412d5cc0dfaedb376482e585bf2989c6863;hp=666d3c8fdd88c1f9dd801329925968d74dc4b6b9;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git diff --git a/_source/plugins/flash/dialogs/flash.js b/_source/plugins/flash/dialogs/flash.js index 666d3c8..7b7649d 100644 --- a/_source/plugins/flash/dialogs/flash.js +++ b/_source/plugins/flash/dialogs/flash.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, 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 */ @@ -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' ] ) @@ -175,8 +177,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var previewPreloader, previewAreaHtml = '
' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'
' + - '' + - '
'; + '' + + '
'; return { title : editor.lang.flash.title, @@ -186,11 +188,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { // Clear previously saved elements. this.fakeImage = this.objectNode = this.embedNode = null; - previewPreloader = new CKEDITOR.dom.element( 'embeded', editor.document ); + previewPreloader = new CKEDITOR.dom.element( 'embed', editor.document ); // Try to detect any embed or object tag that has Flash parameters. var fakeImage = this.getSelectedElement(); - if ( fakeImage && fakeImage.getAttribute( '_cke_real_element_type' ) && fakeImage.getAttribute( '_cke_real_element_type' ) == 'flash' ) + if ( fakeImage && fakeImage.data( 'cke-real-element-type' ) && fakeImage.data( 'cke-real-element-type' ) == 'flash' ) { this.fakeImage = fakeImage; @@ -365,47 +367,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'width', style : 'width:95px', - label : editor.lang.flash.width, - validate : CKEDITOR.dialog.validate.integer( editor.lang.flash.validateWidth ), - 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'; - } + label : editor.lang.common.width, + 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.flash.height, - validate : CKEDITOR.dialog.validate.integer( editor.lang.flash.validateHeight ), - 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'; - } + label : editor.lang.common.height, + validate : CKEDITOR.dialog.validate.htmlLength( editor.lang.common.invalidHtmlLength.replace( '%1', editor.lang.common.height ) ), + setup : loadValue, + commit : commitValue }, { type : 'text', @@ -558,21 +532,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { id : 'align', type : 'select', - label : editor.lang.flash.align, + label : editor.lang.common.align, 'default' : '', style : 'width : 100%;', items : [ [ editor.lang.common.notSet , ''], - [ editor.lang.flash.alignLeft , 'left'], + [ editor.lang.common.alignLeft , 'left'], [ editor.lang.flash.alignAbsBottom , 'absBottom'], [ editor.lang.flash.alignAbsMiddle , 'absMiddle'], [ editor.lang.flash.alignBaseline , 'baseline'], - [ editor.lang.flash.alignBottom , 'bottom'], - [ editor.lang.flash.alignMiddle , 'middle'], - [ editor.lang.flash.alignRight , 'right'], + [ editor.lang.common.alignBottom , 'bottom'], + [ editor.lang.common.alignMiddle , 'middle'], + [ editor.lang.common.alignRight , 'right'], [ editor.lang.flash.alignTextTop , 'textTop'], - [ editor.lang.flash.alignTop , 'top'] + [ editor.lang.common.alignTop , 'top'] ], setup : loadValue, commit : function( objectNode, embedNode, paramMap, extraStyles, extraAttributes ) @@ -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