From a61e60d1b9d876dc9de5c067361f7bfa5de60a23 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Fri, 25 Sep 2015 15:46:40 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E4=BC=9A=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/memos/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index 4cafce30d..c15bd9bb8 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -56,7 +56,7 @@
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
-
+
<%= @memo.content.html_safe%>
From 926bdd81e8916056d01491a20dbe86b2902445ea Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Fri, 25 Sep 2015 15:52:28 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=90=8D=E6=8D=A2?=
=?UTF-8?q?=E8=A1=8C=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_forums.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index 6a980cc87..366291691 100644
--- a/app/views/layouts/base_forums.html.erb
+++ b/app/views/layouts/base_forums.html.erb
@@ -149,7 +149,7 @@
From c8cbab2d505e7cdd0bd22bc29321c0c7fa48bb2d Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Fri, 25 Sep 2015 15:55:29 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E7=81=AB=E7=8B=90=E6=B5=8F=E8=A7=88?=
=?UTF-8?q?=E5=99=A8=20=E5=92=8C=20ie=E6=B5=8F=E8=A7=88=E5=99=A8=E7=9A=84e?=
=?UTF-8?q?vent=E8=8E=B7=E5=BE=97=20=E5=92=8C=20=E9=98=BB=E6=AD=A2=20?=
=?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=B8=8D=E5=90=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/forums/edit.html.erb | 43 ++++++++++++++++++++-------------
app/views/forums/index.html.erb | 15 +++++++++---
public/javascripts/new_user.js | 15 +++++++++---
3 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb
index c212e7b9d..1fcbc6cab 100644
--- a/app/views/forums/edit.html.erb
+++ b/app/views/forums/edit.html.erb
@@ -1,23 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %>
\ No newline at end of file
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index 8f5cb15cc..bb531b85c 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -49,7 +49,7 @@
$("#reorder_popu").removeClass("sortArrowActiveD");
add_class("reorder_time");
});
- document.getElementById('forum_name').onkeydown = function()
+ $('#forum_name').keypress( function(e)
{
var n = 0;
var str = this.value;
@@ -61,9 +61,16 @@
n += 1;//英文,不多说了
}
}
- if(n >= 160 && event.keyCode != 8)
- event.returnValue = false;
- }
+ if(n >= 160 && e.keyCode != 8)
+ if(document.all)
+ {
+ e.returnValue = false;
+ }
+ else
+ {
+ e.preventDefault();
+ }
+ })
});
function check_and_submit(doc){
$("#error").html('').hide();
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index d2b67be5e..22c049ecc 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -337,7 +337,7 @@ var autoTextarea = function (elem, extra, maxHeight) {
};
function limitStrsize(id,length){
- document.getElementById(id).onkeydown = function()
+ $('#'+id).keypress(function(e)
{
var n = 0;
var str = this.value;
@@ -350,9 +350,16 @@ function limitStrsize(id,length){
}
}
- if(n >= length && event.keyCode !== 8)
- event.returnValue = false;
- }
+ if(n >= length && e.keyCode !== 8)
+ if(document.all)
+ {
+ e.returnValue = false;
+ }
+ else
+ {
+ e.preventDefault();
+ }
+ })
}
/////////////////////////////////////////////////////////////////////////////////////创建项目