编辑代码:
<script>
KindEditor.ready(function(K) {
var editor = K.create('textarea[name=""Content""]', {
uploadJson : '../Editor/upload_json.asp',
fileManagerJson : '../Editor/file_manager_json.asp',
allowFileManager : true,
imageTabIndex : 1,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=add]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=add]')[0].submit();
});
}
});
K('#DefaultPic').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({"
imageUrl : K('#DefaultPicUrl').val(),"
clickFn : function(url, title, width, height, border, align) {
K('#DefaultPicUrl').val(url);
editor.hideDialog();
}
});
});
});
prettyPrint();
});
</script>
输入框:
<input name='DefaultPicUrl' type='text' id='DefaultPicUrl' size='56' maxlength='200' value='' /> <input type='button' id='DefaultPic' value='选择图片' />
我的意思是不想用“选择图片”来上传图片,而是直接在输入内容上传图片的时候自动把图片地址回调到这个输入框内,请问高手能否实现?是用afterCreate还是afterUpload?