From 538c64329f16f0be5a6246d4b2021d7d3bd5da1f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 21 Dec 2015 09:26:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?issue=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/update.js.erb | 17 +++++++++++++++-- .../app/views/issues/update_form.js.erb | 11 ++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index be018c3f5..ede4a0534 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -12,12 +12,25 @@ issue_desc_editor = KindEditor.create('#issue_description', {"width":"85%", "resizeType":0, "no_label":true, + "at_id":<%= @issue.project_id%>, + "at_type":"Project", "autoHeightMode":true, - "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})", - "emotionsBasePath":"http://localhost:3000","height":300, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, "allowFileManager":true, "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); +//issue_desc_editor = KindEditor.create('#issue_description', +// {"width":"85%", +// "resizeType":0, +// "no_label":true, +// "autoHeightMode":true, +// "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})", +// "emotionsBasePath":"http://localhost:3000","height":300, +// "allowFileManager":true, +// "uploadJson":"/kindeditor/upload", +// "fileManagerJson":"/kindeditor/filemanager"}); <%else%> alert('<%= @issue.errors.full_messages[0].to_s%>') <%end %> diff --git a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb index 23bd5108b..3b93de0b3 100644 --- a/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb +++ b/plugins/redmine_ckeditor/app/views/issues/update_form.js.erb @@ -13,11 +13,12 @@ issue_desc_editor = KindEditor.create('#issue_description', {"width":"85%", "resizeType":0, "no_label":true, + "at_id":<%= @issue.project_id%>, + "at_type":"Project", "autoHeightMode":true, - "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\"),$(this.toolbar.div).hide();})", - "afterFocus":"eval(function(){$(this.toolbar.div).show();})", - "afterBlur":"eval(function(){$(this.toolbar.div).hide();})", - "emotionsBasePath":"http://localhost:3000", - "height":300,"allowFileManager":true, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, "<%=@issue.project_id %>", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, + "allowFileManager":true, "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); \ No newline at end of file From e86f9f9aeb8469d3b1854679bedfeae180b88808 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 21 Dec 2015 13:20:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=AD=97=E7=AC=A6=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/course.js | 4 ++-- public/javascripts/project.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/javascripts/course.js b/public/javascripts/course.js index c147850ef..5bfaccf30 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -299,12 +299,12 @@ function regexDescription() $("#description_notice_span").focus(); return false; } - else if(name.length >=6000){ + /*else if(name.length >=6000){ $("#description_notice_span").text("描述最多3000个汉字(或6000个英文字符)"); $("#description_notice_span").css('color','#ff0000'); $("#description_notice_span").focus(); return false; - } + }*/ else { $("#description_notice_span").text("填写正确"); diff --git a/public/javascripts/project.js b/public/javascripts/project.js index a7bf954a0..cc679847a 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -248,13 +248,13 @@ function regexDescription() { $("#description_notice_span").focus(); return false; } - else if (name.length > 10000) + /*else if (name.length > 10000) { $("#description_notice_span").text("描述超过10000个字符"); $("#description_notice_span").css('color', '#ff0000'); $("#description_notice_span").focus(); return false; - } + }*/ else { $("#description_notice_span").text("填写正确"); $("#description_notice_span").css('color', '#008000');