Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
431 ddelon 1
<!--
2
 * FCKeditor - The text editor for internet
3
 * Copyright (C) 2003-2005 Frederico Caldeira Knabben
4
 *
5
 * Licensed under the terms of the GNU Lesser General Public License:
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
7
 *
8
 * For further information visit:
9
 * 		http://www.fckeditor.net/
10
 *
11
 * File Name: fckdialog.html
12
 * 	This page is used by all dialog box as the container.
13
 *
14
 * File Authors:
15
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
16
-->
17
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
18
<html>
19
	<head>
20
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
21
		<meta name="robots" content="noindex, nofollow" />
22
		<script type="text/javascript">
23
 
24
// On some Gecko browsers (probably over slow connections) the
25
// "dialogArguments" are not set so we must get it from the opener window.
26
if ( !dialogArguments )
27
	dialogArguments = window.opener.FCKLastDialogInfo ;
28
 
29
// Sets the Skin CSS
30
document.write( '<link href="' + dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
31
 
32
// Sets the language direction.
33
window.document.dir = dialogArguments.Editor.FCKLang.Dir ;
34
 
35
var sTitle = dialogArguments.Title ;
36
document.write( '<title>' + sTitle + '</title>' ) ;
37
 
38
function LoadInnerDialog()
39
{
40
	if ( window.onresize )
41
		window.onresize() ;
42
 
43
	// First of all, translate the dialog box contents.
44
	dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ;
45
 
46
	window.frames["frmMain"].document.location.href = dialogArguments.Page ;
47
}
48
 
49
function InnerDialogLoaded()
50
{
51
	var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
52
 
53
	// Set the language direction.
54
	oInnerDoc.dir = dialogArguments.Editor.FCKLang.Dir ;
55
 
56
	// Sets the Skin CSS.
57
	oInnerDoc.write( '<link href="' + dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
58
 
59
	SetOnKeyDown( oInnerDoc ) ;
60
	DisableContextMenu( oInnerDoc ) ;
61
 
62
	return dialogArguments.Editor ;
63
}
64
 
65
function SetOkButton( showIt )
66
{
67
	document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
68
}
69
 
70
var bAutoSize = false ;
71
 
72
function SetAutoSize( autoSize )
73
{
74
	bAutoSize = autoSize ;
75
	RefreshSize() ;
76
}
77
 
78
function RefreshSize()
79
{
80
	if ( bAutoSize )
81
	{
82
		var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
83
 
84
		if ( document.all )
85
			var iFrameHeight	= oInnerDoc.body.offsetHeight ;
86
		else
87
			var iFrameHeight	= document.getElementById('frmMain').contentWindow.innerHeight ;
88
 
89
		var iInnerHeight	= oInnerDoc.body.scrollHeight ;
90
 
91
		var iDiff = iInnerHeight - iFrameHeight ;
92
 
93
		if ( iDiff > 0 )
94
		{
95
			if ( document.all )
96
				window.dialogHeight = ( parseInt( window.dialogHeight ) + iDiff ) + 'px' ;
97
			else
98
				window.resizeBy( 0, iDiff ) ;
99
		}
100
	}
101
}
102
 
103
function Ok()
104
{
105
	if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
106
		Cancel() ;
107
}
108
 
109
function Cancel()
110
{
111
	window.close() ;
112
}
113
 
114
// Object that holds all available tabs.
115
var oTabs = new Object() ;
116
 
117
function TabDiv_OnClick()
118
{
119
	SetSelectedTab( this.TabCode ) ;
120
}
121
 
122
function AddTab( tabCode, tabText, startHidden )
123
{
124
	if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
125
		return ;
126
 
127
	var eTabsRow = document.getElementById( 'Tabs' ) ;
128
 
129
	var oCell = eTabsRow.insertCell(  eTabsRow.cells.length - 1 ) ;
130
	oCell.noWrap = true ;
131
 
132
	var oDiv = document.createElement( 'DIV' ) ;
133
	oDiv.className = 'PopupTab' ;
134
	oDiv.innerHTML = tabText ;
135
	oDiv.TabCode = tabCode ;
136
	oDiv.onclick = TabDiv_OnClick ;
137
 
138
	if ( startHidden )
139
		oDiv.style.display = 'none' ;
140
 
141
	var eTabsRow = document.getElementById( 'TabsRow' ) ;
142
 
143
	oCell.appendChild( oDiv ) ;
144
 
145
	if ( eTabsRow.style.display == 'none' )
146
	{
147
		var eTitleArea = document.getElementById( 'TitleArea' ) ;
148
		eTitleArea.className = 'PopupTitle' ;
149
 
150
		oDiv.className = 'PopupTabSelected' ;
151
		eTabsRow.style.display = '' ;
152
 
153
		if ( ! dialogArguments.Editor.FCKBrowserInfo.IsIE )
154
			window.onresize() ;
155
	}
156
 
157
	oTabs[ tabCode ] = oDiv ;
158
	oTabs[ tabCode ].Index = oTabs.length - 1 ;
159
}
160
 
161
function SetSelectedTab( tabCode )
162
{
163
	for ( var sCode in oTabs )
164
	{
165
		if ( sCode == tabCode )
166
			oTabs[sCode].className = 'PopupTabSelected' ;
167
		else
168
			oTabs[sCode].className = 'PopupTab' ;
169
	}
170
 
171
	if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
172
		window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
173
}
174
 
175
function SetTabVisibility( tabCode, isVisible )
176
{
177
	var oTab = oTabs[ tabCode ] ;
178
	oTab.style.display = isVisible ? '' : 'none' ;
179
 
180
	if ( ! isVisible && oTab.className == 'PopupTabSelected' )
181
	{
182
		for ( var sCode in oTabs )
183
		{
184
			if ( oTabs[sCode].style.display != 'none' )
185
			{
186
				SetSelectedTab( sCode ) ;
187
				break ;
188
			}
189
		}
190
	}
191
}
192
 
193
function SetOnKeyDown( targetDocument )
194
{
195
	targetDocument.onkeydown = function ( e )
196
	{
197
		var e = e || event || this.parentWindow.event ;
198
		switch ( e.keyCode )
199
		{
200
			case 13 :		// ENTER
201
				var oTarget = e.srcElement || e.target ;
202
				if ( oTarget.tagName == 'TEXTAREA' ) return ;
203
				Ok() ;
204
				return false ;
205
			case 27 :		// ESC
206
				Cancel() ;
207
				return false ;
208
				break ;
209
		}
210
	}
211
}
212
SetOnKeyDown( document ) ;
213
 
214
function DisableContextMenu( targetDocument )
215
{
216
	if ( dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ;
217
 
218
	// Disable Right-Click
219
	var oOnContextMenu = function( e )
220
	{
221
		var sTagName = e.target.tagName ;
222
		if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )
223
			e.preventDefault() ;
224
	}
225
	targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
226
}
227
DisableContextMenu( document ) ;
228
 
229
if ( ! dialogArguments.Editor.FCKBrowserInfo.IsIE )
230
{
231
	window.onresize = function()
232
	{
233
		var oFrame = document.getElementById("frmMain") ;
234
 
235
		if ( ! oFrame )
236
		return ;
237
 
238
		oFrame.height = 0 ;
239
 
240
		var oCell = document.getElementById("FrameCell") ;
241
		var iHeight = oCell.offsetHeight ;
242
 
243
		oFrame.height = iHeight - 2 ;
244
	}
245
}
246
 
247
window.onfocus = function()
248
{
249
	document.getElementById('frmMain').contentWindow.focus() ;
250
}
251
 
252
if ( dialogArguments.Editor.FCKBrowserInfo.IsIE )
253
{
254
	function Window_OnBeforeUnload()
255
	{
256
		for ( var t in oTabs )
257
			oTabs[t] = null ;
258
 
259
		dialogArguments.Editor = null ;
260
	}
261
	window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ;
262
}
263
 
264
		</script>
265
	</head>
266
	<body onload="LoadInnerDialog();" class="PopupBody">
267
		<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
268
			<tr>
269
				<td id="TitleArea" class="PopupTitle PopupTitleBorder">
270
					<script type="text/javascript">
271
document.write( sTitle ) ;
272
					</script>
273
				</td>
274
			</tr>
275
			<tr id="TabsRow" style="DISPLAY: none">
276
				<td class="PopupTabArea">
277
					<table border="0" cellpadding="0" cellspacing="0" width="100%">
278
						<tr id="Tabs" onselectstart="return false;">
279
							<td class="PopupTabEmptyArea">&nbsp;</td>
280
							<td class="PopupTabEmptyArea" width="100%">&nbsp;</td>
281
						</tr>
282
					</table>
283
				</td>
284
			</tr>
285
			<tr>
286
				<td id="FrameCell" height="100%" valign="top">
287
					<iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
288
					</iframe>
289
				</td>
290
			</tr>
291
			<tr>
292
				<td class="PopupButtons">
293
					<table border="0" cellpadding="0" cellspacing="0">
294
						<tr>
295
							<td width="100%">&nbsp;</td>
296
							<td nowrap="nowrap">
297
								<input id="btnOk" style="VISIBILITY: hidden; WIDTH: 100px" type="button" value="Ok" class="Button"
298
									onclick="Ok();" fckLang="DlgBtnOK" />&nbsp; <input type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />
299
							</td>
300
						</tr>
301
					</table>
302
				</td>
303
			</tr>
304
		</table>
305
	</body>
306
</html>