jquery Cleditor插件附加文件选项
我正在为我的应用程序使用cleditor插件。我需要附加文档选项(如ms word)。所以我使用下面的代码来实现附加选项。已成功将文档添加为编辑器中的超链接,但我无法单击并打开链接 有人能帮我吗。或者向我建议其他方法 注意:最后,我想将附加文件的内容保存到数据库中。请对此提出任何建议 提前谢谢 密码jquery Cleditor插件附加文件选项,jquery,jquery-plugins,cleditor,Jquery,Jquery Plugins,Cleditor,我正在为我的应用程序使用cleditor插件。我需要附加文档选项(如ms word)。所以我使用下面的代码来实现附加选项。已成功将文档添加为编辑器中的超链接,但我无法单击并打开链接 有人能帮我吗。或者向我建议其他方法 注意:最后,我想将附加文件的内容保存到数据库中。请对此提出任何建议 提前谢谢 密码 (函数(n) { 函数t(t,i) { n(i.popup).children(“:button”).unbind(“click”).bind(“click”),function() { var r
(函数(n)
{
函数t(t,i)
{
n(i.popup).children(“:button”).unbind(“click”).bind(“click”),function()
{
var r=i.editor,u=n(i.popup).find(:text),v=n(i.popup).find(:file),f=v[0]。value,e=u[0]。value,t;
如果(f!=“”&&e!=“”){
t=“+e+”;
t&r.execCommand(i.command,t,null,i.button);
}
t&r.execCommand(i.command,t,null,i.button);
r、 hidePopups();
r、 焦点()
});
}
n、 cleditor.buttons.file=
{
名称:“文件”,
图片:“file.gif”,
标题:“插入文件”,
命令:“inserthtml”,
popupName:“文件”,
popupClass:“cleditorPrompt”,
popupContent:'Url:
标题:
,
按键:t
};
n、 cleditor.defaultOptions.controls=n.cleditor.defaultOptions.controls.replace(“规则”,“规则文件”)
}
)(jQuery);
(function(n)
{
function t(t,i)
{
n(i.popup).children(":button").unbind("click").bind("click",function()
{
var r=i.editor,u=n(i.popup).find(":text"),v=n(i.popup).find(":file"),f=v[0].value,e=u[0].value,t;
if(f!=""&&e!=""){
t="<a href="+f+" target=_blank>"+e+"<\/a>";
t&&r.execCommand(i.command,t,null,i.button);
}
t&&r.execCommand(i.command,t,null,i.button);
r.hidePopups();
r.focus()
});
}
n.cleditor.buttons.file=
{
name:"file",
image:"file.gif",
title:"Insert File",
command:"inserthtml",
popupName:"file",
popupClass:"cleditorPrompt",
popupContent:'<label>Url: <input type="file" value="" style="width:250px"><\/label><br /><label>Title:<br /><input type="text" value="" style="width:70px"><\/label><br /><input type="button" value="Submit">',
buttonClick:t
};
n.cleditor.defaultOptions.controls=n.cleditor.defaultOptions.controls.replace("rule ","rule file ")
}
)(jQuery);