<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>{$tkd.title|parseTPL}</title>
    <meta name="keywords" content="{$tkd.keywords|parseTPL}" />
    <meta name="description" content="{$tkd.description|parsetpl}" />
    {include file="/system/head"}
</head>
<body class="readpage">
<div class="frame-header">
    <div class="frame-header-content">
        <div class="logo">
            <a href="{$kx.config.siteurl}" title="{$kx.config.sitename}">
                <img src="{$kx.config.resurl}/template/kxwebno2/image/logo.png" alt="{$kx.config.sitename}" />
            </a>
        </div>
        <div class="searchbox">
            <form action="{link=novel.search.result}" name="search-form" method="get">
                <input type="text" class="text" name="searchkey" value="{$novel.name}" autocomplete="off" />
                <button type="submit" class="searchbtn">搜书</button>
            </form>
        </div>
        <div class="frame-operate">
            <div class="frame-btn">
                <a href="{$prevurl}" class="btn btn-primary btn-sm" >
                    <i class="pticon pticon-chevron-left"></i> {$prevpage|default="上一章","上一页"}
                </a>
                <a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" class="btn btn-default" title="{$novel.name}">
                    <i class="pticon pticon-list"></i> 目录
                </a>
                <a href="{$nexturl}" class="btn btn-primary" >
                    {$nextpage|default="下一章","下一页"} <i class="pticon pticon-chevron-right"></i>
                </a>
                <a rel="nofollow" href="javascript:void(0);" data-is-mark="{$ismark}" class="btn btn-danger btn-mark {$ismark|default='','active'}">
                    <i class="pticon pticon-bookmark"></i> {$ismark|default="加入收藏","已收藏"}
                </a>
                <a rel="nofollow" href="{$chapter.source}" class="btn btn-success" title="{$site.name} {$chapter.name}"><i class="pticon pticon-globe"></i> 源网站</a>
            </div>
            <div class="frame-source">
                <div class="dropmenu">
                    <span class="tri"></span>
                    <ul class="dropmenu-item">
                        {block method="chapter.same" name=list novelid=$novel.id chapterid=$chapter.id}
                        {loop=$list}
                        <li><a rel="nofollow" href="{link=novel.chapter.read novelid=$novel.id pinyin=$novel.pinyin chapterid=$chapter.id siteid=$loop.site.id}" title="{$novel.name} {$loop.site.name} {$chapter.name}">{$loop.site.name}</a></li>
                        {/loop}
                    </ul>

                </div>
            </div>
        </div>
    </div>
</div>
<section class="readpage" >
    <div class="readbox">
        <article>
            <div class="title">
                <h1><a href="#" title="{$novel.name} {$chapter.name}">{$novel.name} {$chapter.name}</a></h1>
                <div class="info">
                    <span>小说：<a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}</a></span>
                    <span>作者：<a href="{link=author.space.index authorid=$author.id pinyin=$author.pinyin name=$author.name}" title="{$author.name} 作品大全">{$author.name}</a></span>
                    <span>更新时间：{$chapter.time|date="Y-m-d H:i:s"}</span>
                    <span class="sitename">源网站：<a rel="nofollow" href="{$site.url}" title="{$site.name} {$chapter.name}">{$site.name}</a></span>
                </div>
            </div>
            <div class="content" id="chaptercontent">
                {if $chapter.content}{$chapter.content|showchapter}{else}<div style="text-align:Center;padding:50px 0"><img src="__PUBLIC__/image/loading.gif"><br/>正在转码，请稍后......</div>{/if}
            </div>
            <div class="info bottominfo">
                为更好的阅读体验，本站章节内容基于百度转码进行转码展示，如有问题请您到源站阅读, <a href="https://m.baidu.com/pub/help.php?pn=20&bd_page_type=1" rel="nofollow">转码声明</a>。<br />
                <a href="{$kx.config.siteurl}">{$kx.config.sitename}</a>邀请您进入最专业的<a href="{$kx.config.siteurl}">小说搜索</a>网站阅读<a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}</a>,<a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}最新章节</a>,<a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name} {$site.name}</a>！
            </div>
        </article>
        <div class="operate">
            <ul>
                <li><a href="{$prevurl}" ><i class="pticon pticon-chevron-left"></i> {$prevpage|default="上一章","上一页"}</a></li>
                <li><a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}"><i class="pticon pticon-list"></i> 目录</a></li>
                <li class="last"><a href="{$nexturl}" >{$nextpage|default="下一章","下一页"} <i class="pticon pticon-chevron-right"></i></a></li>
            </ul>
        </div>
        <div class="readingTips">
            可以使用回车、←→快捷键阅读
            <div class="readingSwitch none"><span class="readingSwitch_Btn active"></span>开启瀑布流阅读
            </div>
        </div>
    </div>
</section>
{include file="/system/footer"}
<script type="text/javascript">
    document.onkeydown = function () {
        var event = event ? event : window.event;
        if (event.keyCode == 37) location = "{$prevurl}";
        if (event.keyCode == 39) location = "{$nexturl}";
        if (event.keyCode == 13) location = "{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}";
    }
    window.onerror = function () {
        return true;
    };

</script>
{if $show_type == 2}
<script type="text/javascript">
    $(function () {
        $.get('{link=api.novel.chapter.transcode responsetype=json}', {
            novelid: '{$novel.id}',
            chapterid: '{$chapter.id}',
            siteid: '{$site.id}',
            page: '{$current_page}'
        }, function (res) {
            if (res.code) {
                alert(res.msg)
            } else {
                $('#chaptercontent').html(res.data.chapter.content);
                $('.sitename a')
                    .text(res.data.site.name)
                    .attr('title', res.data.site.name + '' + res.data.chapter.name)
                    .attr('href', res.data.site.url);
            }
        },'json');
        $('.readingSwitch_Btn').on('click', function () {
            if ($(this).is('.active')) {
                $(this).removeClass('active');
            } else {
                $(this).addClass('active');
            }
        });
    })
</script>
{/if}
</body>
</html>
