X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fimage%2Fdialogs%2Fimage.js;h=9c5f4e55d85b2a9fa425e35d7c5eb6e8fe1da4f5;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=0fa8827885bda2296a7e71cf5efe9f0ae3ca92ce;hpb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;p=ckeditor.git diff --git a/_source/plugins/image/dialogs/image.js b/_source/plugins/image/dialogs/image.js index 0fa8827..9c5f4e5 100644 --- a/_source/plugins/image/dialogs/image.js +++ b/_source/plugins/image/dialogs/image.js @@ -264,7 +264,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return { title : ( dialogType == 'image' ) ? editor.lang.image.title : editor.lang.image.titleButton, minWidth : 420, - minHeight : 310, + minHeight : CKEDITOR.env.ie && CKEDITOR.env.quirks? 360: 310, onShow : function() { this.imageElement = false; @@ -319,7 +319,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.setupContent( LINK, link ); } - if ( element && element.getName() == 'img' && !element.getAttribute( '_cke_realelement' ) + if ( element && element.getName() == 'img' && !element.data( 'cke-realelement' ) || element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'image' ) { this.imageEditMode = element.getName(); @@ -533,7 +533,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { if ( type == IMAGE ) { - var url = element.getAttribute( '_cke_saved_src' ) || element.getAttribute( 'src' ); + var url = element.data( 'cke-saved-src' ) || element.getAttribute( 'src' ); var field = this; this.getDialog().dontResetSize = true; @@ -541,14 +541,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license field.setValue( url ); // And call this.onChange() // Manually set the initial value.(#4191) field.setInitValue(); - field.focus(); } }, commit : function( type, element ) { if ( type == IMAGE && ( this.getValue() || this.isChanged() ) ) { - element.setAttribute( '_cke_saved_src', decodeURI( this.getValue() ) ); + element.data( 'cke-saved-src', decodeURI( this.getValue() ) ); element.setAttribute( 'src', decodeURI( this.getValue() ) ); } else if ( type == CLEANUP ) @@ -608,17 +607,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, { type : 'hbox', - widths : [ '140px', '240px' ], children : [ { type : 'vbox', - padding : 10, children : [ { type : 'hbox', - widths : [ '70%', '30%' ], + widths : [ '50%', '50%' ], children : [ { @@ -630,8 +627,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', width: '40px', id : 'txtWidth', - labelLayout : 'horizontal', - label : editor.lang.image.width, + label : editor.lang.common.width, onKeyUp : onSizeChange, onChange : function() { @@ -641,7 +637,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var aMatch = this.getValue().match( regexGetSizeOrEmpty ); if ( !aMatch ) - alert( editor.lang.image.validateWidth ); + alert( editor.lang.common.invalidWidth ); return !!aMatch; }, setup : setupDimension, @@ -680,8 +676,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'txtHeight', width: '40px', - labelLayout : 'horizontal', - label : editor.lang.image.height, + label : editor.lang.common.height, onKeyUp : onSizeChange, onChange : function() { @@ -691,7 +686,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var aMatch = this.getValue().match( regexGetSizeOrEmpty ); if ( !aMatch ) - alert( editor.lang.image.validateHeight ); + alert( editor.lang.common.invalidHeight ); return !!aMatch; }, setup : setupDimension, @@ -731,7 +726,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, { type : 'html', - style : 'margin-top:10px;width:40px;height:40px;', + style : 'margin-top:30px;width:40px;height:40px;', onLoad : function() { // Activate Reset button @@ -801,7 +796,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'txtBorder', width: '60px', - labelLayout : 'horizontal', label : editor.lang.image.border, 'default' : '', onKeyUp : function() @@ -858,7 +852,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'txtHSpace', width: '60px', - labelLayout : 'horizontal', label : editor.lang.image.hSpace, 'default' : '', onKeyUp : function() @@ -922,7 +915,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'txtVSpace', width : '60px', - labelLayout : 'horizontal', label : editor.lang.image.vSpace, 'default' : '', onKeyUp : function() @@ -984,16 +976,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { id : 'cmbAlign', type : 'select', - labelLayout : 'horizontal', widths : [ '35%','65%' ], style : 'width:90px', - label : editor.lang.image.align, + label : editor.lang.common.align, 'default' : '', items : [ [ editor.lang.common.notSet , ''], - [ editor.lang.image.alignLeft , 'left'], - [ editor.lang.image.alignRight , 'right'] + [ editor.lang.common.alignLeft , 'left'], + [ editor.lang.common.alignRight , 'right'] // Backward compatible with v2 on setup when specified as attribute value, // while these values are no more available as select options. // [ editor.lang.image.alignAbsBottom , 'absBottom'], @@ -1099,7 +1090,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { if ( type == LINK ) { - var href = element.getAttribute( '_cke_saved_href' ); + var href = element.data( 'cke-saved-href' ); if ( !href ) href = element.getAttribute( 'href' ); this.setValue( href ); @@ -1111,7 +1102,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { if ( this.getValue() || this.isChanged() ) { - element.setAttribute( '_cke_saved_href', decodeURI( this.getValue() ) ); + element.data( 'cke-saved-href', decodeURI( this.getValue() ) ); element.setAttribute( 'href', 'javascript:void(0)/*' + CKEDITOR.tools.getNextNumber() + '*/' ); @@ -1128,7 +1119,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { action : 'Browse', target: 'Link:txtUrl', - url: editor.config.filebrowserImageBrowseLinkUrl || editor.config.filebrowserBrowseUrl + url: editor.config.filebrowserImageBrowseLinkUrl }, style : 'float:right', hidden : true, @@ -1150,7 +1141,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license setup : function( type, element ) { if ( type == LINK ) - this.setValue( element.getAttribute( 'target' ) ); + this.setValue( element.getAttribute( 'target' ) || '' ); }, commit : function( type, element ) {