/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
params.langCode = editor.langCode;\r
\r
var url = addQueryString( this.filebrowser.url, params );\r
- editor.popup( url, width, height );\r
+ editor.popup( url, width, height, editor.config.fileBrowserWindowFeatures );\r
}\r
\r
/**\r
\r
if ( url )\r
{\r
- element.onClick = uploadFile;\r
+ var onClick = element.onClick;\r
+ element.onClick = function( evt )\r
+ {\r
+ // "element" here means the definition object, so we need to find the correct\r
+ // button to scope the event call\r
+ var sender = evt.sender;\r
+ if ( onClick && onClick.call( sender, evt ) === false )\r
+ return false;\r
+\r
+ return uploadFile.call( sender, evt );\r
+ };\r
+\r
element.filebrowser.url = url;\r
element.hidden = false;\r
setupFileElement( editor, definition.getContents( element[ 'for' ][ 0 ] ).get( element[ 'for' ][ 1 ] ), element.filebrowser );\r
return false;\r
}\r
\r
- return ( definition.getContents( tabId ).get( elementId ).filebrowser && definition.getContents( tabId ).get( elementId ).filebrowser.url );\r
+ var elementFileBrowser = definition.getContents( tabId ).get( elementId ).filebrowser;\r
+ return ( elementFileBrowser && elementFileBrowser.url );\r
}\r
\r
function setUrl( fileUrl, data )\r
if ( targetInput )\r
dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).reset();\r
\r
+ if ( typeof data == 'function' && data.call( this._.filebrowserSe ) === false )\r
+ return;\r
+\r
if ( onSelect && onSelect.call( this._.filebrowserSe, fileUrl, data ) === false )\r
return;\r
\r
init : function( editor, pluginPath )\r
{\r
editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor );\r
+ }\r
+ } );\r
\r
- CKEDITOR.on( 'dialogDefinition', function( evt )\r
+ CKEDITOR.on( 'dialogDefinition', function( evt )\r
+ {\r
+ var definition = evt.data.definition,\r
+ element;\r
+ // Associate filebrowser to elements with 'filebrowser' attribute.\r
+ for ( var i in definition.contents )\r
+ {\r
+ if ( ( element = definition.contents[ i ] ) )\r
{\r
- // Associate filebrowser to elements with 'filebrowser' attribute.\r
- for ( var i in evt.data.definition.contents )\r
+ attachFileBrowser( evt.editor, evt.data.name, definition, element.elements );\r
+ if ( element.hidden && element.filebrowser )\r
{\r
- attachFileBrowser( evt.editor, evt.data.name, evt.data.definition, evt.data.definition.contents[ i ].elements );\r
- if ( evt.data.definition.contents[ i ].hidden && evt.data.definition.contents[ i ].filebrowser )\r
- {\r
- evt.data.definition.contents[ i ].hidden =\r
- !isConfigured( evt.data.definition, evt.data.definition.contents[ i ][ 'id' ], evt.data.definition.contents[ i ].filebrowser );\r
- }\r
+ element.hidden = !isConfigured( definition, element[ 'id' ], element.filebrowser );\r
}\r
- } );\r
+ }\r
}\r
} );\r
\r
} )();\r
+\r
+/**\r
+ * The location of an external file browser, that should be launched when "Browse Server" button is pressed.\r
+ * If configured, the "Browse Server" button will appear in Link, Image and Flash dialogs.\r
+ * @see The <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)">File Browser/Uploader</a> documentation.\r
+ * @name CKEDITOR.config.filebrowserBrowseUrl\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserBrowseUrl = '/browser/browse.php';\r
+ */\r
+\r
+/**\r
+ * The location of a script that handles file uploads.\r
+ * If set, the "Upload" tab will appear in "Link", "Image" and "Flash" dialogs.\r
+ * @name CKEDITOR.config.filebrowserUploadUrl\r
+ * @see The <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)">File Browser/Uploader</a> documentation.\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserUploadUrl = '/uploader/upload.php';\r
+ */\r
+\r
+/**\r
+ * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.\r
+ * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}.\r
+ * @name CKEDITOR.config.filebrowserImageBrowseUrl\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images';\r
+ */\r
+\r
+/**\r
+ * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.\r
+ * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}.\r
+ * @name CKEDITOR.config.filebrowserFlashBrowseUrl\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserFlashBrowseUrl = '/browser/browse.php?type=Flash';\r
+ */\r
+\r
+/**\r
+ * The location of a script that handles file uploads in the Image dialog.\r
+ * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserUploadUrl}.\r
+ * @name CKEDITOR.config.filebrowserImageUploadUrl\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserImageUploadUrl = '/uploader/upload.php?type=Images';\r
+ */\r
+\r
+/**\r
+ * The location of a script that handles file uploads in the Flash dialog.\r
+ * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserUploadUrl}.\r
+ * @name CKEDITOR.config.filebrowserFlashUploadUrl\r
+ * @since 3.0\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserFlashUploadUrl = '/uploader/upload.php?type=Flash';\r
+ */\r
+\r
+/**\r
+ * The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.\r
+ * If not set, CKEditor will use {@link CKEDITOR.config.filebrowserBrowseUrl}.\r
+ * @name CKEDITOR.config.filebrowserImageBrowseLinkUrl\r
+ * @since 3.2\r
+ * @type String\r
+ * @default '' (empty string = disabled)\r
+ * @example\r
+ * config.filebrowserImageBrowseLinkUrl = '/browser/browse.php';\r
+ */\r
+\r
+/**\r
+ * The "features" to use in the file browser popup window.\r
+ * @name CKEDITOR.config.filebrowserWindowFeatures\r
+ * @since 3.4.1\r
+ * @type String\r
+ * @default 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes'\r
+ * @example\r
+ * config.filebrowserWindowFeatures = 'resizable=yes,scrollbars=no';\r
+ */\r