fix bug
parent
c261121201
commit
63940d2790
@ -0,0 +1,80 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% block title %}New Post (Markdown) {% endblock %}
|
||||
|
||||
|
||||
{%block styles%}
|
||||
{{super()}}
|
||||
<link rel="stylesheet" href="{{url_for('static',filename='editormd/css/editormd.min.css')}}">
|
||||
{%endblock%}
|
||||
|
||||
{%block scripts%}
|
||||
{{super()}}
|
||||
<script src="{{ url_for('static',filename='editormd/examples/js/jquery.min.js') }}"></script>
|
||||
<script src="{{ url_for('static',filename='editormd/editormd.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
window.onload = function(){
|
||||
document.getElementById('title').addEventListener('keydown',function(e){
|
||||
if(e.keyCode!=13) return;
|
||||
e.preventDefault();
|
||||
this.value += '';
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var testEditor;
|
||||
$(function(){
|
||||
testEditor=editormd("test-editormd",{
|
||||
placeholder:'This editor supports Markdown editing, write on the left, preview on the right',
|
||||
{#width:'1130px',#}
|
||||
height:'600px',
|
||||
syncScrolling : "single",
|
||||
path:"{{url_for('static',filename='editormd/lib/')}}",
|
||||
saveHTMLToTextarea: true,
|
||||
emoji: true,
|
||||
taskList: true,
|
||||
toolbarIcons : function() { //自定义工具栏
|
||||
return ["undo","redo","search","|","bold","del","italic","quote",
|
||||
"uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|",
|
||||
"list-ul","list-ol","hr","|","link","reference-link","image",
|
||||
"table","code","preformatted-text","code-block","datetime",
|
||||
"emoji","pagebreak","|","clear","watch","preview"]
|
||||
},
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{%endblock%}
|
||||
|
||||
|
||||
|
||||
|
||||
{% block page_content %}
|
||||
|
||||
|
||||
<div>
|
||||
{% if current_user.can(Permission.WRITE) %}
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
|
||||
{{form.hidden_tag()}}
|
||||
|
||||
<div id="test-editormd" class="form-control col-md-12" style="width: 100%">
|
||||
{{form.body(class="form-control",style="display:none;",id="ts")}}
|
||||
</div>
|
||||
|
||||
<div style="text-align: right;margin-bottom: 20px" >
|
||||
<div class="checkbox" style="display: inline-block;">
|
||||
<label>
|
||||
<input name="anonymous" type="checkbox"> anonymous
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 120px;margin-left: 20px">submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue