diff --git a/app/views/account/about_us.html.erb b/app/views/account/about_us.html.erb index 2d21783ce..f990cd64c 100644 --- a/app/views/account/about_us.html.erb +++ b/app/views/account/about_us.html.erb @@ -1,50 +1,50 @@ -<%= stylesheet_link_tag 'new_user'%> -
-

关于我们

-
-

- Trustie是一个面向高校创新实践的在线协作社区,是在中国高校推行大规模开放在线研究(Massive Open Online Research, MOORE)的支撑平台,也简称Trustie平台。老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。 -

-

- MOORE是国防科学技术大学杨学军院士提出的一个面向高校科研教学活动的新型创新实践概念,为全面支持高校人才培养和科学研究提供了一种新思路。MOORE是对大规模在线开放课程(Massive Open Online Course, MOOC)的拓展,是课堂教学与创新实践深度结合的全新模式,可以看作MOOC2.0。 -

-

- 2005年开始,Trustie研制团队围绕网络时代的软件开发效率和质量这一核心问题展开研究,经过十年的磨砺与攻关,逐步揭示出以大众化协同开发、开放式资源共享、持续性可信评估为核心的互联网大规模协同机理,提出了全新的软件开发群体化方法。2008年起,研制团队开始探索如何将这种协同机理引入软件人才培养。MOORE概念的提出为研制团队的人才培养实践提供了新的发展方向和应用模式,使Trustie技术和工具能够更直接、更有效地与高校人才培养对接,形成了今天已被大量师生接受的在线人才培养平台。 -

-

- 研制团队认为MOORE的创新人才培养模式(如图1左图)是将互联网大规模协同机理与高校创新实践活动相结合的全新人才培养方法和模式,研制团队并基于本平台的架构形成了对MOORE核心机理的三方面认识(如图1右图)。 -

-
- -

图1 基于MOORE的创新人才培养模式与核心机理

-
-

- 目前,Trustie平台已经初步展现出大规模开放在线研究的生态系统蓝图,其核心是在线教学实践平台和在线协同研究平台,如图2。Trustie在线教学实践平台是支持教师和学生围绕课堂学习开展实践的平台(如图2),Trustie在线协同研究平台是支持开发小组围绕实践任务或研究工作开展分布式协作的平台(如图2)。两个核心平台为一名"新手"大学生成长为具有一定创新能力的"创客"提供了从学习到研究的一个渐进式成长环境(如图2)。 -

-

- 特别是,根据师生的实际需要,Trustie平台提供了私有模式和公开模式,支持针对未公开成果实施有效知识产权保护为前提的交流分享(如图2)。随着越来越多的高校、课程和研究小组的加入,MOORE创新实践模式的生态效益将不断显现出来。 -

-
- -

图2 基于MOORE的支撑平台和生态系统

-
-

- 研制团队特别感谢高校老师和学生的积极反馈、无私创意。平台的很多实用便捷的功能都是老师们积极参与和设计的结果,汇聚了大量师生的宝贵贡献,是研制团队和用户群体共同成长的结果。 -

-

- Trustie平台的基本思路是将开源模式与中国高校人才培养活动相结合,但其本质上是一种O2O(Online To Offline)的创新人才培养模式,只有在以下两个方面同步推进,才能在持续解决实际需求的过程中快速发展:
-     (1)构建实践平台,激活创新能力:成为支持不同规模的团队进行协同研究和协同开发的实践平台,支持各类可公开的课程实验任务、教研室科研任务的在线协同,能够有效提升和评估学生的创新能力、协作能力和实践能力。
-     (2)引入开源理念,形成创客文化:将互联网开源软件运动中的自由、对等、共享、创新的理念引入高校,使"自主创意并亲自动手实现创意"的创客精神深入人才培养活动,在学生群体中形成大胆创意、大胆实践的创新文化。 -

-

- 研制团队认为,Trustie平台是一种"互联网+"思维在高校教育领域的大型探索性实践。作为一种互联网应用,Trustie平台自身的开发也采取了互联网模式:Trustie研制团队采用了"网构化软件开发模式",坚持"每周一更"的快速上线、快速体验模式,以最大程度上贴近用户实际需求提升。欢迎高校师生一同投身创新实践,共同见证MOORE创新生态的早日形成。 -

-
- - - -
- - - - +<%= stylesheet_link_tag 'new_user'%> +
+

关于我们

+
+

+ Trustie是一个面向高校创新实践的在线协作社区,是在中国高校推行大规模开放在线研究(Massive Open Online Research, MOORE)的支撑平台,也简称Trustie平台。老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。 +

+

+ MOORE是国防科学技术大学杨学军院士提出的一个面向高校科研教学活动的新型创新实践概念,为全面支持高校人才培养和科学研究提供了一种新思路。MOORE是对大规模在线开放课程(Massive Open Online Course, MOOC)的拓展,是课堂教学与创新实践深度结合的全新模式,可以看作MOOC2.0。 +

+

+ 2005年开始,Trustie研制团队围绕网络时代的软件开发效率和质量这一核心问题展开研究,经过十年的磨砺与攻关,逐步揭示出以大众化协同开发、开放式资源共享、持续性可信评估为核心的互联网大规模协同机理,提出了全新的软件开发群体化方法。2008年起,研制团队开始探索如何将这种协同机理引入软件人才培养。MOORE概念的提出为研制团队的人才培养实践提供了新的发展方向和应用模式,使Trustie技术和工具能够更直接、更有效地与高校人才培养对接,形成了今天已被大量师生接受的在线人才培养平台。 +

+

+ 研制团队认为MOORE的创新人才培养模式(如图1左图)是将互联网大规模协同机理与高校创新实践活动相结合的全新人才培养方法和模式,研制团队并基于本平台的架构形成了对MOORE核心机理的三方面认识(如图1右图)。 +

+
+ +

图1 基于MOORE的创新人才培养模式与核心机理

+
+

+ 目前,Trustie平台已经初步展现出大规模开放在线研究的生态系统蓝图,其核心是在线教学实践平台和在线协同研究平台,如图2。Trustie在线教学实践平台是支持教师和学生围绕课堂学习开展实践的平台(如图2),Trustie在线协同研究平台是支持开发小组围绕实践任务或研究工作开展分布式协作的平台(如图2)。两个核心平台为一名"新手"大学生成长为具有一定创新能力的"创客"提供了从学习到研究的一个渐进式成长环境(如图2)。 +

+

+ 特别是,根据师生的实际需要,Trustie平台提供了私有模式和公开模式,支持针对未公开成果实施有效知识产权保护为前提的交流分享(如图2)。随着越来越多的高校、课程和研究小组的加入,MOORE创新实践模式的生态效益将不断显现出来。 +

+
+ +

图2 基于MOORE的支撑平台和生态系统

+
+

+ 研制团队特别感谢高校老师和学生的积极反馈、无私创意。平台的很多实用便捷的功能都是老师们积极参与和设计的结果,汇聚了大量师生的宝贵贡献,是研制团队和用户群体共同成长的结果。 +

+

+ Trustie平台的基本思路是将开源模式与中国高校人才培养活动相结合,但其本质上是一种O2O(Online To Offline)的创新人才培养模式,只有在以下两个方面同步推进,才能在持续解决实际需求的过程中快速发展:
+     (1)构建实践平台,激活创新能力:成为支持不同规模的团队进行协同研究和协同开发的实践平台,支持各类可公开的课程实验任务、教研室科研任务的在线协同,能够有效提升和评估学生的创新能力、协作能力和实践能力。
+     (2)引入开源理念,形成创客文化:将互联网开源软件运动中的自由、对等、共享、创新的理念引入高校,使"自主创意并亲自动手实现创意"的创客精神深入人才培养活动,在学生群体中形成大胆创意、大胆实践的创新文化。 +

+

+ 研制团队认为,Trustie平台是一种"互联网+"思维在高校教育领域的大型探索性实践。作为一种互联网应用,Trustie平台自身的开发也采取了互联网模式:Trustie研制团队采用了"网构化软件开发模式",坚持"每周一更"的快速上线、快速体验模式,以最大程度上贴近用户实际需求提升。欢迎高校师生一同投身创新实践,共同见证MOORE创新生态的早日形成。 +

+
+ + + +
+ + + + diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index 56f2c5454..ed43f455a 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -1,286 +1,286 @@ -<%= stylesheet_link_tag 'new_user'%> -<%= stylesheet_link_tag 'leftside'%> - - -
-
-
- -
欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。
-
-
-
-
-
-
    -
  • 登录
  • -
  • -
-
-
<%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %>
-
-
- - <%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %> - <%= back_url_hidden_field_tag %> -
- <%= text_field_tag 'username', params[:username], :tabindex => '1' , - :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称', :onkeypress => "user_name_keypress(event);"%> - -
- <% if Setting.openid? %> -
- <%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %> -
- <% end %> -
- - <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%> -
-
- <% if Setting.autologin? %> -
- <%= check_box_tag 'autologin', 1, true, :tabindex => 4 %> -
- <%= l(:label_stay_logged_in) %> - <% end %> - - <% if Setting.lost_password? %> - 忘记密码? - <% end %> -
- <% end %> -
- 登录 -
- -
- -
-
-
-
    -
  • 注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %> -
  • -
-
-
- <%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %> - <%= error_messages_for 'user' %> -
- - <%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%> - -
-
- - <%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %> - -
-
- - <%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %> - -
-
- - <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%> - -
-
-
- -
- 我已阅读并接受Trustie服务协议条款
-
- 注册 - -
- <% end %> -
-
-
-
-
-
+<%= stylesheet_link_tag 'new_user'%> +<%= stylesheet_link_tag 'leftside'%> + + +
+
+
+ +
  欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。

  Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。
+
+
+
+
+
+
    +
  • 登录
  • +
  • +
+
+
<%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %>
+
+
+ + <%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %> + <%= back_url_hidden_field_tag %> +
+ <%= text_field_tag 'username', params[:username], :tabindex => '1' , + :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称', :onkeypress => "user_name_keypress(event);"%> + +
+ <% if Setting.openid? %> +
+ <%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %> +
+ <% end %> +
+ + <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%> +
+
+ <% if Setting.autologin? %> +
+ <%= check_box_tag 'autologin', 1, true, :tabindex => 4 %> +
+ <%= l(:label_stay_logged_in) %> + <% end %> + + <% if Setting.lost_password? %> + 忘记密码? + <% end %> +
+ <% end %> +
+ 登录 +
+ +
+ +
+
+
+
    +
  • 注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %> +
  • +
+
+
+ <%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %> + <%= error_messages_for 'user' %> +
+ + <%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%> + +
+
+ + <%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %> + +
+
+ + <%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %> + +
+
+ + <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%> + +
+
+
+ +
+ 我已阅读并接受Trustie服务协议条款
+
+ 注册 + +
+ <% end %> +
+
+
+
+
+
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 1587cbfb1..5f820d923 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -24,7 +24,6 @@ 发帖时间:<%= format_time(activity.created_on) %> -
<% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> @@ -67,21 +66,6 @@ <% end %>
-
-
- <%= 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|%> - - - -

-
- 取消 - 发送 - <% end%> -
-
-
- <% activity= activity.parent ? activity.parent : activity%> <% replies_all_i = 0 %> <% if count > 0 %> @@ -91,7 +75,7 @@ <% replies_all_i=replies_all_i+1 %>
  • - <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %> + <%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %>
    @@ -112,5 +96,25 @@
    <% end %> + +
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= 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|%> + + + + 发送 +
    +
    +

    + <% end%> +
    +
    +
    +
    +
    +
    diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 857ae3697..f9745f59e 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -40,20 +40,6 @@ <% end %> -
    -
    - <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> - - -

    -
    - 取消 - 发送 - <% end%> -
    -
    -
    - <% replies_all_i = 0 %> <% if count > 0 %>
    @@ -62,7 +48,7 @@ <% replies_all_i = replies_all_i + 1 %>
  • - <%= link_to image_tag(url_to_avatar(comment.author), :width => "45", :height => "45"), user_path(comment.author_id), :alt => "用户头像" %> + <%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
    @@ -81,5 +67,21 @@
    <% end %> + +
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> + + +
    + 发送 +

    + <% end%> +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index e0e093f2d..e3ef7c41d 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -78,20 +78,6 @@ <% end %> -
    -
    - <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> - - -

    -
    - 取消 - 发送 - <% end%> -
    -
    -
    - <% replies_all_i = 0 %> <% if count > 0 %>
    @@ -100,7 +86,7 @@ <% replies_all_i=replies_all_i + 1 %>
  • - <%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %> + <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
    @@ -129,6 +115,23 @@
    <% end %> + +
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    +
    + <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> + + +
    + 发送 +

    + <% end%> +
    +
    +
    +
    +
    - <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> - <% case user_activity.container_type.to_s %> - <% when 'Course' %> - <% if act %> - <% case user_activity.act_type.to_s %> - <% when 'HomeworkCommon' %> - <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% when 'News' %> - <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% when 'Message'%> - <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% when 'Poll' %> - <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %> - <% end %> - <% end %> - <% when 'Project' %> - <% if act %> - <% case user_activity.act_type.to_s %> - <% when 'Issue' %> - <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% when 'Message' %> - <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> - <% end %> - <% end %> - <% end %> - <% end %> -<% end %> - -<% if user_activities.count == 10%> -
    展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %>
    - <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> -<% end%> - - + <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> + <% case user_activity.container_type.to_s %> + <% when 'Course' %> + <% if act %> + <% case user_activity.act_type.to_s %> + <% when 'HomeworkCommon' %> + <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% when 'News' %> + <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% when 'Message'%> + <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% when 'Poll' %> + <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %> + <% end %> + <% end %> + <% when 'Project' %> + <% if act %> + <% case user_activity.act_type.to_s %> + <% when 'Issue' %> + <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% when 'Message' %> + <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <% end %> + <% end %> + <% end %> + <% end %> +<% end %> + +<% if user_activities.count == 10%> +
    展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %>
    + <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> +<% end%> + + \ No newline at end of file diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js index 18e7182fb..f9b94e2d3 100644 --- a/public/javascripts/init_KindEditor.js +++ b/public/javascripts/init_KindEditor.js @@ -1,122 +1,126 @@ -function init_editor(params){ - // var minHeight; //最小高度 - var paramsHeight = params.height; //设定的高度 - - var editor = params.kindutil.create(params.textarea, { - resizeType : 1,minWidth:"1px",width:"100%", - height:"30px",// == undefined ? "30px":paramsHeight+"px", - 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)); - }, - afterCreate:function(){ - var toolbar = $("div[class='ke-toolbar']",params.div_form); - $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); - params.toolbar_container.append(toolbar); - //init - var edit = this.edit; - var body = edit.doc.body; - edit.iframe[0].scroll = 'no'; - body.style.overflowY = 'hidden'; - //reset height - var edit = this.edit; - var body = edit.doc.body; - paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; - edit.iframe.height(paramsHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight)); - - } - }).loadPlugin('paste'); - return editor; -} - -function nh_check_field(params){ - var result=true; - if(params.content!=undefined){ - if(params.content.isEmpty()){ - result=false; - } - if(params.content.html()!=params.textarea.html() || params.issubmit==true){ - params.textarea.html(params.content.html()); - params.content.sync(); - if(params.content.isEmpty()){ - params.contentmsg.html('内容不能为空'); - params.contentmsg.css({color:'#ff0000'}); - }else{ - params.contentmsg.html('填写正确'); - params.contentmsg.css({color:'#008000'}); - } - params.contentmsg.show(); - } - } - return result; -} -function init_form(params){ - params.form.submit(function(){ - var flag = false; - if(params.form.attr('data-remote') != undefined ){ - flag = true - } - var is_checked = nh_check_field({ - issubmit:true, - content:params.editor, - contentmsg:params.contentmsg, - textarea:params.textarea - }); - if(is_checked){ - if(flag){ - return true; - }else{ - $(this)[0].submit(); - return false; - } - } - return false; - }); -} -function nh_reset_form(params){ - params.form[0].reset(); - params.textarea.empty(); - if(params.editor != undefined){ - params.editor.html(params.textarea.html()); - } - params.contentmsg.hide(); -} -//第二个参数是高度,可以传,可以不传 -function init_KindEditor_data(id){ - var height = arguments[1] ? arguments[1] : undefined; - KindEditor.ready(function (K) { - $("div[nhname='new_message_" + id + "']").each(function () { - var params = {}; - params.kindutil = K; - params.div_form = $(this); - params.form = $("form", params.div_form); - if (params.form == undefined || params.form.length == 0) { - return; - } - params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form); - params.contentmsg = $("p[nhname='contentmsg_" + id + "']", params.div_form); - params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); - params.cancel_btn = $("#new_message_cancel_btn_" + id); - params.submit_btn = $("#new_message_submit_btn_" + id); - params.height = height; - if (params.textarea.data('init') == undefined) { - params.editor = init_editor(params); - init_form(params); - params.cancel_btn.click(function () { - nh_reset_form(params); - }); - params.submit_btn.click(function () { - params.form.submit(); - }); - params.textarea.data('init', 1); - $(this).show(); - } - }); - }); +function init_editor(params){ + // var minHeight; //最小高度 + var paramsHeight = params.height; //设定的高度 + var paramsWidth = params.width == undefined ? "100%" : params.width; + + var editor = params.kindutil.create(params.textarea, { + resizeType : 1,minWidth:"1px",width:paramsWidth, + height:"30px",// == undefined ? "30px":paramsHeight+"px", + 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)); + }, + afterCreate:function(){ + 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); + //init + var edit = this.edit; + var body = edit.doc.body; + edit.iframe[0].scroll = 'no'; + body.style.overflowY = 'hidden'; + //reset height + var edit = this.edit; + var body = edit.doc.body; + paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; + edit.iframe.height(paramsHeight); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight)); + + } + }).loadPlugin('paste'); + return editor; +} + +function nh_check_field(params){ + var result=true; + if(params.content!=undefined){ + if(params.content.isEmpty()){ + result=false; + } + if(params.content.html()!=params.textarea.html() || params.issubmit==true){ + params.textarea.html(params.content.html()); + params.content.sync(); + if(params.content.isEmpty()){ + params.contentmsg.html('内容不能为空'); + params.contentmsg.css({color:'#ff0000'}); + }else{ + params.contentmsg.html('填写正确'); + params.contentmsg.css({color:'#008000'}); + } + params.contentmsg.show(); + } + } + return result; +} +function init_form(params){ + params.form.submit(function(){ + var flag = false; + if(params.form.attr('data-remote') != undefined ){ + flag = true + } + var is_checked = nh_check_field({ + issubmit:true, + content:params.editor, + contentmsg:params.contentmsg, + textarea:params.textarea + }); + if(is_checked){ + if(flag){ + return true; + }else{ + $(this)[0].submit(); + return false; + } + } + return false; + }); +} +function nh_reset_form(params){ + params.form[0].reset(); + params.textarea.empty(); + if(params.editor != undefined){ + params.editor.html(params.textarea.html()); + } + params.contentmsg.hide(); +} +//第二个参数是高度,可以传,可以不传 +function init_KindEditor_data(id){ + var height = arguments[1] ? arguments[1] : undefined; + var width = arguments[2] ? arguments[2] : undefined; + KindEditor.ready(function (K) { + $("div[nhname='new_message_" + id + "']").each(function () { + var params = {}; + params.kindutil = K; + params.div_form = $(this); + params.form = $("form", params.div_form); + if (params.form == undefined || params.form.length == 0) { + return; + } + params.textarea = $("textarea[nhname='new_message_textarea_" + id + "']", params.div_form); + params.contentmsg = $("p[nhname='contentmsg_" + id + "']", params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); + params.cancel_btn = $("#new_message_cancel_btn_" + id); + params.submit_btn = $("#new_message_submit_btn_" + id); + params.height = height; + params.width = width; + if (params.textarea.data('init') == undefined) { + params.editor = init_editor(params); + init_form(params); + params.cancel_btn.click(function () { + nh_reset_form(params); + }); + params.submit_btn.click(function () { + params.form.submit(); + }); + params.textarea.data('init', 1); + $(this).show(); + } + }); + }); } \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index c526b3245..2fb72c439 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -562,7 +562,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;} .homepagePostReplyBannerTime{width:85px; display:inline-block;} .homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;} -.homepagePostReplyInputContainer {width:680px; margin: 10px auto 0 auto;} +.homepagePostReplyInputContainer {width:630px; float:left;} .homepagePostReplyInput {width:663px; height:45px; max-width:663px; max-height:45px; border:1px solid #d9d9d9; outline:none; margin:20px auto 10px auto;} .homepagePostReplyEmotion {background:url(../images/homepage_icon.png) -90px -88px no-repeat; width:50px; height:24px; float:left; padding-left:30px;} .homepagePostReplySubmit {float:right; width:45px; height:24px; text-align:center; line-height:24px; vertical-align:middle; font-size:12px; color:#ffffff; background-color:#269ac9;} @@ -582,7 +582,7 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;} a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} -.homepagePostReplyPortrait {float:left; width:45px;} +.homepagePostReplyPortrait {float:left; width:33px;} .homepagePostReplyDes {float:left; width:620px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#888888; margin-bottom:5px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} @@ -665,16 +665,18 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} /*20150826忘记密码 LB*/ -.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;margin: 10px auto 20px auto;} +.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px; margin:20px auto;} .BgBox_h2{ font-size:16px; color:#484848; width:968px;border-bottom:1px solid #e3e3e3; padding-bottom:5px;} -.NomalInput{width:308px; height:38px; border:1px solid #98a1a6 !important; outline:none; color:#888888; font-size:14px;} -.BgBoxCon{ width:310px; margin:80px auto;} +.NomalInput{width:308px; height:38px; border:1px solid #98a1a6; outline:none; color:#888888; font-size:14px;} +.BgBoxCon{ width:310px; margin:140px auto 520px;} .BgBoxConP{ font-size:14px; color:#484848;} .LoginButton {width:315px; height:40px; background-color:#269ac9; font-size:14px; text-align:center; line-height:40px; vertical-align:middle;} .LoginButton:hover {background-color:#297fb8;} /*20150826协议 LB*/ .AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;} -.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px; border: none;} +.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px;} +.AgreementTxt{text-indent:2em; margin-bottom:15px;} +.AgreementImg{ margin:0px auto; width:619px;} /*底部*/ #Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/