Mimimum syndical pour en faire un produit zope / cmf.
[ckeditor.git] / skins / ckeditor / _source / skins / office2003 / skin.js
diff --git a/skins/ckeditor/_source/skins/office2003/skin.js b/skins/ckeditor/_source/skins/office2003/skin.js
new file mode 100644 (file)
index 0000000..506427a
--- /dev/null
@@ -0,0 +1,74 @@
+/*\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+For licensing, see LICENSE.html or http://ckeditor.com/license\r
+*/\r
+\r
+CKEDITOR.skins.add( 'office2003', (function()\r
+{\r
+       return {\r
+               editor          : { css : [ 'editor.css' ] },\r
+               dialog          : { css : [ 'dialog.css' ] },\r
+               separator               : { canGroup: false },\r
+               templates       : { css : [ 'templates.css' ] },\r
+               margins         : [ 0, 14, 18, 14 ]\r
+       };\r
+})() );\r
+\r
+(function()\r
+{\r
+       CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );\r
+\r
+       function dialogSetup()\r
+       {\r
+               CKEDITOR.dialog.on( 'resize', function( evt )\r
+                       {\r
+                               var data = evt.data,\r
+                                       width = data.width,\r
+                                       height = data.height,\r
+                                       dialog = data.dialog,\r
+                                       contents = dialog.parts.contents;\r
+\r
+                               if ( data.skin != 'office2003' )\r
+                                       return;\r
+\r
+                               contents.setStyles(\r
+                                       {\r
+                                               width : width + 'px',\r
+                                               height : height + 'px'\r
+                                       });\r
+\r
+                               if ( !CKEDITOR.env.ie || CKEDITOR.env.ie9Compat )\r
+                                       return;\r
+\r
+                               // Fix the size of the elements which have flexible lengths.\r
+                               var fixSize = function()\r
+                                       {\r
+                                               var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),\r
+                                                       body = innerDialog.getChild( 0 ),\r
+                                                       bodyWidth = body.getSize( 'width' );\r
+                                               height += body.getChild( 0 ).getSize( 'height' ) + 1;\r
+\r
+                                               // tc\r
+                                               var el = innerDialog.getChild( 2 );\r
+                                               el.setSize( 'width', bodyWidth );\r
+\r
+                                               // bc\r
+                                               el = innerDialog.getChild( 7 );\r
+                                               el.setSize( 'width', bodyWidth - 28 );\r
+\r
+                                               // ml\r
+                                               el = innerDialog.getChild( 4 );\r
+                                               el.setSize( 'height', height );\r
+\r
+                                               // mr\r
+                                               el = innerDialog.getChild( 5 );\r
+                                               el.setSize( 'height', height );\r
+                                       };\r
+                               setTimeout( fixSize, 100 );\r
+\r
+                               // Ensure size is correct for RTL mode. (#4003)\r
+                               if ( evt.editor.lang.dir == 'rtl' )\r
+                                       setTimeout( fixSize, 1000 );\r
+                       });\r
+       }\r
+})();\r