~ubuntu-branches/ubuntu/gutsy/moin/gutsy

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/_source/internals/fckscriptloader.js

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-02-14 16:09:24 UTC
  • mfrom: (0.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20060214160924-fyrx3gvknzqvt4vj
Tags: 1.5.2-1ubuntu1
Drop python2.3 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        }
66
66
}
67
67
 
68
 
if ( FCKBrowserInfo.IsSafari )
 
68
FCKScriptLoader.LoadFile = function( filePath ) 
69
69
{
70
 
        FCKScriptLoader.LoadFile = function( filePath ) 
71
 
        {
72
 
                if ( filePath.lastIndexOf( '.css' ) > 0 )
73
 
                {
74
 
                        this.CheckQueue() ;
75
 
                        return ;
76
 
                }
77
 
                
78
 
                var oXmlRequest = new XMLHttpRequest() ;
79
 
                
80
 
                // Load the script synchronously.
81
 
                oXmlRequest.open( "GET", filePath, false ) ;
82
 
                oXmlRequest.send( null ) ;
83
 
                
84
 
                // Evaluate the script.
85
 
                if ( oXmlRequest.status == 200 )
86
 
                {
87
 
                        try
88
 
                        {
89
 
                                eval( oXmlRequest.responseText ) ;
90
 
                        }
91
 
                        catch ( e )
92
 
                        {
93
 
                                alert( 'Error parsing ' + filePath + ': ' + e.message ) ;
94
 
                        }
95
 
                }
 
70
        //window.status = ( 'Loading ' + filePath + '...' ) ;
 
71
 
 
72
        // Dynamically load the file (it can be a CSS or a JS)
 
73
        var e ;
 
74
        
 
75
        // If it is a CSS
 
76
        if ( filePath.lastIndexOf( '.css' ) > 0 )
 
77
        {
 
78
                e = document.createElement( 'LINK' ) ;
 
79
                e.rel   = 'stylesheet' ;
 
80
                e.type  = 'text/css' ;
 
81
        }
 
82
        // It it is a JS
 
83
        else
 
84
        {
 
85
                e = document.createElement( "script" ) ;
 
86
                        e.type  = "text/javascript" ;
 
87
        }
 
88
        
 
89
        // Add the new object to the HEAD.
 
90
        document.getElementsByTagName("head")[0].appendChild( e ) ; 
 
91
 
 
92
        // Start downloading it.
 
93
        if ( e.tagName == 'LINK' )
 
94
        {
 
95
                // IE must wait for the file to be downloaded.
 
96
                if ( FCKBrowserInfo.IsIE )
 
97
                        e.onload = FCKScriptLoader_OnLoad ;
 
98
                // Gecko doens't fire any event when the CSS is loaded, so we 
 
99
                // can't wait for it.
96
100
                else
97
 
                        alert( 'Error loading ' + filePath ) ;
 
101
                        FCKScriptLoader.CheckQueue() ;
98
102
                        
99
 
                this.CheckQueue() ;
 
103
                e.href = filePath ;
 
104
        }
 
105
        else
 
106
        {
 
107
                // Gecko fires the "onload" event and IE fires "onreadystatechange"
 
108
                e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ;
 
109
                e.src = filePath ;
100
110
        }
101
111
}
102
 
else
 
112
 
 
113
function FCKScriptLoader_OnLoad()
103
114
{
104
 
        FCKScriptLoader.LoadFile = function( filePath ) 
105
 
        {
106
 
                //window.status = ( 'Loading ' + filePath + '...' ) ;
107
 
 
108
 
                // Dynamically load the file (it can be a CSS or a JS)
109
 
                var e ;
110
 
                
111
 
                // If is a CSS
112
 
                if ( filePath.lastIndexOf( '.css' ) > 0 )
113
 
                {
114
 
                        e = document.createElement( 'LINK' ) ;
115
 
                        e.rel   = 'stylesheet' ;
116
 
                        e.type  = 'text/css' ;
117
 
                }
118
 
                // It is a JS
119
 
                else
120
 
                {
121
 
                        e = document.createElement( "script" ) ;
122
 
                                e.type  = "text/javascript" ;
123
 
                }
124
 
                
125
 
                // Add the new object to the HEAD.
126
 
                document.getElementsByTagName("head")[0].appendChild( e ) ; 
127
 
 
128
 
                // Start downloading it.
129
 
                if ( e.tagName == 'LINK' )
130
 
                {
131
 
                        // IE must wait for the file to be downloaded.
132
 
                        if ( FCKBrowserInfo.IsIE )
133
 
                                e.onload = FCKScriptLoader_OnLoad ;
134
 
                        // Gecko doens't fire any event when the CSS is loaded, so we 
135
 
                        // can't wait for it.
136
 
                        else
137
 
                                FCKScriptLoader.CheckQueue() ;
138
 
                                
139
 
                        e.href = filePath ;
140
 
                }
141
 
                else
142
 
                {
143
 
                        // Gecko fires the "onload" event and IE fires "onreadystatechange"
144
 
                        e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ;
145
 
                        e.src = filePath ;
146
 
                }
147
 
        }
148
 
 
149
 
        function FCKScriptLoader_OnLoad()
150
 
        {
151
 
                // Gecko doesn't have a "readyState" property
152
 
                if ( this.tagName == 'LINK' || !this.readyState || this.readyState == 'loaded' )
153
 
                        // Load the next script available in the queue
154
 
                        FCKScriptLoader.CheckQueue() ;
155
 
        }
 
115
        // Gecko doesn't have a "readyState" property
 
116
        if ( this.tagName == 'LINK' || !this.readyState || this.readyState == 'loaded' )
 
117
                // Load the next script available in the queue
 
118
                FCKScriptLoader.CheckQueue() ;
156
119
}
 
 
b'\\ No newline at end of file'