Project

General

Profile

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<!--
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2008 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>FCKeditor - 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 language="javascript">
31
// Automatically detect the correct document.domain (#1919).
32
(function()
33
{
34
	var d = document.domain ;
35

    
36
	while ( true )
37
	{
38
		// Test if we can access a parent property.
39
		try
40
		{
41
			var test = window.opener.document.domain ;
42
			break ;
43
		}
44
		catch( e ) {}
45

    
46
		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
47
		d = d.replace( /.*?(?:\.|$)/, '' ) ;
48

    
49
		if ( d.length == 0 )
50
			break ;		// It was not able to detect the domain.
51

    
52
		try
53
		{
54
			document.domain = d ;
55
		}
56
		catch (e)
57
		{
58
			break ;
59
		}
60
	}
61
})() ;
62

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

    
68
	if ( oMatch && oMatch.length > 1 )
69
		return decodeURIComponent( oMatch[1] ) ;
70
	else
71
		return '' ;
72
}
73

    
74
var oConnector = new Object() ;
75
oConnector.CurrentFolder	= '/' ;
76

    
77
var sConnUrl = GetUrlParam( 'Connector' ) ;
78

    
79
// Gecko has some problems when using relative URLs (not starting with slash).
80
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
81
	sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
82

    
83
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
84

    
85
var sServerPath = GetUrlParam( 'ServerPath' ) ;
86
if ( sServerPath.length > 0 )
87
	oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
88

    
89
oConnector.ResourceType		= GetUrlParam( 'Type' ) ;
90
oConnector.ShowAllTypes		= ( oConnector.ResourceType.length == 0 ) ;
91

    
92
if ( oConnector.ShowAllTypes )
93
	oConnector.ResourceType = 'File' ;
94

    
95
oConnector.SendCommand = function( command, params, callBackFunction )
96
{
97
	var sUrl = this.ConnectorUrl + 'Command=' + command ;
98
	sUrl += '&Type=' + this.ResourceType ;
99
	sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
100

    
101
	if ( params ) sUrl += '&' + params ;
102

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

    
106
	var oXML = new FCKXml() ;
107

    
108
	if ( callBackFunction )
109
		oXML.LoadUrl( sUrl, callBackFunction ) ;	// Asynchronous load.
110
	else
111
		return oXML.LoadUrl( sUrl ) ;
112

    
113
	return null ;
114
}
115

    
116
oConnector.CheckError = function( responseXml )
117
{
118
	var iErrorNumber = 0 ;
119
	var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
120

    
121
	if ( oErrorNode )
122
	{
123
		iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
124

    
125
		switch ( iErrorNumber )
126
		{
127
			case 0 :
128
				break ;
129
			case 1 :	// Custom error. Message placed in the "text" attribute.
130
				alert( oErrorNode.attributes.getNamedItem('text').value ) ;
131
				break ;
132
			case 101 :
133
				alert( 'Folder already exists' ) ;
134
				break ;
135
			case 102 :
136
				alert( 'Invalid folder name' ) ;
137
				break ;
138
			case 103 :
139
				alert( 'You have no permissions to create the folder' ) ;
140
				break ;
141
			case 110 :
142
				alert( 'Unknown error creating folder' ) ;
143
				break ;
144
			default :
145
				alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
146
				break ;
147
		}
148
	}
149
	return iErrorNumber ;
150
}
151

    
152
var oIcons = new Object() ;
153

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

    
158
oIcons.AvailableIcons = new Object() ;
159

    
160
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
161
	oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
162

    
163
oIcons.GetIcon = function( fileName )
164
{
165
	var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
166

    
167
	if ( this.AvailableIcons[ sExtension ] == true )
168
		return sExtension ;
169
	else
170
		return 'default.icon' ;
171
}
172

    
173
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
174
{
175
	if (errorNumber == "1")
176
		window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
177
	else
178
		window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
179
}
180

    
181
		</script>
182
	</head>
183
	<frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
184
		<frameset rows="50,*" framespacing="0">
185
			<frame src="frmresourcetype.html" scrolling="no" frameborder="0">
186
			<frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
187
		</frameset>
188
		<frameset rows="50,*,50" framespacing="0">
189
			<frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
190
			<frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
191
			<frameset cols="150,*,0" framespacing="0" frameborder="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
</html>
(2-2/10)