diff options
| author | mark <mark> | 2010-03-16 07:49:38 +0000 |
|---|---|---|
| committer | mark <mark> | 2010-03-16 07:49:38 +0000 |
| commit | 7a7bcda9d75c951df9c911ce60d5b0551765daf2 (patch) | |
| tree | 6d3688ce272ee837653c00eda64c5691a4932e1f /httemplate/elements/fckeditor/editor/filemanager/browser/default | |
| parent | c86fe9ea75d23d3d0c3536b709ac1e086f15a5de (diff) | |
FCKeditor 2.6.6
Diffstat (limited to 'httemplate/elements/fckeditor/editor/filemanager/browser/default')
10 files changed, 213 insertions, 71 deletions
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css index ba464ba2c..8325a88d8 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.css @@ -1,6 +1,6 @@ /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -24,28 +24,26 @@ body
{
background-color: #f1f1e3;
+ margin-top:0;
+ margin-bottom:0;
}
form
{
- margin: 0px 0px 0px 0px ;
- padding: 0px 0px 0px 0px ;
+ margin: 0;
+ padding: 0;
}
.Frame
{
background-color: #f1f1e3;
- border-color: #f1f1e3;
- border-right: thin inset;
- border-top: thin inset;
- border-left: thin inset;
- border-bottom: thin inset;
+ border: thin inset #f1f1e3;
}
body.FileArea
{
-
background-color: #ffffff;
+ margin: 10px;
}
body, td, input, select
@@ -69,11 +67,8 @@ body, td, input, select .Button, button
{
- border-right: #737357 1px solid;
- border-top: #737357 1px solid;
- border-left: #737357 1px solid;
color: #3b3b1f;
- border-bottom: #737357 1px solid;
+ border: #737357 1px solid;
background-color: #c7c78f;
}
@@ -85,4 +80,8 @@ body, td, input, select .FolderListFolder img
{
background-image: url(images/Folder.gif);
-}
\ No newline at end of file +}
+
+.fullHeight {
+ height: 100%;
+}
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html index 8b776a281..d5e773b05 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/browser.html @@ -1,7 +1,8 @@ -<!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
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -24,9 +25,42 @@ <html>
<head>
<title>FCKeditor - Resources Browser</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/fckxml.js"></script>
- <script language="javascript">
+ <script type="text/javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+ var d = document.domain ;
+
+ while ( true )
+ {
+ // Test if we can access a parent property.
+ try
+ {
+ var test = window.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 ;
+ }
+ }
+})() ;
function GetUrlParam( paramName )
{
@@ -68,6 +102,9 @@ oConnector.SendCommand = function( command, params, callBackFunction ) if ( params ) sUrl += '&' + params ;
+ // Add a random salt to avoid getting a cached version of the command execution
+ sUrl += '&uuid=' + new Date().getTime() ;
+
var oXML = new FCKXml() ;
if ( callBackFunction )
@@ -134,6 +171,15 @@ oIcons.GetIcon = function( fileName ) else
return 'default.icon' ;
}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+ if (errorNumber == "1")
+ window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
+ else
+ window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
+}
+
</script>
</head>
<frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html index 90653d6ed..dc1f517a6 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmactualfolder.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -23,14 +23,42 @@ -->
<html>
<head>
+ <title>Folder path</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
-
-function OnResize()
+// Automatically detect the correct document.domain (#1919).
+(function()
{
- divName.style.width = "1px" ;
- divName.style.width = tdName.offsetWidth + "px" ;
-}
+ 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 ;
+ }
+ }
+})() ;
function SetCurrentFolder( resourceType, folderPath )
{
@@ -44,8 +72,8 @@ window.onload = function() </script>
</head>
- <body bottomMargin="0" topMargin="0">
- <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<button style="WIDTH: 100%" type="button">
@@ -55,7 +83,7 @@ window.onload = function() <td> </td>
<td id="tdName" width="100%" nowrap class="ActualFolder">/</td>
<td> </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> </td>
</tr>
</table>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html index 8f72ff564..390eb49bc 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -23,10 +23,11 @@ -->
<html>
<head>
+ <title>Create Folder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script>
- <script language="javascript">
+ <script type="text/javascript">
function SetCurrentFolder( resourceType, folderPath )
{
@@ -93,8 +94,8 @@ window.onload = function() }
</script>
</head>
- <body bottomMargin="0" topMargin="0">
- <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td>
<button type="button" style="WIDTH: 100%" onclick="CreateFolder();">
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html index 2dc0eb0dd..d4b3b3d39 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmfolders.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -24,9 +24,11 @@ -->
<html>
<head>
+ <title>Folders</title>
<link href="browser.css" type="text/css" rel="stylesheet">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/common.js"></script>
- <script language="javascript">
+ <script type="text/javascript">
var sActiveFolder ;
@@ -65,12 +67,12 @@ oListManager.AddItem = function( folderName, folderPath ) // Add the folder icon cell.
var oCell = oRow.insertCell(-1) ;
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.
oCell = oRow.insertCell(-1) ;
oCell.noWrap = true ;
- oCell.innerHTML = ' ' + sLink + folderName + '</a>' ;
+ oCell.innerHTML = ' ' + sLink + folderName + '<\/a>' ;
this.TableRows[ folderPath ] = oRow ;
}
@@ -166,7 +168,7 @@ function GetFoldersCallBack( fckXml ) for ( var i = 0 ; i < oNodes.length ; i++ )
{
var sFolderName = oNodes[i].attributes.getNamedItem('name').value ;
- oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + "/" ) ;
+ oListManager.AddItem( sFolderName, sCurrentFolderPath + sFolderName + '/' ) ;
}
OpenFolder( sActiveFolder ) ;
@@ -185,7 +187,7 @@ window.onload = function() }
</script>
</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">
<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>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html index 3f041f78d..3e2771d09 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourceslist.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -21,9 +21,11 @@ *
* This page shows all resources available in a folder in the File Browser.
-->
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html>
<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">
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
@@ -34,26 +36,33 @@ oListManager.Clear = function() document.body.innerHTML = '' ;
}
+function ProtectPath(path)
+{
+ path = path.replace( /\\/g, '\\\\') ;
+ path = path.replace( /'/g, '\\\'') ;
+ return path ;
+}
+
oListManager.GetFolderRowHtml = function( folderName, folderPath )
{
// Build the link to view the folder.
- var sLink = '<a href="#" onclick="OpenFolder(\'' + folderPath.replace( /'/g, '\\\'') + '\');return false;">' ;
+ var sLink = '<a href="#" onclick="OpenFolder(\'' + ProtectPath( folderPath ) + '\');return false;">' ;
return '<tr>' +
'<td width="16">' +
sLink +
- '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"></a>' +
- '</td><td nowrap colspan="2"> ' +
+ '<img alt="" src="images/Folder.gif" width="16" height="16" border="0"><\/a>' +
+ '<\/td><td nowrap colspan="2"> ' +
sLink +
folderName +
- '</a>' +
- '</td></tr>' ;
+ '<\/a>' +
+ '<\/td><\/tr>' ;
}
oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
// Build the link to view the folder.
- var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;
+ var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;
// Get the file icon.
var sIcon = oIcons.GetIcon( fileName ) ;
@@ -61,15 +70,15 @@ oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize ) return '<tr>' +
'<td width="16">' +
sLink +
- '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
- '</td><td> ' +
+ '<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"><\/a>' +
+ '<\/td><td> ' +
sLink +
fileName +
- '</a>' +
- '</td><td align="right" nowrap> ' +
+ '<\/a>' +
+ '<\/td><td align="right" nowrap> ' +
fileSize +
' KB' +
- '</td></tr>' ;
+ '<\/td><\/tr>' ;
}
function OpenFolder( folderPath )
@@ -80,7 +89,7 @@ function OpenFolder( folderPath ) function OpenFile( fileUrl )
{
- window.top.opener.SetUrl( encodeURI( fileUrl ) ) ;
+ window.top.opener.SetUrl( fileUrl ) ;
window.top.close() ;
window.top.opener.focus() ;
}
@@ -136,7 +145,7 @@ function GetFoldersAndFilesCallBack( fckXml ) // Get the optional "url" attribute. If not available, build the url.
var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ;
- var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ;
+ var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : encodeURI( sCurrentFolderUrl + sFileName ).replace( /#/g, '%23' ) ;
oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ;
}
@@ -155,6 +164,6 @@ window.onload = function() }
</script>
</head>
-<body class="FileArea" bottommargin="10" leftmargin="10" topmargin="10" rightmargin="10">
+<body class="FileArea">
</body>
</html>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html index 933e85550..e918f9fb4 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmresourcetype.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -23,10 +23,11 @@ -->
<html>
<head>
+ <title>Available types</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="browser.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/common.js"></script>
- <script language="javascript">
+ <script type="text/javascript">
function SetResourceType( type )
{
@@ -42,21 +43,24 @@ var aTypes = [ window.onload = function()
{
+ var oCombo = document.getElementById('cmbType') ;
+ oCombo.innerHTML = '' ;
for ( var i = 0 ; i < aTypes.length ; i++ )
{
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>
</head>
- <body bottomMargin="0" topMargin="0">
- <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
+ <body>
+ <table class="fullHeight" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap>
Resource Type<BR>
<select id="cmbType" style="WIDTH: 100%" onchange="SetResourceType(this.value);">
+ <option>
</select>
</td>
</tr>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html index b84882dcd..e840c0a9e 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/frmupload.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -21,9 +21,11 @@ *
* Page used to upload new files in the current folder.
-->
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html>
<head>
- <link href="browser.css" type="text/css" rel="stylesheet" />
+ <title>File Upload</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link href="browser.css" type="text/css" rel="stylesheet" >
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
@@ -56,7 +58,7 @@ function OnUploadCompleted( errorNumber, data ) // Reset the Upload Worker Frame.
window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
- // Reset the upload form (On IE we must do a little trick to avout problems).
+ // Reset the upload form (On IE we must do a little trick to avoid problems).
if ( document.all )
document.getElementById('NewFile').outerHTML = '<input id="NewFile" name="NewFile" style="WIDTH: 100%" type="file">' ;
else
@@ -93,9 +95,9 @@ window.onload = function() }
</script>
</head>
- <body bottommargin="0" topmargin="0">
+ <body>
<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>
<td nowrap="nowrap">
<span id="eUploadMessage">Upload a new file in this folder</span><br>
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js index 2f472171b..98c4b9070 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/common.js @@ -1,6 +1,6 @@ /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -22,6 +22,39 @@ * File Browser dialog window.
*/
+// Automatically detect the correct document.domain (#1919).
+(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 ;
+ }
+ }
+})() ;
+
function AddSelectOption( selectElement, optionText, optionValue )
{
var oOption = document.createElement("OPTION") ;
@@ -52,4 +85,4 @@ StringBuilder.prototype.Append = function( value ) StringBuilder.prototype.ToString = function()
{
return this._Strings.join( '' ) ;
-}
\ No newline at end of file +}
diff --git a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js index 043ca84f5..b7eddc601 100644 --- a/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js +++ b/httemplate/elements/fckeditor/editor/filemanager/browser/default/js/fckxml.js @@ -1,6 +1,6 @@ /*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -31,8 +31,8 @@ var FCKXml = function() FCKXml.prototype.GetHttpRequest = function()
{
// Gecko / IE7
- if ( typeof(XMLHttpRequest) != 'undefined' )
- return new XMLHttpRequest() ;
+ try { return new XMLHttpRequest(); }
+ catch(e) {}
// IE6
try { return new ActiveXObject( 'Msxml2.XMLHTTP' ) ; }
@@ -61,7 +61,25 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer ) {
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' +
'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
@@ -70,7 +88,7 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer ) return ;
}
- oFCKXml.DOMDocument = oXmlHttp.responseXML ;
+ oFCKXml.DOMDocument = oXml ;
asyncFunctionPointer( oFCKXml ) ;
}
}
|
