|
|
|
@ -6,42 +6,49 @@ function init_editor(params){
|
|
|
|
|
|
|
|
|
|
var editor = params.kindutil.create(params.textarea, {
|
|
|
|
|
resizeType : 1,minWidth:"1px",width:"95%",
|
|
|
|
|
height:"30px",// == undefined ? "30px":paramsHeight+"px",
|
|
|
|
|
minHeight:"30px",// == undefined ? "30px":paramsHeight+"px",
|
|
|
|
|
height:"33px",// == undefined ? "30px":paramsHeight+"px",
|
|
|
|
|
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
|
|
|
|
|
items:['emoticons'],
|
|
|
|
|
afterChange:function(){//按键事件
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + paramsHeight , paramsHeight));
|
|
|
|
|
},
|
|
|
|
|
afterBlur:function(){
|
|
|
|
|
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
|
|
|
|
if(this.edit.html()=="") {
|
|
|
|
|
this.edit.html('<span id="hint" style="color: #808080">我要回复</span>');
|
|
|
|
|
this.edit.html('<span id="hint" style="color: #999999; font-size: 12px">我要回复</span>');
|
|
|
|
|
}
|
|
|
|
|
//params.toolbar_container.hide();
|
|
|
|
|
$('#reply_image_' + id).addClass('imageFuzzy');
|
|
|
|
|
//this.resize("95%", null);
|
|
|
|
|
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){
|
|
|
|
|
params.submit_btn.hide();
|
|
|
|
|
this.resize("95%", null);
|
|
|
|
|
}else if(edit.html().val().trim() != ""){
|
|
|
|
|
params.submit_btn.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//params.submit_btn.css("display","none");
|
|
|
|
|
},
|
|
|
|
|
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())){
|
|
|
|
|
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
|
|
|
|
|
edit.html('');
|
|
|
|
|
}
|
|
|
|
|
params.submit_btn.show();
|
|
|
|
|
params.contentmsg.hide();
|
|
|
|
|
// params.toolbar_container.show();
|
|
|
|
|
$('#reply_image_' + id).removeClass('imageFuzzy');
|
|
|
|
|
//edit.iframe.width(paramsWidth);
|
|
|
|
|
this.resize(paramsWidth, null);
|
|
|
|
|
params.submit_btn.show();
|
|
|
|
|
//params.submit_btn.show();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
afterCreate:function(){
|
|
|
|
|
params.submit_btn.css("display","none");
|
|
|
|
|
params.submit_btn.hide();
|
|
|
|
|
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
|
|
|
|
toolbar.css('width',24);
|
|
|
|
|
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
|
|
|
@ -52,12 +59,10 @@ function init_editor(params){
|
|
|
|
|
edit.iframe[0].scroll = 'no';
|
|
|
|
|
body.style.overflowY = 'hidden';
|
|
|
|
|
//reset height
|
|
|
|
|
var edit = this.edit;
|
|
|
|
|
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));
|
|
|
|
|
edit.html('<span id="hint" style="color: #999999; font-size: 12px">我要回复</span>');
|
|
|
|
|
this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
|
|
|
|
|
// params.toolbar_container.hide();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -74,7 +79,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() || /^\&\w*\;\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\&\w*\;[\u4e00-\u9fa5]*\&\w*\;\/\w*\&\w*\;$/.test(params.textarea.html())){
|
|
|
|
|
if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){
|
|
|
|
|
params.contentmsg.html('内容不能为空');
|
|
|
|
|
params.contentmsg.css({color:'#ff0000'});
|
|
|
|
|
}else{
|
|
|
|
@ -152,5 +157,5 @@ function init_activity_KindEditor_data(id){
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".ke-edit").css("height","25px");
|
|
|
|
|
$(".ke-edit").css("height","33px");
|
|
|
|
|
}
|