+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<!--\r
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
- * Copyright (C) 2003-2009 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
- * This page is used by all dialog box as the container.\r
--->\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <title></title>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
- <meta name="robots" content="noindex, nofollow" />\r
- <script type="text/javascript">\r
-// <![CDATA[\r
-\r
-// Domain relaxation logic.\r
-(function()\r
-{\r
- var d = document.domain ;\r
-\r
- while ( true )\r
- {\r
- // Test if we can access a parent property.\r
- try\r
- {\r
- var parentDomain = ( Args().TopWindow || E ).document.domain ;\r
-\r
- if ( document.domain != parentDomain )\r
- document.domain = parentDomain ;\r
-\r
- break ;\r
- }\r
- catch( e ) {}\r
-\r
- // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...\r
- d = d.replace( /.*?(?:\.|$)/, '' ) ;\r
-\r
- if ( d.length == 0 )\r
- break ; // It was not able to detect the domain.\r
-\r
- document.domain = d ;\r
- }\r
-})() ;\r
-\r
-var E = frameElement._DialogArguments.Editor ;\r
-\r
-// It seems referencing to frameElement._DialogArguments directly would lead to memory leaks in IE.\r
-// So let's use functions to access its members instead.\r
-function Args()\r
-{\r
- return frameElement._DialogArguments ;\r
-}\r
-\r
-function ParentDialog( dialog )\r
-{\r
- return dialog ? dialog._ParentDialog : frameElement._ParentDialog ;\r
-}\r
-\r
-var FCK = E.FCK ;\r
-var FCKTools = E.FCKTools ;\r
-var FCKDomTools = E.FCKDomTools ;\r
-var FCKDialog = E.FCKDialog ;\r
-var FCKBrowserInfo = E.FCKBrowserInfo ;\r
-var FCKConfig = E.FCKConfig ;\r
-\r
-// Steal the focus so that the caret would no longer stay in the editor iframe.\r
-window.focus() ;\r
-\r
-// Sets the Skin CSS\r
-document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;\r
-\r
-// Sets the language direction.\r
-var langDir = E.FCKLang.Dir ;\r
-\r
-// For IE6-, the fck_dialog_ie6.js is loaded, used to fix limitations in the browser.\r
-if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )\r
- document.write( '<' + 'script type="text/javascript" src="' + FCKConfig.SkinPath + 'fck_dialog_ie6.js"><' + '\/script>' ) ;\r
-\r
-FCKTools.RegisterDollarFunction( window ) ;\r
-\r
-// Resize related functions.\r
-var Sizer = function()\r
-{\r
- var bAutoSize = false ;\r
-\r
- var retval = {\r
- // Sets whether the dialog should auto-resize according to its content's height.\r
- SetAutoSize : function( autoSize )\r
- {\r
- bAutoSize = autoSize ;\r
- this.RefreshSize() ;\r
- },\r
-\r
- // Fit the dialog container's layout to the inner iframe's external size.\r
- RefreshContainerSize : function()\r
- {\r
- var frmMain = $( 'frmMain' ) ;\r
-\r
- if ( frmMain )\r
- {\r
- // Get the container size.\r
- var height = $( 'contents' ).offsetHeight ;\r
-\r
- // Subtract the size of other elements.\r
- height -= $( 'TitleArea' ).offsetHeight ;\r
- height -= $( 'TabsRow' ).offsetHeight ;\r
- height -= $( 'PopupButtons' ).offsetHeight ;\r
-\r
- frmMain.style.height = Math.max( height, 0 ) + 'px' ;\r
- }\r
- },\r
-\r
- // Resize and re-layout the dialog.\r
- // Triggers the onresize event for the layout logic.\r
- ResizeDialog : function( width, height )\r
- {\r
- FCKDomTools.SetElementStyles( window.frameElement,\r
- {\r
- 'width' : width + 'px',\r
- 'height' : height + 'px'\r
- } ) ;\r
-\r
- // If the skin have defined a function for resize fixes, call it now.\r
- if ( typeof window.DoResizeFixes == 'function' )\r
- window.DoResizeFixes() ;\r
- },\r
-\r
- // if bAutoSize is true, automatically fit the dialog size and layout to\r
- // accomodate the inner iframe's internal height.\r
- // if bAutoSize is false, then only the layout logic for the dialog decorations\r
- // is run to accomodate the inner iframe's external height.\r
- RefreshSize : function()\r
- {\r
- if ( bAutoSize )\r
- {\r
- var frmMain = $( 'frmMain' ) ;\r
- var innerDoc = frmMain.contentWindow.document ;\r
- var isStrict = FCKTools.IsStrictMode( innerDoc ) ;\r
-\r
- // Get the size of the frame contents.\r
- var innerWidth = isStrict ? innerDoc.documentElement.scrollWidth : innerDoc.body.scrollWidth ;\r
- var innerHeight = isStrict ? innerDoc.documentElement.scrollHeight : innerDoc.body.scrollHeight ;\r
-\r
- // Get the current frame size.\r
- var frameSize = FCKTools.GetViewPaneSize( frmMain.contentWindow ) ;\r
-\r
- var deltaWidth = innerWidth - frameSize.Width ;\r
- var deltaHeight = innerHeight - frameSize.Height ;\r
-\r
- // If the contents fits the current size.\r
- if ( deltaWidth <= 0 && deltaHeight <= 0 )\r
- return ;\r
-\r
- var dialogWidth = frameElement.offsetWidth + Math.max( deltaWidth, 0 ) ;\r
- var dialogHeight = frameElement.offsetHeight + Math.max( deltaHeight, 0 ) ;\r
-\r
- this.ResizeDialog( dialogWidth, dialogHeight ) ;\r
- }\r
- this.RefreshContainerSize() ;\r
- }\r
- }\r
-\r
- /**\r
- * Safari seems to have a bug with the time when RefreshSize() is executed - it\r
- * thinks frmMain's innerHeight is 0 if we query the value too soon after the\r
- * page is loaded in some circumstances. (#1316)\r
- * TODO : Maybe this is not needed anymore after #35.\r
- */\r
- if ( FCKBrowserInfo.IsSafari )\r
- {\r
- var originalRefreshSize = retval.RefreshSize ;\r
-\r
- retval.RefreshSize = function()\r
- {\r
- FCKTools.SetTimeout( originalRefreshSize, 1, retval ) ;\r
- }\r
- }\r
-\r
- /**\r
- * IE6 has a similar bug where it sometimes thinks $('contents') has an\r
- * offsetHeight of 0 (#2114).\r
- */\r
- if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )\r
- {\r
- var originalRefreshContainerSize = retval.RefreshContainerSize ;\r
- retval.RefreshContainerSize = function()\r
- {\r
- FCKTools.SetTimeout( originalRefreshContainerSize, 1, retval ) ;\r
- }\r
- }\r
-\r
- window.onresize = function()\r
- {\r
- retval.RefreshContainerSize() ;\r
- }\r
-\r
- window.SetAutoSize = FCKTools.Bind( retval, retval.SetAutoSize ) ;\r
-\r
- return retval ;\r
-}() ;\r
-\r
-// Manages the throbber image that appears if the inner part of dialog is taking too long to load.\r
-var Throbber = function()\r
-{\r
- var timer ;\r
-\r
- var updateThrobber = function()\r
- {\r
- var throbberParent = $( 'throbberBlock' ) ;\r
- var throbberBlocks = throbberParent.childNodes ;\r
- var lastClass = throbberParent.lastChild.className ;\r
-\r
- // From the last to the second one, copy the class from the previous one.\r
- for ( var i = throbberBlocks.length - 1 ; i > 0 ; i-- )\r
- throbberBlocks[i].className = throbberBlocks[i-1].className ;\r
-\r
- // For the first one, copy the last class (rotation).\r
- throbberBlocks[0].className = lastClass ;\r
- }\r
-\r
- return {\r
- Show : function( waitMilliseconds )\r
- {\r
- // Auto-setup the Show function to be called again after the\r
- // requested amount of time.\r
- if ( waitMilliseconds && waitMilliseconds > 0 )\r
- {\r
- timer = FCKTools.SetTimeout( this.Show, waitMilliseconds, this, null, window ) ;\r
- return ;\r
- }\r
-\r
- var throbberParent = $( 'throbberBlock' ) ;\r
-\r
- if (throbberParent.childNodes.length == 0)\r
- {\r
- // Create the throbber blocks.\r
- var classIds = [ 1,2,3,4,5,4,3,2 ] ;\r
- while ( classIds.length > 0 )\r
- throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ;\r
- }\r
-\r
- // Center the throbber.\r
- var frm = $( 'contents' ) ;\r
- var frmCoords = FCKTools.GetDocumentPosition( window, frm ) ;\r
- var x = frmCoords.x + ( frm.offsetWidth - throbberParent.offsetWidth ) / 2 ;\r
- var y = frmCoords.y + ( frm.offsetHeight - throbberParent.offsetHeight ) / 2 ;\r
- throbberParent.style.left = parseInt( x, 10 ) + 'px' ;\r
- throbberParent.style.top = parseInt( y, 10 ) + 'px' ;\r
-\r
- // Show it.\r
- throbberParent.style.visibility = '' ;\r
-\r
- // Hide tabs and buttons:\r
- $( 'Tabs' ).style.visibility = 'hidden' ;\r
- $( 'PopupButtons' ).style.visibility = 'hidden' ;\r
-\r
- // Setup the animation interval.\r
- timer = setInterval( updateThrobber, 100 ) ;\r
- },\r
-\r
- Hide : function()\r
- {\r
- if ( timer )\r
- {\r
- clearInterval( timer ) ;\r
- timer = null ;\r
- }\r
-\r
- $( 'throbberBlock' ).style.visibility = 'hidden' ;\r
-\r
- // Show tabs and buttons:\r
- $( 'Tabs' ).style.visibility = '' ;\r
- $( 'PopupButtons' ).style.visibility = '' ;\r
- }\r
- } ;\r
-}() ;\r
-\r
-// Drag and drop handlers.\r
-var DragAndDrop = function()\r
-{\r
- var registeredWindows = [] ;\r
- var lastCoords ;\r
- var currentPos ;\r
-\r
- var cleanUpHandlers = function()\r
- {\r
- for ( var i = 0 ; i < registeredWindows.length ; i++ )\r
- {\r
- FCKTools.RemoveEventListener( registeredWindows[i].document, 'mousemove', dragMouseMoveHandler ) ;\r
- FCKTools.RemoveEventListener( registeredWindows[i].document, 'mouseup', dragMouseUpHandler ) ;\r
- }\r
- }\r
-\r
- var dragMouseMoveHandler = function( evt )\r
- {\r
- if ( !lastCoords )\r
- return ;\r
-\r
- if ( !evt )\r
- evt = FCKTools.GetElementDocument( this ).parentWindow.event ;\r
-\r
- // Updated the last coordinates.\r
- var currentCoords =\r
- {\r
- x : evt.screenX,\r
- y : evt.screenY\r
- } ;\r
-\r
- currentPos =\r
- {\r
- x : currentPos.x + ( currentCoords.x - lastCoords.x ),\r
- y : currentPos.y + ( currentCoords.y - lastCoords.y )\r
- } ;\r
-\r
- lastCoords = currentCoords ;\r
-\r
- frameElement.style.left = currentPos.x + 'px' ;\r
- frameElement.style.top = currentPos.y + 'px' ;\r
-\r
- if ( evt.preventDefault )\r
- evt.preventDefault() ;\r
- else\r
- evt.returnValue = false ;\r
- }\r
-\r
- var dragMouseUpHandler = function( evt )\r
- {\r
- if ( !lastCoords )\r
- return ;\r
- if ( !evt )\r
- evt = FCKTools.GetElementDocument( this ).parentWindow.event ;\r
- cleanUpHandlers() ;\r
- lastCoords = null ;\r
- }\r
-\r
- return {\r
-\r
- MouseDownHandler : function( evt )\r
- {\r
- var view = null ;\r
- if ( !evt )\r
- {\r
- view = FCKTools.GetElementDocument( this ).parentWindow ;\r
- evt = view.event ;\r
- }\r
- else\r
- view = evt.view ;\r
-\r
- var target = evt.srcElement || evt.target ;\r
- if ( target.id == 'closeButton' || target.className == 'PopupTab' || target.className == 'PopupTabSelected' )\r
- return ;\r
-\r
- lastCoords =\r
- {\r
- x : evt.screenX,\r
- y : evt.screenY\r
- } ;\r
-\r
- // Save the current IFRAME position.\r
- currentPos =\r
- {\r
- x : parseInt( FCKDomTools.GetCurrentElementStyle( frameElement, 'left' ), 10 ),\r
- y : parseInt( FCKDomTools.GetCurrentElementStyle( frameElement, 'top' ), 10 )\r
- } ;\r
-\r
- for ( var i = 0 ; i < registeredWindows.length ; i++ )\r
- {\r
- FCKTools.AddEventListener( registeredWindows[i].document, 'mousemove', dragMouseMoveHandler ) ;\r
- FCKTools.AddEventListener( registeredWindows[i].document, 'mouseup', dragMouseUpHandler ) ;\r
- }\r
-\r
- if ( evt.preventDefault )\r
- evt.preventDefault() ;\r
- else\r
- evt.returnValue = false ;\r
- },\r
-\r
- RegisterHandlers : function( w )\r
- {\r
- registeredWindows.push( w ) ;\r
- }\r
- }\r
-}() ;\r
-\r
-// Selection related functions.\r
-//(Became simple shortcuts after the fix for #1990)\r
-var Selection =\r
-{\r
- /**\r
- * Ensures that the editing area contains an active selection. This is a\r
- * requirement for IE, as it looses the selection when the focus moves to other\r
- * frames.\r
- */\r
- EnsureSelection : function()\r
- {\r
- // Move the focus to the Cancel button so even if the dialog contains a\r
- // contentEditable element the selection is properly restored in the editor #2496\r
- window.focus() ;\r
- $( 'btnCancel' ).focus() ;\r
-\r
- FCK.Selection.Restore() ;\r
- },\r
-\r
- /**\r
- * Get the FCKSelection object for the editor instance.\r
- */\r
- GetSelection : function()\r
- {\r
- return FCK.Selection ;\r
- },\r
-\r
- /**\r
- * Get the selected element in the editing area (for object selections).\r
- */\r
- GetSelectedElement : function()\r
- {\r
- return FCK.Selection.GetSelectedElement() ;\r
- }\r
-}\r
-\r
-// Tab related functions.\r
-var Tabs = function()\r
-{\r
- // Only element ids should be stored here instead of element references since setSelectedTab and TabDiv_OnClick\r
- // would build circular references with the element references inside and cause memory leaks in IE6.\r
- var oTabs = new Object() ;\r
-\r
- var setSelectedTab = function( tabCode )\r
- {\r
- for ( var sCode in oTabs )\r
- {\r
- if ( sCode == tabCode )\r
- $( oTabs[sCode] ).className = 'PopupTabSelected' ;\r
- else\r
- $( oTabs[sCode] ).className = 'PopupTab' ;\r
- }\r
-\r
- if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )\r
- window.frames["frmMain"].OnDialogTabChange( tabCode ) ;\r
- }\r
-\r
- function TabDiv_OnClick()\r
- {\r
- setSelectedTab( this.TabCode ) ;\r
- }\r
-\r
- window.AddTab = function( tabCode, tabText, startHidden )\r
- {\r
- if ( typeof( oTabs[ tabCode ] ) != 'undefined' )\r
- return ;\r
-\r
- var eTabsRow = $( 'Tabs' ) ;\r
-\r
- var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ;\r
- oCell.noWrap = true ;\r
-\r
- var oDiv = document.createElement( 'DIV' ) ;\r
- oDiv.className = 'PopupTab' ;\r
- oDiv.innerHTML = tabText ;\r
- oDiv.TabCode = tabCode ;\r
- oDiv.onclick = TabDiv_OnClick ;\r
- oDiv.id = Math.random() ;\r
-\r
- if ( startHidden )\r
- oDiv.style.display = 'none' ;\r
-\r
- eTabsRow = $( 'TabsRow' ) ;\r
-\r
- oCell.appendChild( oDiv ) ;\r
-\r
- if ( eTabsRow.style.display == 'none' )\r
- {\r
- var eTitleArea = $( 'TitleArea' ) ;\r
- eTitleArea.className = 'PopupTitle' ;\r
-\r
- oDiv.className = 'PopupTabSelected' ;\r
- eTabsRow.style.display = '' ;\r
-\r
- if ( window.onresize )\r
- window.onresize() ;\r
- }\r
-\r
- oTabs[ tabCode ] = oDiv.id ;\r
-\r
- FCKTools.DisableSelection( oDiv ) ;\r
- } ;\r
-\r
- window.SetSelectedTab = setSelectedTab ;\r
-\r
- window.SetTabVisibility = function( tabCode, isVisible )\r
- {\r
- var oTab = $( oTabs[ tabCode ] ) ;\r
- oTab.style.display = isVisible ? '' : 'none' ;\r
-\r
- if ( ! isVisible && oTab.className == 'PopupTabSelected' )\r
- {\r
- for ( var sCode in oTabs )\r
- {\r
- if ( $( oTabs[sCode] ).style.display != 'none' )\r
- {\r
- setSelectedTab( sCode ) ;\r
- break ;\r
- }\r
- }\r
- }\r
- } ;\r
-}() ;\r
-\r
-// readystatechange handler for registering drag and drop handlers in cover\r
-// iframes, defined out here to avoid memory leak.\r
-// Do NOT put this function as a private function as it will induce memory leak\r
-// in IE and it's not detectable with Drip or sIEve and undetectable leaks are\r
-// really nasty (sigh).\r
-var onReadyRegister = function()\r
-{\r
- if ( this.readyState != 'complete' )\r
- return ;\r
- DragAndDrop.RegisterHandlers( this.contentWindow ) ;\r
-} ;\r
-\r
-// The business logic of the dialog, dealing with operational things like\r
-// dialog open/dialog close/enable/disable/etc.\r
-(function()\r
-{\r
- var setOnKeyDown = function( targetDocument )\r
- {\r
- targetDocument.onkeydown = function ( e )\r
- {\r
- e = e || event || this.parentWindow.event ;\r
- switch ( e.keyCode )\r
- {\r
- case 13 : // ENTER\r
- var oTarget = e.srcElement || e.target ;\r
- if ( oTarget.tagName == 'TEXTAREA' )\r
- return true ;\r
- Ok() ;\r
- return false ;\r
-\r
- case 27 : // ESC\r
- Cancel() ;\r
- return false ;\r
- }\r
- return true ;\r
- }\r
- } ;\r
-\r
- var contextMenuBlocker = function( e )\r
- {\r
- var sTagName = e.target.tagName ;\r
- if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )\r
- e.preventDefault() ;\r
- } ;\r
-\r
- var disableContextMenu = function( targetDocument )\r
- {\r
- if ( FCKBrowserInfo.IsIE )\r
- return ;\r
-\r
- targetDocument.addEventListener( 'contextmenu', contextMenuBlocker, true ) ;\r
- } ;\r
-\r
- // Program entry point.\r
- window.Init = function()\r
- {\r
- $( 'contents' ).dir = langDir;\r
-\r
- // Start the throbber timer.\r
- Throbber.Show( 1000 ) ;\r
-\r
- Sizer.RefreshContainerSize() ;\r
- LoadInnerDialog() ;\r
-\r
- FCKTools.DisableSelection( document.body ) ;\r
-\r
- // Make the title area draggable.\r
- var titleElement = $( 'header' ) ;\r
- titleElement.onmousedown = DragAndDrop.MouseDownHandler ;\r
-\r
- // Connect mousemove and mouseup events from dialog frame and outer window to dialog dragging logic.\r
- DragAndDrop.RegisterHandlers( window ) ;\r
- DragAndDrop.RegisterHandlers( Args().TopWindow ) ;\r
-\r
- // Disable the previous dialog if it exists.\r
- if ( ParentDialog() )\r
- {\r
- ParentDialog().contentWindow.SetEnabled( false ) ;\r
- if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )\r
- {\r
- var currentParent = ParentDialog() ;\r
- while ( currentParent )\r
- {\r
- var blockerFrame = currentParent.contentWindow.$( 'blocker' ) ;\r
- if ( blockerFrame.readyState == 'complete' )\r
- DragAndDrop.RegisterHandlers( blockerFrame.contentWindow ) ;\r
- else\r
- blockerFrame.onreadystatechange = onReadyRegister ;\r
- currentParent = ParentDialog( currentParent ) ;\r
- }\r
- }\r
- else\r
- {\r
- var currentParent = ParentDialog() ;\r
- while ( currentParent )\r
- {\r
- DragAndDrop.RegisterHandlers( currentParent.contentWindow ) ;\r
- currentParent = ParentDialog( currentParent ) ;\r
- }\r
- }\r
- }\r
-\r
- // If this is the only dialog on screen, enable the background cover.\r
- if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )\r
- {\r
- var blockerFrame = FCKDialog.GetCover().firstChild ;\r
- if ( blockerFrame.readyState == 'complete' )\r
- DragAndDrop.RegisterHandlers( blockerFrame.contentWindow ) ;\r
- else\r
- blockerFrame.onreadystatechange = onReadyRegister;\r
- }\r
-\r
- // Add Enter/Esc hotkeys and disable context menu for the dialog.\r
- setOnKeyDown( document ) ;\r
- disableContextMenu( document ) ;\r
- } ;\r
-\r
- window.LoadInnerDialog = function()\r
- {\r
- if ( window.onresize )\r
- window.onresize() ;\r
-\r
- // First of all, translate the dialog box contents.\r
- E.FCKLanguageManager.TranslatePage( document ) ;\r
-\r
- // Create the IFRAME that holds the dialog contents.\r
- $( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"><\/iframe>' ;\r
- } ;\r
-\r
- window.InnerDialogLoaded = function()\r
- {\r
- // If the dialog has been closed before the iframe is loaded, do nothing.\r
- if ( !frameElement.parentNode )\r
- return null ;\r
-\r
- Throbber.Hide() ;\r
-\r
- var frmMain = $('frmMain') ;\r
- var innerWindow = frmMain.contentWindow ;\r
- var innerDoc = innerWindow.document ;\r
-\r
- // Show the loaded iframe.\r
- frmMain.style.visibility = '' ;\r
-\r
- // Set the language direction.\r
- innerDoc.documentElement.dir = langDir ;\r
-\r
- // Sets the Skin CSS.\r
- innerDoc.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;\r
-\r
- setOnKeyDown( innerDoc ) ;\r
- disableContextMenu( innerDoc ) ;\r
-\r
- Sizer.RefreshContainerSize();\r
-\r
- DragAndDrop.RegisterHandlers( innerWindow ) ;\r
-\r
- innerWindow.focus() ;\r
-\r
- return E ;\r
- } ;\r
-\r
- window.SetOkButton = function( showIt )\r
- {\r
- $('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;\r
- } ;\r
-\r
- window.Ok = function()\r
- {\r
- Selection.EnsureSelection() ;\r
-\r
- var frmMain = window.frames["frmMain"] ;\r
-\r
- if ( frmMain.Ok && frmMain.Ok() )\r
- CloseDialog() ;\r
- else\r
- frmMain.focus() ;\r
- } ;\r
-\r
- window.Cancel = function( dontFireChange )\r
- {\r
- Selection.EnsureSelection() ;\r
- return CloseDialog( dontFireChange ) ;\r
- } ;\r
-\r
- window.CloseDialog = function( dontFireChange )\r
- {\r
- Throbber.Hide() ;\r
-\r
- // Points the src to a non-existent location to avoid loading errors later, in case the dialog\r
- // haven't been completed loaded at this point.\r
- if ( $( 'frmMain' ) )\r
- $( 'frmMain' ).src = FCKTools.GetVoidUrl() ;\r
-\r
- if ( !dontFireChange && !FCK.EditMode )\r
- {\r
- // All dialog windows, by default, will fire the "OnSelectionChange"\r
- // event, no matter the Ok or Cancel button has been pressed.\r
- // It seems that OnSelectionChange may enter on a concurrency state\r
- // on some situations (#1965), so we should put the event firing in\r
- // the execution queue instead of executing it immediately.\r
- setTimeout( function()\r
- {\r
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;\r
- }, 0 ) ;\r
- }\r
-\r
- FCKDialog.OnDialogClose( window ) ;\r
- } ;\r
-\r
- window.SetEnabled = function( isEnabled )\r
- {\r
- var cover = $( 'cover' ) ;\r
- cover.style.display = isEnabled ? 'none' : '' ;\r
-\r
- if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )\r
- {\r
- if ( !isEnabled )\r
- {\r
- // Inser the blocker IFRAME before the cover.\r
- var blocker = document.createElement( 'iframe' ) ;\r
- blocker.src = FCKTools.GetVoidUrl() ;\r
- blocker.hideFocus = true ;\r
- blocker.frameBorder = 0 ;\r
- blocker.id = blocker.className = 'blocker' ;\r
- cover.appendChild( blocker ) ;\r
- }\r
- else\r
- {\r
- var blocker = $( 'blocker' ) ;\r
- if ( blocker && blocker.parentNode )\r
- blocker.parentNode.removeChild( blocker ) ;\r
- }\r
- }\r
- } ;\r
-})() ;\r
-// ]]>\r
- </script>\r
- </head>\r
- <body onload="Init();" class="PopupBody">\r
- <div class="contents" id="contents">\r
- <div id="header">\r
- <div id="TitleArea" class="PopupTitle PopupTitleBorder">\r
- <script type="text/javascript">\r
-// <![CDATA[\r
-document.write( Args().Title ) ;\r
-// ]]>\r
- </script>\r
- <div id="closeButton" onclick="Cancel();"></div>\r
- </div>\r
- <div id="TabsRow" class="PopupTabArea" style="display: none">\r
- <table border="0" cellpadding="0" cellspacing="0" width="100%">\r
- <tr id="Tabs">\r
- <td class="PopupTabEmptyArea"> </td>\r
- <td class="PopupTabEmptyArea" width="100%"> </td>\r
- </tr>\r
- </table>\r
- </div>\r
- </div>\r
- <div id="innerContents"></div>\r
- <div id="PopupButtons" class="PopupButtons">\r
- <table border="0" cellpadding="0" cellspacing="0">\r
- <tr>\r
- <td width="100%"> </td>\r
- <td nowrap="nowrap">\r
- <input id="btnOk" style="visibility: hidden;" type="button" value="Ok" class="Button" onclick="Ok();" fckLang="DlgBtnOK" />\r
- \r
- <input id="btnCancel" type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />\r
- </td>\r
- </tr>\r
- </table>\r
- </div>\r
- </div>\r
- <div class="tl"></div>\r
- <div class="tc"></div>\r
- <div class="tr"></div>\r
- <div class="ml"></div>\r
- <div class="mr"></div>\r
- <div class="bl"></div>\r
- <div class="bc"></div>\r
- <div class="br"></div>\r
- <div class="cover" id="cover" style="display:none"></div>\r
- <div id="throbberBlock" style="position: absolute; visibility: hidden"></div>\r
- <script type="text/javascript">\r
-// <![CDATA[\r
- // Set the class name for language direction.\r
- document.body.className += ' ' + langDir ;\r
-\r
- var cover = $( 'cover' ) ;\r
- cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ;\r
- FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;\r
-// ]]>\r
- </script>\r
- </body>\r
-</html>\r