supportobj.val("已赞同"); } else { supportobj.val("赞同"); } } }); $(this).css("font-weight", "normal"); }, function () { var answerid = $(this).parent().attr("id"); var supportobj = $(this); $.ajax({ type: "GET", url: "http://ask.rtcint.com/index.php?answer/ajaxgetsupport/" + answerid, cache: false, success: function (support) { supportobj.val(support); } }); $(this).css("font-weight", "bold"); }); $(".button_agree").click(function () { var supportobj = $(this); var answerid = $(this).parent().attr("id"); $.ajax({ type: "GET", url: "http://ask.rtcint.com/index.php?answer/ajaxhassupport/" + answerid, cache: false, success: function (hassupport) { if (hassupport != '1') { $("#support_tip").css({height: "0px", opacity: 0}); $("#support_tip").show(); $("#support_tip").position({my: "top-40", of: supportobj}); $("#support_tip").animate({"opacity": "1"}, 500).animate({"opacity": "0"}, 200); $.ajax({ type: "GET", cache: false, url: "http://ask.rtcint.com/index.php?answer/ajaxaddsupport/" + answerid, success: function (comments) { supportobj.val("已赞同"); } }); } } }); }); SyntaxHighlighter.all(); }); function show_comment(answerid) { if ($("#comment_" + answerid).css("display") === "none") { load_comment(answerid); $("#comment_" + answerid).slideDown(); } else { $("#comment_" + answerid).slideUp(); } } function change_category() { var category1 = $("#category1 option:selected").val(); var category2 = $("#category2 option:selected").val(); var category3 = $("#category3 option:selected").val(); if (category1 > 0) { $("#categoryid").val(category1); } if (category2 > 0) { $("#categoryid").val(category2); } if (category3 > 0) { $("#categoryid").val(category3); } $("#catedialog").dialog("close"); $("form[name='editcategoryForm']").submit(); } function adoptanswer(aid) { $("#dialogadopt").dialog({ autoOpen: false, width: 480, modal: true, resizable: false }); $("#adopt_answer").val(aid); $('#dialogadopt form').submit(); } function edittag() { $("#dialog_tag").dialog({ autoOpen: false, width: 500, modal: true, resizable: false }); $("#dialog_tag").dialog("open"); } function append_score() { $("#append_score").dialog({ autoOpen: false, width: 480, modal: true, resizable: false }); $("#append_score").dialog("open"); } function close_question() { if (confirm('确定关闭该问题?') === true) { document.location.href = "http://ask.rtcint.com/question/close/806951.html"; } } function addcomment(answerid) { var content = $("#comment_" + answerid + " input[name='content']").val(); var replyauthor = $("#comment_" + answerid + " input[name='replyauthor']").val(); if (g_uid == 0) { login(); return false; } if (bytes($.trim(content)) < 5) { alert("评论内容不能少于5字"); return false; } $.ajax({ type: "POST", url: "http://ask.rtcint.com/answer/addcomment.html", data: "content=" + content + "&answerid=" + answerid + "&replyauthor=" + replyauthor, success: function (status) { if (status == '1') { $("#comment_" + answerid + " input[name='content']").val(""); load_comment(answerid); } } }); } function deletecomment(commentid, answerid) { if (!confirm("确认删除该评论?")) { return false; } $.ajax({ type: "POST", url: "http://ask.rtcint.com/answer/deletecomment.html", data: "commentid=" + commentid + "&answerid=" + answerid, success: function (status) { if (status == '1') { load_comment(answerid); } } }); } function load_comment(answerid) { $.ajax({ type: "GET", cache: false, url: "http://ask.rtcint.com/index.php?answer/ajaxviewcomment/" + answerid, success: function (comments) { $("#comment_" + answerid + " .comments-list").html(comments); } }); } function replycomment(commentauthorid, answerid) { var comment_author = $("#comment_author_" + commentauthorid).attr("title"); $("#comment_" + answerid + " .comment-input").focus(); $("#comment_" + answerid + " .comment-input").val("回复 " + comment_author + " :"); $("#comment_" + answerid + " input[name='replyauthor']").val(commentauthorid); } //检举 function inform(name, type) { var content = name + '的回答'; if (type == 1) { content = name + '的提问'; } $("#append_score").dialog({ autoOpen: false, width: 480, modal: true, resizable: false }); $("#append_score").dialog("open"); } function check_form() { var anscontent = $("#anscontent").val(); if (bytes($.trim(anscontent)) < 8) { alert("回答内容不得少于4个字!"); $("#anscontent").focus(); return false; } } $.get(g_site_url + "index.php?question/ajaxPushBaidu",{},function(){}); $('#show_default').click(function () { var show_default = 1; qid = 806951; if(show_default == 0){ str = "确认要显示默认答案?"; }else{ str = "确认要不显示默认答案?"; } if(confirm(str) === true) { $.post("http://ask.rtcint.com/index.php?question/ajaxShowDefault",{id:qid,show_dafault:show_default},function(res){ if(res == 1){ alert("修改成功!"); setTimeout(function () { document.location.reload(); },1000) }else{ alert("好像失败了!"); } }); } });
     加载中...