添加 我要回复
This commit is contained in:
parent
dc32bba5fd
commit
9f871ababb
|
@ -8,15 +8,30 @@ function init_editor(params){
|
|||
minHeight:"30px",// == undefined ? "30px":paramsHeight+"px",
|
||||
items:['emoticons'],
|
||||
afterChange:function(){//按键事件
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
|
||||
var edit = this.edit;
|
||||
var body = edit.doc.body;
|
||||
edit.iframe.height(paramsHeight);
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + (paramsHeight == undefined ? 30:paramsHeight), paramsHeight));
|
||||
},
|
||||
afterBlur:function(){
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
//params.toolbar_container.hide();
|
||||
},
|
||||
afterFocus: function(){
|
||||
var edit = this.edit;
|
||||
var body = edit.doc.body;
|
||||
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
|
||||
edit.html('');
|
||||
}
|
||||
params.contentmsg.hide();
|
||||
// params.toolbar_container.show();
|
||||
},
|
||||
|
||||
afterCreate:function(){
|
||||
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||
toolbar.css('width',20);
|
||||
$(".ke-outline>.ke-toolbar-icon",toolbar)//.append('表情');
|
||||
params.toolbar_container.append(toolbar);
|
||||
//init
|
||||
var edit = this.edit;
|
||||
|
@ -28,7 +43,9 @@ function init_editor(params){
|
|||
var body = edit.doc.body;
|
||||
paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight;
|
||||
edit.iframe.height(paramsHeight);
|
||||
edit.html('<span id="hint" style="color: #808080">我要回复</span>');
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight));
|
||||
// params.toolbar_container.hide();
|
||||
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
|
@ -44,7 +61,7 @@ function nh_check_field(params){
|
|||
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||
params.textarea.html(params.content.html());
|
||||
params.content.sync();
|
||||
if(params.content.isEmpty()){
|
||||
if(params.content.isEmpty() || /^\&\w*\;\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\&\w*\;[\u4e00-\u9fa5]*\&\w*\;\/\w*\&\w*\;$/.test(params.textarea.html())){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue