This commit is contained in:
Tim 2015-09-29 17:30:02 +08:00
commit b6a8a69be8
11 changed files with 98 additions and 68 deletions

View File

@ -175,19 +175,19 @@ class NewsController < ApplicationController
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
end
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
teachers = searchTeacherAndAssistant(@course)
for teacher in teachers
if(teacher.user_id != User.current.id)
notify = ActivityNotify.new()
notify.activity_container_id = @course.id
notify.activity_container_type = 'Course'
notify.activity_id = @news.id
notify.activity_type = 'News'
notify.notify_to = teacher.user_id
notify.is_read = 0
notify.save()
end
end
# teachers = searchTeacherAndAssistant(@course)
# for teacher in teachers
# if(teacher.user_id != User.current.id)
# notify = ActivityNotify.new()
# notify.activity_container_id = @course.id
# notify.activity_container_type = 'Course'
# notify.activity_id = @news.id
# notify.activity_type = 'News'
# notify.notify_to = teacher.user_id
# notify.is_read = 0
# notify.save()
# end
# end
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)

View File

@ -59,7 +59,6 @@ class Mailer < ActionMailer::Base
@anonymous_comment_close_name = homework_common.name
@author = homework_common.user
#收件人邮箱
recipients << user.mail
end
mail :to => recipients,
@ -98,10 +97,6 @@ class Mailer < ActionMailer::Base
@anonymous_comment_fail_name = homework_common.name
@author = homework_common.user
#收件人邮箱
puts "######################"
puts homework_common.id
puts recipients
puts "######################"
recipients << user.mail
end
end

View File

@ -123,7 +123,7 @@
}
});
function del_confirm(){
function del_forum_confirm(){
if(confirm('您确定要删除么?')){
$("#del_link").click();
}
@ -180,7 +180,7 @@
<span class="postEdit">
</span>
<a href="<%= edit_forum_path(@forum) %>" class="linkGrey3">编辑贴吧</a>
<a href="javascript:void(0);" data-method="delete" onclick="del_confirm();" class="fr linkGrey3">删除贴吧</a>
<a href="javascript:void(0);" data-method="delete" onclick="del_forum_confirm();" class="fr linkGrey3">删除贴吧</a>
<a href="<%= forum_path(@forum)%>" data-method="delete" id="del_link" type="hidden"></a>
<span class="postDelete"></span>
<% end %>

View File

@ -7,7 +7,7 @@
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
<% @flag = @is_valuate.first.praise_or_tread %>
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
<a href="javascript:void(0);" class="<%= @obj.author.id == User.current.id ? 'linkGrey2 postLikeIcon mr30':'linkGrey2 postLikeIcon' %>" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
<a href="javascript:void(0);" class="<%= obj.author.id == User.current.id ? 'linkGrey2 postLikeIcon mr30':'linkGrey2 postLikeIcon' %>" title="<%= l(:label_issue_praise_over)%>" > <%= get_praise_num(obj)%></a>
<% end %>
<% else %>
<% if user_id == obj.author_id %>

View File

@ -33,7 +33,7 @@
function del_confirm(){
if(confirm('确认删除么?')){
$("#del_link").click();
$("#del_memo_link").click();
}else{
}
@ -52,7 +52,7 @@
<ul class="homepagePostSettiongText">
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_link" ></a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum,@memo) %>" data-method="delete" id="del_memo_link" ></a></li>
</ul>
</li>
</ul>

View File

@ -5031,7 +5031,7 @@ KEditor.prototype = {
height : editHeight > 0 && _removeUnit(height) > self.minHeight ? editHeight : self.minHeight,
src : editDiv,
srcElement : self.srcElement,
designMode : self.designMode,
designMode : true,
themesPath : self.themesPath,
bodyClass : self.bodyClass,
cssPath : self.cssPath,
@ -5063,9 +5063,9 @@ KEditor.prototype = {
_bindTabEvent.call(self);
_bindFocusEvent.call(self);
edit.afterChange(function(e) {
if (!edit.designMode) {
return;
}
// if (!edit.designMode) {
// return;
// }
self.updateState();
self.addBookmark();
//prettyPrint("",self.edit.doc.body);

View File

@ -13,7 +13,7 @@ KindEditor.plugin('emoticons', function(K) {
allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
currentPageNum = 1;
self.clickToolbar(name, function() {
this.edit.focus();//如果没有这句 火狐下取不到焦点 导致_getSel()为空 报错
this.edit.focus();//<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>_getSel()Ϊ<><CEAA> <20><><EFBFBD><EFBFBD>
var rows = 5, cols = 9, total = 135, startNum = 0,
cells = rows * cols, pages = Math.ceil(total / cells),
colsHalf = Math.floor(cols / 2),
@ -55,6 +55,9 @@ KindEditor.plugin('emoticons', function(K) {
K(this).removeClass('ke-on');
});
cell.click(function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
self.insertHtml('<img src="' + path + num + '.gif" border="0" alt="" />').hideMenu().focus();
e.stop();
});

View File

@ -410,22 +410,6 @@ function show_bid_dead_line(year,month,day,divname)
+ "<p class='fr'>作品提交还剩:</p>");
}
//验证新建作业的名字
function regex_homework_name()
{
var name = $.trim($("#homework_name").val());
if(name=="")
{
$("#homework_name_span").text("名称不能为空");
return false;
}
else
{
$("#homework_name_span").text("");
return true;
}
}
//处理迟交、缺评扣分
function check_late_penalty(id)
@ -579,22 +563,68 @@ function regex_evaluation_num(){
}
//老师提交 新建/修改 作业
//function submit_homework(id)
//{
// if(!regex_homework_name())
// {
// $("#homework_name").focus();
// }
// else if(!regex_evaluation_num())
// {
// $("#evaluation_num").focus();
// }
// else
// {
// homework_description_editor.sync();
// $("#"+id).submit();
// }
//}
function submit_homework(id){
if(!regex_homework_name()){
$("#homework_name").focus();
}
else if(!regex_homework_end_time()){
$("#homework_end_time").focus();
}
else if(!regex_course_id()){
$("#course_id").focus();
}
else{
homework_description_editor.sync();
$("#"+id).submit();
}
}
//验证新建作业的名字
function regex_homework_name()
{
var name = $.trim($("#homework_name").val());
if(name=="")
{
$("#homework_name_span").text("名称不能为空");
return false;
}
else
{
$("#homework_name_span").text("");
return true;
}
}
//验证截止时间
function regex_homework_end_time()
{
var name = $.trim($("#homework_end_time").val());
if(name=="")
{
$("#homework_end_time_span").text("截止时间不能为空");
return false;
}
else
{
$("#homework_end_time_span").text("");
return true;
}
}
//验证发送到课程
function regex_course_id(){
var course_id = $("#course_id").val();
if(course_id == -1)
{
$("#homework_course_id_span").text("发布课程不能为空");
return false;
}
else
{
$("#homework_course_id_span").text("");
return true;
}
}
function regexHomeworkCommonName()
{

View File

@ -63,17 +63,10 @@ function submit_homework(id){
else if(!regex_homework_end_time()){
$("#homework_end_time").focus();
}
//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{
homework_description_editor.sync();
$("#"+id).submit();
}

View File

@ -798,6 +798,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailWrap {width:580px; float:left;}
.postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;}
.postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;}
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}
.postDetailReply { margin-top:28px; color:#888888; float:right;}

View File

@ -43,7 +43,11 @@ pre li,ul,ol {
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px } /* IE indents via margin-left */
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px;margin-left: 0px !important; } /* IE indents via margin-left */
.list_style ol li {
list-style-type: decimal;
margin-left: 10px;
}
li.L0,
li.L1,
li.L2,
@ -75,3 +79,7 @@ li.L9 { background: #eee }
/*.prettyprint .dec,*/
/*.prettyprint .var { color: #A6E22E; }*/
/*.prettyprint .pln { color: #66D9EF; }*/
.memo-content pre {
white-space:pre !important;
word-wrap: break-word;
}