2010-04-05 75 views
1

我使用InnovaStudio WYSIWYG Editor,我试图用CKFinder替代InnovaStudio的资产管理器。编辑器配置中有一行用于资产管理器的URL。我已经指出它在CKFinder。我无法工作的部分是通过CKFinder的双击文件路径填充字段。将CKFinder与InnovaStudio WYSIWYG编辑器集成

它似乎使用'func'参数来指定回调函数。我拨打的URL为:/common/ckfinder/ckfinder.html?action=js&func=setAssetValue

InnovaStudio所见即所得编辑器提供setAssetValue(v)回调函数来设置字段值。 v参数应该包含URL。

CKFinder会在调用时弹出按预期的方式,但不会双击缩略图,也不会在上下文菜单中使用“select”选项。正常/预期的行为是CKFinder关闭,目标字段填充所选资产的URL。


附加信息:的InnovaStudio所见即所得编辑器具有添加图像或Flash文件内容的“弹出”。此弹出窗口位于iframe中。当它调用CKFinder(或它自己的资产管理器)时,也是在iframe中。看来CKFinder正在查看主窗口的范围,而不是实际包含需要填充的字段的图像/ Flash iframe。

回答

0

(排序)解决方案

我发现,通过使用Firebug的DOM挖,这InnovaStudio创建ISWindow对象,其中它把引用到它产生的窗口。我修改了我的回调函数以遍历该对象,并调用适当的iframe的setAssetValue()函数。这工作,但CKEditor仍然没有关闭。我认为这是因为它不知道如何关闭它内部的iframe。 有没有办法告诉CKFinder如何关闭它内部的窗口?我可以想象使用iframe的其他情况。

我宁愿让CKFinder使用iframe显示,但我最终得到了使用标准CKFinder弹出窗口的工作。

编辑配置行:oEdit1.cmdAssetManager = "parent.BrowseServerIS();";

支持功能:

// 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); 
     } 
    } 
} 
+0

我刚才已经证实,该代码可以使用InnovaStudio所见即所得编辑器5.3 – Sonny 2011-05-23 15:24:18