我正在使用与primefaces-extensions捆绑在一起的CKEditor 3.6.2,因此升级并不那么容易。但是对页面执行下面的修复也可行。我将它粘贴在配置文件中,以确保它在CKEDITOR变量初始化后被触发。
CKEDITOR.editor.prototype['popup'] = function(url, width, height, options) {
width = width || '80%';
height = height || '70%';
if (typeof width == 'string' && width.length > 1 && width.substr(width.length - 1, 1) == '%')
width = parseInt(window.screen.width * parseInt(width, 10)/100, 10);
if (typeof height == 'string' && height.length > 1 && height.substr(height.length - 1, 1) == '%')
height = parseInt(window.screen.height * parseInt(height, 10)/100, 10);
if (width < 640)
width = 640;
if (height < 420)
height = 420;
var top = parseInt((window.screen.height - height)/2, 10),
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 +
',left=' + left;
var popupWindow = window.open('', null, options, true);
// Blocked by a popup blocker.
if (!popupWindow)
return false;
try
{
// 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)
{
popupWindow = window.open(url, null, options, true);
}
return true;
}
$(document).ready(
function() {
setContentHeight();
makeInstructionsTogglable();
window.onbeforeunload = function() {
if (editor.isDirty()) {
return "Are you sure you want to navigate away? You have unsaved changes."
}
};
}
);
$(window).resize(function() {
setContentHeight();
});
我有几乎相同的问题,即我有一个CKEditor与primefaces-extensions捆绑在一起。现在,当我尝试插入图像时,我没有获取文件眉毛或上传选项卡。我正在使用primefaces 3.4.1。除了捆绑的CKEditor之外,我还需要一些配置文件吗?我在哪里放置该配置文件。请指导。 – 2013-01-27 20:49:38