1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* This page is used by all dialog box as the container.
24
<html xmlns="http://www.w3.org/1999/xhtml">
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
<meta name="robots" content="noindex, nofollow" />
28
<script type="text/javascript">
30
// On some Gecko browsers (probably over slow connections) the
31
// "dialogArguments" are not set so we must get it from the opener window.
32
if ( !window.dialogArguments )
33
window.dialogArguments = window.opener.FCKLastDialogInfo ;
36
document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
38
// Sets the language direction.
39
window.document.dir = window.dialogArguments.Editor.FCKLang.Dir ;
41
var sTitle = window.dialogArguments.Title ;
42
document.write( '<title>' + sTitle + '<\/title>' ) ;
44
function LoadInnerDialog()
46
if ( window.onresize )
49
// First of all, translate the dialog box contents.
50
window.dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ;
52
window.frames["frmMain"].document.location.href = window.dialogArguments.Page ;
55
function InnerDialogLoaded()
57
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
59
// Set the language direction.
60
oInnerDoc.dir = window.dialogArguments.Editor.FCKLang.Dir ;
63
oInnerDoc.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
65
SetOnKeyDown( oInnerDoc ) ;
66
DisableContextMenu( oInnerDoc ) ;
68
return window.dialogArguments.Editor ;
71
function SetOkButton( showIt )
73
document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
76
var bAutoSize = false ;
78
function SetAutoSize( autoSize )
80
bAutoSize = autoSize ;
84
function RefreshSize()
88
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
92
iFrameHeight = oInnerDoc.body.offsetHeight ;
94
iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ;
96
var iInnerHeight = oInnerDoc.body.scrollHeight ;
98
var iDiff = iInnerHeight - iFrameHeight ;
103
window.dialogHeight = ( parseInt( window.dialogHeight, 10 ) + iDiff ) + 'px' ;
105
window.resizeBy( 0, iDiff ) ;
112
if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
116
function Cancel( dontFireChange )
118
if ( !dontFireChange )
120
// All dialog windows, by default, will fire the "OnSelectionChange"
121
// event, no matter the Ok or Cancel button has been pressed.
122
window.dialogArguments.Editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ;
127
// Object that holds all available tabs.
128
var oTabs = new Object() ;
130
function TabDiv_OnClick()
132
SetSelectedTab( this.TabCode ) ;
135
function AddTab( tabCode, tabText, startHidden )
137
if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
140
var eTabsRow = document.getElementById( 'Tabs' ) ;
142
var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ;
143
oCell.noWrap = true ;
145
var oDiv = document.createElement( 'DIV' ) ;
146
oDiv.className = 'PopupTab' ;
147
oDiv.innerHTML = tabText ;
148
oDiv.TabCode = tabCode ;
149
oDiv.onclick = TabDiv_OnClick ;
152
oDiv.style.display = 'none' ;
154
eTabsRow = document.getElementById( 'TabsRow' ) ;
156
oCell.appendChild( oDiv ) ;
158
if ( eTabsRow.style.display == 'none' )
160
var eTitleArea = document.getElementById( 'TitleArea' ) ;
161
eTitleArea.className = 'PopupTitle' ;
163
oDiv.className = 'PopupTabSelected' ;
164
eTabsRow.style.display = '' ;
166
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
170
oTabs[ tabCode ] = oDiv ;
173
function SetSelectedTab( tabCode )
175
for ( var sCode in oTabs )
177
if ( sCode == tabCode )
178
oTabs[sCode].className = 'PopupTabSelected' ;
180
oTabs[sCode].className = 'PopupTab' ;
183
if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
184
window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
187
function SetTabVisibility( tabCode, isVisible )
189
var oTab = oTabs[ tabCode ] ;
190
oTab.style.display = isVisible ? '' : 'none' ;
192
if ( ! isVisible && oTab.className == 'PopupTabSelected' )
194
for ( var sCode in oTabs )
196
if ( oTabs[sCode].style.display != 'none' )
198
SetSelectedTab( sCode ) ;
205
function SetOnKeyDown( targetDocument )
207
targetDocument.onkeydown = function ( e )
209
e = e || event || this.parentWindow.event ;
213
var oTarget = e.srcElement || e.target ;
214
if ( oTarget.tagName == 'TEXTAREA' )
226
SetOnKeyDown( document ) ;
228
function DisableContextMenu( targetDocument )
230
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ;
232
// Disable Right-Click
233
var oOnContextMenu = function( e )
235
var sTagName = e.target.tagName ;
236
if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )
239
targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
241
DisableContextMenu( document ) ;
243
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
245
window.onresize = function()
247
var oFrame = document.getElementById("frmMain") ;
254
var oCell = document.getElementById("FrameCell") ;
255
var iHeight = oCell.offsetHeight ;
257
oFrame.height = iHeight - 2 ;
261
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE )
263
function Window_OnBeforeUnload()
265
for ( var t in oTabs )
268
window.dialogArguments.Editor = null ;
270
window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ;
273
function Window_OnClose()
275
window.dialogArguments.Editor.FCKFocusManager.Unlock() ;
278
if ( window.addEventListener )
279
window.addEventListener( 'unload', Window_OnClose, false ) ;
283
<body onload="LoadInnerDialog();" class="PopupBody">
284
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
286
<td id="TitleArea" class="PopupTitle PopupTitleBorder">
287
<script type="text/javascript">
288
document.write( sTitle ) ;
292
<tr id="TabsRow" style="DISPLAY: none">
293
<td class="PopupTabArea">
294
<table border="0" cellpadding="0" cellspacing="0" width="100%">
295
<tr id="Tabs" onselectstart="return false;">
296
<td class="PopupTabEmptyArea"> </td>
297
<td class="PopupTabEmptyArea" width="100%"> </td>
303
<td id="FrameCell" height="100%" valign="top">
304
<iframe id="frmMain" src="javascript:void(0)" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto">
309
<td class="PopupButtons">
310
<table border="0" cellpadding="0" cellspacing="0">
312
<td width="100%"> </td>
314
<input id="btnOk" style="VISIBILITY: hidden;" type="button" value="Ok" class="Button" onclick="Ok();" fckLang="DlgBtnOK" />
316
<input id="btnCancel" type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />
b'\\ No newline at end of file'