FCKeditor 2.6.6
[freeside.git] / httemplate / elements / fckeditor / editor / fckeditor.html
index 25ad37e..5f90c3d 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
 <!--\r
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
  *\r
  * == BEGIN LICENSE ==\r
  *\r
  *\r
  * Main page that holds the editor.\r
 -->\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
+<html>\r
 <head>\r
        <title>FCKeditor</title>\r
-       <meta name="robots" content="noindex, nofollow" />\r
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
-       <meta http-equiv="Cache-Control" content="public" />\r
+       <meta name="robots" content="noindex, nofollow">\r
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+       <meta http-equiv="Cache-Control" content="public">\r
        <script type="text/javascript">\r
 \r
+// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem\r
+// without security.fileuri.strict_origin_policy disabled.\r
+if ( document.location.protocol == 'file:' )\r
+{\r
+       try\r
+       {\r
+               window.parent.document.domain ;\r
+       }\r
+       catch ( e )\r
+       {\r
+               window.addEventListener( 'load', function()\r
+                       {\r
+                               document.body.innerHTML = '\\r
+                                       <div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\\r
+                                               <p>\\r
+                                                       <b>Your browser security settings don\'t allow FCKeditor to be opened from\\r
+                                                       the local filesystem.<\/b>\\r
+                                               <\/p>\\r
+                                               <p>\\r
+                                                       Please open the <b>about:config<\/b> page and disable the\\r
+                                                       &quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\\r
+                                               <\/p>\\r
+                                               <p>\\r
+                                                       Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\\r
+                                                       for more information.\\r
+                                               <\/p>\\r
+                                       <\/div>' ;\r
+                       }, false ) ;\r
+       }\r
+}\r
+\r
+// Save a reference to the default domain.\r
+var FCK_ORIGINAL_DOMAIN ;\r
+\r
+// Automatically detect the correct document.domain (#123).\r
+(function()\r
+{\r
+       var d = FCK_ORIGINAL_DOMAIN = document.domain ;\r
+\r
+       while ( true )\r
+       {\r
+               // Test if we can access a parent property.\r
+               try\r
+               {\r
+                       var test = window.parent.document.domain ;\r
+                       break ;\r
+               }\r
+               catch( e ) {}\r
+\r
+               // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...\r
+               d = d.replace( /.*?(?:\.|$)/, '' ) ;\r
+\r
+               if ( d.length == 0 )\r
+                       break ;         // It was not able to detect the domain.\r
+\r
+               try\r
+               {\r
+                       document.domain = d ;\r
+               }\r
+               catch (e)\r
+               {\r
+                       break ;\r
+               }\r
+       }\r
+})() ;\r
+\r
+// Save a reference to the detected runtime domain.\r
+var FCK_RUNTIME_DOMAIN = document.domain ;\r
+\r
+var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;\r
+\r
 // Instead of loading scripts and CSSs using inline tags, all scripts are\r
 // loaded by code. In this way we can guarantee the correct processing order,\r
 // otherwise external scripts and inline scripts could be executed in an\r
 \r
 function LoadScript( url )\r
 {\r
-       document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '" onerror="alert(\'Error loading \' + this.src);"><\/scr' + 'ipt>' ) ;\r
-}\r
-\r
-function LoadCss( url )\r
-{\r
-       document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" onerror="alert(\'Error loading \' + this.src);" />' ) ;\r
+       document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ;\r
 }\r
 \r
 // Main editor scripts.\r
-var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;\r
+var sSuffix = ( /*@cc_on!@*/false ) ? 'ie' : 'gecko' ;\r
 \r
 LoadScript( 'js/fckeditorcode_' + sSuffix + '.js' ) ;\r
 \r
@@ -55,6 +121,10 @@ LoadScript( '../fckconfig.js' ) ;
        </script>\r
        <script type="text/javascript">\r
 \r
+// Adobe AIR compatibility file.\r
+if ( FCKBrowserInfo.IsAIR )\r
+       LoadScript( 'js/fckadobeair.js' ) ;\r
+\r
 if ( FCKBrowserInfo.IsIE )\r
 {\r
        // Remove IE mouse flickering.\r
@@ -74,6 +144,11 @@ if ( FCKBrowserInfo.IsIE )
        FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ;\r
 }\r
 \r
+// The first function to be called on selection change must the the styles\r
+// change checker, because the result of its processing may be used by another\r
+// functions listening to the same event.\r
+FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ;\r
+\r
 // The config hidden field is processed immediately, because\r
 // CustomConfigurationsPath may be set in the page.\r
 FCKConfig.ProcessHiddenField() ;\r
@@ -90,8 +165,24 @@ FCKConfig_LoadPageConfig() ;
 \r
 FCKConfig_PreProcess() ;\r
 \r
+// Load the full debug script.\r
+if ( FCKConfig.Debug )\r
+       LoadScript( '_source/internals/fckdebug.js' ) ;\r
+\r
+       </script>\r
+       <script type="text/javascript">\r
+\r
+// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).\r
+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
+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
+\r
+// Popup the debug window if debug mode is set to true. It guarantees that the\r
+// first debug message will not be lost.\r
+if ( FCKConfig.Debug )\r
+       FCKDebug._GetWindow() ;\r
+\r
 // Load the active skin CSS.\r
-LoadCss( FCKConfig.SkinPath + 'fck_editor.css' ) ;\r
+document.write( FCKTools.GetStyleHtml( FCKConfig.SkinEditorCSS ) ) ;\r
 \r
 // Load the language file.\r
 FCKLanguageManager.Initialize() ;\r
@@ -111,10 +202,6 @@ FCKPlugins.Load() ;
 // Set the editor interface direction.\r
 window.document.dir = FCKLang.Dir ;\r
 \r
-// Activate pasting operations.\r
-if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord )\r
-       FCK.Events.AttachEvent( 'OnPaste', FCK.Paste ) ;\r
-\r
        </script>\r
        <script type="text/javascript">\r
 \r
@@ -166,7 +253,8 @@ function WaitForActive( editorInstance, newStatus )
                if ( FCKBrowserInfo.IsGecko )\r
                        FCKTools.RunFunction( window.onresize ) ;\r
 \r
-               _AttachFormSubmitToAPI() ;\r
+               if ( !FCKConfig.PreventSubmitHandler )\r
+                       _AttachFormSubmitToAPI() ;\r
 \r
                FCK.SetStatus( FCK_STATUS_COMPLETE ) ;\r
 \r
@@ -177,13 +265,16 @@ function WaitForActive( editorInstance, newStatus )
        }\r
 }\r
 \r
-// Gecko browsers doens't calculate well that IFRAME size so we must\r
+// Gecko and Webkit browsers don't calculate well the IFRAME size so we must\r
 // recalculate it every time the window size changes.\r
-if ( FCKBrowserInfo.IsGecko )\r
+if ( FCKBrowserInfo.IsGecko || ( FCKBrowserInfo.IsSafari && !FCKBrowserInfo.IsSafari3 ) )\r
 {\r
-       function Window_OnResize()\r
+       window.onresize = function( e )\r
        {\r
-               if ( FCKBrowserInfo.IsOpera )\r
+               // Running in Firefox's chrome makes the window receive the event including subframes.\r
+               // we care only about this window. Ticket #1642.\r
+               // #2002: The originalTarget from the event can be the current document, the window, or the editing area.\r
+               if ( e && e.originalTarget && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))\r
                        return ;\r
 \r
                var oCell = document.getElementById( 'xEditingArea' ) ;\r
@@ -191,11 +282,10 @@ if ( FCKBrowserInfo.IsGecko )
                var eInnerElement = oCell.firstChild ;\r
                if ( eInnerElement )\r
                {\r
-                       eInnerElement.style.height = 0 ;\r
-                       eInnerElement.style.height = oCell.scrollHeight - 2 ;\r
+                       eInnerElement.style.height = '0px' ;\r
+                       eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;\r
                }\r
        }\r
-       window.onresize = Window_OnResize ;\r
 }\r
 \r
        </script>\r