Javascript 将CKFinder与InnovaStudio所见即所得编辑器集成
我使用,并且我正在尝试用替换InnovaStudio的资产管理器。编辑器配置中有一行用于资产管理器的URL。我已经把它指向了CKFinder。我无法工作的部分是让字段填充来自CKFinder的双击文件路径 它似乎使用“func”参数指定回调函数。我调用的URL是:Javascript 将CKFinder与InnovaStudio所见即所得编辑器集成,javascript,callback,ckfinder,Javascript,Callback,Ckfinder,我使用,并且我正在尝试用替换InnovaStudio的资产管理器。编辑器配置中有一行用于资产管理器的URL。我已经把它指向了CKFinder。我无法工作的部分是让字段填充来自CKFinder的双击文件路径 它似乎使用“func”参数指定回调函数。我调用的URL是:/common/ckfinder/ckfinder.html?action=js&func=setAssetValue InnovaStudio WYSIWYG编辑器提供用于设置字段值的setAssetValue(v)回调函数。v参数应
/common/ckfinder/ckfinder.html?action=js&func=setAssetValue
InnovaStudio WYSIWYG编辑器提供用于设置字段值的setAssetValue(v)
回调函数。v
参数应该包含URL
当调用CKFinder时,它会按预期弹出,但双击缩略图或使用上下文菜单中的“选择”选项都不起作用。正常/预期的行为是CKFinder关闭,目标字段填充所选资产的URL
其他信息:InnovaStudio所见即所得编辑器有一个“弹出窗口”,用于将图像或flash文件添加到内容中。此弹出窗口位于iframe中。当它调用CKFinder(或它自己的资产管理器)时,它也在iframe中。似乎CKFinder正在查看主窗口的范围,而不是实际包含需要填充的字段的图像/闪存iframe。(某种)解决方案 通过使用Firebug挖掘DOM,我发现InnovaStudio创建了一个
ISWindow
对象,它将引用放置到它生成的窗口中。我修改了回调函数以循环该对象,并为相应的iframe调用setAssetValue()
函数。这是可行的,但CKEditor仍无法自行关闭。我想这是因为它不知道如何关闭它所在的iframe有没有办法告诉CKFinder如何关闭它所在的窗口?我可以设想在其他情况下使用iframe会很有用
我更愿意让CKFinder使用iframe显示,但我最终使用标准的CKFinder弹出窗口工作
编辑器配置行:oEdit1.cmdAssetManager=“parent.browseseserveris();”代码>
支持功能:
// InnovaStudio WYSIWYG Editor version
function BrowseServerIS()
{
// You can use the "CKFinder" class to render CKFinder in a page:
var finder = new CKFinder();
// The path for the installation of CKFinder (default = "/ckfinder/").
finder.BasePath = '/common/ckfinder/';
// Name of a function which is called when a file is selected in CKFinder.
finder.SelectFunction = SetFileFieldIS;
// Launch CKFinder
finder.Popup();
}
// InnovaStudio WYSIWYG Editor version
function SetFileFieldIS(fileUrl, data)
{
for (var i in ISWindow.objs) {
if ((null != ISWindow.objs[i].rt.frm.contentWindow)
&& ('function' == typeof ISWindow.objs[i].rt.frm.contentWindow.setAssetValue)) {
ISWindow.objs[i].rt.frm.contentWindow.setAssetValue(fileUrl);
}
}
}
我刚刚验证了这段代码与InnovaStudio WYSIWYG Editor 5.3兼容