socialforge/public/javascripts/feedback.js

113 lines
3.0 KiB
JavaScript
Raw Normal View History

(function($){
$.fn.fix = function(options){
var defaults = {
float : 'right',
minStatue : true,
skin : 'blue',
durationTime : 1000
2015-04-23 16:13:01 +08:00
}
var options = $.extend(defaults, options);
this.each(function(){
2015-04-23 16:13:01 +08:00
//???????
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content'),
sideList = thisBox.find('.side_list')
;
2015-04-23 16:13:01 +08:00
var defaultTop = thisBox.offset().top; //????????top
thisBox.css(options.float, 0);
if(options.minStatue == "true"){
$(".show_btn").css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 25);
}
2015-04-23 16:13:01 +08:00
//close
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
2015-04-23 16:13:01 +08:00
cookiesave('minStatue','true','','','');
});
2015-04-23 16:13:01 +08:00
//show
show_btn.bind("click",function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
2015-04-23 16:13:01 +08:00
cookiesave('minStatue','false','','','');
});
2015-04-23 16:13:01 +08:00
}); //end this.each
};
})(jQuery);
2015-04-23 16:13:01 +08:00
$(function(){
$("#button1").click(function(){
myTips("<%= l(:label_feedback_success) %>","success");
});
});
function f_submit()
{
2015-04-23 18:18:07 +08:00
// var subject = $("#memo_subject").val();
// var content = $("#memo_content").val();
// $("#memo_subject").val(subject+""+ content.substr(0,18)+"...");
2015-04-23 16:13:01 +08:00
$("#new_memo").submit();
}
function cookiesave(n, v, mins, dn, path)
{
if(n)
{
2015-04-23 16:13:01 +08:00
if(!mins) mins = 365 * 24 * 60;
if(!path) path = "/";
var date = new Date();
2015-04-23 16:13:01 +08:00
date.setTime(date.getTime() + (mins * 60 * 1000));
2015-04-23 16:13:01 +08:00
var expires = "; expires=" + date.toGMTString();
2015-04-23 16:13:01 +08:00
if(dn) dn = "domain=" + dn + "; ";
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
2015-04-23 16:13:01 +08:00
}
}
function cookieget(n)
{
var name = n + "=";
var ca = document.cookie.split(';');
for(var i=0;i<ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(name) == 0){
return c.substring(name.length,c.length);}
2015-04-23 16:13:01 +08:00
}
return false;
}
$(function(){
$("#button1").click(function(){
myTips("<%= l(:label_feedback_success) %>","success");
});
});
2015-04-23 16:13:01 +08:00
$(document).ready(function () {
$(function () {
$("#scrollsidebar").fix({
float: 'right', //default.left or right
minStatue: cookieget('minStatue'),
skin: 'green', //default.gray or blue
durationTime: 600
});
});
});