\r
CKEDITOR.themes.add( 'default', (function()\r
{\r
+ var hiddenSkins = {};\r
+\r
function checkSharedSpace( editor, spaceName )\r
{\r
var container,\r
sharedTop && ( sharedTop.setHtml( topHtml ) , topHtml = '' );\r
sharedBottoms && ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );\r
\r
+ var hideSkin = '<style>.' + editor.skinClass + '{visibility:hidden;}</style>';\r
+ if ( hiddenSkins[ editor.skinClass ] )\r
+ hideSkin = '';\r
+ else\r
+ hiddenSkins[ editor.skinClass ] = 1;\r
+\r
var container = CKEDITOR.dom.element.createFromHtml( [\r
'<span' +\r
' id="cke_', name, '"' +\r
'<tr', bottomHtml ? '' : ' style="display:none"', ' role="presentation"><td id="cke_bottom_' , name, '" class="cke_bottom" role="presentation">' , bottomHtml , '</td></tr>' +\r
'</tbody></table>' +\r
//Hide the container when loading skins, later restored by skin css.\r
- '<style>.', editor.skinClass, '{visibility:hidden;}</style>' +\r
+ hideSkin +\r
'</span>' +\r
'</span>' +\r
'</span>' ].join( '' ) );\r
// Disable browser context menu for editor's chrome.\r
container.disableContextMenu();\r
\r
+ // Use a class to indicate that the current selection is in different direction than the UI.\r
+ editor.on( 'contentDirChanged', function( evt )\r
+ {\r
+ var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class';\r
+\r
+ container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' );\r
+\r
+ // Put the mixed direction class on the respective element also for shared spaces.\r
+ var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ];\r
+ toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' );\r
+ });\r
+\r
editor.fireOnce( 'themeLoaded' );\r
editor.fireOnce( 'uiReady' );\r
},\r