import torrus 1.0.9
[freeside.git] / httemplate / elements / fckeditor / editor / fckeditor.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
2 <!--\r
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
4  * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
5  *\r
6  * == BEGIN LICENSE ==\r
7  *\r
8  * Licensed under the terms of any of the following licenses at your\r
9  * choice:\r
10  *\r
11  *  - GNU General Public License Version 2 or later (the "GPL")\r
12  *    http://www.gnu.org/licenses/gpl.html\r
13  *\r
14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
15  *    http://www.gnu.org/licenses/lgpl.html\r
16  *\r
17  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
18  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
19  *\r
20  * == END LICENSE ==\r
21  *\r
22  * Main page that holds the editor.\r
23 -->\r
24 <html>\r
25 <head>\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
31 \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
35 {\r
36         try\r
37         {\r
38                 window.parent.document.domain ;\r
39         }\r
40         catch ( e )\r
41         {\r
42                 window.addEventListener( 'load', function()\r
43                         {\r
44                                 document.body.innerHTML = '\\r
45                                         <div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\\r
46                                                 <p>\\r
47                                                         <b>Your browser security settings don\'t allow FCKeditor to be opened from\\r
48                                                         the local filesystem.<\/b>\\r
49                                                 <\/p>\\r
50                                                 <p>\\r
51                                                         Please open the <b>about:config<\/b> page and disable the\\r
52                                                         &quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\\r
53                                                 <\/p>\\r
54                                                 <p>\\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
57                                                 <\/p>\\r
58                                         <\/div>' ;\r
59                         }, false ) ;\r
60         }\r
61 }\r
62 \r
63 // Save a reference to the default domain.\r
64 var FCK_ORIGINAL_DOMAIN ;\r
65 \r
66 // Automatically detect the correct document.domain (#123).\r
67 (function()\r
68 {\r
69         var d = FCK_ORIGINAL_DOMAIN = document.domain ;\r
70 \r
71         while ( true )\r
72         {\r
73                 // Test if we can access a parent property.\r
74                 try\r
75                 {\r
76                         var test = window.parent.document.domain ;\r
77                         break ;\r
78                 }\r
79                 catch( e ) {}\r
80 \r
81                 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...\r
82                 d = d.replace( /.*?(?:\.|$)/, '' ) ;\r
83 \r
84                 if ( d.length == 0 )\r
85                         break ;         // It was not able to detect the domain.\r
86 \r
87                 try\r
88                 {\r
89                         document.domain = d ;\r
90                 }\r
91                 catch (e)\r
92                 {\r
93                         break ;\r
94                 }\r
95         }\r
96 })() ;\r
97 \r
98 // Save a reference to the detected runtime domain.\r
99 var FCK_RUNTIME_DOMAIN = document.domain ;\r
100 \r
101 var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;\r
102 \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
107 \r
108 function LoadScript( url )\r
109 {\r
110         document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ;\r
111 }\r
112 \r
113 // Main editor scripts.\r
114 var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ;\r
115 \r
116 LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;\r
117 \r
118 // Base configuration file.\r
119 LoadScript( '../fckconfig.js' ) ;\r
120 \r
121         </script>\r
122         <script type="text/javascript">\r
123 \r
124 // Adobe AIR compatibility file.\r
125 if ( FCKBrowserInfo.IsAIR )\r
126         LoadScript( 'js/fckadobeair.js' ) ;\r
127 \r
128 if ( FCKBrowserInfo.IsIE )\r
129 {\r
130         // Remove IE mouse flickering.\r
131         try\r
132         {\r
133                 document.execCommand( 'BackgroundImageCache', false, true ) ;\r
134         }\r
135         catch (e)\r
136         {\r
137                 // We have been reported about loading problems caused by the above\r
138                 // line. For safety, let's just ignore errors.\r
139         }\r
140 \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
145 }\r
146 \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
151 \r
152 // The config hidden field is processed immediately, because\r
153 // CustomConfigurationsPath may be set in the page.\r
154 FCKConfig.ProcessHiddenField() ;\r
155 \r
156 // Load the custom configurations file (if defined).\r
157 if ( FCKConfig.CustomConfigurationsPath.length > 0 )\r
158         LoadScript( FCKConfig.CustomConfigurationsPath ) ;\r
159 \r
160         </script>\r
161         <script type="text/javascript">\r
162 \r
163 // Load configurations defined at page level.\r
164 FCKConfig_LoadPageConfig() ;\r
165 \r
166 FCKConfig_PreProcess() ;\r
167 \r
168 // Load the full debug script.\r
169 if ( FCKConfig.Debug )\r
170         LoadScript( '_source/internals/fckdebug.js' ) ;\r
171 \r
172         </script>\r
173         <script type="text/javascript">\r
174 \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
178 \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
183 \r
184 // Load the active skin CSS.\r
185 document.write( FCKTools.GetStyleHtml( FCKConfig.SkinEditorCSS ) ) ;\r
186 \r
187 // Load the language file.\r
188 FCKLanguageManager.Initialize() ;\r
189 LoadScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;\r
190 \r
191         </script>\r
192         <script type="text/javascript">\r
193 \r
194 // Initialize the editing area context menu.\r
195 FCK_ContextMenu_Init() ;\r
196 \r
197 FCKPlugins.Load() ;\r
198 \r
199         </script>\r
200         <script type="text/javascript">\r
201 \r
202 // Set the editor interface direction.\r
203 window.document.dir = FCKLang.Dir ;\r
204 \r
205         </script>\r
206         <script type="text/javascript">\r
207 \r
208 window.onload = function()\r
209 {\r
210         InitializeAPI() ;\r
211 \r
212         if ( FCKBrowserInfo.IsIE )\r
213                 FCK_PreloadImages() ;\r
214         else\r
215                 LoadToolbarSetup() ;\r
216 }\r
217 \r
218 function LoadToolbarSetup()\r
219 {\r
220         FCKeditorAPI._FunctionQueue.Add( LoadToolbar ) ;\r
221 }\r
222 \r
223 function LoadToolbar()\r
224 {\r
225         var oToolbarSet = FCK.ToolbarSet = FCKToolbarSet_Create() ;\r
226 \r
227         if ( oToolbarSet.IsLoaded )\r
228                 StartEditor() ;\r
229         else\r
230         {\r
231                 oToolbarSet.OnLoad = StartEditor ;\r
232                 oToolbarSet.Load( FCKURLParams['Toolbar'] || 'Default' ) ;\r
233         }\r
234 }\r
235 \r
236 function StartEditor()\r
237 {\r
238         // Remove the onload listener.\r
239         FCK.ToolbarSet.OnLoad = null ;\r
240 \r
241         FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ;\r
242 \r
243         FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ;\r
244 \r
245         // Start the editor.\r
246         FCK.StartEditor() ;\r
247 }\r
248 \r
249 function WaitForActive( editorInstance, newStatus )\r
250 {\r
251         if ( newStatus == FCK_STATUS_ACTIVE )\r
252         {\r
253                 if ( FCKBrowserInfo.IsGecko )\r
254                         FCKTools.RunFunction( window.onresize ) ;\r
255 \r
256                 if ( !FCKConfig.PreventSubmitHandler )\r
257                         _AttachFormSubmitToAPI() ;\r
258 \r
259                 FCK.SetStatus( FCK_STATUS_COMPLETE ) ;\r
260 \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
265         }\r
266 }\r
267 \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
271 {\r
272         window.onresize = function( e )\r
273         {\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
278                         return ;\r
279 \r
280                 var oCell = document.getElementById( 'xEditingArea' ) ;\r
281 \r
282                 var eInnerElement = oCell.firstChild ;\r
283                 if ( eInnerElement )\r
284                 {\r
285                         eInnerElement.style.height = '0px' ;\r
286                         eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;\r
287                 }\r
288         }\r
289 }\r
290 \r
291         </script>\r
292 </head>\r
293 <body>\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
301                                         </tr>\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
308                                         </tr>\r
309                                 </table>\r
310                         </td>\r
311                 </tr>\r
312                 <tr>\r
313                         <td id="xEditingArea" valign="top" style="height: 100%"></td>\r
314                 </tr>\r
315         </table>\r
316 </body>\r
317 </html>\r