JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.1
[ckeditor.git] / _source / plugins / showblocks / plugin.js
index 552cbe4..818e833 100644 (file)
@@ -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,7 +85,7 @@ 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
@@ -118,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