<!--
 * @Author: hua
 * @Date: 2020-05-23 19:48:45
 * @description: 
 * @LastEditors: hua
 * @LastEditTime: 2020-06-07 20:21:14
--> 
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
        name="viewport">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="Cache-Control" content="no-transform" />
    <title>
        在线留言
    </title>
    <meta name="keywords" content="在线留言" />
    <meta name="description" content="在线留言" />
    <link rel="stylesheet" href="{{'CMS_BASEHOST'|sysconfig}}/static/css/style.css" media="all">
    <link rel="stylesheet" href="{{'CMS_BASEHOST'|sysconfig}}/static/css/bootstrap.min.css">
    <script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/js/ad.js"></script>
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/jquery.min.js"></script>
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/bootstrap.min.js"></script>
</head>

<body>
    <script>
        site();
    </script>
    {% include "/index/common/header.html" %}<div id="tad">
        <script>
            tjs();
        </script>
    </div>
    
    <div class="box mt10" style="background-color:#fff;padding:20px 0;">
        <h1 class="arct" style="text-align:center">在线留言</h1>
        <div style="padding:20px">
            <form method="post" action="{{'CMS_BASEHOST'|sysconfig}}/api/guestBook/add"  enctype="multipart/form-data" >
                <div class="form-group">
                    <label for="name">标题</label>
                    <input type="text" class="form-control" name="title" id="title" placeholder="请输入标题">
                </div>
                <script  id="ueditor" name="content"  style="height:400px;width:100%"></script>
                <div style="display: flex;flex-direction:row;justify-content:flex-end;margin-top:10px">
                    <button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>
                </div>
            </form>
        </div>
        <!-- 配置文件 --><script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/other/flueditor/ueditor.config.js"></script>
        <!-- 编辑器源码文件 --><script type="text/javascript" src="{{'CMS_BASEHOST'|sysconfig}}/static/other/flueditor/ueditor.all.min.js"></script>
        
        <script type="text/javascript">
            var _editor;
            $(function() {
                //增加占位符属性
                UE.Editor.prototype.placeholder = function (justPlainText) {
                    var _editor = this;
                    _editor.addListener("focus", function () {
                        var localHtml = _editor.getPlainTxt();
                        if ($.trim(localHtml) === $.trim(justPlainText)) {
                            _editor.setContent(" ");
                        }
                    });
                    _editor.addListener("blur", function () {
                        var localHtml = _editor.getContent();
                        if (!localHtml) {
                            _editor.setContent(justPlainText);
                        }
                    });
                    _editor.ready(function () {
                        _editor.fireEvent("blur");
                    });
                };
                //重新实例化一个编辑器，防止在上面的editor编辑器中显示上传的图片或者文件
                _editor = UE.getEditor('ueditor');
                _editor.placeholder("请输入您想留言的内容...");
            });
            //弹出图片上传的对话框
            function upImage()
            {
                var myImage = _editor.getDialog("insertimage");
                myImage.render();
                myImage.open();
            }
        </script>
    </div><!-- box end -->
    {% include "/index/common/footer.html" %}
</body>
