X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpopup%2Fplugin.js;h=bd59fe2d7107d2fa323c26029c55b65e543b5524;hb=refs%2Ftags%2Fv3.6.3;hp=731ab19b19c43f76d85ea6e3edca91246f9b0b6f;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/popup/plugin.js b/_source/plugins/popup/plugin.js index 731ab19..bd59fe2 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-2012, 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 + @@ -47,16 +49,21 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, try { - popupWindow.moveTo( left, top ); - popupWindow.resizeTo( width, height ); + // Chrome 18 is problematic, but it's not really needed here (#8855). + var ua = navigator.userAgent.toLowerCase(); + if ( ua.indexOf( ' chrome/18' ) == -1 ) + { + popupWindow.moveTo( left, top ); + popupWindow.resizeTo( width, height ); + } popupWindow.focus(); popupWindow.location.href = url; } - catch (e) + catch ( e ) { popupWindow = window.open( url, null, options, true ); } - return true ; + return true; } });