Project

General

Profile

1
<!DOCTYPE HTML>
2
<!--
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
5
 *
6
 * == BEGIN LICENSE ==
7
 *
8
 * Licensed under the terms of any of the following licenses at your
9
 * choice:
10
 *
11
 *  - GNU General Public License Version 2 or later (the "GPL")
12
 *    http://www.gnu.org/licenses/gpl.html
13
 *
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
 *    http://www.gnu.org/licenses/lgpl.html
16
 *
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
19
 *
20
 * == END LICENSE ==
21
 *
22
 * This page compose the File Browser dialog frameset.
23
-->
24
<html>
25
    <head>
26
        <title>CKeditor - Resources Browser</title>
27
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
28
        <link href="browser.css" type="text/css" rel="stylesheet">
29
        <script type="text/javascript" src="js/fckxml.js"></script>
30
        <script type="text/javascript">
31
// Automatically detect the correct document.domain (#1919).
32
(function()
33
{
34
    var d = document.domain ;
35
    while ( true )
36
    {
37
        // Test if we can access a parent property.
38
        try
39
        {
40
            var test = window.opener.document.domain ;
41
            break ;
42
        }
43
        catch( e )
44
        {}
45
        // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
46
        d = d.replace( /.*?(?:\.|$)/, '' ) ;
47
        if ( d.length == 0 )
48
            break ;        // It was not able to detect the domain.
49
        try
50
        {
51
            document.domain = d ;
52
        }
53
        catch (e)
54
        {
55
            break ;
56
        }
57
    }
58
})() ;
59

    
60
function GetUrlParam( paramName )
61
{
62
    var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
63
    var oMatch = oRegex.exec( window.top.location.search ) ;
64

    
65
    if ( oMatch && oMatch.length > 1 )
66
        return decodeURIComponent( oMatch[1] ) ;
67
    else
68
        return '' ;
69
}
70

    
71
var oConnector = new Object() ;
72
oConnector.CurrentFolder    = '/' ;
73
var sConnUrl = GetUrlParam( 'Connector' ) ;
74
// Gecko has some problems when using relative URLs (not starting with slash).
75
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
76
    sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
77
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
78
var sServerPath = GetUrlParam( 'ServerPath' ) ;
79
if ( sServerPath.length > 0 ){
80
    oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;}
81
oConnector.ResourceType        = GetUrlParam( 'Type' ) ;
82
oConnector.ShowAllTypes        = ( oConnector.ResourceType.length == 0 ) ;
83
if ( oConnector.ShowAllTypes ){
84
    oConnector.ResourceType = 'File' ;}
85
oConnector.SendCommand = function( command, params, callBackFunction )
86
{
87
    var sUrl = this.ConnectorUrl + 'Command=' + command ;
88
    sUrl += '&Type=' + this.ResourceType ;
89
    sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
90

    
91
    if ( params ) sUrl += '&' + params ;
92

    
93
    // Add a random salt to avoid getting a cached version of the command execution
94
    sUrl += '&uuid=' + new Date().getTime() ;
95

    
96
    var oXML = new FCKXml() ;
97

    
98
    if ( callBackFunction )
99
        oXML.LoadUrl( sUrl, callBackFunction ) ;    // Asynchronous load.
100
    else
101
        return oXML.LoadUrl( sUrl ) ;
102

    
103
    return null ;
104
}
105

    
106
oConnector.CheckError = function( responseXml )
107
{
108
    var iErrorNumber = 0 ;
109
    var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
110

    
111
    if ( oErrorNode )
112
    {
113
        iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
114

    
115
        switch ( iErrorNumber )
116
        {
117
            case 0 :
118
                break ;
119
            case 1 :    // Custom error. Message placed in the "text" attribute.
120
                alert( oErrorNode.attributes.getNamedItem('text').value ) ;
121
                break ;
122
            case 101 :
123
                alert( 'Folder already exists' ) ;
124
                break ;
125
            case 102 :
126
                alert( 'Invalid folder name' ) ;
127
                break ;
128
            case 103 :
129
                alert( 'You have no permissions to create the folder' ) ;
130
                break ;
131
            case 110 :
132
                alert( 'Unknown error creating folder' ) ;
133
                break ;
134
            default :
135
                alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
136
                break ;
137
        }
138
    }
139
    return iErrorNumber ;
140
}
141

    
142
var oIcons = new Object() ;
143

    
144
oIcons.AvailableIconsArray = [
145
    'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
146
    'mdb','mp3','pdf','png','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
147

    
148
oIcons.AvailableIcons = new Object() ;
149

    
150
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
151
    oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
152

    
153
oIcons.GetIcon = function( fileName )
154
{
155
    var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
156

    
157
    if ( this.AvailableIcons[ sExtension ] == true )
158
        return sExtension ;
159
    else
160
        return 'default.icon' ;
161
}
162

    
163
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
164
{
165
    if (errorNumber == "1")
166
        window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
167
    else
168
        window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
169
}
170

    
171
        </script>
172
    </head>
173

    
174
<!--
175
    <body>
176
<div class="frameset Frame">
177
    <div class="frameset Frame">
178
        <iframe src="frmresourceslist.html"></iframe>
179
    </div>
180
</div>
181
    </body>
182
-->
183
    <frameset cols="150,*" class="Frame" >
184
        <frameset rows="25,*">
185
            <frame src="frmresourcetype.html" scrolling="no" frameborder="0">
186
            <frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="0">
187
        </frameset>
188
        <frameset rows="45,*,70">
189
            <frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
190
            <frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="0">
191
            <frameset cols="1050,*,0" >
192
                <frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
193
                <frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
194
                <frame name="frmUploadWorker" src="javascript:void(0)" scrolling="no" frameborder="0">
195
            </frameset>
196
        </frameset>
197
    </frameset>
198

    
199
</html>
(2-2/10)