X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffilebrowser%2Fplugin.js;h=799d68f2be5ba18313c2340ac5df1f5ab2aae2e7;hb=4e90e78dc97789709ee7404359a5517540c27553;hp=e81baa8c9adc504cb05157625938f7d00466c5e9;hpb=9afde8772159bd3436f1f5b7862960307710ae5a;p=ckeditor.git diff --git a/_source/plugins/filebrowser/plugin.js b/_source/plugins/filebrowser/plugin.js index e81baa8..799d68f 100644 --- a/_source/plugins/filebrowser/plugin.js +++ b/_source/plugins/filebrowser/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -112,7 +112,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ ( function() { - /** + /* * Adds (additional) arguments to given url. * * @param {String} @@ -135,7 +135,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" ); } - /** + /* * Make a string's first character uppercase. * * @param {String} @@ -148,7 +148,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return f + str.substr( 1 ); } - /** + /* * The onlick function assigned to the 'Browse Server' button. Opens the * file browser and updates target field when file is selected. * @@ -177,7 +177,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.popup( url, width, height, editor.config.fileBrowserWindowFeatures ); } - /** + /* * The onlick function assigned to the 'Upload' button. Makes the final * decision whether form is really submitted and updates target field when * file is uploaded. @@ -202,7 +202,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return true; } - /** + /* * Setups the file element. * * @param {CKEDITOR.ui.dialog.file} @@ -223,16 +223,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license fileInput.filebrowser = filebrowser; } - /** + /* * Traverse through the content definition and attach filebrowser to * elements with 'filebrowser' attribute. * * @param String * dialogName Dialog name. - * @param {CKEDITOR.dialog.dialogDefinitionObject} + * @param {CKEDITOR.dialog.definitionObject} * definition Dialog definition. * @param {Array} - * elements Array of {@link CKEDITOR.dialog.contentDefinition} + * elements Array of {@link CKEDITOR.dialog.definition.content} * objects. */ function attachFileBrowser( editor, dialogName, definition, elements ) @@ -308,7 +308,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } - /** + /* * Updates the target element with the url of uploaded/selected file. * * @param {String} @@ -333,10 +333,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } - /** + /* * Returns true if filebrowser is configured in one of the elements. * - * @param {CKEDITOR.dialog.dialogDefinitionObject} + * @param {CKEDITOR.dialog.definitionObject} * definition Dialog definition. * @param String * tabId The tab id where element(s) can be found. @@ -388,6 +388,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license init : function( editor, pluginPath ) { editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor ); + editor.on( 'destroy', function () { CKEDITOR.tools.removeFunction( this._.filebrowserFn ); } ); } } ); @@ -499,3 +500,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * @example * config.filebrowserWindowFeatures = 'resizable=yes,scrollbars=no'; */ + +/** + * The width of the file browser popup window. It can be a number or a percent string. + * @name CKEDITOR.config.filebrowserWindowWidth + * @type Number|String + * @default '80%' + * @example + * config.filebrowserWindowWidth = 750; + * @example + * config.filebrowserWindowWidth = '50%'; + */ + +/** + * The height of the file browser popup window. It can be a number or a percent string. + * @name CKEDITOR.config.filebrowserWindowHeight + * @type Number|String + * @default '70%' + * @example + * config.filebrowserWindowHeight = 580; + * @example + * config.filebrowserWindowHeight = '50%'; + */