2
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
7
* Licensed under the terms of any of the following licenses at your
10
* - GNU General Public License Version 2 or later (the "GPL")
11
* http://www.gnu.org/licenses/gpl.html
13
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
* http://www.gnu.org/licenses/lgpl.html
16
* - Mozilla Public License Version 1.1 or later (the "MPL")
17
* http://www.mozilla.org/MPL/MPL-1.1.html
21
* Test page for the File Browser connectors.
23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
24
<html xmlns="http://www.w3.org/1999/xhtml">
26
<title>FCKeditor - Connectors Tests</title>
27
<script type="text/javascript">
29
function BuildBaseUrl( command )
32
document.getElementById('cmbConnector').value +
33
'?Command=' + command +
34
'&Type=' + document.getElementById('cmbType').value +
35
'&CurrentFolder=' + document.getElementById('txtFolder').value ;
40
function SetFrameUrl( url )
43
eRunningFrame.document.location = url ;
45
document.getElementById('eRunningFrame').src = url ;
47
document.getElementById('eUrl').innerHTML = url ;
52
SetFrameUrl( BuildBaseUrl( 'GetFolders' ) ) ;
56
function GetFoldersAndFiles()
58
SetFrameUrl( BuildBaseUrl( 'GetFoldersAndFiles' ) ) ;
62
function CreateFolder()
64
var sFolder = prompt( 'Type the folder name:', 'Test Folder' ) ;
69
var sUrl = BuildBaseUrl( 'CreateFolder' ) ;
70
sUrl += '&NewFolderName=' + encodeURIComponent( sFolder ) ;
76
function OnUploadCompleted( errorNumber, fileName )
78
switch ( errorNumber )
81
alert( 'File uploaded with no errors' ) ;
84
GetFoldersAndFiles() ;
85
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
88
alert( 'Invalid file' ) ;
91
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
96
this.frames.frmUpload = this ;
100
var sUrl = BuildBaseUrl( 'FileUpload' ) ;
101
document.getElementById('eUrl').innerHTML = sUrl ;
102
document.getElementById('frmUpload').action = sUrl ;
108
<table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
111
<table cellspacing="0" cellpadding="0" border="0">
115
<select id="cmbConnector" name="cmbConnector">
116
<option value="asp/connector.asp" selected="selected">ASP</option>
117
<option value="aspx/connector.aspx">ASP.Net</option>
118
<option value="cfm/connector.cfm">ColdFusion</option>
119
<option value="lasso/connector.lasso">Lasso</option>
120
<option value="perl/connector.cgi">Perl</option>
121
<option value="php/connector.php">PHP</option>
122
<option value="py/connector.py">Python</option>
126
</td>
129
<input id="txtFolder" type="text" value="/" name="txtFolder" /></td>
131
</td>
134
<select id="cmbType" name="cmbType">
135
<option value="File" selected="selected">File</option>
136
<option value="Image">Image</option>
137
<option value="Flash">Flash</option>
138
<option value="Media">Media</option>
139
<option value="Invalid">Invalid Type (for testing)</option>
145
<table cellspacing="0" cellpadding="0" border="0">
148
<a href="#" onclick="GetFolders();">Get Folders</a></td>
150
</td>
152
<a href="#" onclick="GetFoldersAndFiles();">Get Folders and Files</a></td>
154
</td>
156
<a href="#" onclick="CreateFolder();">Create Folder</a></td>
158
</td>
160
<form id="frmUpload" action="" target="eRunningFrame" method="post" enctype="multipart/form-data">
162
<input id="txtFileUpload" type="file" name="NewFile" />
163
<input type="submit" value="Upload" onclick="SetAction();" />
169
URL: <span id="eUrl"></span>
173
<td height="100%" valign="top">
174
<iframe id="eRunningFrame" src="javascript:void(0)" name="eRunningFrame" width="100%"
175
height="100%"></iframe>