392 |
jpm |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
2 |
<html>
|
|
|
3 |
<head>
|
|
|
4 |
<title>FCKeditor - Connectors Tests</title>
|
|
|
5 |
<script language="javascript">
|
|
|
6 |
|
|
|
7 |
function BuildBaseUrl( command )
|
|
|
8 |
{
|
|
|
9 |
var sUrl =
|
|
|
10 |
document.getElementById('cmbConnector').value +
|
|
|
11 |
'?Command=' + command +
|
|
|
12 |
'&Type=' + document.getElementById('cmbType').value +
|
|
|
13 |
'&CurrentFolder=' + document.getElementById('txtFolder').value ;
|
|
|
14 |
|
|
|
15 |
var sServerPath = document.getElementById('txtServerPath').value ;
|
|
|
16 |
if ( sServerPath.length > 0 && sServerPath.toLowerCase() != '/userfiles/' )
|
|
|
17 |
sUrl += '&ServerPath=' + sServerPath ;
|
|
|
18 |
|
|
|
19 |
return sUrl ;
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
function SetFrameUrl( url )
|
|
|
23 |
{
|
|
|
24 |
if ( document.all )
|
|
|
25 |
eRunningFrame.document.location = url ;
|
|
|
26 |
else
|
|
|
27 |
document.getElementById('eRunningFrame').src = url ;
|
|
|
28 |
|
|
|
29 |
document.getElementById('eUrl').innerHTML = url ;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
function GetFolders()
|
|
|
33 |
{
|
|
|
34 |
SetFrameUrl( BuildBaseUrl( 'GetFolders' ) ) ;
|
|
|
35 |
return false ;
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
function GetFoldersAndFiles()
|
|
|
39 |
{
|
|
|
40 |
SetFrameUrl( BuildBaseUrl( 'GetFoldersAndFiles' ) ) ;
|
|
|
41 |
return false ;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
function CreateFolder()
|
|
|
45 |
{
|
|
|
46 |
var sFolder = prompt( 'Type the folder name:', 'Test Folder' ) ;
|
|
|
47 |
|
|
|
48 |
if ( ! sFolder )
|
|
|
49 |
return ;
|
|
|
50 |
|
|
|
51 |
var sUrl = BuildBaseUrl( 'CreateFolder' ) ;
|
|
|
52 |
sUrl += '&NewFolderName=' + escape( sFolder ) ;
|
|
|
53 |
|
|
|
54 |
SetFrameUrl( sUrl ) ;
|
|
|
55 |
return false ;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
function OnUploadCompleted( errorNumber, fileName )
|
|
|
59 |
{
|
|
|
60 |
switch ( errorNumber )
|
|
|
61 |
{
|
|
|
62 |
case 0 :
|
|
|
63 |
alert( 'File uploaded with no errors' ) ;
|
|
|
64 |
break ;
|
|
|
65 |
case 201 :
|
|
|
66 |
GetFoldersAndFiles()
|
|
|
67 |
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
|
|
|
68 |
break ;
|
|
|
69 |
case 202 :
|
|
|
70 |
alert( 'Invalid file' ) ;
|
|
|
71 |
break ;
|
|
|
72 |
default :
|
|
|
73 |
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
|
|
|
74 |
break ;
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
this.frames.frmUpload = this ;
|
|
|
79 |
|
|
|
80 |
function SetAction()
|
|
|
81 |
{
|
|
|
82 |
var sUrl = BuildBaseUrl( 'FileUpload' ) ;
|
|
|
83 |
document.getElementById('eUrl').innerHTML = sUrl ;
|
|
|
84 |
document.getElementById('frmUpload').action = sUrl ;
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
</script>
|
|
|
88 |
</head>
|
|
|
89 |
<body>
|
|
|
90 |
<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
|
|
|
91 |
<tr>
|
|
|
92 |
<td>
|
|
|
93 |
<table cellSpacing="0" cellPadding="0" border="0">
|
|
|
94 |
<tr>
|
|
|
95 |
<td>Connector:<br>
|
|
|
96 |
<select id="cmbConnector" name="cmbConnector">
|
|
|
97 |
<option value="asp/connector.asp" selected>ASP</option>
|
|
|
98 |
<option value="aspx/connector.aspx">ASP.Net</option>
|
|
|
99 |
<option value="cfm/connector.cfm">ColdFusion</option>
|
|
|
100 |
<option value="perl/connector.cgi">Perl</option>
|
|
|
101 |
<option value="php/connector.php">PHP</option>
|
|
|
102 |
</select></td>
|
|
|
103 |
<td> </td>
|
|
|
104 |
<td>Current Folder<BR>
|
|
|
105 |
<INPUT id="txtFolder" type="text" value="/" name="txtFolder"></td>
|
|
|
106 |
<td> </td>
|
|
|
107 |
<td>Resource Type<BR>
|
|
|
108 |
<select id="cmbType" name="cmbType">
|
|
|
109 |
<option value="File" selected>File</option>
|
|
|
110 |
<option value="Image">Image</option>
|
|
|
111 |
<option value="Flash">Flash</option>
|
|
|
112 |
<option value="Media">Media</option>
|
|
|
113 |
</select></td>
|
|
|
114 |
<TD> </TD>
|
|
|
115 |
<TD>Server Path<BR>
|
|
|
116 |
<INPUT id="txtServerPath" type="text" value="/UserFiles/" /></TD>
|
|
|
117 |
</tr>
|
|
|
118 |
</table>
|
|
|
119 |
<br>
|
|
|
120 |
<table cellSpacing="0" cellPadding="0" border="0">
|
|
|
121 |
<tr>
|
|
|
122 |
<td valign="top"><a href="#" onclick="GetFolders();">Get Folders</a></td>
|
|
|
123 |
<td> </td>
|
|
|
124 |
<td valign="top"><a href="#" onclick="GetFoldersAndFiles();">Get Folders and Files</a></td>
|
|
|
125 |
<td> </td>
|
|
|
126 |
<td valign="top"><a href="#" onclick="CreateFolder();">Create Folder</a></td>
|
|
|
127 |
<td> </td>
|
|
|
128 |
<td valign="top">
|
|
|
129 |
<form id="frmUpload" action="" target="eRunningFrame" method="post" enctype="multipart/form-data">
|
|
|
130 |
File Upload<br>
|
|
|
131 |
<input id="txtFileUpload" type="file" name="NewFile"> <input type="submit" value="Upload" onclick="SetAction();">
|
|
|
132 |
</form>
|
|
|
133 |
</td>
|
|
|
134 |
</tr>
|
|
|
135 |
</table>
|
|
|
136 |
<br>
|
|
|
137 |
URL: <span id="eUrl"></span>
|
|
|
138 |
</td>
|
|
|
139 |
</tr>
|
|
|
140 |
<tr>
|
|
|
141 |
<td height="100%" vAlign="top">
|
|
|
142 |
<iframe id="eRunningFrame" src="../../../../fckblank.html" name="eRunningFrame" width="100%" height="100%"></iframe>
|
|
|
143 |
</td>
|
|
|
144 |
</tr>
|
|
|
145 |
</table>
|
|
|
146 |
</body>
|
|
|
147 |
</html>
|