X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpopup%2Fplugin.js;h=a2e1f33471c5b900c7cfab7c336e2e5a0dfa7ccd;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=731ab19b19c43f76d85ea6e3edca91246f9b0b6f;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/popup/plugin.js b/_source/plugins/popup/plugin.js index 731ab19..a2e1f33 100644 --- a/_source/plugins/popup/plugin.js +++ b/_source/plugins/popup/plugin.js @@ -1,9 +1,9 @@ /* -Copyright (c) 2003-2009, 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 */ -CKEDITOR.plugins.add( 'popup'); +CKEDITOR.plugins.add( 'popup' ); CKEDITOR.tools.extend( CKEDITOR.editor.prototype, { @@ -13,8 +13,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, * @param {String} url The url of the external file browser. * @param {String} width Popup window width. * @param {String} height Popup window height. + * @param {String} options Popup window features. */ - popup : function( url, width, height ) + popup : function( url, width, height, options ) { width = width || '80%'; height = height || '70%'; @@ -32,8 +33,9 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, height = 420; var top = parseInt( ( window.screen.height - height ) / 2, 10 ), - left = parseInt( ( window.screen.width - width ) / 2, 10 ), - options = 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes' + + left = parseInt( ( window.screen.width - width ) / 2, 10 ); + + options = ( options || 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes' ) + ',width=' + width + ',height=' + height + ',top=' + top + @@ -52,11 +54,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, popupWindow.focus(); popupWindow.location.href = url; } - catch (e) + catch ( e ) { popupWindow = window.open( url, null, options, true ); } - return true ; + return true; } });