1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2<!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 5 * 6 * == BEGIN LICENSE == 7 * 8 * Licensed under the terms of any of the following licenses at your 9 * choice: 10 * 11 * - GNU General Public License Version 2 or later (the "GPL") 12 * http://www.gnu.org/licenses/gpl.html 13 * 14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 15 * http://www.gnu.org/licenses/lgpl.html 16 * 17 * - Mozilla Public License Version 1.1 or later (the "MPL") 18 * http://www.mozilla.org/MPL/MPL-1.1.html 19 * 20 * == END LICENSE == 21 * 22 * Main page that holds the editor. 23--> 24<html> 25<head> 26 <title>FCKeditor</title> 27 <meta name="robots" content="noindex, nofollow"> 28 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 29 <meta http-equiv="Cache-Control" content="public" /> 30 <script type="text/javascript"> 31 32// Instead of loading scripts and CSSs using inline tags, all scripts are 33// loaded by code. In this way we can guarantee the correct processing order, 34// otherwise external scripts and inline scripts could be executed in an 35// unwanted order (IE). 36 37function LoadScript( url ) 38{ 39 document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ; 40} 41 42function LoadCss( url ) 43{ 44 document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" />' ) ; 45} 46 47// Main editor scripts. 48var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ; 49 50LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ; 51 52// Base configuration file. 53LoadScript( '../fckconfig.js' ) ; 54 55 </script> 56 <script type="text/javascript"> 57 58if ( FCKBrowserInfo.IsIE ) 59{ 60 // Remove IE mouse flickering. 61 try 62 { 63 document.execCommand( 'BackgroundImageCache', false, true ) ; 64 } 65 catch (e) 66 { 67 // We have been reported about loading problems caused by the above 68 // line. For safety, let's just ignore errors. 69 } 70 71 // Create the default cleanup object used by the editor. 72 FCK.IECleanup = new FCKIECleanup( window ) ; 73 FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ; 74 FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ; 75} 76 77// The first function to be called on selection change must the the styles 78// change checker, because the result of its processing may be used by another 79// functions listening to the same event. 80FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ; 81 82// The config hidden field is processed immediately, because 83// CustomConfigurationsPath may be set in the page. 84FCKConfig.ProcessHiddenField() ; 85 86// Load the custom configurations file (if defined). 87if ( FCKConfig.CustomConfigurationsPath.length > 0 ) 88 LoadScript( FCKConfig.CustomConfigurationsPath ) ; 89 90 </script> 91 <script type="text/javascript"> 92 93// Load configurations defined at page level. 94FCKConfig_LoadPageConfig() ; 95 96FCKConfig_PreProcess() ; 97 98// Load the active skin CSS. 99LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ; 100 101// Load the language file. 102FCKLanguageManager.Initialize() ; 103LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ; 104 105 </script> 106 <script type="text/javascript"> 107 108// Initialize the editing area context menu. 109FCK_ContextMenu_Init() ; 110 111FCKPlugins.Load() ; 112 113 </script> 114 <script type="text/javascript"> 115 116// Set the editor interface direction. 117window.document.dir = FCKLang.Dir ; 118 119 </script> 120 <script type="text/javascript"> 121 122window.onload = function() 123{ 124 InitializeAPI() ; 125 126 if ( FCKBrowserInfo.IsIE ) 127 FCK_PreloadImages() ; 128 else 129 LoadToolbarSetup() ; 130} 131 132function LoadToolbarSetup() 133{ 134 FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ; 135} 136 137function LoadToolbar() 138{ 139 var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ; 140 141 if ( oToolbarSet.IsLoaded ) 142 StartEditor() ; 143 else 144 { 145 oToolbarSet.OnLoad = StartEditor ; 146 oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ; 147 } 148} 149 150function StartEditor() 151{ 152 // Remove the onload listener. 153 FCK.ToolbarSet.OnLoad = null ; 154 155 FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ; 156 157 FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ; 158 159 // Start the editor. 160 FCK.StartEditor() ; 161} 162 163function WaitForActive( editorInstance, newStatus ) 164{ 165 if ( newStatus == FCK_STATUS_ACTIVE ) 166 { 167 if ( FCKBrowserInfo.IsGecko ) 168 FCKTools.RunFunction( window.onresize ) ; 169 170 _AttachFormSubmitToAPI() ; 171 172 FCK.SetStatus( FCK_STATUS_COMPLETE ) ; 173 174 // Call the special "FCKeditor_OnComplete" function that should be present in 175 // the HTML page where the editor is located. 176 if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' ) 177 window.parent.FCKeditor_OnComplete( FCK ) ; 178 } 179} 180 181// Gecko browsers doens't calculate well that IFRAME size so we must 182// recalculate it every time the window size changes. 183if ( FCKBrowserInfo.IsGecko ) 184{ 185 function Window_OnResize() 186 { 187 if ( FCKBrowserInfo.IsOpera ) 188 return ; 189 190 var oCell = document.getElementById( 'xEditingArea' ) ; 191 192 var eInnerElement = oCell.firstChild ; 193 if ( eInnerElement ) 194 { 195 eInnerElement.style.height = 0 ; 196 eInnerElement.style.height = oCell.scrollHeight - 2 ; 197 } 198 } 199 window.onresize = Window_OnResize ; 200} 201 202 </script> 203</head> 204<body> 205 <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed"> 206 <tr id="xToolbarRow" style="display: none"> 207 <td id="xToolbarSpace" style="overflow: hidden"> 208 <table width="100%" cellpadding="0" cellspacing="0"> 209 <tr id="xCollapsed" style="display: none"> 210 <td id="xExpandHandle" class="TB_Expand" colspan="3"> 211 <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td> 212 </tr> 213 <tr id="xExpanded" style="display: none"> 214 <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td> 215 <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom"> 216 <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td> 217 <td id="xToolbar" class="TB_ToolbarSet"></td> 218 <td class="TB_SideBorder" style="width: 1px"></td> 219 </tr> 220 </table> 221 </td> 222 </tr> 223 <tr> 224 <td id="xEditingArea" valign="top" style="height: 100%"></td> 225 </tr> 226 </table> 227</body> 228</html> 229