1925 |
jp_milcent |
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-2008 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 |
<!-- @Packager.RemoveLine
|
|
|
30 |
<meta http-equiv="Cache-Control" content="public">
|
|
|
31 |
@Packager.RemoveLine -->
|
|
|
32 |
<script type="text/javascript">
|
|
|
33 |
|
|
|
34 |
// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
|
|
|
35 |
// without security.fileuri.strict_origin_policy disabled.
|
|
|
36 |
if ( document.location.protocol == 'file:' )
|
|
|
37 |
{
|
|
|
38 |
try
|
|
|
39 |
{
|
|
|
40 |
window.parent.document.domain ;
|
|
|
41 |
}
|
|
|
42 |
catch ( e )
|
|
|
43 |
{
|
|
|
44 |
window.addEventListener( 'load', function()
|
|
|
45 |
{
|
|
|
46 |
document.body.innerHTML = '\
|
|
|
47 |
<div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
|
|
|
48 |
<p>\
|
|
|
49 |
<b>Your browser security settings don\'t allow FCKeditor to be opened from\
|
|
|
50 |
the local filesystem.<\/b>\
|
|
|
51 |
<\/p>\
|
|
|
52 |
<p>\
|
|
|
53 |
Please open the <b>about:config<\/b> page and disable the\
|
|
|
54 |
"security.fileuri.strict_origin_policy" option; then load this page again.\
|
|
|
55 |
<\/p>\
|
|
|
56 |
<p>\
|
|
|
57 |
Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
|
|
|
58 |
for more information.\
|
|
|
59 |
<\/p>\
|
|
|
60 |
<\/div>' ;
|
|
|
61 |
}, false ) ;
|
|
|
62 |
}
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
// Save a reference to the default domain.
|
|
|
66 |
var FCK_ORIGINAL_DOMAIN ;
|
|
|
67 |
|
|
|
68 |
// Automatically detect the correct document.domain (#123).
|
|
|
69 |
(function()
|
|
|
70 |
{
|
|
|
71 |
var d = FCK_ORIGINAL_DOMAIN = document.domain ;
|
|
|
72 |
|
|
|
73 |
while ( true )
|
|
|
74 |
{
|
|
|
75 |
// Test if we can access a parent property.
|
|
|
76 |
try
|
|
|
77 |
{
|
|
|
78 |
var test = window.parent.document.domain ;
|
|
|
79 |
break ;
|
|
|
80 |
}
|
|
|
81 |
catch( e ) {}
|
|
|
82 |
|
|
|
83 |
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
|
|
|
84 |
d = d.replace( /.*?(?:\.|$)/, '' ) ;
|
|
|
85 |
|
|
|
86 |
if ( d.length == 0 )
|
|
|
87 |
break ; // It was not able to detect the domain.
|
|
|
88 |
|
|
|
89 |
try
|
|
|
90 |
{
|
|
|
91 |
document.domain = d ;
|
|
|
92 |
}
|
|
|
93 |
catch (e)
|
|
|
94 |
{
|
|
|
95 |
break ;
|
|
|
96 |
}
|
|
|
97 |
}
|
|
|
98 |
})() ;
|
|
|
99 |
|
|
|
100 |
// Save a reference to the detected runtime domain.
|
|
|
101 |
var FCK_RUNTIME_DOMAIN = document.domain ;
|
|
|
102 |
|
|
|
103 |
var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;
|
|
|
104 |
|
|
|
105 |
// Instead of loading scripts and CSSs using inline tags, all scripts are
|
|
|
106 |
// loaded by code. In this way we can guarantee the correct processing order,
|
|
|
107 |
// otherwise external scripts and inline scripts could be executed in an
|
|
|
108 |
// unwanted order (IE).
|
|
|
109 |
|
|
|
110 |
function LoadScript( url )
|
|
|
111 |
{
|
|
|
112 |
document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
// Main editor scripts.
|
|
|
116 |
var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ;
|
|
|
117 |
|
|
|
118 |
/* @Packager.RemoveLine
|
|
|
119 |
LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;
|
|
|
120 |
@Packager.RemoveLine */
|
|
|
121 |
// @Packager.Remove.Start
|
|
|
122 |
|
|
|
123 |
LoadScript( '_source/fckconstants.js' ) ;
|
|
|
124 |
LoadScript( '_source/fckjscoreextensions.js' ) ;
|
|
|
125 |
|
|
|
126 |
if ( sSuffix == 'ie' )
|
|
|
127 |
LoadScript( '_source/classes/fckiecleanup.js' ) ;
|
|
|
128 |
|
|
|
129 |
LoadScript( '_source/internals/fckbrowserinfo.js' ) ;
|
|
|
130 |
LoadScript( '_source/internals/fckurlparams.js' ) ;
|
|
|
131 |
LoadScript( '_source/classes/fckevents.js' ) ;
|
|
|
132 |
LoadScript( '_source/classes/fckdataprocessor.js' ) ;
|
|
|
133 |
LoadScript( '_source/internals/fck.js' ) ;
|
|
|
134 |
LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ;
|
|
|
135 |
LoadScript( '_source/internals/fckconfig.js' ) ;
|
|
|
136 |
|
|
|
137 |
LoadScript( '_source/internals/fckdebug_empty.js' ) ;
|
|
|
138 |
LoadScript( '_source/internals/fckdomtools.js' ) ;
|
|
|
139 |
LoadScript( '_source/internals/fcktools.js' ) ;
|
|
|
140 |
LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
|
|
|
141 |
LoadScript( '_source/fckeditorapi.js' ) ;
|
|
|
142 |
LoadScript( '_source/classes/fckimagepreloader.js' ) ;
|
|
|
143 |
LoadScript( '_source/internals/fckregexlib.js' ) ;
|
|
|
144 |
LoadScript( '_source/internals/fcklistslib.js' ) ;
|
|
|
145 |
LoadScript( '_source/internals/fcklanguagemanager.js' ) ;
|
|
|
146 |
LoadScript( '_source/internals/fckxhtmlentities.js' ) ;
|
|
|
147 |
LoadScript( '_source/internals/fckxhtml.js' ) ;
|
|
|
148 |
LoadScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
|
|
|
149 |
LoadScript( '_source/internals/fckcodeformatter.js' ) ;
|
|
|
150 |
LoadScript( '_source/internals/fckundo.js' ) ;
|
|
|
151 |
LoadScript( '_source/classes/fckeditingarea.js' ) ;
|
|
|
152 |
LoadScript( '_source/classes/fckkeystrokehandler.js' ) ;
|
|
|
153 |
|
|
|
154 |
LoadScript( 'dtd/fck_xhtml10transitional.js' ) ;
|
|
|
155 |
LoadScript( '_source/classes/fckstyle.js' ) ;
|
|
|
156 |
LoadScript( '_source/internals/fckstyles.js' ) ;
|
|
|
157 |
|
|
|
158 |
LoadScript( '_source/internals/fcklisthandler.js' ) ;
|
|
|
159 |
LoadScript( '_source/classes/fckelementpath.js' ) ;
|
|
|
160 |
LoadScript( '_source/classes/fckdomrange.js' ) ;
|
|
|
161 |
LoadScript( '_source/classes/fckdocumentfragment_' + sSuffix + '.js' ) ;
|
|
|
162 |
LoadScript( '_source/classes/fckw3crange.js' ) ;
|
|
|
163 |
LoadScript( '_source/classes/fckdomrange_' + sSuffix + '.js' ) ;
|
|
|
164 |
LoadScript( '_source/classes/fckdomrangeiterator.js' ) ;
|
|
|
165 |
LoadScript( '_source/classes/fckenterkey.js' ) ;
|
|
|
166 |
|
|
|
167 |
LoadScript( '_source/internals/fckdocumentprocessor.js' ) ;
|
|
|
168 |
LoadScript( '_source/internals/fckselection.js' ) ;
|
|
|
169 |
LoadScript( '_source/internals/fckselection_' + sSuffix + '.js' ) ;
|
|
|
170 |
|
|
|
171 |
LoadScript( '_source/internals/fcktablehandler.js' ) ;
|
|
|
172 |
LoadScript( '_source/internals/fcktablehandler_' + sSuffix + '.js' ) ;
|
|
|
173 |
LoadScript( '_source/classes/fckxml.js' ) ;
|
|
|
174 |
LoadScript( '_source/classes/fckxml_' + sSuffix + '.js' ) ;
|
|
|
175 |
|
|
|
176 |
LoadScript( '_source/commandclasses/fcknamedcommand.js' ) ;
|
|
|
177 |
LoadScript( '_source/commandclasses/fckstylecommand.js' ) ;
|
|
|
178 |
LoadScript( '_source/commandclasses/fck_othercommands.js' ) ;
|
|
|
179 |
LoadScript( '_source/commandclasses/fckshowblocks.js' ) ;
|
|
|
180 |
LoadScript( '_source/commandclasses/fckspellcheckcommand_' + sSuffix + '.js' ) ;
|
|
|
181 |
LoadScript( '_source/commandclasses/fcktextcolorcommand.js' ) ;
|
|
|
182 |
LoadScript( '_source/commandclasses/fckpasteplaintextcommand.js' ) ;
|
|
|
183 |
LoadScript( '_source/commandclasses/fckpastewordcommand.js' ) ;
|
|
|
184 |
LoadScript( '_source/commandclasses/fcktablecommand.js' ) ;
|
|
|
185 |
LoadScript( '_source/commandclasses/fckfitwindow.js' ) ;
|
|
|
186 |
LoadScript( '_source/commandclasses/fcklistcommands.js' ) ;
|
|
|
187 |
LoadScript( '_source/commandclasses/fckjustifycommands.js' ) ;
|
|
|
188 |
LoadScript( '_source/commandclasses/fckindentcommands.js' ) ;
|
|
|
189 |
LoadScript( '_source/commandclasses/fckblockquotecommand.js' ) ;
|
|
|
190 |
LoadScript( '_source/commandclasses/fckcorestylecommand.js' ) ;
|
|
|
191 |
LoadScript( '_source/commandclasses/fckremoveformatcommand.js' ) ;
|
|
|
192 |
LoadScript( '_source/internals/fckcommands.js' ) ;
|
|
|
193 |
|
|
|
194 |
LoadScript( '_source/classes/fckpanel.js' ) ;
|
|
|
195 |
LoadScript( '_source/classes/fckicon.js' ) ;
|
|
|
196 |
LoadScript( '_source/classes/fcktoolbarbuttonui.js' ) ;
|
|
|
197 |
LoadScript( '_source/classes/fcktoolbarbutton.js' ) ;
|
|
|
198 |
LoadScript( '_source/classes/fckspecialcombo.js' ) ;
|
|
|
199 |
LoadScript( '_source/classes/fcktoolbarspecialcombo.js' ) ;
|
|
|
200 |
LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ;
|
|
|
201 |
LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;
|
|
|
202 |
LoadScript( '_source/classes/fcktoolbarfontscombo.js' ) ;
|
|
|
203 |
LoadScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ;
|
|
|
204 |
LoadScript( '_source/classes/fcktoolbarpanelbutton.js' ) ;
|
|
|
205 |
LoadScript( '_source/internals/fcktoolbaritems.js' ) ;
|
|
|
206 |
LoadScript( '_source/classes/fcktoolbar.js' ) ;
|
|
|
207 |
LoadScript( '_source/classes/fcktoolbarbreak_' + sSuffix + '.js' ) ;
|
|
|
208 |
LoadScript( '_source/internals/fcktoolbarset.js' ) ;
|
|
|
209 |
LoadScript( '_source/internals/fckdialog.js' ) ;
|
|
|
210 |
LoadScript( '_source/classes/fckmenuitem.js' ) ;
|
|
|
211 |
LoadScript( '_source/classes/fckmenublock.js' ) ;
|
|
|
212 |
LoadScript( '_source/classes/fckmenublockpanel.js' ) ;
|
|
|
213 |
LoadScript( '_source/classes/fckcontextmenu.js' ) ;
|
|
|
214 |
LoadScript( '_source/internals/fck_contextmenu.js' ) ;
|
|
|
215 |
LoadScript( '_source/classes/fckhtmliterator.js' ) ;
|
|
|
216 |
LoadScript( '_source/classes/fckplugin.js' ) ;
|
|
|
217 |
LoadScript( '_source/internals/fckplugins.js' ) ;
|
|
|
218 |
|
|
|
219 |
// @Packager.Remove.End
|
|
|
220 |
|
|
|
221 |
// Base configuration file.
|
|
|
222 |
LoadScript( '../fckconfig.js' ) ;
|
|
|
223 |
|
|
|
224 |
</script>
|
|
|
225 |
<script type="text/javascript">
|
|
|
226 |
|
|
|
227 |
// Adobe AIR compatibility file.
|
|
|
228 |
if ( FCKBrowserInfo.IsAIR )
|
|
|
229 |
LoadScript( 'js/fckadobeair.js' ) ;
|
|
|
230 |
|
|
|
231 |
if ( FCKBrowserInfo.IsIE )
|
|
|
232 |
{
|
|
|
233 |
// Remove IE mouse flickering.
|
|
|
234 |
try
|
|
|
235 |
{
|
|
|
236 |
document.execCommand( 'BackgroundImageCache', false, true ) ;
|
|
|
237 |
}
|
|
|
238 |
catch (e)
|
|
|
239 |
{
|
|
|
240 |
// We have been reported about loading problems caused by the above
|
|
|
241 |
// line. For safety, let's just ignore errors.
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
// Create the default cleanup object used by the editor.
|
|
|
245 |
FCK.IECleanup = new FCKIECleanup( window ) ;
|
|
|
246 |
FCK.IECleanup.AddItem( FCKTempBin, FCKTempBin.Reset ) ;
|
|
|
247 |
FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;
|
|
|
248 |
}
|
|
|
249 |
|
|
|
250 |
// The first function to be called on selection change must the the styles
|
|
|
251 |
// change checker, because the result of its processing may be used by another
|
|
|
252 |
// functions listening to the same event.
|
|
|
253 |
FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ;
|
|
|
254 |
|
|
|
255 |
// The config hidden field is processed immediately, because
|
|
|
256 |
// CustomConfigurationsPath may be set in the page.
|
|
|
257 |
FCKConfig.ProcessHiddenField() ;
|
|
|
258 |
|
|
|
259 |
// Load the custom configurations file (if defined).
|
|
|
260 |
if ( FCKConfig.CustomConfigurationsPath.length > 0 )
|
|
|
261 |
LoadScript( FCKConfig.CustomConfigurationsPath ) ;
|
|
|
262 |
|
|
|
263 |
</script>
|
|
|
264 |
<script type="text/javascript">
|
|
|
265 |
|
|
|
266 |
// Load configurations defined at page level.
|
|
|
267 |
FCKConfig_LoadPageConfig() ;
|
|
|
268 |
|
|
|
269 |
FCKConfig_PreProcess() ;
|
|
|
270 |
|
|
|
271 |
// Load the full debug script.
|
|
|
272 |
if ( FCKConfig.Debug )
|
|
|
273 |
LoadScript( '_source/internals/fckdebug.js' ) ;
|
|
|
274 |
|
|
|
275 |
</script>
|
|
|
276 |
<script type="text/javascript">
|
|
|
277 |
|
|
|
278 |
var FCK_InternalCSS = FCKConfig.BasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine
|
|
|
279 |
var FCK_ShowTableBordersCSS = FCKConfig.BasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine
|
|
|
280 |
/* @Packager.RemoveLine
|
|
|
281 |
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
|
|
|
282 |
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)}' ) ;
|
|
|
283 |
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}' ) ;
|
|
|
284 |
@Packager.RemoveLine */
|
|
|
285 |
|
|
|
286 |
// Popup the debug window if debug mode is set to true. It guarantees that the
|
|
|
287 |
// first debug message will not be lost.
|
|
|
288 |
if ( FCKConfig.Debug )
|
|
|
289 |
FCKDebug._GetWindow() ;
|
|
|
290 |
|
|
|
291 |
// Load the active skin CSS.
|
|
|
292 |
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinEditorCSS ) ) ;
|
|
|
293 |
|
|
|
294 |
// Load the language file.
|
|
|
295 |
FCKLanguageManager.Initialize() ;
|
|
|
296 |
LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
|
|
|
297 |
|
|
|
298 |
</script>
|
|
|
299 |
<script type="text/javascript">
|
|
|
300 |
|
|
|
301 |
// Initialize the editing area context menu.
|
|
|
302 |
FCK_ContextMenu_Init() ;
|
|
|
303 |
|
|
|
304 |
FCKPlugins.Load() ;
|
|
|
305 |
|
|
|
306 |
</script>
|
|
|
307 |
<script type="text/javascript">
|
|
|
308 |
|
|
|
309 |
// Set the editor interface direction.
|
|
|
310 |
window.document.dir = FCKLang.Dir ;
|
|
|
311 |
|
|
|
312 |
</script>
|
|
|
313 |
<script type="text/javascript">
|
|
|
314 |
|
|
|
315 |
window.onload = function()
|
|
|
316 |
{
|
|
|
317 |
InitializeAPI() ;
|
|
|
318 |
|
|
|
319 |
if ( FCKBrowserInfo.IsIE )
|
|
|
320 |
FCK_PreloadImages() ;
|
|
|
321 |
else
|
|
|
322 |
LoadToolbarSetup() ;
|
|
|
323 |
}
|
|
|
324 |
|
|
|
325 |
function LoadToolbarSetup()
|
|
|
326 |
{
|
|
|
327 |
FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;
|
|
|
328 |
}
|
|
|
329 |
|
|
|
330 |
function LoadToolbar()
|
|
|
331 |
{
|
|
|
332 |
var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;
|
|
|
333 |
|
|
|
334 |
if ( oToolbarSet.IsLoaded )
|
|
|
335 |
StartEditor() ;
|
|
|
336 |
else
|
|
|
337 |
{
|
|
|
338 |
oToolbarSet.OnLoad = StartEditor ;
|
|
|
339 |
oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;
|
|
|
340 |
}
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
function StartEditor()
|
|
|
344 |
{
|
|
|
345 |
// Remove the onload listener.
|
|
|
346 |
FCK.ToolbarSet.OnLoad = null ;
|
|
|
347 |
|
|
|
348 |
FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;
|
|
|
349 |
|
|
|
350 |
FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;
|
|
|
351 |
|
|
|
352 |
// Start the editor.
|
|
|
353 |
FCK.StartEditor() ;
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
function WaitForActive( editorInstance, newStatus )
|
|
|
357 |
{
|
|
|
358 |
if ( newStatus == FCK_STATUS_ACTIVE )
|
|
|
359 |
{
|
|
|
360 |
if ( FCKBrowserInfo.IsGecko )
|
|
|
361 |
FCKTools.RunFunction( window.onresize ) ;
|
|
|
362 |
|
|
|
363 |
if ( !FCKConfig.PreventSubmitHandler )
|
|
|
364 |
_AttachFormSubmitToAPI() ;
|
|
|
365 |
|
|
|
366 |
FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
|
|
|
367 |
|
|
|
368 |
// Call the special "FCKeditor_OnComplete" function that should be present in
|
|
|
369 |
// the HTML page where the editor is located.
|
|
|
370 |
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
|
|
|
371 |
window.parent.FCKeditor_OnComplete( FCK ) ;
|
|
|
372 |
}
|
|
|
373 |
}
|
|
|
374 |
|
|
|
375 |
// Gecko browsers doesn't calculate well the IFRAME size so we must
|
|
|
376 |
// recalculate it every time the window size changes.
|
|
|
377 |
if ( FCKBrowserInfo.IsGecko && !FCKBrowserInfo.IsOpera )
|
|
|
378 |
{
|
|
|
379 |
window.onresize = function( e )
|
|
|
380 |
{
|
|
|
381 |
// Running in Chrome makes the window receive the event including subframes.
|
|
|
382 |
// we care only about this window. Ticket #1642.
|
|
|
383 |
// #2002: The originalTarget from the event can be the current document, the window, or the editing area.
|
|
|
384 |
if ( e && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))
|
|
|
385 |
return ;
|
|
|
386 |
|
|
|
387 |
var oCell = document.getElementById( 'xEditingArea' ) ;
|
|
|
388 |
|
|
|
389 |
var eInnerElement = oCell.firstChild ;
|
|
|
390 |
if ( eInnerElement )
|
|
|
391 |
{
|
|
|
392 |
eInnerElement.style.height = '0px' ;
|
|
|
393 |
eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;
|
|
|
394 |
}
|
|
|
395 |
}
|
|
|
396 |
}
|
|
|
397 |
|
|
|
398 |
</script>
|
|
|
399 |
</head>
|
|
|
400 |
<body>
|
|
|
401 |
<table width="100%" cellpadding="0" cellspacing="0" style="height: 100%; table-layout: fixed">
|
|
|
402 |
<tr id="xToolbarRow" style="display: none">
|
|
|
403 |
<td id="xToolbarSpace" style="overflow: hidden">
|
|
|
404 |
<table width="100%" cellpadding="0" cellspacing="0">
|
|
|
405 |
<tr id="xCollapsed" style="display: none">
|
|
|
406 |
<td id="xExpandHandle" class="TB_Expand" colspan="3">
|
|
|
407 |
<img class="TB_ExpandImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
|
|
|
408 |
</tr>
|
|
|
409 |
<tr id="xExpanded" style="display: none">
|
|
|
410 |
<td id="xTBLeftBorder" class="TB_SideBorder" style="width: 1px; display: none;"></td>
|
|
|
411 |
<td id="xCollapseHandle" style="display: none" class="TB_Collapse" valign="bottom">
|
|
|
412 |
<img class="TB_CollapseImg" alt="" src="images/spacer.gif" width="8" height="4" /></td>
|
|
|
413 |
<td id="xToolbar" class="TB_ToolbarSet"></td>
|
|
|
414 |
<td class="TB_SideBorder" style="width: 1px"></td>
|
|
|
415 |
</tr>
|
|
|
416 |
</table>
|
|
|
417 |
</td>
|
|
|
418 |
</tr>
|
|
|
419 |
<tr>
|
|
|
420 |
<td id="xEditingArea" valign="top" style="height: 100%"></td>
|
|
|
421 |
</tr>
|
|
|
422 |
</table>
|
|
|
423 |
</body>
|
|
|
424 |
</html>
|