FCKeditor 2.6.6
[freeside.git] / httemplate / elements / fckeditor / editor / skins / silver / fck_dialog_ie6.js
1 /*\r
2  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
3  * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
4  *\r
5  * == BEGIN LICENSE ==\r
6  *\r
7  * Licensed under the terms of any of the following licenses at your\r
8  * choice:\r
9  *\r
10  *  - GNU General Public License Version 2 or later (the "GPL")\r
11  *    http://www.gnu.org/licenses/gpl.html\r
12  *\r
13  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
14  *    http://www.gnu.org/licenses/lgpl.html\r
15  *\r
16  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
17  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
18  *\r
19  * == END LICENSE ==\r
20  */\r
21 \r
22 (function()\r
23 {\r
24         // IE6 doens't handle absolute positioning properly (it is always in quirks\r
25         // mode). This function fixes the sizes and positions of many elements that\r
26         // compose the skin (this is skin specific).\r
27         var fixSizes = window.DoResizeFixes = function()\r
28         {\r
29                 var fckDlg = window.document.body ;\r
30 \r
31                 for ( var i = 0 ; i < fckDlg.childNodes.length ; i++ )\r
32                 {\r
33                         var child = fckDlg.childNodes[i] ;\r
34                         switch ( child.className )\r
35                         {\r
36                                 case 'contents' :\r
37                                         child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 ) ;       // -left -right\r
38                                         child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 ) ;      // -bottom -top\r
39                                         break ;\r
40 \r
41                                 case 'blocker' :\r
42                                 case 'cover' :\r
43                                         child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 + 4 ) ;   // -left -right + 4\r
44                                         child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 + 4 ) ;  // -bottom -top + 4\r
45                                         break ;\r
46 \r
47                                 case 'tr' :\r
48                                         child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;\r
49                                         break ;\r
50 \r
51                                 case 'tc' :\r
52                                         child.style.width = Math.max( 0, fckDlg.clientWidth - 16 - 16 ) ;\r
53                                         break ;\r
54 \r
55                                 case 'ml' :\r
56                                         child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;\r
57                                         break ;\r
58 \r
59                                 case 'mr' :\r
60                                         child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;\r
61                                         child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;\r
62                                         break ;\r
63 \r
64                                 case 'bl' :\r
65                                         child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
66                                         break ;\r
67 \r
68                                 case 'br' :\r
69                                         child.style.left = Math.max( 0, fckDlg.clientWidth - 30 ) ;\r
70                                         child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
71                                         break ;\r
72 \r
73                                 case 'bc' :\r
74                                         child.style.width = Math.max( 0, fckDlg.clientWidth - 30 - 30 ) ;\r
75                                         child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;\r
76                                         break ;\r
77                         }\r
78                 }\r
79         }\r
80 \r
81         var closeButtonOver = function()\r
82         {\r
83                 this.style.backgroundPosition = '-16px -687px' ;\r
84         } ;\r
85 \r
86         var closeButtonOut = function()\r
87         {\r
88                 this.style.backgroundPosition = '-16px -651px' ;\r
89         } ;\r
90 \r
91         var fixCloseButton = function()\r
92         {\r
93                 var closeButton = document.getElementById ( 'closeButton' ) ;\r
94 \r
95                 closeButton.onmouseover = closeButtonOver ;\r
96                 closeButton.onmouseout  = closeButtonOut ;\r
97         }\r
98 \r
99         var onLoad = function()\r
100         {\r
101                 fixSizes() ;\r
102                 fixCloseButton() ;\r
103 \r
104                 window.attachEvent( 'onresize', fixSizes ) ;\r
105                 window.detachEvent( 'onload', onLoad ) ;\r
106         }\r
107 \r
108         window.attachEvent( 'onload', onLoad ) ;\r
109 \r
110 })() ;\r