/// <reference path="jquery-1.10.2.min.js" />

var editor;
var editors;
$(function () {
    editor = CKEDITOR.replace('Comment_body',
{
    filebrowserImageUploadUrl: "/ajax/Admin_AjaxUpImage.ashx?cmd=uploadImage"
});
    editors = CKEDITOR.replace('Comment_body_S',
{
    filebrowserImageUploadUrl: "/ajax/Admin_AjaxUpImage.ashx?cmd=uploadImage"
});

    $("#Game_Comment_Btn").click(function (e) {
        e.preventDefault();
        var gamecomsid = $.trim($("#comsid").val());
        var commenteditstatus = $.trim($("#Comment_Edit_Status").val());
        var text = editor.getData();
        var con = editors.getData();
        if (text == "") {
            alert("回复内容不能为空");
            return;
        } if (con == "") {
            alert("用户评论不能为空哦");
            return;
        } else {
            $.post("/ajax/Admin_GameBase.ashx", { "type": "Comment", "text": text, "con": con, "gamecomsid": gamecomsid, "commenteditstatus": commenteditstatus }, function (data) {
                var data = eval('(' + data + ')');
                if (data.Success == true) {
                    alert("回复成功");
                    window.location.href = "./Admin_GameCommentList.aspx";
                } else {
                    alert("回复失败")

                }

            })

        }



    })


})