Merge branch 'szzh' into develop
This commit is contained in:
commit
5643ad3fa5
|
@ -150,6 +150,10 @@ class HomeworkCommonController < ApplicationController
|
|||
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||
@homework.course_id = params[:course_id]
|
||||
|
||||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? @homework.end_time + 7 : params[:evaluation_start]
|
||||
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end]
|
||||
|
||||
@homework.save_attachments(params[:attachments])
|
||||
render_attachment_warning_if_needed(@homework)
|
||||
|
||||
|
|
|
@ -259,7 +259,8 @@ class ProjectsController < ApplicationController
|
|||
# Author lizanle
|
||||
# Description 项目动态展示方法,删除了不必要的代码
|
||||
def show
|
||||
update_invite_message(User.current, @project)
|
||||
# 更新消息为已读
|
||||
update_message_status(User.current, @project)
|
||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
end
|
||||
|
@ -464,12 +465,11 @@ class ProjectsController < ApplicationController
|
|||
# by young
|
||||
# include CoursesHelper
|
||||
def member
|
||||
# 更新消息状态
|
||||
update_invite_message(User.current, @project)
|
||||
# 消息"同意加入项目"
|
||||
if params[:message_id]
|
||||
message_invite(params[:message_id], params[:key])
|
||||
end
|
||||
update_message_status(User.current, @project)
|
||||
# params[:login]为邮箱邀请用户加入,主要功能:
|
||||
# 1、自动注册
|
||||
# 2、加入项目、创建角色
|
||||
|
@ -525,18 +525,21 @@ class ProjectsController < ApplicationController
|
|||
@members = paginateHelper @members
|
||||
end
|
||||
|
||||
def update_invite_message(user, project)
|
||||
forge_invite_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =?", user, project, "ProjectInvite")
|
||||
forge_invite_messages.each do |forge_invite_messages|
|
||||
forge_invite_messages.update_attribute(:viewed, true)
|
||||
def update_message_status(user, project)
|
||||
project_invite_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =?", user, project, "ProjectInvite")
|
||||
project_invite_messages.each do |project_invite_message|
|
||||
project_invite_message.update_attribute(:viewed, true)
|
||||
end
|
||||
end
|
||||
|
||||
def message_invite(message_id, key)
|
||||
forge_message = ForgeMessage.find(message_id)
|
||||
if key == forge_message.secret_key
|
||||
Member.create(:role_ids => [4], :user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
UserGrade.create(:user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
# 情况:用户收到邀请邮件还没看,但是管理员已经把该用户添加进项目
|
||||
if Member.where("user_id =? and project_id =?",forge_message.user_id, forge_message.project_id).first.nil?
|
||||
Member.create(:role_ids => [4], :user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
UserGrade.create(:user_id => forge_message.user_id, :project_id => forge_message.project_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -77,28 +77,60 @@ class StudentWorkController < ApplicationController
|
|||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
@is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||
@show_all = false
|
||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
|
||||
course_group = CourseGroup.find_by_id(@group) if @group
|
||||
if course_group
|
||||
group_students = course_group.users
|
||||
if group_students.empty?
|
||||
student_in_group = '(0)'
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
||||
end
|
||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
end
|
||||
else
|
||||
@stundet_works = []
|
||||
end
|
||||
else
|
||||
@stundet_works = []
|
||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
end
|
||||
else
|
||||
@stundet_works = []
|
||||
end
|
||||
end
|
||||
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
format.xls {
|
||||
send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present",
|
||||
|
|
|
@ -468,8 +468,8 @@ class UsersController < ApplicationController
|
|||
homework_detail_manual = HomeworkDetailManual.new
|
||||
homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.3
|
||||
homework_detail_manual.comment_status = 1
|
||||
homework_detail_manual.evaluation_start = Time.now
|
||||
homework_detail_manual.evaluation_end = Time.now
|
||||
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? homework.end_time + 7 : params[:evaluation_start]
|
||||
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end]
|
||||
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
|
||||
homework_detail_manual.absence_penalty = 5
|
||||
homework.homework_detail_manual = homework_detail_manual
|
||||
|
|
|
@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base
|
|||
private
|
||||
def get_success_count
|
||||
self.results.inject(0) do |sum, result|
|
||||
sum += (result["status"].to_i == 0 ? 1 : 0)
|
||||
sum += (result["status"] && result["status"].to_i == 0 ? 1 : 0)
|
||||
end || 0
|
||||
end
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
// }
|
||||
});
|
||||
</script>
|
||||
<div class="project_board_content break_word f14" id="content_<%=topic.id%>">
|
||||
<div class="project_board_content break_word f14 list_style" id="content_<%=topic.id%>">
|
||||
<div id="contentmessage<%=topic.id %>" class="upload_img">
|
||||
<%= topic.content.html_safe %>
|
||||
<!-- -->
|
||||
|
@ -165,7 +165,7 @@
|
|||
<div class="Msg_txt">
|
||||
<%= link_to User.current.member_of_course?(@board.course) ? "#{message.author.show_name}(#{message.author.login})" : "#{message.author}", user_path(message.author),:class => 'fl c_orange f14 ' %>
|
||||
<br/>
|
||||
<div class="fl break_word f14">
|
||||
<div class="fl break_word f14 list_style">
|
||||
<%= textAreailizable message,:content,:attachments => message.attachments %>
|
||||
<!-- -->
|
||||
</div>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</script>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="project_board_content break_word f14" id="content_<%=topic.id%>">
|
||||
<div class="project_board_content break_word f14 list_style" id="content_<%=topic.id%>">
|
||||
<div id="contentmessage<%=topic.id %>" class="upload_img">
|
||||
<%= topic.content.html_safe %>
|
||||
<!-- -->
|
||||
|
@ -150,7 +150,7 @@
|
|||
<div class="Msg_txt">
|
||||
<%= link_to_user_header message.author,false,:class => 'fl c_orange f14 ' %>
|
||||
<br/>
|
||||
<div class="fl break_word f14">
|
||||
<div class="fl break_word f14 list_style">
|
||||
<%= textAreailizable message,:content,:attachments => message.attachments %>
|
||||
<!-- -->
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<a class="problem_pic fl">
|
||||
<%= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %>
|
||||
</a>
|
||||
<div class="problem_txt fl mt5 upload_img">
|
||||
<div class="problem_txt fl mt5 upload_img list_style">
|
||||
<%= link_to_user_header(activity.user,false,:class => 'problem_name c_orange fl') %>
|
||||
<span class="fl"> </span>
|
||||
<span class="fl"> <%= activity.course_act_type == "Course" ? "创建了课程" : l(:label_new_activity) %>:</span>
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
<ul class="hwork_new_basic mb10">
|
||||
<li>
|
||||
<label class="label02 mb20">
|
||||
<span class="c_red">*</span>
|
||||
<%= l(:field_name)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red ml110"></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<label class="label02 "> <%= l(:field_quote)%>: </label>
|
||||
<div style="width: 83%;float: left;">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="mt10">
|
||||
<label class="label02"> 附件: </label>
|
||||
<%= render :partial => 'attachments/new_form', :locals => {:container => homework} %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="fl">
|
||||
<label class="label02">
|
||||
<span class="c_red">*</span>
|
||||
<%= l(:label_limit_time)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.end_time%>" >
|
||||
<%= calendar_for('homework_end_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="fl ml100" style="display: none;">
|
||||
<label class="label02"> 发布日期: </label>
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.publish_time%>" >
|
||||
<%= calendar_for('homework_publish_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul><!--hwork_new_basic end--->
|
||||
<div class="hwork_new_set" >
|
||||
<p class="fl ml20 f14 mb10 c_orange">基本规则设置(总分为100分)</p>
|
||||
<div class="cl"></div>
|
||||
<ul class="ml10">
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </label>
|
||||
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
|
||||
<span class="fl mt5"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li style="display: none;">
|
||||
<label class="label02" >是否匿评: </label>
|
||||
<%= f.check_box :homework_type, :class => "mb10 mt5 fl" %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02">评分比例: </label>
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_manual.ta_proportion), {:class => "fl mb10 h26 w70"} %>
|
||||
<span class="ml5 fl mt5">× 教辅评分</span>
|
||||
<span class="ml5 fl mt5"> + </span>
|
||||
<input type="text" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion* 100).to_i%>%" class="fl mb10 h26 w70" readonly>
|
||||
<span class="ml5 fl mt5">× 匿评得分</span>
|
||||
<span class="ml5 fl mt5">= 学生得分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02" > </label>
|
||||
<span class=" fl c_red">如果教师对学生作品进行了评分,则教师评分为学生最终得分。</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--hwork_new_set end-->
|
||||
|
||||
<div class="hwork_new_set" id="evaluation_setting" >
|
||||
<p class="fl ml20 f14 mb10 c_orange">学生互评设置</p>
|
||||
<div class="cl"></div>
|
||||
<ul class="ml10">
|
||||
<li style="display: none;">
|
||||
<label class="label02">互评启动时间: </label>
|
||||
<input type="text" name="evaluation_start" id="evaluation_start_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.homework_detail_manual.evaluation_start%>" >
|
||||
<%= calendar_for('evaluation_start_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li style="display: none;">
|
||||
<label class="label02">互评结束时间: </label>
|
||||
<input type="text" name="evaluation_end" id="evaluation_end_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.homework_detail_manual.evaluation_end%>" >
|
||||
<%= calendar_for('evaluation_end_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02">匿评分配数: </label>
|
||||
<input type="text" name="evaluation_num" id="evaluation_num" class=" hwork_input02 fl" value="<%= homework.homework_detail_manual.evaluation_num%>" maxlength="2" onkeyup="regex_evaluation_num()">
|
||||
<p class="ml5 fl mt5" id="evaluation_num_notice">每个学生将收到<span class="c_red"> 3 </span>份待匿评作品</p>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label class="label02">缺评扣分: </label>
|
||||
<%= select_tag :absence_penalty,options_for_select(absence_penalty_option,homework.homework_detail_manual.absence_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<span class="fl mt5"> 分</span>
|
||||
<p class="ml5 fl mt5">学生漏评1个作品将扣<span class="c_red" id="absence_penalty_notice"> <%= homework.homework_detail_manual.absence_penalty%> </span>分</p>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul> <!-- h1 end--->
|
||||
</div><!--hwork_new_set end-->
|
|
@ -1,193 +0,0 @@
|
|||
<ul class="hwork_new_basic">
|
||||
<li >
|
||||
<label class="label02 mb20">
|
||||
<span class="c_red">*</span>
|
||||
<%= l(:field_name)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red ml110"></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<label class="label02 "> <%= l(:field_quote)%>: </label>
|
||||
<div style="width: 83%;float: left;">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="mt10">
|
||||
<label class="label02"> 附件: </label>
|
||||
<%= render :partial => 'attachments/new_form', :locals => {:container => homework} %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="fl">
|
||||
<label class="label02">
|
||||
<span class="c_red">*</span>
|
||||
<%= l(:label_limit_time)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.end_time%>" >
|
||||
<%= calendar_for('homework_end_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="fl ml100" style="display: none;">
|
||||
<label class="label02"> 发布日期: </label>
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="hwork_input02 fl" readonly="readonly" value="<%= homework.publish_time%>" >
|
||||
<%= calendar_for('homework_publish_time')%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label class="label02">迟交扣分: </label>
|
||||
<%#= select_tag :late_penalty,options_for_select(late_penalty_option,homework.late_penalty), {:class => "fl mb10 h26 w70"} %>
|
||||
<input type="number" value="<%= homework.late_penalty%>" min="0" max="50" class="fl mb10 h26 w70" name="late_penalty" onkeyup="check_late_penalty()">
|
||||
<span class="fl mt5"> 分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul><!--hwork_new_basic end--->
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="hwork_new_set">
|
||||
<p class="fl ml20 f14 mb10 c_orange">编程评测设置</p>
|
||||
<div class="cl"></div>
|
||||
<ul>
|
||||
<li >
|
||||
<label class="label02"> 开发语言: </label>
|
||||
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language.to_i), {:class => "fl mb10 h26 w70",:onchange => "homework_language_change($(this));"} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<label class="label02">评分比例: </label>
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "fl mb10 h26 w70"} %>
|
||||
<span class="ml5 fl mt5">× 教辅评分</span>
|
||||
<span class="ml5 fl mt5"> + </span>
|
||||
<input type="text" id="student_proportion" value="<%= (100 - homework.homework_detail_programing.ta_proportion* 100).to_i%>%" class="fl mb10 h26 w70" readonly>
|
||||
<span class="ml5 fl mt5">× 系统评分</span>
|
||||
<span class="ml5 fl mt5">= 学生得分</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02" > </label>
|
||||
<span class=" fl c_red">如果教师对学生作品进行了评分,则教师评分为学生最终得分。</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<label class="label02"> 标准代码: </label>
|
||||
<textarea name="standard_code" class=" w547 h400 mb10 fl" oninput="init_programing_test();" onpropertychange="init_programing_test()"><%= homework.homework_detail_programing.standard_code || c_stantard_code_teacher%></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<% if edit_mode %>
|
||||
<% homework.homework_tests.each do |homework_test|%>
|
||||
<div>
|
||||
<li>
|
||||
<label class="label02"> 测试输入: </label>
|
||||
<input type="text" class="fl h26 w190 mb10" name="input[<%= homework_test.id%>]" value="<%= homework_test.input%>"/>
|
||||
</li>
|
||||
<li >
|
||||
<label class=" fl f14 ml10"> 输出: </label>
|
||||
<input type="text" class="fl h26 w190 mb10" name="output[<%= homework_test.id%>]" value="<%= homework_test.output%>"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
||||
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
|
||||
<% if homework_test.result && !homework_test.result.to_s.empty?%>
|
||||
<% if homework_test.result == 0%>
|
||||
<a class="green_btn fl ml5 mt1 programing_test" onclick="programing_test('<%= homework_test.id%>')" id="test_send_<%= homework_test.id%>">正确</a>
|
||||
<% else%>
|
||||
<a class="red_btn fl ml5 mt1 programing_test" onclick="programing_test('<%= homework_test.id%>')" id="test_send_<%= homework_test.id%>">错误</a>
|
||||
<% end%>
|
||||
<% else%>
|
||||
<a class="blue_btn fl ml5 mt1 programing_test" onclick="programing_test('<%= homework_test.id%>')" id="test_send_<%= homework_test.id%>">测试</a>
|
||||
<% end%>
|
||||
<input type="hidden" id="test_result_<%= homework_test.id%>" name="result[<%= homework_test.id%>]" value="<%= homework_test.result%>"/>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<div>
|
||||
<li>
|
||||
<label class="label02"> 测试输入: </label>
|
||||
<input type="text" class="fl h26 w190 mb10" name="input[0]" value="1 2"/>
|
||||
</li>
|
||||
<li >
|
||||
<label class=" fl f14 ml10"> 输出: </label>
|
||||
<input type="text" class="fl h26 w190 mb10" name="output[0]" value="3"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon_add ml10 " href="javascript:void(0);" title="添加测试" onclick="add_programing_test($(this).parent().parent())"></a>
|
||||
<a class="icon_remove" href="javascript:void(0);" title="删除测试" onclick="remove_programing_test($(this).parent().parent())"></a>
|
||||
<a class="blue_btn fl ml5 mt programing_test" onclick="programing_test('0')" id="test_send_0">测试</a>
|
||||
<input type="hidden" id="test_result_0" name="result[0]" />
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<input type="hidden" name="error_msg" id="homework_test_error_msg" value="<%= homework.homework_tests.first.error_msg if homework.homework_tests.first && homework.homework_tests.first && homework.homework_tests.first.error_msg%>">
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0" id="homework_work_test_show" style="display: <%= homework.homework_tests.first && homework.homework_tests.first && homework.homework_tests.first.error_msg && !homework.homework_tests.first.error_msg.empty? ? "block" : "none"%>">
|
||||
<tbody>
|
||||
<tr class="border_t" >
|
||||
<td class="td_end fb c_red w60 td_board_left">
|
||||
错误信息:
|
||||
</td>
|
||||
<td class="td_end wl" id="homework_work_test_desc">
|
||||
<% if homework.homework_tests.first && homework.homework_tests.first && homework.homework_tests.first.error_msg %>
|
||||
<%= homework.homework_tests.first.error_msg%>
|
||||
<% end%>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//点击测试,发送
|
||||
function programing_test(obj) {
|
||||
$.post(
|
||||
'<%= programing_test_homework_common_index_path%>',
|
||||
{
|
||||
src: $("textarea[name='standard_code']").val(),
|
||||
input: $("input[name='input[" + obj +"]']").val(),
|
||||
output: $("input[name='output[" + obj + "]']").val(),
|
||||
language: $("select[name='language']").val(),
|
||||
index: obj
|
||||
},
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function init_programing_test()
|
||||
{
|
||||
$(".programing_test").each(function(){
|
||||
$(this).removeClass("green_btn red_btn").addClass("blue_btn").text("测试");
|
||||
$(this).next("input").val("");
|
||||
});
|
||||
}
|
||||
|
||||
function homework_language_change(obj)
|
||||
{
|
||||
if(obj.val() == "1")
|
||||
{
|
||||
// alert(1);
|
||||
$("textarea[name='standard_code']").val("<%= escape_javascript c_stantard_code_teacher%>");
|
||||
|
||||
}
|
||||
else if(obj.val() == "2")
|
||||
{
|
||||
// alert(2);
|
||||
$("textarea[name='standard_code']").val("<%= escape_javascript c_stantard_code_teacher_%>");
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,74 +0,0 @@
|
|||
<div class="homepageRight">
|
||||
<div class="HomeWork">
|
||||
<div class="RightBanner">
|
||||
<div class="NewsBannerName">发布作业</div>
|
||||
</div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<textarea class="InputBox W700 " placeholder="请输入作业标题" name="homework_common[name]" id="homework_name" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>"></textarea>
|
||||
</div>
|
||||
<div class=" mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.end_time%>" placeholder="截止日期"></input>
|
||||
<div class="fl DateBorder mr10"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.publish_time%>" placeholder="发布日期"></input>
|
||||
<div class="fl DateBorder"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W700 SearchIcon" placeholder="发送到课程" style="margin-top: 0px; margin-bottom: 0px; height: 29px;"></textarea>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr20">上传附件</a>
|
||||
<a href="javascript:void(0);" class="FilesBtn fl mr15 mt3">资源库</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class=" fl DropBtn">高级功能</a>
|
||||
<div class="DropLine"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="advanced_option" style="display:none;">
|
||||
<div class="mt10">
|
||||
<select class="InputBox W120" required="true">
|
||||
<option value="语言选择">语言选择</option>
|
||||
<option value="C语言">C语言</option>
|
||||
<option value="C++">C++</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" onClick="submit_homework('new_homework_common');" class="BlueCirBtnMini fr">发布</a>
|
||||
<span class="fr mr10 mt3">或</span><%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'fr mr10 mt3'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
|
||||
</div>
|
||||
|
||||
<script id="t:test-answer-list" type="text/html">
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</script>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
$(function(){if($("#bid_description_<%= homework.id%>_content").height()>360){$("#bid_show_more_des_button<%= homework.id%>").show();}});
|
||||
</script>
|
||||
<div id="bid_description_<%= homework.id%>" class="news_description mt5">
|
||||
<div id="bid_description_<%= homework.id%>_content" class="upload_img">
|
||||
<div id="bid_description_<%= homework.id%>_content" class="upload_img list_style">
|
||||
<%= homework.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= error_messages_for 'homework_common' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_course_homework_new)%>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<div class="cl"></div>
|
|
@ -1,30 +0,0 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<%= error_messages_for 'homework_common' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2">
|
||||
<%= l(:label_course_homework_new)%>
|
||||
</h2>
|
||||
</div>
|
||||
<% if @homework_type == "1"%>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<% elsif @homework_type == "2"%>
|
||||
<div class="hwork_new">
|
||||
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
|
||||
<%= hidden_field_tag "course",@course.id%>
|
||||
<%= hidden_field_tag "homework_common[homework_type]","2"%>
|
||||
<%= render :partial => 'homework_common/homework_detail_programing_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
|
||||
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
|
||||
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
|
||||
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
|
||||
<% end%>
|
||||
</div><!--hwork_new end-->
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -1,4 +1,4 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg' %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
|
||||
</div>
|
||||
|
@ -22,25 +22,25 @@
|
|||
<div class="cl"></div>
|
||||
<p>由<a href="javascript:void(0)" class="problem_name"><%= @issue.author %></a>
|
||||
<%# if @issue.created_on != @issue.updated_on %>
|
||||
添加于 <%= format_time(@issue.created_on).html_safe %>
|
||||
添加于 <%= format_time(@issue.created_on).html_safe %>
|
||||
<%# else %>
|
||||
<%#= format_time(@issue.updated_on).html_safe %>
|
||||
<%#= format_time(@issue.updated_on).html_safe %>
|
||||
<%# end %>
|
||||
</div>
|
||||
<!--talk_txt end-->
|
||||
<a href="javascript:void(0)" class="talk_edit fr"<%= render :partial => 'action_menu' %></a>
|
||||
<div class="cl"></div>
|
||||
<div class="talk_info mb10" style="word-break:break-all;">
|
||||
<div class="talk_info mb10 list_style" style="word-break:break-all;">
|
||||
<% if @issue.description? || @issue.attachments.any? -%>
|
||||
<% if @issue.description? %>
|
||||
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
||||
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pro_pic_box mb10">
|
||||
<a href="javascript:void(0)" class="link_img fl">
|
||||
<!--显示附件、图片-->
|
||||
<%= link_to_attachment_project @issue, :thumbnails => true %></a><br/>
|
||||
</div>
|
||||
<div class="pro_pic_box mb10">
|
||||
<a href="javascript:void(0)" class="link_img fl">
|
||||
<!--显示附件、图片-->
|
||||
<%= link_to_attachment_project @issue, :thumbnails => true %></a><br/>
|
||||
<% end -%>
|
||||
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
|
||||
</div><!--pro_pic_box end-->
|
||||
|
@ -48,51 +48,61 @@
|
|||
<!--属性-->
|
||||
<div class="pro_info_box mb10">
|
||||
<%= issue_fields_rows do |rows| %>
|
||||
<ul class="fl" >
|
||||
<li><p class="label03" > 状态 : </p><p class="pro_info_p"><%= @issue.status.name %></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
|
||||
<li><p class="label03" > 指派给 : </p><span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl" >
|
||||
<li><p class="label03" > 优先级 : </p><span class="pro_info_p" style="width:50px;"><%= @issue.priority.name %></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
|
||||
<li><p class="label03" > % 完成 : </p><span class="pro_info_p" style="width:50px;"><%= @issue.done_ratio %>%</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl">
|
||||
<li><p class="label03"> 状态 : </p>
|
||||
|
||||
<ul class="fl " >
|
||||
<p class="pro_info_p"><%= @issue.status.name %></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
|
||||
<li><p class="label03"> 指派给 : </p>
|
||||
<span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl">
|
||||
<li><p class="label03"> 优先级 : </p>
|
||||
<span class="pro_info_p" style="width:50px;"><%= @issue.priority.name %></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
|
||||
<li><p class="label03"> % 完成 : </p>
|
||||
<span class="pro_info_p" style="width:50px;"><%= @issue.done_ratio %>%</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
||||
<ul class="fl ">
|
||||
<% unless @issue.disabled_core_fields.include?('start_date') %>
|
||||
<li><p class="label03" style="width:50px;" > 开始 : </p><p class="pro_info_p"><%= format_date(@issue.start_date) %></p>
|
||||
</li>
|
||||
<li><p class="label03" style="width:50px;"> 开始 : </p>
|
||||
|
||||
<p class="pro_info_p"><%= format_date(@issue.start_date) %></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
|
||||
<li><p class="label03" style="width:50px;"> 周期 : </p><span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
|
||||
</li>
|
||||
<li><p class="label03" style="width:50px;"> 周期 : </p>
|
||||
<span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl " >
|
||||
<% unless @issue.disabled_core_fields.include?('due_date') %>
|
||||
<li><p class="label03" > 计划完成 : </p><span class="pro_info_p" style="width:120px;"><%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="fl ">
|
||||
<% unless @issue.disabled_core_fields.include?('due_date') %>
|
||||
<li><p class="label03"> 计划完成 : </p>
|
||||
<span class="pro_info_p" style="width:120px;"><%= format_date(@issue.due_date) ? format_date(@issue.due_date) : "--" %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
|
||||
<li><p class="label03" > 目标版本 : </p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
|
||||
</li>
|
||||
<li><p class="label03"> 目标版本 : </p>
|
||||
<span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %><!--pro_info_box end-->
|
||||
<%#= render_custom_fields_rows(@issue) %>
|
||||
<%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
|
||||
|
@ -111,7 +121,7 @@
|
|||
</div>
|
||||
<p style="padding-top: 5px"></p>
|
||||
|
||||
<!--引用时不能修改,剥离出引用内容-->
|
||||
<!--引用时不能修改,剥离出引用内容-->
|
||||
|
||||
<a remote="true" href="javascript:void(0)" class="blue_btn fr mr80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">
|
||||
<%= l(:button_submit) %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<% newss.each do |news| %>
|
||||
<div class="problem_main upload_img">
|
||||
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<div class="problem_txt fl mt5 list_style">
|
||||
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
|
||||
<span class="fl">
|
||||
<%= l(:label_release_news) %>:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</div>
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<div class="problem_txt fl mt5 list_style">
|
||||
<h4 class="r_txt_tit mb5">
|
||||
<%=h @news.title %>
|
||||
</h4>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<div class="ping_C mb10">
|
||||
<div><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "problem_pic fl"%></div>
|
||||
<div class="ping_discon">
|
||||
<div class="ping_distop upload_img break_word">
|
||||
<div class="ping_distop upload_img break_word list_style">
|
||||
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
|
||||
<span class="c_grey fr">
|
||||
<%= format_time(comment.created_on) %>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<% @newss.each do |news| %>
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<div class="problem_txt fl mt5 list_style">
|
||||
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
|
||||
<span class="fl"> <%= l(:label_add_news) %>:</span><%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
|
||||
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w_news" %><br />
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<div class="problem_txt fl mt5 list_style">
|
||||
<h4 class="r_txt_tit mb5"> <%=h @news.title %></h4>
|
||||
<%#= watcher_link(@news, User.current) %>
|
||||
<%= link_to(l(:button_edit),
|
||||
|
|
|
@ -22,3 +22,21 @@
|
|||
<div class="cl"></div>
|
||||
</div><!--编辑头部 end-->
|
||||
<% end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
if($('#polls_description_div').html().trim() == '') {
|
||||
$('#polls_description_div').html("<p style='color:#999999'>问卷描述</p>");
|
||||
}
|
||||
});
|
||||
|
||||
$('#polls_description_div').focus(function(){
|
||||
//alert($('#polls_description_div').html().trim());
|
||||
if(/^\s*<\w*\s*\w*\=\"\w*\:\s*\#\d*\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test($('#polls_description_div').html().trim())) {
|
||||
$('#polls_description_div').html('');
|
||||
}
|
||||
}).blur(function(){
|
||||
if($('#polls_description_div').html().trim() == '') {
|
||||
$('#polls_description_div').html("<p style='color:#999999'>问卷描述</p>");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<% if e.forge_act_type == "Issue" %>
|
||||
<div class="problem_main">
|
||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(act.author), :width => "42", :height => "42") %></a>
|
||||
<div class="problem_txt fl mt5 break_word">
|
||||
<div class="problem_txt fl mt5 break_word list_style">
|
||||
<a class="problem_name fl ">
|
||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
||||
<%= link_to act.author, user_path(act.author), :class => "problem_name c_orange fl" %><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
||||
|
@ -60,7 +60,7 @@
|
|||
<% elsif e.forge_act_type == "Message" %>
|
||||
<div class="problem_main">
|
||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
||||
<div class="problem_txt fl mt5 break_word">
|
||||
<div class="problem_txt fl mt5 break_word list_style">
|
||||
<a class="problem_name fl ">
|
||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
||||
|
@ -79,7 +79,7 @@
|
|||
<% elsif e.forge_act_type == "News" %>
|
||||
<div class="problem_main">
|
||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
||||
<div class="problem_txt fl mt5 break_word">
|
||||
<div class="problem_txt fl mt5 break_word list_style">
|
||||
<a class="problem_name fl ">
|
||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
<ul class="hworkUl b_grey">
|
||||
<li class="hworkList380 width625">
|
||||
<span class="c_dark f14 fb fl ml10">作品信息</span>
|
||||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 width505">
|
||||
<span class="HomeworkNameTitle f14 fb fl">作品名称</span>
|
||||
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
|
||||
<span class="HomeworkStuTitle f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class="hworkList80 mr10" >
|
||||
<span class="c_dark f14 fb fl ml10">我的评分</span>
|
||||
|
||||
<li class="hworkList130 hworkH30 fb ml10">
|
||||
时间
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30 fb mr10 ml10">
|
||||
我的评分
|
||||
</li>
|
||||
</ul>
|
|
@ -1,37 +1,51 @@
|
|||
<ul class="hworkUl b_grey">
|
||||
<li class="hworkList380 <%= @homework.homework_type == 2 ? '' : 'width455'%>">
|
||||
<span class="c_dark f14 fb fl ml10">作品信息</span>
|
||||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
||||
<span class="c_dark f14 fb fl <%= @homework.homework_type == 2 ? 'mr60 ml80' : 'mr95 ml100'%>">作品名称</span>
|
||||
<span class="c_dark f14 fb fl mr50">姓名</span>
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class="hworkList80" >
|
||||
<%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30" >
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkList80">
|
||||
<%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList80">
|
||||
<%= link_to "系统评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end%>
|
||||
<li class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,46 +1,48 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList380 <%= @homework.homework_type == 2 ? '' : 'width455'%>">
|
||||
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
||||
<ul>
|
||||
<li class="hworkName mt12">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
|
||||
</li>
|
||||
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<div>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<ul class="mt12">
|
||||
<li class="hworkDetail mr15">
|
||||
姓名:<%= student_work.user.show_name%>
|
||||
<ul class="mt10 fl">
|
||||
<li class="hworkStName mr10 mt16" title="姓名">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="hworkDetail mr15">
|
||||
学号:
|
||||
<li class="hworkStID mt16" title="学号">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkDate">
|
||||
时间:
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">迟交</span>
|
||||
<% else%>
|
||||
<%= format_time student_work.created_at%>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hworkList80 <%= score_color student_work.teacher_score%>">
|
||||
<li class="hworkList130 c_grey">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList80 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList80 <%= score_color student_work.system_score%>">
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
|
@ -73,4 +75,5 @@
|
|||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -1,51 +1,62 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<li class="hworkList380 width620">
|
||||
<li class="hworkList340 width525">
|
||||
<ul>
|
||||
<li class="hworkName mt12 m_width620">
|
||||
<% if is_my_work%>
|
||||
<% if is_my_work%>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
|
||||
</li>
|
||||
<li class="hworkName mt15 mr15 width285">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
<% else%>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<ul class="mt12">
|
||||
<li class="hworkDetail mr15">
|
||||
姓名:
|
||||
<% if is_my_work%>
|
||||
<div>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="mt10 fl">
|
||||
<li class="hworkStName mr10 mt16" title="姓名">
|
||||
<%= student_work.user.show_name%>
|
||||
<% else%>
|
||||
匿名
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkDetail mr15">
|
||||
学号:
|
||||
<% if is_my_work%>
|
||||
<span>
|
||||
</li>
|
||||
<li class="hworkStID mt16" title="学号">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% else%>
|
||||
--
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hworkDate">
|
||||
时间:
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">迟交</span>
|
||||
<% else%>
|
||||
<%= format_time student_work.created_at%>
|
||||
<% end %>
|
||||
<% else%>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hworkName mt15 mr15 width285">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="mt10 fl">
|
||||
<li class="hworkStName mr10 mt16" title="姓名">
|
||||
匿名
|
||||
</li>
|
||||
<li class="hworkStID mt16" title="学号">
|
||||
--
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hworkList130 c_grey">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class="hworkList80 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
|
||||
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<div class="fl" style="border-bottom:1px solid #eaeaea; padding-bottom:10px; width:720px;">
|
||||
<span class="c_dark f14 fb fl mr30">
|
||||
作品
|
||||
<font class="f12 c_red">
|
||||
(<%= @stundet_works.count%>)
|
||||
</font>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<div class="hworkSearchBox">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>
|
||||
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>"></div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -56,7 +56,7 @@
|
|||
<a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="hworkMenu">
|
||||
<li>
|
||||
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey'%>
|
||||
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
|
||||
</li>
|
||||
<li>
|
||||
<% if @homework.student_works.empty?%>
|
||||
|
@ -82,45 +82,15 @@
|
|||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="hworkListContainer">
|
||||
<div class="ctt2">
|
||||
<div class="dis" id="tbc_01">
|
||||
<div class="codeList">
|
||||
<span class="fl mt3">
|
||||
<%= link_to "所有作品<font class='f12 c_red'>[共#{@stundet_works.count}份]</font>".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<div class="resourcesSearchloadBox fr">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="searchResource" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="homepageSearchIcon" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!---code_list end--->
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<!---hwork_ul end--->
|
||||
<div class="cl"></div>
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<!---hwork_ul end--->
|
||||
<div id="about_hwork_<%= student_work.id%>"></div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<div class="dis" id="homework_student_work_list">
|
||||
<%= render :partial => "student_work/student_work_list"%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
|
||||
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
|
|
@ -7,7 +7,7 @@
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%");
|
||||
$('#ajax-modal').parent().css("top","65%").css("left","60%");
|
||||
$('#ajax-modal').parent().addClass("anonymos_work");
|
||||
});
|
||||
<% end%>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
<div class="homepagePostDeadline">截止时间:<%= activity.end_time.to_s %></div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" style="visibility: hidden" id="act-<%=user_activity_id %>">
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
<% else %>
|
||||
|
@ -45,15 +45,16 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=0 %>
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<%= count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
|
@ -86,7 +87,7 @@
|
|||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<div class="homepagePostReplyContent break_word list_style">
|
||||
<%= reply.content.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -99,14 +100,14 @@
|
|||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mt3 mb10">
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
|
|
|
@ -18,15 +18,16 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id %>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id %>">
|
||||
<%= activity.description.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=activity.comments.count %>
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
|
@ -59,7 +60,7 @@
|
|||
<% end %>
|
||||
<%= format_time(comment.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word"><%= comment.comments.html_safe %></div>
|
||||
<div class="homepagePostReplyContent break_word list_style"><%= comment.comments.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
@ -70,13 +71,13 @@
|
|||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mt3 mb10">
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id %>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id %>">
|
||||
<% if activity.description? %>
|
||||
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
|
||||
<% end %>
|
||||
|
@ -63,10 +63,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReply">
|
||||
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = activity.journals.count %>
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 2 %>
|
||||
|
@ -115,13 +115,13 @@
|
|||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mt3 mb10">
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<div class="homepagePostDate">
|
||||
时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id%>">
|
||||
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
<% else %>
|
||||
|
@ -36,15 +36,16 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = 0 %>
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<%=count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
|
@ -73,7 +74,7 @@
|
|||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word"><%= reply.content.html_safe %></div>
|
||||
<div class="homepagePostReplyContent break_word list_style"><%= reply.content.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
@ -84,14 +85,14 @@
|
|||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mt3 mb10">
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= user_activity.id%>,"","87%");
|
||||
init_activity_KindEditor_data(<%= user_activity.id%>,null,"87%");
|
||||
});
|
||||
</script>
|
||||
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<%= l(:label_end_time)%>:<%= homework_common.end_time%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro upload_img break_word">
|
||||
<div class="homepagePostIntro upload_img break_word list_style">
|
||||
<%= homework_common.description.html_safe %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
||||
<%= javascript_include_tag 'homework','baiduTemplate' %>
|
||||
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<!-- 模板1开始,可以使用script(type设置为text/html)来存放模板片段,并且用id标示 -->
|
||||
|
@ -75,6 +77,7 @@
|
|||
<input type="hidden" name="is_test" value="<%=@is_test%>">
|
||||
<div class="mt15">
|
||||
<span>请使用 <%= @homework.language_name %> 语言编写</span>
|
||||
<span data-language=<%=@homework.language%> style="display-hidden" id="data-language"></span>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="HomeWork mb10">
|
||||
<% homework = HomeworkCommon.new %>
|
||||
<% homework.homework_detail_manual = HomeworkDetailManual.new%>
|
||||
<%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
|
||||
<div id="HomeWorkCon">
|
||||
<%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %>
|
||||
|
|
|
@ -362,12 +362,12 @@
|
|||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">邀请你加入项目:</span>
|
||||
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>邀请你加入项目</span>
|
||||
</li>
|
||||
<% if ma.user.member_of?(ma.project) %>
|
||||
<li class="homepageNewsContent fl">
|
||||
<li class="homepageNewsContent fl">
|
||||
<% else %>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<% end %>
|
||||
<%= link_to ma.project, project_path(ma.project),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
|
@ -377,13 +377,13 @@
|
|||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
</div>
|
||||
<% unless ma.user.member_of?(ma.project) %>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
||||
:value => ma.secret_key,
|
||||
:class => "green_btn_cir ml10",
|
||||
:style => "color:#fff" %>
|
||||
</li>
|
||||
<% unless User.current.member_of?(ma.project) %>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
||||
:value => ma.secret_key,
|
||||
:class => "green_btn_cir ml10",
|
||||
:style => "color:#fff" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
|
41
db/schema.rb
41
db/schema.rb
|
@ -476,13 +476,6 @@ ActiveRecord::Schema.define(:version => 20150918134804) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "documents", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.integer "category_id", :default => 0, :null => false
|
||||
|
@ -497,23 +490,26 @@ ActiveRecord::Schema.define(:version => 20150918134804) do
|
|||
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
|
||||
add_index "documents", ["project_id"], :name => "documents_project_id"
|
||||
|
||||
create_table "dts", :force => true do |t|
|
||||
t.string "IPLineCode"
|
||||
t.string "Description"
|
||||
t.string "Num"
|
||||
t.string "Variable"
|
||||
t.string "TraceInfo"
|
||||
t.string "Method"
|
||||
create_table "dts", :primary_key => "Num", :force => true do |t|
|
||||
t.string "Defect", :limit => 50
|
||||
t.string "Category", :limit => 50
|
||||
t.string "File"
|
||||
t.string "IPLine"
|
||||
t.string "Review"
|
||||
t.string "Category"
|
||||
t.string "Defect"
|
||||
t.string "PreConditions"
|
||||
t.string "StartLine"
|
||||
t.string "Method"
|
||||
t.string "Module", :limit => 20
|
||||
t.string "Variable", :limit => 50
|
||||
t.integer "StartLine"
|
||||
t.integer "IPLine"
|
||||
t.string "IPLineCode", :limit => 200
|
||||
t.string "Judge", :limit => 15
|
||||
t.integer "Review", :limit => 1
|
||||
t.string "Description"
|
||||
t.text "PreConditions", :limit => 2147483647
|
||||
t.text "TraceInfo", :limit => 2147483647
|
||||
t.text "Code", :limit => 2147483647
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "id", :null => false
|
||||
end
|
||||
|
||||
create_table "enabled_modules", :force => true do |t|
|
||||
|
@ -916,6 +912,7 @@ ActiveRecord::Schema.define(:version => 20150918134804) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.datetime "updated_on"
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
|
|
@ -0,0 +1,604 @@
|
|||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
else if (typeof define == "function" && define.amd) // AMD
|
||||
define(["../../lib/codemirror"], mod);
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit,
|
||||
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
||||
dontAlignCalls = parserConfig.dontAlignCalls,
|
||||
keywords = parserConfig.keywords || {},
|
||||
types = parserConfig.types || {},
|
||||
builtin = parserConfig.builtin || {},
|
||||
blockKeywords = parserConfig.blockKeywords || {},
|
||||
defKeywords = parserConfig.defKeywords || {},
|
||||
atoms = parserConfig.atoms || {},
|
||||
hooks = parserConfig.hooks || {},
|
||||
multiLineStrings = parserConfig.multiLineStrings,
|
||||
indentStatements = parserConfig.indentStatements !== false,
|
||||
indentSwitch = parserConfig.indentSwitch !== false,
|
||||
namespaceSeparator = parserConfig.namespaceSeparator;
|
||||
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
||||
|
||||
var curPunc, isDefKeyword;
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (hooks[ch]) {
|
||||
var result = hooks[ch](stream, state);
|
||||
if (result !== false) return result;
|
||||
}
|
||||
if (ch == '"' || ch == "'") {
|
||||
state.tokenize = tokenString(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
||||
curPunc = ch;
|
||||
return null;
|
||||
}
|
||||
if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/[\w\.]/);
|
||||
return "number";
|
||||
}
|
||||
if (ch == "/") {
|
||||
if (stream.eat("*")) {
|
||||
state.tokenize = tokenComment;
|
||||
return tokenComment(stream, state);
|
||||
}
|
||||
if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
}
|
||||
if (isOperatorChar.test(ch)) {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return "operator";
|
||||
}
|
||||
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
||||
if (namespaceSeparator) while (stream.match(namespaceSeparator))
|
||||
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
||||
|
||||
var cur = stream.current();
|
||||
if (keywords.propertyIsEnumerable(cur)) {
|
||||
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
||||
if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true;
|
||||
return "keyword";
|
||||
}
|
||||
if (types.propertyIsEnumerable(cur)) return "variable-3";
|
||||
if (builtin.propertyIsEnumerable(cur)) {
|
||||
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
||||
return "builtin";
|
||||
}
|
||||
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
||||
return "variable";
|
||||
}
|
||||
|
||||
function tokenString(quote) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, next, end = false;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == quote && !escaped) {end = true; break;}
|
||||
escaped = !escaped && next == "\\";
|
||||
}
|
||||
if (end || !(escaped || multiLineStrings))
|
||||
state.tokenize = null;
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
|
||||
function tokenComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while (ch = stream.next()) {
|
||||
if (ch == "/" && maybeEnd) {
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return "comment";
|
||||
}
|
||||
|
||||
function Context(indented, column, type, align, prev) {
|
||||
this.indented = indented;
|
||||
this.column = column;
|
||||
this.type = type;
|
||||
this.align = align;
|
||||
this.prev = prev;
|
||||
}
|
||||
function isStatement(type) {
|
||||
return type == "statement" || type == "switchstatement" || type == "namespace";
|
||||
}
|
||||
function pushContext(state, col, type) {
|
||||
var indent = state.indented;
|
||||
if (state.context && isStatement(state.context.type) && !isStatement(type))
|
||||
indent = state.context.indented;
|
||||
return state.context = new Context(indent, col, type, null, state.context);
|
||||
}
|
||||
function popContext(state) {
|
||||
var t = state.context.type;
|
||||
if (t == ")" || t == "]" || t == "}")
|
||||
state.indented = state.context.indented;
|
||||
return state.context = state.context.prev;
|
||||
}
|
||||
|
||||
function typeBefore(stream, state) {
|
||||
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
|
||||
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
|
||||
}
|
||||
|
||||
function isTopScope(context) {
|
||||
for (;;) {
|
||||
if (!context || context.type == "top") return true;
|
||||
if (context.type == "}" && context.prev.type != "namespace") return false;
|
||||
context = context.prev;
|
||||
}
|
||||
}
|
||||
|
||||
// Interface
|
||||
|
||||
return {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: null,
|
||||
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
||||
indented: 0,
|
||||
startOfLine: true,
|
||||
prevToken: null
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
var ctx = state.context;
|
||||
if (stream.sol()) {
|
||||
if (ctx.align == null) ctx.align = false;
|
||||
state.indented = stream.indentation();
|
||||
state.startOfLine = true;
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
curPunc = isDefKeyword = null;
|
||||
var style = (state.tokenize || tokenBase)(stream, state);
|
||||
if (style == "comment" || style == "meta") return style;
|
||||
if (ctx.align == null) ctx.align = true;
|
||||
|
||||
if ((curPunc == ";" || curPunc == ":" || curPunc == ","))
|
||||
while (isStatement(state.context.type)) popContext(state);
|
||||
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
||||
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
||||
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
||||
else if (curPunc == "}") {
|
||||
while (isStatement(ctx.type)) ctx = popContext(state);
|
||||
if (ctx.type == "}") ctx = popContext(state);
|
||||
while (isStatement(ctx.type)) ctx = popContext(state);
|
||||
}
|
||||
else if (curPunc == ctx.type) popContext(state);
|
||||
else if (indentStatements &&
|
||||
(((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
||||
(isStatement(ctx.type) && curPunc == "newstatement"))) {
|
||||
var type = "statement";
|
||||
if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
|
||||
type = "switchstatement";
|
||||
else if (style == "keyword" && stream.current() == "namespace")
|
||||
type = "namespace";
|
||||
pushContext(state, stream.column(), type);
|
||||
}
|
||||
|
||||
if (style == "variable" &&
|
||||
((state.prevToken == "def" ||
|
||||
(parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
|
||||
isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
|
||||
style = "def";
|
||||
|
||||
if (hooks.token) {
|
||||
var result = hooks.token(stream, state, style);
|
||||
if (result !== undefined) style = result;
|
||||
}
|
||||
|
||||
if (style == "def" && parserConfig.styleDefs === false) style = "variable";
|
||||
|
||||
state.startOfLine = false;
|
||||
state.prevToken = isDefKeyword ? "def" : style || curPunc;
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
||||
if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
|
||||
var closing = firstChar == ctx.type;
|
||||
var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
|
||||
if (isStatement(ctx.type))
|
||||
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
||||
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
||||
return ctx.column + (closing ? 0 : 1);
|
||||
if (ctx.type == ")" && !closing)
|
||||
return ctx.indented + statementIndentUnit;
|
||||
|
||||
return ctx.indented + (closing ? 0 : indentUnit) +
|
||||
(!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
|
||||
},
|
||||
|
||||
electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
|
||||
blockCommentStart: "/*",
|
||||
blockCommentEnd: "*/",
|
||||
lineComment: "//",
|
||||
fold: "brace"
|
||||
};
|
||||
});
|
||||
|
||||
function words(str) {
|
||||
var obj = {}, words = str.split(" ");
|
||||
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
||||
return obj;
|
||||
}
|
||||
var cKeywords = "auto if break case register continue return default do sizeof " +
|
||||
"static else struct switch extern typedef float union for " +
|
||||
"goto while enum const volatile";
|
||||
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
|
||||
|
||||
function cppHook(stream, state) {
|
||||
if (!state.startOfLine) return false;
|
||||
for (;;) {
|
||||
if (stream.skipTo("\\")) {
|
||||
stream.next();
|
||||
if (stream.eol()) {
|
||||
state.tokenize = cppHook;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
stream.skipToEnd();
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "meta";
|
||||
}
|
||||
|
||||
function pointerHook(_stream, state) {
|
||||
if (state.prevToken == "variable-3") return "variable-3";
|
||||
return false;
|
||||
}
|
||||
|
||||
function cpp11StringHook(stream, state) {
|
||||
stream.backUp(1);
|
||||
// Raw strings.
|
||||
if (stream.match(/(R|u8R|uR|UR|LR)/)) {
|
||||
var match = stream.match(/"([^\s\\()]{0,16})\(/);
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
state.cpp11RawStringDelim = match[1];
|
||||
state.tokenize = tokenRawString;
|
||||
return tokenRawString(stream, state);
|
||||
}
|
||||
// Unicode strings/chars.
|
||||
if (stream.match(/(u8|u|U|L)/)) {
|
||||
if (stream.match(/["']/, /* eat */ false)) {
|
||||
return "string";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Ignore this hook.
|
||||
stream.next();
|
||||
return false;
|
||||
}
|
||||
|
||||
function cppLooksLikeConstructor(word) {
|
||||
var lastTwo = /(\w+)::(\w+)$/.exec(word);
|
||||
return lastTwo && lastTwo[1] == lastTwo[2];
|
||||
}
|
||||
|
||||
// C#-style strings where "" escapes a quote.
|
||||
function tokenAtString(stream, state) {
|
||||
var next;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == '"' && !stream.eat('"')) {
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
}
|
||||
|
||||
// C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
|
||||
// <delim> can be a string up to 16 characters long.
|
||||
function tokenRawString(stream, state) {
|
||||
// Escape characters that have special regex meanings.
|
||||
var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
|
||||
var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
|
||||
if (match)
|
||||
state.tokenize = null;
|
||||
else
|
||||
stream.skipToEnd();
|
||||
return "string";
|
||||
}
|
||||
|
||||
function def(mimes, mode) {
|
||||
if (typeof mimes == "string") mimes = [mimes];
|
||||
var words = [];
|
||||
function add(obj) {
|
||||
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
||||
words.push(prop);
|
||||
}
|
||||
add(mode.keywords);
|
||||
add(mode.types);
|
||||
add(mode.builtin);
|
||||
add(mode.atoms);
|
||||
if (words.length) {
|
||||
mode.helperType = mimes[0];
|
||||
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
||||
}
|
||||
|
||||
for (var i = 0; i < mimes.length; ++i)
|
||||
CodeMirror.defineMIME(mimes[i], mode);
|
||||
}
|
||||
|
||||
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords),
|
||||
types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
|
||||
"int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
|
||||
"uint32_t uint64_t"),
|
||||
blockKeywords: words("case do else for if switch while struct"),
|
||||
defKeywords: words("struct"),
|
||||
typeFirstDefinitions: true,
|
||||
atoms: words("null true false"),
|
||||
hooks: {"#": cppHook, "*": pointerHook},
|
||||
modeProps: {fold: ["brace", "include"]}
|
||||
});
|
||||
|
||||
def(["text/x-c++src", "text/x-c++hdr"], {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
|
||||
"static_cast typeid catch operator template typename class friend private " +
|
||||
"this using const_cast inline public throw virtual delete mutable protected " +
|
||||
"alignas alignof constexpr decltype nullptr noexcept thread_local final " +
|
||||
"static_assert override"),
|
||||
types: words(cTypes + " bool wchar_t"),
|
||||
blockKeywords: words("catch class do else finally for if struct switch try while"),
|
||||
defKeywords: words("class namespace struct enum union"),
|
||||
typeFirstDefinitions: true,
|
||||
atoms: words("true false null"),
|
||||
hooks: {
|
||||
"#": cppHook,
|
||||
"*": pointerHook,
|
||||
"u": cpp11StringHook,
|
||||
"U": cpp11StringHook,
|
||||
"L": cpp11StringHook,
|
||||
"R": cpp11StringHook,
|
||||
token: function(stream, state, style) {
|
||||
if (style == "variable" && stream.peek() == "(" &&
|
||||
(state.prevToken == ";" || state.prevToken == null ||
|
||||
state.prevToken == "}") &&
|
||||
cppLooksLikeConstructor(stream.current()))
|
||||
return "def";
|
||||
}
|
||||
},
|
||||
namespaceSeparator: "::",
|
||||
modeProps: {fold: ["brace", "include"]}
|
||||
});
|
||||
|
||||
def("text/x-java", {
|
||||
name: "clike",
|
||||
keywords: words("abstract assert break case catch class const continue default " +
|
||||
"do else enum extends final finally float for goto if implements import " +
|
||||
"instanceof interface native new package private protected public " +
|
||||
"return static strictfp super switch synchronized this throw throws transient " +
|
||||
"try volatile while"),
|
||||
types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
|
||||
"Integer Long Number Object Short String StringBuffer StringBuilder Void"),
|
||||
blockKeywords: words("catch class do else finally for if switch try while"),
|
||||
defKeywords: words("class interface package enum"),
|
||||
typeFirstDefinitions: true,
|
||||
atoms: words("true false null"),
|
||||
hooks: {
|
||||
"@": function(stream) {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "meta";
|
||||
}
|
||||
},
|
||||
modeProps: {fold: ["brace", "import"]}
|
||||
});
|
||||
|
||||
def("text/x-csharp", {
|
||||
name: "clike",
|
||||
keywords: words("abstract as async await base break case catch checked class const continue" +
|
||||
" default delegate do else enum event explicit extern finally fixed for" +
|
||||
" foreach goto if implicit in interface internal is lock namespace new" +
|
||||
" operator out override params private protected public readonly ref return sealed" +
|
||||
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
|
||||
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
|
||||
" global group into join let orderby partial remove select set value var yield"),
|
||||
types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
|
||||
" Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
|
||||
" UInt64 bool byte char decimal double short int long object" +
|
||||
" sbyte float string ushort uint ulong"),
|
||||
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
|
||||
defKeywords: words("class interface namespace struct var"),
|
||||
typeFirstDefinitions: true,
|
||||
atoms: words("true false null"),
|
||||
hooks: {
|
||||
"@": function(stream, state) {
|
||||
if (stream.eat('"')) {
|
||||
state.tokenize = tokenAtString;
|
||||
return tokenAtString(stream, state);
|
||||
}
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "meta";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function tokenTripleString(stream, state) {
|
||||
var escaped = false;
|
||||
while (!stream.eol()) {
|
||||
if (!escaped && stream.match('"""')) {
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
escaped = stream.next() == "\\" && !escaped;
|
||||
}
|
||||
return "string";
|
||||
}
|
||||
|
||||
def("text/x-scala", {
|
||||
name: "clike",
|
||||
keywords: words(
|
||||
|
||||
/* scala */
|
||||
"abstract case catch class def do else extends false final finally for forSome if " +
|
||||
"implicit import lazy match new null object override package private protected return " +
|
||||
"sealed super this throw trait try type val var while with yield _ : = => <- <: " +
|
||||
"<% >: # @ " +
|
||||
|
||||
/* package scala */
|
||||
"assert assume require print println printf readLine readBoolean readByte readShort " +
|
||||
"readChar readInt readLong readFloat readDouble " +
|
||||
|
||||
":: #:: "
|
||||
),
|
||||
types: words(
|
||||
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
|
||||
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
|
||||
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
|
||||
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
|
||||
"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
|
||||
|
||||
/* package java.lang */
|
||||
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
||||
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
||||
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
||||
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
||||
),
|
||||
multiLineStrings: true,
|
||||
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
|
||||
defKeywords: words("class def object package trait type val var"),
|
||||
atoms: words("true false null"),
|
||||
indentStatements: false,
|
||||
indentSwitch: false,
|
||||
hooks: {
|
||||
"@": function(stream) {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "meta";
|
||||
},
|
||||
'"': function(stream, state) {
|
||||
if (!stream.match('""')) return false;
|
||||
state.tokenize = tokenTripleString;
|
||||
return state.tokenize(stream, state);
|
||||
},
|
||||
"'": function(stream) {
|
||||
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
||||
return "atom";
|
||||
}
|
||||
},
|
||||
modeProps: {closeBrackets: {triples: '"'}}
|
||||
});
|
||||
|
||||
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
|
||||
name: "clike",
|
||||
keywords: words("sampler1D sampler2D sampler3D samplerCube " +
|
||||
"sampler1DShadow sampler2DShadow " +
|
||||
"const attribute uniform varying " +
|
||||
"break continue discard return " +
|
||||
"for while do if else struct " +
|
||||
"in out inout"),
|
||||
types: words("float int bool void " +
|
||||
"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
|
||||
"mat2 mat3 mat4"),
|
||||
blockKeywords: words("for while do if else struct"),
|
||||
builtin: words("radians degrees sin cos tan asin acos atan " +
|
||||
"pow exp log exp2 sqrt inversesqrt " +
|
||||
"abs sign floor ceil fract mod min max clamp mix step smoothstep " +
|
||||
"length distance dot cross normalize ftransform faceforward " +
|
||||
"reflect refract matrixCompMult " +
|
||||
"lessThan lessThanEqual greaterThan greaterThanEqual " +
|
||||
"equal notEqual any all not " +
|
||||
"texture1D texture1DProj texture1DLod texture1DProjLod " +
|
||||
"texture2D texture2DProj texture2DLod texture2DProjLod " +
|
||||
"texture3D texture3DProj texture3DLod texture3DProjLod " +
|
||||
"textureCube textureCubeLod " +
|
||||
"shadow1D shadow2D shadow1DProj shadow2DProj " +
|
||||
"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
|
||||
"dFdx dFdy fwidth " +
|
||||
"noise1 noise2 noise3 noise4"),
|
||||
atoms: words("true false " +
|
||||
"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
|
||||
"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
|
||||
"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
|
||||
"gl_FogCoord gl_PointCoord " +
|
||||
"gl_Position gl_PointSize gl_ClipVertex " +
|
||||
"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
|
||||
"gl_TexCoord gl_FogFragCoord " +
|
||||
"gl_FragCoord gl_FrontFacing " +
|
||||
"gl_FragData gl_FragDepth " +
|
||||
"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
|
||||
"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
|
||||
"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
|
||||
"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
|
||||
"gl_ProjectionMatrixInverseTranspose " +
|
||||
"gl_ModelViewProjectionMatrixInverseTranspose " +
|
||||
"gl_TextureMatrixInverseTranspose " +
|
||||
"gl_NormalScale gl_DepthRange gl_ClipPlane " +
|
||||
"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
|
||||
"gl_FrontLightModelProduct gl_BackLightModelProduct " +
|
||||
"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
|
||||
"gl_FogParameters " +
|
||||
"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
|
||||
"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
|
||||
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
|
||||
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
|
||||
"gl_MaxDrawBuffers"),
|
||||
indentSwitch: false,
|
||||
hooks: {"#": cppHook},
|
||||
modeProps: {fold: ["brace", "include"]}
|
||||
});
|
||||
|
||||
def("text/x-nesc", {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
|
||||
"implementation includes interface module new norace nx_struct nx_union post provides " +
|
||||
"signal task uses abstract extends"),
|
||||
types: words(cTypes),
|
||||
blockKeywords: words("case do else for if switch while struct"),
|
||||
atoms: words("null true false"),
|
||||
hooks: {"#": cppHook},
|
||||
modeProps: {fold: ["brace", "include"]}
|
||||
});
|
||||
|
||||
def("text/x-objectivec", {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
|
||||
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
|
||||
types: words(cTypes),
|
||||
atoms: words("YES NO NULL NILL ON OFF true false"),
|
||||
hooks: {
|
||||
"@": function(stream) {
|
||||
stream.eatWhile(/[\w\$]/);
|
||||
return "keyword";
|
||||
},
|
||||
"#": cppHook
|
||||
},
|
||||
modeProps: {fold: "brace"}
|
||||
});
|
||||
|
||||
def("text/x-squirrel", {
|
||||
name: "clike",
|
||||
keywords: words("base break clone continue const default delete enum extends function in class" +
|
||||
" foreach local resume return this throw typeof yield constructor instanceof static"),
|
||||
types: words(cTypes),
|
||||
blockKeywords: words("case catch class else for foreach if switch try while"),
|
||||
defKeywords: words("function local class"),
|
||||
typeFirstDefinitions: true,
|
||||
atoms: words("true false null"),
|
||||
hooks: {"#": cppHook},
|
||||
modeProps: {fold: ["brace", "include"]}
|
||||
});
|
||||
|
||||
});
|
|
@ -0,0 +1,335 @@
|
|||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
color: black;
|
||||
border: 1px solid #D9D9D9;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
}
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cm-animate-fat-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||
-moz-animation: blink 1.06s steps(1) infinite;
|
||||
animation: blink 1.06s steps(1) infinite;
|
||||
background-color: #7e7;
|
||||
}
|
||||
@-moz-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
@-webkit-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
@keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {}
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
border-right: 30px solid transparent;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
margin-bottom: -30px;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
*display:inline;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
position: absolute;
|
||||
z-index: 4;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
min-height: 1px; /* prevents collapsing before first draw */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Force content-box sizing for the elements where we expect it */
|
||||
.CodeMirror-scroll,
|
||||
.CodeMirror-sizer,
|
||||
.CodeMirror-gutter,
|
||||
.CodeMirror-gutters,
|
||||
.CodeMirror-linenumber {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-cursor { position: absolute; }
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-focused div.CodeMirror-cursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
||||
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,358 @@
|
|||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
else if (typeof define == "function" && define.amd) // AMD
|
||||
define(["../../lib/codemirror"], mod);
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
function wordRegexp(words) {
|
||||
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
||||
}
|
||||
|
||||
var wordOperators = wordRegexp(["and", "or", "not", "is"]);
|
||||
var commonKeywords = ["as", "assert", "break", "class", "continue",
|
||||
"def", "del", "elif", "else", "except", "finally",
|
||||
"for", "from", "global", "if", "import",
|
||||
"lambda", "pass", "raise", "return",
|
||||
"try", "while", "with", "yield", "in"];
|
||||
var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr",
|
||||
"classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod",
|
||||
"enumerate", "eval", "filter", "float", "format", "frozenset",
|
||||
"getattr", "globals", "hasattr", "hash", "help", "hex", "id",
|
||||
"input", "int", "isinstance", "issubclass", "iter", "len",
|
||||
"list", "locals", "map", "max", "memoryview", "min", "next",
|
||||
"object", "oct", "open", "ord", "pow", "property", "range",
|
||||
"repr", "reversed", "round", "set", "setattr", "slice",
|
||||
"sorted", "staticmethod", "str", "sum", "super", "tuple",
|
||||
"type", "vars", "zip", "__import__", "NotImplemented",
|
||||
"Ellipsis", "__debug__"];
|
||||
var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
|
||||
"file", "intern", "long", "raw_input", "reduce", "reload",
|
||||
"unichr", "unicode", "xrange", "False", "True", "None"],
|
||||
keywords: ["exec", "print"]};
|
||||
var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
|
||||
keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
|
||||
|
||||
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
|
||||
|
||||
function top(state) {
|
||||
return state.scopes[state.scopes.length - 1];
|
||||
}
|
||||
|
||||
CodeMirror.defineMode("python", function(conf, parserConf) {
|
||||
var ERRORCLASS = "error";
|
||||
|
||||
var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]");
|
||||
var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
|
||||
var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
|
||||
var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
|
||||
|
||||
if (parserConf.version && parseInt(parserConf.version, 10) == 3){
|
||||
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
|
||||
var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]");
|
||||
var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
|
||||
} else {
|
||||
var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
|
||||
var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
|
||||
}
|
||||
|
||||
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
||||
|
||||
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
|
||||
if(parserConf.extra_keywords != undefined){
|
||||
myKeywords = myKeywords.concat(parserConf.extra_keywords);
|
||||
}
|
||||
if(parserConf.extra_builtins != undefined){
|
||||
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
|
||||
}
|
||||
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
|
||||
myKeywords = myKeywords.concat(py3.keywords);
|
||||
myBuiltins = myBuiltins.concat(py3.builtins);
|
||||
var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
|
||||
} else {
|
||||
myKeywords = myKeywords.concat(py2.keywords);
|
||||
myBuiltins = myBuiltins.concat(py2.builtins);
|
||||
var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
|
||||
}
|
||||
var keywords = wordRegexp(myKeywords);
|
||||
var builtins = wordRegexp(myBuiltins);
|
||||
|
||||
// tokenizers
|
||||
function tokenBase(stream, state) {
|
||||
// Handle scope changes
|
||||
if (stream.sol() && top(state).type == "py") {
|
||||
var scopeOffset = top(state).offset;
|
||||
if (stream.eatSpace()) {
|
||||
var lineOffset = stream.indentation();
|
||||
if (lineOffset > scopeOffset)
|
||||
pushScope(stream, state, "py");
|
||||
else if (lineOffset < scopeOffset && dedent(stream, state))
|
||||
state.errorToken = true;
|
||||
return null;
|
||||
} else {
|
||||
var style = tokenBaseInner(stream, state);
|
||||
if (scopeOffset > 0 && dedent(stream, state))
|
||||
style += " " + ERRORCLASS;
|
||||
return style;
|
||||
}
|
||||
}
|
||||
return tokenBaseInner(stream, state);
|
||||
}
|
||||
|
||||
function tokenBaseInner(stream, state) {
|
||||
if (stream.eatSpace()) return null;
|
||||
|
||||
var ch = stream.peek();
|
||||
|
||||
// Handle Comments
|
||||
if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
|
||||
// Handle Number Literals
|
||||
if (stream.match(/^[0-9\.]/, false)) {
|
||||
var floatLiteral = false;
|
||||
// Floats
|
||||
if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
|
||||
if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
|
||||
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
|
||||
if (floatLiteral) {
|
||||
// Float literals may be "imaginary"
|
||||
stream.eat(/J/i);
|
||||
return "number";
|
||||
}
|
||||
// Integers
|
||||
var intLiteral = false;
|
||||
// Hex
|
||||
if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true;
|
||||
// Binary
|
||||
if (stream.match(/^0b[01]+/i)) intLiteral = true;
|
||||
// Octal
|
||||
if (stream.match(/^0o[0-7]+/i)) intLiteral = true;
|
||||
// Decimal
|
||||
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
|
||||
// Decimal literals may be "imaginary"
|
||||
stream.eat(/J/i);
|
||||
// TODO - Can you have imaginary longs?
|
||||
intLiteral = true;
|
||||
}
|
||||
// Zero by itself with no other piece of number.
|
||||
if (stream.match(/^0(?![\dx])/i)) intLiteral = true;
|
||||
if (intLiteral) {
|
||||
// Integer literals may be "long"
|
||||
stream.eat(/L/i);
|
||||
return "number";
|
||||
}
|
||||
}
|
||||
|
||||
// Handle Strings
|
||||
if (stream.match(stringPrefixes)) {
|
||||
state.tokenize = tokenStringFactory(stream.current());
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
|
||||
// Handle operators and Delimiters
|
||||
if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
|
||||
return null;
|
||||
|
||||
if (stream.match(doubleOperators) || stream.match(singleOperators))
|
||||
return "operator";
|
||||
|
||||
if (stream.match(singleDelimiters))
|
||||
return null;
|
||||
|
||||
if (stream.match(keywords) || stream.match(wordOperators))
|
||||
return "keyword";
|
||||
|
||||
if (stream.match(builtins))
|
||||
return "builtin";
|
||||
|
||||
if (stream.match(/^(self|cls)\b/))
|
||||
return "variable-2";
|
||||
|
||||
if (stream.match(identifiers)) {
|
||||
if (state.lastToken == "def" || state.lastToken == "class")
|
||||
return "def";
|
||||
return "variable";
|
||||
}
|
||||
|
||||
// Handle non-detected items
|
||||
stream.next();
|
||||
return ERRORCLASS;
|
||||
}
|
||||
|
||||
function tokenStringFactory(delimiter) {
|
||||
while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
||||
delimiter = delimiter.substr(1);
|
||||
|
||||
var singleline = delimiter.length == 1;
|
||||
var OUTCLASS = "string";
|
||||
|
||||
function tokenString(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
stream.eatWhile(/[^'"\\]/);
|
||||
if (stream.eat("\\")) {
|
||||
stream.next();
|
||||
if (singleline && stream.eol())
|
||||
return OUTCLASS;
|
||||
} else if (stream.match(delimiter)) {
|
||||
state.tokenize = tokenBase;
|
||||
return OUTCLASS;
|
||||
} else {
|
||||
stream.eat(/['"]/);
|
||||
}
|
||||
}
|
||||
if (singleline) {
|
||||
if (parserConf.singleLineStringErrors)
|
||||
return ERRORCLASS;
|
||||
else
|
||||
state.tokenize = tokenBase;
|
||||
}
|
||||
return OUTCLASS;
|
||||
}
|
||||
tokenString.isString = true;
|
||||
return tokenString;
|
||||
}
|
||||
|
||||
function pushScope(stream, state, type) {
|
||||
var offset = 0, align = null;
|
||||
if (type == "py") {
|
||||
while (top(state).type != "py")
|
||||
state.scopes.pop();
|
||||
}
|
||||
offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent);
|
||||
if (type != "py" && !stream.match(/^(\s|#.*)*$/, false))
|
||||
align = stream.column() + 1;
|
||||
state.scopes.push({offset: offset, type: type, align: align});
|
||||
}
|
||||
|
||||
function dedent(stream, state) {
|
||||
var indented = stream.indentation();
|
||||
while (top(state).offset > indented) {
|
||||
if (top(state).type != "py") return true;
|
||||
state.scopes.pop();
|
||||
}
|
||||
return top(state).offset != indented;
|
||||
}
|
||||
|
||||
function tokenLexer(stream, state) {
|
||||
var style = state.tokenize(stream, state);
|
||||
var current = stream.current();
|
||||
|
||||
// Handle '.' connected identifiers
|
||||
if (current == ".") {
|
||||
style = stream.match(identifiers, false) ? null : ERRORCLASS;
|
||||
if (style == null && state.lastStyle == "meta") {
|
||||
// Apply 'meta' style to '.' connected identifiers when
|
||||
// appropriate.
|
||||
style = "meta";
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
// Handle decorators
|
||||
if (current == "@"){
|
||||
if(parserConf.version && parseInt(parserConf.version, 10) == 3){
|
||||
return stream.match(identifiers, false) ? "meta" : "operator";
|
||||
} else {
|
||||
return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
|
||||
}
|
||||
}
|
||||
|
||||
if ((style == "variable" || style == "builtin")
|
||||
&& state.lastStyle == "meta")
|
||||
style = "meta";
|
||||
|
||||
// Handle scope changes.
|
||||
if (current == "pass" || current == "return")
|
||||
state.dedent += 1;
|
||||
|
||||
if (current == "lambda") state.lambda = true;
|
||||
if (current == ":" && !state.lambda && top(state).type == "py")
|
||||
pushScope(stream, state, "py");
|
||||
|
||||
var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1;
|
||||
if (delimiter_index != -1)
|
||||
pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
|
||||
|
||||
delimiter_index = "])}".indexOf(current);
|
||||
if (delimiter_index != -1) {
|
||||
if (top(state).type == current) state.scopes.pop();
|
||||
else return ERRORCLASS;
|
||||
}
|
||||
if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
|
||||
if (state.scopes.length > 1) state.scopes.pop();
|
||||
state.dedent -= 1;
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
var external = {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: tokenBase,
|
||||
scopes: [{offset: basecolumn || 0, type: "py", align: null}],
|
||||
lastStyle: null,
|
||||
lastToken: null,
|
||||
lambda: false,
|
||||
dedent: 0
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
var addErr = state.errorToken;
|
||||
if (addErr) state.errorToken = false;
|
||||
var style = tokenLexer(stream, state);
|
||||
|
||||
state.lastStyle = style;
|
||||
|
||||
var current = stream.current();
|
||||
if (current && style)
|
||||
state.lastToken = current;
|
||||
|
||||
if (stream.eol() && state.lambda)
|
||||
state.lambda = false;
|
||||
return addErr ? style + " " + ERRORCLASS : style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != tokenBase)
|
||||
return state.tokenize.isString ? CodeMirror.Pass : 0;
|
||||
|
||||
var scope = top(state);
|
||||
var closing = textAfter && textAfter.charAt(0) == scope.type;
|
||||
if (scope.align != null)
|
||||
return scope.align - (closing ? 1 : 0);
|
||||
else if (closing && state.scopes.length > 1)
|
||||
return state.scopes[state.scopes.length - 2].offset;
|
||||
else
|
||||
return scope.offset;
|
||||
},
|
||||
|
||||
closeBrackets: {triples: "'\""},
|
||||
lineComment: "#",
|
||||
fold: "indent"
|
||||
};
|
||||
return external;
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/x-python", "python");
|
||||
|
||||
var words = function(str) { return str.split(" "); };
|
||||
|
||||
CodeMirror.defineMIME("text/x-cython", {
|
||||
name: "python",
|
||||
extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
|
||||
"extern gil include nogil property public"+
|
||||
"readonly struct union DEF IF ELIF ELSE")
|
||||
});
|
||||
|
||||
});
|
|
@ -0,0 +1,285 @@
|
|||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
else if (typeof define == "function" && define.amd) // AMD
|
||||
define(["../../lib/codemirror"], mod);
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineMode("ruby", function(config) {
|
||||
function wordObj(words) {
|
||||
var o = {};
|
||||
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
|
||||
return o;
|
||||
}
|
||||
var keywords = wordObj([
|
||||
"alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
|
||||
"elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
|
||||
"redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
|
||||
"until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
|
||||
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
|
||||
"require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
|
||||
]);
|
||||
var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then",
|
||||
"catch", "loop", "proc", "begin"]);
|
||||
var dedentWords = wordObj(["end", "until"]);
|
||||
var matching = {"[": "]", "{": "}", "(": ")"};
|
||||
var curPunc;
|
||||
|
||||
function chain(newtok, stream, state) {
|
||||
state.tokenize.push(newtok);
|
||||
return newtok(stream, state);
|
||||
}
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
if (stream.sol() && stream.match("=begin") && stream.eol()) {
|
||||
state.tokenize.push(readBlockComment);
|
||||
return "comment";
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
var ch = stream.next(), m;
|
||||
if (ch == "`" || ch == "'" || ch == '"') {
|
||||
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
|
||||
} else if (ch == "/") {
|
||||
var currentIndex = stream.current().length;
|
||||
if (stream.skipTo("/")) {
|
||||
var search_till = stream.current().length;
|
||||
stream.backUp(stream.current().length - currentIndex);
|
||||
var balance = 0; // balance brackets
|
||||
while (stream.current().length < search_till) {
|
||||
var chchr = stream.next();
|
||||
if (chchr == "(") balance += 1;
|
||||
else if (chchr == ")") balance -= 1;
|
||||
if (balance < 0) break;
|
||||
}
|
||||
stream.backUp(stream.current().length - currentIndex);
|
||||
if (balance == 0)
|
||||
return chain(readQuoted(ch, "string-2", true), stream, state);
|
||||
}
|
||||
return "operator";
|
||||
} else if (ch == "%") {
|
||||
var style = "string", embed = true;
|
||||
if (stream.eat("s")) style = "atom";
|
||||
else if (stream.eat(/[WQ]/)) style = "string";
|
||||
else if (stream.eat(/[r]/)) style = "string-2";
|
||||
else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
|
||||
var delim = stream.eat(/[^\w\s=]/);
|
||||
if (!delim) return "operator";
|
||||
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
|
||||
return chain(readQuoted(delim, style, embed, true), stream, state);
|
||||
} else if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
|
||||
return chain(readHereDoc(m[1]), stream, state);
|
||||
} else if (ch == "0") {
|
||||
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
||||
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
||||
else stream.eatWhile(/[0-7]/);
|
||||
return "number";
|
||||
} else if (/\d/.test(ch)) {
|
||||
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
|
||||
return "number";
|
||||
} else if (ch == "?") {
|
||||
while (stream.match(/^\\[CM]-/)) {}
|
||||
if (stream.eat("\\")) stream.eatWhile(/\w/);
|
||||
else stream.next();
|
||||
return "string";
|
||||
} else if (ch == ":") {
|
||||
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
|
||||
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
|
||||
|
||||
// :> :>> :< :<< are valid symbols
|
||||
if (stream.eat(/[\<\>]/)) {
|
||||
stream.eat(/[\<\>]/);
|
||||
return "atom";
|
||||
}
|
||||
|
||||
// :+ :- :/ :* :| :& :! are valid symbols
|
||||
if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
|
||||
return "atom";
|
||||
}
|
||||
|
||||
// Symbols can't start by a digit
|
||||
if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) {
|
||||
stream.eatWhile(/[\w$\xa1-\uffff]/);
|
||||
// Only one ? ! = is allowed and only as the last character
|
||||
stream.eat(/[\?\!\=]/);
|
||||
return "atom";
|
||||
}
|
||||
return "operator";
|
||||
} else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) {
|
||||
stream.eat("@");
|
||||
stream.eatWhile(/[\w\xa1-\uffff]/);
|
||||
return "variable-2";
|
||||
} else if (ch == "$") {
|
||||
if (stream.eat(/[a-zA-Z_]/)) {
|
||||
stream.eatWhile(/[\w]/);
|
||||
} else if (stream.eat(/\d/)) {
|
||||
stream.eat(/\d/);
|
||||
} else {
|
||||
stream.next(); // Must be a special global like $: or $!
|
||||
}
|
||||
return "variable-3";
|
||||
} else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) {
|
||||
stream.eatWhile(/[\w\xa1-\uffff]/);
|
||||
stream.eat(/[\?\!]/);
|
||||
if (stream.eat(":")) return "atom";
|
||||
return "ident";
|
||||
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
|
||||
curPunc = "|";
|
||||
return null;
|
||||
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
|
||||
curPunc = ch;
|
||||
return null;
|
||||
} else if (ch == "-" && stream.eat(">")) {
|
||||
return "arrow";
|
||||
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
|
||||
var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
|
||||
if (ch == "." && !more) curPunc = ".";
|
||||
return "operator";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function tokenBaseUntilBrace(depth) {
|
||||
if (!depth) depth = 1;
|
||||
return function(stream, state) {
|
||||
if (stream.peek() == "}") {
|
||||
if (depth == 1) {
|
||||
state.tokenize.pop();
|
||||
return state.tokenize[state.tokenize.length-1](stream, state);
|
||||
} else {
|
||||
state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1);
|
||||
}
|
||||
} else if (stream.peek() == "{") {
|
||||
state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1);
|
||||
}
|
||||
return tokenBase(stream, state);
|
||||
};
|
||||
}
|
||||
function tokenBaseOnce() {
|
||||
var alreadyCalled = false;
|
||||
return function(stream, state) {
|
||||
if (alreadyCalled) {
|
||||
state.tokenize.pop();
|
||||
return state.tokenize[state.tokenize.length-1](stream, state);
|
||||
}
|
||||
alreadyCalled = true;
|
||||
return tokenBase(stream, state);
|
||||
};
|
||||
}
|
||||
function readQuoted(quote, style, embed, unescaped) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, ch;
|
||||
|
||||
if (state.context.type === 'read-quoted-paused') {
|
||||
state.context = state.context.prev;
|
||||
stream.eat("}");
|
||||
}
|
||||
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == quote && (unescaped || !escaped)) {
|
||||
state.tokenize.pop();
|
||||
break;
|
||||
}
|
||||
if (embed && ch == "#" && !escaped) {
|
||||
if (stream.eat("{")) {
|
||||
if (quote == "}") {
|
||||
state.context = {prev: state.context, type: 'read-quoted-paused'};
|
||||
}
|
||||
state.tokenize.push(tokenBaseUntilBrace());
|
||||
break;
|
||||
} else if (/[@\$]/.test(stream.peek())) {
|
||||
state.tokenize.push(tokenBaseOnce());
|
||||
break;
|
||||
}
|
||||
}
|
||||
escaped = !escaped && ch == "\\";
|
||||
}
|
||||
return style;
|
||||
};
|
||||
}
|
||||
function readHereDoc(phrase) {
|
||||
return function(stream, state) {
|
||||
if (stream.match(phrase)) state.tokenize.pop();
|
||||
else stream.skipToEnd();
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
function readBlockComment(stream, state) {
|
||||
if (stream.sol() && stream.match("=end") && stream.eol())
|
||||
state.tokenize.pop();
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
return {tokenize: [tokenBase],
|
||||
indented: 0,
|
||||
context: {type: "top", indented: -config.indentUnit},
|
||||
continuedLine: false,
|
||||
lastTok: null,
|
||||
varList: false};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
curPunc = null;
|
||||
if (stream.sol()) state.indented = stream.indentation();
|
||||
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
|
||||
var thisTok = curPunc;
|
||||
if (style == "ident") {
|
||||
var word = stream.current();
|
||||
style = state.lastTok == "." ? "property"
|
||||
: keywords.propertyIsEnumerable(stream.current()) ? "keyword"
|
||||
: /^[A-Z]/.test(word) ? "tag"
|
||||
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
|
||||
: "variable";
|
||||
if (style == "keyword") {
|
||||
thisTok = word;
|
||||
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
|
||||
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
|
||||
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
|
||||
kwtype = "indent";
|
||||
else if (word == "do" && state.context.indented < state.indented)
|
||||
kwtype = "indent";
|
||||
}
|
||||
}
|
||||
if (curPunc || (style && style != "comment")) state.lastTok = thisTok;
|
||||
if (curPunc == "|") state.varList = !state.varList;
|
||||
|
||||
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
|
||||
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
|
||||
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
|
||||
state.context = state.context.prev;
|
||||
|
||||
if (stream.eol())
|
||||
state.continuedLine = (curPunc == "\\" || style == "operator");
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
|
||||
var firstChar = textAfter && textAfter.charAt(0);
|
||||
var ct = state.context;
|
||||
var closing = ct.type == matching[firstChar] ||
|
||||
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
||||
return ct.indented + (closing ? 0 : config.indentUnit) +
|
||||
(state.continuedLine ? config.indentUnit : 0);
|
||||
},
|
||||
|
||||
electricChars: "}de", // enD and rescuE
|
||||
lineComment: "#"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/x-ruby", "ruby");
|
||||
|
||||
});
|
|
@ -264,7 +264,7 @@ K.options = {
|
|||
minHeight : 100,
|
||||
minChangeSize : 50,
|
||||
zIndex : 811213,
|
||||
items : ['code', 'emoticons','fontname',
|
||||
items : ['emoticons','fontname',
|
||||
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
|
||||
'formatblock', 'fontsize', '|','indent', 'outdent',
|
||||
'|','imagedirectupload','table', 'media', 'preview',"more"
|
||||
|
@ -4986,8 +4986,7 @@ KEditor.prototype = {
|
|||
htmlList.unshift('<div style="display:block" id="define"/>')
|
||||
htmlList.push('</div>')
|
||||
var htmlListFull = [];
|
||||
var fullItems = ['code',
|
||||
'emoticons','fontname',
|
||||
var fullItems = ['emoticons','fontname',
|
||||
'forecolor', 'hilitecolor', 'bold','|', 'justifyleft', 'justifycenter', 'insertorderedlist', 'insertunorderedlist', '|',
|
||||
'formatblock', 'fontsize', '|', 'indent', 'outdent',
|
||||
'|','imagedirectupload','table', 'media', 'preview', "less",
|
||||
|
|
|
@ -38,8 +38,11 @@ pre.prettyprint { padding: 2px;
|
|||
border-right: 1px solid #ccc,
|
||||
border-top: 1px solid #ccc }
|
||||
|
||||
pre li,ul,ol {
|
||||
list-style-type: none;
|
||||
pre li,ol li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ul li{
|
||||
list-style-type: disc;
|
||||
}
|
||||
/* Specify class=linenums on a pre to get line numbering */
|
||||
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
|
||||
|
@ -50,7 +53,7 @@ li.L3,
|
|||
li.L5,
|
||||
li.L6,
|
||||
li.L7,
|
||||
li.L8 { list-style-type: none }
|
||||
li.L8 { list-style-type: decimal }
|
||||
/* Alternate shading for lines */
|
||||
li.L1,
|
||||
li.L3,
|
||||
|
|
|
@ -940,19 +940,37 @@ function SearchByName(url,event)
|
|||
{
|
||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||
if(keycode == '13'){
|
||||
location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val();
|
||||
$.get(
|
||||
url,
|
||||
{
|
||||
name : $("#course_student_name").val(),
|
||||
group : $("#student_work_in_group").val()
|
||||
},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
function SearchByName_1(url)
|
||||
{
|
||||
if($("#late_penalty").val() == null){
|
||||
location.href = url + "&name=" + $("#course_student_name").val()
|
||||
}
|
||||
else{
|
||||
location.href = url + "&name=" + $("#course_student_name").val() + "&group=" + $("#late_penalty").val();
|
||||
}
|
||||
//alert($("#student_work_in_group").val());
|
||||
$.get(
|
||||
url,
|
||||
{
|
||||
name : $("#course_student_name").val(),
|
||||
group : $("#student_work_in_group").val()
|
||||
},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#student_work_in_group").live("change",function(){
|
||||
$("#search_in_student_work").click();
|
||||
});
|
||||
});
|
||||
|
||||
//新建作业临时弹框
|
||||
function new_homework_alert(){
|
||||
alert("您好!课程内直接发布作业的功能正在改进中,请直接点击\n顶部导航栏的“作业”向本课程发送作业。谢谢!如有问\n题,可参见帮助中心。");
|
||||
|
|
|
@ -95,9 +95,9 @@ $(function(){
|
|||
|
||||
//发布作业
|
||||
|
||||
//$('#program-src').focus(function(){
|
||||
// $(this).css('height', '100px');
|
||||
//});
|
||||
$('#program-src').focus(function(){
|
||||
$(this).css('height', '100px');
|
||||
});
|
||||
|
||||
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
|
||||
|
||||
|
@ -115,7 +115,7 @@ $(function(){
|
|||
minWidth: 753
|
||||
});
|
||||
|
||||
$('a.ProBtn').live('click', function(){
|
||||
$('a.ProBtn').on('click', function(){
|
||||
$("#BluePopupBox").dialog("open");
|
||||
$(".ui-dialog-titlebar").hide();
|
||||
$("a.CloseBtn").on('click', function(){
|
||||
|
@ -124,6 +124,7 @@ $(function(){
|
|||
$('#textarea_input_test').focus();
|
||||
});
|
||||
|
||||
|
||||
var saveProgramAnswers = function() {
|
||||
var test_numbers = 0;
|
||||
var valid = true;
|
||||
|
@ -170,7 +171,7 @@ $(function(){
|
|||
return valid;
|
||||
}
|
||||
|
||||
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
||||
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
|
||||
if(saveProgramAnswers()){
|
||||
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
||||
$("#BluePopupBox").dialog( "close" );
|
||||
|
@ -181,16 +182,40 @@ $(function(){
|
|||
$("#BluePopupBox").on('click', 'a.icon_add', function(){
|
||||
var html = bt('t:test-answer-list', null);
|
||||
$(this).parent('.mt10').after(html);
|
||||
var inputs = document.getElementsByName("program[input][]");
|
||||
var outputs = document.getElementsByName("program[output][]");
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i=0; i<inputs.length; i++) {
|
||||
autoTextarea2(inputs[i], outputs[i]);
|
||||
autoTextarea2(outputs[i], inputs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
|
||||
$(this).parent('.mt10').remove();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//代码编辑器
|
||||
if (typeof CodeMirror != "undefined") {
|
||||
var program_name = "text/x-csrc";
|
||||
var language = $('#data-language').attr('data-language');
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
}
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#program-src').val(cMirror.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
|
@ -6,42 +6,49 @@ function init_editor(params){
|
|||
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"95%",
|
||||
height:"30px",// == undefined ? "30px":paramsHeight+"px",
|
||||
minHeight:"30px",// == undefined ? "30px":paramsHeight+"px",
|
||||
height:"33px",// == undefined ? "30px":paramsHeight+"px",
|
||||
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
|
||||
items:['emoticons'],
|
||||
afterChange:function(){//按键事件
|
||||
|
||||
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));
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + paramsHeight , paramsHeight));
|
||||
},
|
||||
afterBlur:function(){
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
if(this.edit.html()=="") {
|
||||
this.edit.html('<span id="hint" style="color: #808080">我要回复</span>');
|
||||
this.edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
|
||||
}
|
||||
//params.toolbar_container.hide();
|
||||
$('#reply_image_' + id).addClass('imageFuzzy');
|
||||
//this.resize("95%", null);
|
||||
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){
|
||||
params.submit_btn.hide();
|
||||
this.resize("95%", null);
|
||||
}else if(edit.html().val().trim() != ""){
|
||||
params.submit_btn.show();
|
||||
}
|
||||
|
||||
//params.submit_btn.css("display","none");
|
||||
},
|
||||
afterFocus: function(){
|
||||
var edit = this.edit;
|
||||
var body = edit.doc.body;
|
||||
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
|
||||
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){
|
||||
edit.html('');
|
||||
}
|
||||
params.submit_btn.show();
|
||||
params.contentmsg.hide();
|
||||
// params.toolbar_container.show();
|
||||
$('#reply_image_' + id).removeClass('imageFuzzy');
|
||||
//edit.iframe.width(paramsWidth);
|
||||
this.resize(paramsWidth, null);
|
||||
params.submit_btn.show();
|
||||
//params.submit_btn.show();
|
||||
},
|
||||
|
||||
afterCreate:function(){
|
||||
params.submit_btn.css("display","none");
|
||||
//params.submit_btn.hide();
|
||||
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||
toolbar.css('width',24);
|
||||
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||
|
@ -52,12 +59,10 @@ function init_editor(params){
|
|||
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);
|
||||
edit.html('<span id="hint" style="color: #808080">我要回复</span>');
|
||||
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight));
|
||||
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
|
||||
this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
|
||||
// params.toolbar_container.hide();
|
||||
|
||||
}
|
||||
|
@ -74,7 +79,7 @@ function nh_check_field(params){
|
|||
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||
params.textarea.html(params.content.html());
|
||||
params.content.sync();
|
||||
if(params.content.isEmpty() || /^\&\w*\;\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\&\w*\;[\u4e00-\u9fa5]*\&\w*\;\/\w*\&\w*\;$/.test(params.textarea.html())){
|
||||
if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
|
@ -152,5 +157,5 @@ function init_activity_KindEditor_data(id){
|
|||
});
|
||||
});
|
||||
|
||||
$(".ke-edit").css("height","25px");
|
||||
$(".ke-edit").css("height","33px");
|
||||
}
|
|
@ -56,18 +56,20 @@ function show_more_project(url){
|
|||
}
|
||||
|
||||
//老师提交 新建/修改 作业
|
||||
function submit_homework(id)
|
||||
{
|
||||
if(!regex_homework_name())
|
||||
{
|
||||
function submit_homework(id){
|
||||
if(!regex_homework_name()){
|
||||
$("#homework_name").focus();
|
||||
}
|
||||
else if(!regex_homework_end_time())
|
||||
{
|
||||
else if(!regex_homework_end_time()){
|
||||
$("#homework_end_time").focus();
|
||||
}
|
||||
else if(!regex_course_id())
|
||||
{
|
||||
//else if(!regex_evaluation_start()){
|
||||
// $("#evaluation_start_time").focus()
|
||||
//}
|
||||
//else if(!regex_evaluation_end()){
|
||||
// $("#evaluation_end_time").focus()
|
||||
//}
|
||||
else if(!regex_course_id()){
|
||||
$("#course_id").focus();
|
||||
}
|
||||
else{
|
||||
|
@ -134,6 +136,42 @@ function search_homework_by_name(url){
|
|||
);
|
||||
}
|
||||
|
||||
//验证匿评开启时间:大于截止时间,或者为空
|
||||
function regex_evaluation_start(){
|
||||
var evaluation_start = $.trim($("#evaluation_start_time").val());
|
||||
if(evaluation_start == ""){
|
||||
return true;
|
||||
}
|
||||
var end_time = new Date($.trim($("#homework_end_time").val()));
|
||||
var evaluation_start_time = new Date(evaluation_start);
|
||||
if(evaluation_start_time > end_time){
|
||||
return true;
|
||||
}else{
|
||||
$("#homework_end_time_span").text("开启匿评日期必须大于截止日期");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//验证匿评结束时间:大于匿评开启时间,或者为空。当匿评开启时间为空时,匿评结束时间必须为空
|
||||
function regex_evaluation_end(){
|
||||
var evaluation_start = $.trim($("#evaluation_start_time").val());
|
||||
var evaluation_end = $.trim($("#evaluation_end_time").val());
|
||||
if(evaluation_end == ""){
|
||||
return true;
|
||||
}else if(evaluation_start == ""){
|
||||
$("#homework_end_time_span").text("开启匿评日期为空时,关闭匿评日期必须为空");
|
||||
return false;
|
||||
}
|
||||
var evaluation_start_time = new Date(evaluation_start);
|
||||
var evaluation_end_time = new Date(evaluation_end);
|
||||
if(evaluation_end_time > evaluation_start_time){
|
||||
return true;
|
||||
}else{
|
||||
$("#homework_end_time_span").text("关闭匿评日期必须大于开启匿评日期");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//提交新建作品
|
||||
function new_student_work()
|
||||
{
|
||||
|
|
|
@ -31,8 +31,8 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
|
|||
|
||||
/*右侧内容新*/
|
||||
.ctt2{clear:both; }
|
||||
.hworkListBanner {width:720px; height:40px; background:#eaeaea; margin-bottom:10px; margin-left:5px;}
|
||||
.hworkListContainer {float:left; clear:both; width:720px; margin-left:5px;}
|
||||
.hworkListBanner {width:720px; height:40px; background:#eaeaea; margin-bottom:10px;}
|
||||
.hworkListContainer {float:left; clear:both; width:720px;}
|
||||
.showHwork{ border:2px solid #269ac9; width:696px; padding:10px; color:#666666; padding-bottom:0px; }
|
||||
.showHworkP{ width:630px; float:left;}
|
||||
.showHwork ul li {margin-bottom: 5px;}
|
||||
|
@ -41,17 +41,21 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
|
|||
.pingBoxTit{ float:left; width:625px; margin-left:10px;}
|
||||
.pingText{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; }
|
||||
.pingBackTit{ float:left; width:573px; margin-left:10px; }
|
||||
.hworkUl{ height:50px; border-bottom:1px solid #eaeaea; line-height:50px; vertical-align:middle;}
|
||||
.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; padding-bottom:5px;}
|
||||
.hworkH30 {height:30px !important; line-height:30px !important;}
|
||||
.hworkListRow {height:65px; border-bottom:1px solid #eaeaea; line-height:65px; vertical-align:middle;}
|
||||
.hworkListRow:hover {background-color:#f6f6f7; cursor:pointer;}
|
||||
.hworkListRow:hover {background-color:#f6f6f7;}
|
||||
.hworkUl li{ float:left;}
|
||||
.hworkListRow li{ float:left;}
|
||||
.hworkList380 {width:375px; text-align:left; height:50px; line-height:50px;padding-left:5px;}
|
||||
.hworkList340 {width:335px; text-align:left; height:50px; line-height:50px;padding-left:5px;}
|
||||
.hworkList80 {width:80px; text-align:center;}
|
||||
.hworkList50 {width:50px; text-align:center;}
|
||||
.hworkList130 {width:130px; text-align:center;}
|
||||
.codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; }
|
||||
.hworkName {max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;}
|
||||
.hworkDetail {max-width:100px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;}
|
||||
.hworkName {width:115px; float:left; line-height:18px;}
|
||||
.hworkName div{max-height: 40px;overflow: hidden;}
|
||||
.hworkStName {width:60px; max-width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
|
||||
.hworkStID {width:80px; max-width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
|
||||
.hworkDate {max-width:150px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;}
|
||||
.hworkMenu {width:100px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-110px; font-size:12px; color:#888888; display:none; line-height:2;}
|
||||
a.hworkExport {background:url(../images/homepage_icon2.png) -10px -401px no-repeat; padding-left:23px;}
|
||||
|
@ -60,11 +64,25 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep
|
|||
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px;}
|
||||
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
|
||||
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
|
||||
.width620{width: 620px;}
|
||||
.width625{width: 625px;}
|
||||
.width455{width: 455px;}
|
||||
.m_width620{max-width: 620px;}
|
||||
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
|
||||
.hworkSearchInput {border:none; outline:none; background-color:#ffffff; width:145px; height:25px; padding-left:10px; display:block; float:left;}
|
||||
.hworkSearchIcon {width:30px; height:25px; background:url(../images/nav_icon.png) -8px -1px no-repeat; float:left;}
|
||||
a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-repeat;}
|
||||
.classSplit {border:1px solid #e7e7e7; height:27px; line-height:27px; display:inline-block; margin-left:10px; padding-left:5px; cursor:pointer; outline:none; width:95px; max-width:95px;}
|
||||
.classList {width:45px; border:1px solid #e7e7e7; float:left; position:absolute; background-color:#ffffff; left:-1px;}
|
||||
.hworkPortrait {float:left; width:40px;}
|
||||
.HomeworkNameTitle{width: 285px;text-align: center;margin-left: 50px;}
|
||||
.HomeworkStuTitle{width: 80px;text-align: center;}
|
||||
.StudentName{display: table-cell;width: 115px;vertical-align: middle;text-align: center;height: 40px;}
|
||||
.width385{width: 385px;}
|
||||
.width505{width: 505px;}
|
||||
.width165{width: 165px;}
|
||||
.width180{width: 180px;}
|
||||
.width525{width: 525px;}
|
||||
.width285{width: 285px;}
|
||||
.mr95{margin-right: 95px;}
|
||||
.ml100{margin-left: 100px;}
|
||||
.mt16{margin-top: 16px;}
|
||||
|
||||
|
||||
/*邮件邀请*/
|
||||
|
@ -262,6 +280,8 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;}
|
||||
.ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;}
|
||||
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
||||
|
||||
/* 创建作品 work */
|
||||
.Newwork{ width:668px; height:418px;}
|
||||
|
@ -637,7 +657,7 @@ a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px sol
|
|||
a:hover.Reply_pic{border:1px solid #64bdd9;}
|
||||
.Msg_txt{ float:left; width:540px; margin-left:10px;}
|
||||
.Msg_txt p{ }
|
||||
.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||
.talkWrapMsg > ul > li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||
.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
|
||||
.Replybox{ float:left; width:495px; margin-left:5px;}
|
||||
.talk_nextpage{ border:none; width:410px; margin:0 auto;}
|
||||
|
|
|
@ -120,7 +120,8 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.ping_distop span{ float:left;}
|
||||
.ping_distop p{ color:#5f5f5f;min-height: 24px;}
|
||||
.ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;}
|
||||
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
||||
.ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}
|
||||
|
||||
|
||||
|
|
|
@ -568,6 +568,7 @@ a.postTypeGrey:hover {color:#269ac9;}
|
|||
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
|
||||
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
|
||||
.borderBottomNone {border-bottom:none !important;}
|
||||
.topBorder {border-top: 1px solid #e4e4e4;}
|
||||
div.minHeight48{min-height: 48px;}
|
||||
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;}
|
||||
.homepagePostReplyBannerTime{width:85px; display:inline-block;}
|
||||
|
@ -688,8 +689,6 @@ a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
|
|||
.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;}
|
||||
.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
|
||||
.AgreementImg{margin: 0px auto; width: 820px;}
|
||||
|
||||
/*底部*/
|
||||
#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/
|
||||
|
@ -1150,3 +1149,6 @@ a:hover.tijiao{ background:#0f99a9;}
|
|||
a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
|
||||
a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
||||
.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
|
@ -328,6 +328,8 @@ a:hover.ping_sub{ background:#14a8b9;}
|
|||
.ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;}
|
||||
.ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;}
|
||||
/*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
||||
|
||||
/*上传资源弹出框样式*/
|
||||
.popbox_polls{position:fixed !important;}
|
||||
|
@ -862,7 +864,7 @@ a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px sol
|
|||
a:hover.Reply_pic{border:1px solid #64bdd9;}
|
||||
.Msg_txt{ float:left; width:540px; margin-left:10px;}
|
||||
.Msg_txt p{ }
|
||||
.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||
.talkWrapMsg > ul > li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
|
||||
.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
|
||||
.Replybox{ float:left; width:495px; margin-left:5px;}
|
||||
.talk_nextpage{ border:none; width:410px; margin:0 auto;}
|
||||
|
|
|
@ -91,8 +91,10 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.mr45{margin-right: 45px;}
|
||||
.mr50{margin-right: 50px;}
|
||||
.mr55{margin-right: 55px;}
|
||||
.mr60 {margin-right:60px;}
|
||||
.mr70{margin-right: 70px;}
|
||||
.mw15{margin:0 15px;}
|
||||
.mr90 {margin-right:90px;}
|
||||
.mw20{ margin: 0 20px;}
|
||||
.mt1{margin-top: 1px;}
|
||||
.mt-4 {margin-top:-4px;}
|
||||
|
@ -102,9 +104,10 @@ h4{ font-size:14px; color:#3b3b3b;}
|
|||
.mt8{ margin-top:8px;}
|
||||
.mt10{ margin-top:10px !important;}
|
||||
.mt30{ margin-top: 30px;}
|
||||
.mt12 { margin-top:12px;}
|
||||
.mt12 { margin-top:12px !important;}
|
||||
.mt15 {margin-top:15px;}
|
||||
.mt19 {margin-top:19px !important;}
|
||||
.ml70{margin-left: 70px;}
|
||||
.mb4{ margin-bottom:4px;}
|
||||
.mb5{ margin-bottom:5px;}
|
||||
.mb8 {margin-bottom:8px;}
|
||||
|
@ -213,6 +216,8 @@ a.linkGrey5 {color:#484848;}
|
|||
a.linkGrey5:hover {color:#3498db;}
|
||||
a.linkGrey6 {color:#484848 !important;}
|
||||
a.linkGrey6:hover {color:#ffffff !important;}
|
||||
a.linkGrey7 {color:#888888;}
|
||||
a.linkGrey7:hover {color:#269ac9;}
|
||||
a.bBlue {background-color:#3498db;}
|
||||
a.bBlue:hover {background-color:#297fb8;}
|
||||
a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;}
|
||||
|
@ -293,7 +298,7 @@ a:hover.bgreen_n_btn{background:#08a384;}
|
|||
#Container{ width:1000px; margin:0 auto; }
|
||||
|
||||
/*头部导航*/
|
||||
#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
|
||||
#Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; position: relative;}
|
||||
.logo{ margin:5px 10px; }
|
||||
#TopNav{}
|
||||
#TopNav ul li{ margin-top:8px;}
|
||||
|
@ -604,6 +609,7 @@ a.postTypeGrey:hover {color:#269ac9;}
|
|||
.homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
|
||||
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
|
||||
.borderBottomNone {border-bottom:none !important;}
|
||||
.topBorder {border-top: 1px solid #e4e4e4;}
|
||||
.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;}
|
||||
.homepagePostReplyBannerTime{width:85px; display:inline-block;}
|
||||
.homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;}
|
||||
|
@ -942,5 +948,8 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
|
|||
|
||||
.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;}
|
||||
.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
|
||||
.AgreementImg{margin: 0px auto; width: 820px;}
|
||||
.AgreementTxt{text-indent:2em; margin-bottom:15px;}
|
||||
.AgreementImg{ margin:0px auto;}
|
||||
|
||||
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
|
||||
.list_style ul li{list-style-type: disc;margin-left: 20px;}
|
||||
|
|
|
@ -794,4 +794,4 @@ div.flash.warning, .conflict {
|
|||
.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;}
|
||||
.AgreementTxt{text-indent: 2em; margin-bottom: 15px;}
|
||||
.AgreementImg{margin: 0px auto; width: 820px;}
|
||||
.AgreementImg{margin: 0px auto;}
|
Loading…
Reference in New Issue