This commit is contained in:
sw 2015-09-19 11:20:54 +08:00
commit 2d0bf60bf2
12 changed files with 49 additions and 38 deletions

View File

@ -198,7 +198,7 @@ class UsersController < ApplicationController
# 系统消息
def user_system_messages
@sytem_messages = SystemMessage.order("created_at desc").all
@sytem_messages = paginateHelper @sytem_messages,25
@sytem_messages = paginateHelper @sytem_messages, 10
respond_to do |format|
format.html{render :layout=>'new_base_user'}
end

View File

@ -1,3 +1,3 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
init_activity_KindEditor_data('<%= @user_activity_id%>',"","85%");
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%");

View File

@ -1,3 +1,3 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");

View File

@ -3,4 +3,4 @@
<%elsif @course%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
<%end%>
init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");

View File

@ -97,16 +97,16 @@
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone">
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> /* id="reply_input_<%= user_activity_id%>" style="display: <%= (first_user_activity==user_activity_id && page==0)? '' : 'none'%>"*/
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer">
<div class="homepagePostReplyInputContainer mt3">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= 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|%>
<input type="hidden" name="quote[quote]" value="">
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= user_activity_id%>'></p>
<% end%>

View File

@ -68,9 +68,9 @@
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone">
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer">
<div class="homepagePostReplyInputContainer mt3">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">

View File

@ -113,9 +113,9 @@
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone">
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer">
<div class="homepagePostReplyInputContainer mt3">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">

View File

@ -82,9 +82,9 @@
</div>
<% end %>
<div class="homepagePostReplyContainer borderBottomNone">
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer">
<div class="homepagePostReplyInputContainer mt3">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= 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|%>
<input type="hidden" name="quote[quote]" value="">

View File

@ -36,7 +36,7 @@
}
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>,"","85%");
init_activity_KindEditor_data(<%= user_activity.id%>,"","87%");
});
</script>
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>

View File

@ -39,8 +39,8 @@
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<span class="fl"> Trustie平台 发布了系统消息:</span>
<span style="color:#0781b4; max-width:470px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;vertical-align: top;"><%= system_message.subject %></span>
<span class="fl"><span style="color:#0781b4;">Trustie平台 </span>发布了系统消息:</span>
<span style="color:#0781b4; max-width:470px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;vertical-align: top;"><%= system_message.subject.nil? ? "系统消息" : system_message.subject %></span>
</div>
<div class="cl"></div>
<p class="homepagePostIntro break_word upload_img">

View File

@ -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('<span id="hint" style="color: #808080">我要回复</span>');
}
//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('<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();
},
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){
}
});
});
}
}

View File

@ -568,6 +568,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;}
@ -583,7 +584,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;}