diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index e89f621c8..518cc01c4 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -836,7 +836,7 @@ class CoursesController < ApplicationController
sql_select = ""
if groupid == 0
sql_select = "SELECT members.*,(
- SELECT SUM(student_works.final_score)
+ SELECT AVG(student_works.final_score)
FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id}
@@ -848,7 +848,7 @@ class CoursesController < ApplicationController
WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}"
else
sql_select = "SELECT members.*,(
- SELECT SUM(student_works.final_score)
+ SELECT AVG(student_works.final_score)
FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{@course.id}
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 32ec3dad2..73650a782 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -1,8 +1,8 @@
class PollController < ApplicationController
- before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll]
+ before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
- before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll]
+ before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll]
include PollHelper
def index
if @course
@@ -360,6 +360,17 @@ class PollController < ApplicationController
end
end
+ #导出问卷
+ def export_poll
+ poll_questions = @poll.poll_questions
+ respond_to do |format|
+ format.xls {
+ send_data(poll_to_xls(poll_questions), :type => "text/excel;charset=utf-8; header=present",
+ :filename => "#{@poll.polls_name}.xls")
+ }
+ end
+ end
+
private
def find_poll_and_course
@poll = Poll.find params[:id]
@@ -438,4 +449,41 @@ class PollController < ApplicationController
end
pu
end
+
+ #将poll中题目转换为Excel
+ def poll_to_xls poll_questions
+ xls_report = StringIO.new
+ book = Spreadsheet::Workbook.new
+ sheet1 = book.create_worksheet :name => "poll"
+ blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
+ count_row = 0
+ poll_questions.each do |poll_question|
+ if poll_question.question_type == 1 || poll_question.question_type == 2
+ sheet1.row(count_row).default_format = blue
+ sheet1[count_row,0]= l(:label_poll_question_num,:num => poll_question.question_number)
+ sheet1[count_row + 1,0] = l(:label_poll_subtotal)
+ sheet1[count_row + 2,0] = l(:label_poll_proportion)
+ poll_question.poll_answers.each_with_index do |poll_answer,i|
+ sheet1[count_row, i + 1] = poll_answer.answer_text
+ sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count
+ sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%"
+ end
+ sheet1[count_row + 3,0] = l(:label_poll_valid_commit)
+ sheet1[count_row + 3,1] = total_answer(poll_question.id)
+ count_row += 5
+ else
+ sheet1.row(count_row).default_format = blue
+ sheet1[count_row,0] = l(:label_poll_question_num,:num => poll_question.question_number)
+ sheet1[count_row,1] = poll_question.question_title
+ count_row += 1
+ poll_question.poll_votes.each do |poll_vote|
+ sheet1[count_row,0] = poll_vote.vote_text
+ count_row += 1
+ end
+ count_row += 1
+ end
+ end
+ book.write xls_report
+ xls_report.string
+ end
end
\ No newline at end of file
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 7411dd30f..8488fc1d0 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -103,11 +103,10 @@ class Mailer < ActionMailer::Base
course_ids = courses.map {|course| course.id}.join(",")
# 查询user的缺陷,项目中成员都能收到
- sql = "select * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}'
+ sql = "select DISTINCT * from members m, issues i where i.project_id = m.project_id and m.user_id='#{user.id}'
and (i.created_on between '#{date_from}' and '#{date_to}') order by i.created_on desc"
@issues = Issue.find_by_sql(sql)
-
# @bids 查询课程作业,包括老师发布的作业,以及user提交作业
# @attachments查询课程课件更新
@attachments ||= []
@@ -126,13 +125,19 @@ class Mailer < ActionMailer::Base
# user 提交的作业
# @homeworks = HomeworkAttach.where("user_id=#{user.id} and (created_at between '#{date_from}' and '#{date_to}')").order("created_at desc")
+ # 查询user所在项目添加wiki
+ @wiki_contents = WikiContent.find_by_sql("select DISTINCT wc.* from wikis w, members m, projects p, wiki_pages wp, wiki_contents wc where
+ m.user_id = '#{user.id}' and m.project_id = p.id and w.project_id = p.id and w.id = wp.wiki_id and wc.page_id = wp.id and w.project_id>0
+ and (wc.updated_on between '#{date_from}' and '#{date_to}') order by updated_on desc")
+
# 查询user在课程中发布的讨论帖子
- course_mesages = Message.find_by_sql("select distinct me.* from messages me, boards b, members m where
+ course_mesages = Message.find_by_sql("select DISTINCT me.* from messages me, boards b, members m where
b.id = me.board_id and b.course_id = m.course_id
and b.course_id is not Null and m.user_id = '#{user.id}'
and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+
# 查询user在项目中发布的讨论帖子
- project_messages = Message.find_by_sql("select distinct me.* from messages me, boards b, members m where
+ project_messages = Message.find_by_sql("select DISTINCT me.* from messages me, boards b, members m where
b.id = me.board_id and b.project_id = m.project_id
and b.project_id != '-1' and m.user_id = '#{user.id}' and (me.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
# messages = Message.find_by_sql("select DISTINCT * from messages where author_id = #{user.id} and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@@ -158,17 +163,24 @@ class Mailer < ActionMailer::Base
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc") : []
# 查询user在课程及个人中留言
- @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT * from journals_for_messages where
- jour_type='Course' and user_id = #{user.id}
- and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
- @user_journal_messages = user.journals_for_messages.where("m_parent_id IS NULL and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
+ @course_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, courses c
+ where m.user_id = '#{user.id}' and c.id = m.course_id and jfm.jour_id = c.id
+ and jfm.jour_type='Course' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+
+ @user_journal_messages = user.journals_for_messages.where("jour_type='Principal' and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
+
+ # 查询user在项目中留言(用户反馈)
+ @project_journal_messages = JournalsForMessage.find_by_sql("select DISTINCT jfm.* from journals_for_messages jfm, members m, projects p
+ where m.user_id = '#{user.id}' and p.id = m.project_id and jfm.jour_id = p.id
+ and jfm.jour_type='Project' and (jfm.created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
+
# 查询user新建贴吧或发布帖子
@forums = Forum.find_by_sql("select DISTINCT * from forums where creator_id = #{user.id} and (created_at between '#{date_from}' and '#{date_to}') order by created_at desc")
@memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id}))
and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc")
has_content = [@issues,@course_messages,@project_messages,@course_news,@project_news,
- @course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o| !o.empty?}
+ @course_journal_messages,@user_journal_messages,@project_journal_messages,@forums,@memos,@attachments,@bids,@wiki_contents].any? {|o| !o.empty?}
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
mail :to => user.mail,:subject => subject if has_content
diff --git a/app/models/member.rb b/app/models/member.rb
index 2936392ab..5b1e277d7 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -116,21 +116,23 @@ class Member < ActiveRecord::Base
# 查找每个学生每个作业的评分
def student_homework_score
- score_count = 0
homework_score = StudentWork.find_by_sql("SELECT homework_commons.name,student_works.final_score as score
FROM student_works,homework_commons
WHERE student_works.homework_common_id = homework_commons.id
AND homework_commons.course_id = #{self.course_id}
AND student_works.user_id = #{self.user_id}")
- homework_score.each do |homework|
- mem_score = 0
- if homework[:score]
- mem_score = homework[:score]
- end
- score_count = score_count + mem_score
- end
+ score_count = StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
[homework_score, format("%0.2f", score_count)]
end
+
+ def student_work_score
+ StudentWork.select("homework_commons.name, student_works.final_score").joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}")
+ end
+
+ def student_work_score_avg
+ StudentWork.joins(:homework_common).where("student_works.user_id = #{self.user_id} and homework_commons.course_id = #{self.course_id}").average(:final_score).try(:round, 2).to_f
+ end
+
protected
def validate_role
diff --git a/app/views/attachments/_course_file_links.html.erb b/app/views/attachments/_course_file_links.html.erb
index d32025787..e651c0a93 100644
--- a/app/views/attachments/_course_file_links.html.erb
+++ b/app/views/attachments/_course_file_links.html.erb
@@ -53,7 +53,7 @@
<% end %>
<% if options[:author] %>
- <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
+ <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "author_name" %>,
<%= format_time(attachment.created_on) %>
<% end %>
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index bf276925a..d7a02e326 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -105,6 +105,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(); //用上面那句ie11提交到服务器居然木有值
if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空');
params.contentmsg.css({color:'#ff0000'});
diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb
index adbbf4780..07d065901 100644
--- a/app/views/courses/_courses_jours.html.erb
+++ b/app/views/courses/_courses_jours.html.erb
@@ -1,25 +1,41 @@
+
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
-
+
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= l(:label_leave_message) %>
<% if !User.current.logged?%>
-
- <%= l(:label_user_login_tips) %>
- <%= link_to l(:label_user_login_new), signin_path %>
-
-
+
+ <%= l(:label_user_login_tips) %>
+ <%= link_to l(:label_user_login_new), signin_path %>
+
+
<% else %>
- <%= form_for('new_form', :method => :post,
- :url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%>
- <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
- <%= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
+ <%= form_for('new_form', :method => :post,
+ :url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%>
+ <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
+ <%#= f.kindeditor 'course_message',:height => '140px;',:editor_id => 'leave_message_editor',:input_html=>{:id => "leave_meassge",:style => "resize: none;",
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
-
取 消
-
- <%= l(:button_leave_meassge)%>
-
- <% end %>
+
+
+
+
取 消
+
+ <%= l(:button_leave_meassge)%>
+
+ <% end %>
<% end %>
@@ -28,4 +44,157 @@
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb
index e7c5a7c5e..3dc9aeba5 100644
--- a/app/views/courses/_history.html.erb
+++ b/app/views/courses/_history.html.erb
@@ -30,8 +30,7 @@
<% end %>
<% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
-
+ {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %>
diff --git a/app/views/courses/_set_course_time.html.erb b/app/views/courses/_set_course_time.html.erb
index 0c28b90a7..27c6c0c99 100644
--- a/app/views/courses/_set_course_time.html.erb
+++ b/app/views/courses/_set_course_time.html.erb
@@ -1,6 +1,6 @@
<%
id = "finish_course_#{course.id}"
- display = (course.teacher.id == User.current.id || User.current.admin?)
+ display = (User.current.allowed_to?(:as_teacher,course) || User.current.admin?)
%>
<% if display #如果课程已结束%>
diff --git a/app/views/courses/_show_member_score.html.erb b/app/views/courses/_show_member_score.html.erb
index 0d250cf14..0fd1248c6 100644
--- a/app/views/courses/_show_member_score.html.erb
+++ b/app/views/courses/_show_member_score.html.erb
@@ -17,17 +17,17 @@
<%= @member_score.user.name %> 历次作业积分
- 作业名称得分
- <% @member_score.student_homework_score[0].each do |homework_score| %>
+ <% @member_score.student_work_score.each do |homework_score| %>
-
<%= homework_score.name %>
- <%= format("%0.2f",homework_score[:score].nil? ? 0 : homework_score[:score]) %>
+ <%= format("%0.2f",homework_score.final_score.nil? ? 0 : homework_score.final_score) %>
<% end %>
- - 作业积分(总得分)<%= @member_score.student_homework_score[1] %>
+ - 作业积分(平均分)<%= @member_score.student_work_score_avg %>
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 1e8189ddb..3208bb969 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -41,9 +41,9 @@
<%= homework.description.html_safe %>
-
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 3c4426696..180fed0f0 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -37,6 +37,13 @@
关闭
<% end%>
+ <% if poll.polls_status == 1%>
+ 导出
+ <% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
+ <%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%>
+ <% end%>
+
+
<%= format_date poll.created_at.to_date%>
<% else%>
<% if poll.polls_status == 2%>
diff --git a/app/views/poll/commit_poll.js.erb b/app/views/poll/commit_poll.js.erb
index 8f68dae68..76e5e53df 100644
--- a/app/views/poll/commit_poll.js.erb
+++ b/app/views/poll/commit_poll.js.erb
@@ -1,6 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
-showModal('ajax-modal', '250px');
-$('#ajax-modal').css('height','100px');
+showModal('ajax-modal', '270px');
+$('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
"
");
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index d52f7cfe1..9d4eebd6f 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -34,7 +34,7 @@
<% end %>
<% if reply_allow %>
<%= link_to l(:button_reply),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
+ {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<% end %>
diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb
index e705b7fd3..5b27fd21f 100644
--- a/app/views/words/_new_respond_course.html.erb
+++ b/app/views/words/_new_respond_course.html.erb
@@ -4,12 +4,14 @@
:placeholder => l(:label_feedback_respond_content),
:maxlength => 250 %>
+
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
+
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
-
+
<% end %>
\ No newline at end of file
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index a023bc8cb..f83d3810c 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -219,7 +219,7 @@ zh:
label_submit: 提交
button_project_tags_add: 增加
button_download: 下载
- button_more: "更多»"
+ button_more: "更多"
button_delete: 删除
button_unfollow: 取消关注
button_follow: 关注
diff --git a/config/locales/mailers/zh.yml b/config/locales/mailers/zh.yml
index 8a6aa5168..46666ee25 100644
--- a/config/locales/mailers/zh.yml
+++ b/config/locales/mailers/zh.yml
@@ -20,4 +20,4 @@ zh:
mail_issue_sent_from: "来源:"
mail_issue_from_project: "项目问题跟踪"
mail_issue_attachments: "附件:"
- mail_issue_reply: "我要回复"
\ No newline at end of file
+ mail_issue_reply: "我要回复"
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index e01e2992c..42eea8dcc 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -395,7 +395,8 @@ zh:
label_issue_score: issue得分
label_issue_number: issue的数量
- label_issue_journal_number: issue的留言数量
+ label_issue_journal_number: issue的留言数量
+ label_project_mail_feedback: 项目留言
label_news_score: 新闻得分
label_new_number: 新闻的数量
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 7653a0c4e..b327b1d5f 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -736,6 +736,7 @@ zh:
label_date_to: 到
label_language_based: 根据用户的语言
+ label_mail_policy: 邮件策略
label_send_test_email: 发送测试邮件
label_feeds_access_key: RSS存取键
label_missing_feeds_access_key: 缺少RSS存取键
@@ -782,6 +783,7 @@ zh:
label_project_newother: "查看其他评论"
label_project_newshare: "分享了"
label_project_notice: "发布了通知:"
+ label_project_mail_notice: "发布了新闻:"
label_project_issue: "发布了问题:"
label_project_newadd: "添加了"
label_project_unadd: "暂无项目,赶快去创建吧!"
@@ -1504,6 +1506,7 @@ zh:
label_news_number: 新闻的数量
label_wiki_number: wiki的数量
+ label_wiki_mail_notification: 发布了wiki
@@ -1936,6 +1939,7 @@ zh:
label_poll_description: 问卷描述
label_poll_options: 选项
label_poll_subtotal: 小计
+ label_poll_question_num: "第%{num}题"
label_poll_proportion: 比例
label_poll_valid_commit: 本题有效填写人次
label_poll_result: 问卷调查_问卷统计
diff --git a/config/routes.rb b/config/routes.rb
index d2c21f6ea..c92c732d2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -70,6 +70,7 @@ RedmineApp::Application.routes.draw do
get 'republish_poll'
get 'poll_result'
get 'close_poll'
+ get 'export_poll'
end
collection do
delete 'delete_poll_question'
diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js
index e58e4b2be..fe27e92c2 100644
--- a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js
+++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/kindeditor.js
@@ -5054,8 +5054,7 @@ KEditor.prototype = {
}
});
statusbar.removeClass('statusbar').addClass('ke-statusbar')
- .append('')
- .append('');
+ .append('');
if (self._fullscreenResizeHandler) {
K(window).unbind('resize', self._fullscreenResizeHandler);
self._fullscreenResizeHandler = null;
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 176e00ec8..74228d3ea 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -1,3 +1,10 @@
+//function dump_obj(myObject) {
+// var s = "";
+// for (var property in myObject) {
+// s = s + "\n "+property +": " + myObject[property] ;
+// }
+// alert(s);
+//}
/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2013 kindsoft.net
@@ -4150,6 +4157,7 @@ function KUploadButton(options) {
}
_extend(KUploadButton, {
init : function(options) {
+ //dump_obj(options);
var self = this,
button = K(options.button),
fieldName = options.fieldName || 'file',
@@ -4180,6 +4188,7 @@ _extend(KUploadButton, {
button.hide();
button.before(div);
self.div = div;
+ if(options.ops!=undefined)options.ops.up_file_div = div;//options.ops是KindEditor.create()的options参数
self.button = button;
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
self.form = options.form ? K(options.form) : K('form', div);
@@ -4981,13 +4990,13 @@ KEditor.prototype = {
'emoticons',
'source','plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', '|',
'formatblock', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'link', "less",
+ 'italic', 'underline', 'removeformat', '|','imagedirectupload','table', 'media', "less",
'/',
'undo', 'redo', '|', 'preview', 'print', 'template',
'justifyfull', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
- 'superscript', 'clearhtml', 'quickformat', 'selectall', 'fontname',
+ 'superscript', 'clearhtml', 'quickformat', /* 'selectall',*/ 'fontname',
'strikethrough', 'lineheight', 'hr', 'pagebreak',
- 'anchor' , 'unlink'
+ 'anchor' , 'link','unlink'
]
K.each(fullItems, function(i, name) {
if (name == '|') {
@@ -5093,8 +5102,7 @@ KEditor.prototype = {
}
});
statusbar.removeClass('statusbar').addClass('ke-statusbar')
- .append('')
- .append('');
+ .append('');
if (self._fullscreenResizeHandler) {
K(window).unbind('resize', self._fullscreenResizeHandler);
self._fullscreenResizeHandler = null;
@@ -5602,8 +5610,11 @@ _plugin('core', function(K) {
inputObj.setAttribute('type', 'button');
inputObj.setAttribute('style', 'visibility:hidden');
document.body.appendChild(inputObj);
- window.uploadButton = K.uploadbutton({
- button: inputObj,
+
+ //window.uploadButton = K.uploadbutton({
+ self.uploadButton = K.uploadbutton({
+ ops:self, //self 是KindEditor.create()的options参数
+ button: inputObj,
fieldName:'imgFile',
url:K.addParam('/kindeditor/upload', 'dir=image'),
afterUpload : function(data) {
@@ -5625,8 +5636,8 @@ _plugin('core', function(K) {
alert('error: ' + str);
}
});
- uploadButton.fileBox.change(function(e) {
- uploadButton.submit();
+ self.uploadButton.fileBox.change(function(e) {
+ self.uploadButton.submit();
});
if (self.fullscreenShortcut) {
@@ -5663,7 +5674,7 @@ _plugin('core', function(K) {
});
});
self.clickToolbar('imagedirectupload', function() {
- $('.ke-upload-file').focus().trigger('click');
+ $('.ke-upload-file',this.up_file_div).trigger('click');
});
self.clickToolbar('formatblock', function() {
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 4c0cae670..8f87767ed 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -353,10 +353,26 @@ function show_more_msg()
function news_show_more_des(id)
{
$('#news_description_' + id).toggleClass("news_description_none");
+ if($("#news_description_" + id).hasClass("news_description_none"))
+ {
+ $("#news_foot_" + id).html("[收起]");
+ }
+ else
+ {
+ $("#news_foot_" + id).html("[展开]");
+ }
}
function bid_show_more_des(id)
{
$("#bid_description_" + id).toggleClass("news_description_none");
+ if($("#bid_description_" + id).hasClass("news_description_none"))
+ {
+ $("#bid_show_more_des_button" + id).html("[收起]");
+ }
+ else
+ {
+ $("#bid_show_more_des_button" + id).html("[展开]");
+ }
}
//课程作业结束时间倒计时
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index edb70075b..e577bde66 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -30,10 +30,6 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;}
.box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:10px; padding-left:5px; width:290px;}
-/*.icon_addm{ background:url(../images/img_floatbox.png) 0 -33px no-repeat; width:16px; height:16px; display:block; margin:5px 0 0 5px;}*/
-/*.icon_addm:hover{background:url(../images/img_floatbox.png) 0 -61px no-repeat; }*/
-/*.icon_removem{ background:url(../images/img_floatbox.png) -22px -33px no-repeat;width:16px; height:16px; display:block; margin:5px 0 0 5px}*/
-/*.icon_removem:hover{background:url(../images/img_floatbox.png) -22px -61px no-repeat;}*/
a.btn_free{ background:#ff5722; display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;}
a:hover.btn_free{ background:#d63502;}
/*成员邀请*/
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index f1b5023bd..353ec3937 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -127,7 +127,7 @@ a:hover.btn_de{ background:#ff5d31;}
a.btn_pu{ border:1px solid #3cb761; color:#3cb761; }
a:hover.btn_pu{ background:#3cb761;}
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; height:19px; padding-top:3px; }
-.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
+.polls_title_w { width:300px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_title_st { max-width:530px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.polls_de_grey{ color:#b1b1b1; margin-top:3px;}
.ml5{ margin-left:5px;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 59431b3ad..4bfc1ef99 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -439,3 +439,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
img{max-width: 100%;}
.attachments {clear: both;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
+.author_name{color: #3ca5c6 !important;}