X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fimage%2Fdialogs%2Fimage.js;h=3c24d2fed0a84dc054bec6b926f0ef915be04ed7;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=3833e03ffdab6e89b1782bcd045e845448918501;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba;p=ckeditor.git diff --git a/_source/plugins/image/dialogs/image.js b/_source/plugins/image/dialogs/image.js index 3833e03..3c24d2f 100644 --- a/_source/plugins/image/dialogs/image.js +++ b/_source/plugins/image/dialogs/image.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 */ @@ -158,11 +158,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license else ratioButton.addClass( 'cke_btn_unlocked' ); - var lang = dialog._.editor.lang.image, - label = lang[ dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ]; + ratioButton.setAttribute( 'aria-checked', dialog.lockRatio ); - ratioButton.setAttribute( 'title', label ); - ratioButton.getFirst().setText( label ); + // Ratio button hc presentation - WHITE SQUARE / BLACK SQUARE + if ( CKEDITOR.env.hc ) + { + var icon = ratioButton.getChild( 0 ); + icon.setHtml( dialog.lockRatio ? CKEDITOR.env.ie ? '\u25A0': '\u25A3' : CKEDITOR.env.ie ? '\u25A1' : '\u25A2' ); + } return dialog.lockRatio; }; @@ -263,7 +266,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license btnLockSizesId = numbering( 'btnLockSizes' ), btnResetSizeId = numbering( 'btnResetSize' ), imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ), - imagePreviewBoxId = numbering( 'ImagePreviewBox' ), previewLinkId = numbering( 'previewLink' ), previewImageId = numbering( 'previewImage' ); @@ -287,8 +289,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.addLink = false; var editor = this.getParentEditor(), - sel = this.getParentEditor().getSelection(), - element = sel.getSelectedElement(), + sel = editor.getSelection(), + element = sel && sel.getSelectedElement(), link = element && element.getAscendant( 'a' ); //Hide loader. @@ -780,7 +782,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license updatePreview( this ); } } - evt.data.preventDefault(); + evt.data && evt.data.preventDefault(); }, this.getDialog() ); ratioButton.on( 'mouseover', function() { @@ -793,8 +795,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } }, html : '
'+ - '' + editor.lang.image.unlockRatio + '' + + '' + editor.lang.image.lockRatio + '' + '' + editor.lang.image.resetSize + ''+ '
' @@ -844,11 +846,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license element.setStyle( 'border-style', 'solid' ); } else if ( !value && this.isChanged() ) - { - element.removeStyle( 'border-width' ); - element.removeStyle( 'border-style' ); - element.removeStyle( 'border-color' ); - } + element.removeStyle( 'border' ); if ( !internalCommit && type == IMAGE ) element.removeAttribute( 'border' ); @@ -1074,7 +1072,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license style : 'width:95%;', html : '
' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'
'+ ''+ - '
'+ + '
'+ ''+ '' + ( editor.config.image_previewText || @@ -1346,6 +1344,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'text', id : 'txtdlgGenStyle', label : editor.lang.common.cssStyle, + validate : CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ), 'default' : '', setup : function( type, element ) {