项目issue评论

dev_aliyun
caishi 5 years ago
parent 7e01c32481
commit 2fe3f5741b

@ -72,10 +72,10 @@ class Journal < ActiveRecord::Base
where("(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(user, :view_private_notes, *args)}))", false) where("(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(user, :view_private_notes, *args)}))", false)
} }
def save(*args) # def save(*args)
# Do not save an empty journal # # Do not save an empty journal
(details.empty? && notes.blank?) ? false : super # (details.empty? && notes.blank?) ? false : super
end # end
# Returns the new status if the journal contains a status change, otherwise nil # Returns the new status if the journal contains a status change, otherwise nil
def new_status def new_status

@ -36,7 +36,8 @@ function sd_create_editor(params){
} }
//params.toolbar_container.hide(); //params.toolbar_container.hide();
$('#reply_image_' + id).addClass('imageFuzzy'); $('#reply_image_' + id).addClass('imageFuzzy');
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){ // /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html()))
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html()) && $(".upload_filename").length == 0 ){
params.submit_btn.hide(); params.submit_btn.hide();
params.toolbar_container.hide(); params.toolbar_container.hide();
this.resize("100%", null); this.resize("100%", null);
@ -209,13 +210,17 @@ function sd_check_editor_form_field(params){
if(params.content.html()!=params.textarea.html() || params.issubmit==true){ if(params.content.html()!=params.textarea.html() || params.issubmit==true){
params.textarea.html(params.content.html()); params.textarea.html(params.content.html());
params.content.sync(); params.content.sync();
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())){ if(
params.contentmsg.html('内容不能为空'); (params.content.isEmpty() && $(".upload_filename").length == 0)
||
(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.textarea.html())&& $(".upload_filename").length == 0)){
params.contentmsg.html('请填写评论内容或者上传附件!');
params.contentmsg.css({color:'#ff0000'}); params.contentmsg.css({color:'#ff0000'});
}else{
params.contentmsg.html('填写正确');
params.contentmsg.css({color:'#008000'});
} }
// else{
// params.contentmsg.html('填写正确');
// params.contentmsg.css({color:'#008000'});
// }
params.contentmsg.show(); params.contentmsg.show();
} }
} }
@ -281,6 +286,7 @@ function sd_create_editor_from_data(id){
}); });
params.submit_btn.click(function () { params.submit_btn.click(function () {
var tContents = $("#comment_news_" + id).val(); var tContents = $("#comment_news_" + id).val();
console.log("tcontrnet"+tContents);
if(tContents != undefined){ if(tContents != undefined){
var beforeImage = tContents.split("<img"); var beforeImage = tContents.split("<img");
var afterImage = tContents.split("/>"); var afterImage = tContents.split("/>");

Loading…
Cancel
Save