JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / showborders / plugin.js
index 6e199e3..846a12b 100644 (file)
@@ -1,5 +1,5 @@
 /*\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
@@ -18,7 +18,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                ( CKEDITOR.env.ie6Compat ?\r
                  [\r
                        '.%1 table.%2,',\r
-                        '.%1 table.%2 td, .%1 table.%2 th,',\r
+                        '.%1 table.%2 td, .%1 table.%2 th',\r
                         '{',\r
                                'border : #d3d3d3 1px dotted',\r
                         '}'\r
@@ -40,6 +40,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        {\r
                preserveState : true,\r
                editorFocus : false,\r
+               readOnly: 1,\r
 \r
                exec : function ( editor )\r
                {\r
@@ -49,8 +50,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                refresh : function( editor )\r
                {\r
-                       var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass';\r
-                       editor.document.getBody()[ funcName ]( 'cke_show_borders' );\r
+                       if ( editor.document )\r
+                       {\r
+                               var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass';\r
+                               editor.document.getBody()[ funcName ]( 'cke_show_borders' );\r
+                       }\r
                }\r
        };\r
 \r
@@ -111,7 +115,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        cssClass = attributes[ 'class' ],\r
                                                                        border = parseInt( attributes.border, 10 );\r
 \r
-                                                               if ( !border || border <= 0 )\r
+                                                               if ( ( !border || border <= 0 ) && ( !cssClass || cssClass.indexOf( showBorderClassName ) == -1 ) )\r
                                                                        attributes[ 'class' ] = ( cssClass || '' ) + ' ' + showBorderClassName;\r
                                                        }\r
                                                }\r