X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fshowborders%2Fplugin.js;h=381bf7065ca85819f13fbf2eb6d3a93100f8e635;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=6e199e3515b13543fd8ab1063cf4ab273c41037e;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/showborders/plugin.js b/_source/plugins/showborders/plugin.js index 6e199e3..381bf70 100644 --- a/_source/plugins/showborders/plugin.js +++ b/_source/plugins/showborders/plugin.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 */ @@ -18,7 +18,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ( CKEDITOR.env.ie6Compat ? [ '.%1 table.%2,', - '.%1 table.%2 td, .%1 table.%2 th,', + '.%1 table.%2 td, .%1 table.%2 th', '{', 'border : #d3d3d3 1px dotted', '}' @@ -40,6 +40,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { preserveState : true, editorFocus : false, + readOnly: 1, exec : function ( editor ) { @@ -49,8 +50,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license refresh : function( editor ) { - var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass'; - editor.document.getBody()[ funcName ]( 'cke_show_borders' ); + if ( editor.document ) + { + var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass'; + editor.document.getBody()[ funcName ]( 'cke_show_borders' ); + } } }; @@ -111,7 +115,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license cssClass = attributes[ 'class' ], border = parseInt( attributes.border, 10 ); - if ( !border || border <= 0 ) + if ( ( !border || border <= 0 ) && ( !cssClass || cssClass.indexOf( showBorderClassName ) == -1 ) ) attributes[ 'class' ] = ( cssClass || '' ) + ' ' + showBorderClassName; } }