JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / plugins / showblocks / plugin.js
index 6a5ebc2..60f686a 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -24,9 +24,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                '.%2 h6'+\r
                '{'+\r
                        'background-repeat: no-repeat;'+\r
+                       'background-position: top %3;'+\r
                        'border: 1px dotted gray;'+\r
                        'padding-top: 8px;'+\r
-                       'padding-left: 8px;'+\r
+                       'padding-%3: 8px;'+\r
                '}'+\r
 \r
                '.%2 p'+\r
@@ -84,11 +85,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        '%1h6.png);'+\r
                '}';\r
 \r
-       var cssTemplateRegex = /%1/g, cssClassRegex = /%2/g;\r
+       var cssTemplateRegex = /%1/g, cssClassRegex = /%2/g, backgroundPositionRegex = /%3/g;\r
 \r
        var commandDefinition =\r
        {\r
                preserveState : true,\r
+               editorFocus : false,\r
 \r
                exec : function ( editor )\r
                {\r
@@ -117,7 +119,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                        editor.addCss( cssTemplate\r
                                .replace( cssTemplateRegex, 'background-image: url(' + CKEDITOR.getUrl( this.path ) + 'images/block_' )\r
-                               .replace( cssClassRegex, 'cke_show_blocks ' ) );\r
+                               .replace( cssClassRegex, 'cke_show_blocks ' )\r
+                               .replace( backgroundPositionRegex, editor.lang.dir == 'rtl' ? 'right' : 'left' ) );\r
 \r
                        editor.ui.addButton( 'ShowBlocks',\r
                                {\r
@@ -150,4 +153,3 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  * @example\r
  * config.startupOutlineBlocks = true;\r
  */\r
-CKEDITOR.config.startupOutlineBlocks = false;\r