1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
2
"http://www.w3.org/TR/html4/frameset.dtd">
4
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
5
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
9
* Licensed under the terms of any of the following licenses at your
12
* - GNU General Public License Version 2 or later (the "GPL")
13
* http://www.gnu.org/licenses/gpl.html
15
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
16
* http://www.gnu.org/licenses/lgpl.html
18
* - Mozilla Public License Version 1.1 or later (the "MPL")
19
* http://www.mozilla.org/MPL/MPL-1.1.html
23
* This page compose the File Browser dialog frameset.
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
// Automatically detect the correct document.domain (#1919).
35
var d = document.domain ;
39
// Test if we can access a parent property.
42
var test = window.opener.document.domain ;
48
// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
49
d = d.replace( /.*?(?:\.|$)/, '' ) ;
52
break ; // It was not able to detect the domain.
65
function GetUrlParam( paramName )
67
var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
68
var oMatch = oRegex.exec( window.top.location.search ) ;
70
if ( oMatch && oMatch.length > 1 )
71
return decodeURIComponent( oMatch[1] ) ;
76
var oConnector = new Object() ;
77
oConnector.CurrentFolder = '/' ;
79
var sConnUrl = GetUrlParam( 'Connector' ) ;
81
// Gecko has some problems when using relative URLs (not starting with slash).
82
if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 )
83
sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ;
85
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
87
var sServerPath = GetUrlParam( 'ServerPath' ) ;
88
if ( sServerPath.length > 0 )
89
oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
91
oConnector.ResourceType = GetUrlParam( 'Type' ) ;
92
oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ;
94
if ( oConnector.ShowAllTypes )
95
oConnector.ResourceType = 'File' ;
97
oConnector.SendCommand = function( command, params, callBackFunction )
99
var sUrl = this.ConnectorUrl + 'Command=' + command ;
100
sUrl += '&Type=' + this.ResourceType ;
101
sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
103
if ( params ) sUrl += '&' + params ;
105
// Add a random salt to avoid getting a cached version of the command execution
106
sUrl += '&uuid=' + new Date().getTime() ;
108
var oXML = new FCKXml() ;
110
if ( callBackFunction )
111
oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load.
113
return oXML.LoadUrl( sUrl ) ;
118
oConnector.CheckError = function( responseXml )
120
var iErrorNumber = 0 ;
121
var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
125
iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
127
switch ( iErrorNumber )
131
case 1 : // Custom error. Message placed in the "text" attribute.
132
alert( oErrorNode.attributes.getNamedItem('text').value ) ;
135
alert( 'Folder already exists' ) ;
138
alert( 'Invalid folder name' ) ;
141
alert( 'You have no permissions to create the folder' ) ;
144
alert( 'Unknown error creating folder' ) ;
147
alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
151
return iErrorNumber ;
154
var oIcons = new Object() ;
156
oIcons.AvailableIconsArray = [
157
'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js',
158
'mdb','mp3','pdf','png','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ;
160
oIcons.AvailableIcons = new Object() ;
162
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
163
oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
165
oIcons.GetIcon = function( fileName )
167
var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
169
if ( this.AvailableIcons[ sExtension ] == true )
172
return 'default.icon' ;
175
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
177
if (errorNumber == "1")
178
window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
180
window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
185
<frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="1">
186
<frameset rows="50,*" framespacing="0">
187
<frame src="frmresourcetype.html" scrolling="no" frameborder="0">
188
<frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="1">
190
<frameset rows="50,*,50" framespacing="0">
191
<frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="0">
192
<frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="1">
193
<frameset cols="150,*,0" framespacing="0" frameborder="0">
194
<frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="0">
195
<frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="0">
196
<frame name="frmUploadWorker" src="javascript:void(0)" scrolling="no" frameborder="0">