<|start_filename|>owllook/static/md/js/setting.js<|end_filename|>
/**
 * Created by howie on 29/07/2017.
 */
var inst_panel = new mdui.Panel('#panel');

document.getElementById('email-close').addEventListener('click', function () {
    inst_panel.close('#item-email');
});
document.getElementById('pass-close').addEventListener('click', function () {
    inst_panel.close('#item-pass');
});

$("#passSubmitBtn").click(function () {
    var old_pass = $("[name='old_pass']").val();
    var new_pass = $("[name='new_pass']").val();
    var new_pass1 = $("[name='new_pass1']").val();
    $(".pass-error").css("visibility", "hidden");
    if (old_pass == "" || new_pass == "" || new_pass1 == "") {
        $(".pass-error").text("密码不能为空");
        $(".pass-error").css("visibility", "visible");
    } else if (new_pass != <PASSWORD>) {
        $(".pass-error").text("两次密码输入不一致");
        $(".pass-error").css("visibility", "visible");
    } else if (new_pass.length < 6) {
        $(".pass-error").text("密码不能小于6位数");
        $(".pass-error").css("visibility", "visible");
    } else {
        var pass_pd = {"new_pass": <PASSWORD>pass, "old_pass": old_pass};
        $.ajax({
            type: "post",
            contentType: "application/json",
            url: "/operate/change_pass",
            data: pass_pd,
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    mdui.snackbar({
                        message: '密码修改成功',
                        timeout: 3000
                    });
                    inst_panel.close('#item-pass');
                }
                if (data.status == -2) {
                    $(".pass-error").text("原始密码错误");
                    $(".pass-error").css("visibility", "visible");
                }
                if (data.status == -1) {
                    alert('您还没有登录');
                }
            }
        });
    }

});

$("#emailSubmitBtn").click(function () {
    var email = $("[name='email']").val();
    var email_reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    var str_email = email_reg.test(email);
    $(".email-error").css("visibility", "hidden");
    if (str_email) {
        var email_pd = {"email": email};
        $.ajax({
            type: "post",
            contentType: "application/json",
            url: "/operate/change_email",
            data: email_pd,
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    inst_panel.close('#item-email');
                    mdui.snackbar({
                        message: '邮箱修改成功',
                        timeout: 3000
                    });
                    $("#owl-email").html(email);
                    //location.reload();
                }
                if (data.status == -1) {
                    alert('您还没有登录');
                }
            }
        });
    } else {
        $(".email-error").text("邮箱格式错误");
        $(".email-error").css("visibility", "visible");
    }
});

<|start_filename|>owllook/static/novels/js/main.js<|end_filename|>
/**
 * Created by howie on 17/02/2017.
 */

$(function () {
    $('[data-toggle="popover"]').popover()
});


$(document).ready(function () {
    $('.move_up').click(function () {
        $('html, body').animate({scrollTop: 0}, 'slow');
        return false;
    });
    $('.move_down').click(function () {
        $('html, body, .content').animate({scrollTop: $(document).height()}, 300);
        return false;
    });
    // book
    $('#owllook_book').click(function () {
        var chapter_url = $("#chapter_url").val();
        var novels_name = $("#novels_name").val();
        if ($(this).hasClass('add-color')) {
            // delete book
            var del_pd = {"novels_name": novels_name, "chapter_url": chapter_url};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/delete_book",
                data: del_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        $('#owllook_book').removeClass('add-color');
                    }
                    if (data.status == -1) {
                        alert('您还没有登录');
                    }
                }
            });
        } else {
            // add book
            last_read_url = window.location.pathname + window.location.search;
            var add_pd = {"novels_name": novels_name, "chapter_url": chapter_url, 'last_read_url': last_read_url};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/add_book",
                data: add_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        $('#owllook_book').addClass('add-color');
                        alert('已加入书架^_^');
                        window.location.reload();

                    }
                    if (data.status == -1) {
                        alert('您还没有登录');
                    }
                }
            });
        }
    });

    // bookmark
    $('#bookMark').click(function () {
        var chapter_url = $("#chapter_url").val();
        var novels_name = $("#novels_name").val();
        var url = $("#url").val();
        var content_name = $("#content_name").text();
        bookmarkurl = "/owllook_content?url=" + url + "&name=" + content_name + "&chapter_url=" + chapter_url + "&novels_name=" + novels_name;
        if ($(this).hasClass('bookMark')) {
            // add bookmark
            var add_bm_pd = {'bookmark_url': bookmarkurl};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/add_bookmark",
                data: add_bm_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        $('#bookMark').removeClass('bookMark');
                        $('#bookMark').addClass('bookMarkAct');
                    }
                    if (data.status == -1) {
                        alert('您还没有登录');
                    }
                }
            });
        } else {
            // delete bookmark
            var del_bm_pd = {'bookmarkurl': bookmarkurl};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/delete_bookmark",
                data: del_bm_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        $('#bookMark').removeClass('bookMarkAct');
                        $('#bookMark').addClass('bookMark');
                    }
                    if (data.status == -1) {
                        alert('您还没有登录');
                    }
                }
            });
        }
    });
    // login
    $("#owllook_login").click(function () {
        var owllook_user = $("#owllook_user").val();
        var owllook_pass = $("#owllook_pass").val();
        if (owllook_user == "" || owllook_pass == "") {
            alert('不能有内容为空');
        } else {
            var login_pd = {'user': owllook_user, 'pwd': <PASSWORD>};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/login",
                data: login_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        location.reload();
                    }
                    if (data.status == -1) {
                        alert('用户名错误');
                    }
                    if (data.status == -2) {
                        alert('密码错误');
                    }
                }
            });
        }
    });
    // logout
    $("#logout").click(function () {
        $.ajax({
            type: "get",
            contentType: "application/json",
            url: "/operate/logout",
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    location.reload();
                }
            }
        });
    })
});

$('.we-button').popover({
    trigger: 'hover',
    html: true,
    content: "<img width='120px' height='120px' src='static/novels/img/lcxs.jpg'><p style='text-align: center'><span>关注后回复进群</span></p>"
});

$('.lcxs-button').popover({
    trigger: 'hover',
    html: true,
    content: "<img width='120px' height='120px' src='static/novels/img/lcxs.jpg'><p style='text-align: center'><span>微信关注粮草小说</span></p>"
});



<|start_filename|>owllook/static/novels/css/register.css<|end_filename|>
body {
    background-color: #f1f1f1 !important;
}

.logo {
    margin: 5% auto;
}

.register {
    width: 40%;
    height: 100%;
    background-color: white;
    margin-top: 4%;
    padding: 2rem 4rem;
    box-shadow: 0 0 8px rgba(0, 0, 0, .1);
}

.title {
    text-align: center;
    font-family: -apple-system, SF UI Display, Arial, PingFang SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;
    font-weight: 700;
    font-size: 3rem;
    margin: 2rem 0;
}

.input-group {
    position: relative;
    width: 100%;
}

.sign {
    padding: 4px 12px 4px 25px !important;
    font-family: -apple-system, SF UI Text, Arial, PingFang SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;
    height: 50px !important;
    font-size: 14px;
    border: 1px solid #c8c8c8;
    border-bottom: none;
    width: 100%;
    background-color: #f1f1f1;
    outline: none
}

.sign-last {
    border-bottom: 1px solid #c8c8c8;
    margin-bottom: 2rem;
}

.icon {
    position: absolute !important;
    top: 17px !important;
    left: 8px;
    color: #969696;
}

.submitBtn {
    width: 100%;
    margin-bottom: 3rem !important;
    padding: 1rem 0 !important;
}

.errorInfo {
    color: red;
    text-align: center;
}

.errorHidden0, .errorHidden1, .errorHidden2, .errorHidden3 {
    display: none;
}

@media (max-width: 960px) {
    .register {
        width: 100%;
        margin-top: -6%;
    }
}

@media (min-width: 1680px) {
    .register {
        margin-top: 20%;
    }
}

<|start_filename|>owllook/templates/novels/content.html<|end_filename|>
{% extends "main.html" %}

{% block header %}
<title>{{ name }} - owllook</title>
<link rel="stylesheet" href="static/novels/css/content.css">
<style>
    #yun-tie-sdk-wrap {
        background-color: #f8f3e9 !important;
        margin-top: 20px;
    }
</style>
{% endblock %}

{% block content %}

<nav class="navbar navbar-default nav-search">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="/">
            </a>
        </div>
        <form action="/search" method="get">
            <div class="col-xs-3 search">
                <input type="text" name="wd" placeholder="search" value="">
            </div>
        </form>
        {% if is_login %}
        <div class="header">
            {% include "login.html" %}
        </div>
        {% else %}
        <div class="login">
            <a class="btn btn-primary pull-right" href="#" role="button" data-toggle="modal" data-target="#login">登录</a>
        </div>
        {% endif %}
    </div>
</nav>

<div class="container all-content">
    <input id="content_url" type="hidden" value="{{content_url}}">
    <input id="url" type="hidden" value="{{url}}">
    <input id="chapter_url" type="hidden" value="{{chapter_url}}">
    <input id="novels_name" type="hidden" value="{{novels_name}}">
    <div class="title">
        {% if bookmark %}
        <a id="bookMark" title="书签" class="bookMarkAct"></a>
        {% else %}
        <a id="bookMark" title="书签" class="bookMark"></a>
        {% endif %}
        <h2 id="content_name">{{name}}</h2>
    </div>
    <div class="left-bar-list">
        <div class="left-bar-flag">
            <a href="/chapter?url={{chapter_url}}&novels_name={{novels_name}}">
                <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
                <div>目录</div>
            </a>
        </div>
        <div class="left-bar-flag">
            <a href="">
                <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                <div>设置</div>
            </a>
        </div>
        <div class="left-bar-flag">
            {% if book %}
            <a id="owllook_book" class="add-color" href="javascript:;">
                <span class="glyphicon glyphicon-book" aria-hidden="true"></span>
                <div>书架</div>
            </a>
            {% else %}
            <a id="owllook_book" href="javascript:;">
                <span class="glyphicon glyphicon-book" aria-hidden="true"></span>
                <div>书架</div>
            </a>
            {% endif %}

        </div>
        <div class="left-bar-flag">
            <a href="">
                <span class="glyphicon glyphicon-tasks" aria-hidden="true"></span>
                <div>书单</div>
            </a>
        </div>
    </div>
    <div class="show-content">
        {% for item in soup -%}
        {{item|safe}}
        {%- endfor %}
    </div>
    <div class="pre_next">
        {% for v in next_chapter%}
        {% if next_chapter[v] %}
            <a href="/owllook_content?url={{next_chapter[v]}}&chapter_url={{chapter_url}}&novels_name={{novels_name}}"
        {% else %}
            <a href="/chapter?url={{chapter_url}}&novels_name={{novels_name}}"
        {% endif %}
           class="btn btn-default">
            {{v}}
        </a>

        {% endfor %}
    </div>
    <div class="move">
        <div class="move_up">
            <span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
        </div>
        <div class="move_down">
            <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
        </div>
    </div>
    {% include "lcxs_show.html" %}
    <!--{% include "comment.html" %}-->
</div>
{% endblock %}
{% block script %}
<script src="static/novels/js/theme.js"></script>
<script src="static/novels/js/content.js"></script>
{% endblock %}




<|start_filename|>owllook/static/md/js/index.js<|end_filename|>
/**
 * Created by howie on 12/08/2017.
 */

var inst_drawer = new mdui.Drawer('#drawer');
document.getElementById('toggle').addEventListener('click', function () {
    inst_drawer.toggle();
});

var tab = new mdui.Tab('#owl-login-tab');
mdui.JQ('#owl-login').on('open.mdui.dialog', function () {
    tab.handleUpdate();
});

var userStatus = {
    logout: function () {
        $.ajax({
            type: "get",
            contentType: "application/json",
            url: "/operate/logout",
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    window.location.reload()
                }
            }
        });
    },
    login: function () {
        var owllook_user = $("#owllook_user").val();
        var owllook_pass = $("#owllook_pass").val();
        if (owllook_user == "" || owllook_pass == "") {
            alert('不能有内容为空');
        } else {
            var login_pd = {'user': owllook_user, 'pwd': <PASSWORD>};
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/login",
                data: login_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        window.location.reload()
                    }
                    if (data.status == -1) {
                        alert('用户名错误');
                    }
                    if (data.status == -2) {
                        alert('密码错误');
                    }
                }
            });
        }
    }
};

<|start_filename|>owllook/static/novels/js/bookmarks.js<|end_filename|>
/**
 * Created by howie on 24/04/2017.
 */

$(document).ready(function () {
    $(".del-bookmark").click(function () {
        var msg = "您真的确定要删除吗？请确认！";
        if (confirm(msg)) {
            var bookmarkurl = $(this).find('a.bookmark_url').attr("data-value");
            var del_bm_pd = {"bookmarkurl": bookmarkurl};
            var del_bm_object = $(this).parent();
            $.ajax({
                type: "post",
                contentType: "application/json",
                url: "/operate/delete_bookmark",
                data: del_bm_pd,
                dataType: 'json',
                success: function (data) {
                    if (data.status == 1) {
                        del_bm_object.remove();
                    }
                    if (data.status == -1) {
                        alert('您还没有登录');
                    }
                }
            });
        }
    });
});

<|start_filename|>owllook/templates/novels/chapter.html<|end_filename|>
{% extends "main.html" %}

{% block header %}
<title>{{ novels_name }} - owllook</title>
<link rel="stylesheet" href="static/novels/css/chapter.css">
{% endblock %}

{% block content %}

<div class="alert alert-warning center-block">
    <p class="close" data-dismiss="alert">
        &times;
    </p>
    <p style="text-align: center">
        <strong>注意！</strong>页面内容来自<a target="_blank" href="{{url}}">{{url}}</a>，本站不储存任何内容，为了更好的阅读体验进行在线解析，若有广告出现，请及时反馈。若您觉得侵犯了您的利益，请通知我们进行删除，然后访问
        <a href="{{url}}">原网页</a>
    </p>
</div>

<div class="container all-chapter">
    <input id="content_url" type="hidden" value="{{content_url}}">
    <input id="url" type="hidden" value="{{url}}">
    <input id="novels_name" type="hidden" value="{{novels_name}}">
    {% for item in soup -%}
    {{item|safe}}
    {%- endfor %}
    <div class="move">
        <div class="move_up">
            <span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
        </div>
        <div class="move_down">
            <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
        </div>
    </div>
    <!--{% include "comment.html" %}-->
</div>
{% endblock %}
{% block script %}
<script src="static/novels/js/list.js"></script>
{% endblock %}




<|start_filename|>owllook/templates/md/similar_user.html<|end_filename|>
{% extends "main.html" %}

{% block header %}
<title>{{ title }}</title>
<link rel="stylesheet" href="/md/static/md/css/md.css">
{% endblock %}

{% block content %}
<body class="mdui-appbar-with-toolbar">

<div class="mdui-drawer mdui-drawer-close" id="drawer">
    {% include "user_status.html" %}
    <ul class="mdui-list">
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">library_books</i>
            <div class="mdui-list-item-content"><a href="/md/books">我的书架</a></div>
        </li>
        <li class="mdui-list-item mdui-ripple mdui-list-item-active">
            <i class="mdui-list-item-icon mdui-icon material-icons">directions_run</i>
            <div class="mdui-list-item-content"><a href="/md/similar_user">书友推荐</a></div>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">book</i>
            <div class="mdui-list-item-content"><a href="/md/bookmarks">我的书签</a></div>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">favorite</i>
            <div class="mdui-list-item-content"><a href="/md/book_list">我的书单</a></div>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">notifications</i>
            <div class="mdui-list-item-content"><a href="/md/noti_book">新书提醒</a></div>
        </li>
        <li class="mdui-subheader">设置</li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">settings</i>
            <div class="mdui-list-item-content"><a href="/md/setting">个人设置</a></div>
        </li>
        <!--<li class="mdui-list-item mdui-ripple">-->
        <!--<i class="mdui-list-item-icon mdui-icon material-icons">security</i>-->
        <!--<div class="mdui-list-item-content">修改密码</div>-->
        <!--</li>-->
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">feedback</i>
            <div class="mdui-list-item-content">
                <a target="_blank" href="https://github.com/howie6879/owllook/issues/9">我要反馈</a>
            </div>
        </li>
    </ul>
</div>

{% include "toolbar.html" %}

<div class="mdui-container-fluid">
    <div class="mdui-table-fluid">
        {% if is_similar %}
        <table class="mdui-table mdui-table-hoverable" style="margin-bottom: 50px;">
            <thead>
            <tr align="center">
                <th>相似用户</th>
                <th>相似度</th>
            </tr>
            </thead>
            <tbody>
            {% for v in similar_user%}
            {% for key in v %}
            <tr>
                <td>
                    <a href="/admin/search_user?ss={{key|replace('&#183;','.')}}" target="_blank">{{key|replace('&#183;','.')}}</a>
                </td>
                <td>
                    <a href="#">{{v[key]}}</a>
                </td>
            </tr>
            {% endfor %}
            {% endfor %}
            </tbody>
        </table>
        {% else %}
        <center style="height: 50px;line-height: 50px">暂无相似书友</center>
        {% endif %}
    </div>
    {% include "is_login.html" %}
</div>
{% endblock %}
{% block script %}
{% endblock %}

<|start_filename|>owllook/static/md/js/noti.js<|end_filename|>
/**
 * Created by howie on 12/08/2017.
 */

var inst_panel = new mdui.Panel('#panel');


$("#authorBtn").click(function () {
    var author_name = $("[name='author_name']").val();
    var author_pd = {"author_name": author_name};
    if (author_name == "") {
        mdui.snackbar({
            message: '请输入作者名',
            timeout: 3000
        });
    } else {
        $.ajax({
            type: "post",
            contentType: "application/json",
            url: "/operate/author_notification",
            data: author_pd,
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    mdui.snackbar({
                        message: '添加作者成功',
                        onClose: function () {
                            location.reload();
                        }
                    });
                }
                if (data.status == -1) {
                    alert('您还没有登录');
                }
                if (data.status == 2) {
                    mdui.snackbar({
                        message: '暂无该作者',
                        timeout: 2000
                    });
                }
                if (data.status == 3) {
                    mdui.snackbar({
                        message: '作者已添加',
                        timeout: 2000
                    });
                }
                if (data.status == 4) {
                    mdui.snackbar({
                        message: '只能添加五位作者',
                        timeout: 2000
                    });
                }
                if (data.status == 0) {
                    mdui.snackbar({
                        message: '操作失败',
                        timeout: 1000
                    });
                }
            }
        });
    }
});

<|start_filename|>owllook/static/novels/css/content.css<|end_filename|>
body {
    background: url(../img/read_bg.png) #ede7da !important;
    color: #333 !important;
    font-family: "Microsoft YaHei" !important;
}

.navbar {
    background: rgb(242, 238, 230) !important;
}

.search {
    width: 200px;
    height: 50px;
}

.nav-search {
    background: rgba(242, 238, 230, 0.58) !important;
}

.search input {
    font-family: PingFangSC-Regular, HelveticaNeue-Light, 'Helvetica Neue Light', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    position: absolute;
    z-index: 1;
    top: 20px;
    right: 40px;
    width: 175px;
    height: 26px;
    transition: border .5s;
    border: none;
    outline: none;
    border-bottom: 1px solid #ccc;
    background: 0 0;
    -moz-transition: border .5s; /* Firefox 4 */
    -webkit-transition: border .5s; /* Safari and Chrome */
    -o-transition: border .5s;

}

.login > a {
    margin-top: 8px;
}

.btn-login {
    border: 1px solid #d8d8d8 !important;
    color: #b3acac;
    background-color: #5c6165;
}

.btn-login:hover, .btn-login:focus {
    color: #fff !important;
    background-color: #337ab7;
    border-color: #2e6da4;
}

.search input:focus {
    top: 15px;
    border-bottom: 3px solid #E67676;
}

.all-content {
    width: 65% !important;
    box-shadow: 0 0 15px 0 #CCC;
    background: #F6F4EC;
    margin: 0 auto 30px;
    border-radius: 3px;
    padding-bottom: 10px;
    min-height: 600px;
    margin-bottom: 70px;
    border: 1px solid #d8d8d8;
    background: url(../img/read_content.png) !important;
}

.title {
    position: relative;
}

.title > a.bookMark {
    position: absolute;
    background: url(../img/bookMark.png) no-repeat;
    width: 20px;
    height: 36px;
    right: 30px;
    top: -30px;
    cursor: pointer;
}

.title > a.bookMarkAct {
    position: absolute;
    background: url(../img/bookMark.png) no-repeat -20px 0;
    width: 22px;
    height: 39px;
    right: 30px;
    top: -30px;
    cursor: pointer;
}

.title > h2 {
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.show-content, pre {
    width: 90%;
    line-height: 1.8;
    font-size: 16px !important;
    padding-top: 16px;
    min-height: 360px;
    margin-left: 5%;
    word-break: break-all;
    font-family: "Microsoft YaHei";
    text-align: left;
    position: relative;
}

pre {
    border: none !important;
    background: none !important;
}

.left-bar-list {
    width: 60px;
    position: fixed;
    left: 12%;
}

.left-bar-list .left-bar-flag {
    position: relative;
    z-index: 100;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .1);
    border-top: none;
    background: url("../img/left_bar_flag.png")
}

.left-bar-list .left-bar-flag .glyphicon {
    font-size: 18px;
}

.left-bar-list .left-bar-flag a {
    font: 12px/16px PingFangSC-Regular, '-apple-system', Simsun;
    display: block;
    width: 58px;
    height: 58px;
    transition: none;
    text-align: center;
    padding-top: 12px;
    color: #999;
    text-decoration: none;
    color: rgba(0, 0, 0, .4)
}

.left-bar-list .left-bar-flag a:hover, .add-color {
    color: #E67676 !important;
}

.show-content > p {
    font-size: 16px !important;
}

.show-content > #content {
    text-align: left !important;
}

.pre_next {
    width: 100%;
    height: 40px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.pre_next > a:first-child {
    margin-right: 40%;
}

.pre_next > a {
    cursor: pointer;
    border: 1px solid rgba(90, 76, 76, 0.1);
    color: #555;
    background: rgba(0, 0, 0, .0001);
}

.pre_next > a:hover {
    border: 1px solid rgba(90, 76, 76, 0.1);
    color: #E67676;
    background: rgba(0, 0, 0, .0001);
}

.move {
    right: 5% !important;
}

/*原网页上一章下一章等隐藏*/

.mingzhuPage, #htmlContent img, .chapter_Turnpage, #pageselect, .biao-qian-love-bd, #toplink, #tuijian, .chapter_Turnpage a, .bottem, .chapter h1, .content > center, .content p > strong, .content p > a {
    display: none !important;
}

@media (max-width: 1024px) {
    .left-bar-list, #cloud-tie-wrapper {
        display: none !important;
    }

    .all-content {
        width: 96% !important;
    }

    .move {
        display: none;
    }

    .search input {
        right: 0 !important;
        left: 0 !important;
    }

    .login > a {
        margin-top: 10px !important;
    }

    .title > h2 {
        font-size: 20px;
    }
}

<|start_filename|>owllook/static/novels/js/content.js<|end_filename|>
/*
Created By MSCSTSTS
2017-09-27 18:13:50 UTC+8


Edit By MSCSTSTS
2017-12-02 19:36:17 UTC+8
+触屏滑动切换上一章/下一章。
+键盘左右方向键切换上一章/下一章。

*/


//--------------------------------------------------------------------------------------------

/*
登录、书签、加入书库等功能，都是基于刷新或者ajax
所以仅需修改部分页面
最后，将页面滑动到顶部即可。
处理逻辑：
	1：页面加载，检查浏览器是否支持 ajax 和 sessionStorage
	2：查询下一章 和 上一章是否已被缓存，若没有，则进行 ajax 请求，并将对应页面存入sessionStorage
	3：点击上一章或下一章按钮以后，将缓存中的数据取出，重新渲染页面，回到顶部，修改浏览器url，并重新执行2
需要缓存的条目：
	1：本页链接      data.url
	2：下一章链接  data.next_chapter."下一章"
	3：上一章链接  data.next_chapter."上一章"
	4：章节名         data.name
	5：小说名         data.novels_name
	6：正文内容      data.soup
	7：是否书签      data.bookmark
需要更新的页面内容：
	0：【索引项】 页面链接（相对地址）    由 缓存数据的本页链接 拼接产生
	1：书签状态          #bookMark   的 class ，根据 缓存数据 的 是否书签来定义 class
	2：隐藏表单          page_url  的 value       , 根据 缓存数据 的 本页链接
	3：页面标题          page_title          ,  根据 缓存数据 的 章节名产生
	4：正文文本          page_chapter_content      ,根据 缓存数据 的 正文内容产生
	5：上一章和下一章的地址     ，根据缓存数据的上一章链接和下一章链接产生
	6：地址栏URL ，使用replaceState来更新，根据缓存数据的 本页链接 来拼接
*/


$(document).ready(function () {

    var page_btn_pre = $("div.pre_next > a:nth-child(1)");
    var page_btn_next = $("div.pre_next > a:nth-child(2)");
    var page_title = $("title");
    var page_chapter_name = $("#content_name");
    // var page_chapter_content = $(".show-content>div");//正文
    var page_chapter_content = $($(".show-content").children("*").get(0)); //正文
    var page_bookmark = $("#bookMark");//书签，需要修改样式
    var page_url = $("#url");//页面隐藏表单，本页地址

    function get_chapter(n_url) {
        $.ajax({
            //提交数据的类型 POST GET
            type: "GET",
            //提交的网址
            url: n_url,
            //提交的数据
            data: {is_ajax: "owl_cache"},
            //返回数据的格式
            datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
            //在请求之前调用的函数
            //beforeSend:function(){$("#msg").html("logining");},
            //成功返回之后调用的函数
            success: function (data) {
                if (typeof data.name == "undefined") {

                } else { // 正确获取到数据
                    var obj = {
                        url: data.url,
                        pre_chapter_url: transform(data.next_chapter)[0],
                        next_chapter_url: transform(data.next_chapter)[1],
                        name: data.name,
                        novels_name: data.novels_name,
                        content: data.soup,
                        bookmark: data.bookmark,
                        chapter_url: data.chapter_url
                    };
                    store(n_url, obj);
                }
            },
            //调用执行后调用的函数
            complete: function () {

            },
            //调用出错执行的函数
            error: function () {
                //请求出错处理
            }
        });
    }

    function transform(obj) {
        var arr = [];
        for (var item in obj) {
            arr.push(obj[item]);
        }
        return arr;
    }

    function store(n_url, obj) {
        window.sessionStorage.setItem(n_url, JSON.stringify(obj));
    }

    function ajax_content_init() {
        if (isSupport()) {
            log("支持sessionStorage，将为你开启页面缓存");
            search_url = window.location;
            // 来自书签页面的跳转不进行缓存
            if (search_url.search.indexOf("from_bookmarks") > 0) {
                log('来自书签页面的跳转不进行缓存')
            } else {
                ajax_task();
                page_bookmark.bind("click", function () {
                    cache_reset();
                });
            }
        } else {
            //不支持
            return;
        }
    }

    function ajax_task() {
        store_query();//检查是否已缓存
        page_btn_pre.unbind("click");
        page_btn_pre.click(function () {
            event.preventDefault();
            if (window.sessionStorage.getItem(page_btn_pre.attr("href")) === null) {
                //若未缓存
                window.location.href = page_btn_pre.attr("href");
            } else {
                try {
                    load(page_btn_pre.attr("href"));
                } catch (err) {
                    window.location.href = page_btn_pre.attr("href");
                }

            }
        });
        page_btn_next.unbind("click");
        page_btn_next.click(function () {
            event.preventDefault();
            if (window.sessionStorage.getItem(page_btn_next.attr("href")) === null) {
                //若未缓存
                window.location.href = page_btn_next.attr("href");
            } else {
                try {
                    load(page_btn_next.attr("href"));
                } catch (err) {
                    window.location.href = page_btn_next.attr("href");
                }

            }
        });
    }


    function load_bookmark(data) {
        page_bookmark.removeClass("bookMark");
        page_bookmark.removeClass("bookMarkAct");
        //log(data.bookmark);
        if (data.bookmark == 0) {
            page_bookmark.addClass("bookMark");
        } else {
            page_bookmark.addClass("bookMarkAct");
        }
    }

    function load_hiddenForm(data) {
        page_url.val(data.url);
    }

    function load_title(data) {
        page_title.html(data.name + " - owllook");
    }

    function stripscript(s) {//用于过滤script标签
        return s.replace(/<script>.*?<\/script>/ig, '').replace(/<.*?div.*?>/, '');
    }

    function load_chapter_content(data) {
        page_chapter_content.html(stripscript($(data.content).html()));
    }

    function load_chapter_name(data) {
        page_chapter_name.text(data.name);
    }

    function load_btn_href(data) {
        page_btn_pre.attr("href", "/owllook_content?url=" + data.pre_chapter_url + "&chapter_url=" + data.chapter_url + "&novels_name=" + data.novels_name);
        page_btn_next.attr("href", "/owllook_content?url=" + data.next_chapter_url + "&chapter_url=" + data.chapter_url + "&novels_name=" + data.novels_name);
    }

    function load_location_url(data) {
        var th_url = window.location.href + "";
        var pos = th_url.indexOf("/owllook_content?");
        var td_url = "/owllook_content?url=" + data.url + "&name=" + data.name + "&chapter_url=" + data.chapter_url + "&novels_name=" + data.novels_name;
        th_url += td_url;
        //log(th_url);
        window.history.replaceState({}, data.name + " - owllook", td_url);
    }

    function load(index) {//从缓存中加载内容
        var data = JSON.parse(window.sessionStorage.getItem(index));
        load_bookmark(data);
        load_hiddenForm(data);
        load_title(data);
        load_chapter_content(data);
        load_chapter_name(data);
        load_btn_href(data);
        load_location_url(data);
        $("body > div.container.all-content > div.move > div.move_up").click();//回到顶部
        ajax_task();
    }


    function store_query() {
        var pre_url = page_btn_pre.attr("href");
        var next_url = page_btn_next.attr("href");
        //log(pre_url);
        //log(window.sessionStorage.getItem(pre_url));
        if (window.sessionStorage.getItem(pre_url) === null) {
            get_chapter(pre_url);
        }
        if (window.sessionStorage.getItem(next_url) === null) {
            get_chapter(next_url);
        }
    }

    function cache_reset() {
        window.sessionStorage.clear();
        ajax_task();
    }


    function isSupport() {
        if (typeof window.sessionStorage == "undefined") { //判断是否支持sessionStorage
            return false;
        }
        return true;
    }


    function log(s) {
        if (1) {
            console.log(s);
        }

    }


    ajax_content_init();


    /*
        2017年12月2日 +触屏滑动切换上一章/下一章。
    */
    //按键事件
    $(document).keydown(function (event) {
        var e = event || window.event;
        var k = e.keyCode || e.which;
        switch (k) {
            case 39:
                // right
                page_btn_next.click();
                break;
            case 37:
                // left
                page_btn_pre.click();
                break;
            case 38:
                //	up
                break;
            case 40:
                // down
                break;
        }
        return true;
    });

    // (function(){
    // 	var startX,startY,endX,endY;
    // 	var el = document.querySelector("body");
    // 	//获取点击开始的坐标
    // 	el.addEventListener("touchstart", function (e){
    // 		startX = e.touches[0].pageX;
    // 		startY = e.touches[0].pageY;
    // 	});
    // 	//获取点击结束后的坐标
    // 	el.addEventListener("touchend", function(e){
    // 		endX = e.changedTouches[0].pageX;
    // 		endY = e.changedTouches[0].pageY;
    // 		var x = (endX - startX);
    // 		var y = (endY - startY);
    // 		if(Math.abs(x/y)>5&&Math.abs(x)>30){
    // 			if(x<0){
    // 				page_btn_next.click();
    // 			}else{
    // 				page_btn_pre.click();
    // 			}
    // 		}
    //
    // 	});
    // })();
});


//---------------------------------------------------------------------------------------

<|start_filename|>owllook/static/novels/js/register.js<|end_filename|>
/**
 * Created by howie on 14/03/2017.
 */
$(function () {
    $(".submitBtn").click(function () {
        var nickname = $("[name='nickname']").val();
        var email = $("[name='email']").val();
        var answer = $("[name='answer']").val();
        var password = $("[name='password']").val();
        var email_reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        var str_email = email_reg.test(email);
        $("#errorInfo0").addClass("errorHidden0");
        $("#errorInfo1").addClass("errorHidden1");
        $("#errorInfo2").addClass("errorHidden2");
        $("#errorInfo3").addClass("errorHidden3");
        if (str_email) {
            if (password == "" || password != $("[name='password2']").val()) {
                $(".errorInfo").removeClass("errorHidden1");
            }
            else if (password.length < 6 || nickname.length <= 2) {
                $(".errorInfo").removeClass("errorHidden0");
            }
            else if (nickname == "" || email == "" || answer == "") {
                $(".errorInfo").removeClass("errorHidden2");
            }
            else {
                register_pd = {
                    'user': nickname,
                    'pwd': password,
                    'email': email,
                    'answer': answer
                };
                $.ajax({
                    type: "post",
                    contentType: "application/json",
                    url: "/operate/register",
                    data: register_pd,
                    dataType: 'json',
                    success: function (data) {
                        if (data.status == 1) {
                            window.location.href = '/';
                        }
                        if (data.status == -1) {
                            alert('用户名已存在 换个更好的名字吧');
                        }
                        if (data.status == -2) {
                            alert('回答错了^_^');
                        }
                        if (data.status == 0) {
                            alert('注册失败');
                        }
                    }
                });
            }
        } else {
            $(".errorInfo").removeClass("errorHidden3");
        }
    });
});

<|start_filename|>owllook/templates/novels/search_user.html<|end_filename|>
{% extends "main.html" %}

{% block header %}
<title>{{ title }}</title>
<link rel="stylesheet" href="static/novels/css/result.css">
<style>
    td, th {
        text-align: center !important;
    }
</style>
{% endblock %}

{% block content %}
{% include "search_bar.html" %}
<div class="container">
    {% if is_bookmark %}
    <table class="table table-striped table-hover">
        <thead>
        <tr align="center">
            <th>小说名</th>
            <th>源目录</th>
            <th>最新章节</th>
            <th>{{username}}上次阅读到</th>
        </tr>
        </thead>
        <tbody>
        {%for item in result%}
        <tr>
            <td><a href="/search?wd={{item.novels_name}}" target="_blank">{{item.novels_name}}</a></td>
            <td>
                <a href="{{item.book_url}}" target="_blank">查看{{item.novels_name}}源目录</a>
            </td>
            <td>
                <a href="{{item.owllook_content_url}}" target="_blank">{{item.latest_chapter_name}}</a>
            </td>
            <td>
                <a href="{{item.last_read_url}}" target="_blank">{{item.last_read_chapter_name}}</a>
            </td>
        </tr>
        {%endfor%}
        </tbody>
    </table>
    {% else %}
    <center>书架暂无数据</center>
    {% endif %}

</div>
{% endblock %}
{% block script %}
<script src="static/novels/js/books.js"></script>
{% endblock %}

<|start_filename|>owllook/templates/novels/donate.html<|end_filename|>
{% extends "main.html" %}

{% block header %}
<title>donate - owllook</title>
{% endblock %}

{% block content %}
<div class="container">
    <div class="donate">
        <p>如果觉得<a href="https://www.owllook.net/">owllook</a>对您有帮助，那么您可以给开发者一些支持，右下角可加微信群一起交流：</p>
        <ul>
            <li>服务器的费用也是一笔开销，网站需要存活</li>
            <li>为用户提供更好的搜索环境</li>
            <li>一杯咖啡</li>
        </ul>
        <p>请扫一扫微信支付（留言希望你带上自己的名字^_^）：</p>
        <p><img class="img-responsive" src='static/novels/img/donate.png' width="300px"
                height="300px" alt=''/></p>
        <p>有兴趣可关注公众号：粮草小说</p>
        <p><img class="img-responsive" src='https://i.loli.net/2018/11/03/5bdce6bfc7811.png' width="300px"
                height="300px" alt=''/></p>
    </div>
    <div class="donate_lists">
        <p><strong>捐赠名单（按照时间排序）：</strong></p>
        <br>
        <ul>
            <li>12hStudy: 5 元</li>
            <li>佚名：5元</li>
            <li>佚名：50元</li>
            <li>路人甲、：100元</li>
            <li>盛阿德：20元</li>
            <li>shine：50元</li>
            <li>江黑龙：10元</li>
            <li>Future：100元</li>
            <li>Mongol Hun：20元</li>
            <li>佚名：15元</li>
            <li>人到中年：100元</li>
            <li>Black：6元</li>
            <li>滑稽：5元</li>
            <li>w.：20元</li>
            <li>包子.：6.6元</li>
            <li>佚名：200元</li>
            <li>佚名：20元</li>
            <li>lfl44135：5元</li>
            <li>佚名：5元</li>
            <li>ray：68元</li>
            <li>起个名字真难：15元</li>
            <li>佚名：10元</li>
            <li>乌鸦还是黑的好：10元</li>
            <li>极其优秀：6元</li>
            <li>键盘侠：20元</li>
            <li>佚名：12元</li>
            <li>过客：5元</li>
            <li>周洲：10元</li>
            <li>佚名：6元</li>
            <li>non-secure：26.66元</li>
            <li>佚名：8.88元</li>
            <li>*生：18.80元</li>
            <li>*杨：15元</li>
            <li>*.：5元</li>
            <li>*鸣：15元</li>
            <li>D*y：4.98元</li>
            <li>*剑：30元</li>
            <li>快乐就好：20元</li>
            <li>*曦：1元</li>
            <li>痴想集：100元</li>
        </ul>
    </div>
</div>
{% endblock %}