【文件属性】:
文件名称:克隆,回复
文件大小:5KB
文件格式:JS
更新时间:2015-03-30 03:26:32
js
$(document).ready(function(){
loadReplyedInformation("comment-wrap","page",1,10);
});
function loadReplyedInformation(className,pageClassName,pageNum,size) {
$.ajax({
type:"POST",
url:"replyedInformation?pageNum="+(pageNum-1)+"&size;="+size,
timeout:10000,
success:function(data,textStatus) {
$("."+className+":visible").remove();
$("."+pageClassName+":visible").empty();
$("."+className+":hidden").show();
for(var i=0;i<input type=\"hidden\" name=\"status\" value=\"4\"/><span><input type=\"submit\" value=\"发布此留言\"/></span></form>"
var published_message = "<form action=\"cancelPublishMessage\" left\"><input type=\"hidden\" name=\"id\" value=\"\"/><input type=\"hidden\" name=\"status\" value=\"4\"/><span><input type=\"submit\" value=\"撤销发布\"/></span></form>"
if(data.lists[i].PUBLISH_STATUS == 0) {
$("."+"ans"+":last "+".ansMain "+"form:eq(1)").after(noPublish_message);
}else {
$("."+"ans"+":last "+".ansMain "+"form:eq(1)").after(published_message);
}
$("."+"ans"+":last "+"form:eq(2) "+"input:eq(0)").attr("value",data.lists[i].PRIMARY_ID);
var delete_message = "<input type=\"submit\" value=\"删除此留言\"/>";
$("."+"ans"+":last "+"form:eq(3) "+"span:eq(0)").append(delete_message);
$("."+"ans"+":last "+"form:eq(3) "+"input:eq(0)").attr("value",data.lists[i].PRIMARY_ID);
var delete_reply = "<input type=\"submit\" value=\"删除回复\"/>";
$("."+"ans"+":last "+"form:eq(1) "+"span:eq(0)").append(delete_reply);
$("."+"ans"+":last "+"form:eq(1) "+"input:eq(0)").attr("value",data.lists[i].PRIMARY_ID);
if(data.lists[i].REPLY_TIME != null) {
$(".timeAns:last").text("回复时间:"+data.lists[i].REPLY_TIME);
}else {
$(".timeAns:last").remove();
}
}
cut(pageNum,data.num,size,10);
$("."+className+":first").hide();
}
});
}
function change(id){
$("#ans_"+id).show();
$("#ques_"+id).hide();
}
function clear_message(id) {
$("#textarea_"+id).text("");
}
function changePage(pageNum , size) {
loadReplyedInformation("comment-wrap","page",pageNum,size);
}
function changeCurrentPage() {
var choosePage = document.getElementById("select").selectedIndex;
if(choosePage == 1) {
location.href = "messager.html";
}
if(choosePage == 2) {
location.href = "messageReplyed.html";
}
if(choosePage == 3) {
location.href = "messageNoReply.html";
}
if(choosePage == 4) {
location.href = "messagePublished.html";
}
if(choosePage == 5) {
location.href = "messageNoPublish.html";
}
}