1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
\r
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
\r
6 * == BEGIN LICENSE ==
\r
8 * Licensed under the terms of any of the following licenses at your
\r
11 * - GNU General Public License Version 2 or later (the "GPL")
\r
12 * http://www.gnu.org/licenses/gpl.html
\r
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
15 * http://www.gnu.org/licenses/lgpl.html
\r
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
18 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
22 * Main page that holds the editor.
\r
24 <html xmlns="http://www.w3.org/1999/xhtml">
\r
26 <title>FCKeditor</title>
\r
27 <meta name="robots" content="noindex, nofollow" />
\r
28 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
29 <meta http-equiv="Cache-Control" content="public" />
\r
30 <script type="text/javascript">
\r
32 // Instead of loading scripts and CSSs using inline tags, all scripts are
\r
33 // loaded by code. In this way we can guarantee the correct processing order,
\r
34 // otherwise external scripts and inline scripts could be executed in an
\r
35 // unwanted order (IE).
\r
37 function LoadScript( url )
\r
39 document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/scr' + 'ipt>' ) ;
\r
42 function LoadCss( url )
\r
44 document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;
\r
47 // Main editor scripts.
\r
48 var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
\r
50 LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
\r
52 // Base configuration file.
\r
53 LoadScript( '../fckconfig.js' ) ;
\r
56 <script type="text/javascript">
\r
58 if ( FCKBrowserInfo.IsIE )
\r
60 // Remove IE mouse flickering.
\r
63 document.execCommand( 'BackgroundImageCache', false, true ) ;
\r
67 // We have been reported about loading problems caused by the above
\r
68 // line. For safety, let's just ignore errors.
\r
71 // Create the default cleanup object used by the editor.
\r
72 FCK.IECleanup = new FCKIECleanup( window ) ;
\r
73 FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
\r
74 FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
\r
77 // The config hidden field is processed immediately, because
\r
78 // CustomConfigurationsPath may be set in the page.
\r
79 FCKConfig.ProcessHiddenField() ;
\r
81 // Load the custom configurations file (if defined).
\r
82 if ( FCKConfig.CustomConfigurationsPath.length > 0 )
\r
83 LoadScript( FCKConfig.CustomConfigurationsPath ) ;
\r
86 <script type="text/javascript">
\r
88 // Load configurations defined at page level.
\r
89 FCKConfig_LoadPageConfig() ;
\r
91 FCKConfig_PreProcess() ;
\r
93 // Load the active skin CSS.
\r
94 LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;
\r
96 // Load the language file.
\r
97 FCKLanguageManager.Initialize() ;
\r
98 LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
\r
101 <script type="text/javascript">
\r
103 // Initialize the editing area context menu.
\r
104 FCK_ContextMenu_Init() ;
\r
106 FCKPlugins.Load() ;
\r
109 <script type="text/javascript">
\r
111 // Set the editor interface direction.
\r
112 window.document.dir = FCKLang.Dir ;
\r
114 // Activate pasting operations.
\r
115 if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )
\r
116 FCK.Events.AttachEvent( 'OnPaste', FCK.Paste ) ;
\r
119 <script type="text/javascript">
\r
121 window.onload = function()
\r
125 if ( FCKBrowserInfo.IsIE )
\r
126 FCK_PreloadImages() ;
\r
128 LoadToolbarSetup() ;
\r
131 function LoadToolbarSetup()
\r
133 FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
\r
136 function LoadToolbar()
\r
138 var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
\r
140 if ( oToolbarSet.IsLoaded )
\r
144 oToolbarSet.OnLoad = StartEditor ;
\r
145 oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
\r
149 function StartEditor()
\r
151 // Remove the onload listener.
\r
152 FCK.ToolbarSet.OnLoad = null ;
\r
154 FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
\r
156 FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
\r
158 // Start the editor.
\r
159 FCK.StartEditor() ;
\r
162 function WaitForActive( editorInstance, newStatus )
\r
164 if ( newStatus == FCK_STATUS_ACTIVE )
\r
166 if ( FCKBrowserInfo.IsGecko )
\r
167 FCKTools.RunFunction( window.onresize ) ;
\r
169 _AttachFormSubmitToAPI() ;
\r
171 FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
\r
173 // Call the special "FCKeditor_OnComplete" function that should be present in
\r
174 // the HTML page where the editor is located.
\r
175 if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
\r
176 window.parent.FCKeditor_OnComplete( FCK ) ;
\r
180 // Gecko browsers doens't calculate well that IFRAME size so we must
\r
181 // recalculate it every time the window size changes.
\r
182 if ( FCKBrowserInfo.IsGecko )
\r
184 function Window_OnResize()
\r
186 if ( FCKBrowserInfo.IsOpera )
\r
189 var oCell = document.getElementById( 'xEditingArea' ) ;
\r
191 var eInnerElement = oCell.firstChild ;
\r
192 if ( eInnerElement )
\r
194 eInnerElement.style.height = 0 ;
\r
195 eInnerElement.style.height = oCell.scrollHeight - 2 ;
\r
198 window.onresize = Window_OnResize ;
\r
204 <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
\r
205 <tr id="xToolbarRow" style="display: none">
\r
206 <td id="xToolbarSpace" style="overflow: hidden">
\r
207 <table width="100%" cellpadding="0" cellspacing="0">
\r
208 <tr id="xCollapsed" style="display: none">
\r
209 <td id="xExpandHandle" class="TB_Expand" colspan="3">
\r
210 <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
212 <tr id="xExpanded" style="display: none">
\r
213 <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
\r
214 <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
\r
215 <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
216 <td id="xToolbar" class="TB_ToolbarSet"></td>
\r
217 <td class="TB_SideBorder" style="width: 1px"></td>
\r
223 <td id="xEditingArea" valign="top" style="height: 100%"></td>
\r