From 2c7a964470b2f76c0de351058f47f5c1d746c460 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 16:59:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/pasteimg.js | 1 + public/javascripts/application.js | 1 + 2 files changed, 2 insertions(+) diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index 8831ba300..51f717086 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -416,6 +416,7 @@ function uploadpic(piclist,myself) { that.attr("src", str[tIndex]); that.attr("data-ke-src", str[tIndex]); + //复制过来带的链接class等都要去掉 和视频图片有关系 that.removeAttr("class"); that.parent().removeAttr("class"); that.parent().removeAttr("href"); diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c43e0a6a2..4cf64abb7 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1019,6 +1019,7 @@ function showNormalImage(id) { $(image).attr('src',_src); return; } + //无格式的图片不让点击显示大图,显示的话会有问题 var tmpsrc = image.attr('src'); if (tmpsrc.indexOf('.gif') >= 0 || tmpsrc.indexOf('.jpg') >= 0 || tmpsrc.indexOf('.jpeg') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.bmp') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.BMP') >= 0 || tmpsrc.indexOf('.JPEG') >= 0 || tmpsrc.indexOf('.JPG') >= 0 || tmpsrc.indexOf('.PNG') >= 0 || tmpsrc.indexOf('.GIF') >= 0) { var element = $("").attr("href", image.attr('src')); From 6056505f967ceb731514bebf24cfd76af5ac6b9d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 19:07:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E6=97=B6=E5=B0=86=E5=9B=BE=E7=89=87=E6=89=80=E5=B8=A6=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/pasteimg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index 51f717086..7165b142a 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -419,7 +419,8 @@ function uploadpic(piclist,myself) { //复制过来带的链接class等都要去掉 和视频图片有关系 that.removeAttr("class"); that.parent().removeAttr("class"); - that.parent().removeAttr("href"); + that.parents().removeAttr("href"); //删除所有父节点的href +// that.parent().removeAttr("href"); that.parent().removeAttr("data-ke-src"); tIndex = tIndex + 1; } From e24470db4c9067f08e6f04e20289be77bae4ab9c Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Sun, 15 May 2016 00:00:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=88=AA=E5=8F=96ERROR=5FMSG=E6=97=B6=E5=8F=AA=E5=9C=A8?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=E4=B8=8B=E6=88=AA=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index ba2999577..589f232c5 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -123,7 +123,9 @@ class StudentWorkController < ApplicationController #-1 默认值 0全部正确并结束 2 超时 -2 编译错误 resultObj[:status] = -1 resultObj[:results] = result["results"].first #本次测试结果 - result["error_msg"] = result["error_msg"][0..2047] + if result["status"].to_i == -2 #编译错误 + result["error_msg"] = result["error_msg"][0..2047] + end resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 #该状态用于存入CodeTests