<%--
  Created by IntelliJ IDEA.
  User: njc
  Date: 2022/5/10
  Time: 19:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>老王个人博客</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="keywords" content="个人博客,纳进财个人博客,个人博客系统,老王博客,王风宇">
    <meta name="description" content="Lao王博客系统，一个站在java开发之路上的草根程序员个人博客网站。">
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/plugin/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/plugin/Hui-iconfont/1.0.8/iconfont.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/plugin/pifu/pifu.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/plugin/wangEditor/css/wangEditor.min.css">
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(hideURLbar, 0);
    }, false);

    function hideURLbar() {
        window.scrollTo(0, 1);
    }

    function showSide() {
        $('.navbar-nav').toggle();
    }
    </script>
</head>
<body>
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container cl">
            <a class="navbar-logo hidden-xs" href="index.do">
                <img class="logo" src="${pageContext.request.contextPath}/static/img/logo.png" alt="Lao王博客"/>
            </a>
            <a class="logo navbar-logo-m visible-xs" href="index.do">Lao王博客</a>
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:void(0);"
               onclick="showSide();">&#xe667;</a>
            <nav class="nav navbar-nav nav-collapse w_menu" role="navigation">
                <ul class="cl">
                    <li class="active"><a href="index.do" data-hover="首页">首页</a></li>
                    <li><a href="about.jsp" data-hover="关于我">关于我</a></li>
                    <li><a href="mood.jsp" data-hover="碎言碎语">碎言碎语</a></li>
                    <li><a href="article.jsp" data-hover="学无止尽">学无止尽</a></li>
                    <li><a href="board.jsp" data-hover="留言板">留言板</a></li>
                </ul>
            </nav>
            <nav class="navbar-nav navbar-userbar hidden-xs hidden-sm " style="top: 0;">
                <ul class="cl">
                    <li class="userInfo dropDown dropDown_hover">
                        <a href="${pageContext.request.contextPath}/admin/main.jsp">后台入口</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>

<!--导航条-->
<nav class="breadcrumb">
    <div class="container"><i class="Hui-iconfont">&#xe67f;</i> <a href="index.do" class="c-primary">首页</a> <span
            class="c-gray en">&gt;</span> <span class="c-gray">文章</span> <span class="c-gray en">&gt;</span> <span
            class="c-gray">个人博客应该选择什么样的域名和域名后缀</span></div>
</nav>

<section class="container pt-20">

    <div class="row w_main_row">


        <div class="col-lg-9 col-md-9 w_main_left">
            <div class="panel panel-default  mb-20">
                <div class="panel-body pt-10 pb-10">
                    <h2 class="c_titile">${blog.title}</h2>
                    <p class="box_c"><span class="d_time">发布时间：<fmt:formatDate value="${blog.releaseDate}" type="date"
                                                                               pattern="yyyy年MM月dd日"/></span><span>编辑：<a
                            href="mailto:wfyv@qq.com">wilco</a></span><span>阅读${blog.clickHit}</span></p>
                    <ul class="infos">
                        ${blog.content}
                    </ul>
                    <div class="keybq">
                        <p><span>关键字</span>：<a class="label label-default">${blog.keyWord}</a></p>
                    </div>
                    <div class="nextinfo">
                        <p class="last">上一篇：<a href="#">免费收录网站搜索引擎登录口大全</a></p>
                        <p class="next">下一篇：<a href="#">javascript显示年月日时间代码</a></p>
                    </div>

                </div>
            </div>

            <div class="panel panel-default  mb-20">
                <div class="tab-category">
                    <a href=""><strong>评论区</strong></a>
                </div>
                <div class="panel-body">
                    <div class="panel-body" style="margin: 0 3%;">
                        <div class="mb-20">
                            <ul class="commentList">
                                <c:choose>
                                    <c:when test="${commentList.size() == 0}">
                                        <li class="item cl">
                                            <p>暂无评论</p>
                                        </li>
                                    </c:when>
                                    <c:otherwise>
                                        <c:forEach var="comment" items="${commentList}" varStatus="status">
                                            <li class="item cl">
                                                <a href="#"><i class="avatar size-L radius">
                                                    <img alt=""
                                                         src="http://qzapp.qlogo.cn/qzapp/101388738/1CF8425D24660DB8C3EBB76C03D95F35/100"></i></a>
                                                <div class="comment-main">
                                                    <header class="comment-header">
                                                        <div class="comment-meta">
                                                            <a class="comment-author"
                                                               href="#">${comment.userIp}</a>
                                                            <time class="f-r">
                                                                <fmt:formatDate value="${comment.commentDate}"
                                                                                type="date"
                                                                                pattern="yyyy年MM月dd日hh时"/>
                                                            </time>
                                                        </div>
                                                    </header>
                                                    <div class="comment-body">
                                                        <p>${comment.content}</p>
                                                    </div>
                                                </div>
                                            </li>
                                        </c:forEach>
                                    </c:otherwise>
                                </c:choose>
                            </ul>
                        </div>
                        <div class="line"></div>
                        <!--用于评论-->
                        <div class="mt-20" id="ct">
                            <div id="err" class="Huialert Huialert-danger hidden radius">成功状态提示</div>
                            <textarea id="textarea1" name="comment" style="height:200px;"
                                      placeholder="看完不留一发？">
                            </textarea>
                            <div class="text-r mt-10">
                                <button onclick="getPlainTxt()" class="btn btn-primary radius">发表评论</button>
                            </div>
                        </div>
                        <%--                        <!--用于回复-->--%>
                        <%--                        <div class="comment hidden mt-20">--%>
                        <%--                            <div id="err2" class="Huialert Huialert-danger hidden radius">成功状态提示</div>--%>
                        <%--                            <textarea class="textarea" style="height:100px;"> </textarea>--%>
                        <%--                            <button onclick="hf(this);" type="button" class="btn btn-primary radius mt-10">回复</button>--%>
                        <%--                            <a class="cancelReply f-r mt-10">取消回复</a>--%>
                        <%--                        </div>--%>

                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-3">
            <!--热门推荐-->
            <div class="bg-fff box-shadow radius mb-20">
                <div class="tab-category">
                    <a href=""><strong>热门推荐</strong></a>
                </div>
                <div class="tab-category-item">
                    <ul class="index_recd">
                        <li>
                            <a href="#">阻止a标签href默认跳转事件</a>
                            <p class="hits"><i class="Hui-iconfont" title="点击量">&#xe622;</i> 276 </p>
                        </li>
                        <li>
                            <a href="#">PHP面试题汇总</a>
                            <p class="hits"><i class="Hui-iconfont" title="点击量">&#xe622;</i> 276 </p>
                        </li>
                        <li>
                            <a href="#">阻止a标签href默认跳转事件</a>
                            <p class="hits"><i class="Hui-iconfont" title="点击量">&#xe622;</i> 276 </p>
                        </li>
                        <li>
                            <a href="#">阻止a标签href默认跳转事件</a>
                            <p class="hits"><i class="Hui-iconfont" title="点击量">&#xe622;</i> 276 </p>
                        </li>
                        <li>
                            <a href="#">PHP面试题汇总</a>
                            <p class="hits"><i class="Hui-iconfont" title="点击量">&#xe622;</i> 276 </p>
                        </li>
                    </ul>
                </div>
            </div>

            <!--图片-->
            <div class="bg-fff box-shadow radius mb-20">
                <div class="tab-category">
                    <a href=""><strong>扫我关注</strong></a>
                </div>
                <div class="tab-category-item">
                    <img data-original="temp/gg.jpg" class="img-responsive lazyload" alt="响应式图片">
                </div>
            </div>

        </div>
    </div>

</section>
<footer class="footer mt-20">
    <p>Copyright &copy; 2017-2022 www.ftebox.cn <br>
        <a href="#" target="_blank">基于SSM框架实现的个人博客系统</a>
    </p>
</footer>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/plugin/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugin/layer/3.0/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugin/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugin/pifu/pifu.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/common.js"></script>
<script> $(function () {
    $(window).on("scroll", backToTopFun);
    backToTopFun();
}); </script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/plugin/wangEditor/js/wangEditor.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("img.lazyload").lazyload({failurelimit: 3});

        wangEditor.config.printLog = false;
        var editor1 = new wangEditor('textarea1');
        editor1.config.menus = ['insertcode', 'quote', 'bold', '|', 'img', 'emotion', '|', 'undo', 'fullscreen'];
        editor1.config.emotions = {
            'default': {
                title: '老王表情',
                data: '${pageContext.request.contextPath}/static/plugin/wangEditor/emotions1.data'
            },
            'default2': {
                title: '老王心情',
                data: '${pageContext.request.contextPath}/static/plugin/wangEditor/emotions3.data'
            },
            'default3': {
                title: '顶一顶',
                data: '${pageContext.request.contextPath}/static/plugin/wangEditor/emotions2.data'
            }
        };
        editor1.create();
    });

    function getPlainTxt() {
        var text = $("#textarea1").val();

        // ----测试代码----
        console.log(text);
        //----------------
        $.post("${pageContext.request.contextPath}/comment/save.do",
            {'content':text,'blog.id':'${blog.id}'},
            function (result) {
                if(result.success){
                    window.location.reload();
                    alert("提交成功，等待审核！")
                }else {
                    alert("提交失败，请重新提交！")
                }
            },"json");
    }

</script>
</body>
</html>

