1 | <!-- |
---|
2 | * FCKeditor - The text editor for internet |
---|
3 | * Copyright (C) 2003-2005 Frederico Caldeira Knabben |
---|
4 | * |
---|
5 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
6 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
7 | * |
---|
8 | * For further information visit: |
---|
9 | * http://www.fckeditor.net/ |
---|
10 | * |
---|
11 | * "Support Open Source software. What about a donation today?" |
---|
12 | * |
---|
13 | * File Name: browser.html |
---|
14 | * This page compose the File Browser dialog frameset. |
---|
15 | * |
---|
16 | * File Authors: |
---|
17 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
18 | --> |
---|
19 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
20 | <html> |
---|
21 | <head> |
---|
22 | <title>FCKeditor - Resources Browser</title> |
---|
23 | <link href="browser.css" type="text/css" rel="stylesheet"> |
---|
24 | <script type="text/javascript" src="js/fckxml.js"></script> |
---|
25 | <script language="javascript"> |
---|
26 | |
---|
27 | function GetUrlParam( paramName ) |
---|
28 | { |
---|
29 | var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ; |
---|
30 | var oMatch = oRegex.exec( window.top.location.search ) ; |
---|
31 | |
---|
32 | if ( oMatch && oMatch.length > 1 ) |
---|
33 | return oMatch[1] ; |
---|
34 | else |
---|
35 | return '' ; |
---|
36 | } |
---|
37 | |
---|
38 | var oConnector = new Object() ; |
---|
39 | oConnector.CurrentFolder = GetUrlParam( 'CurrentFolder' ) ; |
---|
40 | |
---|
41 | var sConnUrl = GetUrlParam( 'Connector' ) ; |
---|
42 | |
---|
43 | // Gecko has some problems when using relative URLs (not starting with slash). |
---|
44 | if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 ) |
---|
45 | sConnUrl = window.location.href.replace( /browser.html.*$/, '' ) + sConnUrl ; |
---|
46 | |
---|
47 | oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ) ; |
---|
48 | |
---|
49 | var sServerPath = GetUrlParam( 'ServerPath' ) ; |
---|
50 | if ( sServerPath.length > 0 ) |
---|
51 | oConnector.ConnectorUrl += 'ServerPath=' + escape( sServerPath ) + '&' ; |
---|
52 | |
---|
53 | oConnector.ResourceType = GetUrlParam( 'Type' ) ; |
---|
54 | oConnector.ShowAllTypes = ( oConnector.ResourceType.length == 0 ) ; |
---|
55 | |
---|
56 | if ( oConnector.ShowAllTypes ) |
---|
57 | oConnector.ResourceType = '' ; |
---|
58 | |
---|
59 | oConnector.SendCommand = function( command, params, callBackFunction ) |
---|
60 | { |
---|
61 | |
---|
62 | var sUrl = this.ConnectorUrl + 'Command=' + command ; |
---|
63 | sUrl += '&Type=' + this.ResourceType ; |
---|
64 | sUrl += '&CurrentFolder=' + escape( this.CurrentFolder ) ; |
---|
65 | |
---|
66 | if ( params ) sUrl += '&' + params ; |
---|
67 | var oXML = new FCKXml() ; |
---|
68 | |
---|
69 | if ( callBackFunction ) |
---|
70 | oXML.LoadUrl( sUrl, callBackFunction ) ; // Asynchronous load. |
---|
71 | else |
---|
72 | return oXML.LoadUrl( sUrl ) ; |
---|
73 | } |
---|
74 | |
---|
75 | oConnector.CheckError = function( responseXml ) |
---|
76 | { |
---|
77 | var iErrorNumber = 0 |
---|
78 | var oErrorNode = responseXml.SelectSingleNode( 'Connector/Error' ) ; |
---|
79 | |
---|
80 | if ( oErrorNode ) |
---|
81 | { |
---|
82 | iErrorNumber = parseInt( oErrorNode.attributes.getNamedItem('number').value ) ; |
---|
83 | |
---|
84 | switch ( iErrorNumber ) |
---|
85 | { |
---|
86 | case 0 : |
---|
87 | break ; |
---|
88 | case 1 : // Custom error. Message placed in the "text" attribute. |
---|
89 | alert( oErrorNode.attributes.getNamedItem('text').value ) ; |
---|
90 | break ; |
---|
91 | case 101 : |
---|
92 | alert( 'Folder already exists' ) ; |
---|
93 | break ; |
---|
94 | case 102 : |
---|
95 | alert( 'Invalid folder name' ) ; |
---|
96 | break ; |
---|
97 | case 103 : |
---|
98 | alert( 'You have no permissions to create the folder' ) ; |
---|
99 | break ; |
---|
100 | case 110 : |
---|
101 | alert( 'Unknown error creating folder' ) ; |
---|
102 | break ; |
---|
103 | default : |
---|
104 | alert( 'Error on your request. Error number: ' + iErrorNumber ) ; |
---|
105 | break ; |
---|
106 | } |
---|
107 | } |
---|
108 | return iErrorNumber ; |
---|
109 | } |
---|
110 | |
---|
111 | var oIcons = new Object() ; |
---|
112 | |
---|
113 | oIcons.AvailableIconsArray = [ |
---|
114 | 'ai','avi','bmp','cs','dll','doc','exe','fla','gif','htm','html','jpg','js', |
---|
115 | 'mdb','mp3','pdf','ppt','rdp','swf','swt','txt','vsd','xls','xml','zip' ] ; |
---|
116 | |
---|
117 | oIcons.AvailableIcons = new Object() ; |
---|
118 | |
---|
119 | for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ ) |
---|
120 | oIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ; |
---|
121 | |
---|
122 | oIcons.GetIcon = function( fileName ) |
---|
123 | { |
---|
124 | var sExtension = fileName.substr( fileName.lastIndexOf('.') + 1 ).toLowerCase() ; |
---|
125 | |
---|
126 | if ( this.AvailableIcons[ sExtension ] == true ) |
---|
127 | return sExtension ; |
---|
128 | else |
---|
129 | return 'default.icon' ; |
---|
130 | } |
---|
131 | </script> |
---|
132 | </head> |
---|
133 | <frameset cols="150,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="yes"> |
---|
134 | <frameset rows="50,*" framespacing="0"> |
---|
135 | <frame src="frmresourcetype.html" scrolling="no" frameborder="no"> |
---|
136 | <frame name="frmFolders" src="frmfolders.html" scrolling="auto" frameborder="yes"> |
---|
137 | </frameset> |
---|
138 | <frameset rows="50,*,50" framespacing="0"> |
---|
139 | <frame name="frmActualFolder" src="frmactualfolder.html" scrolling="no" frameborder="no"> |
---|
140 | <frame name="frmResourcesList" src="frmresourceslist.html" scrolling="auto" frameborder="yes"> |
---|
141 | <frameset cols="150,*,0" framespacing="0" frameborder="no"> |
---|
142 | <frame name="frmCreateFolder" src="frmcreatefolder.html" scrolling="no" frameborder="no"> |
---|
143 | <frame name="frmUpload" src="frmupload.html" scrolling="no" frameborder="no"> |
---|
144 | <frame name="frmUploadWorker" src="../../../fckblank.html" scrolling="no" frameborder="no"> |
---|
145 | </frameset> |
---|
146 | </frameset> |
---|
147 | </frameset> |
---|
148 | </html> |
---|