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 <meta http-equiv="Cache-Control" content="public">
\r
30 <script type="text/javascript">
\r
32 // #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
\r
33 // without security.fileuri.strict_origin_policy disabled.
\r
34 if ( document.location.protocol == 'file:' )
\r
38 window.parent.document.domain ;
\r
42 window.addEventListener( 'load', function()
\r
44 document.body.innerHTML = '\
\r
45 <div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
\r
47 <b>Your browser security settings don\'t allow FCKeditor to be opened from\
\r
48 the local filesystem.<\/b>\
\r
51 Please open the <b>about:config<\/b> page and disable the\
\r
52 "security.fileuri.strict_origin_policy" option; then load this page again.\
\r
55 Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
\r
56 for more information.\
\r
63 // Save a reference to the default domain.
\r
64 var FCK_ORIGINAL_DOMAIN ;
\r
66 // Automatically detect the correct document.domain (#123).
\r
69 var d = FCK_ORIGINAL_DOMAIN = document.domain ;
\r
73 // Test if we can access a parent property.
\r
76 var test = window.parent.document.domain ;
\r
81 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
\r
82 d = d.replace( /.*?(?:\.|$)/, '' ) ;
\r
84 if ( d.length == 0 )
\r
85 break ; // It was not able to detect the domain.
\r
89 document.domain = d ;
\r
98 // Save a reference to the detected runtime domain.
\r
99 var FCK_RUNTIME_DOMAIN = document.domain ;
\r
101 var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;
\r
103 // Instead of loading scripts and CSSs using inline tags, all scripts are
\r
104 // loaded by code. In this way we can guarantee the correct processing order,
\r
105 // otherwise external scripts and inline scripts could be executed in an
\r
106 // unwanted order (IE).
\r
108 function LoadScript( url )
\r
110 document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ;
\r
113 // Main editor scripts.
\r
114 var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ;
\r
116 LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
\r
118 // Base configuration file.
\r
119 LoadScript( '../fckconfig.js' ) ;
\r
122 <script type="text/javascript">
\r
124 // Adobe AIR compatibility file.
\r
125 if ( FCKBrowserInfo.IsAIR )
\r
126 LoadScript( 'js/fckadobeair.js' ) ;
\r
128 if ( FCKBrowserInfo.IsIE )
\r
130 // Remove IE mouse flickering.
\r
133 document.execCommand( 'BackgroundImageCache', false, true ) ;
\r
137 // We have been reported about loading problems caused by the above
\r
138 // line. For safety, let's just ignore errors.
\r
141 // Create the default cleanup object used by the editor.
\r
142 FCK.IECleanup = new FCKIECleanup( window ) ;
\r
143 FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
\r
144 FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
\r
147 // The first function to be called on selection change must the the styles
\r
148 // change checker, because the result of its processing may be used by another
\r
149 // functions listening to the same event.
\r
150 FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ;
\r
152 // The config hidden field is processed immediately, because
\r
153 // CustomConfigurationsPath may be set in the page.
\r
154 FCKConfig.ProcessHiddenField() ;
\r
156 // Load the custom configurations file (if defined).
\r
157 if ( FCKConfig.CustomConfigurationsPath.length > 0 )
\r
158 LoadScript( FCKConfig.CustomConfigurationsPath ) ;
\r
161 <script type="text/javascript">
\r
163 // Load configurations defined at page level.
\r
164 FCKConfig_LoadPageConfig() ;
\r
166 FCKConfig_PreProcess() ;
\r
168 // Load the full debug script.
\r
169 if ( FCKConfig.Debug )
\r
170 LoadScript( '_source/internals/fckdebug.js' ) ;
\r
173 <script type="text/javascript">
\r
175 // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
\r
176 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
177 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
179 // Popup the debug window if debug mode is set to true. It guarantees that the
\r
180 // first debug message will not be lost.
\r
181 if ( FCKConfig.Debug )
\r
182 FCKDebug._GetWindow() ;
\r
184 // Load the active skin CSS.
\r
185 document.write( FCKTools.GetStyleHtml( FCKConfig.SkinEditorCSS ) ) ;
\r
187 // Load the language file.
\r
188 FCKLanguageManager.Initialize() ;
\r
189 LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
\r
192 <script type="text/javascript">
\r
194 // Initialize the editing area context menu.
\r
195 FCK_ContextMenu_Init() ;
\r
197 FCKPlugins.Load() ;
\r
200 <script type="text/javascript">
\r
202 // Set the editor interface direction.
\r
203 window.document.dir = FCKLang.Dir ;
\r
206 <script type="text/javascript">
\r
208 window.onload = function()
\r
212 if ( FCKBrowserInfo.IsIE )
\r
213 FCK_PreloadImages() ;
\r
215 LoadToolbarSetup() ;
\r
218 function LoadToolbarSetup()
\r
220 FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
\r
223 function LoadToolbar()
\r
225 var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
\r
227 if ( oToolbarSet.IsLoaded )
\r
231 oToolbarSet.OnLoad = StartEditor ;
\r
232 oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
\r
236 function StartEditor()
\r
238 // Remove the onload listener.
\r
239 FCK.ToolbarSet.OnLoad = null ;
\r
241 FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
\r
243 FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
\r
245 // Start the editor.
\r
246 FCK.StartEditor() ;
\r
249 function WaitForActive( editorInstance, newStatus )
\r
251 if ( newStatus == FCK_STATUS_ACTIVE )
\r
253 if ( FCKBrowserInfo.IsGecko )
\r
254 FCKTools.RunFunction( window.onresize ) ;
\r
256 if ( !FCKConfig.PreventSubmitHandler )
\r
257 _AttachFormSubmitToAPI() ;
\r
259 FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
\r
261 // Call the special "FCKeditor_OnComplete" function that should be present in
\r
262 // the HTML page where the editor is located.
\r
263 if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
\r
264 window.parent.FCKeditor_OnComplete( FCK ) ;
\r
268 // Gecko and Webkit browsers don't calculate well the IFRAME size so we must
\r
269 // recalculate it every time the window size changes.
\r
270 if ( FCKBrowserInfo.IsGecko || ( FCKBrowserInfo.IsSafari && !FCKBrowserInfo.IsSafari3 ) )
\r
272 window.onresize = function( e )
\r
274 // Running in Firefox's chrome makes the window receive the event including subframes.
\r
275 // we care only about this window. Ticket #1642.
\r
276 // #2002: The originalTarget from the event can be the current document, the window, or the editing area.
\r
277 if ( e && e.originalTarget && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))
\r
280 var oCell = document.getElementById( 'xEditingArea' ) ;
\r
282 var eInnerElement = oCell.firstChild ;
\r
283 if ( eInnerElement )
\r
285 eInnerElement.style.height = '0px' ;
\r
286 eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;
\r
294 <table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
\r
295 <tr id="xToolbarRow" style="display: none">
\r
296 <td id="xToolbarSpace" style="overflow: hidden">
\r
297 <table width="100%" cellpadding="0" cellspacing="0">
\r
298 <tr id="xCollapsed" style="display: none">
\r
299 <td id="xExpandHandle" class="TB_Expand" colspan="3">
\r
300 <img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
302 <tr id="xExpanded" style="display: none">
\r
303 <td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
\r
304 <td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
\r
305 <img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
\r
306 <td id="xToolbar" class="TB_ToolbarSet"></td>
\r
307 <td class="TB_SideBorder" style="width: 1px"></td>
\r
313 <td id="xEditingArea" valign="top" style="height: 100%"></td>
\r