From 3aaa078a4bad4a0976d1c4bc3ce50b7399072547 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 16:26:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/_project_activities.html.erb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index deb0af842..7fc5c347c 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -1,4 +1,4 @@ -<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> +<%= import_ke(enable_at: true,init_activity: true) %> <% unless forge_acts.empty? %> <% forge_acts.each do |activity| -%> @@ -68,7 +68,7 @@ } $(function () { - init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>"); + sd_create_editor_from_data(<%= activity.id %>, null, "100%", "<%= activity.class.to_s %>"); }); From dc3278274d5e7ae262a809047ef7a7625ef5dc30 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 29 Jan 2016 16:55:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9kindeditor=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- .../_simple_ke_reply_form.html.erb | 2 +- app/views/blog_comments/quote.js.erb | 2 +- app/views/blog_comments/reply.js.erb | 2 +- app/views/blog_comments/show.html.erb | 2 +- app/views/blogs/_article.html.erb | 2 +- app/views/blogs/_article_list.html.erb | 22 +++++++++---------- app/views/boards/_course_show_detail.html.erb | 2 +- .../boards/_project_show_detail.html.erb | 2 +- app/views/comments/create.js.erb | 2 +- app/views/courses/_course_activity.html.erb | 2 +- app/views/courses/_courses_jours.html.erb | 2 +- app/views/courses/syllabus.html.erb | 4 ++-- .../set_evaluation_attr.js.erb | 4 ++-- .../start_anonymous_comment.js.erb | 4 ++-- .../stop_anonymous_comment.js.erb | 4 ++-- app/views/issues/_list.html.erb | 2 +- app/views/issues/add_journal.js.erb | 3 ++- app/views/issues/add_journal_in_org.js.erb | 2 +- app/views/memos/show.html.erb | 4 ++-- app/views/messages/_course_show.html.erb | 4 ++-- .../messages/_org_subfield_show.html.erb | 2 +- app/views/messages/_project_show.html.erb | 2 +- app/views/messages/_reply_message.html.erb | 2 +- app/views/messages/quote.js.erb | 2 +- app/views/messages/reply.js.erb | 2 +- app/views/news/_course_news_detail.html.erb | 2 +- app/views/news/_project_news_detail.html.erb | 2 +- .../_reply_form.html.erb | 2 +- .../_simple_ke_reply_form.html.erb | 2 +- .../org_document_comments/add_reply.js.erb | 2 +- .../org_document_comments/index.html.erb | 2 +- app/views/org_document_comments/quote.js.erb | 2 +- app/views/org_document_comments/show.html.erb | 2 +- .../org_subfields/_show_details.html.erb | 2 +- .../organizations/_org_activities.html.erb | 2 +- .../_org_course_homework.html.erb | 2 +- .../_org_course_message.html.erb | 2 +- .../organizations/_org_course_news.html.erb | 2 +- .../organizations/_org_project_issue.html.erb | 2 +- .../_org_subfield_message.html.erb | 2 +- .../organizations/_org_subfield_news.html.erb | 2 +- .../organizations/_project_message.html.erb | 2 +- .../organizations/_show_org_document.html.erb | 3 +-- app/views/organizations/show.html.erb | 2 +- .../projects/_project_activities.html.erb | 2 +- app/views/projects/_project_news.html.erb | 2 +- .../student_work/cancel_relate_project.js.erb | 4 ++-- .../forbidden_anonymous_comment.js.erb | 4 ++-- app/views/student_work/set_score_rule.js.erb | 4 ++-- .../student_work/student_work_project.js.erb | 4 ++-- app/views/users/_course_homework.html.erb | 2 +- .../users/_course_journalsformessage.html.erb | 2 +- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/_project_issue_reply.html.erb | 2 +- app/views/users/_project_message.html.erb | 2 +- app/views/users/_project_news.html.erb | 2 +- app/views/users/_user_activities.html.erb | 21 +++++++++--------- app/views/users/_user_blog.html.erb | 2 +- .../users/_user_homework_detail.html.erb | 2 +- app/views/users/_user_homework_list.html.erb | 2 +- .../users/_user_journalsformessage.html.erb | 2 +- app/views/users/_user_jours_list.html.erb | 20 ++++++++--------- app/views/words/create_reply.js.erb | 2 +- app/views/words/destroy.js.erb | 4 ++-- app/views/words/leave_homework_message.js.erb | 4 ++-- 67 files changed, 109 insertions(+), 108 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3a0808bdd..ab091b61c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2808,7 +2808,7 @@ int main(int argc, char** argv){ end if opt[:init_activity] - ss += javascript_include_tag "init_activity_KindEditor" + ss += javascript_include_tag "create_kindeditor" end ss.html_safe diff --git a/app/views/blog_comments/_simple_ke_reply_form.html.erb b/app/views/blog_comments/_simple_ke_reply_form.html.erb index 61669058b..292587cad 100644 --- a/app/views/blog_comments/_simple_ke_reply_form.html.erb +++ b/app/views/blog_comments/_simple_ke_reply_form.html.erb @@ -21,8 +21,8 @@ <% end %> +
-

diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb index cd53707d5..9bd226ce1 100644 --- a/app/views/blog_comments/quote.js.erb +++ b/app/views/blog_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%", "<%=@blogComment.class.to_s%>"); + sd_create_editor_from_data(<%= @blogComment.id%>,null,"100%", "<%=@blogComment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @blogComment.id%>").length >0) { $("#reply_to_message_<%= @blogComment.id%>").replaceWith("

"); diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb index 2a4e71f1c..915ab892d 100644 --- a/app/views/blog_comments/reply.js.erb +++ b/app/views/blog_comments/reply.js.erb @@ -5,4 +5,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); //init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity'); <% end %> -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); \ No newline at end of file diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index 4a407089f..e6d8be24e 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"85%", '<%=@article.class.to_s%>'); + sd_create_editor_from_data(<%= @article.id%>,null,"100%", '<%=@article.class.to_s%>'); showNormalImage('message_description_<%= @article.id %>'); }); diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 4ca86e7ae..05f69055f 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -198,8 +198,8 @@ +
-

diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb index ca85c0ba2..f3fd1aa61 100644 --- a/app/views/blogs/_article_list.html.erb +++ b/app/views/blogs/_article_list.html.erb @@ -1,19 +1,19 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor" %> + <%= javascript_include_tag "create_kindeditor" %> <% end %> <% if topic %> diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb index 1898fce02..88fd7d224 100644 --- a/app/views/boards/_course_show_detail.html.erb +++ b/app/views/boards/_course_show_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>"); + sd_create_editor_from_data(<%= topic.id%>, null, "100%", "<%=topic.class.to_s%>"); }); <% if topic %> diff --git a/app/views/boards/_project_show_detail.html.erb b/app/views/boards/_project_show_detail.html.erb index 367f0552c..fc24dfd09 100644 --- a/app/views/boards/_project_show_detail.html.erb +++ b/app/views/boards/_project_show_detail.html.erb @@ -39,7 +39,7 @@ } $(function () { - init_activity_KindEditor_data(<%= topic.id%>, null, "87%"); + sd_create_editor_from_data(<%= topic.id%>, null, "100%"); }); <% if topic %> diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index f94eda065..0814b5f50 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -5,4 +5,4 @@ <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% end %> -init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity"); +sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity"); diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 1b0d5330d..65aa142af 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -107,7 +107,7 @@ } $(function () { - init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>"); + sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>"); }); <% if activity && activity.course_act%> diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 0c4f4c1e0..c7e4a7428 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -32,9 +32,9 @@
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> +

-
取消 留言 <% end %> diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb index c9d333e6d..3bace514b 100644 --- a/app/views/courses/syllabus.html.erb +++ b/app/views/courses/syllabus.html.erb @@ -40,7 +40,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>"); + sd_create_editor_from_data(<%= @article.id%>,null,"100%", "<%=@article.class.to_s%>"); showNormalImage('message_description_<%= @article.id %>'); }); @@ -201,8 +201,8 @@ +
-

diff --git a/app/views/homework_common/set_evaluation_attr.js.erb b/app/views/homework_common/set_evaluation_attr.js.erb index 73436750c..987abd351 100644 --- a/app/views/homework_common/set_evaluation_attr.js.erb +++ b/app/views/homework_common/set_evaluation_attr.js.erb @@ -1,8 +1,8 @@ clickCanel(); <% if @user_activity_id != -1 %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% else %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% end %> \ No newline at end of file diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb index 8b2e9ed04..91a68011e 100644 --- a/app/views/homework_common/start_anonymous_comment.js.erb +++ b/app/views/homework_common/start_anonymous_comment.js.erb @@ -3,11 +3,11 @@ <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); + sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% end %> /*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/ <% elsif @statue == 2 %> diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 2f8d8c6d6..874374476 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -2,11 +2,11 @@ alert('关闭成功'); <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>"); +sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity'); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); <% end %> /* $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 2a1ae56d4..3ee20ee2a 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -18,7 +18,7 @@ } $(function () { - init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>"); + sd_create_editor_from_data(<%= issue.id%>, null, "100%", "<%= issue.class.name %>"); }); <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index 9099c31b6..43d7f741b 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -21,6 +21,7 @@ sd_create_editor_from_data(<%= @issue.id %>, null, "100%"); <%else%> $("#div_user_issue_reply_<%=@user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); + sd_create_editor_from_data(<%= @user_activity_id %>, null, "100%", "UserActivity"); +//init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", 'UserActivity'); // sd_create_editor_from_data(<%#= @issue.id%>, null, "100%"); <%end %> diff --git a/app/views/issues/add_journal_in_org.js.erb b/app/views/issues/add_journal_in_org.js.erb index 34e874f13..ed4666d0c 100644 --- a/app/views/issues/add_journal_in_org.js.erb +++ b/app/views/issues/add_journal_in_org.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 3028f3369..e59c8359d 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -34,7 +34,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>"); + sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>"); }); function del_confirm(){ @@ -124,8 +124,8 @@ <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> +
-

diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 022b8c76b..00f22cc95 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -27,7 +27,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); @@ -175,4 +175,4 @@ postContent = postContent.replace(/ /g," "); $("#message_description_<%= @topic.id %>").html(postContent); }); - + diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb index fab0f752e..5fc7ed746 100644 --- a/app/views/messages/_org_subfield_show.html.erb +++ b/app/views/messages/_org_subfield_show.html.erb @@ -58,7 +58,7 @@ } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index a0e9db171..2009c7133 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -88,7 +88,7 @@ } } $(function() { - init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>"); + sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>"); showNormalImage('message_description_<%= @topic.id %>'); }); diff --git a/app/views/messages/_reply_message.html.erb b/app/views/messages/_reply_message.html.erb index a859a088a..15cb465de 100644 --- a/app/views/messages/_reply_message.html.erb +++ b/app/views/messages/_reply_message.html.erb @@ -18,8 +18,8 @@ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'new_form'} do |f| %> +
-

diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb index b0e8ecb85..89f953bb9 100644 --- a/app/views/messages/quote.js.erb +++ b/app/views/messages/quote.js.erb @@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>"); + sd_create_editor_from_data(<%= @message.id%>,null,"100%", "<%=@message.class.to_s%>"); }); }else if($("#reply_to_message_<%= @message.id%>").length >0) { $("#reply_to_message_<%= @message.id%>").replaceWith("

"); diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index f61de74f0..385a49a82 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -5,4 +5,4 @@ <% elsif @org_subfield %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); <%end%> -init_activity_KindEditor_data(<%= @user_activity_id %>,"","87%", "UserActivity"); \ No newline at end of file +sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity"); \ No newline at end of file diff --git a/app/views/news/_course_news_detail.html.erb b/app/views/news/_course_news_detail.html.erb index 954f7dbf1..6092a8590 100644 --- a/app/views/news/_course_news_detail.html.erb +++ b/app/views/news/_course_news_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= news.id%>, null, "87%"); + sd_create_editor_from_data(<%= news.id%>, null, "100%"); showNormalImage('activity_description_<%= news.id %>'); }); diff --git a/app/views/news/_project_news_detail.html.erb b/app/views/news/_project_news_detail.html.erb index fdb035bf5..a0610ae63 100644 --- a/app/views/news/_project_news_detail.html.erb +++ b/app/views/news/_project_news_detail.html.erb @@ -40,7 +40,7 @@ } $(function () { - init_activity_KindEditor_data(<%= news.id%>, null, "87%"); + sd_create_editor_from_data(<%= news.id%>, null, "100%"); showNormalImage('activity_description_<%= news.id %>'); }); diff --git a/app/views/org_document_comments/_reply_form.html.erb b/app/views/org_document_comments/_reply_form.html.erb index 8808ff8b7..60db259c6 100644 --- a/app/views/org_document_comments/_reply_form.html.erb +++ b/app/views/org_document_comments/_reply_form.html.erb @@ -1,2 +1,2 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); +sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); diff --git a/app/views/org_document_comments/_simple_ke_reply_form.html.erb b/app/views/org_document_comments/_simple_ke_reply_form.html.erb index cfa197ff4..c0166f5ce 100644 --- a/app/views/org_document_comments/_simple_ke_reply_form.html.erb +++ b/app/views/org_document_comments/_simple_ke_reply_form.html.erb @@ -18,8 +18,8 @@ <%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %> +
-

diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb index 968d7295d..79858dd03 100644 --- a/app/views/org_document_comments/add_reply.js.erb +++ b/app/views/org_document_comments/add_reply.js.erb @@ -1,2 +1,2 @@ $("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>"); -init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>"); +sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>"); diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index 7734a2853..7dba82d9a 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -19,7 +19,7 @@ <% @documents.each do |document| %> <%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %> diff --git a/app/views/org_document_comments/quote.js.erb b/app/views/org_document_comments/quote.js.erb index 7ea5daf7b..53d22eb58 100644 --- a/app/views/org_document_comments/quote.js.erb +++ b/app/views/org_document_comments/quote.js.erb @@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) { $(function(){ $('#reply_subject').val("<%= raw escape_javascript(@subject) %>"); $('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>"); - init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>"); + sd_create_editor_from_data(<%= @org_comment.id%>,null,"100%", "<%=@org_comment.class.to_s%>"); }); }else if($("#reply_to_message_<%= @org_comment.id %>").length >0) { $("#reply_to_message_<%= @org_comment.id%>").replaceWith("

"); diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 405631369..561364d64 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -1,7 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %> diff --git a/app/views/org_subfields/_show_details.html.erb b/app/views/org_subfields/_show_details.html.erb index eda9c9d57..3a605f75d 100644 --- a/app/views/org_subfields/_show_details.html.erb +++ b/app/views/org_subfields/_show_details.html.erb @@ -38,7 +38,7 @@ <% org_activities.each do |act| %> <% if act.container_type == 'Organization' %> diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index 6579ccbca..20b98ffa0 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -38,7 +38,7 @@ <% org_activities.each do |act| %> <% if act.container_type == 'Organization' %> diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 3dccdcc2b..b5e3c6958 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -326,8 +326,8 @@ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'course_activity',params[:course_activity],:value =>course_activity %> +
-

diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index 339ff8b26..4f13e1b4f 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -142,8 +142,8 @@ <%= 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/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index b6e2f74ef..665f5c1ae 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -108,8 +108,8 @@
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> +
-

diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 763a76d5e..2495e0044 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -125,8 +125,8 @@
<%= form_for('new_form',:url => add_journal_in_org_issue_path(activity.id),:method => "post", :remote => true) do |f|%> +
-

diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index a14138903..4763089a0 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -143,8 +143,8 @@ <%= 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/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 41eb473e8..891ad14a7 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -128,8 +128,8 @@
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> +
-

diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index baa687107..6cc3f5740 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -120,8 +120,8 @@ <%= 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/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index b29bac7d1..da458636a 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -117,9 +117,8 @@
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> +
- -
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 78fb12279..a271abe02 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -61,7 +61,7 @@ <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %> <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index 7fc5c347c..062d64096 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -1,4 +1,4 @@ -<%= import_ke(enable_at: true,init_activity: true) %> +<%= import_ke(enable_at: true, prettify: false, init_activity: true) %> <% user_activities.each do |user_activity| if user_activities %> @@ -74,7 +75,7 @@ } $(function() { - init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%", "<%=user_activity.class.to_s%>"); + sd_create_editor_from_data(<%= user_activity.id %>, null, "100%", "<%= user_activity.class.to_s %>"); }); <% unless user_activity.act_type == "ProjectCreateInfo" %> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 7658bc581..244951dfa 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -120,8 +120,8 @@ +
-

diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 36b2be34f..01673d164 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -328,8 +328,8 @@ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %> <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %> +
-

diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 36f823a9a..e55065c52 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -17,7 +17,7 @@ <% homework_commons.each do |homework_common|%> <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>0} %> diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index d4d9a2cd7..285866f9d 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -5,7 +5,7 @@ <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); <% end %> - init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); + sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity"); <% else %> <% if !@jfm.nil? && @jfm.jour_type == 'Principal' %> $("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>"); diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 6a56249a3..cd48ae74c 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -19,10 +19,10 @@ <% elsif @homework%> <% if @user_activity_id == -1 %> $("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); - init_activity_KindEditor_data(<%= @homework.id%>,"","87%"); + sd_create_editor_from_data(<%= @homework.id%>,"","100%"); <% else %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%"); <% end %> <% end %> var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb index 5eeb9ce64..acb16be50 100644 --- a/app/views/words/leave_homework_message.js.erb +++ b/app/views/words/leave_homework_message.js.erb @@ -1,7 +1,7 @@ <% if @user_activity_id %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity"); + sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% elsif @homework_common_id && @is_in_course %> $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>"); - init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%", "HomeworkCommon"); + sd_create_editor_from_data(<%= @homework_common_id%>,"","100%", "HomeworkCommon"); <% end %> From cdd997e45ef4ab1d7de64403de5d4eedf0a21603 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 1 Feb 2016 14:50:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?kindeditor=E5=9B=9E=E5=A4=8D=E6=A1=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blog_comments/show.html.erb | 2 +- app/views/boards/_course_show_detail.html.erb | 20 ++++---- .../boards/_project_show_detail.html.erb | 20 ++++---- app/views/courses/_course_activity.html.erb | 48 ------------------- app/views/issues/index.html.erb | 18 +++---- app/views/news/_course_news_detail.html.erb | 20 ++++---- app/views/news/_project_news_detail.html.erb | 20 ++++---- .../org_document_comments/index.html.erb | 12 ----- app/views/org_document_comments/show.html.erb | 2 +- .../org_subfields/_show_post_type.html.erb | 13 ----- app/views/organizations/show.html.erb | 12 ----- app/views/users/_user_homework_list.html.erb | 12 ----- 12 files changed, 51 insertions(+), 148 deletions(-) diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index e6d8be24e..856a122d3 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -1,6 +1,6 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor",'blog' %> + <%= javascript_include_tag "create_kindeditor",'blog' %> <% end %> <% course_activities.each do |activity| if course_activities %>