update to FCK 2.6.3, please note: you probably have to delete your browser cache!

this should fix the <br type="_moz"> bug.
-added the about button in all egw_config settings, as it enables the user to check the version of the editor
-added the show-blocks button in all egw_config settings, as it enables the user to check the structure elements of his document
This commit is contained in:
Klaus Leithoff 2008-10-08 10:16:30 +00:00
parent bad25ee249
commit 260ce05397
261 changed files with 59273 additions and 57462 deletions

View File

@ -27,17 +27,20 @@
<title>FCKeditor - AFP - Samples - Posted Data</title> <title>FCKeditor - AFP - Samples - Posted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" /> <link href="../sample.css" rel="stylesheet" type="text/css">
</head> </head>
<body> <body>
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td nowrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
<% <%
lcForm=REQUEST.Form() lcForm=REQUEST.Form()
lcForm=STRTRAN(lcForm,"&",CHR(13)+CHR(10)) lcForm=STRTRAN(lcForm,"&",CHR(13)+CHR(10))
@ -51,7 +54,7 @@
lcWert=STRTRAN(lcWert,"<","&lt;") lcWert=STRTRAN(lcWert,"<","&lt;")
lcWert=STRTRAN(lcWert,">","&gt;") && ... if wanted remove/translate HTML Chars ... lcWert=STRTRAN(lcWert,">","&gt;") && ... if wanted remove/translate HTML Chars ...
? [<tr><td>]+lcVariable+[ =</td><td>]+lcWert+[</td></tr>] ? [<tr><th>]+lcVariable+[ =</th><td><pre>]+lcWert+[</pre></td></tr>]
ENDIF ENDIF
NEXT NEXT
%> %>

View File

@ -28,24 +28,27 @@
<title>FCKeditor - Samples - Posted Data</title> <title>FCKeditor - Samples - Posted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" /> <link href="../sample.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td noWrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
<% <%
Dim sForm Dim sForm
For Each sForm in Request.Form For Each sForm in Request.Form
%> %>
<tr> <tr>
<td valign="top" nowrap><b><%=sForm%></b></td> <th><%=sForm%></th>
<td width="100%" style="white-space:pre"><%=Server.HTMLEncode( Request.Form(sForm) )%></td> <td><pre><%=Server.HTMLEncode( Request.Form(sForm) )%></pre></td>
</tr> </tr>
<% Next %> <% Next %>
</table> </table>

View File

@ -38,23 +38,22 @@
<cfif isDefined( 'FORM.fieldnames' )> <cfif isDefined( 'FORM.fieldnames' )>
<cfoutput> <cfoutput>
<hr /> <hr />
<style> <table border="1" cellspacing="0" id="outputSample">
<!-- <colgroup><col width="80"><col></colgroup>
td, th { font: 11px Verdana, Arial, Helv, Helvetica, sans-serif; } <thead>
-->
</style>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="darkblue" bordercolordark="darkblue" bordercolorlight="darkblue">
<tr> <tr>
<th colspan="2" bgcolor="darkblue"><font color="white"><strong>Dump of FORM Variables</strong></font></th> <th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
<tr> <tr>
<td bgcolor="lightskyblue">FieldNames</td> <th>FieldNames</th>
<td>#FORM.fieldNames#</td> <td>#FORM.fieldNames#</td>
</tr> </tr>
<cfloop list="#FORM.fieldnames#" index="key"> <cfloop list="#FORM.fieldnames#" index="key">
<tr> <tr>
<td valign="top" bgcolor="lightskyblue">#key#</td> <th>#key#</th>
<td style="white-space:pre">#HTMLEditFormat( evaluate( "FORM.#key#" ) )#</td> <td><pre>#HTMLEditFormat( evaluate( "FORM.#key#" ) )#</pre></td>
</tr> </tr>
</cfloop> </cfloop>
</table> </table>

View File

@ -37,7 +37,7 @@
This sample displays a normal HTML form with an FCKeditor with full features enabled. This sample displays a normal HTML form with an FCKeditor with full features enabled.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -52,7 +52,7 @@ window.onload = function()
It uses the "ReplaceTextarea" command to create the editor. It uses the "ReplaceTextarea" command to create the editor.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<div> <div>
<textarea name="FCKeditor1" rows="10" cols="80" style="width: 100%; height: 200px">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea> <textarea name="FCKeditor1" rows="10" cols="80" style="width: 100%; height: 200px">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.&lt;/p&gt;</textarea>
</div> </div>

View File

@ -105,7 +105,7 @@ function ChangeLanguage( languageCode )
</tr> </tr>
</table> </table>
<br /> <br />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -65,7 +65,7 @@ function ChangeLanguage( languageCode )
</tr> </tr>
</table> </table>
<br /> <br />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -71,7 +71,7 @@ function ChangeLanguage( languageCode )
</tr> </tr>
</table> </table>
<br /> <br />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -45,7 +45,7 @@
</ul> </ul>
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.
@ -57,7 +57,7 @@ var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ; oFCKeditor.BasePath = sBasePath ;
// Set the custom configurations file path (in this way the original file is mantained). // Set the custom configurations file path (in this way the original file is mantained).
oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + '_samples/html/sample06.config.js' ; oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + '_samples/html/assets/sample06.config.js' ;
// Let's use a custom toolbar for this sample. // Let's use a custom toolbar for this sample.
oFCKeditor.ToolbarSet = 'PluginTest' ; oFCKeditor.ToolbarSet = 'PluginTest' ;

View File

@ -37,7 +37,7 @@
to &lt;/HTML&gt;). to &lt;/HTML&gt;).
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -148,7 +148,7 @@ function ResetIsDirty()
at runtime. at runtime.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -57,7 +57,7 @@ function FCKeditor_OnFocus( editorInstance )
in the JavaScript API. in the JavaScript API.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
Normal text field:<br /> Normal text field:<br />
<input name="NormaText" value="Plain Text" /> <input name="NormaText" value="Plain Text" />
<br /> <br />

View File

@ -39,7 +39,7 @@
<hr /> <hr />
<div id="xToolbar"></div> <div id="xToolbar"></div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
Normal text field:<br /> Normal text field:<br />
<input name="NormaText" value="Plain Text" /> <input name="NormaText" value="Plain Text" />
<br /> <br />

View File

@ -38,6 +38,6 @@
<hr /> <hr />
<div id="xToolbar"></div> <div id="xToolbar"></div>
<hr /> <hr />
<iframe src="sample11_frame.html" width="100%" height="300"></iframe> <iframe src="assets/sample11_frame.html" width="100%" height="300"></iframe>
</body> </body>
</html> </html>

View File

@ -76,7 +76,7 @@ function ChangeMode()
</tr> </tr>
</table> </table>
<br /> <br />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.

View File

@ -125,7 +125,7 @@ function PrepareSave()
operations so it will work even if the internal implementation changes. operations so it will work even if the internal implementation changes.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank" onsubmit="PrepareSave();"> <form action="../php/sampleposteddata.php" method="post" target="_blank" onsubmit="PrepareSave();">
<div id="Textarea"> <div id="Textarea">
<input type="button" value="Switch to FCKeditor" onclick="Toggle()" /> <input type="button" value="Switch to FCKeditor" onclick="Toggle()" />
<br /> <br />

View File

@ -39,7 +39,7 @@
or the "style" attribute, are avoided. or the "style" attribute, are avoided.
</div> </div>
<hr /> <hr />
<form action="sampleposteddata.asp" method="post" target="_blank"> <form action="../php/sampleposteddata.php" method="post" target="_blank">
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
// Automatically calculates the editor base path based on the _samples directory. // Automatically calculates the editor base path based on the _samples directory.
@ -52,7 +52,7 @@ oFCKeditor.BasePath = sBasePath ;
// Instruct the editor to load our configurations from a custom file, leaving the // Instruct the editor to load our configurations from a custom file, leaving the
// original configuration file untouched. // original configuration file untouched.
oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + '_samples/html/sample14.config.js' ; oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + '_samples/html/assets/sample14.config.js' ;
oFCKeditor.Height = 300 ; oFCKeditor.Height = 300 ;
oFCKeditor.Value = '<p>This is some <span class="Bold">sample text<\/span>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; oFCKeditor.Value = '<p>This is some <span class="Bold">sample text<\/span>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;

View File

@ -28,21 +28,24 @@
<title>FCKeditor - Samples - Posted Data</title> <title>FCKeditor - Samples - Posted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" /> <link href="../sample.css" rel="stylesheet" type="text/css">
</head> </head>
<body> <body>
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td nowrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
[iterate(client_postparams, local('this'))] [iterate(client_postparams, local('this'))]
<tr> <tr>
<td valign="top" nowrap><b>[#this->first]</b></td> <th>[#this->first]</th>
<td width="100%" style="white-space:pre">[#this->second]</td> <td><pre>[#this->second]</pre></td>
</tr> </tr>
[/iterate] [/iterate]
</table> </table>

View File

@ -70,31 +70,33 @@ require '../../fckeditor.pl';
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
print <<"_HTML_TAG_"; print <<"_HTML_TAG_";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<title>FCKeditor - Samples - Posted Data</title> <title>FCKeditor - Samples - Posted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" /> <link href="../sample.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td nowrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
_HTML_TAG_ _HTML_TAG_
foreach $key (keys %FORM) { foreach $key (keys %FORM) {
$postedValue = &specialchar_cnv($FORM{$key}); $postedValue = &specialchar_cnv($FORM{$key});
print <<"_HTML_TAG_"; print <<"_HTML_TAG_";
<tr> <tr>
<td valign="top" nowrap><b>$key</b></td> <th>$key</th>
<td width="100%" style="white-space:pre">$postedValue</td> <td><pre>$postedValue</pre></td>
</tr> </tr>
_HTML_TAG_ _HTML_TAG_
} }

View File

@ -28,17 +28,20 @@
<title>FCKeditor - Samples - Posted Data</title> <title>FCKeditor - Samples - Posted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" /> <link href="../sample.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td nowrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
<?php <?php
if ( isset( $_POST ) ) if ( isset( $_POST ) )
@ -55,8 +58,8 @@ foreach ( $postArray as $sForm => $value )
?> ?>
<tr> <tr>
<td valign="top" nowrap><b><?=$sForm?></b></td> <th><?php echo $sForm?></th>
<td width="100%" style="white-space:pre"><?=$postedValue?></td> <td><pre><?php echo $postedValue?></pre></td>
</tr> </tr>
<?php <?php
} }

View File

@ -53,19 +53,22 @@ print """
<h1>FCKeditor - Samples - Posted Data</h1> <h1>FCKeditor - Samples - Posted Data</h1>
This page lists all data posted by the form. This page lists all data posted by the form.
<hr> <hr>
<table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <table border="1" cellspacing="0" id="outputSample">
<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <colgroup><col width="80"><col></colgroup>
<td nowrap>Field Name&nbsp;&nbsp;</td> <thead>
<td>Value</td> <tr>
<th>Field Name</th>
<th>Value</th>
</tr> </tr>
</thead>
""" """
for key in form.keys(): for key in form.keys():
try: try:
value = form[key].value value = form[key].value
print """ print """
<tr> <tr>
<td valign="top" nowrap><b>%s</b></td> <th>%s</th>
<td width="100%%" style="white-space:pre">%s</td> <td><pre>%s</pre></td>
</tr> </tr>
""" % (key, value) """ % (key, value)
except Exception, e: except Exception, e:

View File

@ -21,7 +21,7 @@
* Styles used in the samples pages. * Styles used in the samples pages.
*/ */
body, td, input, select, textarea body, td, th, input, select, textarea
{ {
font-size: 12px; font-size: 12px;
font-family: Arial, Verdana, Sans-Serif; font-family: Arial, Verdana, Sans-Serif;
@ -36,15 +36,39 @@ h1
form form
{ {
margin: 0px 0px 0px 0px; margin: 0;
padding: 0px 0px 0px 0px; padding: 0;
}
#outputSample
{
table-layout: fixed;
width: 100%;
} }
pre pre
{ {
margin:0px; margin: 0;
padding:0px; padding: 0;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: pre; /* CSS2 */
word-wrap: break-word; /* Internet Explorer 5.5+ */ white-space: -moz-pre-wrap; /* Mozilla*/
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
word-wrap: break-word; /* IE */
}
#outputSample thead th
{
color: #dddddd;
background-color: #999999;
padding: 4px;
white-space: nowrap;
}
#outputSample tbody th
{
vertical-align: top;
text-align: left;
} }

View File

@ -64,6 +64,8 @@ function OpenSample( sample )
<option value="html/sample12.html">JavaScript : Sample 12 : Enter key behavior</option> <option value="html/sample12.html">JavaScript : Sample 12 : Enter key behavior</option>
<option value="html/sample13.html">JavaScript : Sample 13 : Dinamically switching with a Textarea</option> <option value="html/sample13.html">JavaScript : Sample 13 : Dinamically switching with a Textarea</option>
<option value="html/sample14.html">JavaScript : Sample 14 : XHTML 1.1</option> <option value="html/sample14.html">JavaScript : Sample 14 : XHTML 1.1</option>
<option value="html/sample15.html">JavaScript : Sample 15 : Legacy HTML 4 tags</option>
<option value="html/sample16.html">JavaScript : Sample 16 : Flash content editor</option>
<option value=""></option> <option value=""></option>
</optgroup> </optgroup>
<optgroup label="Active Fox Pro"> <optgroup label="Active Fox Pro">

View File

@ -33,261 +33,135 @@
<h1> <h1>
FCKeditor ChangeLog - What's New?</h1> FCKeditor ChangeLog - What's New?</h1>
<h3> <h3>
Version 2.6</h3> Version 2.6.3</h3>
<p>
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
<h3>
Version 2.6 RC</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
object can now be used to access all FCKeditor instances available in the page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
style="color: #ff0000">Attention:</span> By default, the editor now produces &lt;strong&gt;
and &lt;em&gt; instead of &lt;b&gt; and &lt;i&gt;.</li>
</ul>
<p> <p>
Fixed Bugs:</p> Fixed Bugs:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2412">#2412</a>] FCK.InsertHtml()
close button is now correctly positioned in IE in RTL languages.</li> is now properly removing selected contents after content insertion in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2420">#2420</a>] Spelling
dialog will now display the placeholder value correctly in IE.</li> mistake corrections made by the spell checking dialog are now undoable. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2411">#2411</a>] Insert
Enter or typing after a placeholder with the placeholder plugin will no longer generate anchor was not working for non-empty selections.</li>
colored text.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2426">#2426</a>] It was
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed impossible to switch between editor areas with a single click.</li>
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li> <li>Language file updates for the following languages:
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed <ul>
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li> <li>Canadian French</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2402">#2402</a>] Catalan
permission denied errors during opening popup menus in IE6 under domain relaxation
mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
Fixed XHTML source formatting errors in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
character is now properly encoded in file names returned by the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
and file names are now properly sanitized against control characters. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
character is now disallowed in current folder path.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
logic to override JavaScript errors occurring inside the editing frame due to user
added JavaScript code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
ENTER on list items containing block elements will now create new list item elements,
instead of adding further blocks to the same list item.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
only combos now get properly grayed out when moving to source view.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
an important bug regarding styles removal on styled text boundaries, introduced
with the 2.6 Beta 1. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
CSS &lt;style&gt; tags where being outputted when FullPage=true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
dialog now properly selects the first field when opening it to modify mailto or
anchor links. This problem was also throwing an error in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
will no longer remain behind in the editing area when the placeholder dialog is
opened.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
the issue where context menus sometimes don't disappear after selecting an option.
</li> </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2400">#2400</a>] Chinese
JavaScript error when EnterMode=br and user tries to insert a page break.</li> (Simplified and Traditional)</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2401">#2401</a>] Croatian</li>
the issue where the maximize editor button does not vertically expand the editing <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2422">#2422</a>] Czech</li>
area in Firefox.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2417">#2417</a>] Dutch</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration: <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2428">#2428</a>] French</li>
fixed filename encoding problems in file browser.</li> <li>German</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2427">#2427</a>] Hebrew</li>
FCK.InsertHtml() in non-IE browsers would now activate the document processor as <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2410">#2410</a>] Hindi</li>
expected.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2405">#2405</a>] Japanese</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2409">#2409</a>] Norwegian
XMLHttpRequest class is now used in IE, whenever it is available.</li> and Norwegian Bokmål</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE, <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2429">#2429</a>] Spanish</li>
the browser was able to enter in an infinite loop when working with multiple editors <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2406">#2406</a>] Vietnamese</li>
in the same page. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
having problems with SpellerPages, causing some errors to be thrown when completing
the spell checking in some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
command was throwing an error if executed in an editor where its relative button
is not present in the toolbar.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
a generic document processor for &lt;OBJECT&gt; and &lt;EMBED&gt; tags.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
the issue where the placeholder icon for &lt;EMBED&gt; tags does not always show
up in IE7.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
the caret will not any more move to the previous line when selecting a Format style
inside an empty paragraph.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
dialogs using API calls which deals with the selection, like InsertHtml now can
be sure the selection will be placed in the correct position.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
IE, the first character of table captions where being lost on table creation.</li>
<li>The selection and cursor position was not being properly handled when creating some
elements like forms and tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
</ul> </ul>
</li>
</ul>
<p>
This version has been sponsored by <a href="http://www.dataillusion.com/fs/">Data Illusion
survey software solutions</a>.</p>
<h3> <h3>
Version 2.6 Beta 1</h3> Version 2.6.3 Beta</h3>
<p> <p>
New Features and Improvements:</p> New Features and Improvements:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/439">#439</a>] Added a
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers new <strong>context menu option for opening links</strong> in the editor.</li>
and enhancing the editor usability.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2220">#2220</a>] <strong>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong> Email links</strong> from the Link dialog <strong>are now encoded</strong> by default
Adobe AIR</strong> compatibility.</li> to prevent being harvested by spammers. (Kudos to asuter for proposing the patch)
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support </li>
for <strong>document.domain</strong> with automatic domain detection.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2234">#2234</a>] Added
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong> the ability to create, modify and remove <strong>DIV containers</strong>. </li>
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2247">#2247</a>] The <strong>
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS, SHIFT+SPACE</strong> keystroke will now <strong>produce a &amp;nbsp;</strong> character.
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|&lt;minified </li>
CSS styles". All internal CSS links are already using this feature. </li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2252">#2252</a>] It's
<li>New language file for <strong>Canadian French</strong>.</li> now possible to enable the browsers default menu using the configuration file (FCKConfig.BrowserContextMenu
option). </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2032">#2032</a>] Added
HTML samples for legacy HTML and Flash HTML. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/234">#234</a>] Introduced
the "PreventSubmitHandler" setting, which makes it possible to instruct the editor
to not handle the hidden field update on form submit events.</li>
</ul> </ul>
<p> <p>
Fixed Bugs:</p> Fixed Bugs:</p>
<ul> <ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2319">#2319</a>] On Opera
several "strict warning" messages in Firefox when running FCKeditor.</li> and Firefox 3, the entire page was scrolling on SHIFT+ENTER, or when EnterMode='br'.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2321">#2321</a>] On Firefox
key will now work properly in IE with the cursor at the start of a formatted block.</li> 3, the entire page was scrolling when inserting block elements with the FCK.InsertElement
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's function, used by the Table and Horizontal Rule buttons.. </li>
possible to define in the Styles that a Style (with an empty class) must be shown <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/692">#692</a>] Added some
selected only when no class is present in the current element, and selecting that hints in editor/css/fck_editorarea.css on how to handle style items that would break
item will clear the current class (it does apply to any attribute, not only classes).</li> the style combo. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2263">#2263</a>] Fixed
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden a JavaScript error in IE which occurs when there are placeholder elements in the
div.</li> document and the user has pressed the Source button.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2314">#2314</a>] Corrected
&lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li> mixed up Chinese translations for the blockquote command.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2323">#2323</a>] Fixed
key will not any more break &lt;button&gt; elements at the beginning of paragraphs.</li> the issue where the show blocks command loses the current selection from the view
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor area when editing a long document.</li>
was not loading on a specific unknown situation. The breaking point has been removed.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2322">#2322</a>] Fixed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor the issue where the fit window command loses the current selection and scroll position
no longer hangs when operating on documents imported from Microsoft Word.</li> in the editing area.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1917">#1917</a>] Fixed
panels attached to a shared toolbar among multiple FCKeditor instances are no longer the issue where the merge down command for tables cells does not work in IE for
misplaced when the editing areas are absolutely or relatively positioned.</li> more than two cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2320">#2320</a>] Fixed
is now enforced only when ForcePasteAsPlainText = true.</li> the issue where the Find/Replace dialog scrolls the entire page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1645">#1645</a>] Added
the autogrow plugin didn't work properly in Firefox.</li> warning message about Firefox 3's strict origin policy.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2272">#2272</a>] Improved
toolbars are now properly sized in Opera.</li> the garbage filter in Paste from Word dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2327">#2327</a>] Fixed
on radio buttons or checkboxes in the editor in IE will no longer cause lockups invalid HTML in the Paste dialog.</li>
in IE.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1907">#1907</a>] Fixed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes sporadic "FCKeditorAPI is not defined" errors in Firefox 3.</li>
commands where executed even if the command itself was disabled.</li> <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2356">#2356</a>] Fixed
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button access denied error in IE7 when FCKeditor is launched from local filesystem.</li>
to empty the box in the "Paste from Word" has been removed as it leads to confusion <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1150">#1150</a>] Fixed
for some users.</li> the type="_moz" attribute that sometimes appear in &lt;br&gt; tags in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing
control elements in Firefox, Opera and Safari now works properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor
was surrounded by a &lt;div&gt; element that wasn't really needed.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form
control was moved in IE after creating it, then it did lose its name.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't
possible to change the type of an existing button.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation
now works inside table cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor
was entering on looping on some specific cases when dealing with invalid source
markup.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting
text into the "Find what" fields in the Find and Replace dialog would now activate
the find and replace buttons.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace
dialog will no longer display wrong starting positions for the match when there
are multiple and identical characters preceding the character at the real starting
point of the match.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
a JavaScript error which occurs in the Find/Replace dialog when the user presses
"Find" or "Replace" after the "No match found" message has appeared.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
breaks and spaces are now conserved when converting to and from the "Formatted"
format.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
the background color behind smiley icons and special characters in their corresponding
dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
error messages are now properly displayed in the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
and value fields in the selection box dialog will no longer extend beyond the dialog
limits when the user inputs a very long text or value for one of the selection options.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
issue where pressing Enter in an &lt;o:p&gt; tag in IE does not generate line breaks.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
issue where the image preview in image dialog sometimes doesn't display after selecting
the image from server browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
of depreciated "var").</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
removed closing tag: "?&gt;", so no additional whitespace added when files are included.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
integration: fixed issues with setting the editor height.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
returning an empty string.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
in IE will no longer turn the preceding normal whitespace into &amp;nbsp;.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
method now has an additional fifth parameter "customData" that will be sent to the
Execute method of the command for that menu item, allowing a single command to be
used for different menu items..</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
command now also removes the attributes from the cleaned text. The list of attributes
is configurable with FCKConfig.RemoveAttributes.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
warning message on Copy and Cut operation failure on IE due to paste permission
settings.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
to file browser has been changed to avoid requests containing double dots.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt; multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
block.</li> block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2363">#2363</a>] There
failed to load from local filesystem in IE7.</li> were some sporadic "Permission Denied" errors with IE on some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2135">#2135</a>] Fixed
a data loss bug in IE when there are @import statements in the editor's CSS files,
and IE's cache is set to "Check for newer versions on every visit".</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2376">#2376</a>] FCK.InsertHtml()
will now insert to the last selected position after the user has selected things
outside of FCKeditor, in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2368">#2368</a>] Fixed
broken protect source logic for comments in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2387">#2387</a>] Fixed
JavaScript error with list commands when the editable document is selected with
Ctrl-A.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2390">#2390</a>] Fixed
the issue where indent styles in JavaScript-generated &lt;p&gt; blocks are erased
in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2394">#2394</a>] Fixed
JavaScript error with the "split vertically" command in IE when attempting to split
cells in the last row of a table.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2316">#2316</a>] The sample
posted data page has now the table fixed at 100% width. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2396">#2396</a>] SpellerPages
was causing a "Permission Denied" error in some situations. </li>
</ul> </ul>
<p> <p>
<a href="_whatsnew_history.html">See previous versions history</a> <a href="_whatsnew_history.html">See previous versions history</a></p>
</p>
</body> </body>
</html> </html>

View File

@ -32,6 +32,420 @@
<body> <body>
<h1> <h1>
FCKeditor ChangeLog - What's New?</h1> FCKeditor ChangeLog - What's New?</h1>
<h3>
Version 2.6.2</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2043">#2043</a>] The debug
script is not any more part of the compressed files. If FCKeditor native debugging
features (FCKDebug) are required, the _source folder must be present in your installation.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2248">#2248</a>] Calling
FCK.InsertHtml( 'nbsp;') was inserting a plain space instead of a non breaking space
character.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2273">#2273</a>] The dragresizetable
plugin now works in Firefox 3 as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2254">#2254</a>] Minor
fix in FCKSelection for nodeTagName object.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1614">#1614</a>] Unified
FCKConfig.FullBasePath with FCKConfig.BasePath.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2127">#2127</a>] Changed
floating dialogs to use fixed positioning so that they are no longer affected by
scrolling.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2018">#2018</a>] Reversed
the fix for <a target="_blank" href="http://dev.fckeditor.net/ticket/183">#183</a>
which broke FCKeditorAPI's cleanup logic. A new configuration directive <strong>MsWebBrowserControlCompat</strong>
has been added for those who wish to force the #183 fix to be enabled.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2276">#2276</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/2279">#2279</a>] On Opera
and Firefox 3, the entire page was scrolling on ENTER.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2149</a>] CSS urls
with querystring parameters were not being accepted for CSS values in the configuration
file (like EditorAreaCSS).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] On some
specific cases, with Firefox 2, some extra spacing was appearing in the final HTML
on posting, if inserting two successive tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] Block
elements (like tables or horizontal rules) will be inserted correctly now when the
cursor is at the start or the end of blocks. No extra paragraphs will be included
in this operation.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2149">#2197</a>] The TAB
key will now have the default browser behavior if TabSpaces=0. It will move the
focus out of the editor (expect on Safari).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2296">#2296</a>] Fixed
permission denied error on clicking on files in the file browser.</li>
</ul>
<h3>
Version 2.6.1</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2150">#2150</a>] The searching
speed of the Find/Replace dialog has been vastly improved.</li>
<li>New language file for <strong>Gujarati</strong> (by Nilam Doctor).</li>
<li>A new TabIndex property has been added to the JavaScript integration files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2215">#2215</a>] Following
the above new feature, the ReplaceTextarea method will now copy the textarea.tabIndex
value if available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2163">#2163</a>] If the
FCKConfig.DocType setting points to a HTML DocType then the output won't generate
self-closing tags (it will output &lt;img &gt; instead of &lt;img /&gt;).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2173">#2173</a>] A throbber
will be shown in the Quick Uploads.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2142">#2142</a>] HTML
samples will now use sampleposteddata.php in action parameter inside a form.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/768">#768</a>] It is no
longer possible for an image to have its width and height defined with both HTML
attributes and inline CSS styles in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1426">#1426</a>] Fixed
the error loading fckstyles.xml in servers which cannot return the correct content
type header for .xml files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2102">#2102</a>] Fixed
FCKConfig.DocType which stopped working in FCKeditor 2.6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2039">#2039</a>] Fixed
the locking up issue in the Find/Replace dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2124">#2124</a>] PHP File
Browser: fixed issue with resolving paths on Windows servers with PHP 5.2.4/5.2.5.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2059">#2059</a>] Fixed
the error in the toolbar name in fckeditor.py.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2065">#2065</a>] Floating
dialogs will now block the user from re-selecting the editing area by pressing Tab.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2114">#2114</a>] Added
a workaround for an IE6 bug which causes floating dialogs to appear blank after
opening it for the first time.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2136">#2136</a>] Fixed
JavaScript error in IE when opening the bullet list properties dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1633">#1633</a>] External
styles should no longer interfere with the appearance of the editor and floating
panels now.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2113">#2113</a>] Fixed
unneeded &lt;span class=&quot;Apple-style-span&quot;&gt; created after inserting
special characters.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2170">#2170</a>] Fixed
Ctrl-Insert hotkey for copying.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2125">#2125</a>] Fixed
the issue that FCK.InsertHtml() doesn't insert contents at the caret position when
dialogs are opened in IE. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1764">#1764</a>] FCKeditor
will no longer catch focus in IE on load when StartupFocus is false and the initial
content is empty.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2126">#2126</a>] Opening
and closing floating dialogs will no longer cause toolbar button states to become
frozen.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2159">#2159</a>] Selection
are now correctly restored when undoing changes made by the Replace dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2160">#2160</a>] "Match
whole word" in the Find and Replace dialog will now find words next to punctuation
marks as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2162">#2162</a>] If the
configuration is set to work including the &lt;head&gt; (FullPage), references to
stylesheets added by Firefox extensions won't be added to the output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2168">#2168</a>] Comments
won't generate new paragraphs in the output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2184">#2184</a>] Fixed
several validation errors in the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed
an IE issue where pressing backspace may merge a hyperlink on the previous line
with the text on the current line.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1691">#1691</a>] Creation
of links in Safari failed if there was no selection.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2188">#2188</a>] PreserveSessionOnFileBrowser
is now removed as it was made obsolete with 2.6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/898">#898</a>] The styles
for the editing area are applied in the image preview dialog.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2056">#2056</a>] Fixed
several validation errors in the dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2063">#2063</a>] Fixed
some problems in asp related to the use of network paths for the location of the
uploaded files.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1593">#1593</a>] The "Sample
Posted Data" page will now properly wrap the text.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2239">#2239</a>] The PHP
code in sampleposteddata.php has been changed from "&lt;?=" to "&lt;? echo".</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2241">#2241</a>] Fixed
404 error in floating panels when FCKeditor is installed to a different domain.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2066">#2066</a>] Added
a workaround for a Mac Safari 3.1 browser bug which caused the Fit Window button
to give a blank screen.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2218">#2218</a>] Improved
Gecko based browser detection to accept Epiphany/Gecko as well.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2193">#2193</a>] Fixed
the issue where the caret cannot reach the last character of a paragraph in Opera
9.50.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2264">#2264</a>] Fixed
empty spaces that appear at the top of the editor in Opera 9.50.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2238">#2238</a>] The &lt;object&gt;
placeholder was not being properly displayed in the compressed distribution version
and nightly builds.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2115">#2115</a>] Fixed
JavaScript (permission denied) error in Firefox when file has been uploaded.</li>
</ul>
<h3>
Version 2.6</h3>
<p>
No changes. The stabilization of the 2.6 RC was completed successfully, as expected.</p>
<h3>
Version 2.6 RC</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
object can now be used to access all FCKeditor instances available in the page.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
style="color: #ff0000">Attention:</span> By default, the editor now produces &lt;strong&gt;
and &lt;em&gt; instead of &lt;b&gt; and &lt;i&gt;.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog
close button is now correctly positioned in IE in RTL languages.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder
dialog will now display the placeholder value correctly in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing
Enter or typing after a placeholder with the placeholder plugin will no longer generate
colored text.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed
an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed
permission denied errors during opening popup menus in IE6 under domain relaxation
mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
Fixed XHTML source formatting errors in non-IE browsers.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
character is now properly encoded in file names returned by the File Browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
and file names are now properly sanitized against control characters. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
character is now disallowed in current folder path.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
logic to override JavaScript errors occurring inside the editing frame due to user
added JavaScript code.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
ENTER on list items containing block elements will now create new list item elements,
instead of adding further blocks to the same list item.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
only combos now get properly grayed out when moving to source view.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
an important bug regarding styles removal on styled text boundaries, introduced
with the 2.6 Beta 1. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
CSS &lt;style&gt; tags where being outputted when FullPage=true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
dialog now properly selects the first field when opening it to modify mailto or
anchor links. This problem was also throwing an error in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
will no longer remain behind in the editing area when the placeholder dialog is
opened.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
the issue where context menus sometimes don't disappear after selecting an option.
</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed
JavaScript error when EnterMode=br and user tries to insert a page break.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed
the issue where the maximize editor button does not vertically expand the editing
area in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
fixed filename encoding problems in file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
FCK.InsertHtml() in non-IE browsers would now activate the document processor as
expected.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
XMLHttpRequest class is now used in IE, whenever it is available.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
the browser was able to enter in an infinite loop when working with multiple editors
in the same page. </li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
having problems with SpellerPages, causing some errors to be thrown when completing
the spell checking in some situations.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
command was throwing an error if executed in an editor where its relative button
is not present in the toolbar.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
a generic document processor for &lt;OBJECT&gt; and &lt;EMBED&gt; tags.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
the issue where the placeholder icon for &lt;EMBED&gt; tags does not always show
up in IE7.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
the caret will not any more move to the previous line when selecting a Format style
inside an empty paragraph.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
dialogs using API calls which deals with the selection, like InsertHtml now can
be sure the selection will be placed in the correct position.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
IE, the first character of table captions where being lost on table creation.</li>
<li>The selection and cursor position was not being properly handled when creating some
elements like forms and tables.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
Perl sample files, the GetServerPath function will now calculate the path properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2208">#2208</a>] Added
missing translations in Italian language file.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2096">#2096</a>] Added
the codepage to basexml file. Filenames with special chars should now display properly.</li>
</ul>
<h3>
Version 2.6 Beta 1</h3>
<p>
New Features and Improvements:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/35">#35</a>] <strong>New
(and cool!) floating dialog system</strong>, avoiding problems with popup blockers
and enhancing the editor usability.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong>
Adobe AIR</strong> compatibility.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support
for <strong>document.domain</strong> with automatic domain detection.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1622">#1622</a>] New <strong>
inline CSS cache</strong> feature, making it possible to avoid downloading the CSS
files for the editing area and skins. For that, it is enough to set the EditorAreaCSS,
SkinEditorCSS and SkinDialogCSS to string values in the format "/absolute/path/for/urls/|&lt;minified
CSS styles". All internal CSS links are already using this feature. </li>
<li>New language file for <strong>Canadian French</strong>.</li>
</ul>
<p>
Fixed Bugs:</p>
<ul>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1643">#1643</a>] Resolved
several "strict warning" messages in Firefox when running FCKeditor.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER
key will now work properly in IE with the cursor at the start of a formatted block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's
possible to define in the Styles that a Style (with an empty class) must be shown
selected only when no class is present in the current element, and selecting that
item will clear the current class (it does apply to any attribute, not only classes).</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/191">#191</a>] The scrollbars
are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden
div.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned
&lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/309">#309</a>] The ENTER
key will not any more break &lt;button&gt; elements at the beginning of paragraphs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1654">#1654</a>] The editor
was not loading on a specific unknown situation. The breaking point has been removed.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1707">#1707</a>] The editor
no longer hangs when operating on documents imported from Microsoft Word.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1514">#1514</a>] Floating
panels attached to a shared toolbar among multiple FCKeditor instances are no longer
misplaced when the editing areas are absolutely or relatively positioned.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1715">#1715</a>] The ShowDropDialog
is now enforced only when ForcePasteAsPlainText = true.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes
the autogrow plugin didn't work properly in Firefox.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1728">#1728</a>] External
toolbars are now properly sized in Opera.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking
on radio buttons or checkboxes in the editor in IE will no longer cause lockups
in IE.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes
commands where executed even if the command itself was disabled.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button
to empty the box in the "Paste from Word" has been removed as it leads to confusion
for some users.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing
control elements in Firefox, Opera and Safari now works properly.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1613">#1613</a>] The editor
was surrounded by a &lt;div&gt; element that wasn't really needed.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/676">#676</a>] If a form
control was moved in IE after creating it, then it did lose its name.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] It wasn't
possible to change the type of an existing button.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1854">#1854</a>] Indentation
now works inside table cells.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor
was entering on looping on some specific cases when dealing with invalid source
markup.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1530">#1530</a>] Pasting
text into the "Find what" fields in the Find and Replace dialog would now activate
the find and replace buttons.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1828">#1828</a>] The Find/Replace
dialog will no longer display wrong starting positions for the match when there
are multiple and identical characters preceding the character at the real starting
point of the match.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1878">#1878</a>] Fixed
a JavaScript error which occurs in the Find/Replace dialog when the user presses
"Find" or "Replace" after the "No match found" message has appeared.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1355">#1355</a>] Line
breaks and spaces are now conserved when converting to and from the "Formatted"
format.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1670">#1670</a>] Improved
the background color behind smiley icons and special characters in their corresponding
dialogs.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1693">#1693</a>] Custom
error messages are now properly displayed in the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/970">#970</a>] The text
and value fields in the selection box dialog will no longer extend beyond the dialog
limits when the user inputs a very long text or value for one of the selection options.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/479">#479</a>] Fixed the
issue where pressing Enter in an &lt;o:p&gt; tag in IE does not generate line breaks.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/481">#481</a>] Fixed the
issue where the image preview in image dialog sometimes doesn't display after selecting
the image from server browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1488">#1488</a>] PHP integration:
the FCKeditor class is now more PHP5/6 friendly ("public" keyword is used instead
of depreciated "var").</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
removed closing tag: "?&gt;", so no additional whitespace added when files are included.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1871">#1871</a>] PHP file
browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1872">#1872</a>] Perl
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1873">#1873</a>] Python
file browser: permissions applied with the chmod command are now configurable.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1572">#1572</a>] ColdFusion
integration: fixed issues with setting the editor height.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1692">#1692</a>] ColdFusion
file browser: it is possible now to define TempDirectory to avoid issues with GetTempdirectory()
returning an empty string.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1379">#1379</a>] ColdFusion
file browser: resolved issues with OnRequestEnd.cfm breaking the file browser.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1509">#1509</a>] InsertHtml()
in IE will no longer turn the preceding normal whitespace into &amp;nbsp;.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/958">#958</a>] The AddItem
method now has an additional fifth parameter "customData" that will be sent to the
Execute method of the command for that menu item, allowing a single command to be
used for different menu items..</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1502">#1502</a>] The RemoveFormat
command now also removes the attributes from the cleaned text. The list of attributes
is configurable with FCKConfig.RemoveAttributes.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1596">#1596</a>] On Safari,
dialogs have now right-to-left layout when it runs a RTL language, like Arabic.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1344">#1344</a>] Added
warning message on Copy and Cut operation failure on IE due to paste permission
settings.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
to file browser has been changed to avoid requests containing double dots.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
block.</li>
<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
failed to load from local filesystem in IE7.</li>
</ul>
<h3> <h3>
Version 2.5.1</h3> Version 2.5.1</h3>
<p> <p>

View File

@ -89,6 +89,9 @@ FCKContextMenu.prototype.AttachToElement = function( element )
function FCKContextMenu_Document_OnContextMenu( e ) function FCKContextMenu_Document_OnContextMenu( e )
{ {
if ( FCKConfig.BrowserContextMenu )
return true ;
var el = e.target ; var el = e.target ;
while ( el ) while ( el )
@ -114,6 +117,9 @@ function FCKContextMenu_Document_OnMouseDown( e )
if( !e || e.button != 2 ) if( !e || e.button != 2 )
return false ; return false ;
if ( FCKConfig.BrowserContextMenu )
return true ;
var el = e.target ; var el = e.target ;
while ( el ) while ( el )
@ -145,6 +151,9 @@ function FCKContextMenu_Document_OnMouseDown( e )
function FCKContextMenu_Document_OnMouseUp( e ) function FCKContextMenu_Document_OnMouseUp( e )
{ {
if ( FCKConfig.BrowserContextMenu )
return true ;
var overrideButton = FCKContextMenu_OverrideButton ; var overrideButton = FCKContextMenu_OverrideButton ;
if ( overrideButton ) if ( overrideButton )
@ -164,7 +173,7 @@ function FCKContextMenu_Document_OnMouseUp( e )
function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el ) function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
{ {
if ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) if ( ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) || FCKConfig.BrowserContextMenu )
return true ; return true ;
var eTarget = el || this ; var eTarget = el || this ;

View File

@ -39,6 +39,13 @@ FCKDocumentFragment.prototype =
targetNode.appendChild( this.RootNode ) ; targetNode.appendChild( this.RootNode ) ;
}, },
AppendHtml : function( html )
{
var eTmpDiv = this.RootNode.ownerDocument.createElement( 'div' ) ;
eTmpDiv.innerHTML = html ;
FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
},
InsertAfterNode : function( existingNode ) InsertAfterNode : function( existingNode )
{ {
FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ; FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ;

View File

@ -41,7 +41,6 @@ FCKDomRange.prototype =
{ {
// For text nodes, the node itself is the StartNode. // For text nodes, the node itself is the StartNode.
var eStart = innerRange.startContainer ; var eStart = innerRange.startContainer ;
var eEnd = innerRange.endContainer ;
var oElementPath = new FCKElementPath( eStart ) ; var oElementPath = new FCKElementPath( eStart ) ;
this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ; this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ;
@ -49,6 +48,17 @@ FCKDomRange.prototype =
this.StartBlock = oElementPath.Block ; this.StartBlock = oElementPath.Block ;
this.StartBlockLimit = oElementPath.BlockLimit ; this.StartBlockLimit = oElementPath.BlockLimit ;
if ( innerRange.collapsed )
{
this.EndNode = this.StartNode ;
this.EndContainer = this.StartContainer ;
this.EndBlock = this.StartBlock ;
this.EndBlockLimit = this.StartBlockLimit ;
}
else
{
var eEnd = innerRange.endContainer ;
if ( eStart != eEnd ) if ( eStart != eEnd )
oElementPath = new FCKElementPath( eEnd ) ; oElementPath = new FCKElementPath( eEnd ) ;
@ -72,6 +82,7 @@ FCKDomRange.prototype =
this.EndBlock = oElementPath.Block ; this.EndBlock = oElementPath.Block ;
this.EndBlockLimit = oElementPath.BlockLimit ; this.EndBlockLimit = oElementPath.BlockLimit ;
} }
}
this._Cache = {} ; this._Cache = {} ;
}, },
@ -458,13 +469,13 @@ FCKDomRange.prototype =
// Also note that the node that we use for "address base" would change during backtracking. // Also note that the node that we use for "address base" would change during backtracking.
var addrStart = this._Range.startContainer ; var addrStart = this._Range.startContainer ;
var addrEnd = this._Range.endContainer ; var addrEnd = this._Range.endContainer ;
while ( curStart && curStart.nodeType == 3 ) while ( curStart && addrStart.nodeType == 3 )
{ {
bookmark.Start[0] += curStart.length ; bookmark.Start[0] += curStart.length ;
addrStart = curStart ; addrStart = curStart ;
curStart = curStart.previousSibling ; curStart = curStart.previousSibling ;
} }
while ( curEnd && curEnd.nodeType == 3 ) while ( curEnd && addrEnd.nodeType == 3 )
{ {
bookmark.End[0] += curEnd.length ; bookmark.End[0] += curEnd.length ;
addrEnd = curEnd ; addrEnd = curEnd ;
@ -863,6 +874,12 @@ FCKDomRange.prototype =
this.ExtractContents().AppendTo( oFixedBlock ) ; this.ExtractContents().AppendTo( oFixedBlock ) ;
FCKDomTools.TrimNode( oFixedBlock ) ; FCKDomTools.TrimNode( oFixedBlock ) ;
// If the fixed block is empty (not counting bookmark nodes)
// Add a <br /> inside to expand it.
if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
&& FCKBrowserInfo.IsGeckoLike )
FCKTools.AppendBogusBr( oFixedBlock ) ;
// Insert the fixed block into the DOM. // Insert the fixed block into the DOM.
this.InsertNode( oFixedBlock ) ; this.InsertNode( oFixedBlock ) ;

View File

@ -136,7 +136,7 @@ FCKDomRangeIterator.prototype =
// The found boundary must be set as the next one at this // The found boundary must be set as the next one at this
// point. (#1717) // point. (#1717)
if ( nodeName != 'br' ) if ( nodeName != 'br' )
this._NextNode = currentNode ; this._NextNode = FCKDomTools.GetNextSourceNode( currentNode, true, null, lastNode ) ;
} }
closeRange = true ; closeRange = true ;

View File

@ -96,11 +96,11 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ; var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ;
oIFrame.frameBorder = 0 ; oIFrame.frameBorder = 0 ;
oIFrame.width = oIFrame.height = '100%' ; oIFrame.style.width = oIFrame.style.height = '100%' ;
if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE ) if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
{ {
window._FCKHtmlToLoad = sOverrideError + html ; window._FCKHtmlToLoad = html.replace( /<head>/i, '<head>' + sOverrideError ) ;
oIFrame.src = 'javascript:void( (function(){' + oIFrame.src = 'javascript:void( (function(){' +
'document.open() ;' + 'document.open() ;' +
'document.domain="' + document.domain + '" ;' + 'document.domain="' + document.domain + '" ;' +
@ -132,7 +132,7 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
var oDoc = this.Window.document ; var oDoc = this.Window.document ;
oDoc.open() ; oDoc.open() ;
oDoc.write( sOverrideError + html ) ; oDoc.write( html.replace( /<head>/i, '<head>' + sOverrideError ) ) ;
oDoc.close() ; oDoc.close() ;
} }
@ -150,18 +150,23 @@ FCKEditingArea.prototype.Start = function( html, secondCall )
if ( oIFrame.readyState && oIFrame.readyState != 'completed' ) if ( oIFrame.readyState && oIFrame.readyState != 'completed' )
{ {
var editArea = this ; var editArea = this ;
( oIFrame.onreadystatechange = function()
// Using a IE alternative for DOMContentLoaded, similar to the
// solution proposed at http://javascript.nwbox.com/IEContentLoaded/
setTimeout( function()
{ {
if ( oIFrame.readyState == 'complete' ) try
{ {
oIFrame.onreadystatechange = null ; editArea.Window.document.documentElement.doScroll("left") ;
}
catch(e)
{
setTimeout( arguments.callee, 0 ) ;
return ;
}
editArea.Window._FCKEditingArea = editArea ; editArea.Window._FCKEditingArea = editArea ;
FCKEditingArea_CompleteStart.call( editArea.Window ) ; FCKEditingArea_CompleteStart.call( editArea.Window ) ;
} }, 0 ) ;
// It happened that IE changed the state to "complete" after the
// "if" and before the "onreadystatechange" assignement, making we
// lost the event call, so we do a manual call just to be sure.
} )() ;
} }
else else
{ {
@ -246,6 +251,7 @@ FCKEditingArea.prototype.MakeEditable = function()
if ( this._BodyHTML ) if ( this._BodyHTML )
{ {
oDoc.body.innerHTML = this._BodyHTML ; oDoc.body.innerHTML = this._BodyHTML ;
oDoc.body.offsetLeft ; // Don't remove, this is a hack to fix Opera 9.50, see #2264.
this._BodyHTML = null ; this._BodyHTML = null ;
} }

View File

@ -43,17 +43,21 @@ var FCKEnterKey = function( targetWindow, enterMode, shiftEnterMode, tabSpaces )
oKeystrokeHandler.SetKeystrokes( [ oKeystrokeHandler.SetKeystrokes( [
[ 13 , 'Enter' ], [ 13 , 'Enter' ],
[ SHIFT + 13, 'ShiftEnter' ], [ SHIFT + 13, 'ShiftEnter' ],
[ 9 , 'Tab' ],
[ 8 , 'Backspace' ], [ 8 , 'Backspace' ],
[ CTRL + 8 , 'CtrlBackspace' ], [ CTRL + 8 , 'CtrlBackspace' ],
[ 46 , 'Delete' ] [ 46 , 'Delete' ]
] ) ; ] ) ;
if ( tabSpaces > 0 )
{
this.TabText = '' ; this.TabText = '' ;
while ( tabSpaces-- > 0 )
// Safari by default inserts 4 spaces on TAB, while others make the editor
// loose focus. So, we need to handle it here to not include those spaces.
if ( tabSpaces > 0 || FCKBrowserInfo.IsSafari )
{
while ( tabSpaces-- )
this.TabText += '\xa0' ; this.TabText += '\xa0' ;
oKeystrokeHandler.SetKeystrokes( [ 9, 'Tab' ] );
} }
oKeystrokeHandler.AttachToElement( targetWindow.document ) ; oKeystrokeHandler.AttachToElement( targetWindow.document ) ;
@ -163,6 +167,28 @@ FCKEnterKey.prototype.DoBackspace = function()
return false ; return false ;
} }
// On IE, it is better for us handle the deletion if the caret is preceeded
// by a <br> (#1383).
if ( FCKBrowserInfo.IsIE )
{
var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ;
if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' )
{
// Create a range that starts after the <br> and ends at the
// current range position.
var testRange = oRange.Clone() ;
testRange.SetStart( previousElement, 4 ) ;
// If that range is empty, we can proceed cleaning that <br> manually.
if ( testRange.CheckIsEmpty() )
{
previousElement.parentNode.removeChild( previousElement ) ;
return true ;
}
}
}
var oStartBlock = oRange.StartBlock ; var oStartBlock = oRange.StartBlock ;
var oEndBlock = oRange.EndBlock ; var oEndBlock = oRange.EndBlock ;
@ -504,10 +530,8 @@ FCKEnterKey.prototype._ExecuteEnterBlock = function( blockTag, range )
oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ; oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ;
} }
if ( FCKBrowserInfo.IsSafari ) if ( FCKBrowserInfo.IsGeckoLike )
FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ; FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
else if ( FCKBrowserInfo.IsGeckoLike )
( eNextBlock || eNewBlock ).scrollIntoView( false ) ;
oRange.Select() ; oRange.Select() ;
} }
@ -590,10 +614,7 @@ FCKEnterKey.prototype._ExecuteEnterBr = function( blockTag )
eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ; eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ;
if ( FCKBrowserInfo.IsSafari )
FCKDomTools.ScrollIntoView( dummy, false ) ; FCKDomTools.ScrollIntoView( dummy, false ) ;
else
dummy.scrollIntoView( false ) ;
dummy.parentNode.removeChild( dummy ) ; dummy.parentNode.removeChild( dummy ) ;
} }

View File

@ -43,7 +43,7 @@ FCKIECleanup.prototype.AddItem = function( dirtyItem, cleanupFunction )
function FCKIECleanup_Cleanup() function FCKIECleanup_Cleanup()
{ {
if ( !this._FCKCleanupObj || !window.FCKUnloadFlag ) if ( !this._FCKCleanupObj || ( FCKConfig.MsWebBrowserControlCompat && !window.FCKUnloadFlag ) )
return ; return ;
var aItems = this._FCKCleanupObj.Items ; var aItems = this._FCKCleanupObj.Items ;

View File

@ -66,11 +66,12 @@ var FCKPanel = function( parentWindow )
else else
{ {
var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ; var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
FCKTools.ResetStyles( oIFrame );
oIFrame.src = 'javascript:void(0)' ; oIFrame.src = 'javascript:void(0)' ;
oIFrame.allowTransparency = true ; oIFrame.allowTransparency = true ;
oIFrame.frameBorder = '0' ; oIFrame.frameBorder = '0' ;
oIFrame.scrolling = 'no' ; oIFrame.scrolling = 'no' ;
oIFrame.width = oIFrame.height = 0 ; oIFrame.style.width = oIFrame.style.height = '0px' ;
FCKDomTools.SetElementStyles( oIFrame, FCKDomTools.SetElementStyles( oIFrame,
{ {
position : 'absolute', position : 'absolute',
@ -277,8 +278,8 @@ FCKPanel.prototype.Show = function( x, y, relElement, width, height )
{ {
var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ; var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
var iHeight = eMainNode.offsetHeight ; var iHeight = eMainNode.offsetHeight ;
me._IFrame.width = iWidth ; me._IFrame.style.width = iWidth + 'px' ;
me._IFrame.height = iHeight ; me._IFrame.style.height = iHeight + 'px' ;
}, 0 ) ; }, 0 ) ;
@ -303,7 +304,7 @@ FCKPanel.prototype.Hide = function( ignoreOnHide, ignoreFocusManagerUnlock )
// It is better to set the sizes to 0, otherwise Firefox would have // It is better to set the sizes to 0, otherwise Firefox would have
// rendering problems. // rendering problems.
this._IFrame.width = this._IFrame.height = 0 ; this._IFrame.style.width = this._IFrame.style.height = '0px' ;
this._IsOpened = false ; this._IsOpened = false ;

View File

@ -221,6 +221,8 @@ FCKStyle.prototype =
if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) ) if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) )
continue ; continue ;
/*jsl:fallthru*/
default : default :
FCKDomTools.RemoveAttribute( pathElement, att ) ; FCKDomTools.RemoveAttribute( pathElement, att ) ;
} }
@ -373,6 +375,8 @@ FCKStyle.prototype =
if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) ) if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) )
continue ; continue ;
/*jsl:fallthru*/
default : default :
FCKDomTools.RemoveAttribute( currentNode, att ) ; FCKDomTools.RemoveAttribute( currentNode, att ) ;
} }
@ -546,6 +550,8 @@ FCKStyle.prototype =
if ( FCKDomTools.GetAttributeValue( innerElement, att ) != this.GetFinalAttributeValue( att ) ) if ( FCKDomTools.GetAttributeValue( innerElement, att ) != this.GetFinalAttributeValue( att ) )
continue ; continue ;
/*jsl:fallthru*/
default : default :
FCKDomTools.RemoveAttribute( innerElement, att ) ; FCKDomTools.RemoveAttribute( innerElement, att ) ;
} }
@ -781,7 +787,7 @@ FCKStyle.prototype =
{ {
if ( !isTag ) if ( !isTag )
{ {
value = value.replace( /\n/g, '<BR>' ) ; value = value.replace( /\n/g, '<br>' ) ;
value = value.replace( /[ \t]{2,}/g, value = value.replace( /[ \t]{2,}/g,
function ( match ) function ( match )
{ {
@ -802,40 +808,126 @@ FCKStyle.prototype =
// Handle converting from a regular block to a <pre> block. // Handle converting from a regular block to a <pre> block.
var innerHTML = block.innerHTML.Trim() ; var innerHTML = block.innerHTML.Trim() ;
// 1. Delete ANSI whitespaces immediately before and after <BR> because they are not visible. // 1. Delete ANSI whitespaces immediately before and after <BR> because
// 2. Mark down any <BR /> nodes here so they can be turned into \n in the next step and avoid being compressed. // they are not visible.
innerHTML = innerHTML.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '<BR />' ) ; // 2. Mark down any <BR /> nodes here so they can be turned into \n in
// the next step and avoid being compressed.
innerHTML = innerHTML.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '<br />' ) ;
// 3. Compress other ANSI whitespaces since they're only visible as one single space previously. // 3. Compress other ANSI whitespaces since they're only visible as one
// single space previously.
// 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>. // 4. Convert &nbsp; to spaces since &nbsp; is no longer needed in <PRE>.
// 5. Convert any <BR /> to \n. This must not be done earlier because the \n would then get compressed. // 5. Convert any <BR /> to \n. This must not be done earlier because
// the \n would then get compressed.
var htmlIterator = new FCKHtmlIterator( innerHTML ) ; var htmlIterator = new FCKHtmlIterator( innerHTML ) ;
var results = [] ; var results = [] ;
htmlIterator.Each( function( isTag, value ) htmlIterator.Each( function( isTag, value )
{ {
if ( !isTag ) if ( !isTag )
value = value.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' ) ; value = value.replace( /([ \t\n\r]+|&nbsp;)/g, ' ' ) ;
else if ( isTag && value == '<BR />' ) else if ( isTag && value == '<br />' )
value = '\n' ; value = '\n' ;
results.push( value ) ; results.push( value ) ;
} ) ; } ) ;
// Assigning innerHTML to <PRE> in IE causes all linebreaks to be reduced to spaces. // Assigning innerHTML to <PRE> in IE causes all linebreaks to be
// Assigning outerHTML to <PRE> in IE doesn't work if the <PRE> isn't contained in another node // reduced to spaces.
// since the node reference is changed after outerHTML assignment. // Assigning outerHTML to <PRE> in IE doesn't work if the <PRE> isn't
// contained in another node since the node reference is changed after
// outerHTML assignment.
// So, we need some hacks to workaround IE bugs here. // So, we need some hacks to workaround IE bugs here.
if ( FCKBrowserInfo.IsIE ) if ( FCKBrowserInfo.IsIE )
{ {
var temp = doc.createElement( 'div' ) ; var temp = doc.createElement( 'div' ) ;
temp.appendChild( newBlock ) ; temp.appendChild( newBlock ) ;
newBlock.outerHTML = '<PRE>\n' + results.join( '' ) + '</PRE>' ; newBlock.outerHTML = '<pre>\n' + results.join( '' ) + '</pre>' ;
newBlock = temp.removeChild( temp.firstChild ) ; newBlock = temp.removeChild( temp.firstChild ) ;
} }
else else
newBlock.innerHTML = results.join( '' ) ; newBlock.innerHTML = results.join( '' ) ;
return newBlock ; return newBlock ;
}, },
/**
* Merge a <pre> block with a previous <pre> block, if available.
*/
_CheckAndMergePre : function( previousBlock, preBlock )
{
// Check if the previous block and the current block are next
// to each other.
if ( previousBlock != FCKDomTools.GetPreviousSourceElement( preBlock, true ) )
return ;
// Merge the previous <pre> block contents into the current <pre>
// block.
//
// Another thing to be careful here is that currentBlock might contain
// a '\n' at the beginning, and previousBlock might contain a '\n'
// towards the end. These new lines are not normally displayed but they
// become visible after merging.
var innerHTML = previousBlock.innerHTML.replace( /\n$/, '' ) + '\n\n' +
preBlock.innerHTML.replace( /^\n/, '' ) ;
// Buggy IE normalizes innerHTML from <pre>, breaking whitespaces.
if ( FCKBrowserInfo.IsIE )
preBlock.outerHTML = '<pre>' + innerHTML + '</pre>' ;
else
preBlock.innerHTML = innerHTML ;
// Remove the previous <pre> block.
//
// The preBlock must not be moved or deleted from the DOM tree. This
// guarantees the FCKDomRangeIterator in _ApplyBlockStyle would not
// get lost at the next iteration.
FCKDomTools.RemoveNode( previousBlock ) ;
},
_CheckAndSplitPre : function( newBlock )
{
var lastNewBlock ;
var cursor = newBlock.firstChild ;
// We are not splitting <br><br> at the beginning of the block, so
// we'll start from the second child.
cursor = cursor && cursor.nextSibling ;
while ( cursor )
{
var next = cursor.nextSibling ;
// If we have two <BR>s, and they're not at the beginning or the end,
// then we'll split up the contents following them into another block.
// Stop processing if we are at the last child couple.
if ( next && next.nextSibling && cursor.nodeName.IEquals( 'br' ) && next.nodeName.IEquals( 'br' ) )
{
// Remove the first <br>.
FCKDomTools.RemoveNode( cursor ) ;
// Move to the node after the second <br>.
cursor = next.nextSibling ;
// Remove the second <br>.
FCKDomTools.RemoveNode( next ) ;
// Create the block that will hold the child nodes from now on.
lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || newBlock, FCKDomTools.CloneElement( newBlock ) ) ;
continue ;
}
// If we split it, then start moving the nodes to the new block.
if ( lastNewBlock )
{
cursor = cursor.previousSibling ;
FCKDomTools.MoveNode(cursor.nextSibling, lastNewBlock ) ;
}
cursor = cursor.nextSibling ;
}
},
/** /**
* Apply an inline style to a FCKDomRange. * Apply an inline style to a FCKDomRange.
* *
@ -856,76 +948,41 @@ FCKStyle.prototype =
var block ; var block ;
var doc = range.Window.document ; var doc = range.Window.document ;
var previousPreBlock ;
var preBlocks = [] ;
var convertedPreBlocks = [] ;
while( ( block = iterator.GetNextParagraph() ) ) // Only one = while( ( block = iterator.GetNextParagraph() ) ) // Only one =
{ {
// Create the new node right before the current one. // Create the new node right before the current one.
var newBlock = this.BuildElement( doc ) ; var newBlock = this.BuildElement( doc ) ;
// Move everything from the current node to the new one. // Check if we are changing from/to <pre>.
var newBlockIsPre = newBlock.nodeName.IEquals( 'pre' ) ; var newBlockIsPre = newBlock.nodeName.IEquals( 'pre' ) ;
var blockIsPre = block.nodeName.IEquals( 'pre' ) ; var blockIsPre = block.nodeName.IEquals( 'pre' ) ;
if ( newBlockIsPre && !blockIsPre )
{ var toPre = newBlockIsPre && !blockIsPre ;
var fromPre = !newBlockIsPre && blockIsPre ;
// Move everything from the current node to the new one.
if ( toPre )
newBlock = this._ToPre( doc, block, newBlock ) ; newBlock = this._ToPre( doc, block, newBlock ) ;
preBlocks.push( newBlock ) ; else if ( fromPre )
}
else if ( !newBlockIsPre && blockIsPre )
{
newBlock = this._FromPre( doc, block, newBlock ) ; newBlock = this._FromPre( doc, block, newBlock ) ;
convertedPreBlocks.push( newBlock ) ;
}
else // Convering from a regular block to another regular block. else // Convering from a regular block to another regular block.
FCKDomTools.MoveChildren( block, newBlock ) ; FCKDomTools.MoveChildren( block, newBlock ) ;
// Replace the current block. // Replace the current block.
block.parentNode.insertBefore( newBlock, block ) ; block.parentNode.insertBefore( newBlock, block ) ;
FCKDomTools.RemoveNode( block ) ; FCKDomTools.RemoveNode( block ) ;
}
// Merge adjacent <PRE> blocks for #1229. // Complete other tasks after inserting the node in the DOM.
for ( var i = 0 ; i < preBlocks.length - 1 ; i++ ) if ( newBlockIsPre )
{ {
// Check if the next block in HTML equals the next <PRE> block generated. if ( previousPreBlock )
if ( FCKDomTools.GetNextSourceElement( preBlocks[i], true, [], [], true ) != preBlocks[i+1] ) this._CheckAndMergePre( previousPreBlock, newBlock ) ; // Merge successive <pre> blocks.
continue ; previousPreBlock = newBlock ;
// Merge the upper <PRE> block's content into the lower <PRE> block.
// Remove the upper <PRE> block.
preBlocks[i+1].innerHTML = preBlocks[i].innerHTML + '\n\n' + preBlocks[i+1].innerHTML ;
FCKDomTools.RemoveNode( preBlocks[i] ) ;
}
// Split converted <PRE> blocks for #1229.
for ( var i = 0 ; i < convertedPreBlocks.length ; i++ )
{
var currentBlock = convertedPreBlocks[i] ;
var lastNewBlock = null ;
for ( var j = 0 ; j < currentBlock.childNodes.length ; j++ )
{
var cursor = currentBlock.childNodes[j] ;
// If we have two <BR>s, and they're not at the beginning or the end,
// then we'll split up the contents following them into another block.
if ( cursor.nodeName.IEquals( 'br' ) && j != 0 && j != currentBlock.childNodes.length - 2
&& cursor.nextSibling && cursor.nextSibling.nodeName.IEquals( 'br' ) )
{
FCKDomTools.RemoveNode( cursor.nextSibling ) ;
FCKDomTools.RemoveNode( cursor ) ;
j-- ; // restart at current index at next iteration
lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || currentBlock, doc.createElement( currentBlock.nodeName ) ) ;
continue ;
}
if ( lastNewBlock )
{
FCKDomTools.MoveNode( cursor, lastNewBlock ) ;
j-- ; // restart at current index at next iteration
}
} }
else if ( fromPre )
this._CheckAndSplitPre( newBlock ) ; // Split <br><br> in successive <pre>s.
} }
// Re-select the original range. // Re-select the original range.

View File

@ -32,10 +32,14 @@ FCKXml.prototype =
oXmlHttp.open( 'GET', urlToCall, false ) ; oXmlHttp.open( 'GET', urlToCall, false ) ;
oXmlHttp.send( null ) ; oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
oXml = oXmlHttp.responseXML ; {
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
oXml = oXmlHttp.responseXML ; oXml = oXmlHttp.responseXML ;
// #1426: Fallback if responseXML isn't set for some
// reason (e.g. improperly configured web server)
if ( !oXml )
oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
}
else else
oXml = null ; oXml = null ;

View File

@ -40,15 +40,20 @@ FCKXml.prototype =
oXmlHttp.send( null ) ; oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
{
this.DOMDocument = oXmlHttp.responseXML ; this.DOMDocument = oXmlHttp.responseXML ;
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
// #1426: Fallback if responseXML isn't set for some
// reason (e.g. improperly configured web server)
if ( !this.DOMDocument || this.DOMDocument.firstChild == null )
{ {
this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ; this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
this.DOMDocument.async = false ; this.DOMDocument.async = false ;
this.DOMDocument.resolveExternals = false ; this.DOMDocument.resolveExternals = false ;
this.DOMDocument.loadXML( oXmlHttp.responseText ) ; this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
} }
}
else else
{ {
this.DOMDocument = null ; this.DOMDocument = null ;

View File

@ -311,6 +311,65 @@ FCKUnlinkCommand.prototype.GetState = function()
return state ; return state ;
} }
FCKVisitLinkCommand = function()
{
this.Name = 'VisitLink';
}
FCKVisitLinkCommand.prototype =
{
GetState : function()
{
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
return FCK_TRISTATE_DISABLED ;
var state = FCK.GetNamedCommandState( 'Unlink' ) ;
if ( state == FCK_TRISTATE_OFF )
{
var el = FCKSelection.MoveToAncestorNode( 'A' ) ;
if ( !el.href )
state = FCK_TRISTATE_DISABLED ;
}
return state ;
},
Execute : function()
{
var el = FCKSelection.MoveToAncestorNode( 'A' ) ;
var url = el.getAttribute( '_fcksavedurl' ) || el.getAttribute( 'href', 2 ) ;
// Check if it's a full URL.
// If not full URL, we'll need to apply the BaseHref setting.
if ( ! /:\/\//.test( url ) )
{
var baseHref = FCKConfig.BaseHref ;
var parentWindow = FCK.GetInstanceObject( 'parent' ) ;
if ( !baseHref )
{
baseHref = parentWindow.document.location.href ;
baseHref = baseHref.substring( 0, baseHref.lastIndexOf( '/' ) + 1 ) ;
}
if ( /^\//.test( url ) )
{
try
{
baseHref = baseHref.match( /^.*:\/\/+[^\/]+/ )[0] ;
}
catch ( e )
{
baseHref = parentWindow.document.location.protocol + '://' + parentWindow.parent.document.location.host ;
}
}
url = baseHref + url ;
}
if ( !window.open( url, '_blank' ) )
alert( FCKLang.VisitLinkBlocked ) ;
}
} ;
// FCKSelectAllCommand // FCKSelectAllCommand
var FCKSelectAllCommand = function() var FCKSelectAllCommand = function()
{ {
@ -516,3 +575,60 @@ FCKAnchorDeleteCommand.prototype =
return FCK.GetNamedCommandState( 'Unlink') ; return FCK.GetNamedCommandState( 'Unlink') ;
} }
}; };
var FCKDeleteDivCommand = function()
{
}
FCKDeleteDivCommand.prototype =
{
GetState : function()
{
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
return FCK_TRISTATE_DISABLED ;
var node = FCKSelection.GetParentElement() ;
var path = new FCKElementPath( node ) ;
return path.BlockLimit && path.BlockLimit.nodeName.IEquals( 'div' ) ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
},
Execute : function()
{
// Create an undo snapshot before doing anything.
FCKUndo.SaveUndoStep() ;
// Find out the nodes to delete.
var nodes = FCKDomTools.GetSelectedDivContainers() ;
// Remember the current selection position.
var range = new FCKDomRange( FCK.EditorWindow ) ;
range.MoveToSelection() ;
var bookmark = range.CreateBookmark() ;
// Delete the container DIV node.
for ( var i = 0 ; i < nodes.length ; i++)
FCKDomTools.RemoveNode( nodes[i], true ) ;
// Restore selection.
range.MoveToBookmark( bookmark ) ;
range.Select() ;
}
} ;
// FCKRuleCommand
var FCKNbsp = function()
{
this.Name = 'Non Breaking Space' ;
}
FCKNbsp.prototype =
{
Execute : function()
{
FCK.InsertHtml( '&nbsp;' ) ;
},
GetState : function()
{
return ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_DISABLED : FCK_TRISTATE_OFF ) ;
}
} ;

View File

@ -37,6 +37,11 @@ FCKFitWindow.prototype.Execute = function()
var eBodyStyle = eBody.style ; var eBodyStyle = eBody.style ;
var eParent ; var eParent ;
// Save the current selection and scroll position.
var oRange = new FCKDomRange( FCK.EditorWindow ) ;
oRange.MoveToSelection() ;
var oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ;
// No original style properties known? Go fullscreen. // No original style properties known? Go fullscreen.
if ( !this.IsMaximized ) if ( !this.IsMaximized )
{ {
@ -83,6 +88,7 @@ FCKFitWindow.prototype.Execute = function()
var oViewPaneSize = FCKTools.GetViewPaneSize( eMainWindow ) ; var oViewPaneSize = FCKTools.GetViewPaneSize( eMainWindow ) ;
eEditorFrameStyle.position = "absolute"; eEditorFrameStyle.position = "absolute";
eEditorFrame.offsetLeft ; // Kludge for Safari 3.1 browser bug, do not remove. See #2066.
eEditorFrameStyle.zIndex = FCKConfig.FloatingPanelsZIndex - 1; eEditorFrameStyle.zIndex = FCKConfig.FloatingPanelsZIndex - 1;
eEditorFrameStyle.left = "0px"; eEditorFrameStyle.left = "0px";
eEditorFrameStyle.top = "0px"; eEditorFrameStyle.top = "0px";
@ -159,6 +165,10 @@ FCKFitWindow.prototype.Execute = function()
FCK.EditingArea.MakeEditable() ; FCK.EditingArea.MakeEditable() ;
FCK.Focus() ; FCK.Focus() ;
// Restore the selection and scroll position of inside the document.
oRange.Select() ;
FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ;
} }
FCKFitWindow.prototype.GetState = function() FCKFitWindow.prototype.GetState = function()

View File

@ -44,6 +44,23 @@ FCKShowBlockCommand.prototype.Execute = function()
else else
body.className += ' FCK__ShowBlocks' ; body.className += ' FCK__ShowBlocks' ;
if ( FCKBrowserInfo.IsIE )
{
try
{
FCK.EditorDocument.selection.createRange().select() ;
}
catch ( e )
{}
}
else
{
var focus = FCK.EditorWindow.getSelection().focusNode ;
if ( focus.nodeType != 1 )
focus = focus.parentNode ;
FCKDomTools.ScrollIntoView( focus, false ) ;
}
FCK.Events.FireEvent( 'OnSelectionChange' ) ; FCK.Events.FireEvent( 'OnSelectionChange' ) ;
} }

View File

@ -40,8 +40,8 @@ function InitializeAPI()
// objects that aren't really FCKeditor instances. // objects that aren't really FCKeditor instances.
var sScript = var sScript =
'window.FCKeditorAPI = {' + 'window.FCKeditorAPI = {' +
'Version : "2.6",' + 'Version : "2.6.3",' +
'VersionBuild : "18638",' + 'VersionBuild : "19836",' +
'Instances : new Object(),' + 'Instances : new Object(),' +
'GetInstance : function( name )' + 'GetInstance : function( name )' +
@ -115,7 +115,7 @@ function InitializeAPI()
{ {
FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ;
} }
else if ( FCKBrowserInfo.IsSafari || FCKBrowserInfo.IsGecko19 ) else if ( FCKBrowserInfo.IsSafari )
{ {
// oParentWindow.eval in Safari and Gran Paradiso executes in the calling window // oParentWindow.eval in Safari and Gran Paradiso executes in the calling window
// environment, instead of the parent one. The following should make it work. // environment, instead of the parent one. The following should make it work.
@ -164,12 +164,14 @@ function _AttachFormSubmitToAPI()
function FCKeditorAPI_Cleanup() function FCKeditorAPI_Cleanup()
{ {
if ( ! window.FCKUnloadFlag ) if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat
&& !window.FCKUnloadFlag )
return ; return ;
delete FCKeditorAPI.Instances[ FCK.Name ] ; delete FCKeditorAPI.Instances[ FCK.Name ] ;
} }
function FCKeditorAPI_ConfirmCleanup() function FCKeditorAPI_ConfirmCleanup()
{ {
if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat )
window.FCKUnloadFlag = true ; window.FCKUnloadFlag = true ;
} }
FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ;

View File

@ -198,6 +198,13 @@ var FCK =
// Ignore space only or empty text. // Ignore space only or empty text.
if ( oNewBlock || oNode.nodeValue.Trim().length > 0 ) if ( oNewBlock || oNode.nodeValue.Trim().length > 0 )
bMoveNode = true ; bMoveNode = true ;
break;
// Comment Node
case 8 :
if ( oNewBlock )
bMoveNode = true ;
break;
} }
if ( bMoveNode ) if ( bMoveNode )
@ -402,6 +409,8 @@ var FCK =
FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ; FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ;
} }
FCKTempBin.Reset();
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{ {
// Save the resetIsDirty for later use (async) // Save the resetIsDirty for later use (async)
@ -622,7 +631,8 @@ var FCK =
var sHtml ; var sHtml ;
// Update the HTML in the view output to show. // Update the HTML in the view output to show, also update
// FCKTempBin for IE to avoid #2263.
if ( bIsWysiwyg ) if ( bIsWysiwyg )
{ {
FCKCommands.GetCommand( 'ShowBlocks' ).SaveState() ; FCKCommands.GetCommand( 'ShowBlocks' ).SaveState() ;
@ -631,6 +641,9 @@ var FCK =
sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ; sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ;
if ( FCKBrowserInfo.IsIE )
FCKTempBin.ToHtml() ;
if ( sHtml == null ) if ( sHtml == null )
return false ; return false ;
} }
@ -664,9 +677,22 @@ var FCK =
// object that may internally supply this feature. // object that may internally supply this feature.
var range = new FCKDomRange( this.EditorWindow ) ; var range = new FCKDomRange( this.EditorWindow ) ;
// Move to the selection and delete it.
range.MoveToSelection() ;
range.DeleteContents() ;
if ( FCKListsLib.BlockElements[ elementName ] != null ) if ( FCKListsLib.BlockElements[ elementName ] != null )
{ {
if ( range.StartBlock )
{
if ( range.CheckStartOfBlock() )
range.MoveToPosition( range.StartBlock, 3 ) ;
else if ( range.CheckEndOfBlock() )
range.MoveToPosition( range.StartBlock, 4 ) ;
else
range.SplitBlock() ; range.SplitBlock() ;
}
range.InsertNode( element ) ; range.InsertNode( element ) ;
var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ; var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ;
@ -687,18 +713,16 @@ var FCK =
else else
range.MoveToPosition( element, 4 ) ; range.MoveToPosition( element, 4 ) ;
if ( FCKBrowserInfo.IsGecko ) if ( FCKBrowserInfo.IsGeckoLike )
{ {
if ( next ) if ( next )
next.scrollIntoView( false ) ; FCKDomTools.ScrollIntoView( next, false );
element.scrollIntoView( false ) ; FCKDomTools.ScrollIntoView( element, false );
} }
} }
else else
{ {
// Delete the current selection and insert the node. // Insert the node.
range.MoveToSelection() ;
range.DeleteContents() ;
range.InsertNode( element ) ; range.InsertNode( element ) ;
// Move the selection right after the new element. // Move the selection right after the new element.
@ -887,6 +911,14 @@ function _FCK_PaddingNodeListener()
if ( FCK.EditorDocument.body.childNodes.length == 1 if ( FCK.EditorDocument.body.childNodes.length == 1
&& FCK.EditorDocument.body.firstChild == paddingNode ) && FCK.EditorDocument.body.firstChild == paddingNode )
{ {
/*
* Bug #1764: Don't move the selection if the
* current selection isn't in the editor
* document.
*/
if ( FCKSelection._GetSelectionDocument( FCK.EditorDocument.selection ) != FCK.EditorDocument )
return ;
var range = FCK.EditorDocument.body.createTextRange() ; var range = FCK.EditorDocument.body.createTextRange() ;
var clearContents = false ; var clearContents = false ;
if ( !paddingNode.childNodes.firstChild ) if ( !paddingNode.childNodes.firstChild )
@ -909,6 +941,9 @@ function _FCK_EditingArea_OnLoad()
FCK.EditorWindow = FCK.EditingArea.Window ; FCK.EditorWindow = FCK.EditingArea.Window ;
FCK.EditorDocument = FCK.EditingArea.Document ; FCK.EditorDocument = FCK.EditingArea.Document ;
if ( FCKBrowserInfo.IsIE )
FCKTempBin.ToElements() ;
FCK.InitializeBehaviors() ; FCK.InitializeBehaviors() ;
// Listen for mousedown and mouseup events for tracking drag and drops. // Listen for mousedown and mouseup events for tracking drag and drops.
@ -1061,6 +1096,28 @@ var FCKTempBin =
while ( i < this.Elements.length ) while ( i < this.Elements.length )
this.Elements[ i++ ] = null ; this.Elements[ i++ ] = null ;
this.Elements.length = 0 ; this.Elements.length = 0 ;
},
ToHtml : function()
{
for ( var i = 0 ; i < this.Elements.length ; i++ )
{
this.Elements[i] = '<div>&nbsp;' + this.Elements[i].outerHTML + '</div>' ;
this.Elements[i].isHtml = true ;
}
},
ToElements : function()
{
var node = FCK.EditorDocument.createElement( 'div' ) ;
for ( var i = 0 ; i < this.Elements.length ; i++ )
{
if ( this.Elements[i].isHtml )
{
node.innerHTML = this.Elements[i] ;
this.Elements[i] = node.firstChild.removeChild( node.firstChild.lastChild ) ;
}
}
} }
} ; } ;
@ -1173,3 +1230,23 @@ function FCKFocusManager_Win_OnFocus()
FCK.Events.FireEvent( "OnFocus" ) ; FCK.Events.FireEvent( "OnFocus" ) ;
} }
} }
/*
* #1633 : Protect the editor iframe from external styles.
* Notice that we can't use FCKTools.ResetStyles here since FCKTools isn't
* loaded yet.
*/
(function()
{
var el = window.frameElement ;
var width = el.width ;
var height = el.height ;
if ( /^\d+$/.test( width ) ) width += 'px' ;
if ( /^\d+$/.test( height ) ) height += 'px' ;
var style = el.style ;
style.border = style.padding = style.margin = 0 ;
style.backgroundColor = 'transparent';
style.backgroundImage = 'none';
style.width = width ;
style.height = height ;
})() ;

View File

@ -127,6 +127,8 @@ function FCK_ContextMenu_GetListener( listenerName )
if ( bIsAnchor ) if ( bIsAnchor )
return ; return ;
menu.AddSeparator() ;
menu.AddItem( 'VisitLink', FCKLang.VisitLink ) ;
menu.AddSeparator() ; menu.AddSeparator() ;
if ( bInsideLink ) if ( bInsideLink )
menu.AddItem( 'Link', FCKLang.EditLink , 34 ) ; menu.AddItem( 'Link', FCKLang.EditLink , 34 ) ;
@ -292,6 +294,21 @@ function FCK_ContextMenu_GetListener( listenerName )
menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ; menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ;
} }
}} ; }} ;
case 'DivContainer':
return {
AddItems : function( menu, tag, tagName )
{
var currentBlocks = FCKDomTools.GetSelectedDivContainers() ;
if ( currentBlocks.length > 0 )
{
menu.AddSeparator() ;
menu.AddItem( 'EditDiv', FCKLang.EditDiv, 75 ) ;
menu.AddItem( 'DeleteDiv', FCKLang.DeleteDiv, 76 ) ;
}
}} ;
} }
return null ; return null ;
} }

View File

@ -104,7 +104,7 @@ FCK.InitializeBehaviors = function()
// only perform the patched behavior if we're in an <a> tag, or the End key is pressed. // only perform the patched behavior if we're in an <a> tag, or the End key is pressed.
var parentTag = node.parentNode.tagName.toLowerCase() ; var parentTag = node.parentNode.tagName.toLowerCase() ;
if ( ! ( parentTag == 'a' || String(node.parentNode.contentEditable) == 'false' || if ( ! ( parentTag == 'a' || ( !FCKBrowserInfo.IsOpera && String(node.parentNode.contentEditable) == 'false' ) ||
( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] ) ( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] )
&& keyCode == 35 ) ) ) && keyCode == 35 ) ) )
return ; return ;
@ -349,6 +349,9 @@ FCK._ExecPaste = function()
// selected content if any. // selected content if any.
FCK.InsertHtml = function( html ) FCK.InsertHtml = function( html )
{ {
var doc = FCK.EditorDocument,
range;
html = FCKConfig.ProtectedSource.Protect( html ) ; html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectEvents( html ) ; html = FCK.ProtectEvents( html ) ;
html = FCK.ProtectUrls( html ) ; html = FCK.ProtectUrls( html ) ;
@ -357,11 +360,45 @@ FCK.InsertHtml = function( html )
// Save an undo snapshot first. // Save an undo snapshot first.
FCKUndo.SaveUndoStep() ; FCKUndo.SaveUndoStep() ;
// Insert the HTML code. if ( FCKBrowserInfo.IsGecko )
this.EditorDocument.execCommand( 'inserthtml', false, html ) ; {
html = html.replace( /&nbsp;$/, '$&<span _fcktemp="1"/>' ) ;
var docFrag = new FCKDocumentFragment( this.EditorDocument ) ;
docFrag.AppendHtml( html ) ;
var lastNode = docFrag.RootNode.lastChild ;
range = new FCKDomRange( this.EditorWindow ) ;
range.MoveToSelection() ;
range.DeleteContents() ;
range.InsertNode( docFrag.RootNode ) ;
range.MoveToPosition( lastNode, 4 ) ;
}
else
doc.execCommand( 'inserthtml', false, html ) ;
this.Focus() ; this.Focus() ;
FCKDocumentProcessor.Process( FCK.EditorDocument ) ; // Save the caret position before calling document processor.
if ( !range )
{
range = new FCKDomRange( this.EditorWindow ) ;
range.MoveToSelection() ;
}
var bookmark = range.CreateBookmark() ;
FCKDocumentProcessor.Process( doc ) ;
// Restore caret position, ignore any errors in case the document
// processor removed the bookmark <span>s for some reason.
try
{
range.MoveToBookmark( bookmark ) ;
range.Select() ;
}
catch ( e ) {}
// For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call. // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
this.Events.FireEvent( "OnSelectionChange" ) ; this.Events.FireEvent( "OnSelectionChange" ) ;
@ -401,6 +438,12 @@ FCK.CreateLink = function( url, noUndo )
// Creates the array that will be returned. It contains one or more created links (see #220). // Creates the array that will be returned. It contains one or more created links (see #220).
var aCreatedLinks = new Array() ; var aCreatedLinks = new Array() ;
// Only for Safari, a collapsed selection may create a link. All other
// browser will have no links created. So, we check it here and return
// immediatelly, having the same cross browser behavior.
if ( FCKSelection.GetSelection().isCollapsed )
return aCreatedLinks ;
FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
if ( url.length > 0 ) if ( url.length > 0 )
@ -420,12 +463,6 @@ FCK.CreateLink = function( url, noUndo )
var oLink = oLinksInteractor.snapshotItem( i ) ; var oLink = oLinksInteractor.snapshotItem( i ) ;
oLink.href = url ; oLink.href = url ;
// It may happen that the browser (aka Safari) decides to use the
// URL as the link content to not leave it empty. In this case,
// let's reset it.
if ( sTempUrl == oLink.innerHTML )
oLink.innerHTML = '' ;
aCreatedLinks.push( oLink ) ; aCreatedLinks.push( oLink ) ;
} }
} }

View File

@ -29,11 +29,11 @@ FCK._GetBehaviorsStyle = function()
{ {
if ( !FCK._BehaviorsStyle ) if ( !FCK._BehaviorsStyle )
{ {
var sBasePath = FCKConfig.FullBasePath ; var sBasePath = FCKConfig.BasePath ;
var sTableBehavior = '' ; var sTableBehavior = '' ;
var sStyle ; var sStyle ;
// The behaviors should be pointed using the FullBasePath to avoid security // The behaviors should be pointed using the BasePath to avoid security
// errors when using a different BaseHref. // errors when using a different BaseHref.
sStyle = '<style type="text/css" _fcktemp="true">' ; sStyle = '<style type="text/css" _fcktemp="true">' ;
@ -136,6 +136,8 @@ FCK.InitializeBehaviors = function( dontReturn )
this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ; this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ;
this.EditorDocument.attachEvent("onbeforedeactivate", function(){ FCKSelection.Save( true ) ; } ) ;
// Catch cursor selection changes. // Catch cursor selection changes.
this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ; this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ;
@ -150,6 +152,7 @@ FCK.InsertHtml = function( html )
html = FCK.ProtectTags( html ) ; html = FCK.ProtectTags( html ) ;
// FCK.Focus() ; // FCK.Focus() ;
FCKSelection.Restore() ;
FCK.EditorWindow.focus() ; FCK.EditorWindow.focus() ;
FCKUndo.SaveUndoStep() ; FCKUndo.SaveUndoStep() ;

View File

@ -28,7 +28,6 @@ var FCKBrowserInfo =
IsIE : /*@cc_on!@*/false, IsIE : /*@cc_on!@*/false,
IsIE7 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 7 ), IsIE7 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 7 ),
IsIE6 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 6 ), IsIE6 : /*@cc_on!@*/false && ( parseInt( s.match( /msie (\d+)/ )[1], 10 ) >= 6 ),
IsGecko : s.Contains('gecko/'),
IsSafari : s.Contains(' applewebkit/'), // Read "IsWebKit" IsSafari : s.Contains(' applewebkit/'), // Read "IsWebKit"
IsOpera : !!window.opera, IsOpera : !!window.opera,
IsAIR : s.Contains(' adobeair/'), IsAIR : s.Contains(' adobeair/'),
@ -38,11 +37,13 @@ var FCKBrowserInfo =
// Completes the browser info with further Gecko information. // Completes the browser info with further Gecko information.
(function( browserInfo ) (function( browserInfo )
{ {
browserInfo.IsGecko = ( navigator.product == 'Gecko' ) && !browserInfo.IsSafari && !browserInfo.IsOpera ;
browserInfo.IsGeckoLike = ( browserInfo.IsGecko || browserInfo.IsSafari || browserInfo.IsOpera ) ; browserInfo.IsGeckoLike = ( browserInfo.IsGecko || browserInfo.IsSafari || browserInfo.IsOpera ) ;
if ( browserInfo.IsGecko ) if ( browserInfo.IsGecko )
{ {
var geckoVersion = s.match( /gecko\/(\d+)/ )[1] ; var geckoMatch = s.match( /rv:(\d+\.\d+)/ ) ;
var geckoVersion = geckoMatch && parseFloat( geckoMatch[1] ) ;
// Actually "10" refers to Gecko versions before Firefox 1.5, when // Actually "10" refers to Gecko versions before Firefox 1.5, when
// Gecko 1.8 (build 20051111) has been released. // Gecko 1.8 (build 20051111) has been released.
@ -51,11 +52,10 @@ var FCKBrowserInfo =
// than 20051111, so we must also check for the revision number not to // than 20051111, so we must also check for the revision number not to
// be 1.7 (we are assuming that rv < 1.7 will not have build > 20051111). // be 1.7 (we are assuming that rv < 1.7 will not have build > 20051111).
// TODO: Future versions may consider the rv number only, but it is if ( geckoVersion )
// still to check that all Gecko based browser present the rv number. {
browserInfo.IsGecko10 = ( ( geckoVersion < 20051111 ) || ( /rv:1\.7/.test(s) ) ) ; browserInfo.IsGecko10 = ( geckoVersion < 1.8 ) ;
browserInfo.IsGecko19 = /rv:1\.9/.test(s) ; browserInfo.IsGecko19 = ( geckoVersion > 1.8 ) ;
}
} }
else
browserInfo.IsGecko10 = false ;
})(FCKBrowserInfo) ; })(FCKBrowserInfo) ;

View File

@ -51,6 +51,7 @@ FCKCommands.GetCommand = function( commandName )
case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ; case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ;
case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 300 ) ; break ; case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 300 ) ; break ;
case 'Unlink' : oCommand = new FCKUnlinkCommand() ; break ; case 'Unlink' : oCommand = new FCKUnlinkCommand() ; break ;
case 'VisitLink' : oCommand = new FCKVisitLinkCommand() ; break ;
case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 160 ) ; break ; case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 160 ) ; break ;
case 'AnchorDelete' : oCommand = new FCKAnchorDeleteCommand() ; break ; case 'AnchorDelete' : oCommand = new FCKAnchorDeleteCommand() ; break ;
case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html?UL' , 370, 160 ) ; break ; case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html?UL' , 370, 160 ) ; break ;
@ -79,6 +80,7 @@ FCKCommands.GetCommand = function( commandName )
case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ; case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ;
case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ; case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ;
case 'Rule' : oCommand = new FCKRuleCommand() ; break ; case 'Rule' : oCommand = new FCKRuleCommand() ; break ;
case 'Nbsp' : oCommand = new FCKNbsp() ; break ;
case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ; case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ;
case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ; case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ;
@ -94,6 +96,9 @@ FCKCommands.GetCommand = function( commandName )
case 'Indent' : oCommand = new FCKIndentCommand( 'indent', FCKConfig.IndentLength ) ; break ; case 'Indent' : oCommand = new FCKIndentCommand( 'indent', FCKConfig.IndentLength ) ; break ;
case 'Outdent' : oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ; case 'Outdent' : oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ;
case 'Blockquote' : oCommand = new FCKBlockQuoteCommand() ; break ; case 'Blockquote' : oCommand = new FCKBlockQuoteCommand() ; break ;
case 'CreateDiv' : oCommand = new FCKDialogCommand( 'CreateDiv', FCKLang.CreateDiv, 'dialog/fck_div.html', 380, 210, null, null, true ) ; break ;
case 'EditDiv' : oCommand = new FCKDialogCommand( 'EditDiv', FCKLang.EditDiv, 'dialog/fck_div.html', 380, 210, null, null, false ) ; break ;
case 'DeleteDiv' : oCommand = new FCKDeleteDivCommand() ; break ;
case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ;
case 'TableInsertRowBefore' : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ; case 'TableInsertRowBefore' : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ;

View File

@ -42,13 +42,12 @@ if ( document.location.protocol == 'file:' )
sFullProtocol += 'localhost/' ; sFullProtocol += 'localhost/' ;
FCKConfig.BasePath = sFullProtocol + FCKConfig.BasePath.substring( 0, FCKConfig.BasePath.lastIndexOf( '/' ) + 1) ; FCKConfig.BasePath = sFullProtocol + FCKConfig.BasePath.substring( 0, FCKConfig.BasePath.lastIndexOf( '/' ) + 1) ;
FCKConfig.FullBasePath = FCKConfig.BasePath ;
} }
else else
{ FCKConfig.BasePath = document.location.protocol + '//' + document.location.host +
FCKConfig.BasePath = document.location.pathname.substring( 0, document.location.pathname.lastIndexOf( '/' ) + 1) ; document.location.pathname.substring( 0, document.location.pathname.lastIndexOf( '/' ) + 1) ;
FCKConfig.FullBasePath = document.location.protocol + '//' + document.location.host + FCKConfig.BasePath ;
} FCKConfig.FullBasePath = FCKConfig.BasePath ;
FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ; FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ;

View File

@ -21,17 +21,11 @@
* Debug window control and operations. * Debug window control and operations.
*/ */
var FCKDebug = new Object() ; // Public function defined here must be declared in fckdebug_empty.js.
FCKDebug._GetWindow = function() var FCKDebug =
{ {
if ( !this.DebugWindow || this.DebugWindow.closed ) Output : function( message, color, noParse )
this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
return this.DebugWindow ;
}
FCKDebug.Output = function( message, color, noParse )
{ {
if ( ! FCKConfig.Debug ) if ( ! FCKConfig.Debug )
return ; return ;
@ -41,9 +35,9 @@ FCKDebug.Output = function( message, color, noParse )
this._GetWindow().Output( message, color ) ; this._GetWindow().Output( message, color ) ;
} }
catch ( e ) {} // Ignore errors catch ( e ) {} // Ignore errors
} },
FCKDebug.OutputObject = function( anyObject, color ) OutputObject : function( anyObject, color )
{ {
if ( ! FCKConfig.Debug ) if ( ! FCKConfig.Debug )
return ; return ;
@ -53,4 +47,13 @@ FCKDebug.OutputObject = function( anyObject, color )
this._GetWindow().OutputObject( anyObject, color ) ; this._GetWindow().OutputObject( anyObject, color ) ;
} }
catch ( e ) {} // Ignore errors catch ( e ) {} // Ignore errors
},
_GetWindow : function()
{
if ( !this.DebugWindow || this.DebugWindow.closed )
this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
return this.DebugWindow ;
} }
} ;

View File

@ -75,15 +75,6 @@ var FCKDialog = ( function()
} ) ; } ) ;
} }
var resetStyles = function( element )
{
element.style.cssText = 'margin:0;' +
'padding:0;' +
'border:0;' +
'background-color:transparent;' +
'background-image:none;' ;
}
return { return {
/** /**
* Opens a dialog window using the standard dialog template. * Opens a dialog window using the standard dialog template.
@ -107,13 +98,16 @@ var FCKDialog = ( function()
// Calculate the dialog position, centering it on the screen. // Calculate the dialog position, centering it on the screen.
var viewSize = FCKTools.GetViewPaneSize( topWindow ) ; var viewSize = FCKTools.GetViewPaneSize( topWindow ) ;
var scrollPosition = FCKTools.GetScrollPosition( topWindow ) ; var scrollPosition = { 'X' : 0, 'Y' : 0 } ;
var useAbsolutePosition = FCKBrowserInfo.IsIE && ( !FCKBrowserInfo.IsIE7 || !FCKTools.IsStrictMode( topWindow.document ) ) ;
if ( useAbsolutePosition )
scrollPosition = FCKTools.GetScrollPosition( topWindow ) ;
var iTop = Math.max( scrollPosition.Y + ( viewSize.Height - height - 20 ) / 2, 0 ) ; var iTop = Math.max( scrollPosition.Y + ( viewSize.Height - height - 20 ) / 2, 0 ) ;
var iLeft = Math.max( scrollPosition.X + ( viewSize.Width - width - 20 ) / 2, 0 ) ; var iLeft = Math.max( scrollPosition.X + ( viewSize.Width - width - 20 ) / 2, 0 ) ;
// Setup the IFRAME that will hold the dialog. // Setup the IFRAME that will hold the dialog.
var dialog = topDocument.createElement( 'iframe' ) ; var dialog = topDocument.createElement( 'iframe' ) ;
resetStyles( dialog ) ; FCKTools.ResetStyles( dialog ) ;
dialog.src = FCKConfig.BasePath + 'fckdialog.html' ; dialog.src = FCKConfig.BasePath + 'fckdialog.html' ;
// Dummy URL for testing whether the code in fckdialog.js alone leaks memory. // Dummy URL for testing whether the code in fckdialog.js alone leaks memory.
@ -123,7 +117,7 @@ var FCKDialog = ( function()
dialog.allowTransparency = true ; dialog.allowTransparency = true ;
FCKDomTools.SetElementStyles( dialog, FCKDomTools.SetElementStyles( dialog,
{ {
'position' : 'absolute', 'position' : ( useAbsolutePosition ) ? 'absolute' : 'fixed',
'top' : iTop + 'px', 'top' : iTop + 'px',
'left' : iLeft + 'px', 'left' : iLeft + 'px',
'width' : width + 'px', 'width' : width + 'px',
@ -179,7 +173,7 @@ var FCKDialog = ( function()
{ {
// Setup the DIV that will be used to cover. // Setup the DIV that will be used to cover.
cover = topDocument.createElement( 'div' ) ; cover = topDocument.createElement( 'div' ) ;
resetStyles( cover ) ; FCKTools.ResetStyles( cover ) ;
FCKDomTools.SetElementStyles( cover, FCKDomTools.SetElementStyles( cover,
{ {
'position' : 'absolute', 'position' : 'absolute',
@ -195,7 +189,7 @@ var FCKDialog = ( function()
if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 ) if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
{ {
var iframe = topDocument.createElement( 'iframe' ) ; var iframe = topDocument.createElement( 'iframe' ) ;
resetStyles( iframe ) ; FCKTools.ResetStyles( iframe ) ;
iframe.hideFocus = true ; iframe.hideFocus = true ;
iframe.frameBorder = 0 ; iframe.frameBorder = 0 ;
iframe.src = FCKTools.GetVoidUrl() ; iframe.src = FCKTools.GetVoidUrl() ;
@ -218,12 +212,23 @@ var FCKDialog = ( function()
topDocument.body.appendChild( cover ) ; topDocument.body.appendChild( cover ) ;
FCKFocusManager.Lock() ; FCKFocusManager.Lock() ;
// Prevent the user from refocusing the disabled
// editing window by pressing Tab. (Bug #2065)
var el = FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'frameElement' ) ;
el._fck_originalTabIndex = el.tabIndex ;
el.tabIndex = -1 ;
}, },
HideMainCover : function() HideMainCover : function()
{ {
FCKDomTools.RemoveNode( cover ) ; FCKDomTools.RemoveNode( cover ) ;
FCKFocusManager.Unlock() ; FCKFocusManager.Unlock() ;
// Revert the tab index hack. (Bug #2065)
var el = FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'frameElement' ) ;
el.tabIndex = el._fck_originalTabIndex ;
FCKDomTools.ClearElementJSProperty( el, '_fck_originalTabIndex' ) ;
}, },
GetCover : function() GetCover : function()

View File

@ -45,7 +45,7 @@ var FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
{ {
var oImg = FCKTools.GetElementDocument( realElement ).createElement( 'IMG' ) ; var oImg = FCKTools.GetElementDocument( realElement ).createElement( 'IMG' ) ;
oImg.className = fakeClass ; oImg.className = fakeClass ;
oImg.src = FCKConfig.FullBasePath + 'images/spacer.gif' ; oImg.src = FCKConfig.BasePath + 'images/spacer.gif' ;
oImg.setAttribute( '_fckfakelement', 'true', 0 ) ; oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ; oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
return oImg ; return oImg ;
@ -142,24 +142,29 @@ FCKEmbedAndObjectProcessor = (function()
el.parentNode.replaceChild( replaceElement, el ) ; el.parentNode.replaceChild( replaceElement, el ) ;
} }
var processElementsByName = function( elementName, doc )
{
var aObjects = doc.getElementsByTagName( elementName );
for ( var i = aObjects.length - 1 ; i >= 0 ; i-- )
processElement( aObjects[i] ) ;
}
var processObjectAndEmbed = function( doc )
{
processElementsByName( 'object', doc );
processElementsByName( 'embed', doc );
}
return FCKTools.Merge( FCKDocumentProcessor.AppendNew(), return FCKTools.Merge( FCKDocumentProcessor.AppendNew(),
{ {
ProcessDocument : function( doc ) ProcessDocument : function( doc )
{ {
// Firefox 3 would sometimes throw an unknown exception while accessing EMBEDs and OBJECTs // Firefox 3 would sometimes throw an unknown exception while accessing EMBEDs and OBJECTs
// without the setTimeout(). // without the setTimeout().
FCKTools.RunFunction( function() if ( FCKBrowserInfo.IsGecko )
{ FCKTools.RunFunction( processObjectAndEmbed, this, [ doc ] ) ;
// Process OBJECTs first, since EMBEDs can sometimes go inside OBJECTS (e.g. Flash). else
var aObjects = doc.getElementsByTagName( 'object' ); processObjectAndEmbed( doc ) ;
for ( var i = aObjects.length - 1 ; i >= 0 ; i-- )
processElement( aObjects[i] ) ;
// Now process any EMBEDs left.
var aEmbeds = doc.getElementsByTagName( 'embed' ) ;
for ( var i = aEmbeds.length - 1 ; i >= 0 ; i-- )
processElement( aEmbeds[i] ) ;
} ) ;
}, },
RefreshView : function( placeHolder, original ) RefreshView : function( placeHolder, original )
@ -247,3 +252,19 @@ FCKEmbedAndObjectProcessor.AddCustomHandler( function( el, fakeImg )
fakeImg.className = 'FCK__Flash' ; fakeImg.className = 'FCK__Flash' ;
fakeImg.setAttribute( '_fckflash', 'true', 0 ); fakeImg.setAttribute( '_fckflash', 'true', 0 );
} ) ; } ) ;
// Buggy <span class="Apple-style-span"> tags added by Safari.
if ( FCKBrowserInfo.IsSafari )
{
FCKDocumentProcessor.AppendNew().ProcessDocument = function( doc )
{
var spans = doc.getElementsByClassName ?
doc.getElementsByClassName( 'Apple-style-span' ) :
Array.prototype.filter.call(
doc.getElementsByTagName( 'span' ),
function( item ){ return item.className == 'Apple-style-span' ; }
) ;
for ( var i = spans.length - 1 ; i >= 0 ; i-- )
FCKDomTools.RemoveNode( spans[i], true ) ;
}
}

View File

@ -696,7 +696,7 @@ var FCKDomTools =
SetElementMarker : function ( markerObj, element, attrName, value) SetElementMarker : function ( markerObj, element, attrName, value)
{ {
var id = String( parseInt( Math.random() * 0xfffffff, 10 ) ) ; var id = String( parseInt( Math.random() * 0xffffffff, 10 ) ) ;
element._FCKMarkerId = id ; element._FCKMarkerId = id ;
element[attrName] = value ; element[attrName] = value ;
if ( ! markerObj[id] ) if ( ! markerObj[id] )
@ -972,8 +972,9 @@ var FCKDomTools =
}, },
/** /**
* Current implementation for ScrollIntoView (due to #1462). We don't have * Current implementation for ScrollIntoView (due to #1462 and #2279). We
* a complete implementation here, just the things that fit our needs. * don't have a complete implementation here, just the things that fit our
* needs.
*/ */
ScrollIntoView : function( element, alignTop ) ScrollIntoView : function( element, alignTop )
{ {
@ -988,22 +989,21 @@ var FCKDomTools =
// Appends the height it we are about to align the bottoms. // Appends the height it we are about to align the bottoms.
if ( alignTop === false ) if ( alignTop === false )
{ {
offset += element.offsetHeight ; offset += element.offsetHeight || 0 ;
// Consider the margin in the scroll, which is ok for our current // Consider the margin in the scroll, which is ok for our current
// needs, but needs investigation if we will be using this function // needs, but needs investigation if we will be using this function
// in other places. // in other places.
offset += parseInt( this.GetCurrentElementStyle( element, 'marginBottom' ) || 0, 10 ) ; offset += parseInt( this.GetCurrentElementStyle( element, 'marginBottom' ) || 0, 10 ) || 0 ;
} }
// Appends the offsets for the entire element hierarchy. // Appends the offsets for the entire element hierarchy.
offset += element.offsetTop ; var elementPosition = FCKTools.GetDocumentPosition( window, element ) ;
while ( ( element = element.offsetParent ) ) offset += elementPosition.y ;
offset += element.offsetTop || 0 ;
// Scroll the window to the desired position, if not already visible. // Scroll the window to the desired position, if not already visible.
var currentScroll = FCKTools.GetScrollPosition( window ).Y ; var currentScroll = FCKTools.GetScrollPosition( window ).Y ;
if ( offset > 0 && offset > currentScroll ) if ( offset > 0 && ( offset > currentScroll || offset < currentScroll - windowHeight ) )
window.scrollTo( 0, offset ) ; window.scrollTo( 0, offset ) ;
}, },
@ -1020,5 +1020,38 @@ var FCKDomTools =
// In the DTD # == text node. // In the DTD # == text node.
return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ; return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ;
},
GetSelectedDivContainers : function()
{
var currentBlocks = [] ;
var range = new FCKDomRange( FCK.EditorWindow ) ;
range.MoveToSelection() ;
var startNode = range.GetTouchedStartNode() ;
var endNode = range.GetTouchedEndNode() ;
var currentNode = startNode ;
if ( startNode == endNode )
{
while ( endNode.nodeType == 1 && endNode.lastChild )
endNode = endNode.lastChild ;
endNode = FCKDomTools.GetNextSourceNode( endNode ) ;
}
while ( currentNode && currentNode != endNode )
{
if ( currentNode.nodeType != 3 || !/^[ \t\n]*$/.test( currentNode.nodeValue ) )
{
var path = new FCKElementPath( currentNode ) ;
var blockLimit = path.BlockLimit ;
if ( blockLimit && blockLimit.nodeName.IEquals( 'div' ) && currentBlocks.IndexOf( blockLimit ) == -1 )
currentBlocks.push( blockLimit ) ;
}
currentNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
}
return currentBlocks ;
} }
} ; } ;

View File

@ -50,6 +50,7 @@ var FCKLanguageManager = FCK.Language =
fr : 'French', fr : 'French',
'fr-ca' : 'French (Canada)', 'fr-ca' : 'French (Canada)',
gl : 'Galician', gl : 'Galician',
gu : 'Gujarati',
he : 'Hebrew', he : 'Hebrew',
hi : 'Hindi', hi : 'Hindi',
hr : 'Croatian', hr : 'Croatian',

View File

@ -78,6 +78,7 @@ ProtectUrlsArea : /<area(?=\s).*?\shref=((?:(?:\s*)("|').*?\2)|(?:[^"'][^ >]+))/
Html4DocType : /HTML 4\.0 Transitional/i , Html4DocType : /HTML 4\.0 Transitional/i ,
DocTypeTag : /<!DOCTYPE[^>]*>/i , DocTypeTag : /<!DOCTYPE[^>]*>/i ,
HtmlDocType : /DTD HTML/ ,
// These regex are used to save the original event attributes in the HTML. // These regex are used to save the original event attributes in the HTML.
TagsWithEvent : /<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g , TagsWithEvent : /<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g ,

View File

@ -75,9 +75,17 @@ FCKSelection.GetParentElement = function()
var oSel = this.GetSelection() ; var oSel = this.GetSelection() ;
if ( oSel ) if ( oSel )
{ {
// make the common case fast - for collapsed/nearly collapsed selections just return anchor.parent. // if anchorNode == focusNode, see if the selection is text only or including nodes.
// if text only, return the parent node.
// if the selection includes DOM nodes, then the anchorNode is the nearest container.
if ( oSel.anchorNode && oSel.anchorNode == oSel.focusNode ) if ( oSel.anchorNode && oSel.anchorNode == oSel.focusNode )
{
var oRange = oSel.getRangeAt( 0 ) ;
if ( oRange.collapsed || oRange.startContainer.nodeType == 3 )
return oSel.anchorNode.parentNode ; return oSel.anchorNode.parentNode ;
else
return oSel.anchorNode ;
}
// looks like we're having a large selection here. To make the behavior same as IE's TextRange.parentElement(), // looks like we're having a large selection here. To make the behavior same as IE's TextRange.parentElement(),
// we need to find the nearest ancestor node which encapsulates both the beginning and the end of the selection. // we need to find the nearest ancestor node which encapsulates both the beginning and the end of the selection.
@ -162,7 +170,7 @@ FCKSelection.HasAncestorNode = function( nodeTagName )
while ( oContainer ) while ( oContainer )
{ {
if ( oContainer.nodeType == 1 && oContainer.tagName == nodeTagName ) return true ; if ( oContainer.nodeType == 1 && oContainer.nodeName.IEquals( nodeTagName ) ) return true ;
oContainer = oContainer.parentNode ; oContainer = oContainer.parentNode ;
} }
@ -180,7 +188,7 @@ FCKSelection.MoveToAncestorNode = function( nodeTagName )
while ( oContainer ) while ( oContainer )
{ {
if ( oContainer.nodeName == nodeTagName ) if ( oContainer.nodeName.IEquals( nodeTagName ) )
return oContainer ; return oContainer ;
oContainer = oContainer.parentNode ; oContainer = oContainer.parentNode ;

View File

@ -147,7 +147,7 @@ FCKSelection.HasAncestorNode = function( nodeTagName )
while ( oContainer ) while ( oContainer )
{ {
if ( oContainer.tagName == nodeTagName ) return true ; if ( oContainer.nodeName.IEquals( nodeTagName ) ) return true ;
oContainer = oContainer.parentNode ; oContainer = oContainer.parentNode ;
} }
@ -209,9 +209,10 @@ FCKSelection.GetSelection = function()
return FCK.EditorDocument.selection ; return FCK.EditorDocument.selection ;
} }
FCKSelection.Save = function() FCKSelection.Save = function( noFocus )
{ {
// Ensures the editor has the selection focus. (#1801) // Ensures the editor has the selection focus. (#1801)
if ( !noFocus )
FCK.Focus() ; FCK.Focus() ;
var editorDocument = FCK.EditorDocument ; var editorDocument = FCK.EditorDocument ;
@ -259,8 +260,11 @@ FCKSelection.Restore = function()
try try
{ {
// Don't repeat the restore process if the editor document is already selected. // Don't repeat the restore process if the editor document is already selected.
if ( this._GetSelectionDocument( FCK.EditorDocument.selection ) == FCK.EditorDocument ) if ( String( this._GetSelectionDocument( FCK.EditorDocument.selection ).body.contentEditable ) == 'true' )
{
FCK.IsSelectionChangeLocked = false ;
return ; return ;
}
this.SelectionData.select() ; this.SelectionData.select() ;
} }
catch ( e ) {} catch ( e ) {}

View File

@ -550,7 +550,11 @@ FCKTableHandler.VerticalSplitCell = function()
// 1. Insert a new row. // 1. Insert a new row.
var newCellRowIndex = currentRowIndex + 1 ; var newCellRowIndex = currentRowIndex + 1 ;
var newRow = FCK.EditorDocument.createElement( 'tr' ) ; var newRow = FCK.EditorDocument.createElement( 'tr' ) ;
currentCell.parentNode.parentNode.insertBefore( newRow, currentCell.parentNode.parentNode.rows[newCellRowIndex] ) ; var tBody = currentCell.parentNode.parentNode ;
if ( tBody.rows.length > newCellRowIndex )
tBody.insertBefore( newRow, tBody.rows[newCellRowIndex] ) ;
else
tBody.appendChild( newRow ) ;
// 2. +1 to rowSpan for all cells crossing currentCell's row. // 2. +1 to rowSpan for all cells crossing currentCell's row.
for ( var i = 0 ; i < tableMap[currentRowIndex].length ; ) for ( var i = 0 ; i < tableMap[currentRowIndex].length ; )
@ -677,6 +681,11 @@ FCKTableHandler._CreateTableMap = function( table )
// This function is the inverse of _CreateTableMap - it takes in a table map and converts it to an HTML table. // This function is the inverse of _CreateTableMap - it takes in a table map and converts it to an HTML table.
FCKTableHandler._InstallTableMap = function( tableMap, table ) FCKTableHandler._InstallTableMap = function( tableMap, table )
{ {
// Workaround for #1917 : MSIE will always report a cell's rowSpan as 1 as long
// as the cell is not attached to a row. So we'll need an alternative attribute
// for storing the calculated rowSpan in IE.
var rowSpanAttr = FCKBrowserInfo.IsIE ? "_fckrowspan" : "rowSpan" ;
// Clear the table of all rows first. // Clear the table of all rows first.
while ( table.rows.length > 0 ) while ( table.rows.length > 0 )
{ {
@ -692,7 +701,7 @@ FCKTableHandler._InstallTableMap = function( tableMap, table )
var cell = tableMap[i][j] ; var cell = tableMap[i][j] ;
if ( cell.parentNode ) if ( cell.parentNode )
cell.parentNode.removeChild( cell ) ; cell.parentNode.removeChild( cell ) ;
cell.colSpan = cell.rowSpan = 1 ; cell.colSpan = cell[rowSpanAttr] = 1 ;
} }
} }
@ -727,7 +736,7 @@ FCKTableHandler._InstallTableMap = function( tableMap, table )
if ( ! cell || cell._rowScanned === true ) if ( ! cell || cell._rowScanned === true )
continue ; continue ;
if ( tableMap[j-1] && tableMap[j-1][i] == cell ) if ( tableMap[j-1] && tableMap[j-1][i] == cell )
cell.rowSpan++ ; cell[rowSpanAttr]++ ;
if ( ! tableMap[j+1] || tableMap[j+1][i] != cell ) if ( ! tableMap[j+1] || tableMap[j+1][i] != cell )
cell._rowScanned = true ; cell._rowScanned = true ;
} }
@ -765,6 +774,11 @@ FCKTableHandler._InstallTableMap = function( tableMap, table )
continue ; continue ;
} }
rowObj.appendChild( cell ) ; rowObj.appendChild( cell ) ;
if ( rowSpanAttr != 'rowSpan' )
{
cell.rowSpan = cell[rowSpanAttr] ;
cell.removeAttribute( rowSpanAttr ) ;
}
j += cell.colSpan ; j += cell.colSpan ;
if ( cell.colSpan == 1 ) if ( cell.colSpan == 1 )
cell.removeAttribute( 'colspan' ) ; cell.removeAttribute( 'colspan' ) ;

View File

@ -71,6 +71,7 @@ FCKToolbarItems.GetItem = function( itemName )
case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ; case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ; case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ;
case 'Blockquote' : oItem = new FCKToolbarButton( 'Blockquote' , FCKLang.Blockquote, null, null, false, true, 73 ) ; break ; case 'Blockquote' : oItem = new FCKToolbarButton( 'Blockquote' , FCKLang.Blockquote, null, null, false, true, 73 ) ; break ;
case 'CreateDiv' : oItem = new FCKToolbarButton( 'CreateDiv' , FCKLang.CreateDiv, null, null, false, true, 74 ) ; break ;
case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ; case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ; case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ;

View File

@ -81,7 +81,7 @@ FCKTools.AppendStyleSheet = function( domDocument, cssFileOrArrayOrDef )
if ( typeof( cssFileOrArrayOrDef ) == 'string' ) if ( typeof( cssFileOrArrayOrDef ) == 'string' )
{ {
// Test if the passed argument is an URL. // Test if the passed argument is an URL.
if ( /[\\\/\.]\w*$/.test( cssFileOrArrayOrDef ) ) if ( /[\\\/\.][^{}]*$/.test( cssFileOrArrayOrDef ) )
{ {
// The string may have several URLs separated by comma. // The string may have several URLs separated by comma.
return this.AppendStyleSheet( domDocument, cssFileOrArrayOrDef.split(',') ) ; return this.AppendStyleSheet( domDocument, cssFileOrArrayOrDef.split(',') ) ;
@ -126,7 +126,7 @@ FCKTools.GetStyleHtml = (function()
if ( typeof( cssFileOrArrayOrDef ) == 'string' ) if ( typeof( cssFileOrArrayOrDef ) == 'string' )
{ {
// Test if the passed argument is an URL. // Test if the passed argument is an URL.
if ( /[\\\/\.]\w*$/.test( cssFileOrArrayOrDef ) ) if ( /[\\\/\.][^{}]*$/.test( cssFileOrArrayOrDef ) )
{ {
// The string may have several URLs separated by comma. // The string may have several URLs separated by comma.
return this.GetStyleHtml( cssFileOrArrayOrDef.split(','), markTemp ) ; return this.GetStyleHtml( cssFileOrArrayOrDef.split(','), markTemp ) ;
@ -738,3 +738,12 @@ FCKTools.GetVoidUrl = function()
return "javascript: void(0);" ; // All other browsers. return "javascript: void(0);" ; // All other browsers.
} }
FCKTools.ResetStyles = function( element )
{
element.style.cssText = 'margin:0;' +
'padding:0;' +
'border:0;' +
'background-color:transparent;' +
'background-image:none;' ;
}

View File

@ -75,6 +75,7 @@ FCKTools.CreateXmlObject = function( object )
{ {
case 'XmlHttp' : case 'XmlHttp' :
// Try the native XMLHttpRequest introduced with IE7. // Try the native XMLHttpRequest introduced with IE7.
if ( document.location.protocol != 'file:' )
try { return new XMLHttpRequest() ; } catch (e) {} try { return new XMLHttpRequest() ; } catch (e) {}
aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ; aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;

View File

@ -70,7 +70,12 @@ FCKXHtml.GetXHTML = function( node, includeNode, format )
// Strip the "XHTML" root node. // Strip the "XHTML" root node.
sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ; sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
// Add a space in the tags with no closing tags, like <br/> -> <br /> // According to the doctype set the proper end for self-closing tags
// HTML: <br>
// XHTML: Add a space, like <br/> -> <br />
if (FCKConfig.DocType.length > 0 && FCKRegexLib.HtmlDocType.test( FCKConfig.DocType ) )
sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, '>');
else
sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />'); sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
if ( FCKConfig.ForceSimpleAmpersand ) if ( FCKConfig.ForceSimpleAmpersand )
@ -199,9 +204,16 @@ FCKXHtml._AppendNode = function( xmlNode, htmlNode )
// Ignore bogus BR nodes in the DOM. // Ignore bogus BR nodes in the DOM.
if ( FCKBrowserInfo.IsGecko && if ( FCKBrowserInfo.IsGecko &&
htmlNode.nextSibling &&
( htmlNode.hasAttribute('_moz_editor_bogus_node') || htmlNode.getAttribute( 'type' ) == '_moz' ) ) ( htmlNode.hasAttribute('_moz_editor_bogus_node') || htmlNode.getAttribute( 'type' ) == '_moz' ) )
{
if ( htmlNode.nextSibling )
return false ; return false ;
else
{
htmlNode.removeAttribute( '_moz_editor_bogus_node' ) ;
htmlNode.removeAttribute( 'type' ) ;
}
}
// This is for elements that are instrumental to FCKeditor and // This is for elements that are instrumental to FCKeditor and
// must be removed from the final HTML. // must be removed from the final HTML.
@ -400,6 +412,13 @@ FCKXHtml.TagProcessors =
if ( sSavedUrl != null ) if ( sSavedUrl != null )
FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ; FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ;
// Bug #768 : If the width and height are defined inline CSS,
// don't define it again in the HTML attributes.
if ( htmlNode.style.width )
node.removeAttribute( 'width' ) ;
if ( htmlNode.style.height )
node.removeAttribute( 'height' ) ;
return node ; return node ;
}, },

View File

@ -99,3 +99,16 @@ if ( FCKBrowserInfo.IsOpera )
return node ; return node ;
} }
} }
if ( FCKBrowserInfo.IsGecko )
{
// #2162, some Firefox extensions might add references to internal links
FCKXHtml.TagProcessors['link'] = function( node, htmlNode )
{
if ( htmlNode.href.substr(0, 9).toLowerCase() == 'chrome://' )
return false ;
return node ;
}
}

View File

@ -29,7 +29,8 @@ FCKXHtml._GetMainXmlString = function()
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName ) FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
{ {
var aAttributes = htmlNode.attributes ; var aAttributes = htmlNode.attributes,
bHasStyle ;
for ( var n = 0 ; n < aAttributes.length ; n++ ) for ( var n = 0 ; n < aAttributes.length ; n++ )
{ {
@ -47,9 +48,9 @@ FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
// attribute. It returns "null" for the nodeValue. // attribute. It returns "null" for the nodeValue.
else if ( sAttName == 'style' ) else if ( sAttName == 'style' )
{ {
var data = FCKTools.ProtectFormStyles( htmlNode ) ; // Just mark it to do it later in this function.
sAttValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ; bHasStyle = true ;
FCKTools.RestoreFormStyles( htmlNode, data ) ; continue ;
} }
// There are two cases when the oAttribute.nodeValue must be used: // There are two cases when the oAttribute.nodeValue must be used:
// - for the "class" attribute // - for the "class" attribute
@ -80,6 +81,15 @@ FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ; this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ;
} }
} }
// IE loses the style attribute in JavaScript-created elements tags. (#2390)
if ( bHasStyle || htmlNode.style.cssText.length > 0 )
{
var data = FCKTools.ProtectFormStyles( htmlNode ) ;
var sStyleValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ;
FCKTools.RestoreFormStyles( htmlNode, data ) ;
this._AppendAttribute( node, 'style', sStyleValue ) ;
}
} }
// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list) // On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)

View File

@ -26,9 +26,9 @@
* file. * file.
*/ */
/* /**
The "body" styles should match your editor web site, mainly regarding * The "body" styles should match your editor web site, mainly regarding
background color and font family and size. * background color and font family and size.
*/ */
body body
@ -50,9 +50,9 @@ a[href]
text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */ text-decoration: -moz-anchor-decoration; /* For Firefox 3, otherwise no underline will be used */
} }
/* /**
Just uncomment the following block if you want to avoid spaces between * Just uncomment the following block if you want to avoid spaces between
paragraphs. Remember to apply the same style in your output front end page. * paragraphs. Remember to apply the same style in your output front end page.
*/ */
/* /*
@ -63,10 +63,28 @@ p, ul, li
} }
*/ */
/**
* Uncomment the following block, or only selected lines if appropriate,
* if you have some style items that would break the styles combo box.
* You can also write other CSS overrides inside the style block below
* as needed and they will be applied to inside the style combo only.
*/
/* /*
The following are some sample styles used in the "Styles" toolbar command. .SC_Item *, .SC_ItemSelected *
You should instead remove them, and include the styles used by the site {
you are using the editor in. margin: 0px !important;
padding: 0px !important;
text-indent: 0px !important;
clip: auto !important;
position: static !important;
}
*/
/**
* The following are some sample styles used in the "Styles" toolbar command.
* You should instead remove them, and include the styles used by the site
* you are using the editor in.
*/ */
.Bold .Bold

View File

@ -57,7 +57,7 @@
// Attention: FCKConfig must be available in the page. // Attention: FCKConfig must be available in the page.
function GetCommonDialogCss( prefix ) function GetCommonDialogCss( prefix )
{ {
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ; return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ;
} }
@ -187,33 +187,6 @@ function OpenFileBrowser( url, width, height )
sOptions += ",left=" + iLeft ; sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ; sOptions += ",top=" + iTop ;
// The "PreserveSessionOnFileBrowser" because the above code could be
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
{
// Detect Yahoo popup blocker.
try
{
var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
oWindow.opener = window ;
}
catch(e)
{
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
}
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
window.open( url, 'FCKBrowseWindow', sOptions ) ; window.open( url, 'FCKBrowseWindow', sOptions ) ;
} }

View File

@ -78,8 +78,8 @@ window.onload = function()
border-left: #000000 1px solid; border-bottom: #000000 1px solid"> border-left: #000000 1px solid; border-bottom: #000000 1px solid">
<span fcklang="DlgAboutVersion">version</span> <span fcklang="DlgAboutVersion">version</span>
<br /> <br />
<b>2.6</b><br /> <b>2.6.3</b><br />
Build 18638</td> Build 19836</td>
</tr> </tr>
</table> </table>
</td> </td>

View File

@ -119,10 +119,7 @@ function Ok()
var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ; var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ;
if ( aNewAnchors.length == 0 ) if ( aNewAnchors.length == 0 )
{
// Nothing was selected, so now just create a normal A
aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ; aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
}
else else
{ {
// Remove the fake href // Remove the fake href
@ -136,6 +133,17 @@ function Ok()
oAnchor = aNewAnchors[i] ; oAnchor = aNewAnchors[i] ;
// Set the name // Set the name
if ( FCKBrowserInfo.IsIE )
{
// Setting anchor names directly in IE will trash the HTML code stored
// in FCKTempBin after undos. See #2263.
var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
oAnchor = replaceAnchor ;
}
else
oAnchor.name = sNewName ; oAnchor.name = sNewName ;
// IE does require special processing to show the Anchor's image // IE does require special processing to show the Anchor's image

View File

@ -97,7 +97,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<script type="text/javascript"> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ; document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script> </script>
</form> </form>
</div> </div>

View File

@ -236,6 +236,10 @@ function SetUrl( url, width, height )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@ -288,5 +292,9 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@ -165,7 +165,7 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
<script type="text/javascript"> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ; document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script> </script>
</form> </form>
</div> </div>

View File

@ -447,6 +447,10 @@ function SetUrl( url, width, height, alt )
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@ -500,5 +504,9 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@ -34,9 +34,9 @@
var FCKTools = window.parent.FCKTools ; var FCKTools = window.parent.FCKTools ;
var FCKConfig = window.parent.FCKConfig ; var FCKConfig = window.parent.FCKConfig ;
// Sets the Skin CSS // Set the preview CSS
document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ; document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ;
document.write( FCKTools.GetStyleHtml( GetCommonDialogCss( '../' ) ) ) ; document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ;
if ( window.parent.FCKConfig.BaseHref.length > 0 ) if ( window.parent.FCKConfig.BaseHref.length > 0 )
document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ; document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
@ -50,7 +50,7 @@ window.onload = function()
</script> </script>
</head> </head>
<body style="color: #000000; background-color: #ffffff"> <body>
<div> <div>
<a id="lnkPreview" onclick="return false;" style="cursor: default"> <a id="lnkPreview" onclick="return false;" style="cursor: default">
<img id="imgPreview" onload="window.parent.UpdateOriginal();" <img id="imgPreview" onload="window.parent.UpdateOriginal();"

View File

@ -108,7 +108,9 @@
<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br /> <input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
<br /> <br />
<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" /> <input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
<iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe> <script type="text/javascript">
document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
</script>
</form> </form>
</div> </div>
<div id="divTarget" style="DISPLAY: none"> <div id="divTarget" style="DISPLAY: none">

View File

@ -77,7 +77,32 @@ oRegex.PopupFeatures = /(?:^|,)([^=]+)=(\d+|yes|no)/gi ;
var oParser = new Object() ; var oParser = new Object() ;
oParser.ParseEMailUrl = function( emailUrl ) // This method simply returns the two inputs in numerical order. You can even
// provide strings, as the method would parseInt() the values.
oParser.SortNumerical = function(a, b)
{
return parseInt( a, 10 ) - parseInt( b, 10 ) ;
}
oParser.ParseEMailParams = function(sParams)
{
// Initialize the oEMailParams object.
var oEMailParams = new Object() ;
oEMailParams.Subject = '' ;
oEMailParams.Body = '' ;
var aMatch = sParams.match( /(^|^\?|&)subject=([^&]+)/i ) ;
if ( aMatch ) oEMailParams.Subject = decodeURIComponent( aMatch[2] ) ;
aMatch = sParams.match( /(^|^\?|&)body=([^&]+)/i ) ;
if ( aMatch ) oEMailParams.Body = decodeURIComponent( aMatch[2] ) ;
return oEMailParams ;
}
// This method returns either an object containing the email info, or FALSE
// if the parameter is not an email link.
oParser.ParseEMailUri = function( sUrl )
{ {
// Initializes the EMailInfo object. // Initializes the EMailInfo object.
var oEMailInfo = new Object() ; var oEMailInfo = new Object() ;
@ -85,28 +110,154 @@ oParser.ParseEMailUrl = function( emailUrl )
oEMailInfo.Subject = '' ; oEMailInfo.Subject = '' ;
oEMailInfo.Body = '' ; oEMailInfo.Body = '' ;
var oParts = emailUrl.match( /^([^\?]+)\??(.+)?/ ) ; var aLinkInfo = sUrl.match( /^(\w+):(.*)$/ ) ;
if ( oParts ) if ( aLinkInfo && aLinkInfo[1] == 'mailto' )
{
// This seems to be an unprotected email link.
var aParts = aLinkInfo[2].match( /^([^\?]+)\??(.+)?/ ) ;
if ( aParts )
{ {
// Set the e-mail address. // Set the e-mail address.
oEMailInfo.Address = oParts[1] ; oEMailInfo.Address = aParts[1] ;
// Look for the optional e-mail parameters. // Look for the optional e-mail parameters.
if ( oParts[2] ) if ( aParts[2] )
{ {
var oMatch = oParts[2].match( /(^|&)subject=([^&]+)/i ) ; var oEMailParams = oParser.ParseEMailParams( aParts[2] ) ;
if ( oMatch ) oEMailInfo.Subject = decodeURIComponent( oMatch[2] ) ; oEMailInfo.Subject = oEMailParams.Subject ;
oEMailInfo.Body = oEMailParams.Body ;
}
}
return oEMailInfo ;
}
else if ( aLinkInfo && aLinkInfo[1] == 'javascript' )
{
// This may be a protected email.
oMatch = oParts[2].match( /(^|&)body=([^&]+)/i ) ; // Try to match the url against the EMailProtectionFunction.
if ( oMatch ) oEMailInfo.Body = decodeURIComponent( oMatch[2] ) ; var func = FCKConfig.EMailProtectionFunction ;
if ( func != null )
{
try
{
// Escape special chars.
func = func.replace( /([\/^$*+.?()\[\]])/g, '\\$1' ) ;
// Define the possible keys.
var keys = new Array('NAME', 'DOMAIN', 'SUBJECT', 'BODY') ;
// Get the order of the keys (hold them in the array <pos>) and
// the function replaced by regular expression patterns.
var sFunc = func ;
var pos = new Array() ;
for ( var i = 0 ; i < keys.length ; i ++ )
{
var rexp = new RegExp( keys[i] ) ;
var p = func.search( rexp ) ;
if ( p >= 0 )
{
sFunc = sFunc.replace( rexp, '\'([^\']*)\'' ) ;
pos[pos.length] = p + ':' + keys[i] ;
} }
} }
// Sort the available keys.
pos.sort( oParser.SortNumerical ) ;
// Replace the excaped single quotes in the url, such they do
// not affect the regexp afterwards.
aLinkInfo[2] = aLinkInfo[2].replace( /\\'/g, '###SINGLE_QUOTE###' ) ;
// Create the regexp and execute it.
var rFunc = new RegExp( '^' + sFunc + '$' ) ;
var aMatch = rFunc.exec( aLinkInfo[2] ) ;
if ( aMatch )
{
var aInfo = new Array();
for ( var i = 1 ; i < aMatch.length ; i ++ )
{
var k = pos[i-1].match(/^\d+:(.+)$/) ;
aInfo[k[1]] = aMatch[i].replace(/###SINGLE_QUOTE###/g, '\'') ;
}
// Fill the EMailInfo object that will be returned
oEMailInfo.Address = aInfo['NAME'] + '@' + aInfo['DOMAIN'] ;
oEMailInfo.Subject = decodeURIComponent( aInfo['SUBJECT'] ) ;
oEMailInfo.Body = decodeURIComponent( aInfo['BODY'] ) ;
return oEMailInfo ; return oEMailInfo ;
} }
}
catch (e)
{
}
}
// Try to match the email against the encode protection.
var aMatch = aLinkInfo[2].match( /^location\.href='mailto:'\+(String\.fromCharCode\([\d,]+\))\+'(.*)'$/ ) ;
if ( aMatch )
{
// The link is encoded
oEMailInfo.Address = eval( aMatch[1] ) ;
if ( aMatch[2] )
{
var oEMailParams = oParser.ParseEMailParams( aMatch[2] ) ;
oEMailInfo.Subject = oEMailParams.Subject ;
oEMailInfo.Body = oEMailParams.Body ;
}
return oEMailInfo ;
}
}
return false;
}
oParser.CreateEMailUri = function( address, subject, body ) oParser.CreateEMailUri = function( address, subject, body )
{ {
// Switch for the EMailProtection setting.
switch ( FCKConfig.EMailProtection )
{
case 'function' :
var func = FCKConfig.EMailProtectionFunction ;
if ( func == null )
{
if ( FCKConfig.Debug )
{
alert('EMailProtection alert!\nNo function defined. Please set "FCKConfig.EMailProtectionFunction"') ;
}
return '';
}
// Split the email address into name and domain parts.
var aAddressParts = address.split( '@', 2 ) ;
if ( aAddressParts[1] == undefined )
{
aAddressParts[1] = '' ;
}
// Replace the keys by their values (embedded in single quotes).
func = func.replace(/NAME/g, "'" + aAddressParts[0].replace(/'/g, '\\\'') + "'") ;
func = func.replace(/DOMAIN/g, "'" + aAddressParts[1].replace(/'/g, '\\\'') + "'") ;
func = func.replace(/SUBJECT/g, "'" + encodeURIComponent( subject ).replace(/'/g, '\\\'') + "'") ;
func = func.replace(/BODY/g, "'" + encodeURIComponent( body ).replace(/'/g, '\\\'') + "'") ;
return 'javascript:' + func ;
case 'encode' :
var aParams = [] ;
var aAddressCode = [] ;
if ( subject.length > 0 )
aParams.push( 'subject='+ encodeURIComponent( subject ) ) ;
if ( body.length > 0 )
aParams.push( 'body=' + encodeURIComponent( body ) ) ;
for ( var i = 0 ; i < address.length ; i++ )
aAddressCode.push( address.charCodeAt( i ) ) ;
return 'javascript:location.href=\'mailto:\'+String.fromCharCode(' + aAddressCode.join( ',' ) + ')+\'?' + aParams.join( '&' ) + '\'' ;
}
// EMailProtection 'none'
var sBaseUri = 'mailto:' + address ; var sBaseUri = 'mailto:' + address ;
var sParams = '' ; var sParams = '' ;
@ -263,29 +414,27 @@ function LoadSelection()
// Search for the protocol. // Search for the protocol.
var sProtocol = oRegex.UriProtocol.exec( sHRef ) ; var sProtocol = oRegex.UriProtocol.exec( sHRef ) ;
if ( sProtocol ) // Search for a protected email link.
var oEMailInfo = oParser.ParseEMailUri( sHRef );
if ( oEMailInfo )
{
sType = 'email' ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else if ( sProtocol )
{ {
sProtocol = sProtocol[0].toLowerCase() ; sProtocol = sProtocol[0].toLowerCase() ;
GetE('cmbLinkProtocol').value = sProtocol ; GetE('cmbLinkProtocol').value = sProtocol ;
// Remove the protocol and get the remaining URL. // Remove the protocol and get the remaining URL.
var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ; var sUrl = sHRef.replace( oRegex.UriProtocol, '' ) ;
if ( sProtocol == 'mailto:' ) // It is an e-mail link.
{
sType = 'email' ;
var oEMailInfo = oParser.ParseEMailUrl( sUrl ) ;
GetE('txtEMailAddress').value = oEMailInfo.Address ;
GetE('txtEMailSubject').value = oEMailInfo.Subject ;
GetE('txtEMailBody').value = oEMailInfo.Body ;
}
else // It is a normal link.
{
sType = 'url' ; sType = 'url' ;
GetE('txtUrl').value = sUrl ; GetE('txtUrl').value = sUrl ;
} }
}
else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link. else if ( sHRef.substr(0,1) == '#' && sHRef.length > 1 ) // It is an anchor link.
{ {
sType = 'anchor' ; sType = 'anchor' ;
@ -650,13 +799,17 @@ function BrowseServer()
function SetUrl( url ) function SetUrl( url )
{ {
document.getElementById('txtUrl').value = url ; GetE('txtUrl').value = url ;
OnUrlChange() ; OnUrlChange() ;
dialog.SetSelectedTab( 'Info' ) ; dialog.SetSelectedTab( 'Info' ) ;
} }
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ) function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{ {
// Remove animation
window.parent.Throbber.Hide() ;
GetE( 'divUpload' ).style.display = '' ;
switch ( errorNumber ) switch ( errorNumber )
{ {
case 0 : // No errors case 0 : // No errors
@ -709,6 +862,10 @@ function CheckUpload()
return false ; return false ;
} }
// Show animation
window.parent.Throbber.Show( 100 ) ;
GetE( 'divUpload' ).style.display = 'none' ;
return true ; return true ;
} }

View File

@ -67,7 +67,7 @@ window.onload = function()
dialog.SetOkButton( true ) ; dialog.SetOkButton( true ) ;
dialog.SetAutoSize( true ) ; dialog.SetAutoSize( true ) ;
SelectField( 'txtStartPosition' ) ; SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ;
} }
function Ok() function Ok()

View File

@ -64,7 +64,7 @@ window.onload = function ()
var eFrameSpace = document.getElementById( 'xFrameSpace' ) ; var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' + eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"></iframe>' ; 'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
var oFrame = eFrameSpace.firstChild ; var oFrame = eFrameSpace.firstChild ;
@ -187,7 +187,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
var html = oNode.innerHTML ; var html = oNode.innerHTML ;
html = html.replace(/<o:p>\s*<\/o:p>/g, '') ; html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ; html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
// Remove mso-xxx styles. // Remove mso-xxx styles.
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ; html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
@ -224,6 +224,10 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
if ( bRemoveStyles ) if ( bRemoveStyles )
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ; html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
// Remove style, meta and link tags
html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
// Remove empty styles. // Remove empty styles.
html = html.replace( /\s*style="\s*"/gi, '' ) ; html = html.replace( /\s*style="\s*"/gi, '' ) ;
@ -234,25 +238,28 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
// Remove Lang attributes // Remove Lang attributes
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ; html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ; html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
// Remove XML elements and declarations // Remove XML elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ; html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
// Remove w: tags with contents.
html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
// Remove Tags with XML namespace declarations: <o:p><\/o:p> // Remove Tags with XML namespace declarations: <o:p><\/o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ; html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
// Remove comments [SF BUG-1481861]. // Remove comments [SF BUG-1481861].
html = html.replace(/<\!--.*?-->/g, '' ) ; html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ; html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ; html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
// Remove "display:none" tags. // Remove "display:none" tags.
html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ; html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
// Remove language tags // Remove language tags
html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ; html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
@ -267,8 +274,8 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ; html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
// Word likes to insert extra <font> tags, when using MSIE. (Wierd). // Word likes to insert extra <font> tags, when using MSIE. (Wierd).
html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' ); html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' ); html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
} }
else else
{ {
@ -282,7 +289,7 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ; html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
// Transform <P> to <DIV> // Transform <P> to <DIV>
var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
html = html.replace( re, '<div$2<\/div>' ) ; html = html.replace( re, '<div$2<\/div>' ) ;
// Remove empty tags (three times, just to be sure). // Remove empty tags (three times, just to be sure).

View File

@ -34,6 +34,12 @@ var oEditor = dialog.InnerDialogLoaded() ;
var dialogArguments = dialog.Args() ; var dialogArguments = dialog.Args() ;
var FCKLang = oEditor.FCKLang ; var FCKLang = oEditor.FCKLang ;
var FCKDomTools = oEditor.FCKDomTools ;
var FCKDomRange = oEditor.FCKDomRange ;
var FCKListsLib = oEditor.FCKListsLib ;
var FCKTools = oEditor.FCKTools ;
var EditorDocument = oEditor.FCK.EditorDocument ;
var HighlightStyle = oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ) ;
dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ; dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ;
dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ; dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ;
@ -51,38 +57,312 @@ function OnDialogTabChange( tabCode )
dialog.SetAutoSize( true ) ; dialog.SetAutoSize( true ) ;
} }
GetNextNonEmptyTextNode = function( node, stopNode )
{
while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 )
1 ;
return node ;
}
CharacterCursor = function( arg )
{
if ( arg.nodeType && arg.nodeType == 9 )
{
this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ;
this._offset = 0 ;
this._doc = arg ;
}
else
{
this._textNode = arguments[0] ;
this._offset = arguments[1] ;
this._doc = FCKTools.GetElementDocument( arguments[0] ) ;
}
}
CharacterCursor.prototype =
{
GetCharacter : function()
{
return ( this._textNode && this._textNode.nodeValue.charAt( this._offset ) ) || null ;
},
// Non-normalized.
GetTextNode : function()
{
return this._textNode ;
},
// Non-normalized.
GetIndex : function()
{
return this._offset ;
},
// Return value means whehther we've crossed a line break or a paragraph boundary.
MoveNext : function()
{
if ( this._offset < this._textNode.length - 1 )
{
this._offset++ ;
return false ;
}
var crossed = false ;
var curNode = this._textNode ;
while ( ( curNode = FCKDomTools.GetNextSourceNode( curNode ) )
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
{
var tag = curNode.nodeName.toLowerCase() ;
if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
crossed = true ;
}
this._textNode = curNode ;
this._offset = 0 ;
return crossed ;
},
// Return value means whehther we've crossed a line break or a paragraph boundary.
MoveBack : function()
{
if ( this._offset > 0 && this._textNode.length > 0 )
{
this._offset = Math.min( this._offset - 1, this._textNode.length - 1 ) ;
return false ;
}
var crossed = false ;
var curNode = this._textNode ;
while ( ( curNode = FCKDomTools.GetPreviousSourceNode( curNode ) )
&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
{
var tag = curNode.nodeName.toLowerCase() ;
if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
crossed = true ;
}
this._textNode = curNode ;
this._offset = curNode.length - 1 ;
return crossed ;
},
Clone : function()
{
return new CharacterCursor( this._textNode, this._offset ) ;
}
} ;
CharacterRange = function( initCursor, maxLength )
{
this._cursors = initCursor.push ? initCursor : [initCursor] ;
this._maxLength = maxLength ;
this._highlightRange = null ;
}
CharacterRange.prototype =
{
ToDomRange : function()
{
var firstCursor = this._cursors[0] ;
var lastCursor = this._cursors[ this._cursors.length - 1 ] ;
var domRange = new FCKDomRange( FCKTools.GetElementWindow( firstCursor.GetTextNode() ) ) ;
var w3cRange = domRange._Range = domRange.CreateRange() ;
w3cRange.setStart( firstCursor.GetTextNode(), firstCursor.GetIndex() ) ;
w3cRange.setEnd( lastCursor.GetTextNode(), lastCursor.GetIndex() + 1 ) ;
domRange._UpdateElementInfo() ;
return domRange ;
},
Highlight : function()
{
if ( this._cursors.length < 1 )
return ;
var domRange = this.ToDomRange() ;
HighlightStyle.ApplyToRange( domRange, false, true ) ;
this._highlightRange = domRange ;
var charRange = CharacterRange.CreateFromDomRange( domRange ) ;
var focusNode = domRange.StartNode ;
if ( focusNode.nodeType != 1 )
focusNode = focusNode.parentNode ;
FCKDomTools.ScrollIntoView( focusNode, false ) ;
this._cursors = charRange._cursors ;
},
RemoveHighlight : function()
{
if ( this._highlightRange )
{
HighlightStyle.RemoveFromRange( this._highlightRange, false, true ) ;
var charRange = CharacterRange.CreateFromDomRange( this._highlightRange ) ;
this._cursors = charRange._cursors ;
this._highlightRange = null ;
}
},
GetHighlightDomRange : function()
{
return this._highlightRange;
},
MoveNext : function()
{
var next = this._cursors[ this._cursors.length - 1 ].Clone() ;
var retval = next.MoveNext() ;
if ( retval )
this._cursors = [] ;
this._cursors.push( next ) ;
if ( this._cursors.length > this._maxLength )
this._cursors.shift() ;
return retval ;
},
MoveBack : function()
{
var prev = this._cursors[0].Clone() ;
var retval = prev.MoveBack() ;
if ( retval )
this._cursors = [] ;
this._cursors.unshift( prev ) ;
if ( this._cursors.length > this._maxLength )
this._cursors.pop() ;
return retval ;
},
GetEndCharacter : function()
{
if ( this._cursors.length < 1 )
return null ;
var retval = this._cursors[ this._cursors.length - 1 ].GetCharacter() ;
return retval ;
},
GetNextRange : function( len )
{
if ( this._cursors.length == 0 )
return null ;
var cur = this._cursors[ this._cursors.length - 1 ].Clone() ;
cur.MoveNext() ;
return new CharacterRange( cur, len ) ;
},
GetCursors : function()
{
return this._cursors ;
}
} ;
CharacterRange.CreateFromDomRange = function( domRange )
{
var w3cRange = domRange._Range ;
var startContainer = w3cRange.startContainer ;
var endContainer = w3cRange.endContainer ;
var startTextNode, startIndex, endTextNode, endIndex ;
if ( startContainer.nodeType == 3 )
{
startTextNode = startContainer ;
startIndex = w3cRange.startOffset ;
}
else if ( domRange.StartNode.nodeType == 3 )
{
startTextNode = domRange.StartNode ;
startIndex = 0 ;
}
else
{
startTextNode = GetNextNonEmptyTextNode( domRange.StartNode, domRange.StartNode.parentNode ) ;
if ( !startTextNode )
return null ;
startIndex = 0 ;
}
if ( endContainer.nodeType == 3 && w3cRange.endOffset > 0 )
{
endTextNode = endContainer ;
endIndex = w3cRange.endOffset - 1 ;
}
else
{
endTextNode = domRange.EndNode ;
while ( endTextNode.nodeType != 3 )
endTextNode = endTextNode.lastChild ;
endIndex = endTextNode.length - 1 ;
}
var cursors = [] ;
var current = new CharacterCursor( startTextNode, startIndex ) ;
cursors.push( current ) ;
if ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) && !domRange.CheckIsEmpty() )
{
do
{
current = current.Clone() ;
current.MoveNext() ;
cursors.push( current ) ;
}
while ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) ) ;
}
return new CharacterRange( cursors, cursors.length ) ;
}
// Knuth-Morris-Pratt Algorithm for stream input
KMP_NOMATCH = 0 ;
KMP_ADVANCED = 1 ;
KMP_MATCHED = 2 ;
KmpMatch = function( pattern, ignoreCase )
{
var overlap = [ -1 ] ;
for ( var i = 0 ; i < pattern.length ; i++ )
{
overlap.push( overlap[i] + 1 ) ;
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
}
this._Overlap = overlap ;
this._State = 0 ;
this._IgnoreCase = ( ignoreCase === true ) ;
if ( ignoreCase )
this.Pattern = pattern.toLowerCase();
else
this.Pattern = pattern ;
}
KmpMatch.prototype = {
FeedCharacter : function( c )
{
if ( this._IgnoreCase )
c = c.toLowerCase();
while ( true )
{
if ( c == this.Pattern.charAt( this._State ) )
{
this._State++ ;
if ( this._State == this.Pattern.length )
{
// found a match, start over, don't care about partial matches involving the current match
this._State = 0;
return KMP_MATCHED;
}
return KMP_ADVANCED ;
}
else if ( this._State == 0 )
return KMP_NOMATCH;
else
this._State = this._Overlap[ this._State ];
}
return null ;
},
Reset : function()
{
this._State = 0 ;
}
};
// Place a range at the start of document. // Place a range at the start of document.
// This will be the starting point of our search.
var GlobalRange = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
function ResetGlobalRange()
{
GlobalRange.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ;
GlobalRange.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ;
GlobalRange.Collapse( true ) ;
}
ResetGlobalRange() ;
var HighlightRange = null ;
function Highlight()
{
if ( HighlightRange )
ClearHighlight() ;
var cloneRange = GlobalRange.Clone() ;
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).ApplyToRange( cloneRange, false, true ) ;
HighlightRange = cloneRange ;
GlobalRange = HighlightRange.Clone() ;
}
function ClearHighlight()
{
if ( HighlightRange )
{
oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' ).RemoveFromRange( HighlightRange, false, true ) ;
HighlightRange = null ;
}
}
function OnLoad() function OnLoad()
{ {
// First of all, translate the dialog box texts. // First of all, translate the dialog box texts.
@ -133,78 +413,12 @@ function GetMatchWord()
return !! ( GetE(idMap['CheckWord']).checked ) ; return !! ( GetE(idMap['CheckWord']).checked ) ;
} }
// Get the data pointed to by a bookmark. /* Is this character a unicode whitespace or a punctuation mark?
function GetData( bookmark ) * References:
{ * http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces)
var cursor = oEditor.FCK.EditorDocument.documentElement ; * http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks)
for ( var i = 0 ; i < bookmark.length ; i++ ) */
{ function CheckIsWordSeparator( c )
var target = bookmark[i] ;
var currentIndex = -1 ;
if ( cursor.nodeType != 3 )
{
for (var j = 0 ; j < cursor.childNodes.length ; j++ )
{
var candidate = cursor.childNodes[j] ;
if ( candidate.nodeType == 3 &&
candidate.previousSibling &&
candidate.previousSibling.nodeType == 3 )
continue ;
currentIndex++ ;
if ( currentIndex == target )
{
cursor = candidate ;
break ;
}
}
if ( currentIndex < target )
return null ;
}
else
{
if ( i != bookmark.length - 1 )
return null ;
while ( target >= cursor.length && cursor.nextSibling && cursor.nextSibling.nodeType == 3 )
{
target -= cursor.length ;
cursor = cursor.nextSibling ;
}
cursor = cursor.nodeValue.charAt( target ) ;
if ( cursor == "" )
cursor = null ;
}
}
return cursor ;
}
// With this function, we can treat the bookmark as an iterator for DFS.
function NextPosition( bookmark )
{
// See if there's anything further down the tree.
var next = bookmark.concat( [0] ) ;
if ( GetData( next ) != null )
return next ;
// Nothing down there? See if there's anything next to me.
var next = bookmark.slice( 0, bookmark.length - 1 ).concat( [ bookmark[ bookmark.length - 1 ] + 1 ] ) ;
if ( GetData( next ) != null )
return next ;
// Nothing even next to me? See if there's anything next to my ancestors.
for ( var i = bookmark.length - 1 ; i > 0 ; i-- )
{
var next = bookmark.slice( 0, i - 1 ).concat( [ bookmark[ i - 1 ] + 1 ] ) ;
if ( GetData( next ) != null )
return next ;
}
// There's absolutely nothing left to walk, return null.
return null ;
}
// Is this character a unicode whitespace?
// Reference: http://unicode.org/Public/UNIDATA/PropList.txt
function CheckIsWhitespace( c )
{ {
var code = c.charCodeAt( 0 ); var code = c.charCodeAt( 0 );
if ( code >= 9 && code <= 0xd ) if ( code >= 9 && code <= 0xd )
@ -225,212 +439,103 @@ function CheckIsWhitespace( c )
case 0x3000: case 0x3000:
return true; return true;
default: default:
return false;
} }
return /[.,"'?!;:]/.test( c ) ;
} }
// Knuth-Morris-Pratt Algorithm for stream input FindRange = null ;
KMP_NOMATCH = 0 ;
KMP_ADVANCED = 1 ;
KMP_MATCHED = 2 ;
function KmpMatch( pattern, ignoreCase )
{
var overlap = [ -1 ] ;
for ( var i = 0 ; i < pattern.length ; i++ )
{
overlap.push( overlap[i] + 1 ) ;
while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
}
this._Overlap = overlap ;
this._State = 0 ;
this._IgnoreCase = ( ignoreCase === true ) ;
if ( ignoreCase )
this.Pattern = pattern.toLowerCase();
else
this.Pattern = pattern ;
}
KmpMatch.prototype = {
"FeedCharacter" : function( c )
{
if ( this._IgnoreCase )
c = c.toLowerCase();
while ( true )
{
if ( c == this.Pattern.charAt( this._State ) )
{
this._State++ ;
if ( this._State == this.Pattern.length )
{
// found a match, start over, don't care about partial matches involving the current match
this._State = 0;
return KMP_MATCHED;
}
return KMP_ADVANCED ;
}
else if ( this._State == 0 )
return KMP_NOMATCH;
else
this._State = this._Overlap[ this._State ];
}
return null ;
},
"Reset" : function()
{
this._State = 0 ;
}
};
function _Find() function _Find()
{ {
// Start from the end of the current selection. var searchString = GetSearchString() ;
var matcher = new KmpMatch( GetSearchString(), ! GetCheckCase() ) ; if ( !FindRange )
var cursor = GlobalRange.CreateBookmark2().End ; FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ;
else
{
FindRange.RemoveHighlight() ;
FindRange = FindRange.GetNextRange( searchString.length ) ;
}
var matcher = new KmpMatch( searchString, ! GetCheckCase() ) ;
var matchState = KMP_NOMATCH ; var matchState = KMP_NOMATCH ;
var matchBookmark = null ; var character = '%' ;
var matchBookmarkStart = [] ;
// Match finding. while ( character != null )
while ( true )
{ {
// Perform KMP stream matching. while ( ( character = FindRange.GetEndCharacter() ) )
// - Reset KMP matcher if we encountered a block element.
var data = GetData( cursor ) ;
if ( data )
{ {
if ( data.tagName ) matchState = matcher.FeedCharacter( character ) ;
{ if ( matchState == KMP_MATCHED )
if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] )
{
matcher.Reset();
matchBookmarkStart = [] ;
}
}
else if ( data.charAt != undefined )
{
matchState = matcher.FeedCharacter(data) ;
// No possible match of any useful substring in the pattern for the currently scanned character.
// So delete any positional information.
if ( matchState == KMP_NOMATCH )
matchBookmarkStart = [] ;
// We've matched something, but it's not a complete match, so let's just mark down the position for backtracking later.
else if ( matchState == KMP_ADVANCED )
{
matchBookmarkStart.push( cursor.concat( [] ) ) ;
if ( matchBookmarkStart.length > matcher._State )
matchBookmarkStart.shift() ;
}
// Found a complete match! Mark down the ending position as well.
else if ( matchState == KMP_MATCHED )
{
// It is possible to get a KMP_MATCHED without KMP_ADVANCED when the match pattern is only 1 character.
// So need to check and mark down the starting position as well.
if ( matchBookmarkStart.length == 0 )
matchBookmarkStart = [cursor.concat( [] )] ;
matchBookmark = { 'Start' : matchBookmarkStart.shift(), 'End' : cursor.concat( [] ) } ;
matchBookmark.End[ matchBookmark.End.length - 1 ]++;
// Wait, do we have to match a whole word?
// If yes, carry out additional checks on what we've got.
if ( GetMatchWord() )
{
var startOk = false ;
var endOk = false ;
var start = matchBookmark.Start ;
var end = matchBookmark.End ;
if ( start[ start.length - 1 ] == 0 )
startOk = true ;
else
{
var cursorBeforeStart = start.slice( 0, start.length - 1 ) ;
cursorBeforeStart.push( start[ start.length - 1 ] - 1 ) ;
var dataBeforeStart = GetData( cursorBeforeStart ) ;
if ( dataBeforeStart == null || dataBeforeStart.charAt == undefined )
startOk = true ;
else if ( CheckIsWhitespace( dataBeforeStart ) )
startOk = true ;
}
// this is already one character beyond the last char, no need to move
var cursorAfterEnd = end ;
var dataAfterEnd = GetData( cursorAfterEnd );
if ( dataAfterEnd == null || dataAfterEnd.charAt == undefined )
endOk = true ;
else if ( CheckIsWhitespace( dataAfterEnd ) )
endOk = true ;
if ( startOk && endOk )
break ; break ;
else if ( FindRange.MoveNext() )
matcher.Reset() ; matcher.Reset() ;
} }
else
break ;
}
}
}
// Perform DFS across the document, until we've reached the end.
cursor = NextPosition( cursor ) ;
if ( cursor == null )
break;
}
// If we've found a match, highlight the match.
if ( matchState == KMP_MATCHED ) if ( matchState == KMP_MATCHED )
{ {
GlobalRange.MoveToBookmark2( matchBookmark ) ; if ( GetMatchWord() )
Highlight() ;
var focus = GlobalRange._Range.endContainer ;
while ( focus && focus.nodeType != 1 )
focus = focus.parentNode ;
if ( focus )
{ {
if ( oEditor.FCKBrowserInfo.IsSafari ) var cursors = FindRange.GetCursors() ;
oEditor.FCKDomTools.ScrollIntoView( focus, false ) ; var head = cursors[ cursors.length - 1 ].Clone() ;
else var tail = cursors[0].Clone() ;
focus.scrollIntoView( false ) ; if ( !head.MoveNext() && !CheckIsWordSeparator( head.GetCharacter() ) )
continue ;
if ( !tail.MoveBack() && !CheckIsWordSeparator( tail.GetCharacter() ) )
continue ;
} }
FindRange.Highlight() ;
return true ; return true ;
} }
else
{
ResetGlobalRange() ;
return false ;
} }
FindRange = null ;
return false ;
} }
function Find() function Find()
{ {
if ( ! _Find() ) if ( ! _Find() )
{
ClearHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
} }
}
function Replace() function Replace()
{ {
if ( GlobalRange.CheckIsCollapsed() ) var saveUndoStep = function( selectRange )
{ {
if (! _Find() ) var ieRange ;
{ if ( oEditor.FCKBrowserInfo.IsIE )
ClearHighlight() ; ieRange = document.selection.createRange() ;
alert( FCKLang.DlgFindNotFoundMsg ) ;
selectRange.Select() ;
oEditor.FCKUndo.SaveUndoStep() ;
var cloneRange = selectRange.Clone() ;
cloneRange.Collapse( false ) ;
cloneRange.Select() ;
if ( ieRange )
setTimeout( function(){ ieRange.select() ; }, 1 ) ;
} }
if ( FindRange && FindRange.GetHighlightDomRange() )
{
var range = FindRange.GetHighlightDomRange() ;
var bookmark = range.CreateBookmark() ;
FindRange.RemoveHighlight() ;
range.MoveToBookmark( bookmark ) ;
saveUndoStep( range ) ;
range.DeleteContents() ;
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
range._UpdateElementInfo() ;
FindRange = CharacterRange.CreateFromDomRange( range ) ;
} }
else else
{ {
oEditor.FCKUndo.SaveUndoStep() ; if ( ! _Find() )
GlobalRange.DeleteContents() ; {
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ; FindRange && FindRange.RemoveHighlight() ;
GlobalRange.Collapse( false ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
}
} }
} }
@ -441,21 +546,34 @@ function ReplaceAll()
while ( _Find() ) while ( _Find() )
{ {
dialog.Selection.EnsureSelection() ; var range = FindRange.GetHighlightDomRange() ;
GlobalRange.DeleteContents() ; var bookmark = range.CreateBookmark() ;
GlobalRange.InsertNode( oEditor.FCK.EditorDocument.createTextNode( GetReplaceString() ) ) ; FindRange.RemoveHighlight() ;
GlobalRange.Collapse( false ) ; range.MoveToBookmark( bookmark) ;
range.DeleteContents() ;
range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
range._UpdateElementInfo() ;
FindRange = CharacterRange.CreateFromDomRange( range ) ;
replaceCount++ ; replaceCount++ ;
} }
if ( replaceCount == 0 ) if ( replaceCount == 0 )
{ {
ClearHighlight() ; FindRange && FindRange.RemoveHighlight() ;
alert( FCKLang.DlgFindNotFoundMsg ) ; alert( FCKLang.DlgFindNotFoundMsg ) ;
} }
dialog.Cancel() ; dialog.Cancel() ;
} }
window.onunload = function(){ ClearHighlight() ; } window.onunload = function()
{
if ( FindRange )
{
FindRange.RemoveHighlight() ;
FindRange.ToDomRange().Select() ;
}
}
</script> </script>
</head> </head>
<body onload="OnLoad()" style="overflow: hidden"> <body onload="OnLoad()" style="overflow: hidden">

View File

@ -52,7 +52,12 @@ function OnSpellerControlsLoad( controlsWindow )
function oSpeller_OnFinished( numberOCorrections ) function oSpeller_OnFinished( numberOCorrections )
{ {
if ( numberOCorrections > 0 ) if ( numberOCorrections > 0 )
oEditor.FCK.SetData( document.getElementById('txtHtml').value ) ; {
oEditor.FCKUndo.SaveUndoStep() ;
oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ;
if ( oEditor.FCKBrowserInfo.IsIE )
oEditor.FCKSelection.Collapse( true ) ;
}
window.parent.Cancel() ; window.parent.Cancel() ;
} }

View File

@ -3,29 +3,10 @@ header('Content-type: text/html; charset=utf-8');
// The following variables values must reflect your installation needs. // The following variables values must reflect your installation needs.
//$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows) $aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = 'aspell'; // by FredCK (for Linux) //$aspell_prog = 'aspell'; // by FredCK (for Linux)
if ($_GET['aspell_path'])
{
$aspell_prog = $_GET['aspell_path'];
}
else
{
$aspell_prog = 'aspell';
}
if ($_GET['spellchecker_lang'])
{
$lang = $_GET['spellchecker_lang'];
}
else
{
$lang = 'en_US'; $lang = 'en_US';
}
//$lang = 'en_US';
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
$tempfiledir = "./"; $tempfiledir = "./";

View File

@ -27,6 +27,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" /> <meta name="robots" content="noindex, nofollow" />
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
// Domain relaxation logic. // Domain relaxation logic.
(function() (function()
{ {
@ -190,6 +192,19 @@ var Sizer = function()
} }
} }
/**
* IE6 has a similar bug where it sometimes thinks $('contents') has an
* offsetHeight of 0 (#2114).
*/
if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
{
var originalRefreshContainerSize = retval.RefreshContainerSize ;
retval.RefreshContainerSize = function()
{
FCKTools.SetTimeout( originalRefreshContainerSize, 1, retval ) ;
}
}
window.onresize = function() window.onresize = function()
{ {
retval.RefreshContainerSize() ; retval.RefreshContainerSize() ;
@ -232,10 +247,13 @@ var Throbber = function()
var throbberParent = $( 'throbberBlock' ) ; var throbberParent = $( 'throbberBlock' ) ;
if (throbberParent.childNodes.length == 0)
{
// Create the throbber blocks. // Create the throbber blocks.
var classIds = [ 1,2,3,4,5,4,3,2 ] ; var classIds = [ 1,2,3,4,5,4,3,2 ] ;
while ( classIds.length > 0 ) while ( classIds.length > 0 )
throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ; throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ;
}
// Center the throbber. // Center the throbber.
var frm = $( 'contents' ) ; var frm = $( 'contents' ) ;
@ -248,6 +266,10 @@ var Throbber = function()
// Show it. // Show it.
throbberParent.style.visibility = '' ; throbberParent.style.visibility = '' ;
// Hide tabs and buttons:
$( 'Tabs' ).style.visibility = 'hidden' ;
$( 'PopupButtons' ).style.visibility = 'hidden' ;
// Setup the animation interval. // Setup the animation interval.
timer = setInterval( updateThrobber, 100 ) ; timer = setInterval( updateThrobber, 100 ) ;
}, },
@ -260,9 +282,11 @@ var Throbber = function()
timer = null ; timer = null ;
} }
var throbberParent = document.getElementById( 'throbberBlock' ) ; $( 'throbberBlock' ).style.visibility = 'hidden' ;
if ( throbberParent )
FCKDomTools.RemoveNode( throbberParent ) ; // Show tabs and buttons:
$( 'Tabs' ).style.visibility = '' ;
$( 'PopupButtons' ).style.visibility = '' ;
} }
} ; } ;
}() ; }() ;
@ -617,7 +641,7 @@ var onReadyRegister = function()
E.FCKLanguageManager.TranslatePage( document ) ; E.FCKLanguageManager.TranslatePage( document ) ;
// Create the IFRAME that holds the dialog contents. // Create the IFRAME that holds the dialog contents.
$( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"></iframe>' ; $( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"><\/iframe>' ;
} ; } ;
window.InnerDialogLoaded = function() window.InnerDialogLoaded = function()
@ -727,6 +751,7 @@ var onReadyRegister = function()
} }
} ; } ;
})() ; })() ;
// ]]>
</script> </script>
</head> </head>
<body onload="Init();" class="PopupBody"> <body onload="Init();" class="PopupBody">
@ -734,7 +759,9 @@ var onReadyRegister = function()
<div id="header"> <div id="header">
<div id="TitleArea" class="PopupTitle PopupTitleBorder"> <div id="TitleArea" class="PopupTitle PopupTitleBorder">
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
document.write( Args().Title ) ; document.write( Args().Title ) ;
// ]]>
</script> </script>
<div id="closeButton" onclick="Cancel();"></div> <div id="closeButton" onclick="Cancel();"></div>
</div> </div>
@ -772,12 +799,14 @@ document.write( Args().Title ) ;
<div class="cover" id="cover" style="display:none"></div> <div class="cover" id="cover" style="display:none"></div>
<div id="throbberBlock" style="position: absolute; visibility: hidden"></div> <div id="throbberBlock" style="position: absolute; visibility: hidden"></div>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[
// Set the class name for language direction. // Set the class name for language direction.
document.body.className += ' ' + langDir ; document.body.className += ' ' + langDir ;
var cover = $( 'cover' ) ; var cover = $( 'cover' ) ;
cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ; cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ;
FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ; FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;
// ]]>
</script> </script>
</body> </body>
</html> </html>

View File

@ -29,6 +29,37 @@
<meta http-equiv="Cache-Control" content="public"> <meta http-equiv="Cache-Control" content="public">
<script type="text/javascript"> <script type="text/javascript">
// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
// without security.fileuri.strict_origin_policy disabled.
if ( document.location.protocol == 'file:' )
{
try
{
window.parent.document.domain ;
}
catch ( e )
{
window.addEventListener( 'load', function()
{
document.body.innerHTML = '\
<div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
<p>\
<b>Your browser security settings don\'t allow FCKeditor to be opened from\
the local filesystem.<\/b>\
<\/p>\
<p>\
Please open the <b>about:config<\/b> page and disable the\
&quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\
<\/p>\
<p>\
Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
for more information.\
<\/p>\
<\/div>' ;
}, false ) ;
}
}
// Save a reference to the default domain. // Save a reference to the default domain.
var FCK_ORIGINAL_DOMAIN ; var FCK_ORIGINAL_DOMAIN ;
@ -134,9 +165,16 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ; FCKConfig_PreProcess() ;
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // Load the full debug script.
var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + '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__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)}' ) ; if ( FCKConfig.Debug )
var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + '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}' ) ; LoadScript( '_source/internals/fckdebug.js' ) ;
</script>
<script type="text/javascript">
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
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)}' ) ;
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}' ) ;
// Popup the debug window if debug mode is set to true. It guarantees that the // Popup the debug window if debug mode is set to true. It guarantees that the
// first debug message will not be lost. // first debug message will not be lost.
@ -215,6 +253,7 @@ function WaitForActive( editorInstance, newStatus )
if ( FCKBrowserInfo.IsGecko ) if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCKTools.RunFunction( window.onresize ) ;
if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ; _AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@ -31,6 +31,37 @@
@Packager.RemoveLine --> @Packager.RemoveLine -->
<script type="text/javascript"> <script type="text/javascript">
// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem
// without security.fileuri.strict_origin_policy disabled.
if ( document.location.protocol == 'file:' )
{
try
{
window.parent.document.domain ;
}
catch ( e )
{
window.addEventListener( 'load', function()
{
document.body.innerHTML = '\
<div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\
<p>\
<b>Your browser security settings don\'t allow FCKeditor to be opened from\
the local filesystem.<\/b>\
<\/p>\
<p>\
Please open the <b>about:config<\/b> page and disable the\
&quot;security.fileuri.strict_origin_policy&quot; option; then load this page again.\
<\/p>\
<p>\
Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\
for more information.\
<\/p>\
<\/div>' ;
}, false ) ;
}
}
// Save a reference to the default domain. // Save a reference to the default domain.
var FCK_ORIGINAL_DOMAIN ; var FCK_ORIGINAL_DOMAIN ;
@ -103,7 +134,7 @@ LoadScript( '_source/internals/fck.js' ) ;
LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ; LoadScript( '_source/internals/fck_' + sSuffix + '.js' ) ;
LoadScript( '_source/internals/fckconfig.js' ) ; LoadScript( '_source/internals/fckconfig.js' ) ;
LoadScript( '_source/internals/fckdebug.js' ) ; LoadScript( '_source/internals/fckdebug_empty.js' ) ;
LoadScript( '_source/internals/fckdomtools.js' ) ; LoadScript( '_source/internals/fckdomtools.js' ) ;
LoadScript( '_source/internals/fcktools.js' ) ; LoadScript( '_source/internals/fcktools.js' ) ;
LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ; LoadScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
@ -237,12 +268,19 @@ FCKConfig_LoadPageConfig() ;
FCKConfig_PreProcess() ; FCKConfig_PreProcess() ;
var FCK_InternalCSS = FCKConfig.FullBasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine // Load the full debug script.
var FCK_ShowTableBordersCSS = FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine if ( FCKConfig.Debug )
LoadScript( '_source/internals/fckdebug.js' ) ;
</script>
<script type="text/javascript">
var FCK_InternalCSS = FCKConfig.BasePath + 'css/fck_internal.css' ; // @Packager.RemoveLine
var FCK_ShowTableBordersCSS = FCKConfig.BasePath + 'css/fck_showtableborders_gecko.css' ; // @Packager.RemoveLine
/* @Packager.RemoveLine /* @Packager.RemoveLine
// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor // CSS minified by http://iceyboard.no-ip.org/projects/css_compressor (see _dev/css_compression.txt).
var FCK_InternalCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + '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__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)}' ) ; 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)}' ) ;
var FCK_ShowTableBordersCSS = FCKTools.FixCssUrls( FCKConfig.FullBasePath + '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}' ) ; 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}' ) ;
@Packager.RemoveLine */ @Packager.RemoveLine */
// Popup the debug window if debug mode is set to true. It guarantees that the // Popup the debug window if debug mode is set to true. It guarantees that the
@ -322,6 +360,7 @@ function WaitForActive( editorInstance, newStatus )
if ( FCKBrowserInfo.IsGecko ) if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCKTools.RunFunction( window.onresize ) ;
if ( !FCKConfig.PreventSubmitHandler )
_AttachFormSubmitToAPI() ; _AttachFormSubmitToAPI() ;
FCK.SetStatus( FCK_STATUS_COMPLETE ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ;

View File

@ -24,27 +24,24 @@
body body
{ {
background-color: #f1f1e3; background-color: #f1f1e3;
margin-top:0;
margin-bottom:0;
} }
form form
{ {
margin: 0px 0px 0px 0px ; margin: 0;
padding: 0px 0px 0px 0px ; padding: 0;
} }
.Frame .Frame
{ {
background-color: #f1f1e3; background-color: #f1f1e3;
border-color: #f1f1e3; border: thin inset #f1f1e3;
border-right: thin inset;
border-top: thin inset;
border-left: thin inset;
border-bottom: thin inset;
} }
body.FileArea body.FileArea
{ {
background-color: #ffffff; background-color: #ffffff;
margin: 10px; margin: 10px;
} }
@ -70,11 +67,8 @@ body, td, input, select
.Button, button .Button, button
{ {
border-right: #737357 1px solid;
border-top: #737357 1px solid;
border-left: #737357 1px solid;
color: #3b3b1f; color: #3b3b1f;
border-bottom: #737357 1px solid; border: #737357 1px solid;
background-color: #c7c78f; background-color: #c7c78f;
} }
@ -87,3 +81,7 @@ body, td, input, select
{ {
background-image: url(images/Folder.gif); background-image: url(images/Folder.gif);
} }
.fullHeight {
height: 100%;
}

View File

@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<!-- <!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net * FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben * Copyright (C) 2003-2008 Frederico Caldeira Knabben
@ -27,7 +28,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/fckxml.js"></script> <script type="text/javascript" src="js/fckxml.js"></script>
<script language="javascript"> <script type="text/javascript">
// Automatically detect the correct document.domain (#1919). // Automatically detect the correct document.domain (#1919).
(function() (function()
{ {
@ -41,7 +42,8 @@
var test = window.opener.document.domain ; var test = window.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

@ -23,6 +23,7 @@
--> -->
<html> <html>
<head> <head>
<title>Folder path</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript"> <script type="text/javascript">
@ -39,7 +40,8 @@
var test = window.top.opener.document.domain ; var test = window.top.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;
@ -58,12 +60,6 @@
} }
})() ; })() ;
function OnResize()
{
divName.style.width = "1px" ;
divName.style.width = tdName.offsetWidth + "px" ;
}
function SetCurrentFolder( resourceType, folderPath ) function SetCurrentFolder( resourceType, folderPath )
{ {
document.getElementById('tdName').innerHTML = folderPath ; document.getElementById('tdName').innerHTML = folderPath ;
@ -76,8 +72,8 @@ window.onload = function()
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td> <td>
<button style="WIDTH: 100%" type="button"> <button style="WIDTH: 100%" type="button">
@ -87,7 +83,7 @@ window.onload = function()
<td>&nbsp;</td> <td>&nbsp;</td>
<td id="tdName" width="100%" nowrap class="ActualFolder">/</td> <td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><img height="8" src="images/ButtonArrow.gif" width="12"></td> <td><img height="8" src="images/ButtonArrow.gif" width="12" alt=""></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</table> </table>

View File

@ -23,10 +23,11 @@
--> -->
<html> <html>
<head> <head>
<title>Create Folder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
function SetCurrentFolder( resourceType, folderPath ) function SetCurrentFolder( resourceType, folderPath )
{ {
@ -93,8 +94,8 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td> <td>
<button type="button" style="WIDTH: 100%" onclick="CreateFolder();"> <button type="button" style="WIDTH: 100%" onclick="CreateFolder();">

View File

@ -24,10 +24,11 @@
--> -->
<html> <html>
<head> <head>
<title>Folders</title>
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
var sActiveFolder ; var sActiveFolder ;
@ -66,12 +67,12 @@ oListManager.AddItem = function( folderName, folderPath )
// Add the folder icon cell. // Add the folder icon cell.
var oCell = oRow.insertCell(-1) ; var oCell = oRow.insertCell(-1) ;
oCell.width = 16 ; oCell.width = 16 ;
oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"></a>' ; oCell.innerHTML = sLink + '<img alt="" src="images/spacer.gif" width="16" height="16" border="0"><\/a>' ;
// Add the folder name cell. // Add the folder name cell.
oCell = oRow.insertCell(-1) ; oCell = oRow.insertCell(-1) ;
oCell.noWrap = true ; oCell.noWrap = true ;
oCell.innerHTML = '&nbsp;' + sLink + folderName + '</a>' ; oCell.innerHTML = '&nbsp;' + sLink + folderName + '<\/a>' ;
this.TableRows[ folderPath ] = oRow ; this.TableRows[ folderPath ] = oRow ;
} }
@ -186,7 +187,7 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body class="FileArea" bottomMargin="10" leftMargin="10" topMargin="10" rightMargin="10"> <body class="FileArea">
<table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table id="tableFiles" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr id="trUp" style="DISPLAY: none"> <tr id="trUp" style="DISPLAY: none">
<td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td> <td width="16"><a id="linkUpIcon" href="#"><img alt="" src="images/FolderUp.gif" width="16" height="16" border="0"></a></td>

View File

@ -21,9 +21,10 @@
* *
* This page shows all resources available in a folder in the File Browser. * This page shows all resources available in a folder in the File Browser.
--> -->
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<link href="browser.css" type="text/css" rel="stylesheet" /> <title>Resources</title>
<link href="browser.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -23,10 +23,11 @@
--> -->
<html> <html>
<head> <head>
<title>Available types</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet"> <link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script language="javascript"> <script type="text/javascript">
function SetResourceType( type ) function SetResourceType( type )
{ {
@ -42,21 +43,24 @@ var aTypes = [
window.onload = function() window.onload = function()
{ {
var oCombo = document.getElementById('cmbType') ;
oCombo.innerHTML = '' ;
for ( var i = 0 ; i < aTypes.length ; i++ ) for ( var i = 0 ; i < aTypes.length ; i++ )
{ {
if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType ) if ( oConnector.ShowAllTypes || aTypes[i][0] == oConnector.ResourceType )
AddSelectOption( document.getElementById('cmbType'), aTypes[i][1], aTypes[i][0] ) ; AddSelectOption( oCombo, aTypes[i][1], aTypes[i][0] ) ;
} }
} }
</script> </script>
</head> </head>
<body bottomMargin="0" topMargin="0"> <body>
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr> <tr>
<td nowrap> <td nowrap>
Resource Type<BR> Resource Type<BR>
<select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);"> <select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
<option>&nbsp;
</select> </select>
</td> </td>
</tr> </tr>

View File

@ -21,11 +21,11 @@
* *
* Page used to upload new files in the current folder. * Page used to upload new files in the current folder.
--> -->
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<title>File Upload</title> <title>File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet" /> <link href="browser.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"> <script type="text/javascript">
@ -95,9 +95,9 @@ window.onload = function()
} }
</script> </script>
</head> </head>
<body bottommargin="0" topmargin="0"> <body>
<form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();"> <form id="frmUpload" action="" target="frmUploadWorker" method="post" enctype="multipart/form-data" onsubmit="return OnSubmit();">
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0"> <table class="fullHeight" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr> <tr>
<td nowrap="nowrap"> <td nowrap="nowrap">
<span id="eUploadMessage">Upload a new file in this folder</span><br> <span id="eUploadMessage">Upload a new file in this folder</span><br>

View File

@ -35,7 +35,8 @@
var test = window.top.opener.document.domain ; var test = window.top.opener.document.domain ;
break ; break ;
} }
catch( e ) {} catch( e )
{}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ; d = d.replace( /.*?(?:\.|$)/, '' ) ;

View File

@ -61,7 +61,25 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{ {
if ( oXmlHttp.readyState == 4 ) if ( oXmlHttp.readyState == 4 )
{ {
if ( ( oXmlHttp.status != 200 && oXmlHttp.status != 304 ) || oXmlHttp.responseXML == null || oXmlHttp.responseXML.firstChild == null ) var oXml ;
try
{
// this is the same test for an FF2 bug as in fckxml_gecko.js
// but we've moved the responseXML assignment into the try{}
// so we don't even have to check the return status codes.
var test = oXmlHttp.responseXML.firstChild ;
oXml = oXmlHttp.responseXML ;
}
catch ( e )
{
try
{
oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
}
catch ( e ) {}
}
if ( !oXml || !oXml.firstChild || oXml.firstChild.nodeName == 'parsererror' )
{ {
alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' + alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' +
'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' + 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
@ -70,7 +88,7 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
return ; return ;
} }
oFCKXml.DOMDocument = oXmlHttp.responseXML ; oFCKXml.DOMDocument = oXml ;
asyncFunctionPointer( oFCKXml ) ; asyncFunctionPointer( oFCKXml ) ;
} }
} }

View File

@ -30,6 +30,7 @@ Sub SetXmlHeaders()
Response.CacheControl = "no-cache" Response.CacheControl = "no-cache"
' Set the response format. ' Set the response format.
Response.CodePage = 65001
Response.CharSet = "UTF-8" Response.CharSet = "UTF-8"
Response.ContentType = "text/xml" Response.ContentType = "text/xml"
End Sub End Sub

View File

@ -103,7 +103,7 @@ Sub CreateFolder( resourceType, currentFolder )
Else Else
' Map the virtual path to the local server path of the current folder. ' Map the virtual path to the local server path of the current folder.
Dim sServerDir Dim sServerDir
sServerDir = ServerMapFolder( resourceType, CombinePaths(currentFolder, sNewFolderName), "CreateFolder" ) sServerDir = ServerMapFolder( resourceType, CombineLocalPaths(currentFolder, sNewFolderName), "CreateFolder" )
On Error Resume Next On Error Resume Next
@ -171,7 +171,7 @@ Sub FileUpload( resourceType, currentFolder, sCommand )
Do While ( True ) Do While ( True )
Dim sFilePath Dim sFilePath
sFilePath = sServerDir & sFileName sFilePath = CombineLocalPaths(sServerDir, sFileName)
If ( oFSO.FileExists( sFilePath ) ) Then If ( oFSO.FileExists( sFilePath ) ) Then
iCounter = iCounter + 1 iCounter = iCounter + 1

View File

@ -25,6 +25,12 @@ function CombinePaths( sBasePath, sFolder)
CombinePaths = RemoveFromEnd( sBasePath, "/" ) & "/" & RemoveFromStart( sFolder, "/" ) CombinePaths = RemoveFromEnd( sBasePath, "/" ) & "/" & RemoveFromStart( sFolder, "/" )
end function end function
function CombineLocalPaths( sBasePath, sFolder)
sFolder = replace(sFolder, "/", "\")
' The RemoveFrom* functions use RegExp, so we must escape the \
CombineLocalPaths = RemoveFromEnd( sBasePath, "\\" ) & "\" & RemoveFromStart( sFolder, "\\" )
end function
Function GetResourceTypePath( resourceType, sCommand ) Function GetResourceTypePath( resourceType, sCommand )
if ( sCommand = "QuickUpload") then if ( sCommand = "QuickUpload") then
GetResourceTypePath = ConfigQuickUploadPath.Item( resourceType ) GetResourceTypePath = ConfigQuickUploadPath.Item( resourceType )
@ -69,7 +75,7 @@ Function ServerMapFolder( resourceType, folderPath, sCommand )
CreateServerFolder sResourceTypePath CreateServerFolder sResourceTypePath
' Return the resource type directory combined with the required path. ' Return the resource type directory combined with the required path.
ServerMapFolder = CombinePaths( sResourceTypePath, folderPath ) ServerMapFolder = CombineLocalPaths( sResourceTypePath, folderPath )
End Function End Function
Sub CreateServerFolder( folderPath ) Sub CreateServerFolder( folderPath )
@ -79,6 +85,10 @@ Sub CreateServerFolder( folderPath )
Dim sParent Dim sParent
sParent = oFSO.GetParentFolderName( folderPath ) sParent = oFSO.GetParentFolderName( folderPath )
' If folderPath is a network path (\\server\folder\) then sParent is an empty string.
' Get out.
if (sParent = "") then exit sub
' Check if the parent exists, or create it. ' Check if the parent exists, or create it.
If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent ) If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )
@ -214,37 +224,9 @@ end function
Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg ) Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg )
Response.Clear Response.Clear
Response.Write "<script type=""text/javascript"">" Response.Write "<script type=""text/javascript"">"
Response.Write "(function()" ' Minified version of the document.domain automatic fix script (#1919).
Response.Write "{" ' The original script can be found at _dev/domain_fix_template.js
Response.Write "var d = document.domain ;" Response.Write "(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();"
Response.Write " while ( true )"
Response.Write " {"
' Test if we can access a parent property.
Response.Write " try"
Response.Write " {"
Response.Write " var test = window.top.opener.document.domain ;"
Response.Write " break ;"
Response.Write " }"
Response.Write " catch( e ) {}"
' Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
Response.Write " d = d.replace( /.*?(?:\.|$)/, '' ) ;"
Response.Write " if ( d.length == 0 )"
' It was not able to detect the domain.
Response.Write " break ;"
Response.Write ""
Response.Write " try"
Response.Write " {"
Response.Write " document.domain = d ;"
Response.Write " }"
Response.Write " catch (e)"
Response.Write " {"
Response.Write " break ;"
Response.Write " }"
Response.Write " }"
Response.Write "})() ;"
Response.Write "window.parent.OnUploadCompleted(" & errorNumber & ",""" & Replace( fileUrl, """", "\""" ) & """,""" & Replace( fileName, """", "\""" ) & """,""" & Replace( customMsg , """", "\""" ) & """) ;" Response.Write "window.parent.OnUploadCompleted(" & errorNumber & ",""" & Replace( fileUrl, """", "\""" ) & """,""" & Replace( fileName, """", "\""" ) & """,""" & Replace( customMsg , """", "\""" ) & """) ;"
Response.Write "</script>" Response.Write "</script>"

View File

@ -47,38 +47,9 @@
function SendUploadResults(errorNumber, fileUrl, fileName, customMsg) function SendUploadResults(errorNumber, fileUrl, fileName, customMsg)
{ {
WriteOutput('<script type="text/javascript">'); WriteOutput('<script type="text/javascript">');
WriteOutput("(function()"& // Minified version of the document.domain automatic fix script (#1919).
"{"& // The original script can be found at _dev/domain_fix_template.js
" var d = document.domain ;"& WriteOutput("(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();");
""&
" while ( true )"&
" {"&
// Test if we can access a parent property.
" try"&
" {"&
" var test = window.top.opener.document.domain ;"&
" break ;"&
" }"&
" catch( e ) {}"&
""&
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
" d = d.replace( /.*?(?:\.|$)/, '' ) ;"&
""&
" if ( d.length == 0 )"&
// It was not able to detect the domain.
" break ;"&
""&
" try"&
" {"&
" document.domain = d ;"&
" }"&
" catch (e)"&
" {"&
" break ;"&
" }"&
" }"&
"})() ;");
WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' ); WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' );
WriteOutput('</script>'); WriteOutput('</script>');
} }

View File

@ -265,39 +265,11 @@
<cfargument name="fileName" required="false" type="String" default=""> <cfargument name="fileName" required="false" type="String" default="">
<cfargument name="customMsg" required="false" type="String" default=""> <cfargument name="customMsg" required="false" type="String" default="">
<!--- Minified version of the document.domain automatic fix script (#1919).
The original script can be found at _dev/domain_fix_template.js --->
<cfoutput> <cfoutput>
<script type="text/javascript"> <script type="text/javascript">
(function() (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
{
var d = document.domain ;
while ( true )
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ;
if ( d.length == 0 )
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
window.parent.OnUploadCompleted( #errorNumber#, "#JSStringFormat(fileUrl)#", "#JSStringFormat(fileName)#", "#JSStringFormat(customMsg)#" ); window.parent.OnUploadCompleted( #errorNumber#, "#JSStringFormat(fileUrl)#", "#JSStringFormat(fileName)#", "#JSStringFormat(customMsg)#" );
</script> </script>
</cfoutput> </cfoutput>

View File

@ -74,38 +74,15 @@
-type='string', -type='string',
-description='Sets the HTML response for the FCKEditor Quick Upload feature.' -description='Sets the HTML response for the FCKEditor Quick Upload feature.'
); );
$__html_reply__ = '\
<script type="text/javascript">
(function()
{
var d = document.domain ;
while ( true ) $__html_reply__ = '<script type="text/javascript">';
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... // Minified version of the document.domain automatic fix script (#1919).
d = d.replace( /.*?(?:\\.|$)/, "" ) ; // The original script can be found at _dev/domain_fix_template.js
// Note: in Lasso replace \ with \\
$__html_reply__ = $__html_reply__ + "(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();";
if ( d.length == 0 ) $__html_reply__ = $__html_reply__ + '\
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
window.parent.OnUploadCompleted(' + #errorNumber + ',"' window.parent.OnUploadCompleted(' + #errorNumber + ',"'
+ string_replace(#fileUrl, -find='"', -replace='\\"') + '","' + string_replace(#fileUrl, -find='"', -replace='\\"') + '","'
+ string_replace(#fileName, -find='"', -replace='\\"') + '","' + string_replace(#fileName, -find='"', -replace='\\"') + '","'

View File

@ -169,41 +169,14 @@ sub SendUploadResults
local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_; local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_;
# Minified version of the document.domain automatic fix script (#1919).
# The original script can be found at _dev/domain_fix_template.js
# Note: in Perl replace \ with \\ and $ with \$
print <<EOF; print <<EOF;
Content-type: text/html Content-type: text/html
<script type="text/javascript"> <script type="text/javascript">
// Automatically detect the correct document.domain (#1919). (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|\$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
(function()
{
var d = document.domain ;
while ( true )
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\\.|\$)/, '' ) ;
if ( d.length == 0 )
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
EOF EOF
print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;'; print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;';

View File

@ -28,7 +28,6 @@ global $Config ;
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
// authenticated users can access this file or use some kind of session checking. // authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = false ; $Config['Enabled'] = false ;
function deny_no_egw_session(&$account) function deny_no_egw_session(&$account)
{ {
die('Access denied!'); die('Access denied!');

View File

@ -154,6 +154,8 @@ function GetRootPath()
global $_SERVER; global $_SERVER;
} }
$sRealPath = realpath( './' ) ; $sRealPath = realpath( './' ) ;
// #2124 ensure that no slash is at the end
$sRealPath = rtrim($sRealPath,"\\/");
$sSelfPath = $_SERVER['PHP_SELF'] ; $sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ; $sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
@ -178,6 +180,7 @@ function Server_MapPath( $path )
if ( function_exists( 'apache_lookup_uri' ) ) if ( function_exists( 'apache_lookup_uri' ) )
{ {
$info = apache_lookup_uri( $path ) ; $info = apache_lookup_uri( $path ) ;
// RalfBecker 2008/04/15: remove index.{html|php} added by apache
return str_replace(array('/index.html','/index.php'),'',$info->filename) . $info->path_info ; return str_replace(array('/index.html','/index.php'),'',$info->filename) . $info->path_info ;
} }
@ -277,40 +280,13 @@ function SanitizeFileName( $sNewFileName )
// This is the function that sends the results of the uploading process. // This is the function that sends the results of the uploading process.
function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' ) function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
{ {
// Minified version of the document.domain automatic fix script (#1919).
// The original script can be found at _dev/domain_fix_template.js
echo <<<EOF echo <<<EOF
<script type="text/javascript"> <script type="text/javascript">
(function() (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
{
var d = document.domain ;
while ( true )
{
// Test if we can access a parent property.
try
{
var test = window.top.opener.document.domain ;
break ;
}
catch( e ) {}
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
d = d.replace( /.*?(?:\.|$)/, '' ) ;
if ( d.length == 0 )
break ; // It was not able to detect the domain.
try
{
document.domain = d ;
}
catch (e)
{
break ;
}
}
})() ;
EOF; EOF;
$rpl = array( '\\' => '\\\\', '"' => '\\"' ) ; $rpl = array( '\\' => '\\\\', '"' => '\\"' ) ;
echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ; echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ;
echo '</script>' ; echo '</script>' ;

Some files were not shown because too many files have changed in this diff Show More