<%= 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 ba9e970b6..225304185 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%>,"","85%");
+ init_activity_KindEditor_data(<%= user_activity.id%>,"","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 b73ff10d3..866d0ea41 100644
--- a/public/javascripts/init_activity_KindEditor.js
+++ b/public/javascripts/init_activity_KindEditor.js
@@ -1,10 +1,7 @@
-/**
- * Created by Alan on 2015/9/18.
- */
function init_editor(params){
// var minHeight; //最小高度
- var id = arguments[1] ? arguments[1] : undefined;
var paramsHeight = params.height; //设定的高度
+ var id = arguments[1] ? arguments[1] : undefined;
var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, {
@@ -13,19 +10,42 @@ 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});
+ if(this.edit.html()=="") {
+ this.edit.html('我要回复');
+ }
+ //params.toolbar_container.hide();
+ $('#reply_image_' + id).addClass('imageFuzzy');
+ //this.resize("95%", null);
+ //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())){
+ edit.html('');
+ }
+ params.contentmsg.hide();
+ // params.toolbar_container.show();
+ $('#reply_image_' + id).removeClass('imageFuzzy');
+ //edit.iframe.width(paramsWidth);
+ this.resize(paramsWidth, null);
+ params.submit_btn.show();
+ },
+
afterCreate:function(){
params.submit_btn.css("display","none");
var toolbar = $("div[class='ke-toolbar']",params.div_form);
toolbar.css('width',24);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
- params.toolbar_container.style.display = 'none';
//init
var edit = this.edit;
var body = edit.doc.body;
@@ -36,20 +56,10 @@ function init_editor(params){
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));
+ // params.toolbar_container.hide();
- },
- afterFocus:function(){
- $('#reply_image_' + id).removeClass('imageFuzzy');
- //edit.iframe.width(paramsWidth);
- this.resize(paramsWidth, null);
- params.submit_btn.css('display','inline-block');
- },
-
- afterBlur:function(){
- $('#reply_image_' + id).addClass('imageFuzzy');
- this.resize("95%", null);
- params.submit_btn.css("display","none");
}
}).loadPlugin('paste');
return editor;
@@ -64,7 +74,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{
@@ -128,7 +138,7 @@ function init_activity_KindEditor_data(id){
params.height = height;
params.width = width;
if (params.textarea.data('init') == undefined) {
- params.editor = init_editor(params, id);
+ params.editor = init_editor(params,id);
init_form(params);
params.cancel_btn.click(function () {
nh_reset_form(params);
@@ -141,4 +151,4 @@ function init_activity_KindEditor_data(id){
}
});
});
-}
+}
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 8ecda84d4..c233bcbe8 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -566,6 +566,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
.borderBottomNone {border-bottom:none !important;}
+div.minHeight48{min-height: 48px;}
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;}
.homepagePostReplyBannerTime{width:85px; display:inline-block;}
.homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;}
@@ -581,7 +582,7 @@ a.postReplyCancel {color:#888888; display:block;}
a.postReplyCancel:hover {color:#ffffff;}
.homepagePostReplyInputContainer2 {width:595px; margin:0px auto;}
.homepagePostReplyInput2 {width:588px; height:45px; max-width:588px; max-height:45px; border:1px solid #d9d9d9; outline:none; margin:0px auto 10px auto;}
-.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:680px; margin:0px auto; margin-top:18px; min-height:48px;}
+.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:680px; margin:0px auto; margin-top:15px; min-height:60px;}
.homepagePostSetting {position:absolute; width:20px; height:20px; right:0px; top:0px;}
.homepagePostSetting ul li:hover ul {display:block;}
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}