]>
Commit | Line | Data |
---|---|---|
1 | /**\r | |
2 | * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\r | |
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license\r | |
4 | */\r | |
5 | \r | |
6 | /**\r | |
7 | * @fileOverview The "filebrowser" plugin that adds support for file uploads and\r | |
8 | * browsing.\r | |
9 | *\r | |
10 | * When a file is uploaded or selected inside the file browser, its URL is\r | |
11 | * inserted automatically into a field defined in the <code>filebrowser</code>\r | |
12 | * attribute. In order to specify a field that should be updated, pass the tab ID and\r | |
13 | * the element ID, separated with a colon.<br /><br />\r | |
14 | *\r | |
15 | * <strong>Example 1: (Browse)</strong>\r | |
16 | *\r | |
17 | * <pre>\r | |
18 | * {\r | |
19 | * type : 'button',\r | |
20 | * id : 'browse',\r | |
21 | * filebrowser : 'tabId:elementId',\r | |
22 | * label : editor.lang.common.browseServer\r | |
23 | * }\r | |
24 | * </pre>\r | |
25 | *\r | |
26 | * If you set the <code>filebrowser</code> attribute for an element other than\r | |
27 | * the <code>fileButton</code>, the <code>Browse</code> action will be triggered.<br /><br />\r | |
28 | *\r | |
29 | * <strong>Example 2: (Quick Upload)</strong>\r | |
30 | *\r | |
31 | * <pre>\r | |
32 | * {\r | |
33 | * type : 'fileButton',\r | |
34 | * id : 'uploadButton',\r | |
35 | * filebrowser : 'tabId:elementId',\r | |
36 | * label : editor.lang.common.uploadSubmit,\r | |
37 | * 'for' : [ 'upload', 'upload' ]\r | |
38 | * }\r | |
39 | * </pre>\r | |
40 | *\r | |
41 | * If you set the <code>filebrowser</code> attribute for a <code>fileButton</code>\r | |
42 | * element, the <code>QuickUpload</code> action will be executed.<br /><br />\r | |
43 | *\r | |
44 | * The filebrowser plugin also supports more advanced configuration performed through\r | |
45 | * a JavaScript object.\r | |
46 | *\r | |
47 | * The following settings are supported:\r | |
48 | *\r | |
49 | * <ul>\r | |
50 | * <li><code>action</code> – <code>Browse</code> or <code>QuickUpload</code>.</li>\r | |
51 | * <li><code>target</code> – the field to update in the <code><em>tabId:elementId</em></code> format.</li>\r | |
52 | * <li><code>params</code> – additional arguments to be passed to the server connector (optional).</li>\r | |
53 | * <li><code>onSelect</code> – a function to execute when the file is selected/uploaded (optional).</li>\r | |
54 | * <li><code>url</code> – the URL to be called (optional).</li>\r | |
55 | * </ul>\r | |
56 | *\r | |
57 | * <strong>Example 3: (Quick Upload)</strong>\r | |
58 | *\r | |
59 | * <pre>\r | |
60 | * {\r | |
61 | * type : 'fileButton',\r | |
62 | * label : editor.lang.common.uploadSubmit,\r | |
63 | * id : 'buttonId',\r | |
64 | * filebrowser :\r | |
65 | * {\r | |
66 | * action : 'QuickUpload', // required\r | |
67 | * target : 'tab1:elementId', // required\r | |
68 | * params : // optional\r | |
69 | * {\r | |
70 | * type : 'Files',\r | |
71 | * currentFolder : '/folder/'\r | |
72 | * },\r | |
73 | * onSelect : function( fileUrl, errorMessage ) // optional\r | |
74 | * {\r | |
75 | * // Do not call the built-in selectFuntion.\r | |
76 | * // return false;\r | |
77 | * }\r | |
78 | * },\r | |
79 | * 'for' : [ 'tab1', 'myFile' ]\r | |
80 | * }\r | |
81 | * </pre>\r | |
82 | *\r | |
83 | * Suppose you have a file element with an ID of <code>myFile</code>, a text\r | |
84 | * field with an ID of <code>elementId</code> and a <code>fileButton</code>.\r | |
85 | * If the <code>filebowser.url</code> attribute is not specified explicitly,\r | |
86 | * the form action will be set to <code>filebrowser[<em>DialogWindowName</em>]UploadUrl</code>\r | |
87 | * or, if not specified, to <code>filebrowserUploadUrl</code>. Additional parameters\r | |
88 | * from the <code>params</code> object will be added to the query string. It is\r | |
89 | * possible to create your own <code>uploadHandler</code> and cancel the built-in\r | |
90 | * <code>updateTargetElement</code> command.<br /><br />\r | |
91 | *\r | |
92 | * <strong>Example 4: (Browse)</strong>\r | |
93 | *\r | |
94 | * <pre>\r | |
95 | * {\r | |
96 | * type : 'button',\r | |
97 | * id : 'buttonId',\r | |
98 | * label : editor.lang.common.browseServer,\r | |
99 | * filebrowser :\r | |
100 | * {\r | |
101 | * action : 'Browse',\r | |
102 | * url : '/ckfinder/ckfinder.html&type=Images',\r | |
103 | * target : 'tab1:elementId'\r | |
104 | * }\r | |
105 | * }\r | |
106 | * </pre>\r | |
107 | *\r | |
108 | * In this example, when the button is pressed, the file browser will be opened in a\r | |
109 | * popup window. If you do not specify the <code>filebrowser.url</code> attribute,\r | |
110 | * <code>filebrowser[<em>DialogName</em>]BrowseUrl</code> or\r | |
111 | * <code>filebrowserBrowseUrl</code> will be used. After selecting a file in the file\r | |
112 | * browser, an element with an ID of <code>elementId</code> will be updated. Just\r | |
113 | * like in the third example, a custom <code>onSelect</code> function may be defined.\r | |
114 | */\r | |
115 | \r | |
116 | ( function() {\r | |
117 | // Default input element name for CSRF protection token.\r | |
118 | var TOKEN_INPUT_NAME = 'ckCsrfToken';\r | |
119 | \r | |
120 | // Adds (additional) arguments to given url.\r | |
121 | //\r | |
122 | // @param {String}\r | |
123 | // url The url.\r | |
124 | // @param {Object}\r | |
125 | // params Additional parameters.\r | |
126 | function addQueryString( url, params ) {\r | |
127 | var queryString = [];\r | |
128 | \r | |
129 | if ( !params )\r | |
130 | return url;\r | |
131 | else {\r | |
132 | for ( var i in params )\r | |
133 | queryString.push( i + '=' + encodeURIComponent( params[ i ] ) );\r | |
134 | }\r | |
135 | \r | |
136 | return url + ( ( url.indexOf( '?' ) != -1 ) ? '&' : '?' ) + queryString.join( '&' );\r | |
137 | }\r | |
138 | \r | |
139 | // Make a string's first character uppercase.\r | |
140 | //\r | |
141 | // @param {String}\r | |
142 | // str String.\r | |
143 | function ucFirst( str ) {\r | |
144 | str += '';\r | |
145 | var f = str.charAt( 0 ).toUpperCase();\r | |
146 | return f + str.substr( 1 );\r | |
147 | }\r | |
148 | \r | |
149 | // The onlick function assigned to the 'Browse Server' button. Opens the\r | |
150 | // file browser and updates target field when file is selected.\r | |
151 | //\r | |
152 | // @param {CKEDITOR.event}\r | |
153 | // evt The event object.\r | |
154 | function browseServer() {\r | |
155 | var dialog = this.getDialog();\r | |
156 | var editor = dialog.getParentEditor();\r | |
157 | \r | |
158 | editor._.filebrowserSe = this;\r | |
159 | \r | |
160 | var width = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowWidth' ] || editor.config.filebrowserWindowWidth || '80%';\r | |
161 | var height = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowHeight' ] || editor.config.filebrowserWindowHeight || '70%';\r | |
162 | \r | |
163 | var params = this.filebrowser.params || {};\r | |
164 | params.CKEditor = editor.name;\r | |
165 | params.CKEditorFuncNum = editor._.filebrowserFn;\r | |
166 | if ( !params.langCode )\r | |
167 | params.langCode = editor.langCode;\r | |
168 | \r | |
169 | var url = addQueryString( this.filebrowser.url, params );\r | |
170 | // TODO: V4: Remove backward compatibility (#8163).\r | |
171 | editor.popup( url, width, height, editor.config.filebrowserWindowFeatures || editor.config.fileBrowserWindowFeatures );\r | |
172 | }\r | |
173 | \r | |
174 | // Appends token preventing CSRF attacks to the form of provided file input.\r | |
175 | //\r | |
176 | // @since 4.5.6\r | |
177 | // @param {CKEDITOR.dom.element} fileInput\r | |
178 | function appendToken( fileInput ) {\r | |
179 | var tokenElement;\r | |
180 | var form = new CKEDITOR.dom.element( fileInput.$.form );\r | |
181 | \r | |
182 | if ( form ) {\r | |
183 | // Check if token input element already exists.\r | |
184 | tokenElement = form.$.elements[ TOKEN_INPUT_NAME ];\r | |
185 | \r | |
186 | // Create new if needed.\r | |
187 | if ( !tokenElement ) {\r | |
188 | tokenElement = new CKEDITOR.dom.element( 'input' );\r | |
189 | tokenElement.setAttributes( {\r | |
190 | name: TOKEN_INPUT_NAME,\r | |
191 | type: 'hidden'\r | |
192 | } );\r | |
193 | \r | |
194 | form.append( tokenElement );\r | |
195 | } else {\r | |
196 | tokenElement = new CKEDITOR.dom.element( tokenElement );\r | |
197 | }\r | |
198 | \r | |
199 | tokenElement.setAttribute( 'value', CKEDITOR.tools.getCsrfToken() );\r | |
200 | }\r | |
201 | }\r | |
202 | \r | |
203 | // The onlick function assigned to the 'Upload' button. Makes the final\r | |
204 | // decision whether form is really submitted and updates target field when\r | |
205 | // file is uploaded.\r | |
206 | //\r | |
207 | // @param {CKEDITOR.event}\r | |
208 | // evt The event object.\r | |
209 | function uploadFile() {\r | |
210 | var dialog = this.getDialog();\r | |
211 | var editor = dialog.getParentEditor();\r | |
212 | \r | |
213 | editor._.filebrowserSe = this;\r | |
214 | \r | |
215 | // If user didn't select the file, stop the upload.\r | |
216 | if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getInputElement().$.value )\r | |
217 | return false;\r | |
218 | \r | |
219 | if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getAction() )\r | |
220 | return false;\r | |
221 | \r | |
222 | return true;\r | |
223 | }\r | |
224 | \r | |
225 | // Setups the file element.\r | |
226 | //\r | |
227 | // @param {CKEDITOR.ui.dialog.file}\r | |
228 | // fileInput The file element used during file upload.\r | |
229 | // @param {Object}\r | |
230 | // filebrowser Object containing filebrowser settings assigned to\r | |
231 | // the fileButton associated with this file element.\r | |
232 | function setupFileElement( editor, fileInput, filebrowser ) {\r | |
233 | var params = filebrowser.params || {};\r | |
234 | params.CKEditor = editor.name;\r | |
235 | params.CKEditorFuncNum = editor._.filebrowserFn;\r | |
236 | if ( !params.langCode )\r | |
237 | params.langCode = editor.langCode;\r | |
238 | \r | |
239 | fileInput.action = addQueryString( filebrowser.url, params );\r | |
240 | fileInput.filebrowser = filebrowser;\r | |
241 | }\r | |
242 | \r | |
243 | // Traverse through the content definition and attach filebrowser to\r | |
244 | // elements with 'filebrowser' attribute.\r | |
245 | //\r | |
246 | // @param String\r | |
247 | // dialogName Dialog name.\r | |
248 | // @param {CKEDITOR.dialog.definitionObject}\r | |
249 | // definition Dialog definition.\r | |
250 | // @param {Array}\r | |
251 | // elements Array of {@link CKEDITOR.dialog.definition.content}\r | |
252 | // objects.\r | |
253 | function attachFileBrowser( editor, dialogName, definition, elements ) {\r | |
254 | if ( !elements || !elements.length )\r | |
255 | return;\r | |
256 | \r | |
257 | var element;\r | |
258 | \r | |
259 | for ( var i = elements.length; i--; ) {\r | |
260 | element = elements[ i ];\r | |
261 | \r | |
262 | if ( element.type == 'hbox' || element.type == 'vbox' || element.type == 'fieldset' )\r | |
263 | attachFileBrowser( editor, dialogName, definition, element.children );\r | |
264 | \r | |
265 | if ( !element.filebrowser )\r | |
266 | continue;\r | |
267 | \r | |
268 | if ( typeof element.filebrowser == 'string' ) {\r | |
269 | var fb = {\r | |
270 | action: ( element.type == 'fileButton' ) ? 'QuickUpload' : 'Browse',\r | |
271 | target: element.filebrowser\r | |
272 | };\r | |
273 | element.filebrowser = fb;\r | |
274 | }\r | |
275 | \r | |
276 | if ( element.filebrowser.action == 'Browse' ) {\r | |
277 | var url = element.filebrowser.url;\r | |
278 | if ( url === undefined ) {\r | |
279 | url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ];\r | |
280 | if ( url === undefined )\r | |
281 | url = editor.config.filebrowserBrowseUrl;\r | |
282 | }\r | |
283 | \r | |
284 | if ( url ) {\r | |
285 | element.onClick = browseServer;\r | |
286 | element.filebrowser.url = url;\r | |
287 | element.hidden = false;\r | |
288 | }\r | |
289 | } else if ( element.filebrowser.action == 'QuickUpload' && element[ 'for' ] ) {\r | |
290 | url = element.filebrowser.url;\r | |
291 | if ( url === undefined ) {\r | |
292 | url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ];\r | |
293 | if ( url === undefined )\r | |
294 | url = editor.config.filebrowserUploadUrl;\r | |
295 | }\r | |
296 | \r | |
297 | if ( url ) {\r | |
298 | var onClick = element.onClick;\r | |
299 | element.onClick = function( evt ) {\r | |
300 | // "element" here means the definition object, so we need to find the correct\r | |
301 | // button to scope the event call\r | |
302 | var sender = evt.sender;\r | |
303 | if ( onClick && onClick.call( sender, evt ) === false )\r | |
304 | return false;\r | |
305 | \r | |
306 | if ( uploadFile.call( sender, evt ) ) {\r | |
307 | var fileInput = sender.getDialog().getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getInputElement();\r | |
308 | \r | |
309 | // Append token preventing CSRF attacks.\r | |
310 | appendToken( fileInput );\r | |
311 | return true;\r | |
312 | }\r | |
313 | \r | |
314 | \r | |
315 | return false;\r | |
316 | };\r | |
317 | \r | |
318 | element.filebrowser.url = url;\r | |
319 | element.hidden = false;\r | |
320 | setupFileElement( editor, definition.getContents( element[ 'for' ][ 0 ] ).get( element[ 'for' ][ 1 ] ), element.filebrowser );\r | |
321 | }\r | |
322 | }\r | |
323 | }\r | |
324 | }\r | |
325 | \r | |
326 | // Updates the target element with the url of uploaded/selected file.\r | |
327 | //\r | |
328 | // @param {String}\r | |
329 | // url The url of a file.\r | |
330 | function updateTargetElement( url, sourceElement ) {\r | |
331 | var dialog = sourceElement.getDialog();\r | |
332 | var targetElement = sourceElement.filebrowser.target || null;\r | |
333 | \r | |
334 | // If there is a reference to targetElement, update it.\r | |
335 | if ( targetElement ) {\r | |
336 | var target = targetElement.split( ':' );\r | |
337 | var element = dialog.getContentElement( target[ 0 ], target[ 1 ] );\r | |
338 | if ( element ) {\r | |
339 | element.setValue( url );\r | |
340 | dialog.selectPage( target[ 0 ] );\r | |
341 | }\r | |
342 | }\r | |
343 | }\r | |
344 | \r | |
345 | // Returns true if filebrowser is configured in one of the elements.\r | |
346 | //\r | |
347 | // @param {CKEDITOR.dialog.definitionObject}\r | |
348 | // definition Dialog definition.\r | |
349 | // @param String\r | |
350 | // tabId The tab id where element(s) can be found.\r | |
351 | // @param String\r | |
352 | // elementId The element id (or ids, separated with a semicolon) to check.\r | |
353 | function isConfigured( definition, tabId, elementId ) {\r | |
354 | if ( elementId.indexOf( ';' ) !== -1 ) {\r | |
355 | var ids = elementId.split( ';' );\r | |
356 | for ( var i = 0; i < ids.length; i++ ) {\r | |
357 | if ( isConfigured( definition, tabId, ids[ i ] ) )\r | |
358 | return true;\r | |
359 | }\r | |
360 | return false;\r | |
361 | }\r | |
362 | \r | |
363 | var elementFileBrowser = definition.getContents( tabId ).get( elementId ).filebrowser;\r | |
364 | return ( elementFileBrowser && elementFileBrowser.url );\r | |
365 | }\r | |
366 | \r | |
367 | function setUrl( fileUrl, data ) {\r | |
368 | var dialog = this._.filebrowserSe.getDialog(),\r | |
369 | targetInput = this._.filebrowserSe[ 'for' ],\r | |
370 | onSelect = this._.filebrowserSe.filebrowser.onSelect;\r | |
371 | \r | |
372 | if ( targetInput )\r | |
373 | dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).reset();\r | |
374 | \r | |
375 | if ( typeof data == 'function' && data.call( this._.filebrowserSe ) === false )\r | |
376 | return;\r | |
377 | \r | |
378 | if ( onSelect && onSelect.call( this._.filebrowserSe, fileUrl, data ) === false )\r | |
379 | return;\r | |
380 | \r | |
381 | // The "data" argument may be used to pass the error message to the editor.\r | |
382 | if ( typeof data == 'string' && data )\r | |
383 | alert( data ); // jshint ignore:line\r | |
384 | \r | |
385 | if ( fileUrl )\r | |
386 | updateTargetElement( fileUrl, this._.filebrowserSe );\r | |
387 | }\r | |
388 | \r | |
389 | CKEDITOR.plugins.add( 'filebrowser', {\r | |
390 | requires: 'popup',\r | |
391 | init: function( editor ) {\r | |
392 | editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor );\r | |
393 | editor.on( 'destroy', function() {\r | |
394 | CKEDITOR.tools.removeFunction( this._.filebrowserFn );\r | |
395 | } );\r | |
396 | }\r | |
397 | } );\r | |
398 | \r | |
399 | CKEDITOR.on( 'dialogDefinition', function( evt ) {\r | |
400 | // We require filebrowser plugin to be loaded.\r | |
401 | if ( !evt.editor.plugins.filebrowser )\r | |
402 | return;\r | |
403 | \r | |
404 | var definition = evt.data.definition,\r | |
405 | element;\r | |
406 | // Associate filebrowser to elements with 'filebrowser' attribute.\r | |
407 | for ( var i = 0; i < definition.contents.length; ++i ) {\r | |
408 | if ( ( element = definition.contents[ i ] ) ) {\r | |
409 | attachFileBrowser( evt.editor, evt.data.name, definition, element.elements );\r | |
410 | if ( element.hidden && element.filebrowser )\r | |
411 | element.hidden = !isConfigured( definition, element.id, element.filebrowser );\r | |
412 | \r | |
413 | }\r | |
414 | }\r | |
415 | } );\r | |
416 | \r | |
417 | } )();\r | |
418 | \r | |
419 | /**\r | |
420 | * The location of an external file manager that should be launched when the **Browse Server**\r | |
421 | * button is pressed. If configured, the **Browse Server** button will appear in the\r | |
422 | * **Link**, **Image**, and **Flash** dialog windows.\r | |
423 | *\r | |
424 | * Read more in the [documentation](#!/guide/dev_file_browse_upload)\r | |
425 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
426 | *\r | |
427 | * config.filebrowserBrowseUrl = '/browser/browse.php';\r | |
428 | *\r | |
429 | * @since 3.0\r | |
430 | * @cfg {String} [filebrowserBrowseUrl='' (empty string = disabled)]\r | |
431 | * @member CKEDITOR.config\r | |
432 | */\r | |
433 | \r | |
434 | /**\r | |
435 | * The location of the script that handles file uploads.\r | |
436 | * If set, the **Upload** tab will appear in the **Link**, **Image**,\r | |
437 | * and **Flash** dialog windows.\r | |
438 | *\r | |
439 | * Read more in the [documentation](#!/guide/dev_file_browse_upload)\r | |
440 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
441 | *\r | |
442 | * config.filebrowserUploadUrl = '/uploader/upload.php';\r | |
443 | *\r | |
444 | * **Note:** This is a configuration setting for a [file browser/uploader](#!/guide/dev_file_browse_upload).\r | |
445 | * To configure [uploading dropped or pasted files](#!/guide/dev_file_upload) use the {@link CKEDITOR.config#uploadUrl}\r | |
446 | * configuration option.\r | |
447 | *\r | |
448 | * @since 3.0\r | |
449 | * @cfg {String} [filebrowserUploadUrl='' (empty string = disabled)]\r | |
450 | * @member CKEDITOR.config\r | |
451 | */\r | |
452 | \r | |
453 | /**\r | |
454 | * The location of an external file manager that should be launched when the **Browse Server**\r | |
455 | * button is pressed in the **Image** dialog window.\r | |
456 | *\r | |
457 | * If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.\r | |
458 | *\r | |
459 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-adding-file-manager-scripts-for-selected-dialog-windows)\r | |
460 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
461 | *\r | |
462 | * config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images';\r | |
463 | *\r | |
464 | * @since 3.0\r | |
465 | * @cfg {String} [filebrowserImageBrowseUrl='' (empty string = disabled)]\r | |
466 | * @member CKEDITOR.config\r | |
467 | */\r | |
468 | \r | |
469 | /**\r | |
470 | * The location of an external file browser that should be launched when the **Browse Server**\r | |
471 | * button is pressed in the **Flash** dialog window.\r | |
472 | *\r | |
473 | * If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.\r | |
474 | *\r | |
475 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-adding-file-manager-scripts-for-selected-dialog-windows)\r | |
476 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
477 | *\r | |
478 | * config.filebrowserFlashBrowseUrl = '/browser/browse.php?type=Flash';\r | |
479 | *\r | |
480 | * @since 3.0\r | |
481 | * @cfg {String} [filebrowserFlashBrowseUrl='' (empty string = disabled)]\r | |
482 | * @member CKEDITOR.config\r | |
483 | */\r | |
484 | \r | |
485 | /**\r | |
486 | * The location of the script that handles file uploads in the **Image** dialog window.\r | |
487 | *\r | |
488 | * If not set, CKEditor will use {@link CKEDITOR.config#filebrowserUploadUrl}.\r | |
489 | *\r | |
490 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-adding-file-manager-scripts-for-selected-dialog-windows)\r | |
491 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
492 | *\r | |
493 | * config.filebrowserImageUploadUrl = '/uploader/upload.php?type=Images';\r | |
494 | *\r | |
495 | * **Note:** This is a configuration setting for a [file browser/uploader](#!/guide/dev_file_browse_upload).\r | |
496 | * To configure [uploading dropped or pasted files](#!/guide/dev_file_upload) use the {@link CKEDITOR.config#uploadUrl}\r | |
497 | * or {@link CKEDITOR.config#imageUploadUrl} configuration option.\r | |
498 | *\r | |
499 | * @since 3.0\r | |
500 | * @cfg {String} [filebrowserImageUploadUrl='' (empty string = disabled)]\r | |
501 | * @member CKEDITOR.config\r | |
502 | */\r | |
503 | \r | |
504 | /**\r | |
505 | * The location of the script that handles file uploads in the **Flash** dialog window.\r | |
506 | *\r | |
507 | * If not set, CKEditor will use {@link CKEDITOR.config#filebrowserUploadUrl}.\r | |
508 | *\r | |
509 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-adding-file-manager-scripts-for-selected-dialog-windows)\r | |
510 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
511 | *\r | |
512 | * config.filebrowserFlashUploadUrl = '/uploader/upload.php?type=Flash';\r | |
513 | *\r | |
514 | * @since 3.0\r | |
515 | * @cfg {String} filebrowserFlashUploadUrl='' (empty string = disabled)]\r | |
516 | * @member CKEDITOR.config\r | |
517 | */\r | |
518 | \r | |
519 | /**\r | |
520 | * The location of an external file manager that should be launched when the **Browse Server**\r | |
521 | * button is pressed in the **Link** tab of the **Image** dialog window.\r | |
522 | *\r | |
523 | * If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.\r | |
524 | *\r | |
525 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-adding-file-manager-scripts-for-selected-dialog-windows)\r | |
526 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
527 | *\r | |
528 | * config.filebrowserImageBrowseLinkUrl = '/browser/browse.php';\r | |
529 | *\r | |
530 | * @since 3.2\r | |
531 | * @cfg {String} [filebrowserImageBrowseLinkUrl='' (empty string = disabled)]\r | |
532 | * @member CKEDITOR.config\r | |
533 | */\r | |
534 | \r | |
535 | /**\r | |
536 | * The features to use in the file manager popup window.\r | |
537 | *\r | |
538 | * config.filebrowserWindowFeatures = 'resizable=yes,scrollbars=no';\r | |
539 | *\r | |
540 | * @since 3.4.1\r | |
541 | * @cfg {String} [filebrowserWindowFeatures='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes']\r | |
542 | * @member CKEDITOR.config\r | |
543 | */\r | |
544 | \r | |
545 | /**\r | |
546 | * The width of the file manager popup window. It can be a number denoting a value in\r | |
547 | * pixels or a percent string.\r | |
548 | *\r | |
549 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-file-manager-window-size)\r | |
550 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
551 | *\r | |
552 | * config.filebrowserWindowWidth = 750;\r | |
553 | *\r | |
554 | * config.filebrowserWindowWidth = '50%';\r | |
555 | *\r | |
556 | * @cfg {Number/String} [filebrowserWindowWidth='80%']\r | |
557 | * @member CKEDITOR.config\r | |
558 | */\r | |
559 | \r | |
560 | /**\r | |
561 | * The height of the file manager popup window. It can be a number denoting a value in\r | |
562 | * pixels or a percent string.\r | |
563 | *\r | |
564 | * Read more in the [documentation](#!/guide/dev_file_manager_configuration-section-file-manager-window-size)\r | |
565 | * and see the [SDK sample](http://sdk.ckeditor.com/samples/fileupload.html).\r | |
566 | *\r | |
567 | * config.filebrowserWindowHeight = 580;\r | |
568 | *\r | |
569 | * config.filebrowserWindowHeight = '50%';\r | |
570 | *\r | |
571 | * @cfg {Number/String} [filebrowserWindowHeight='70%']\r | |
572 | * @member CKEDITOR.config\r | |
573 | */\r |