diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index fadf5e465..b316aa406 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -128,6 +128,11 @@ }); $mail.blur(function (event) { + if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){ + $('#mail_req').html( '邮件格式不对').show(); + $mail_correct = false; + return ; + } if ($(this).is('#user_mail')) { $.get('<%=account_valid_ajax_path%>', { valid: "mail", 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,4 +1,56 @@ <%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %> + +
+ +
+ + + + +
+
+
+ <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> +
+ + + + + + + + + + + + +
+ -
- -
- - - - -
-
-
- <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%> -
- - - - - - - - - - - - -
- \ 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