$(function () {
/**
* 图片点击放大处理
*/
$('.mini_img').click(function () {
$(this).hide().next().show();
});
$('.img_info img').click(function () {
$(this).parents('.img_tool').hide().prev().show();
});
$('.packup').click(function () {
$(this).parent().parent().parent().hide().prev().show();
});
$('.turn_mini_img').click(function () {
$(this).hide().next().show();
});
$('.turn_img_info img').click(function () {
$(this).parents('.turn_img_tool').hide().prev().show();
});
/**
* 转发框处理
*/
$('.turn').click(function () {
//获取原微内容并添加到转发框
var orgObj = $(this).parents('.wb_tool').prev();
var author = $.trim(orgObj.find('.author').html());
var content = orgObj.find('.content p').html();
var tid = $(this).attr('tid') ? $(this).attr('tid') : 0;
var cons = '';
//多重转发时,转发框内容处理
if (tid) {
author = orgObj.find('.author a').html();
cons = replace_weibo(' // @' + author + ' : ' + content);
author = $.trim(orgObj.find('.turn_name').html());
content = orgObj.find('.turn_cons p').html();
}
$('.turn_main p').html(author + ' : ' + content);
$('.turn-cname').html(author);
$('form[name=turn] textarea').val(cons);
//提取原微博ID
$('form[name=turn] input[name=id]').val($(this).attr('id'));
$('form[name=turn] input[name=tid]').val(tid);
//隐藏表情框
$('#phiz').hide();
//点击转发创建透明背景层
createBg('opacity_bg');
//定位转发框居中
var turnLeft = ($(window).width() - $('#turn').width()) / 2;
var turnTop = $(document).scrollTop() + ($(window).height() - $('#turn').height()) / 2;
$('#turn').css({
'left' : turnLeft,
'top' : turnTop
}).fadeIn().find('textarea').focus(function () {
$(this).css('borderColor', '#FF9B00').keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
var num = 140 - Math.ceil(lengths[0]);
var msg = num < 0 ? 0 : num;
//当前字数同步到显示提示
$('#turn_num').html(msg);
});
}).focus().blur(function () {
$(this).css('borderColor', '#CCCCCC');    //失去焦点时还原边框颜色
         });
});
drag($('#turn'), $('.turn_text'));  //拖拽转发框
/**
* 收藏微博
*/
$('.keep').click(function () {
var wid = $(this).attr('wid');
var keepUp = $(this).next();
var msg = '';
$.post(keepUrl, {wid : wid}, function (data) {
if (data == 1) {
msg = '收藏成功';
}
if (data == -1) {
msg = '已收藏';
}
if (data == 0) {
msg = '收藏失败';
}
keepUp.html(msg).fadeIn();
setTimeout(function () {
keepUp.fadeOut();
}, 3000);
}, 'json');
});
/**
* 评论框处理
*/
//点击评论时异步提取数据
$('.comment').toggle(function () {
//异步加载状态DIV
var commentLoad = $(this).parents('.wb_tool').next();
var commentList = commentLoad.next();
//提取当前评论按钮对应微博的ID号
var wid = $(this).attr('wid');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
}, function () {
$(this).parents('.wb_tool').next().next().hide().find('dl').remove();
$('#phiz').hide();
});
//评论输入框获取焦点时改变边框颜色
$('.comment_list textarea').focus(function () {
$(this).css('borderColor', '#FF9B00');
}).blur(function () {
$(this).css('borderColor', '#CCCCCC');
}).keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
});
//回复
$('.reply a').live('click', function () {
var reply = $(this).parent().siblings('a').html();
$(this).parents('.comment_list').find('textarea').val('回复@' + reply + ' :');
return false;
});
//提交评论
$('.comment_btn').click(function () {
var commentList = $(this).parents('.comment_list');
var _textarea = commentList.find('textarea');
var content = _textarea.val();
//评论内容为空时不作处理
if (content == '') {
_textarea.focus();
return false;
}
//提取评论数据
var cons = {
content : content,
wid : $(this).attr('wid'),
uid : $(this).attr('uid'),
isturn : $(this).prev().find('input:checked').val() ? 1 : 0
};
$.post(commentUrl, cons, function (data) {
if (data != 'false') {
if (cons.isturn) {
window.location.reload();
} else {
_textarea.val('');
commentList.find('ul').after(data);
}
} else {
alert('评论失败,请重试...');
}
}, 'html');
});
/**
* 评论异步分类处理
*/
$('.comment-page dd').live('click', function () {
var commentList = $(this).parents('.comment_list');
var commentLoad = commentList.prev();
var wid = $(this).attr('wid');
var page = $(this).attr('page');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid, page : page},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentList.hide().find('dl').remove();
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
});
/**
* 取消收藏
*/
$('.cancel-keep').click(function () {
var isCancel = confirm('确认取消该微博的收藏?');
var data = {
kid : $(this).attr('kid'),
wid : $(this).attr('wid')
};
var obj = $(this).parents('.weibo');
if (isCancel) {
$.post(cancelKeep, data, function (data) {
if (data) {
obj.slideUp('slow', function () {
obj.remove();
});
} else {
alert('取消失败,请重试...');
}
}, 'json');
}
});
/**
* 表情处理
* 以原生JS添加点击事件,不走jQuery队列事件机制
*/
var phiz = $('.phiz');
for (var i = 0; i < phiz.length; i++) {
phiz[i].onclick = function () {
//定位表情框到对应位置
$('#phiz').show().css({
'left' : $(this).offset().left,
'top' : $(this).offset().top + $(this).height() + 5
});
//为每个表情图片添加事件
var phizImg = $("#phiz img");
var sign = this.getAttribute('sign');
for (var i = 0; i < phizImg.length; i++){
phizImg[i].onclick = function () {
var content = $('textarea[sign = '+sign+']');
content.val(content.val() + '[' + $(this).attr('title') + ']');
$('#phiz').hide();
}
}
}
}
//关闭表情框
$('.close').hover(function () {
$(this).css('backgroundPosition', '-100px -200px');
}, function () {
$(this).css('backgroundPosition', '-75px -200px');
}).click(function () {
$(this).parent().parent().hide();
$('#phiz').hide();
if ($('#turn').css('display') == 'none') {
$('#opacity_bg').remove();
};
});
});
/**
* 统计字数
* @param  字符串
* @return 数组[当前字数, 最大字数]
*/
function check (str) {
var num = [0, 140];
for (var i=0; i<str.length; i++) {
//字符串不是中文时
if (str.charCodeAt(i) >= 0 && str.charCodeAt(i) <= 255){
num[0] = num[0] + 0.5;//当前字数增加0.5个
num[1] = num[1] + 0.5;//最大输入字数增加0.5个
} else {//字符串是中文时
num[0]++;//当前字数增加1个
        }
}
return num;
}
/**
* 替换微博内容,去除 <a> 链接与表情图片
*/
function replace_weibo (content) {
content = content.replace(/<img.*?title=['"](.*?)['"].*?\/?>/ig, '[$1]');
content = content.replace(/<a.*?>(.*?)<\/a>/ig, '$1');
return content.replace(/<span.*?>\&nbsp;(\/\/)\&nbsp;<\/span>/ig, '$1');
}
$(function () {
/**
* 图片点击放大处理
*/
$('.mini_img').click(function () {
$(this).hide().next().show();
});
$('.img_info img').click(function () {
$(this).parents('.img_tool').hide().prev().show();
});
$('.packup').click(function () {
$(this).parent().parent().parent().hide().prev().show();
});
$('.turn_mini_img').click(function () {
$(this).hide().next().show();
});
$('.turn_img_info img').click(function () {
$(this).parents('.turn_img_tool').hide().prev().show();
});
/**
* 转发框处理
*/
$('.turn').click(function () {
//获取原微内容并添加到转发框
var orgObj = $(this).parents('.wb_tool').prev();
var author = $.trim(orgObj.find('.author').html());
var content = orgObj.find('.content p').html();
var tid = $(this).attr('tid') ? $(this).attr('tid') : 0;
var cons = '';
//多重转发时,转发框内容处理
if (tid) {
author = orgObj.find('.author a').html();
cons = replace_weibo(' // @' + author + ' : ' + content);
author = $.trim(orgObj.find('.turn_name').html());
content = orgObj.find('.turn_cons p').html();
}
$('.turn_main p').html(author + ' : ' + content);
$('.turn-cname').html(author);
$('form[name=turn] textarea').val(cons);
//提取原微博ID
$('form[name=turn] input[name=id]').val($(this).attr('id'));
$('form[name=turn] input[name=tid]').val(tid);
//隐藏表情框
$('#phiz').hide();
//点击转发创建透明背景层
createBg('opacity_bg');
//定位转发框居中
var turnLeft = ($(window).width() - $('#turn').width()) / 2;
var turnTop = $(document).scrollTop() + ($(window).height() - $('#turn').height()) / 2;
$('#turn').css({
'left' : turnLeft,
'top' : turnTop
}).fadeIn().find('textarea').focus(function () {
$(this).css('borderColor', '#FF9B00').keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
var num = 140 - Math.ceil(lengths[0]);
var msg = num < 0 ? 0 : num;
//当前字数同步到显示提示
$('#turn_num').html(msg);
});
}).focus().blur(function () {
$(this).css('borderColor', '#CCCCCC');    //失去焦点时还原边框颜色
         });
});
drag($('#turn'), $('.turn_text'));  //拖拽转发框
/**
* 收藏微博
*/
$('.keep').click(function () {
var wid = $(this).attr('wid');
var keepUp = $(this).next();
var msg = '';
$.post(keepUrl, {wid : wid}, function (data) {
if (data == 1) {
msg = '收藏成功';
}
if (data == -1) {
msg = '已收藏';
}
if (data == 0) {
msg = '收藏失败';
}
keepUp.html(msg).fadeIn();
setTimeout(function () {
keepUp.fadeOut();
}, 3000);
}, 'json');
});
/**
* 评论框处理
*/
//点击评论时异步提取数据
$('.comment').toggle(function () {
//异步加载状态DIV
var commentLoad = $(this).parents('.wb_tool').next();
var commentList = commentLoad.next();
//提取当前评论按钮对应微博的ID号
var wid = $(this).attr('wid');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
}, function () {
$(this).parents('.wb_tool').next().next().hide().find('dl').remove();
$('#phiz').hide();
});
//评论输入框获取焦点时改变边框颜色
$('.comment_list textarea').focus(function () {
$(this).css('borderColor', '#FF9B00');
}).blur(function () {
$(this).css('borderColor', '#CCCCCC');
}).keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
});
//回复
$('.reply a').live('click', function () {
var reply = $(this).parent().siblings('a').html();
$(this).parents('.comment_list').find('textarea').val('回复@' + reply + ' :');
return false;
});
//提交评论
$('.comment_btn').click(function () {
var commentList = $(this).parents('.comment_list');
var _textarea = commentList.find('textarea');
var content = _textarea.val();
//评论内容为空时不作处理
if (content == '') {
_textarea.focus();
return false;
}
//提取评论数据
var cons = {
content : content,
wid : $(this).attr('wid'),
uid : $(this).attr('uid'),
isturn : $(this).prev().find('input:checked').val() ? 1 : 0
};
$.post(commentUrl, cons, function (data) {
if (data != 'false') {
if (cons.isturn) {
window.location.reload();
} else {
_textarea.val('');
commentList.find('ul').after(data);
}
} else {
alert('评论失败,请重试...');
}
}, 'html');
});
/**
* 评论异步分类处理
*/
$('.comment-page dd').live('click', function () {
var commentList = $(this).parents('.comment_list');
var commentLoad = commentList.prev();
var wid = $(this).attr('wid');
var page = $(this).attr('page');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid, page : page},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentList.hide().find('dl').remove();
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
});
/**
* 表情处理
* 以原生JS添加点击事件,不走jQuery队列事件机制
*/
var phiz = $('.phiz');
for (var i = 0; i < phiz.length; i++) {
phiz[i].onclick = function () {
//定位表情框到对应位置
$('#phiz').show().css({
'left' : $(this).offset().left,
'top' : $(this).offset().top + $(this).height() + 5
});
//为每个表情图片添加事件
var phizImg = $("#phiz img");
var sign = this.getAttribute('sign');
for (var i = 0; i < phizImg.length; i++){
phizImg[i].onclick = function () {
var content = $('textarea[sign = '+sign+']');
content.val(content.val() + '[' + $(this).attr('title') + ']');
$('#phiz').hide();
}
}
}
}
//关闭表情框
$('.close').hover(function () {
$(this).css('backgroundPosition', '-100px -200px');
}, function () {
$(this).css('backgroundPosition', '-75px -200px');
}).click(function () {
$(this).parent().parent().hide();
$('#phiz').hide();
if ($('#turn').css('display') == 'none') {
$('#opacity_bg').remove();
};
});
});
/**
* 统计字数
* @param  字符串
* @return 数组[当前字数, 最大字数]
*/
function check (str) {
var num = [0, 140];
for (var i=0; i<str.length; i++) {
//字符串不是中文时
if (str.charCodeAt(i) >= 0 && str.charCodeAt(i) <= 255){
num[0] = num[0] + 0.5;//当前字数增加0.5个
num[1] = num[1] + 0.5;//最大输入字数增加0.5个
} else {//字符串是中文时
num[0]++;//当前字数增加1个
        }
}
return num;
}
/**
* 替换微博内容,去除 <a> 链接与表情图片
*/
function replace_weibo (content) {
content = content.replace(/<img.*?title=['"](.*?)['"].*?\/?>/ig, '[$1]');
content = content.replace(/<a.*?>(.*?)<\/a>/ig, '$1');
return content.replace(/<span.*?>\&nbsp;(\/\/)\&nbsp;<\/span>/ig, '$1');
}
$(function () {
//点击刷新验证码
var verifyUrl = $('#verify-img').attr('src');
$('#verify-img').click(function () {
$(this).attr('src', verifyUrl + '/' + Math.random());
});
//jQuery Validate 表单验证
/**
* 添加验证方法
* 以字母开头,5-17 字母、数字、下划线"_"
*/
jQuery.validator.addMethod("user", function(value, element) {
var tel = /^[a-zA-Z][\w]{4,16}$/;
return this.optional(element) || (tel.test(value));
}, "以字母开头,5-17 字母、数字、下划线'_'");
$('form[name=register]').validate({
errorElement : 'span',
success : function (label) {
label.addClass('success');
},
rules : {
account : {
required : true,
user : true,
remote : {
url : checkAccount,
type : 'post',
dataType : 'json',
data : {
account : function () {
return $('#account').val();
}
}
}
},
pwd : {
required : true,
user : true
},
pwded : {
required : true,
equalTo : "#pwd"
},
uname : {
required : true,
rangelength : [2,10],
remote : {
url : checkUname,
type : 'post',
dataType : 'json',
data : {
uname : function () {
return $('#uname').val();
}
}
}
},
verify : {
required : true,
remote : {
url : checkVerify,
type : 'post',
dataType : 'json',
data : {
verify : function () {
return $('#verify').val();
}
}
}
}
},
messages : {
account : {
required : '账号不能为空',
remote : '账号已存在'
},
pwd : {
required : '密码不能为空'
},
pwded : {
required : '请确认密码',
equalTo : '两次密码不一致'
},
uname : {
required : '请填写您的昵称',
rangelength : '昵称在2-10个字之间',
remote : '昵称已存在'
},
verify : {
required : ' ',
remote : ' '
}
}
});
});
/**
* 头部导航
*/
$(function () {
/**
* 头部选项移入效果
*/
//左侧选项
$('.top_left li').hover(function () {
$(this).addClass('cur_bg');
}, function () {
$(this).removeClass('cur_bg');
});
//用户名
$('.user').hover(function () {
$(this).addClass('cur_bg');
}, function () {
$(this).removeClass('cur_bg');
});
//快速发微博按钮
$('.top_right li:eq(0)').hover(function () {
$(this).addClass('cur_bg');
}, function () {
$(this).removeClass('cur_bg');
});
$('.fast_send').click(function () {
$('.send_write textarea').focus();
$('.backToTop').click();
});
/**
* 头部右侧下拉选项
*/
$('.selector').hover(function () {
var objClass = $('i', this).attr('class');
$('i', this).removeClass(objClass).addClass(objClass + '-cur');
$(this).css({  //改变背景色
'width' : '36px',
'backgroundColor' : '#FFFFFF',
'borderLeft' : '1px solid #CCCCCC',
'borderRight' : '1px solid #CCCCCC'
}).find('ul').show();
}, function () {
var objClass = $('i', this).attr('class');
$('i', this).removeClass(objClass).addClass(objClass.replace('-cur', ''));
$(this).css({  //还原背景
'width' : '38px',
'background' : 'none',
'border' : 'none'
}).find('ul').hide();
});
$('.selector li').hover(function () {  //下拉项添加效果
$(this).css('background', '#DCDCDC');
}, function () {
$(this).css('background', 'none');
});
/**
* 头部搜索框
*/
//移入时改变背景
$('#sech_text').hover(function () {
$(this).css('backgroundPosition', '-237px -5px');
$('#sech_sub').css('backgroundPosition', '-443px -5px');
}, function () {
if ($(this).val() == '搜索微博、找人') {
$(this).css('backgroundPosition', '0 -5px');
$('#sech_sub').css('backgroundPosition', '-206px -5px');
};
//获得焦点时清空默认文字
    }).focus(function () {
if ($(this).val() == '搜索微博、找人') {
$(this).val('');
};
//失去焦点时
    }).blur(function () {
//添加默认文字
if ($(this).val() == '') {
$(this).val('搜索微博、找人')
};
//恢复原背景
$(this).css('backgroundPosition', '0 -5px');
$('#sech_sub').css('backgroundPosition', '-206px -5px');
});
$('#sech_sub').hover(function () {
$(this).css('backgroundPosition', '-443px -5px');
$('#sech_text').css('backgroundPosition', '-237px -5px');
}, function () {
$(this).css('backgroundPosition', '-206px -5px');
$('#sech_text').css('backgroundPosition', '0 -5px');
});
/**
* 中部左侧导行选项移入效果
*/
$('.left_nav li').hover(function () {
$(this).css('background', '#D7ECF4');
}, function () {
$(this).css('background', '#EFF8FC');
});
$('.group ul li').hover(function () {
$(this).css('background', '#D7ECF4');
}, function () {
$(this).css('background', '#EFF8FC');
});
/**
* 返回顶部
*/
var toTopElement = '<div class="backToTop" title="返回顶部"><i class="icon icon-totop"></i>返回顶部</div>';
//创建DIV按钮并定位
var toTop = $(toTopElement).appendTo($("body")).css({
'left' : ($('body').width() - ($('body').width() - $('.main').width()) / 2) + 'px',
'top' : ($(window).height() - ($(window).height() / 3)) + 80 + 'px'
//添加点击事件
    }).click(function() {
$("html, body").animate({scrollTop: 0}, 200);
});
//添加窗口滚动事件
    $(window).scroll(function () {
var st = $(document).scrollTop();
//IE6定位
if (window.ActiveXObject&&!window.XMLHttpRequest) {
var ieTop = st + ($(window).height() / 2 + 80);
$('.backToTop').css('top', ieTop + 'px');
}
//滚动条高度大于100时显示 返回顶部按钮
(st > 100) ? $('.backToTop').show() : $('.backToTop').hide();
});
//创建好友分组
$('#create_group').click(function () {
var groupLeft = ($(window).width() - $('#add-group').width()) / 2;
var groupTop = $(document).scrollTop() + ($(window).height() - $('#add-group').height()) / 2;
var gpObj = $('#add-group').show().css({
'left' : groupLeft,
'top' : groupTop
});
createBg('group-bg');
drag(gpObj, gpObj.find('.group_head'));
});
//异步创建分组
$('.add-group-sub').click(function () {
var groupName = $('#gp-name').val();
if (groupName != '') {
$.post(addGroup, {name : groupName}, function (data) {
if (data.status) {
showTips(data.msg);
$('#add-group').hide();
$('#group-bg').remove();
} else {
alert(data.msg);
}
}, 'json');
}
});
//关闭
$('.group-cencle').click(function () {
$('#add-group').hide();
$('#group-bg').remove();
});
//好友关注
$('.add-fl').click(function () {
var followLeft = ($(window).width() - $('#follow').width()) / 2;
var followTop = $(document).scrollTop() + ($(window).height() - $('#follow').height()) / 2;
var flObj = $('#follow').show().css({
'left' : followLeft,
'top' : followTop
});
createBg('follow-bg');
drag(flObj, flObj.find('.follow_head'));
$('input[name=follow]').val($(this).attr('uid'));
});
//添加关注
$('.add-follow-sub').click(function () {
var follow = $('input[name=follow]').val();
var group = $('select[name=gid]').val();
$.post(addFollow, {
'follow' : follow,
'gid' : group
}, function (data) {
if (data.status) {
$('.add-fl[uid=' + follow + ']').removeClass('add-fl').html('√&nbsp;已关注');
$('#follow').hide();
$('#follow-bg').remove();
} else {
alert(data.msg);
}
}, 'json');
});
//关闭关注框
$('.follow-cencle').click(function () {
$('#follow').hide();
$('#follow-bg').remove();
});
//移除关注与粉丝
$('.del-follow').click(function () {
var data = {
uid : $(this).attr('uid'),
type : $(this).attr('type')
};
var isDel = confirm('确认移除?');
var obj = $(this).parents('li');
if (isDel) {
$.post(delFollow, data, function (data) {
if (data) {
obj.slideUp('slow', function () {
obj.remove();
})
} else {
alert('移除失败请重试...');
}
}, 'json');
}
});
//搜索切换
$('.sech-type').click(function () {
$('.cur').removeClass('cur');
$(this).addClass('cur');
$('form[name=search]').attr('action', $(this).attr('url'));
});
/**
* 自定义模版框
*/
$('.set_model').click(function () {
//点击转发创建透明背景层
createBg('opacity_bg');
//定位模版选择框居中
var modelLeft = ($(window).width() - $('#model').width()) / 2;
var modelTop = $(document).scrollTop() + ($(window).height() - $('#model').height()) / 2;
$('#model').css({
'left' : modelLeft,
'top' : modelTop
}).fadeIn();
return false;
});
//点击消取时
$('.model_cancel').click(function () {
$('#model').hide();
$('#opacity_bg').remove();
});
drag($('#model'), $('.model_text'));  //拖拽模版框
//选中模版风格
$('#model ul li').click(function () {
$(this).addClass('theme-cur').siblings().removeClass('theme-cur');
});
//保存模版风格
$('#model .model_save').click(function () {
var theme = $('.theme-cur').attr('theme');
if (!theme) {
alert('请选择一套模版风格');
} else {
$.post(editStyle, {style : theme}, function (data) {
if (data) {
window.location.reload();
} else {
alert('修改失败请重试...');
}
}, 'json');
}
})
//消息推送回调函数
    get_msg(getMsgUrl);
});
/********************效果函数********************/
/**
* 异步轮询函数
*/
function get_msg (url) {
$.getJSON(url, function (data) {
if (data.status) {
news({
"total" : data.total,
"type" : data.type
});
}
setTimeout(function () {
get_msg(url);
}, 5000);
});
}
/**
* 推送的新消息
* @param  {[type]} json {total:新消息的条数,type:(1:评论,2:私信,3:@我)}
* @return {[type]}      [description]
*/
var flags = true;
function news (json) {
switch (json.type) {
case 1:
$('#news ul .news_comment').show().find('a').html(json.total + '条新评论');
break;
case 2:
$('#news ul .news_letter').show().find('a').html(json.total + '条新私信');
break;
case 3:
$('#news ul .news_atme').show().find('a').html(json.total + '条@提到我');
break;
}
var obj = $('#news');
var icon = obj.find('i');
obj.show().find('li').hover(function () {  //下拉项添加效果
$(this).css('background', '#DCDCDC');
}, function () {
$(this).css('background', 'none');
}).click(function () {
clearInterval(newsGlint);
});
if (flags) {
flags = false;
var newsGlint= setInterval(function () {
icon.toggleClass("icon-news");
}, 500);
}
}
/**
* 创建全屏透明背景层
* @param   id
*/
function createBg (id) {
$('<div id = "' + id + '"></div>').appendTo('body').css({
'width' : $(document).width(),
'height' : $(document).height(),
'position' : 'absolute',
'top' : 0,
'left' : 0,
'z-index' : 2,
'opacity' : 0.3,
'filter' : 'Alpha(Opacity = 30)',
'backgroundColor' : '#000'
});
}
/**
* 元素拖拽
* @param  obj        拖拽的对象
* @param  element     触发拖拽的对象
*/
function drag (obj, element) {
var DX, DY, moving;
element.mousedown(function (event) {
DX = event.pageX - parseInt(obj.css('left'));    //鼠标距离事件源宽度
DY = event.pageY - parseInt(obj.css('top'));    //鼠标距离事件源高度
moving = true;    //记录拖拽状态
    });
$(document).mousemove(function (event) {
if (!moving) return;
var OX = event.pageX, OY = event.pageY;    //移动时鼠标当前 X、Y 位置
var    OW = obj.outerWidth(), OH = obj.outerHeight();    //拖拽对象宽、高
var DW = $(window).width(), DH = $('body').height();  //页面宽、高
var left, top;    //计算定位宽、高
left = OX - DX < 0 ? 0 : OX - DX > DW - OW ? DW - OW : OX - DX;
top = OY - DY < 0 ? 0 : OY - DY > DH - OH ? DH - OH : OY - DY;
obj.css({
'left' : left + 'px',
'top' : top + 'px'
});
}).mouseup(function () {
moving = false;    //鼠标抬起消取拖拽状态
    });
}
/**操作成功效果**/
function showTips(tips,time,height){
var windowWidth = $(window).width();height=height?height:$(window).height();
time = time ? time : 1;
var tipsDiv = '<div class="tipsClass">' + tips + '</div>';
$( 'body' ).append( tipsDiv );
$( 'div.tipsClass' ).css({
'top' : height/2 + 'px',
'left' : ( windowWidth / 2 ) - 100 + 'px',
'position' : 'absolute',
'padding' : '3px 5px',
'background': '#670768',
'font-size' : 14 + 'px',
'text-align': 'center',
'width' : '300px',
'height' : '40px',
'line-height' : '40px',
'color' : '#fff',
'font-weight' : 'bold',
'opacity' : '0.8'
}).show();
setTimeout( function(){
$( 'div.tipsClass' ).animate({
top: height/2-50+'px'
}, "slow").fadeOut();
}, time * 1000);
}
$(function () {
//jQuery Validate 表单验证
/**
* 添加验证方法
* 以字母开头,5-17 字母、数字、下划线"_"
*/
jQuery.validator.addMethod("user", function(value, element) {
var tel = /^[a-zA-Z][\w]{4,16}$/;
return this.optional(element) || (tel.test(value));
}, " ");
$('form[name=login]').validate({
errorElement : 'span',
success : function (label) {
label.addClass('success');
},
rules : {
account : {
required : true,
user : true
},
pwd : {
required : true,
user : true
}
},
messages : {
account : {
required : ' ',
},
pwd : {
required : ' '
}
}
});
});
$(function () {
//发送私信框
$('.l-reply,.send').click(function () {
var username = '';
if ($(this).attr('class') == 'l-reply') {
username = $(this).parents('dd').prev().find('a').html();
}
var letterLeft = ($(window).width() - $('#letter').width()) / 2;
var letterTop = $(document).scrollTop() + ($(window).height() - $('#letter').height()) / 2;
var obj = $('#letter').show().css({
'left' : letterLeft,
'top' : letterTop
});
obj.find('input[name=name]').val(username);
obj.find('textarea').focus();
createBg('letter-bg');
drag(obj, obj.find('.letter_head'));
});
//关闭
$('.letter-cencle').click(function () {
$('#letter').hide();
$('#letter-bg').remove();
});
/**
* 删除私信
*/
$('.del-letter').click(function () {
var isDel = confirm('确定删除该私信?');
var lid = $(this).attr('lid');   //添加属性
var obj = $(this).parents('dl');  //parents() 获得当前匹配元素集合中每个元素的祖先元素,使用选择器进行筛选是可选的。
if (isDel) {
$.post(delLetter, {lid : lid}, function (data) {
if (data) {
obj.slideUp('slow', function () {
obj.remove();
});
} else {
alert('删除失败重请试...');
}
}, 'json');
}
})
})
/**
* 首页
* @author Carmen
*/
$(function () {
/**
* 上传微博图片
*/
$('#picture').uploadify({
swf : PUBLIC + '/Uploadify/uploadify.swf',    //引入Uploadify核心Flash文件
uploader : uploadUrl,    //PHP处理脚本地址
width : 120,    //上传按钮宽度
height : 30,    //上传按钮高度
buttonImage : PUBLIC + '/Uploadify/browse-btn.png',    //上传按钮背景图地址
fileTypeDesc : 'Image File',    //选择文件提示文字
fileTypeExts : '*.jpeg; *.jpg; *.png; *.gif',    //允许选择的文件类型
formData : {'session_id' : sid},
//上传成功后的回调函数
        onUploadSuccess : function (file, data, response) {
eval('var data = ' + data);
if (data.status) {
$('input[name=max]').val(data.path.max);
$('input[name=medium]').val(data.path.medium);
$('input[name=mini]').val(data.path.mini);
$('#upload_img').fadeOut().next().fadeIn().find('img').attr('src', ROOT + '/Uploads/Pic/' + data.path.medium);
} else {
alert(data.msg);
}
}
});
/**
* 发布转入框效果
*/
$('.send_write textarea').focus(function () {
//获取焦点时改变边框背景
$('.ta_right').css('backgroundPosition', '0 -50px');
//转入文字时
$(this).css('borderColor', '#FFB941').keyup(function () {
var content = $(this).val();
//调用check函数取得当前字数
var lengths = check(content);
if (lengths[0] > 0) {//当前有输入内容时改变发布按钮背景
$('.send_btn').css('backgroundPosition', '-133px -50px');
} else {//内容为空时发布按钮背景归位
$('.send_btn').css('backgroundPosition', '-50px -50px');
};
//最大允许输入140字个
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
var num = 140 - Math.ceil(lengths[0]);
var msg = num < 0 ? 0 : num;
//当前字数同步到显示提示
$('#send_num').html(msg);
});
//失去焦点时边框背景归位
    }).blur(function () {
$(this).css('borderColor', '#CCCCCC');
$('.ta_right').css('backgroundPosition', '0 -69px');
});
//内容提交时处理
$('form[name=weibo]').submit(function () {
var cons = $('textarea', this);
if (cons.val() == '') {//内容为空时闪烁输入框
var timeOut = 0;
var glint = setInterval(function () {
if (timeOut % 2 == 0) {
cons.css('background','#FFA0C2');
} else {
cons.css('background','#fff');
}
timeOut++;
if (timeOut > 7) {
clearInterval(glint);
cons.focus();
}
}, 100);
return false;
}
});
//显示图片上传框
$('.icon-picture').click(function () {
$('#phiz').hide();
$('#upload_img').show();
});
/**
* 图片点击放大处理
*/
$('.mini_img').click(function () {
$(this).hide().next().show();
});
$('.img_info img').click(function () {
$(this).parents('.img_tool').hide().prev().show();
});
$('.packup').click(function () {
$(this).parent().parent().parent().hide().prev().show();
});
$('.turn_mini_img').click(function () {
$(this).hide().next().show();
});
$('.turn_img_info img').click(function () {
$(this).parents('.turn_img_tool').hide().prev().show();
});
/**
* 转发框处理
*/
$('.turn').click(function () {
//获取原微内容并添加到转发框
var orgObj = $(this).parents('.wb_tool').prev();
var author = $.trim(orgObj.find('.author').html());
var content = orgObj.find('.content p').html();
var tid = $(this).attr('tid') ? $(this).attr('tid') : 0;
var cons = '';
//多重转发时,转发框内容处理
if (tid) {
author = orgObj.find('.author a').html();
cons = replace_weibo(' // @' + author + ' : ' + content);
author = $.trim(orgObj.find('.turn_name').html());
content = orgObj.find('.turn_cons p').html();
}
$('.turn_main p').html(author + ' : ' + content);
$('.turn-cname').html(author);
$('form[name=turn] textarea').val(cons);
//提取原微博ID
$('form[name=turn] input[name=id]').val($(this).attr('id'));
$('form[name=turn] input[name=tid]').val(tid);
//隐藏表情框
$('#phiz').hide();
//点击转发创建透明背景层
createBg('opacity_bg');
//定位转发框居中
var turnLeft = ($(window).width() - $('#turn').width()) / 2;
var turnTop = $(document).scrollTop() + ($(window).height() - $('#turn').height()) / 2;
$('#turn').css({
'left' : turnLeft,
'top' : turnTop
}).fadeIn().find('textarea').focus(function () {
$(this).css('borderColor', '#FF9B00').keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
var num = 140 - Math.ceil(lengths[0]);
var msg = num < 0 ? 0 : num;
//当前字数同步到显示提示
$('#turn_num').html(msg);
});
}).focus().blur(function () {
$(this).css('borderColor', '#CCCCCC');    //失去焦点时还原边框颜色
         });
});
drag($('#turn'), $('.turn_text'));  //拖拽转发框
/**
* 收藏微博
*/
$('.keep').click(function () {
var wid = $(this).attr('wid');
var keepUp = $(this).next();
var msg = '';
$.post(keepUrl, {wid : wid}, function (data) {
if (data == 1) {
msg = '收藏成功';
}
if (data == -1) {
msg = '已收藏';
}
if (data == 0) {
msg = '收藏失败';
}
keepUp.html(msg).fadeIn();
setTimeout(function () {
keepUp.fadeOut();
}, 3000);
}, 'json');
});
/**
* 评论框处理
*/
//点击评论时异步提取数据
$('.comment').toggle(function () {
//异步加载状态DIV
var commentLoad = $(this).parents('.wb_tool').next();
var commentList = commentLoad.next();
//提取当前评论按钮对应微博的ID号
var wid = $(this).attr('wid');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
}, function () {
$(this).parents('.wb_tool').next().next().hide().find('dl').remove();
$('#phiz').hide();
});
//评论输入框获取焦点时改变边框颜色
$('.comment_list textarea').focus(function () {
$(this).css('borderColor', '#FF9B00');
}).blur(function () {
$(this).css('borderColor', '#CCCCCC');
}).keyup(function () {
var content = $(this).val();
var lengths = check(content);  //调用check函数取得当前字数
//最大允许输入140个字
if (lengths[0] >= 140) {
$(this).val(content.substring(0, Math.ceil(lengths[1])));
}
});
//回复
$('.reply a').live('click', function () {
var reply = $(this).parent().siblings('a').html();
$(this).parents('.comment_list').find('textarea').val('回复@' + reply + ' :');
return false;
});
//提交评论
$('.comment_btn').click(function () {
var commentList = $(this).parents('.comment_list');
var _textarea = commentList.find('textarea');
var content = _textarea.val();
//评论内容为空时不作处理
if (content == '') {
_textarea.focus();
return false;
}
//提取评论数据
var cons = {
content : content,
wid : $(this).attr('wid'),
uid : $(this).attr('uid'),
isturn : $(this).prev().find('input:checked').val() ? 1 : 0
};
$.post(commentUrl, cons, function (data) {
if (data != 'false') {
if (cons.isturn) {
window.location.reload();
} else {
_textarea.val('');
commentList.find('ul').after(data);
}
} else {
alert('评论失败,请重试...');
}
}, 'html');
});
/**
* 评论异步分类处理
*/
$('.comment-page dd').live('click', function () {
var commentList = $(this).parents('.comment_list');
var commentLoad = commentList.prev();
var wid = $(this).attr('wid');
var page = $(this).attr('page');
//异步提取评论内容
        $.ajax({
url : getComment,
data : {wid : wid, page : page},
dataType : 'html',
type : 'post',
beforeSend : function () {
commentList.hide().find('dl').remove();
commentLoad.show();
},
success : function (data) {
if (data != 'false') {
commentList.append(data);
}
},
complete : function () {
commentLoad.hide();
commentList.show().find('textarea').val('').focus();
}
});
});
/**
* 删除微博
*/
$('.weibo').hover(function () {
$(this).find('.del-li').show();
}, function () {
$(this).find('.del-li').hide();
});
$('.del-weibo').click(function () {
var wid = $(this).attr('wid');
var isDel = confirm('确认要删除该微博?');
var obj = $(this).parents('.weibo');
if (isDel) {
$.post(delWeibo, {wid : wid}, function (data) {
if (data) {
obj.slideUp('slow', function () {
obj.remove();
});
} else {
alert('删除失败请重试...');
}
}, 'json');
}
});
/**
* 表情处理
* 以原生JS添加点击事件,不走jQuery队列事件机制
*/
var phiz = $('.phiz');
for (var i = 0; i < phiz.length; i++) {
phiz[i].onclick = function () {
//定位表情框到对应位置
$('#phiz').show().css({
'left' : $(this).offset().left,
'top' : $(this).offset().top + $(this).height() + 5
});
//为每个表情图片添加事件
var phizImg = $("#phiz img");
var sign = this.getAttribute('sign');
for (var i = 0; i < phizImg.length; i++){
phizImg[i].onclick = function () {
var content = $('textarea[sign = '+sign+']');
content.val(content.val() + '[' + $(this).attr('title') + ']');
$('#phiz').hide();
}
}
}
}
//关闭表情框
$('.close').hover(function () {
$(this).css('backgroundPosition', '-100px -200px');
}, function () {
$(this).css('backgroundPosition', '-75px -200px');
}).click(function () {
$(this).parent().parent().hide();
$('#phiz').hide();
if ($('#turn').css('display') == 'none') {
$('#opacity_bg').remove();
};
});
});
/**
* 统计字数
* @param  字符串
* @return 数组[当前字数, 最大字数]
*/
function check (str) {
var num = [0, 140];
for (var i=0; i<str.length; i++) {
//字符串不是中文时
if (str.charCodeAt(i) >= 0 && str.charCodeAt(i) <= 255){
num[0] = num[0] + 0.5;//当前字数增加0.5个
num[1] = num[1] + 0.5;//最大输入字数增加0.5个
} else {//字符串是中文时
num[0]++;//当前字数增加1个
        }
}
return num;
}
/**
* 替换微博内容,去除 <a> 链接与表情图片
*/
function replace_weibo (content) {
content = content.replace(/<img.*?title=['"](.*?)['"].*?\/?>/ig, '[$1]');
content = content.replace(/<a.*?>(.*?)<\/a>/ig, '$1');
return content.replace(/<span.*?>\&nbsp;(\/\/)\&nbsp;<\/span>/ig, '$1');
}
$(function () {
//修改资料选项卡
$('#sel-edit li').click( function () {
var index = $(this).index();
$(this).addClass('edit-cur').siblings().removeClass('edit-cur');
$('.form').hide().eq(index).show();
} );
//城市联动
var province = '';
$.each(city, function (i, k) {
province += '<option value="' + k.name + '" index="' + i + '">' + k.name + '</option>';
});
$('select[name=province]').append(province).change(function () {
var option = '';
if ($(this).val() == '') {
option += '<option value="">请选择</option>';
} else {
var index = $(':selected', this).attr('index');
var data = city[index].child;
for (var i = 0; i < data.length; i++) {
option += '<option value="' + data[i] + '">' + data[i] + '</option>';
}
}
$('select[name=city]').html(option);
});
//所在地默认选项
address = address.split(' ');
$('select[name=province]').val(address[0]);
$.each(city, function (i, k) {
if (k.name == address[0]) {
var str = '';
for (var j in k.child) {
str += '<option value="' + k.child[j] + '" ';
if (k.child[j] == address[1]) {
str += 'selected="selected"';
}
str += '>' + k.child[j] + '</option>';
}
$('select[name=city]').html(str);
}
});
//星座默认选项
$('select[name=night]').val(constellation);
//头像上传 Uploadify 插件
$('#face').uploadify({
swf : PUBLIC + '/Uploadify/uploadify.swf',    //引入Uploadify核心Flash文件
uploader : uploadUrl,    //PHP处理脚本地址
width : 120,    //上传按钮宽度
height : 30,    //上传按钮高度
buttonImage : PUBLIC + '/Uploadify/browse-btn.png',    //上传按钮背景图地址
fileTypeDesc : 'Image File',    //选择文件提示文字
fileTypeExts : '*.jpeg; *.jpg; *.png; *.gif',    //允许选择的文件类型
formData : {'session_id' : sid},
//上传成功后的回调函数
        onUploadSuccess : function (file, data, response) {
eval('var data = ' + data);
if (data.status) {
$('#face-img').attr('src', ROOT + '/Uploads/Face/' + data.path.max);
$('input[name=face180]').val(data.path.max);
$('input[name=face80]').val(data.path.medium);
$('input[name=face50]').val(data.path.mini);
} else {
alert(data.msg);
}
}
});
//jQuery Validate 表单验证
/**
* 添加验证方法
* 以字母开头,5-17 字母、数字、下划线"_"
*/
jQuery.validator.addMethod("user", function(value, element) {
var tel = /^[a-zA-Z][\w]{4,16}$/;
return this.optional(element) || (tel.test(value));
}, "以字母开头,5-17 字母、数字、下划线'_'");
$('form[name=editPwd]').validate({
errorElement : 'span',
success : function (label) {
label.addClass('success');
},
rules : {
old : {
required : true,
user : true
},
new : {
required : true,
user : true
},
newed : {
required : true,
equalTo : "#new"
}
},
messages : {
old : {
required : '请填写旧密码',
},
new : {
required : '请设置新密码'
},
newed : {
required : '请确认密码',
equalTo : '两次密码不一致'
}
}
});
});
$(function () {
$('.c-reply').toggle (function () {
var name = $(this).parents('dl').find('dd a').html();
var str = '回复@' + name.replace(/:$/, ' ') + ':';
$(this).parent().next().show().find('textarea').val(str);
}, function () {
$(this).parent().next().hide();
});
//回复按钮
$('.comment_btn').click(function () {
var data = {
wid : $(this).attr('wid'),
content : $(this).parents('ul').prev().val()
};
var obj = $(this).parents('.comment_list');
$.post(replyUrl, data, function (data) {
if (data) {
alert('评论已回复');
obj.hide();
} else {
alert('回复失败请重试...');
}
}, 'json');
});
//删除评论
$('.del-comment').click(function () {
var data = {
cid : $(this).attr('cid'),
wid : $(this).attr('wid')
};
var isDel = confirm('确定删除该评论?');
var obj = $(this).parents('dl');
if (isDel) {
$.post(delComment, data, function (data) {
if (data) {
obj.slideUp('slow', function () {
obj.remove();
});
} else {
alert('删除失败请重试...');
}
}, 'json');
}
});
/**
* 表情处理
* 以原生JS添加点击事件,不走jQuery队列事件机制
*/
var phiz = $('.phiz');
for (var i = 0; i < phiz.length; i++) {
phiz[i].onclick = function () {
//定位表情框到对应位置
$('#phiz').show().css({
'left' : $(this).offset().left,
'top' : $(this).offset().top + $(this).height() + 5
});
//为每个表情图片添加事件
var phizImg = $("#phiz img");
var sign = this.getAttribute('sign');
for (var i = 0; i < phizImg.length; i++){
phizImg[i].onclick = function () {
var content = $('textarea[sign = '+sign+']');
content.val(content.val() + '[' + $(this).attr('title') + ']');
$('#phiz').hide();
}
}
}
}
//关闭表情框
$('.close').hover(function () {
$(this).css('backgroundPosition', '-100px -200px');
}, function () {
$(this).css('backgroundPosition', '-75px -200px');
}).click(function () {
$(this).parent().parent().hide();
$('#phiz').hide();
if ($('#turn').css('display') == 'none') {
$('#opacity_bg').remove();
};
});
});

常用 ajax js 表单相关推荐

  1. JS表单验证-12个常用的JS表单验证

    JS表单验证-12个常用的JS表单验证 表单验证,小编在项目完结后的这段时间把常用的JS表单验证demo整理了一下,和大家一起分享~~~ 1.长度限制 <p>1. 长度限制</p&g ...

  2. js-最常用的js表单校验1

    最近写了无数各种形式的表单,记录下奇奇怪怪的校验规则~ 一:首先是element自带的rules校验规则: element作为常用框架,自带rules属性简单易懂,官方文档一目了然,不再赘述,应付常用 ...

  3. 项目开发中常用JS表单取值方法

    项目开发中常用JS表单取值方法 一.常用表单基本取值方法(form1为表单名称,TextBox1为控件ID,以文本框为例,html控件与web服务器控件是一样的)         1.form1.Te ...

  4. js登录特效+ajax提交表单+异步刷新验证

    今天成功测试一种js登录特效+ajax提交表单+异步刷新验证,登录时特效提醒,无刷新ajax提交表单,获取验证结果,跳转正式页面:废话不多说,先直接分享代码: 1.主界面index.php  加载的这 ...

  5. js表单验证(常用的正则表达式)

    js表单验证的正则表达式,test() 方法用于检测一个字符串是否匹配某个模式,如果字符串中含有匹配的文本,则返回 true,否则返回 false. 语法:let reg=/正则表达式主体/修饰符(可 ...

  6. ajax form表单提交 input file中的文件

    现今的主流浏览器由于ajax提交form表单无法把文件类型数据提交到后台,供后台处理,可是开发中由于某些原因又不得不用ajax提交文件, 为了解决这个问题我走了不少弯路: 1.用原生的 input f ...

  7. ajax合并表单,ajax。表单

    JQuery读书笔记--JQuery-Form中的ajaxForm和ajaxSubmit的区别 JQuery中的ajaxForm和ajaxSubmit使用差不多功能也差不多.很容易误解. 按照作者的解 ...

  8. VIEW层AJAX提交表单到Controller的实体(AJAX传递序列化的输入元素)

    在MVC环境中,AJAX方式添加一个对象,这个对象在Models中是一个视图模型,在前台显示时是这样的代码: <%using (Html.BeginForm())       { %>   ...

  9. php ajax弹出框传值,PHP_Yii2.0 模态弹出框+ajax提交表单,如题 我们使用模态弹出框+ajax - phpStudy...

    Yii2.0 模态弹出框+ajax提交表单 如题 我们使用模态弹出框+ajax提交表单 首先我们把index视图的create按钮添加data-toggle 和 data-target. 代码如下: ...

  10. html ajax提交表单实例,Ajax提交表单并接收json实例代码

    需求: 实现点击按钮后,数据以表单形式提交至服务器,并接收来自服务器的返回数据.过程中页面不刷新. html代码 xingming: nianling: ajax提交 js代码 function my ...

最新文章

  1. 浅谈25种设计模式(4/25)(此坑未填)
  2. 自学成才翁_作为一名自学成才的开发者从“我的旅程”中吸取的教训
  3. 数据恢复软件extundelete介绍
  4. react native 学习笔记
  5. 读取文本节点_总结语录|Part1:Dynamo节点介绍
  6. 浏览器窗口尺寸clientHeight / scrollHeight / offsetHeight / innerHeight
  7. pdo mysql连接类_PHP PDO-MYSQL:如何在不同类之间使用数据库连接
  8. (转)C#开发微信门户及应用(6)--微信门户菜单的管理操作
  9. struts2 action 中autowired 不能注入
  10. android app报错log,Android studio 解决logcat无过滤工具栏的操作
  11. pytorch损失函数
  12. 计算机科学与技术专业导论mooc答案,中国大学MOOC人工智能导论(2017级)网课答案...
  13. Linux学习笔记之秋水BBR一键部署
  14. java 火星坐标转wgs84_火星坐标、百度坐标、WGS84坐标、墨卡托投影坐标相互转换...
  15. 因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies
  16. citymaker 8 sketchup和3dsmax直接导出fdb
  17. go zap + lumberjack 日志按大小分割demo整理
  18. android studio安装插件查看db数据库
  19. 设置java进程名称_如何为Java程序设置进程名称? - java
  20. vue 判断两个时间插件结束时间必选大于开始时间

热门文章

  1. 1075c语言程序设计答案,山东理工大学ACM平台题答案关于C语言 1075 Doubles
  2. STM32F412 串口接收不到数据的问题
  3. Udacity课程脉络-统计学基础(二)- t分布
  4. 2020-04-03-功能性光学脑成像
  5. 用python做生信_1 python生信入门
  6. 通过css和html构建能耗数据分析树状图
  7. 微信群控,云控?云控系统工作原理
  8. 三角函数 sinx, cosx 的泰勒展开推导及两个巧妙应用
  9. 浏览器验证码图片(缩略图)显示不出来问题解决办法
  10. 瑞幸咖啡,成败今年见分晓!