From db0978c6571e5645fc5cc931d911e145b8fcc68a Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 17:07:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 186 +++++++++++++++++---------------- app/views/memos/edit.html.erb | 9 +- public/javascripts/feedback.js | 38 ++++++- 3 files changed, 136 insertions(+), 97 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 523ab1300..5bbc52db2 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,96 +1,5 @@ <%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %> -
-
\ No newline at end of file + + \ No newline at end of file diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index d26ebdbf8..b2b7d73f0 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -7,10 +7,11 @@ $("#error").html('主题不能超过50个字符').show(); return; } -// if(memo_content.html().trim().length > 5000 ){ -// $("#error").html('内容不能超过5000个字符').show(); -// return; -// } + if(memo_content.html().length > 30000){ + $("#error").html("内容 过长(最长为 30000 个字符)").show(); + $("html,body").animate({scrollTop:$("#error").offset().top},1000) + return false; + } memo_content.sync(); $("#edit_memo").submit(); }else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){ diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index b30c8f91d..97209131e 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -1,5 +1,10 @@ (function($){ $.fn.fix = function(options){ + var u = navigator.userAgent; + if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){ + $("#scrollsidebar").css("display","none"); + return; + } var defaults = { float : 'right', minStatue : true, @@ -73,6 +78,11 @@ function cookieget(n) $(function(){ + var u = navigator.userAgent; + if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){ + $("#scrollsidebar").css("display","none"); + return; + } $(".closeSidebar").click(function(){ $(".show_btn").css("display","none"); $("#scrollsidebar").css("display","none"); @@ -109,4 +119,30 @@ $(function(){ $("#textCount").text(50-$("#subject").val().length) } }); -}); \ No newline at end of file +}); + +//var browser={ +// versions:function(){ +// var u = navigator.userAgent, app = navigator.appVersion; +// return {//移动终端浏览器版本信息 +// trident: u.indexOf('Trident') > -1, //IE内核 +// presto: u.indexOf('Presto') > -1, //opera内核 +// webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 +// gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 +// mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端 +// ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 +// android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器 +// iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器 +// iPad: u.indexOf('iPad') > -1, //是否iPad +// webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部 +// }; +// }(), +// language:(navigator.browserLanguage || navigator.language).toLowerCase() +//} +//document.writeln("语言版本: "+browser.language); +//document.writeln(" 是否为移动终端: "+browser.versions.mobile); +//document.writeln(" ios终端: "+browser.versions.ios); +//document.writeln(" android终端: "+browser.versions.android); +//document.writeln(" 是否为iPhone: "+browser.versions.iPhone); +//document.writeln(" 是否iPad: "+browser.versions.iPad); +//document.writeln(navigator.userAgent); \ No newline at end of file From 2cf61ad74f9eb6a0f05cd5645bc805107b15a3fe Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 10 Nov 2015 17:34:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 4 ++-- app/views/memos/edit.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 5bbc52db2..05c086ed4 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -128,8 +128,8 @@ $("#error").html("主题 过长(最长为 50 个字符)").show(); return false; } - if(memo_content.html().length > 30000){ - $("#error").html("内容 过长(最长为 30000 个字符)").show(); + if(memo_content.html().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); $("html,body").animate({scrollTop:$("#error").offset().top},1000) return false; } diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index b2b7d73f0..cace5bcc8 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -7,8 +7,8 @@ $("#error").html('主题不能超过50个字符').show(); return; } - if(memo_content.html().length > 30000){ - $("#error").html("内容 过长(最长为 30000 个字符)").show(); + if(memo_content.html().length > 20000){ + $("#error").html("内容 过长(最长为 20000 个字符)").show(); $("html,body").animate({scrollTop:$("#error").offset().top},1000) return false; }