Subversion Repositories Applications.papyrus

Rev

Rev 1925 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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