From b7c7cc4c64d5e742b77b46ae0e19024531cccfe4 Mon Sep 17 00:00:00 2001 From: whimlex Date: Wed, 28 Jan 2015 12:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88=E6=A0=8F?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0cookie=E7=BC=93=E5=AD=98=E6=94=B6=E6=8B=89?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=AE=9E=E7=8E=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E8=B7=B3=E8=BD=AC=EF=BC=8C=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=A0=8F=E6=94=B6=E6=8B=89=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 49 +++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index bf4b12daf..2039735bc 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -63,7 +63,7 @@ a:hover.opnionButton{ text-decoration:underline;} (function($){ $.fn.fix = function(options){ var defaults = { - float : 'left', + float : 'right', minStatue : false, skin : 'blue', durationTime : 1000 @@ -81,7 +81,7 @@ a:hover.opnionButton{ text-decoration:underline;} var defaultTop = thisBox.offset().top; //????????top thisBox.css(options.float, 0); - if(options.minStatue){ + if(options.minStatue == "true"){ $(".show_btn").css("float", options.float); sideContent.css('width', 0); show_btn.css('width', 25); @@ -106,15 +106,18 @@ a:hover.opnionButton{ text-decoration:underline;} closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); + cookiesave('minStatue','true','','',''); }); //show??? - show_btn.click(function() { + show_btn.bind("click",function() { $(this).animate({width: '0px'},"fast"); sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); + cookiesave('minStatue','false','','',''); }); - }); //end this.each + + }); //end this.each }; })(jQuery); @@ -130,6 +133,38 @@ function f_submit() { $("#new_memo").submit(); } + +function cookiesave(n, v, mins, dn, path) +{ + if(n) + { + + if(!mins) mins = 365 * 24 * 60; + if(!path) path = "/"; + var date = new Date(); + + date.setTime(date.getTime() + (mins * 60 * 1000)); + + var expires = "; expires=" + date.toGMTString(); + + if(dn) dn = "domain=" + dn + "; "; + document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path; + + } +} +function cookieget(n) +{ + var name = n + "="; + var ca = document.cookie.split(';'); + for(var i=0;i @@ -138,9 +173,9 @@ function f_submit() 意见反馈 - + -
+
@@ -171,7 +206,7 @@ function f_submit() $(function() { $("#scrollsidebar").fix({ float : 'right', //default.left or right - //minStatue : true, + minStatue : cookieget('minStatue'), skin : 'green', //default.gray or blue durationTime : 600 });