Index: _source/core/config.js =================================================================== --- _source/core/config.js (revision 3056) +++ _source/core/config.js (working copy) @@ -147,7 +147,7 @@ * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea'; */ - plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,preview,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,wysiwygarea', + plugins : 'basicstyles,button,elementspath,filebrowser,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,preview,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,wysiwygarea', /** * The theme to be used to build the UI. Index: _source/core/loader.js =================================================================== --- _source/core/loader.js (revision 3056) +++ _source/core/loader.js (working copy) @@ -44,7 +44,7 @@ 'core/dom/text' : [ 'core/dom/node', 'core/dom/domobject' ], 'core/dom/window' : [ 'core/dom/domobject' ], 'core/dtd' : [ 'core/tools' ], - 'core/editor' : [ 'core/command', 'core/config', 'core/editor_basic', 'core/focusmanager', 'core/lang', 'core/plugins', 'core/skins', 'core/themes', 'core/tools', 'core/ui' ], + 'core/editor' : [ 'core/ajax', 'core/command', 'core/config', 'core/editor_basic', 'core/focusmanager', 'core/lang', 'core/plugins', 'core/skins', 'core/themes', 'core/tools', 'core/ui' ], 'core/editor_basic' : [ 'core/event' ], 'core/env' : [], 'core/event' : [], Index: _source/lang/en.js =================================================================== --- _source/lang/en.js (revision 3056) +++ _source/lang/en.js (working copy) @@ -365,6 +365,45 @@ vSpace : 'VSpace' }, + filebrowser : + { + errors : + { + 10 : 'Invalid command.', + 11 : 'The resource type was not specified in the request.', + 12 : 'The requested resource type is not valid.', + 102 : 'Invalid file or folder name.', + 103 : 'It was not possible to complete the request due to authorization restrictions.', + 104 : 'It was not possible to complete the request due to file system permission restrictions.', + 105 : 'Invalid file extension.', + 109 : 'Invalid request.', + 110 : 'Unknown error.', + 115 : 'A file or folder with the same name already exists.', + 116 : 'Folder not found. Please refresh and try again.', + 117 : 'File not found. Please refresh the files list and try again.', + 201 : 'A file with the same name is already available. The uploaded file has been renamed to "%1"', + 202 : 'Invalid file', + 203 : 'Invalid file. The file size is too big.', + 204 : 'The uploaded file is corrupt.', + 205 : 'No temporary folder is available for upload in the server.', + 206 : 'Upload cancelled for security reasons. The file contains HTML like data.', + 500 : 'The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.', + 501 : 'The thumbnails support is disabled.' + }, + errorUnknown : 'It was not possible to complete the request. (Error %1)', + fileNotSelected : 'Please select a file from your computer', + fileInvalidChar : 'The file name cannot contain any of the following characters: \n\\ / : * ? " < > |', + folderCreate : 'Create Folder', + folderCreateTip : 'Create folder in working directory', + folderEmpty : 'The folder name cannot be empty', + folderInvalidChar : 'The folder name cannot contain any of the following characters: \n\\ / : * ? " < > |', + folderNew : 'Please type the new folder name: ', + resourceType : 'Resource Type', + title : 'File Browser', + uploadProgressLbl : '(Upload in progress, please wait...)', + uploadTip : 'Upload a new file in this folder', + }, + smiley : { toolbar : 'Smiley', Index: _source/plugins/dialog/plugin.js =================================================================== --- _source/plugins/dialog/plugin.js (revision 3056) +++ _source/plugins/dialog/plugin.js (working copy) @@ -709,6 +709,17 @@ }, /** + * Gets the name of the dialog. + * @returns {String} The name of this dialog. + * @example + * var dialogName = dialogObj.getName(); + */ + getName : function() + { + return this._.name; + }, + + /** * Gets a dialog UI element object from a dialog page. * @param {String} pageId id of dialog page. * @param {String} elementId id of UI element. @@ -1986,6 +1997,24 @@ */ selectParentTab : function() { + tabId = this.getParentTab(); + + this._.dialog.selectPage( tabId ); + return this; + }, + + /** + * Gets the name of the parent tab of this element. + * @returns {String} The name of selected tab. + * @example + * focus : function() + * { + * this.getParentTab(); + * // do something else. + * } + */ + getParentTab : function() + { var element = this.getInputElement(), cursor = element, tabId; @@ -1994,8 +2023,7 @@ tabId = cursor.getAttribute( 'name' ); - this._.dialog.selectPage( tabId ); - return this; + return tabId; }, /** Index: _source/plugins/dialogui/plugin.js =================================================================== --- _source/plugins/dialogui/plugin.js (revision 3056) +++ _source/plugins/dialogui/plugin.js (working copy) @@ -656,12 +656,16 @@ this.validate = elementDefinition.validate; var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition ); + var onClick = myDefinition.onClick; myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button'; myDefinition.onClick = function( evt ) { var target = elementDefinition[ 'for' ]; // [ pageId, elementId ] - dialog.getContentElement( target[0], target[1] ).submit(); - this.disable(); + if ( !onClick || onClick.call( this, evt ) !== false ) + { + dialog.getContentElement( target[0], target[1] ).submit(); + this.disable(); + } }; dialog.on( 'load', function() @@ -1158,12 +1162,34 @@ }, /** + * Sets the action to given value. + * @param {String} value The new action. + * @returns {CKEDITOR.ui.dialog.file} This object. + * @example + */ + setAction : function( action ) + { + this.getInputElement().getParent().$.action = action; + return this; + }, + + /** + * Get the action assigned to the form. + * @returns {String} The value of the action. + * @example + */ + getAction : function( action ) + { + return this.getInputElement().getParent().$.action; + }, + + /** * Redraws the file input and resets the file path in the file input. * The redraw logic is necessary because non-IE browsers tend to clear * the <iframe> containing the file input after closing the dialog. * @example */ - reset : function() + reset : function( action ) { var frameElement = CKEDITOR.document.getById( this._.frameId ), frameDocument = frameElement.$.contentWindow.document, @@ -1172,7 +1198,7 @@ frameDocument.open(); frameDocument.write( [ '