/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
btnLockSizesId = numbering( 'btnLockSizes' ),\r
btnResetSizeId = numbering( 'btnResetSize' ),\r
imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ),\r
- imagePreviewBoxId = numbering( 'ImagePreviewBox' ),\r
previewLinkId = numbering( 'previewLink' ),\r
previewImageId = numbering( 'previewImage' );\r
\r
this.addLink = false;\r
\r
var editor = this.getParentEditor(),\r
- sel = this.getParentEditor().getSelection(),\r
- element = sel.getSelectedElement(),\r
+ sel = editor.getSelection(),\r
+ element = sel && sel.getSelectedElement(),\r
link = element && element.getAscendant( 'a' );\r
\r
//Hide loader.\r
element.setStyle( 'border-style', 'solid' );\r
}\r
else if ( !value && this.isChanged() )\r
- {\r
- element.removeStyle( 'border-width' );\r
- element.removeStyle( 'border-style' );\r
- element.removeStyle( 'border-color' );\r
- }\r
+ element.removeStyle( 'border' );\r
\r
if ( !internalCommit && type == IMAGE )\r
element.removeAttribute( 'border' );\r
style : 'width:95%;',\r
html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+\r
'<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading"> </div></div>'+\r
- '<div id="' + imagePreviewBoxId + '" class="ImagePreviewBox"><table><tr><td>'+\r
+ '<div class="ImagePreviewBox"><table><tr><td>'+\r
'<a href="javascript:void(0)" target="_blank" onclick="return false;" id="' + previewLinkId + '">'+\r
'<img id="' + previewImageId + '" alt="" /></a>' +\r
( editor.config.image_previewText ||\r
type : 'text',\r
id : 'txtdlgGenStyle',\r
label : editor.lang.common.cssStyle,\r
+ validate : CKEDITOR.dialog.validate.inlineStyle( editor.lang.common.invalidInlineStyle ),\r
'default' : '',\r
setup : function( type, element )\r
{\r