publish-md.ftl 5.4 KB
Newer Older
Y
yadong.zhang 已提交
1
<#include "/include/macros.ftl">
发生的发生飞's avatar
发生的发生飞 已提交
2
<#setting number_format="#">
Y
yadong.zhang 已提交
3
<@header>
4 5 6
    <link href="https://cdn.jsdelivr.net/npm/simplemde@1.11.2/dist/simplemde.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/github-markdown-css@2.10.0/github-markdown.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/github.min.css" rel="stylesheet">
Y
yadong.zhang 已提交
7 8 9 10 11 12 13 14 15 16 17
    <style>
        .CodeMirror, .CodeMirror-scroll {
            min-height: 130px;
            max-height: 200px;
        }
        .CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
            background: none;
        }
    </style>
</@header>
    <div class="clearfix"></div>
18 19 20 21 22 23 24
    <form id="publishForm" class="form-horizontal form-label-left" novalidate>
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <@breadcrumb>
                    <ol class="breadcrumb">
                        <li><a href="/">首页</a></li>
                        <li><a href="/articles">文章列表</a></li>
25
                        <li class="active">发布文章-<a href="https://simplemde.com/" target="_blank">Markdown 编辑器</a></li>
26 27 28 29
                    </ol>
                </@breadcrumb>
                <div class="x_panel">
                    <div class="x_title">
30
                        <h2>发布文章 <small>可以通过右上角“系统配置”-“文章编辑器”选择默认的文章发布编辑器</small></h2>
31
                        <#if !id??>
32 33 34 35 36 37 38 39 40
                            <ul class="nav navbar-right">
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a class="changeEditor" data-href="/article/publish-we">WangEditor 编辑器</a></li>
                                        <li><a class="changeEditor" data-href="/article/publish-tiny">TinyMCE 编辑器</a></li>
                                    </ul>
                                </li>
                            </ul>
41
                        </#if>
42 43 44 45 46
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <input type="hidden" name="id">
                        <input type="hidden" name="isMarkdown" value="1">
47
                        <input type="hidden" name="editorType" value="md">
48 49 50 51 52 53 54 55
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-1" for="title">标题 <span class="required">*</span></label>
                            <div class="col-md-8 col-sm-8 col-xs-8">
                                <input type="text" class="form-control col-md-7 col-xs-12" name="title" id="title" required="required" placeholder="请输入标题"/>
                            </div>
                            <div class="col-md-1 col-sm-1 col-xs-1">
                                <div class="checkbox">
                                    <label>
56
                                        <input type="checkbox" class="square" checked name="original"> 原创
57
                                    </label>
Y
yadong.zhang 已提交
58 59
                                </div>
                            </div>
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="password">内容 <span class="required">*</span></label>
                            <div class="col-md-10 col-sm-10 col-xs-10">
                                <textarea class="form-control col-md-7 col-xs-12" id="content" name="content" style="display: none" required="required"></textarea>
                                <textarea class="form-control col-md-7 col-xs-12 valid" id="contentMd" name="contentMd" style="display: none" required="required"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12"></label>
                            <div class="col-md-10 col-sm-10 col-xs-12">
                                <button type="button" class="btn btn-success to-choose-info"><i class="fa fa-pencil"> 发布文章</i></button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
78
        <@publishModal></@publishModal>
79
    </form>
Y
yadong.zhang 已提交
80
</div>
81
<@chooseImgModal></@chooseImgModal>
Y
yadong.zhang 已提交
82 83
<@footer>

84 85
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/lib/highlight.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/simplemde@1.11.2/dist/simplemde.min.js"></script>
Y
yadong.zhang 已提交
86 87 88 89 90 91
    <script type="text/javascript" src="/assets/js/inline-attachment.js"></script>
    <script type="text/javascript" src="/assets/js/codemirror.inline-attachment.js"></script>
    <script>
        var op = {
            id: "contentMd",
            uniqueId: "mdEditor_1",
92
            uploadUrl: "/api/uploadFileForMd"
Y
yadong.zhang 已提交
93
        };
94
        zhyd.simpleMDE.init(op);
Y
yadong.zhang 已提交
95
        articleId = '${id}';
96
        editorType = 'md';
Y
yadong.zhang 已提交
97 98
    </script>
    <script src="/assets/js/zhyd.publish-article.js"></script>
99
</@footer>