Subversion Repositories Applications.papyrus

Rev

Rev 1925 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1925 jp_milcent 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
2048 gduche 5
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
1925 jp_milcent 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
// Automatically detect the correct document.domain (#1919).
33
(function()
34
{
35
	var d = document.domain ;
36
 
37
	while ( true )
38
	{
39
		// Test if we can access a parent property.
40
		try
41
		{
42
			var test = window.opener.document.domain ;
43
			break ;
44
		}
45
		catch( e )
46
		{}
47
 
48
		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
49
		d = d.replace( /.*?(?:\.|$)/, '' ) ;
50
 
51
		if ( d.length == 0 )
52
			break ;		// It was not able to detect the domain.
53
 
54
		try
55
		{
56
			document.domain = d ;
57
		}
58
		catch (e)
59
		{
60
			break ;
61
		}
62
	}
63
})() ;
64
 
65
function GetUrlParam( paramName )
66
{
67
	var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
68
	var oMatch = oRegex.exec( window.top.location.search ) ;
69
 
70
	if ( oMatch && oMatch.length > 1 )
71
		return decodeURIComponent( oMatch[1] ) ;
72
	else
73
		return '' ;
74
}
75
 
76
var oConnector = new Object() ;
77
oConnector.CurrentFolder	= '/' ;
78
 
79
var sConnUrl = GetUrlParam( 'Connector' ) ;
80
 
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 ;
84
 
85
oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ;
86
 
87
var sServerPath = GetUrlParam( 'ServerPath' ) ;
88
if ( sServerPath.length > 0 )
89
	oConnector.ConnectorUrl += 'ServerPath=' + encodeURIComponent( sServerPath ) + '&' ;
90
 
91
oConnector.ResourceType		= GetUrlParam( 'Type' ) ;
92
oConnector.ShowAllTypes		= ( oConnector.ResourceType.length == 0 ) ;
93
 
94
if ( oConnector.ShowAllTypes )
95
	oConnector.ResourceType = 'File' ;
96
 
97
oConnector.SendCommand = function( command, params, callBackFunction )
98
{
99
	var sUrl = this.ConnectorUrl + 'Command=' + command ;
100
	sUrl += '&Type=' + this.ResourceType ;
101
	sUrl += '&CurrentFolder=' + encodeURIComponent( this.CurrentFolder ) ;
102
 
103
	if ( params ) sUrl += '&' + params ;
104
 
105
	// Add a random salt to avoid getting a cached version of the command execution
106
	sUrl += '&uuid=' + new Date().getTime() ;
107
 
108
	var oXML = new FCKXml() ;
109
 
110
	if ( callBackFunction )
111
		oXML.LoadUrl( sUrl, callBackFunction ) ;	// Asynchronous load.
112
	else
113
		return oXML.LoadUrl( sUrl ) ;
114
 
115
	return null ;
116
}
117
 
118
oConnector.CheckError = function( responseXml )
119
{
120
	var iErrorNumber = 0 ;
121
	var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ;
122
 
123
	if ( oErrorNode )
124
	{
125
		iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value, 10 ) ;
126
 
127
		switch ( iErrorNumber )
128
		{
129
			case 0 :
130
				break ;
131
			case 1 :	// Custom error. Message placed in the "text" attribute.
132
				alert( oErrorNode.attributes.getNamedItem('text').value ) ;
133
				break ;
134
			case 101 :
135
				alert( 'Folder already exists' ) ;
136
				break ;
137
			case 102 :
138
				alert( 'Invalid folder name' ) ;
139
				break ;
140
			case 103 :
141
				alert( 'You have no permissions to create the folder' ) ;
142
				break ;
143
			case 110 :
144
				alert( 'Unknown error creating folder' ) ;
145
				break ;
146
			default :
147
				alert( 'Error on your request. Error number: ' + iErrorNumber ) ;
148
				break ;
149
		}
150
	}
151
	return iErrorNumber ;
152
}
153
 
154
var oIcons = new Object() ;
155
 
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' ] ;
159
 
160
oIcons.AvailableIcons = new Object() ;
161
 
162
for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )
163
	oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;
164
 
165
oIcons.GetIcon = function( fileName )
166
{
167
	var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ;
168
 
169
	if ( this.AvailableIcons[ sExtension ] == true )
170
		return sExtension ;
171
	else
172
		return 'default.icon' ;
173
}
174
 
175
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
176
{
177
	if (errorNumber == "1")
178
		window.frames['frmUpload'].OnUploadCompleted( errorNumber, customMsg ) ;
179
	else
180
		window.frames['frmUpload'].OnUploadCompleted( errorNumber, fileName ) ;
181
}
182
 
183
		</script>
184
	</head>
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">
189
		</frameset>
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">
197
			</frameset>
198
		</frameset>
199
	</frameset>
200
</html>