From b1f3395bd1f40b4b709c3dec238a6b7202439f34 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Mar 2016 14:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=93=81=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=A1=86=E5=92=8C=E5=90=8D=E7=A7=B0=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/new.html.erb | 21 ++++++++++++++------- app/views/users/user_homeworks.html.erb | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index 0a29d2f6e..a7e223ac1 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -79,10 +79,6 @@ } } - var KE = { - MDU: "1234455",//当前文章标识符 - }; - function nh_check_field(params){ var result=true; if(!regexStudentWorkName()) { @@ -90,14 +86,14 @@ return result; } if(params.content!=undefined){ - if(params.content.isEmpty()){ + if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*[\uFE30-\uFFA0][\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.content.html())){ result=false; } if(params.content.html()!=params.textarea.html() || params.issubmit==true){ params.textarea.html(params.content.html()); params.content.sync(); - if(params.content.isEmpty()){ + if(params.content.isEmpty() || /^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*[\uFE30-\uFFA0][\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(params.content.html())){ params.contentmsg.html('作品描述不能为空'); }else{ params.contentmsg.html(''); @@ -150,6 +146,17 @@ edit.iframe.height(150); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 33, 150)); }, + afterBlur:function(){ + if(this.isEmpty()) { + this.edit.html("请在此输入作品描述,您可以直接在这里粘贴作业图片"); + } + }, + afterFocus: function(){ + var edit = this.edit; + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*[\uFE30-\uFFA0][\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){ + edit.html(''); + } + }, afterCreate:function(){ //init var edit = this.edit; @@ -159,7 +166,7 @@ //reset height var edit = this.edit; var body = edit.doc.body; - edit.html(params.textarea.innerHTML); + edit.html("请在此输入作品描述,您可以直接在这里粘贴作业图片"); //paramsHeight = params.kindutil.removeUnit(this.height); edit.iframe.height(150); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) , 150)); diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 683cb7019..2cd1f5b21 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -58,7 +58,7 @@
- <%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %> + <%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => nil} %>