/**
 * Created by A.J on 2019/3/21.
 */
$(document).ready(function(){
    if($("#pinglun").length > 0){
        var he = HE.getEditor('pinglun',{
            height : '250px',
            item : ['bold','italic','fontSize','fontName','color','|','selectAll','removeFormat','trash','|','expression','|','undo','redo','|','about']
        });
    }
    $("#tijiaopinglun").click(function(){
        he.sync();
    });
    $("#zan").click(function(){
        $.post("", { id: $("#id").text(), zan: 1 },
            function(data){
                $("#zan").find("span").text(data);
            });
    });
    $("#shoucang").click(function(){
        $.post("", { id: $("#id").text(), shoucang: 1 },
            function(data){
                if(data == "ok"){
                    $("#shoucang").find("span").removeClass("d-none");
                }
                else{
                    alert(data);
                }
            });
    });
    $("#liuyanForm").hide();
    $("#liuyan").click(function(){
        $("#liuyanForm").toggle();
    });
});