FCKeditor 2.6.6
[freeside.git] / httemplate / elements / fckeditor / editor / skins / office2003 / fck_dialog_ie6.js
diff --git a/httemplate/elements/fckeditor/editor/skins/office2003/fck_dialog_ie6.js b/httemplate/elements/fckeditor/editor/skins/office2003/fck_dialog_ie6.js
new file mode 100644 (file)
index 0000000..93dd674
--- /dev/null
@@ -0,0 +1,110 @@
+/*\r
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
+ *\r
+ * == BEGIN LICENSE ==\r
+ *\r
+ * Licensed under the terms of any of the following licenses at your\r
+ * choice:\r
+ *\r
+ *  - GNU General Public License Version 2 or later (the "GPL")\r
+ *    http://www.gnu.org/licenses/gpl.html\r
+ *\r
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
+ *    http://www.gnu.org/licenses/lgpl.html\r
+ *\r
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
+ *    http://www.mozilla.org/MPL/MPL-1.1.html\r
+ *\r
+ * == END LICENSE ==\r
+ */\r
+\r
+(function()\r
+{\r
+       // IE6 doens't handle absolute positioning properly (it is always in quirks\r
+       // mode). This function fixes the sizes and positions of many elements that\r
+       // compose the skin (this is skin specific).\r
+       var fixSizes = window.DoResizeFixes = function()\r
+       {\r
+               var fckDlg = window.document.body ;\r
+\r
+               for ( var i = 0 ; i < fckDlg.childNodes.length ; i++ )\r
+               {\r
+                       var child = fckDlg.childNodes[i] ;\r
+                       switch ( child.className )\r
+                       {\r
+                               case 'contents' :\r
+                                       child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 ) ;       // -left -right\r
+                                       child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 ) ;      // -bottom -top\r
+                                       break ;\r
+\r
+                               case 'blocker' :\r
+                               case 'cover' :\r
+                                       child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 + 4 ) ;   // -left -right + 4\r
+                                       child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 + 4 ) ;  // -bottom -top + 4\r
+                                       break ;\r
+\r
+                               case 'tr' :\r
+                                       child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;\r
+                                       break ;\r
+\r
+                               case 'tc' :\r
+                                       child.style.width = Math.max( 0, fckDlg.clientWidth - 16 - 16 ) ;\r
+                                       break ;\r
+\r
+                               case 'ml' :\r
+                                       child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;\r
+                                       break ;\r
+\r
+                               case 'mr' :\r
+                                       child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;\r
+                                       child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;\r
+                                       break ;\r
+\r
+                               case 'bl' :\r
+                                       child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
+                                       break ;\r
+\r
+                               case 'br' :\r
+                                       child.style.left = Math.max( 0, fckDlg.clientWidth - 30 ) ;\r
+                                       child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
+                                       break ;\r
+\r
+                               case 'bc' :\r
+                                       child.style.width = Math.max( 0, fckDlg.clientWidth - 30 - 30 ) ;\r
+                                       child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
+                                       break ;\r
+                       }\r
+               }\r
+       }\r
+\r
+       var closeButtonOver = function()\r
+       {\r
+               this.style.backgroundPosition = '-16px -687px' ;\r
+       } ;\r
+\r
+       var closeButtonOut = function()\r
+       {\r
+               this.style.backgroundPosition = '-16px -651px' ;\r
+       } ;\r
+\r
+       var fixCloseButton = function()\r
+       {\r
+               var closeButton = document.getElementById ( 'closeButton' ) ;\r
+\r
+               closeButton.onmouseover = closeButtonOver ;\r
+               closeButton.onmouseout  = closeButtonOut ;\r
+       }\r
+\r
+       var onLoad = function()\r
+       {\r
+               fixSizes() ;\r
+               fixCloseButton() ;\r
+\r
+               window.attachEvent( 'onresize', fixSizes ) ;\r
+               window.detachEvent( 'onload', onLoad ) ;\r
+       }\r
+\r
+       window.attachEvent( 'onload', onLoad ) ;\r
+\r
+})() ;\r