Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 1... Line 1...
1
/*
1
/*
2
 * FCKeditor - The text editor for internet
2
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
3
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
4
 * 
4
 *
5
 * Licensed under the terms of the GNU Lesser General Public License:
5
 * == BEGIN LICENSE ==
6
 * 		http://www.opensource.org/licenses/lgpl-license.php
-
 
7
 * 
6
 *
8
 * For further information visit:
7
 * Licensed under the terms of any of the following licenses at your
9
 * 		http://www.fckeditor.net/
8
 * choice:
10
 * 
9
 *
11
 * "Support Open Source software. What about a donation today?"
10
 *  - GNU General Public License Version 2 or later (the "GPL")
-
 
11
 *    http://www.gnu.org/licenses/gpl.html
-
 
12
 *
-
 
13
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
-
 
14
 *    http://www.gnu.org/licenses/lgpl.html
-
 
15
 *
-
 
16
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
-
 
17
 *    http://www.mozilla.org/MPL/MPL-1.1.html
-
 
18
 *
-
 
19
 * == END LICENSE ==
12
 * 
20
 *
13
 * File Name: fckxml.js
-
 
14
 * 	Defines the FCKXml object that is used for XML data calls
21
 * Defines the FCKXml object that is used for XML data calls
15
 * 	and XML processing.
22
 * and XML processing.
-
 
23
 *
16
 * 	This script is shared by almost all pages that compose the 
24
 * This script is shared by almost all pages that compose the
17
 * 	File Browser frameset.
25
 * File Browser frameset.
18
 * 
-
 
19
 * File Authors:
-
 
20
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
-
 
21
 */
26
 */
Line 22... Line 27...
22
 
27
 
23
var FCKXml = function()
28
var FCKXml = function()
Line 24... Line 29...
24
{}
29
{}
25
 
30
 
26
FCKXml.prototype.GetHttpRequest = function()
31
FCKXml.prototype.GetHttpRequest = function()
27
{
-
 
28
	// Gecko / IE7
32
{
-
 
33
	// Gecko / IE7
Line 29... Line 34...
29
	if ( typeof(XMLHttpRequest) != 'undefined' )
34
	try { return new XMLHttpRequest(); }
30
		return new XMLHttpRequest() ;
35
	catch(e) {}
31
 
36
 
Line 32... Line 37...
32
	// IE6
37
	// IE6
33
	try { return new ActiveXObject("Msxml2.XMLHTTP") ; } 
38
	try { return new ActiveXObject( 'Msxml2.XMLHTTP' ) ; }
34
	catch(e) {}
39
	catch(e) {}
-
 
40
 
-
 
41
	// IE5
35
 
42
	try { return new ActiveXObject( 'Microsoft.XMLHTTP' ) ; }
Line 36... Line 43...
36
	// IE5
43
	catch(e) {}
37
	try { return new ActiveXObject("Microsoft.XMLHTTP") ; }
44
 
38
	catch(e) {}
45
	return null ;
Line 52... Line 59...
52
	{	
59
	{
53
		oXmlHttp.onreadystatechange = function() 
60
		oXmlHttp.onreadystatechange = function()
54
		{
61
		{
55
			if ( oXmlHttp.readyState == 4 )
62
			if ( oXmlHttp.readyState == 4 )
56
			{
63
			{
-
 
64
				var oXml ;
-
 
65
				try
-
 
66
				{
-
 
67
					// this is the same test for an FF2 bug as in fckxml_gecko.js
-
 
68
					// but we've moved the responseXML assignment into the try{}
-
 
69
					// so we don't even have to check the return status codes.
-
 
70
					var test = oXmlHttp.responseXML.firstChild ;
57
				oFCKXml.DOMDocument = oXmlHttp.responseXML ;
71
					oXml = oXmlHttp.responseXML ;
-
 
72
				}
-
 
73
				catch ( e )
-
 
74
				{
-
 
75
					try
-
 
76
					{
-
 
77
						oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
-
 
78
					}
-
 
79
					catch ( e ) {}
-
 
80
				}
-
 
81
 
-
 
82
				if ( !oXml || !oXml.firstChild || oXml.firstChild.nodeName == 'parsererror' )
-
 
83
				{
-
 
84
					alert( 'The server didn\'t send back a proper XML response. Please contact your system administrator.\n\n' +
58
				if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
85
							'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')\n\n' +
-
 
86
							'Requested URL:\n' + urlToCall + '\n\n' +
-
 
87
							'Response text:\n' + oXmlHttp.responseText ) ;
-
 
88
					return ;
-
 
89
				}
-
 
90
 
-
 
91
				oFCKXml.DOMDocument = oXml ;
59
					asyncFunctionPointer( oFCKXml ) ;
92
				asyncFunctionPointer( oFCKXml ) ;
60
				else
-
 
61
					alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ;
-
 
62
			}
93
			}
63
		}
94
		}
64
	}
95
	}
Line 65... Line 96...
65
	
96