From 069c1ddf3c1040f17cf022994bed89dc5fa34c5c Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 15 Sep 2015 15:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E8=AF=84=E8=AE=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_show.html.erb | 5 +- app/views/users/_course_news_reply.html.erb | 177 ------------- app/views/users/show_chen.erb | 279 -------------------- public/javascripts/course.js | 19 +- 4 files changed, 20 insertions(+), 460 deletions(-) delete mode 100644 app/views/users/_course_news_reply.html.erb delete mode 100644 app/views/users/show_chen.erb diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 0baafd513..9ae951779 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -32,7 +32,8 @@ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%> -

+

+

<%= l(:label_cancel_with_space) %> @@ -76,4 +77,4 @@ <% end %> -<% html_title @news.title -%> +<% html_title @news.title -%> \ No newline at end of file diff --git a/app/views/users/_course_news_reply.html.erb b/app/views/users/_course_news_reply.html.erb deleted file mode 100644 index c3f8571be..000000000 --- a/app/views/users/_course_news_reply.html.erb +++ /dev/null @@ -1,177 +0,0 @@ - -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> - -<% if @news.commentable? %> -

-

<%= l(:label_comment_add) %>

- <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %> -
- <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%> -
-

- - <%= l(:label_cancel_with_space) %> - - - <%= l(:label_comment_with_space) %> - -

- <% end %> -
-<% end %> - -
- - <%= form_for('new_form', :method => :post, - :url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - -

- <% end %> -
-
-
- 取  消 - - 发送 - -
-
- -
- - - - - diff --git a/app/views/users/show_chen.erb b/app/views/users/show_chen.erb deleted file mode 100644 index 3bd0014c6..000000000 --- a/app/views/users/show_chen.erb +++ /dev/null @@ -1,279 +0,0 @@ -
-
-
最新动态
- -
- -
-
- 用户头像
-
- - -
- -
截止时间:2015-08-20
-
-
(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
- -
-
-
-
-
-
-
- 用户头像
-
- - -
- -
截止时间:2015-08-20
-
-
(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
- -
-
-
-
- - - -
-
-
- 用户头像
-
- - -
- 时间:2015-07-31 -
-
- -
-
-
-
-
-
-
回复(5)
-
2015-07-31
- -
-
- -
-
- - - -
-
-
-
- 用户头像 -
-
-
黄井泉 学生 - 2015-08-01删除 -
-
很开心!
-
-
-
-
-
- 用户头像 -
-
-
陈正东 学生 - 2015-08-02删除 -
-
假期好热,没出去。
-
-
-
-
-
-
-
-
- 用户头像
-
- - -
-
指派给  苏稳 -
-
时间:2015-08-20
-
-
(缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
-
- 文件附件.zip(123KB) -
-
- 图片附件.png(123KB) -
-
- -
-
-
-
-
-
-
回复(5)
-
2015-07-26
- -
-
- -
-
- - - -
-
-
-
- 用户头像 -
-
-
尹教授 - 2015-08-01删除 -
-
请大家说下软件工程是什么!
-
-
-
-
-
- 用户头像 -
-
-
Tang 学生 - 2015-08-01删除 -
-
软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
-
-
-
-
-
\ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index e5c50ac51..fc52ef87a 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -260,8 +260,23 @@ function submitFocus(obj) function submitComment() { - comment_editor.sync(); - $("#add_comment_form").submit(); + if (newsReplyVerify()) { + comment_editor.sync(); + $("#add_comment_form").submit(); + } +} + +function newsReplyVerify() { + var content = comment_editor.html(); + if(content.length == 0) { + $("#add_reply_news").text("评论不能为空"); + $("#add_reply_news").css('color', '#ff0000'); + return false; + } else { + $("#add_reply_news").text("填写正确"); + $("#add_reply_news").css('color', '#008000'); + return true; + } } /////////////////////////////////////////////////课程讨论区