/*textcount*/
(function($){jQuery.fn.txtCount = function(tipWrap, maxNumber){var countClass = 'js_txtCount', fullClass = 'js_txtFull', disabledClass = 'disabled', undisableClass = 'undisabled';var count = function(){var btn = $(this).closest('form').find(':submit'),info = $('.comm_topic'),val = $(this).val().length,disabled = {on: function(){btn.removeAttr('disabled').removeClass(disabledClass).addClass(undisableClass);},off: function(){btn.attr('disabled', 'disabled').removeClass(undisableClass).addClass(disabledClass);}};if (val == 0){disabled.off();info.css("display","block");}if(val <= maxNumber){if (val > 0) {disabled.on();info.css("display","none");}tipWrap.html('' + val + '/' + maxNumber + '');}else{disabled.off();tipWrap.html('-' + (val - maxNumber) + '/' + maxNumber + '');};};$(this).bind('keyup focus change', count);return this;};})(jQuery);
QzTool={
Ajax:function(option){
var def = {type:"post",data:"",dataType:"json",before:function(){}};
var opts = $.extend(def, option);
burl=((opts.request.indexOf("?")==-1)? "?":"&")+"_rnd="+new Date().getTime();
$.ajax({type: opts.type,url:opts.request+burl,data:opts.data,dataType: opts.dataType,beforeSend:opts.before,success:opts.respon});
}
};
Face={
load:function(div_show,div_id){
if(!arguments[0]) {div_show = "#js_emotion"};
if(!arguments[1]) {div_id = "#textContent"};
if($(div_show+" .qqFace").size()<=0){
QzTool.Ajax({
request: "http://www.wangqiu8.com/index.php?m=member&c=content&a=public_ajax_face",
data:"div_id="+div_id,
respon:function(res){
$('.commentPop').css("border","1px solid #a2cadc");
$(div_show).html(res.html).show();
}
});
}else{
$(div_show).show();
}
}
};
Pilun={
postThread:function(commentid){
message=$.trim($("#textContent").val());
jinzhi=$.trim($("#jinzhi").val());
code=$.trim($("#code").val());
if(jinzhi=='1'){
alert("您的IP已被禁用。");
return false;
}
if(message==''){
alert("请写点内容吧");
return false;
}
if(message.length >140){alert("你输入的字太多了");return false;}
QzTool.Ajax({
request: "http://www.wangqiu8.com/index.php?m=comment&c=index&a=public_post&commentid="+commentid,
data:$("#threadForm").serializeArray(),
respon:function(res){
if(res.status==0){
$("#quoteDiv").html("");
$("#textContent").val("");
alert(res.msg);
return false;
}
$("#quoteDiv").html("");
$("#textContent").val("");
$("#lastorder").val("");
$("#reply").val("0");
$("#wall_list").html(res.data);
$("#wall_list_page").html(res.pagination);
if (res.msg!=''&&res.msg!==null){
alert(res.msg);
};
}
});
},
replieAt:function(user_name,lastorder){
$("#textContent").focus();
$("#lastorder").val(lastorder);
$("#reply").val("1");
$("#textContent").val("回复:");
}
}