1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
|
2
|
"http://www.w3.org/TR/html4/frameset.dtd">
|
3
|
<!--
|
4
|
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
5
|
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
|
6
|
*
|
7
|
* == BEGIN LICENSE ==
|
8
|
*
|
9
|
* Licensed under the terms of any of the following licenses at your
|
10
|
* choice:
|
11
|
*
|
12
|
* - GNU General Public License Version 2 or later (the "GPL")
|
13
|
* http://www.gnu.org/licenses/gpl.html
|
14
|
*
|
15
|
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
16
|
* http://www.gnu.org/licenses/lgpl.html
|
17
|
*
|
18
|
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
19
|
* http://www.mozilla.org/MPL/MPL-1.1.html
|
20
|
*
|
21
|
* == END LICENSE ==
|
22
|
*
|
23
|
* This page compose the File Browser dialog frameset.
|
24
|
-->
|
25
|
<html>
|
26
|
<head>
|
27
|
<title>FCKeditor - Resources Browser</title>
|
28
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
29
|
<link href="browser.css" type="text/css" rel="stylesheet">
|
30
|
<script type="text/javascript" src="js/fckxml.js"></script>
|
31
|
<script type="text/javascript">
|
32
|
/*
|
33
|
engine = null;
|
34
|
if (window.navigator.appName == "Microsoft Internet Explorer")
|
35
|
{
|
36
|
// This is an IE browser. What mode is the engine in?
|
37
|
if (document.documentMode) // IE8
|
38
|
engine = document.documentMode;
|
39
|
else // IE 5-7
|
40
|
{
|
41
|
engine = 5; // Assume quirks mode unless proven otherwise
|
42
|
if (document.compatMode)
|
43
|
{
|
44
|
if (document.compatMode == "CSS1Compat")
|
45
|
engine = 7; // standards mode
|
46
|
}
|
47
|
}
|
48
|
// the engine variable now contains the document compatibility mode.
|
49
|
}
|
50
|
*/
|
51
|
// Automatically detect the correct document.domain (#1919).
|
52
|
(function()
|
53
|
{
|
54
|
var d = document.domain ;
|
55
|
|
56
|
while ( true )
|
57
|
{
|
58
|
// Test if we can access a parent property.
|
59
|
try
|
60
|
{
|
61
|
var test = window.opener.document.domain ;
|
62
|
break ;
|
63
|
}
|
64
|
catch( e )
|
65
|
{}
|
66
|
|
67
|
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
|
68
|
d = d.replace( /.*?(?:\.|$)/, '' ) ;
|
69
|
|
70
|
if ( d.length == 0 )
|
71
|
break ; // It was not able to detect the domain.
|
72
|
|
73
|
try
|
74
|
{
|
75
|
document.domain = d ;
|
76
|
}
|
77
|
catch (e)
|
78
|
{
|
79
|
break ;
|
80
|
}
|
81
|
}
|
82
|
})() ;
|
83
|
|
84
|
function GetUrlParam( paramName )
|
85
|
{
|
86
|
var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
|
87
|
var oMatch = oRegex.exec( window.top.location.search ) ;
|
88
|
|
89
|
if ( oMatch && oMatch.length > 1 )
|
90
|
return decodeURIComponent( oMatch[1] ) ;
|
91
|
else
|
92
|
return '' ;
|
93
|
}
|
94
|
|
95
|
var oConnector = new Object() ;
|
96
|
oConnector.CurrentFolder = '/' ;
|
97
|
|
98
|
var sConnUrl = GetUrlParam( 'Connector' ) ;
|
99
|
|
100
|
// Gecko has some problems when using relative URLs (not starting with slash).
|
101
|
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
|
102
|
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
|
103
|
|
104
|
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
|
105
|
|
106
|
var sServerPath = GetUrlParam( 'ServerPath' ) ;
|
107
|
if ( sServerPath.length > 0 )
|
108
|
oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
|
109
|
|
110
|
oConnector.ResourceType = GetUrlParam( 'Type' ) ;
|
111
|
oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;
|
112
|
|
113
|
if ( oConnector.ShowAllTypes )
|
114
|
oConnector.ResourceType = 'File' ;
|
115
|
|
116
|
oConnector.SendCommand = function( command, params, callBackFunction )
|
117
|
{
|
118
|
var sUrl = this.ConnectorUrl + 'Command=' + command ;
|
119
|
sUrl += '&Type=' + this.ResourceType ;
|
120
|
sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
|
121
|
|
122
|
if ( params ) sUrl += '&' + params ;
|
123
|
|
124
|
// Add a random salt to avoid getting a cached version of the command execution
|
125
|
sUrl += '&uuid=' + new Date().getTime() ;
|
126
|
|
127
|
var oXML = new FCKXml() ;
|
128
|
|
129
|
if ( callBackFunction )
|
130
|
oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
|
131
|
else
|
132
|
return oXML.LoadUrl( sUrl ) ;
|
133
|
|
134
|
return null ;
|
135
|
}
|
136
|
|
137
|
oConnector.CheckError = function( responseXml )
|
138
|
{
|
139
|
var iErrorNumber = 0 ;
|
140
|
var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
|
141
|
|
142
|
if ( oErrorNode )
|
143
|
{
|
144
|
iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
|
145
|
|
146
|
switch ( iErrorNumber )
|
147
|
{
|
148
|
case 0 :
|
149
|
break ;
|
150
|
case 1 : // Custom error. Message placed in the "text" attribute.
|
151
|
alert( oErrorNode.attributes.getNamedItem('text').value ) ;
|
152
|
break ;
|
153
|
case 101 :
|
154
|
alert( 'Folder already exists' ) ;
|
155
|
break ;
|
156
|
case 102 :
|
157
|
alert( 'Invalid folder name' ) ;
|
158
|
break ;
|
159
|
case 103 :
|
160
|
alert( 'You have no permissions to create the folder' ) ;
|
161
|
break ;
|
162
|
case 110 :
|
163
|
alert( 'Unknown error creating folder' ) ;
|
164
|
break ;
|
165
|
default :
|
166
|
alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
|
167
|
break ;
|
168
|
}
|
169
|
}
|
170
|
return iErrorNumber ;
|
171
|
}
|
172
|
|
173
|
var oIcons = new Object() ;
|
174
|
|
175
|
oIcons.AvailableIconsArray = [
|
176
|
'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
|
177
|
'mdb','mp3','pdf','png','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
|
178
|
|
179
|
oIcons.AvailableIcons = new Object() ;
|
180
|
|
181
|
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
|
182
|
oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
|
183
|
|
184
|
oIcons.GetIcon = function( fileName )
|
185
|
{
|
186
|
var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
|
187
|
|
188
|
if ( this.AvailableIcons[ sExtension ] == true )
|
189
|
return sExtension ;
|
190
|
else
|
191
|
return 'default.icon' ;
|
192
|
}
|
193
|
|
194
|
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
|
195
|
{
|
196
|
if (errorNumber == "1")
|
197
|
window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
|
198
|
else
|
199
|
window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
|
200
|
}
|
201
|
|
202
|
</script>
|
203
|
</head>
|
204
|
<frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
|
205
|
<frameset rows="50,*" framespacing="0">
|
206
|
<frame src="frmresourcetype.html" scrolling="no" frameborder="0">
|
207
|
<frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
|
208
|
</frameset>
|
209
|
<frameset rows="50,*,50" framespacing="0">
|
210
|
<frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
|
211
|
<frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
|
212
|
<frameset cols="150,*,0" framespacing="0" frameborder="0">
|
213
|
<frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
|
214
|
<frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
|
215
|
<frame name="frmUploadWorker" src="javascript:void(0)" scrolling="no" frameborder="0">
|
216
|
</frameset>
|
217
|
</frameset>
|
218
|
</frameset>
|
219
|
</html>
|