<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index 225304185..ea9c572d9 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -36,7 +36,7 @@
}
$(function() {
- init_activity_KindEditor_data(<%= user_activity.id%>,"","87%");
+ init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%");
});
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js
index 1e51067ef..bea7dc1e7 100644
--- a/public/javascripts/init_activity_KindEditor.js
+++ b/public/javascripts/init_activity_KindEditor.js
@@ -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('我要回复');
+ this.edit.html('我要回复');
}
//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('我要回复');
- this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight));
+ edit.html('我要回复');
+ 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");
}
\ No newline at end of file