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-2010 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
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 <!-- @Packager.RemoveLine
\r
30 <meta http-equiv="Cache-Control" content="public">
\r
31 @Packager.RemoveLine -->
\r
32 <script type="text/javascript">
\r
34 // #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
\r
35 // without security.fileuri.strict_origin_policy disabled.
\r
36 if ( document.location.protocol == 'file:' )
\r
40 window.parent.document.domain ;
\r
44 window.addEventListener( 'load', function()
\r
46 document.body.innerHTML = '\
\r
47 <div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
\r
49 <b>Your browser security settings don\'t allow FCKeditor to be opened from\
\r
50 the local filesystem.<\/b>\
\r
53 Please open the <b>about:config<\/b> page and disable the\
\r
54 "security.fileuri.strict_origin_policy" option; then load this page again.\
\r
57 Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
\r
58 for more information.\
\r
65 // Save a reference to the default domain.
\r
66 var FCK_ORIGINAL_DOMAIN ;
\r
68 // Automatically detect the correct document.domain (#123).
\r
71 var d = FCK_ORIGINAL_DOMAIN = document.domain ;
\r
75 // Test if we can access a parent property.
\r
78 var test = window.parent.document.domain ;
\r
83 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
\r
84 d = d.replace( /.*?(?:\.|$)/, '' ) ;
\r
86 if ( d.length == 0 )
\r
87 break ; // It was not able to detect the domain.
\r
91 document.domain = d ;
\r
100 // Save a reference to the detected runtime domain.
\r
101 var FCK_RUNTIME_DOMAIN = document.domain ;
\r
103 var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;
\r
105 // Instead of loading scripts and CSSs using inline tags, all scripts are
\r
106 // loaded by code. In this way we can guarantee the correct processing order,
\r
107 // otherwise external scripts and inline scripts could be executed in an
\r
108 // unwanted order (IE).
\r
110 function LoadScript( url )
\r
112 document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ;
\r
115 // Main editor scripts.
\r
116 var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ;
\r
118 /* @Packager.RemoveLine
\r
119 LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
\r
120 @Packager.RemoveLine */
\r
121 // @Packager.Remove.Start
\r
123 LoadScript( '_source/fckconstants.js' ) ;
\r
124 LoadScript( '_source/fckjscoreextensions.js' ) ;
\r
126 if ( sSuffix == 'ie' )
\r
127 LoadScript( '_source/classes/fckiecleanup.js' ) ;
\r
129 LoadScript( '_source/internals/fckbrowserinfo.js' ) ;
\r
130 LoadScript( '_source/internals/fckurlparams.js' ) ;
\r
131 LoadScript( '_source/classes/fckevents.js' ) ;
\r
132 LoadScript( '_source/classes/fckdataprocessor.js' ) ;
\r
133 LoadScript( '_source/internals/fck.js' ) ;
\r
134 LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ;
\r
135 LoadScript( '_source/internals/fckconfig.js' ) ;
\r
137 LoadScript( '_source/internals/fckdebug_empty.js' ) ;
\r
138 LoadScript( '_source/internals/fckdomtools.js' ) ;
\r
139 LoadScript( '_source/internals/fcktools.js' ) ;
\r
140 LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
\r
141 LoadScript( '_source/fckeditorapi.js' ) ;
\r
142 LoadScript( '_source/classes/fckimagepreloader.js' ) ;
\r
143 LoadScript( '_source/internals/fckregexlib.js' ) ;
\r
144 LoadScript( '_source/internals/fcklistslib.js' ) ;
\r
145 LoadScript( '_source/internals/fcklanguagemanager.js' ) ;
\r
146 LoadScript( '_source/internals/fckxhtmlentities.js' ) ;
\r
147 LoadScript( '_source/internals/fckxhtml.js' ) ;
\r
148 LoadScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
\r
149 LoadScript( '_source/internals/fckcodeformatter.js' ) ;
\r
150 LoadScript( '_source/internals/fckundo.js' ) ;
\r
151 LoadScript( '_source/classes/fckeditingarea.js' ) ;
\r
152 LoadScript( '_source/classes/fckkeystrokehandler.js' ) ;
\r
154 LoadScript( 'dtd/fck_xhtml10transitional.js' ) ;
\r
155 LoadScript( '_source/classes/fckstyle.js' ) ;
\r
156 LoadScript( '_source/internals/fckstyles.js' ) ;
\r
158 LoadScript( '_source/internals/fcklisthandler.js' ) ;
\r
159 LoadScript( '_source/classes/fckelementpath.js' ) ;
\r
160 LoadScript( '_source/classes/fckdomrange.js' ) ;
\r
161 LoadScript( '_source/classes/fckdocumentfragment_' + sSuffix + '.js' ) ;
\r
162 LoadScript( '_source/classes/fckw3crange.js' ) ;
\r
163 LoadScript( '_source/classes/fckdomrange_' + sSuffix + '.js' ) ;
\r
164 LoadScript( '_source/classes/fckdomrangeiterator.js' ) ;
\r
165 LoadScript( '_source/classes/fckenterkey.js' ) ;
\r
167 LoadScript( '_source/internals/fckdocumentprocessor.js' ) ;
\r
168 LoadScript( '_source/internals/fckselection.js' ) ;
\r
169 LoadScript( '_source/internals/fckselection_' + sSuffix + '.js' ) ;
\r
171 LoadScript( '_source/internals/fcktablehandler.js' ) ;
\r
172 LoadScript( '_source/internals/fcktablehandler_' + sSuffix + '.js' ) ;
\r
173 LoadScript( '_source/classes/fckxml.js' ) ;
\r
174 LoadScript( '_source/classes/fckxml_' + sSuffix + '.js' ) ;
\r
176 LoadScript( '_source/commandclasses/fcknamedcommand.js' ) ;
\r
177 LoadScript( '_source/commandclasses/fckstylecommand.js' ) ;
\r
178 LoadScript( '_source/commandclasses/fck_othercommands.js' ) ;
\r
179 LoadScript( '_source/commandclasses/fckshowblocks.js' ) ;
\r
180 LoadScript( '_source/commandclasses/fckspellcheckcommand_' + sSuffix + '.js' ) ;
\r
181 LoadScript( '_source/commandclasses/fcktextcolorcommand.js' ) ;
\r
182 LoadScript( '_source/commandclasses/fckpasteplaintextcommand.js' ) ;
\r
183 LoadScript( '_source/commandclasses/fckpastewordcommand.js' ) ;
\r
184 LoadScript( '_source/commandclasses/fcktablecommand.js' ) ;
\r
185 LoadScript( '_source/commandclasses/fckfitwindow.js' ) ;
\r
186 LoadScript( '_source/commandclasses/fcklistcommands.js' ) ;
\r
187 LoadScript( '_source/commandclasses/fckjustifycommands.js' ) ;
\r
188 LoadScript( '_source/commandclasses/fckindentcommands.js' ) ;
\r
189 LoadScript( '_source/commandclasses/fckblockquotecommand.js' ) ;
\r
190 LoadScript( '_source/commandclasses/fckcorestylecommand.js' ) ;
\r
191 LoadScript( '_source/commandclasses/fckremoveformatcommand.js' ) ;
\r
192 LoadScript( '_source/internals/fckcommands.js' ) ;
\r
194 LoadScript( '_source/classes/fckpanel.js' ) ;
\r
195 LoadScript( '_source/classes/fckicon.js' ) ;
\r
196 LoadScript( '_source/classes/fcktoolbarbuttonui.js' ) ;
\r
197 LoadScript( '_source/classes/fcktoolbarbutton.js' ) ;
\r
198 LoadScript( '_source/classes/fckspecialcombo.js' ) ;
\r
199 LoadScript( '_source/classes/fcktoolbarspecialcombo.js' ) ;
\r
200 LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ;
\r
201 LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;
\r
202 LoadScript( '_source/classes/fcktoolbarfontscombo.js' ) ;
\r
203 LoadScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ;
\r
204 LoadScript( '_source/classes/fcktoolbarpanelbutton.js' ) ;
\r
205 LoadScript( '_source/internals/fckscayt.js' ) ;
\r
206 LoadScript( '_source/internals/fcktoolbaritems.js' ) ;
\r
207 LoadScript( '_source/classes/fcktoolbar.js' ) ;
\r
208 LoadScript( '_source/classes/fcktoolbarbreak_' + sSuffix + '.js' ) ;
\r
209 LoadScript( '_source/internals/fcktoolbarset.js' ) ;
\r
210 LoadScript( '_source/internals/fckdialog.js' ) ;
\r
211 LoadScript( '_source/classes/fckmenuitem.js' ) ;
\r
212 LoadScript( '_source/classes/fckmenublock.js' ) ;
\r
213 LoadScript( '_source/classes/fckmenublockpanel.js' ) ;
\r
214 LoadScript( '_source/classes/fckcontextmenu.js' ) ;
\r
215 LoadScript( '_source/internals/fck_contextmenu.js' ) ;
\r
216 LoadScript( '_source/classes/fckhtmliterator.js' ) ;
\r
217 LoadScript( '_source/classes/fckplugin.js' ) ;
\r
218 LoadScript( '_source/internals/fckplugins.js' ) ;
\r
220 // @Packager.Remove.End
\r
222 // Base configuration file.
\r
223 LoadScript( '../fckconfig.js' ) ;
\r
226 <script type="text/javascript">
\r
228 // Adobe AIR compatibility file.
\r
229 if ( FCKBrowserInfo.IsAIR )
\r
230 LoadScript( 'js/fckadobeair.js' ) ;
\r
232 if ( FCKBrowserInfo.IsIE )
\r
234 // Remove IE mouse flickering.
\r
237 document.execCommand( 'BackgroundImageCache', false, true ) ;
\r
241 // We have been reported about loading problems caused by the above
\r
242 // line. For safety, let's just ignore errors.
\r
245 // Create the default cleanup object used by the editor.
\r
246 FCK.IECleanup = new FCKIECleanup( window ) ;
\r
247 FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
\r
248 FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
\r
251 // The first function to be called on selection change must the the styles
\r
252 // change checker, because the result of its processing may be used by another
\r
253 // functions listening to the same event.
\r
254 FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ;
\r
256 // The config hidden field is processed immediately, because
\r
257 // CustomConfigurationsPath may be set in the page.
\r
258 FCKConfig.ProcessHiddenField() ;
\r
260 // Load the custom configurations file (if defined).
\r
261 if ( FCKConfig.CustomConfigurationsPath.length > 0 )
\r
262 LoadScript( FCKConfig.CustomConfigurationsPath ) ;
\r
265 <script type="text/javascript">
\r
267 // Load configurations defined at page level.
\r
268 FCKConfig_LoadPageConfig() ;
\r
270 FCKConfig_PreProcess() ;
\r
272 // Load the full debug script.
\r
273 if ( FCKConfig.Debug )
\r
274 LoadScript( '_source/internals/fckdebug.js' ) ;
\r
277 <script type="text/javascript">
\r
279 var FCK_InternalCSS = FCKConfig.BasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine
\r
280 var FCK_ShowTableBordersCSS = FCKConfig.BasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine
\r
281 /* @Packager.RemoveLine
\r
282 // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
\r
283 var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'html{min-height:100%}table.FCK__ShowTableBorders,table.FCK__ShowTableBorders td,table.FCK__ShowTableBorders th{border:#d3d3d3 1px solid}form{border:1px dotted #F00;padding:2px}.FCK__Flash{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_flashlogo.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__UnknownObject{border:#a9a9a9 1px solid;background-position:center center;background-image:url(images/fck_plugin.gif);background-repeat:no-repeat;width:80px;height:80px}.FCK__Anchor{border:1px dotted #00F;background-position:center center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;width:16px;height:15px;vertical-align:middle}.FCK__AnchorC{border:1px dotted #00F;background-position:1px center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}a[name]{border:1px dotted #00F;background-position:0 center;background-image:url(images/fck_anchor.gif);background-repeat:no-repeat;padding-left:18px}.FCK__PageBreak{background-position:center center;background-image:url(images/fck_pagebreak.gif);background-repeat:no-repeat;clear:both;display:block;float:none;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;border-right:0;border-left:0;height:5px}.FCK__InputHidden{width:19px;height:18px;background-image:url(images/fck_hiddenfield.gif);background-repeat:no-repeat;vertical-align:text-bottom;background-position:center center}.FCK__ShowBlocks p,.FCK__ShowBlocks div,.FCK__ShowBlocks pre,.FCK__ShowBlocks address,.FCK__ShowBlocks blockquote,.FCK__ShowBlocks h1,.FCK__ShowBlocks h2,.FCK__ShowBlocks h3,.FCK__ShowBlocks h4,.FCK__ShowBlocks h5,.FCK__ShowBlocks h6{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px;padding-left:8px}.FCK__ShowBlocks p{background-image:url(images/block_p.png)}.FCK__ShowBlocks div{background-image:url(images/block_div.png)}.FCK__ShowBlocks pre{background-image:url(images/block_pre.png)}.FCK__ShowBlocks address{background-image:url(images/block_address.png)}.FCK__ShowBlocks blockquote{background-image:url(images/block_blockquote.png)}.FCK__ShowBlocks h1{background-image:url(images/block_h1.png)}.FCK__ShowBlocks h2{background-image:url(images/block_h2.png)}.FCK__ShowBlocks h3{background-image:url(images/block_h3.png)}.FCK__ShowBlocks h4{background-image:url(images/block_h4.png)}.FCK__ShowBlocks h5{background-image:url(images/block_h5.png)}.FCK__ShowBlocks h6{background-image:url(images/block_h6.png)}' ) ;
\r
284 var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.BasePath + 'css/', 'table:not([border]),table:not([border]) > tr > td,table:not([border]) > tr > th,table:not([border]) > tbody > tr > td,table:not([border]) > tbody > tr > th,table:not([border]) > thead > tr > td,table:not([border]) > thead > tr > th,table:not([border]) > tfoot > tr > td,table:not([border]) > tfoot > tr > th,table[border=\"0\"],table[border=\"0\"] > tr > td,table[border=\"0\"] > tr > th,table[border=\"0\"] > tbody > tr > td,table[border=\"0\"] > tbody > tr > th,table[border=\"0\"] > thead > tr > td,table[border=\"0\"] > thead > tr > th,table[border=\"0\"] > tfoot > tr > td,table[border=\"0\"] > tfoot > tr > th{border:#d3d3d3 1px dotted}' ) ;
\r
285 @Packager.RemoveLine */
\r
287 // Popup the debug window if debug mode is set to true. It guarantees that the
\r
288 // first debug message will not be lost.
\r
289 if ( FCKConfig.Debug )
\r
290 FCKDebug._GetWindow() ;
\r
292 // Load the active skin CSS.
\r
293 document.write( FCKTools.GetStyleHtml( FCKConfig.SkinEditorCSS ) ) ;
\r
295 // Load the language file.
\r
296 FCKLanguageManager.Initialize() ;
\r
297 LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
\r
300 <script type="text/javascript">
\r
302 // Initialize the editing area context menu.
\r
303 FCK_ContextMenu_Init() ;
\r
305 FCKPlugins.Load() ;
\r
308 <script type="text/javascript">
\r
310 // Set the editor interface direction.
\r
311 window.document.dir = FCKLang.Dir ;
\r
314 <script type="text/javascript">
\r
316 window.onload = function()
\r
320 if ( FCKBrowserInfo.IsIE )
\r
321 FCK_PreloadImages() ;
\r
323 LoadToolbarSetup() ;
\r
326 function LoadToolbarSetup()
\r
328 FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
\r
331 function LoadToolbar()
\r
333 var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
\r
335 if ( oToolbarSet.IsLoaded )
\r
339 oToolbarSet.OnLoad = StartEditor ;
\r
340 oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
\r
344 function StartEditor()
\r
346 // Remove the onload listener.
\r
347 FCK.ToolbarSet.OnLoad = null ;
\r
349 FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
\r
351 FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
\r
353 // Start the editor.
\r
354 FCK.StartEditor() ;
\r
357 function WaitForActive( editorInstance, newStatus )
\r
359 if ( newStatus == FCK_STATUS_ACTIVE )
\r
361 if ( FCKBrowserInfo.IsGecko )
\r
362 FCKTools.RunFunction( window.onresize ) ;
\r
364 if ( !FCKConfig.PreventSubmitHandler )
\r
365 _AttachFormSubmitToAPI() ;
\r
367 FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
\r
369 // Call the special "FCKeditor_OnComplete" function that should be present in
\r
370 // the HTML page where the editor is located.
\r
371 if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
\r
372 window.parent.FCKeditor_OnComplete( FCK ) ;
\r
376 // Gecko and Webkit browsers don't calculate well the IFRAME size so we must
\r
377 // recalculate it every time the window size changes.
\r
378 if ( FCKBrowserInfo.IsGecko || ( FCKBrowserInfo.IsSafari && !FCKBrowserInfo.IsSafari3 ) )
\r
380 window.onresize = function( e )
\r
382 // Running in Firefox's chrome makes the window receive the event including subframes.
\r
383 // we care only about this window. Ticket #1642.
\r
384 // #2002: The originalTarget from the event can be the current document, the window, or the editing area.
\r
385 if ( e && e.originalTarget && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))
\r
388 var oCell = document.getElementById( 'xEditingArea' ) ;
\r
390 var eInnerElement = oCell.firstChild ;
\r
391 if ( eInnerElement )
\r
393 eInnerElement.style.height = '0px' ;
\r
394 eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;
\r
402 <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
\r
403 <tr id="xToolbarRow" style="display: none">
\r
404 <td id="xToolbarSpace" style="overflow: hidden">
\r
405 <table width="100%" cellpadding="0" cellspacing="0">
\r
406 <tr id="xCollapsed" style="display: none">
\r
407 <td id="xExpandHandle" class="TB_Expand" colspan="3">
\r
408 <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
410 <tr id="xExpanded" style="display: none">
\r
411 <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
\r
412 <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
\r
413 <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
414 <td id="xToolbar" class="TB_ToolbarSet"></td>
\r
415 <td class="TB_SideBorder" style="width: 1px"></td>
\r
421 <td id="xEditingArea" valign="top" style="height: 100%"></td>
\r