(1)单个文件上传:
editor = K.editor({
uploadJson : contextPath+'/fileupload/fileUpload.do?p=${desUtil("0,4,1,0,0")}',
allowFileManager : true,
imageUploadLimit : 6
});
function uploadFive(va) {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showRemote : false,
clickFn : function(url, title, width, height, border, align) {
$(va).parent().prev().children("img").attr("src",url);
editor.hideDialog();
}
})
})
};
(2)多文件上传
editor = K.editor({
uploadJson : contextPath+'/fileupload/fileUpload.do?p=${desUtil("0,4,1,0,0")}',
allowFileManager : true,
imageUploadLimit : 6
});
K('#uploadImg').click(function() {
editor.loadPlugin('multiimage', function() {
editor.plugin.multiImageDialog({
showRemote : false,
clickFn : function(urlList) {
var div = K('#J_imageView');div.html('');
K.each(urlList,function(i,data) {
K("#On-line ul").append("<li flag='0'><img src='"+data.url+"' /><span><img src='"+contextPath+"/dest/images/xuanzhong.png'/></span></li>");
});
editor.hideDialog();
editor.sync();
}
});
});
});