dev_zanle
cxt 10 years ago
commit 72c475e8a2

@ -44,7 +44,9 @@ group :development do
gem 'grape-swagger'
gem 'better_errors', '~> 1.1.0'
gem 'rack-mini-profiler', '~> 0.9.3'
gem 'win32console'
if RUBY_PLATFORM =~ /w32/
gem 'win32console'
end
end
group :development, :test do

@ -142,6 +142,13 @@ class IssuesController < ApplicationController
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
#id name email
#1. issues list persons
#2. project persons
@at_persons = @journals.map(&:user) + @issue.project.users
@at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
@at_persons = nil
respond_to do |format|``
format.html {
retrieve_previous_and_next_issue_ids

@ -1934,6 +1934,8 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
elsif attachment.container.class.to_s=="BlogComment"
candown = true
elsif attachment.container.class.to_s == "User"
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
@ -2659,4 +2661,38 @@ int main(int argc, char** argv){
true
end
end
def import_ke(default_opt={})
opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
ss = ''
if opt[:enable_at]
ss = '<script type="text/javascript">'
ss += 'window.atPersonLists = [];'
@at_persons && @at_persons.each_with_index do |person,index|
ss += "var o = {id: #{index}, name: '#{person.show_name}', login: '#{person.login}', searchKey: '#{person.get_at_show_name}'};"
ss += "atPersonLists.push(o);"
end
ss += "</script>"
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
if opt[:enable_at]
ss += javascript_include_tag('/assets/kindeditor/at/jquery.caret.min.js', '/assets/kindeditor/at/jquery.atwho.js', '/assets/kindeditor/at/config.js')
ss += stylesheet_link_tag("/assets/kindeditor/at/jquery.atwho.css")
end
if opt[:prettify]
ss += javascript_include_tag 'prettify'
ss += stylesheet_link_tag 'prettify'
end
if opt[:init_activity]
ss += javascript_include_tag "init_activity_KindEditor"
end
ss.html_safe
end
end

@ -410,11 +410,15 @@ class User < Principal
else
name = lastname+firstname
end
name = name.empty? || name.nil? ? login : name
name
name.empty? || name.nil? ? login : name
end
## end
def get_at_show_name
name = show_name
name = "#{name} #{self.login}" if name != self.login
end
#added by nie
def count_new_journal_reply
count = self.journal_reply.count

@ -1,4 +1,6 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false) %>
<% end %>
<h3 style="float: left">
<%=l(:label_system_message)%>
</h3><br/>

@ -1,5 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'prettify','/assets/kindeditor/pasteimg' %>
<%= stylesheet_link_tag 'prettify'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: true) %>
<% end %>
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
<% end %>

@ -1,9 +1,13 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag 'blog' %>
<% end %>
<div class="resources mt10">
<div id="new_course_topic">
<div class="homepagePostBrief c_grey">
<div>
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " />
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" />
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: block;">

@ -1,9 +1,12 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag 'blog' %>
<% end %>
<div class="resources mt10">
<div id="new_course_topic">
<div class="homepagePostBrief c_grey">
<div>
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " >
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" >
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">

@ -1,4 +1,6 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<% end %>
<li>
<div style="display: none ;" class="fl"><label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label></div>
<div style="display: none;"><%= f.text_field :title, { size: 60, id: "message_subject",:class=>"talk_input w585 fl" }.merge({ hidden: "hidden"}) %></div>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag "init_activity_KindEditor",'blog' %>
<% end %>
<script type="text/javascript">
$(function(){

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag "init_activity_KindEditor" %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}

@ -27,8 +27,7 @@
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.created_on desc"), :page => 0, :user => @user} %>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<% end %>
<%= error_messages_for 'message' %>
<div class="resources mt10">
<div id="new_course_topic">

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag "init_activity_KindEditor" %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}

@ -27,8 +27,9 @@
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<% end %>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
div.ke-toolbar {

@ -12,7 +12,11 @@
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
/*.ke-container{height: 80px !important;}*/
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<script >
init_KindEditor_data('',80);
</script>

@ -1,9 +1,14 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'blog' %>
<% end %>
<style type="text/css">
/*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
span.ke-toolbar-icon-url{background-image:url("/images/public_icon.png")}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
@ -191,7 +196,7 @@
<div class="homepagePostReplyInputContainer" style="margin-top: 8px">
<div nhname='new_message_<%= @article.id%>' style="display:none;">
<%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%>
<input type="hidden" name="course_id" value="<%= @course.id%>"
<input type="hidden" name="course_id" value="<%= @course.id%>">
<input type="hidden" name="blog_comment[title]" value="RE:<%= @article.title%>">
<input type="hidden" name="blog_comment[sticky]" value="0">
<input type="hidden" name="quote[quote]" value="">

@ -1,5 +1,8 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'new_user' %>
<% end %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %>
<script>

@ -5,7 +5,8 @@
<% @nav_dispaly_forum_label = 1%>
<!-- added by fq -->
<h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= render 'form_create_mode' %>
<%#= link_to l(:button_back), forums_path %>

@ -1,4 +1,8 @@
<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'new_user' %>
<% end %>
<div class="postRightContainer">
<div id="create_memo_div" style="display: none">

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>

@ -8,7 +8,7 @@
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<span class ="<%= get_issue_type(column_content[1])[0] %>" title="<%= get_issue_type(column_content[1])[1] %>"></span>
<div class="problem_txt fl">
<div class="problem_txt fl w600">
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span>
<div class="problem_tit_div fl break_word">

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
</div>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true) %>
<% end %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
</div>

@ -10,7 +10,10 @@
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'prettify' %>
<%= import_ke(enable_at: false, prettify: true, init_activity: false) %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>

@ -14,6 +14,7 @@
<%= heads_for_theme %>
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>

@ -1,4 +1,9 @@
<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'new_user' %>
<% end %>
<script>
function check_and_submit(){

@ -4,8 +4,12 @@
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<!-- <h1>New memo</h1> -->
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="top-content">
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>

@ -1,4 +1,9 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor","forum" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'forum' %>
<% end %>
<style type="text/css">
/*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<script type="text/javascript">
$(function(){

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<%= error_messages_for 'message' %>
<% replying ||= false %>
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
</div>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<li>
<label style="float: left"><span class="c_red">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</label>
<input type="text" name="news[title]" class="hwork_input_news fl" id="news_title" width="576px" onblur="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
</div>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<script>
function check_org_title()
{

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<script>
function check_org_title(title)
{

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<script>
function check_org_title()
{

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'blog' %>
<% end %>
<script>
$(function() {
init_activity_KindEditor_data(<%= @document.id%>,null,"85%");

@ -1,5 +1,9 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}

@ -11,7 +11,10 @@
div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;">
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h4><%= l(:label_user_response) %></h4>

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}

@ -1,5 +1,6 @@
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<script type="text/javascript">
$(function(){

@ -1,4 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}

@ -11,7 +11,10 @@
div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="dis">
<div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>

@ -1,4 +1,8 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor","user" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag "user" %>
<% end %>
<style type="text/css">
/*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}

@ -1,5 +1,6 @@
module RailsKindeditor
module Helper
EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight")})|
def kindeditor_tag(name, content = nil, options = {})
id = sanitize_to_id(name)
@ -9,7 +10,7 @@ module RailsKindeditor
output << text_area_tag(name, content, input_html)
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
:autoHeightMode=>true,
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
afterCreate: EVAL_STR,
emotionsBasePath: 'http://' + Setting.host_name
)))
end
@ -22,7 +23,7 @@ module RailsKindeditor
output_buffer << build_text_area_tag(name, method, self, options, input_html)
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
:autoHeightMode=>true,
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
afterCreate: EVAL_STR,
emotionsBasePath: 'http://' + Setting.host_name
)))
end

@ -0,0 +1,38 @@
function enableAt(_editor) {
var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
}
var ifr = editor.edit.iframe[0];
var doc = ifr.contentDocument || iframe.contentWindow.document;
var ifrBody = doc.body;
ifrBody.contentEditable = true;
console.log("enable at");
$.fn.atwho.debug = true;
if(!atPersonLists){
return;
}
var names = atPersonLists;
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];
//
//var names = $.map(names,function(value,i) {
// return {'id':i,'name':value,'email':value+"@email.com"};
//});
var at_config = {
at: "@",
data: names,
insertTpl: '<span style="color:#269ac9">@${name}(${login})</span>',
displayTpl: "<li>${name} <small>${login}</small></li>",
searchKey: 'searchKey',
limit: 200
}
$inputor = $(ifrBody).atwho(at_config);
window.aaa= $inputor;
$inputor.caret('pos', 47);
$inputor.focus().atwho('run');
};

@ -0,0 +1,49 @@
.atwho-view {
position:absolute;
top: 0;
left: 0;
display: none;
margin-top: 18px;
background: white;
color: black;
border: 1px solid #DDD;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0,0,0,0.1);
min-width: 120px;
max-height: 200px;
overflow: auto;
z-index: 11110 !important;
}
.atwho-view .cur {
background: #3366FF;
color: white;
}
.atwho-view .cur small {
color: white;
}
.atwho-view strong {
color: #3366FF;
}
.atwho-view .cur strong {
color: white;
font:bold;
}
.atwho-view ul {
/* width: 100px; */
list-style:none;
padding:0;
margin:auto;
}
.atwho-view ul li {
display: block;
padding: 5px 10px;
border-bottom: 1px solid #DDD;
cursor: pointer;
/* border-top: 1px solid #C8C8C8; */
}
.atwho-view small {
font-size: smaller;
color: #777;
font-weight: normal;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -145,7 +145,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w583{ width:583px;}
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px;}
.w600{ width:600px !important;}
.h20{height: 20px;}
.h22{ height:22px;}
.h26{ height:26px;}

Loading…
Cancel
Save