~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to MoinMoin/web/static/htdocs/applets/FCKeditor/editor/_source/classes/fckxml_ie.js

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
3
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
 
4
 *
 
5
 * == BEGIN LICENSE ==
 
6
 *
 
7
 * Licensed under the terms of any of the following licenses at your
 
8
 * choice:
 
9
 *
 
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 ==
 
20
 *
 
21
 * FCKXml Class: class to load and manipulate XML files.
 
22
 * (IE specific implementation)
 
23
 */
 
24
 
 
25
FCKXml.prototype =
 
26
{
 
27
        LoadUrl : function( urlToCall )
 
28
        {
 
29
                this.Error = false ;
 
30
 
 
31
                var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
 
32
 
 
33
                if ( !oXmlHttp )
 
34
                {
 
35
                        this.Error = true ;
 
36
                        return ;
 
37
                }
 
38
 
 
39
                oXmlHttp.open( "GET", urlToCall, false ) ;
 
40
 
 
41
                oXmlHttp.send( null ) ;
 
42
 
 
43
                if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
 
44
                {
 
45
                        this.DOMDocument = oXmlHttp.responseXML ;
 
46
 
 
47
                        // #1426: Fallback if responseXML isn't set for some
 
48
                        // reason (e.g. improperly configured web server)
 
49
                        if ( !this.DOMDocument || this.DOMDocument.firstChild == null )
 
50
                        {
 
51
                                this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
 
52
                                this.DOMDocument.async = false ;
 
53
                                this.DOMDocument.resolveExternals = false ;
 
54
                                this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
 
55
                        }
 
56
                }
 
57
                else
 
58
                {
 
59
                        this.DOMDocument = null ;
 
60
                }
 
61
 
 
62
                if ( this.DOMDocument == null || this.DOMDocument.firstChild == null )
 
63
                {
 
64
                        this.Error = true ;
 
65
                        if (window.confirm( 'Error loading "' + urlToCall + '"\r\nDo you want to see more info?' ) )
 
66
                                alert( 'URL requested: "' + urlToCall + '"\r\n' +
 
67
                                                        'Server response:\r\nStatus: ' + oXmlHttp.status + '\r\n' +
 
68
                                                        'Response text:\r\n' + oXmlHttp.responseText ) ;
 
69
                }
 
70
        },
 
71
 
 
72
        SelectNodes : function( xpath, contextNode )
 
73
        {
 
74
                if ( this.Error )
 
75
                        return new Array() ;
 
76
 
 
77
                if ( contextNode )
 
78
                        return contextNode.selectNodes( xpath ) ;
 
79
                else
 
80
                        return this.DOMDocument.selectNodes( xpath ) ;
 
81
        },
 
82
 
 
83
        SelectSingleNode : function( xpath, contextNode )
 
84
        {
 
85
                if ( this.Error )
 
86
                        return null ;
 
87
 
 
88
                if ( contextNode )
 
89
                        return contextNode.selectSingleNode( xpath ) ;
 
90
                else
 
91
                        return this.DOMDocument.selectSingleNode( xpath ) ;
 
92
        }
 
93
} ;